--Golden Skies Armatus - Necromantic Mail --Scripted by Yuno local cid,id=GetID() function cid.initial_effect(c) c:EnableReviveLimit() --Fusion Materials aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x528),cid.mfilter,true) --Send a "Golden Skies Treasure" to GY when Fusion Summoned local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOGRAVE) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1, id) e1:SetCondition(cid.tgcon) e1:SetTarget(cid.tgtg) e1:SetOperation(cid.tgop) c:RegisterEffect(e1) --Shuffle a "Golden Skies Treasure" to deck and Special Summon 3 "Golden Skies" monsters local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1, id+100) e2:SetCost(cid.spcost) e2:SetTarget(cid.sptg) e2:SetOperation(cid.spop) c:RegisterEffect(e2) end --Fusion Materials filter function cid.mfilter(c) return c:IsType(TYPE_MONSTER) and (c:IsLevelBelow(4) or c:IsRankBelow(4)) end --Send a "Golden Skies Treasure" to GY when Fusion Summoned function cid.tgcon(e, tp, eg, ep, ev, re, r, rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) end function cid.tgfilter(c) return c:IsCode(CARD_GOLDEN_SKIES_TREASURE) and c:IsAbleToGrave() end function cid.tgtg(e, tp, eg, ep, ev, re, r, rp, chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.tgfilter, tp, LOCATION_DECK, 0, 1, nil) end Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK) end function cid.tgop(e, tp, eg, ep, ev, re, r, rp) Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp, cid.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil) if g:GetCount()>0 then Duel.SendtoGrave(g, REASON_EFFECT) end end --Shuffle a "Golden Skies Treasure" to deck and Special Summon 3 "Golden Skies" monsters function cid.costfilter(c) return c:IsCode(CARD_GOLDEN_SKIES_TREASURE) and c:IsAbleToDeckAsCost() end function cid.spcost(e, tp, eg, ep, ev, re, r, rp, chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.costfilter, tp, LOCATION_HAND+LOCATION_GRAVE, 0, 1, nil) end Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp, cid.costfilter, tp, LOCATION_HAND+LOCATION_GRAVE, 0, 1, 1, nil) Duel.SendtoDeck(g, nil, 1, REASON_COST) end function cid.spfilter(c,e,tp) return c:IsSetCard(0x528) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cid.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cid.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end local ft=3 if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end ft=math.min(ft,(Duel.GetLocationCount(tp,LOCATION_MZONE))) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,cid.spfilter,tp,LOCATION_GRAVE,0,1,ft,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) if g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if g:GetCount()>ft then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) g=g:Select(tp,ft,ft,nil) end local tc=g:GetFirst() while tc do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_ATTACK) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e1:SetValue(1) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) tc=g:GetNext() end Duel.SpecialSummonComplete() end