--Arcarum Extra - IL MONDO OLTRE I CIELI --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) c:EnableReviveLimit() --custom link summon local link=Effect.CreateEffect(c) link:SetDescription(1166) link:SetType(EFFECT_TYPE_FIELD) link:SetCode(EFFECT_SPSUMMON_PROC) link:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) link:SetRange(LOCATION_EXTRA) link:SetCondition(aux.LinkCondition(cid.matfilter,5,5,cid.lcheck)) link:SetTarget(aux.LinkTarget(cid.matfilter,5,5,cid.lcheck)) link:SetOperation(cid.LinkOperation(cid.matfilter,5,5,cid.lcheck)) link:SetValue(SUMMON_TYPE_LINK) c:RegisterEffect(link) --spsummon condition local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_SPSUMMON_CONDITION) e0:SetValue(aux.lnklimit) c:RegisterEffect(e0) --immune local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetValue(cid.efilter) c:RegisterEffect(e1) --negate local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e2:SetCode(EVENT_CHAINING) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(cid.negcon) e2:SetTarget(cid.negtg) e2:SetOperation(cid.negop) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_LEAVE_FIELD) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetCondition(cid.spcon) e3:SetTarget(cid.sptg) e3:SetOperation(cid.spop) c:RegisterEffect(e3) end --filters function cid.matfilter(c) return c:IsLinkSetCard(0x5477) and c:IsAbleToRemoveAsCost() end function cid.lcheck(g,lc) return g:IsExists(Card.IsLinkCode,1,nil,id-1) end function cid.spfilter(c,e,tp) return c:IsSetCard(0x5477) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end --custom link summon function cid.LinkOperation(f,min,max,gf) return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg) local g=e:GetLabelObject() c:SetMaterial(g) Duel.Remove(g,POS_FACEUP,REASON_MATERIAL+REASON_LINK) g:DeleteGroup() end end --immune function cid.efilter(e,te) if te:IsActiveType(TYPE_SPELL+TYPE_TRAP) then return true elseif te:IsActiveType(TYPE_MONSTER) then if te:GetOwner():GetAttack()0 and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) 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 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,ft,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end