--Goldvale Skydancer local m=88010 local cm=_G["c"..m] function cm.initial_effect(c) c:SetSPSummonOnce(m) c:EnableReviveLimit() aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xff9),aux.FilterBoolFunction(Card.IsFusionSetCard,0xff9),true) --special summon rule local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetRange(LOCATION_EXTRA) e2:SetCondition(cm.sprcon) e2:SetOperation(cm.sprop) c:RegisterEffect(e2) --search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCondition(cm.condition) e1:SetTarget(cm.target) e1:SetOperation(cm.activate) c:RegisterEffect(e1) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(44509529,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetHintTiming(0,TIMING_BATTLE_START+TIMING_END_PHASE) e3:SetCondition(cm.spcon) e3:SetCost(cm.spcost) e3:SetTarget(cm.sptg) e3:SetOperation(cm.spop) c:RegisterEffect(e3) end function cm.matfilter(c) return (c:IsFusionSetCard(0xff9) or c:IsFusionSetCard(0xff9)) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial() and c:IsType(TYPE_MONSTER) end function cm.spfilter1(c,tp,g) return g:IsExists(cm.spfilter2,1,c,tp,c) end function cm.spfilter2(c,tp,mc) return (c:IsFusionSetCard(0xff9) and mc:IsFusionSetCard(0xff9) or c:IsFusionSetCard(0xff9) and mc:IsFusionSetCard(0xff9)) and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0 end function cm.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_HAND,0,nil) return g:IsExists(cm.spfilter1,1,nil,tp,g) end function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_HAND,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g1=g:FilterSelect(tp,cm.spfilter1,1,1,nil,tp,g) local mc=g1:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g2=g:FilterSelect(tp,cm.spfilter2,1,1,mc,tp,mc) g1:Merge(g2) c:SetMaterial(g1) Duel.Remove(g1,POS_FACEUP,REASON_COST) end function cm.cfilter(c) return c:IsFaceup() and c:IsSetCard(0xff9) end function cm.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) end function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function cm.activate(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(cm.cfilter,tp,LOCATION_MZONE,0,nil) if ct==0 then return end if ct>2 then ct=2 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,ct,nil) if g:GetCount()>0 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) end end function cm.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_REMOVED,0,2,nil) end function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToExtraAsCost() end Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_COST) end function cm.spfilter(c,e,tp) return c:IsSetCard(0xff9) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_REMOVED,2,nil,e,tp) if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g1=g:Select(tp,1,1,nil) g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g2=g:Select(tp,1,1,nil) g1:Merge(g2) Duel.SetTargetCard(g1) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0) end function cm.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=tg:Filter(Card.IsRelateToEffect,nil,e) if g:GetCount()==0 or ft<=0 or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end if ft