--Arcane-Caster Assailant function c249001068.initial_effect(c) --spsummon proc local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c249001068.spcon) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(502) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCountLimit(1) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCost(c249001068.cost) e2:SetTarget(c249001068.target) e2:SetOperation(c249001068.operation) c:RegisterEffect(e2) end function c249001068.spcon(e,c) if c==nil then return true end return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function c249001068.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end local rt=Duel.GetTargetCount(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil) if rt>2 then rt=2 end local ct=Duel.DiscardHand(tp,nil,1,rt,REASON_DISCARD+REASON_COST) e:SetLabel(ct) end function c249001068.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsLocation(LOCATION_MZONE) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end local ct=e:GetLabel() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,ct,ct,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,ct,0,0) end function c249001068.operation(e,tp,eg,ep,ev,re,r,rp,chk) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local rg=tg:Filter(Card.IsRelateToEffect,nil,e) if rg:GetCount()>0 then Duel.Destroy(rg,REASON_EFFECT) end end