--Steinitz's Oblivion --Script by XGlitchy30 function c25386877.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,25386877) e1:SetTarget(c25386877.target) e1:SetOperation(c25386877.activate) c:RegisterEffect(e1) --spsummon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(25386877,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,21386877) e2:SetCost(c25386877.spcost) e2:SetTarget(c25386877.sptg) e2:SetOperation(c25386877.spop) c:RegisterEffect(e2) end --fusion filters function c25386877.filter1(c,e) return not c:IsImmuneToEffect(e) end function c25386877.filter2(c,e,tp,m,f,chkf) return c:IsType(TYPE_FUSION) and c:IsSetCard(0x63d0) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) end --filters function c25386877.spfilter(c,e,tp) return c:IsSetCard(0x63d0) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c25386877.scfilter(c) return c:IsSetCard(0x63d0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end --values function c25386877.spcard(e,c,sump,sumtype,sumpos,targetp,se) return se~=e:GetLabelObject() end --Activate function c25386877.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local chkf=tp local mg1=Duel.GetFusionMaterial(tp) local res=Duel.IsExistingMatchingCard(c25386877.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) if not res then local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() local mg2=fgroup(ce,e,tp) local mf=ce:GetValue() res=Duel.IsExistingMatchingCard(c25386877.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) end end return res end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c25386877.activate(e,tp,eg,ep,ev,re,r,rp) local chkf=tp local mg1=Duel.GetFusionMaterial(tp):Filter(c25386877.filter1,nil,e) local sg1=Duel.GetMatchingGroup(c25386877.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local mg2=nil local sg2=nil local ce=Duel.GetChainMaterial(tp) if ce~=nil then local fgroup=ce:GetTarget() mg2=fgroup(ce,e,tp) local mf=ce:GetValue() sg2=Duel.GetMatchingGroup(c25386877.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) end if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then local sg=sg1:Clone() if sg2 then sg:Merge(sg2) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local tg=sg:Select(tp,1,1,nil) local tc=tg:GetFirst() if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) tc:SetMaterial(mat1) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.BreakEffect() Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) else local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf) local fop=ce:GetOperation() fop(ce,e,tp,tc,mat2) end tc:CompleteProcedure() end end --spsummon function c25386877.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) and Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,nil) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Destroy(g,REASON_COST) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetTarget(c25386877.spcard) e1:SetLabelObject(e) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_BP) Duel.RegisterEffect(e2,tp) end function c25386877.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then local g=Duel.GetMatchingGroup(c25386877.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and g:GetClassCount(Card.GetCode)>=3 and Duel.IsExistingMatchingCard(c25386877.scfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_GRAVE) end function c25386877.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local g=Duel.GetMatchingGroup(c25386877.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) if not Duel.IsExistingMatchingCard(c25386877.scfilter,tp,LOCATION_DECK,0,1,nil) then return end if not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and g:GetClassCount(Card.GetCode)>=3 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg1=g:Select(tp,1,1,nil) g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg2=g:Select(tp,1,1,nil) g:Remove(Card.IsCode,nil,sg2:GetFirst():GetCode()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg3=g:Select(tp,1,1,nil) sg1:Merge(sg2) sg1:Merge(sg3) local tc=sg1:GetFirst() while tc do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) tc=sg1:GetNext() end Duel.SpecialSummonComplete() Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local th=Duel.SelectMatchingCard(tp,c25386877.scfilter,tp,LOCATION_DECK,0,1,1,nil) if th:GetCount()>0 then Duel.SendtoHand(th,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,th) end end end