--Winged Goghi of Magnificent Vine function c160004412.initial_effect(c) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(160004412,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,160004412) e1:SetCost(c160004412.discost) e1:SetTarget(c160004412.sptg2) e1:SetOperation(c160004412.spop2) c:RegisterEffect(e1) --spsummon proc --local e2=Effect.CreateEffect(c) --e2:SetType(EFFECT_TYPE_FIELD) --e2:SetCode(EFFECT_SPSUMMON_PROC) --e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) --e1:SetValue(1) --e1:SetCountLimit(1,160004412) --e2:SetRange(LOCATION_HAND) --e2:SetCondition(c160004412.spcon) --e2:SetOperation(c160004412.spop) --c:RegisterEffect(e2) end function c160004412.spfilter(c) return c:IsFaceup() and c:IsType(TYPE_TRAP) or c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost() end function c160004412.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c160004412.spfilter,c:GetControler(),0,LOCATION_ONFIELD,1,nil) end function c160004412.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c160004412.spfilter,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c160004412.filter(c,e,tp) return c:IsSetCard(0x285a) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c160004412.discost(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 Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) end function c160004412.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c160004412.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c160004412.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c160004412.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c160004412.spop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+0x1fe0000) tc:RegisterEffect(e2,true) Duel.SpecialSummonComplete() end end