--Guardian-Caller Champion function c249000658.initial_effect(c) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(5818294,0)) e2:SetCategory(CATEGORY_DISABLE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,249000658) e2:SetCondition(c249000658.negcon) e2:SetCost(c249000658.negcost) e2:SetTarget(c249000658.negtg) e2:SetOperation(c249000658.negop) c:RegisterEffect(e2) --draw local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(4334811,1)) e3:SetCategory(CATEGORY_DRAW) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,249000658) e3:SetCondition(c249000658.drcon) e3:SetCost(c249000658.drcost) e3:SetOperation(c249000658.drop) c:RegisterEffect(e3) end function c249000658.tfilter(c,tp) return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and (c:IsSetCard(0x3052) or c:IsSetCard(0x5052)) end function c249000658.confilter(c) return c:IsSetCard(0x5052) and not c:IsCode(249000658) end function c249000658.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(c249000658.tfilter,1,nil,tp) and Duel.IsChainDisablable(ev) and Duel.IsExistingMatchingCard(c249000658.confilter,tp,LOCATION_GRAVE,0,1,nil) end function c249000658.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c249000658.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 c249000658.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateEffect(ev) end function c249000658.cfilter(c) return c:IsFaceup() and c:IsSetCard(0x5052) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and not c:IsCode(249000658) end function c249000658.drcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c249000658.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end function c249000658.drcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) end function c249000658.drop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.Draw(tp,1,REASON_EFFECT) if ct==0 then return end local dc=Duel.GetOperatedGroup():GetFirst() if dc:IsSetCard(0x5052) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(69584564,0)) then Duel.BreakEffect() Duel.ConfirmCards(1-tp,dc) Duel.Draw(tp,1,REASON_EFFECT) Duel.ShuffleHand(tp) end end