--Olympus, Portale Nottesfumo dell'Ascensione --Script by XGlitchy30 local s,id=GetID() function s.initial_effect(c) --Activate local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e0) --def up local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_DEFENSE) e1:SetRange(LOCATION_FZONE) e1:SetTargetRange(LOCATION_MZONE,0) e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_SYNCHRO)) e1:SetValue(500) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_FZONE) e2:HOPT() e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) --xyz with a synchro local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,3)) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_FZONE) e4:HOPT() e4:SetTarget(s.xyztg) e4:SetOperation(s.xyzop) c:RegisterEffect(e4) --replace field local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,4)) e5:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_PHASE|PHASE_END) e5:SetRange(LOCATION_FZONE) e5:HOPT() e5:SetCost(s.actcost) e5:SetTarget(s.acttg) e5:SetOperation(s.actop) c:RegisterEffect(e5) end --filters function s.confilter(c) return c:IsFaceup() and c:IsSetCard(ARCHE_NIGHTSHADE) end function s.spfilter(c,e,tp) return c:IsFaceupEx() and c:IsSetCard(ARCHE_NIGHTSHADE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.synfilter(c,e,tp) return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsSetCard(ARCHE_NIGHTSHADE) and c:IsCanOverlay() and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_GRAVE,0,1,c,e,tp,c) end function s.xyzfilter(c,e,tp,mc) return c:IsType(TYPE_XYZ) and c:IsSetCard(ARCHE_NIGHTSHADE) and mc:IsCanBeXyzMaterial(c) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.fieldfilter(c,tp) return c:IsCode(62613316) and c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true) end --special summon function s.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_MZONE,0,1,nil) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_REMOVED,0,1,nil,e,tp) end local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) local b2=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) local opt=aux.Option(tp,id,1,b1,b2) Duel.SetTargetParam(opt) local loc = opt==0 and LOCATION_DECK or LOCATION_REMOVED Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local opt=Duel.GetTargetParam() local loc = opt==0 and LOCATION_DECK or LOCATION_REMOVED local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,loc,0,1,1,nil,e,tp) if sg:GetCount()>0 then Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end --xyz with a synchro function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(s.synfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local tc=Duel.SelectTarget(tp,s.synfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst() e:SetLabelObject(tc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g2=Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_GRAVE,0,1,1,g1,e,tp,tc) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,#g2,0,0) end function s.xyzop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards() if #g~=2 then return end local syn,xyz = g:GetFirst(),g:GetNext() if e:GetLabelObject()==xyz then syn,xyz = xyz,syn end if not aux.MustMaterialCheck(syn,tp,EFFECT_MUST_BE_XMATERIAL) or syn:IsFacedown() or not syn:IsType(TYPE_SYNCHRO) or not syn:IsSetCard(ARCHE_NIGHTSHADE) or not syn:IsControler(tp) or syn:IsImmuneToEffect(e) or not xyz:IsMonster(TYPE_XYZ) or not xyz:IsSetCard(ARCHE_NIGHTSHADE) or not xyz:IsCanBeSpecialSummoned(e,0,tp,false,false) or not syn:IsCanBeXyzMaterial(xyz) then return end xyz:SetMaterial(Group.FromCards(syn)) Duel.Attach(syn,xyz) Duel.SpecialSummon(xyz,0,tp,tp,false,false,POS_FACEUP) end --replace field function s.actcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToRemoveAsCost() end Duel.Remove(c,POS_FACEUP,REASON_COST) end function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.fieldfilter,tp,LOCATION_DECK,0,1,nil,tp) end end function s.actop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,3)) local tc=Duel.SelectMatchingCard(tp,s.fieldfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst() if tc then local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) if fc then Duel.SendtoGrave(fc,REASON_RULE) Duel.BreakEffect() end Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) local te=tc:GetActivateEffect() te:UseCountLimit(tp,1,true) local tep=tc:GetControler() local cost=te:GetCost() if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain()) end end