--Firewall Dragun function c249001205.initial_effect(c) c:EnableReviveLimit() aux.AddXyzProcedure(c,nil,8,2) --atkup local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCondition(c249001205.atkcon) e1:SetValue(c249001205.atkup) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e2:SetCountLimit(1,2490012052) e2:SetCondition(c249001205.spcon2) e2:SetTarget(c249001205.sptg2) e2:SetOperation(c249001205.spop2) c:RegisterEffect(e2) --to hand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(38495396,0)) e3:SetCategory(CATEGORY_TOHAND) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,2490012051) e3:SetCost(c249001205.thcost) e3:SetTarget(c249001205.thtg) e3:SetOperation(c249001205.thop) c:RegisterEffect(e3) end function c249001205.atkcon(e) local ph=Duel.GetCurrentPhase() return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()~=nil end function c249001205.atkfilter(c) return c:IsFaceup() and c:IsRace(RACE_CYBERSE) end function c249001205.atkup(e,c) return Duel.GetMatchingGroupCount(c249001205.atkfilter,c:GetControler(),LOCATION_MZONE,0,nil)*300 end function c249001205.spcon2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK) end function c249001205.spfilter2(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c249001205.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c249001205.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c249001205.spop2(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 g=Duel.SelectMatchingCard(tp,c249001205.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp) local tc=g:GetFirst() if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end function c249001205.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST) end function c249001205.thfilter(c) return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c249001205.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and c249001205.thfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c249001205.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,c249001205.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) if Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0,nil) < Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD,nil) and Duel.IsExistingTarget(c249001205.thfilter,tp,0,LOCATION_ONFIELD,1,g:GetFirst()) and Duel.SelectYesNo(tp,aux.Stringid(1347977,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g2=Duel.SelectTarget(tp,c249001205.thfilter,tp,0,LOCATION_ONFIELD,1,1,g:GetFirst()) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g2,1,0,0) end end function c249001205.thop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) end end