--goh sly rouge function c249001173.initial_effect(c) --negate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(5818294,0)) e1:SetCategory(CATEGORY_DISABLE) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_CHAINING) e1:SetRange(LOCATION_GRAVE) e1:SetCondition(c249001173.negcon) e1:SetCost(aux.bfgcost) e1:SetTarget(c249001173.negtg) e1:SetOperation(c249001173.negop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_HAND) e2:SetCondition(c249001173.spcon) c:RegisterEffect(e2) --tohand local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(75878039,0)) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCountLimit(1,249001173) e3:SetTarget(c249001173.target) e3:SetOperation(c249001173.operation) c:RegisterEffect(e3) --pos local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetCode(EVENT_PHASE+PHASE_BATTLE) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(c249001173.poscon) e4:SetOperation(c249001173.posop) c:RegisterEffect(e4) end function c249001173.tfilter(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and c:IsSetCard(0x22E) end function c249001173.negcon(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) return g and g:IsExists(c249001173.tfilter,1,nil,tp) and Duel.IsChainDisablable(ev) end function c249001173.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end function c249001173.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end function c249001173.spcon(e,c) if c==nil then return true end return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function c249001173.filter(c) return c:IsSetCard(0x22E) and c:IsAbleToHand() and c:IsType(TYPE_SPELL) end function c249001173.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249001173.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c249001173.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c249001173.filter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end function c249001173.poscon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetAttackedCount()>0 end function c249001173.posop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsAttackPos() then Duel.ChangePosition(c,POS_FACEUP_DEFENSE) end end