--Elemental HERO Spark Wingman function c249000528.initial_effect(c) --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(c249000528.spcon) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCost(c249000528.cost) e3:SetTarget(c249000528.target) e3:SetOperation(c249000528.operation) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) end function c249000528.spfilter(c) return c:IsSetCard(0x8) and c:GetCode()~=20721928 end function c249000528.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0 or Duel.IsExistingMatchingCard(c249000528.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) end function c249000528.cfilter(c) return c:IsSetCard(0x8) and c:IsDiscardable() end function c249000528.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c249000528.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,c249000528.cfilter,1,1,REASON_COST+REASON_DISCARD) end function c249000528.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable() end function c249000528.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and c249000528.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c249000528.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,c249000528.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c249000528.operation(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end