--Braccialetto di Granato Spektrale --Scripted by: XGlitchy30 local s,id = GetID() function s.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsSetCard,0x27a),1) c:EnableReviveLimit() --cannot link material local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e0:SetValue(1) c:RegisterEffect(e0) --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCountLimit(1,id) e1:SetCondition(s.spcon) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --xyz mat local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_XMATERIAL) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetCondition(s.xyzcon) e4:SetValue(2400) c:RegisterEffect(e4) local e2=e4:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_XMATERIAL) e3:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e3:SetCondition(s.xyzcon) c:RegisterEffect(e3) --check summons if not s.global_check then s.global_check=true local g1=Effect.CreateEffect(c) g1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) g1:SetCode(EVENT_SUMMON_SUCCESS) g1:SetOperation(s.regop) Duel.RegisterEffect(g1,0) local g2=g1:Clone() g2:SetCode(EVENT_SPSUMMON_SUCCESS) Duel.RegisterEffect(g2,0) local g3=g1:Clone() g3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) Duel.RegisterEffect(g3,0) end Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter2) end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetOwner() for p=0,1 do if eg:IsExists(s.counterfilter,1,c,p) then Duel.RegisterFlagEffect(p,id,RESET_PHASE+PHASE_END,0,1) end end end function s.counterfilter(c,p) return not c:IsAttribute(ATTRIBUTE_DARK) and c:GetSummonPlayer()==p end function s.counterfilter2(c) return not c:IsSummonType(SUMMON_TYPE_LINK) or c:IsType(TYPE_LINK) and c:IsSetCard(0x27a) end function s.sharedcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFlagEffect(tp,id)<=0 end 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:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(1,0) e1:SetTarget(s.sumlimit) Duel.RegisterEffect(e1,tp) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_SUMMON) Duel.RegisterEffect(e2,tp) local e3=e1:Clone() e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON) Duel.RegisterEffect(e3,tp) local e4=Effect.CreateEffect(e:GetHandler()) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_OATH) e4:SetDescription(aux.Stringid(id,4)) e4:SetReset(RESET_PHASE+PHASE_END) e4:SetTargetRange(1,0) Duel.RegisterEffect(e4,tp) end function s.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) return not c:IsAttribute(ATTRIBUTE_DARK) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) end function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return s.sharedcost(e,tp,eg,ep,ev,re,r,rp,chk) and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,3)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) s.sharedcost(e,tp,eg,ep,ev,re,r,rp,chk) end function s.splimit(e,c,sump,sumtype,sumpos,targetp,se) return (sumtype&SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK and (not c:IsType(TYPE_LINK) or not c:IsSetCard(0x27a)) end function s.filter(c,e,tp) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,3,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE,0,3,3,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) for chk in aux.Next(g) do if not s.filter(chk,e,tp) then g:RemoveCard(chk) end end if g:GetCount()==0 or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)0 end