--Oro degli Stolti Spektrale --Scripted by: XGlitchy30 local s,id = GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --gained effects local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_QUICK_F) e2:SetCode(EVENT_BATTLE_START) e2:SetCondition(s.effcon0) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_MUST_ATTACK) e4:SetTargetRange(0,LOCATION_MZONE) e4:SetTarget(s.atktg) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EFFECT_MUST_ATTACK_MONSTER) e5:SetValue(s.atklimit) c:RegisterEffect(e5) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(1) return true end function s.filter(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK) and c:GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,0x27a) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then if e:GetLabel()==0 then return false end e:SetLabel(0) return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsCanOverlay() end e:SetLabel(0) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) then c:CancelToGrave() Duel.Overlay(tc,Group.FromCards(c)) end end function s.effcon0(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() return c:IsAttribute(ATTRIBUTE_DARK) and bc and bc:IsControler(1-tp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local bc=c:GetBattleTarget() if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,tp,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local bc=c:GetBattleTarget() if bc and bc:IsRelateToBattle() and Duel.Destroy(bc,REASON_EFFECT)>0 then local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) if ft>1 and Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end if ft<2 then return end if not Duel.IsPlayerCanSpecialSummonMonster(tp,901019,0x27a,TYPES_TOKEN_MONSTER+TYPE_TUNER,0,0,2,RACE_INSECT,ATTRIBUTE_DARK,POS_FACEUP,1-tp) then return end local success=false for i=1,2 do local token=Duel.CreateToken(tp,901019) if Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP) then if not success then success=true end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(901019,0)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(1) token:RegisterEffect(e1,true) end end Duel.SpecialSummonComplete() end end function s.eftg(e,c) return c:GetOverlayGroup():IsContains(c) and c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_DARK) end function s.atktg(e,c) return c:IsSummonLocation(LOCATION_EXTRA) end function s.atklimit(e,c) return c==e:GetHandler() end