--Arcarum XXI - IL MONDO --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) c:EnableReviveLimit() c:SetUniqueOnField(1,0,id) --spsummon self local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(cid.spcon) e1:SetTarget(cid.sptg) e1:SetOperation(cid.spop) c:RegisterEffect(e1) --spsummon condition local e1x=Effect.CreateEffect(c) e1x:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1x:SetType(EFFECT_TYPE_SINGLE) e1x:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e1x) --skip turn local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(cid.skipcon) e2:SetTarget(cid.skiptg) e2:SetOperation(cid.skipop) c:RegisterEffect(e2) --disable local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DISABLE) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e3:SetCountLimit(1) e3:SetCost(cid.discost) e3:SetTarget(cid.distg) e3:SetOperation(cid.disop) c:RegisterEffect(e3) --special summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,2)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_PHASE+PHASE_STANDBY) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetCondition(cid.spsumcon) e4:SetTarget(cid.spsumtg) e4:SetOperation(cid.spsumop) c:RegisterEffect(e4) end --filters function cid.spfilter(c) return c:IsSetCard(0x5477) and c:IsType(TYPE_MONSTER) end function cid.checktribute(c,code) local code1,code2=c:GetOriginalCodeRule() return code1==code or code2==code end function cid.spsumfilter(c,e,tp) return c:IsSetCard(0x5477) and c:IsType(TYPE_MONSTER) and c:GetLevel()<=6 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end --spsummon self function cid.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local rg=Duel.GetReleaseGroup(tp):Filter(cid.spfilter,nil) return rg:CheckSubGroup(aux.mzctcheck,3,3,tp) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) local rg=Duel.GetReleaseGroup(tp):Filter(cid.spfilter,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local sg=rg:SelectSubGroup(tp,aux.mzctcheck,true,3,3,tp) if sg then sg:KeepAlive() e:SetLabelObject(sg) return true else return false end end function cid.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if Duel.Release(g,REASON_COST)~=0 then local b1,b2,b3=g:IsExists(cid.checktribute,1,nil,id-4),og:IsExists(cid.checktribute,1,nil,id-3),og:IsExists(cid.checktribute,1,nil,id-2) if b1 and b2 and b3 then e:SetValue(SUMMON_TYPE_SPECIAL+2) local e2x=Effect.CreateEffect(c) e2x:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2x:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e2x:SetCode(EVENT_SPSUMMON) e2x:SetLabelObject(e) e2x:SetCondition(cid.resetcon) e2x:SetOperation(cid.resetval) c:RegisterEffect(e2x) end end g:DeleteGroup() end function cid.resetcon(e,tp,eg,ep,ev,re,r,rp) return e:GetLabelObject():GetValue()==SUMMON_TYPE_SPECIAL+2 end function cid.resetval(e,tp,eg,ep,ev,re,r,rp) e:GetLabelObject():SetValue(SUMMON_TYPE_SPECIAL) e:Reset() end --skip turn function cid.skipcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+2 end function cid.skiptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_SKIP_TURN) end end function cid.skipop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_SKIP_TURN) e1:SetTargetRange(0,1) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN) Duel.RegisterEffect(e1,tp) end --disable function cid.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end if Duel.GetCurrentPhase()==PHASE_STANDBY and Duel.GetTurnPlayer()==tp then e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2,Duel.GetTurnCount()) else e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1,0) end end function cid.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,PLAYER_ALL,LOCATION_ONFIELD) end function cid.disop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local tc=g:GetFirst() if tc and ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) then Duel.HintSelection(g) Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetValue(RESET_TURN_SET) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) if tc:IsType(TYPE_TRAPMONSTER) then local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e3) end end end --special summon function cid.spsumcon(e,tp,eg,ep,ev,re,r,rp) local tid=e:GetHandler():GetFlagEffectLabel(id) return tid and tid~=Duel.GetTurnCount() and Duel.GetTurnPlayer()==tp end function cid.spsumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.spsumfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function cid.spsumop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.spsumfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end