--Wisprit Enticement local cid,id=GetID() function cid.initial_effect(c) c:SetUniqueOnField(1,0,id) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --to hand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCondition(aux.exccon) e2:SetCost(cid.thcost) e2:SetTarget(cid.thtg) e2:SetOperation(cid.thop) c:RegisterEffect(e2) --draw local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetCondition(cid.drcon) e3:SetTarget(cid.drtg) e3:SetOperation(cid.drop) c:RegisterEffect(e3) if cid.counter==nil then cid.counter=true cid[0]=0 cid[1]=0 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_PHASE_START+PHASE_DRAW) e2:SetOperation(cid.resetcount) Duel.RegisterEffect(e2,0) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_RELEASE) e3:SetOperation(cid.addcount) Duel.RegisterEffect(e3,0) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e4:SetCode(EVENT_DISCARD) e4:SetOperation(cid.addcount) Duel.RegisterEffect(e4,0) end end function cid.resetcount(e,tp,eg,ep,ev,re,r,rp) cid[0]=0 cid[1]=0 end function cid.addcount(e,tp,eg,ep,ev,re,r,rp) local tc=eg:GetFirst() while tc do local pl=tc:GetPreviousLocation() if pl==LOCATION_MZONE and tc:GetPreviousRaceOnField()==RACE_FAIRY then local p=tc:GetReasonPlayer() cid[p]=cid[p]+1 elseif pl==LOCATION_HAND and tc:IsType(TYPE_MONSTER) and tc:GetOriginalRace()==RACE_FAIRY then local p=tc:GetPreviousControler() cid[p]=cid[p]+1 end if #cid[p]>=2 then cid[p]=cid[p]-cid[p]:GetFirst() end tc=eg:GetNext() end end --filters function cid.cfilter(c) return c:IsSetCard(0x26c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() end --to hand function cid.thcost(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.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) end function cid.thop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) end end --draw function cid.drcon(e,tp,eg,ep,ev,re,r,rp) return cid[tp]>0 end function cid.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,cid[tp]) end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,cid[tp]) end function cid.drop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end Duel.Draw(tp,cid[tp],REASON_EFFECT) end