--created & coded by Lyris --ローマ・キー・XXX local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND+LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end function s.counterfilter(c) return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsSetCard(0xeeb) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,1) end function s.splimit(e,c,sump,sumtype,sumpos,targetp) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xeeb) end function s.spfilter(c,e,tp) return c:IsSetCard(0xeeb) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,true,false) end function s.chk(g,e,tp,tg) local ft=Duel.GetLocationCountFromEx(tp,tp,tg,TYPE_FUSION) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end return g:GetSum(Card.GetLevel)<=tg:GetSum(Card.GetLevel) and Duel.GetLocationCountFromEx(tp,tp,tg+e:GetHandler(),TYPE_FUSION)>#g end function s.filter(c,e,tp,mg) if (c:IsOnField() and c:IsFacedown()) or not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_FMATERIAL) or c:GetLevel()<=0 or not c:IsSetCard(0xeeb) then return false end local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp) return #sg>0 and mg:CheckSubGroup(function(tg) return sg:CheckSubGroup(s.chk,1,6,e,tp,tg) end) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local mg=Duel.GetFusionMaterial(tp)-e:GetHandler() return mg:IsExists(s.filter,1,nil,e,tp,mg) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local mg=Duel.GetFusionMaterial(tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) local mat=mg:FilterSelect(tp,s.filter,1,99,nil,e,tp,mg) if #mat==0 then return end local sg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_EXTRA,0,mat,e,tp) local ft=Duel.GetLocationCountFromEx(tp,tp,mat,TYPE_FUSION) if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=sg:SelectSubGroup(tp,function(g) return g:GetSum(Card.GetLevel)<=mat:GetSum(Card.GetLevel) end,false,1,ft) for tc in aux.Next(tg) do tc:SetMaterial(mat) end Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.BreakEffect() for nc in aux.Next(tg) do Duel.SpecialSummonStep(nc,SUMMON_TYPE_FUSION,tp,tp,true,false,POS_FACEUP) nc:CompleteProcedure() end Duel.SpecialSummonComplete() end