--created by Seth, coded by Lyris & Rawstone local cid,id=GetID() function cid.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCountLimit(1,id) e1:SetCondition(cid.hspcon) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetLabel(0) e2:SetCost(function(e) e:SetLabel(100) return true end) e2:SetTarget(cid.tg) e2:SetOperation(cid.op) c:RegisterEffect(e2) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCountLimit(1,id+200) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e4:SetTarget(cid.thtg) e4:SetOperation(cid.thop) c:RegisterEffect(e4) end function cid.hspcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,c,0x83e) end function cid.cfilter(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x83e) and c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttack()) end function cid.filter(c,e,tp,atk) return c:IsSetCard(0x83e) and c:IsAttackBelow(atk) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then if e:GetLabel()~=100 then return false end e:SetLabel(0) return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local tc=Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst() e:SetLabel(tc:GetAttack()) Duel.Remove(tc,POS_FACEUP,REASON_COST) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function cid.op(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tc=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel()):GetFirst() if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) for _,val in ipairs(Auxiliary.CannotBeEDMatCodes) do local restrict = Effect.CreateEffect(e:GetHandler()) restrict:SetType(EFFECT_TYPE_SINGLE) restrict:SetCode(val) restrict:SetValue(cid.filtor) restrict:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(restrict) end end Duel.SpecialSummonComplete() end function cid.filtor(e,c) if c==nil then return false end return not c:IsSetCard(0x83e) end function cid.thfilter(c) return c:IsType(TYPE_TUNER) and c:IsSetCard(0x83e) and c:IsAbleToHand() end function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function cid.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,cid.thfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end