--created by Seth, coded by Lyris local cid,id=GetID() function cid.initial_effect(c) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_IGNITION) e0:SetRange(LOCATION_MZONE) e0:SetCountLimit(1,id) e0:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e0:SetCost(cid.cost) e0:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x83e) end end) e0:SetOperation(cid.op) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCode(EVENT_BATTLE_DAMAGE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCondition(cid.hdcon) e1:SetTarget(cid.hdtg) e1:SetOperation(cid.hdop) c:RegisterEffect(e1) end function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLPCost(tp,1000) end Duel.PayLPCost(tp,1000) end function cid.op(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetMatchingGroup(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,nil,0x83e) for tc in aux.Next(tg) do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(500) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) end end function cid.hdcon(e,tp,eg,ep,ev,re,r,rp) return ep~=tp and e:GetHandler()==Duel.GetAttacker() and Duel.GetAttackTarget()==nil end function cid.hdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) end function cid.srfilter(c) return c:IsSetCard(0x83e) and c:IsType(TYPE_FIELD) and c:IsAbleToHand() end function cid.hdop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cid.srfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end