--Smokai FluoHebi local cid,id=GetID() function cid.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetCountLimit(1) e1:SetRange(LOCATION_MZONE) e1:SetCost(cid.cost) e1:SetTarget(cid.destg) e1:SetOperation(cid.desop) c:RegisterEffect(e1) --battle destroyed local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_DESTROYED) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCondition(cid.condition) e2:SetTarget(cid.target) e2:SetOperation(cid.operation) e2:SetLabelObject(e1) c:RegisterEffect(e2) end function cid.cfilter(c) return c:IsRace(RACE_FAIRY) and c:IsAbleToRemoveAsCost() end function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function cid.filter(c) return c:IsFaceup() and c:IsRace(RACE_FAIRY) and c:GetLevel()~=4 end function cid.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_MZONE,0,1,nil) end end function cid.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(cid.filter,tp,LOCATION_MZONE,0,nil) local tc=g:GetFirst() while tc do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetValue(4) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) tc=g:GetNext() end Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) if g:GetCount()>0 then Duel.Destroy(g,REASON_EFFECT) end end function cid.condition(e,tp,eg,ep,ev,re,r,rp) return bit.band(e:GetHandler():GetReason(),REASON_BATTLE+REASON_EFFECT)~=0 and re~=e:GetLabelObject() end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:GetControler()==tp and chkc:GetLocation()==LOCATION_GRAVE and cid.filter2(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.filter2,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,cid.filter2,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function cid.filter2(c,e,tp) return c:IsSetCard(0xa69) and not c:IsCode(id) and c:IsAbleToHand() end function cid.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsSetCard(0xa69) and not tc:IsCode(id) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end