--created & coded by Lyris, art from Shadowverse's "Spinaria, Keeper of Enigmas" --謎の管理者スフィネ local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_MONSTER_SSET) e1:SetValue(TYPE_SPELL) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_TO_GRAVE) e2:SetCondition(s.spcon) e2:SetTarget(s.sptg) e2:SetOperation(s.spop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCondition(s.descon) e3:SetOperation(s.desop) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetRange(LOCATION_HAND) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK+CATEGORY_DESTROY) e4:SetTarget(s.sptg2) e4:SetOperation(s.spop2) c:RegisterEffect(e4) local s1=Effect.CreateEffect(c) s1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) s1:SetCode(EVENT_SUMMON_SUCCESS) s1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) s1:SetOperation(function() Duel.Hint(HINT_SOUND,0,aux.Stringid(id,10)) end) c:RegisterEffect(s1) local s2=s1:Clone() s2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(s2) local s3=s1:Clone() s3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(s3) local s5=Effect.CreateEffect(c) s5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) s5:SetCode(EVENT_ATTACK_ANNOUNCE) s5:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) s5:SetOperation(function() Duel.Hint(HINT_SOUND,0,aux.Stringid(id,12)) end) c:RegisterEffect(s5) local s6=Effect.CreateEffect(c) s6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) s6:SetCode(EVENT_DESTROYED) s6:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) s6:SetOperation(function(e,tp) if not c:IsPreviousLocation(LOCATION_SZONE) or Duel.GetTurnPlayer()==tp then Duel.Hint(HINT_SOUND,0,aux.Stringid(id,13)) else Duel.Hint(HINT_SOUND,0,aux.Stringid(id,11)) end end) c:RegisterEffect(s6) end function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEDOWN) and c:IsReason(REASON_DESTROY) and Duel.GetTurnPlayer()~=tp end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end end function s.descon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end function s.ssfilter(c) return c:IsSetCard(0x97) and c:IsType(TYPE_MONSTER) and c:IsSSetable(true) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,s.ssfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SSet(tp,g:GetFirst()) end end function s.filter(c) return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP) end function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_SZONE,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEDOWN) Duel.SelectTarget(tp,s.filter,tp,LOCATION_SZONE,0,1,64,nil) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.spop2(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) if not c:IsRelateToEffect(e) or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 or #tg==0 then return end Duel.BreakEffect() if tg:IsExists(Card.IsAbleToDeck,1,nil) and Duel.SelectOption(tp,1124,1105)==1 then Duel.SendtoDeck(tg,nil,2,REASON_EFFECT) else if Duel.GetTurnPlayer()~=tp then Duel.Hint(HINT_SOUND,0,aux.Stringid(id,11)) end Duel.Destroy(tg,REASON_EFFECT) end end