From 53f7fa3a8b83e8d441ac4059e9c04db608de562d Mon Sep 17 00:00:00 2001 From: Vury Leo Date: Sat, 13 Sep 2025 01:36:41 +0900 Subject: [PATCH 1/2] use id --- c20584712.lua | 13 ++++++------ c35699.lua | 55 ++++++++++++++++++++++++++------------------------- c41091257.lua | 31 +++++++++++++++-------------- 3 files changed, 51 insertions(+), 48 deletions(-) diff --git a/c20584712.lua b/c20584712.lua index bd9ea002f0..eceb561512 100644 --- a/c20584712.lua +++ b/c20584712.lua @@ -1,20 +1,21 @@ --SPYRAL-タフネス -function c20584712.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --change name aux.EnableChangeCode(c,41091257,LOCATION_MZONE+LOCATION_GRAVE) --destroy local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(20584712,0)) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) - e2:SetTarget(c20584712.destg) - e2:SetOperation(c20584712.desop) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) c:RegisterEffect(e2) end -function c20584712.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end @@ -23,7 +24,7 @@ function c20584712.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil) end -function c20584712.desop(e,tp,eg,ep,ev,re,r,rp) +function s.desop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end local dc=Duel.GetFirstTarget() if not dc:IsRelateToEffect(e) then return end diff --git a/c35699.lua b/c35699.lua index 29bd4a0cec..eae242ce73 100644 --- a/c35699.lua +++ b/c35699.lua @@ -1,5 +1,6 @@ --SPYRAL-ボルテックス -function c35699.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) c:EnableReviveLimit() --splimit local e0=Effect.CreateEffect(c) @@ -13,13 +14,13 @@ function c35699.initial_effect(c) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) - e1:SetCondition(c35699.sprcon) - e1:SetTarget(c35699.sprtg) - e1:SetOperation(c35699.sprop) + e1:SetCondition(s.sprcon) + e1:SetTarget(s.sprtg) + e1:SetOperation(s.sprop) c:RegisterEffect(e1) --Destroy local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(35699,0)) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) @@ -27,31 +28,31 @@ function c35699.initial_effect(c) e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) - e2:SetTarget(c35699.destg) - e2:SetOperation(c35699.desop) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) c:RegisterEffect(e2) --destroy and summon local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(35699,1)) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_TO_GRAVE) - e3:SetCondition(c35699.spcon) - e3:SetTarget(c35699.sptg) - e3:SetOperation(c35699.spop) + e3:SetCondition(s.spcon) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) c:RegisterEffect(e3) end -function c35699.sprfilter(c) +function s.sprfilter(c) return c:IsSetCard(0xee) and c:IsAbleToRemoveAsCost() end -function c35699.sprcon(e,c) +function s.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(c35699.sprfilter,tp,LOCATION_GRAVE,0,3,nil) + and Duel.IsExistingMatchingCard(s.sprfilter,tp,LOCATION_GRAVE,0,3,nil) end -function c35699.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c) - local g=Duel.GetMatchingGroup(c35699.sprfilter,tp,LOCATION_GRAVE,0,nil) +function s.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c) + local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_GRAVE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg=g:CancelableSelect(tp,3,3,nil) if sg then @@ -60,51 +61,51 @@ function c35699.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c) return true else return false end end -function c35699.sprop(e,tp,eg,ep,ev,re,r,rp,c) +function s.sprop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON) g:DeleteGroup() end -function c35699.desfilter(c) +function s.desfilter(c) return c:IsFaceup() and c:IsSetCard(0xee) end -function c35699.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end - if chk==0 then return Duel.IsExistingTarget(c35699.desfilter,tp,LOCATION_ONFIELD,0,1,nil) + if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g1=Duel.SelectTarget(tp,c35699.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil) + local g1=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g2=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,2,nil) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0) end -function c35699.desop(e,tp,eg,ep,ev,re,r,rp) +function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tg=g:Filter(Card.IsRelateToEffect,nil,e) if tg:GetCount()>0 then Duel.Destroy(tg,REASON_EFFECT) end end -function c35699.spcon(e,tp,eg,ep,ev,re,r,rp) +function s.spcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) end -function c35699.spfilter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsCode(41091257) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function c35699.sptg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) end -function c35699.spop(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) local dg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0) if dg:GetCount()>0 and Duel.Destroy(dg,REASON_EFFECT)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c35699.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end diff --git a/c41091257.lua b/c41091257.lua index 9366577a63..4113b6d333 100644 --- a/c41091257.lua +++ b/c41091257.lua @@ -1,29 +1,30 @@ --SPYRAL-ダンディ -function c41091257.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(41091257,0)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) - e1:SetCountLimit(1,41091257) - e1:SetTarget(c41091257.sptg) - e1:SetOperation(c41091257.spop) + e1:SetCountLimit(1,id) + e1:SetTarget(s.sptg) + e1:SetOperation(s.spop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(41091257,1)) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS) - e2:SetCountLimit(1,41091258) - e2:SetCondition(c41091257.descon) - e2:SetTarget(c41091257.destg) - e2:SetOperation(c41091257.desop) + e2:SetCountLimit(1,id+o) + e2:SetCondition(s.descon) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) c:RegisterEffect(e2) end -function c41091257.sptg(e,tp,eg,ep,ev,re,r,rp,chk) +function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end @@ -31,7 +32,7 @@ function c41091257.sptg(e,tp,eg,ep,ev,re,r,rp,chk) e:SetLabel(Duel.AnnounceType(tp)) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end -function c41091257.spop(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end Duel.ConfirmDecktop(1-tp,1) @@ -43,17 +44,17 @@ function c41091257.spop(e,tp,eg,ep,ev,re,r,rp) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end -function c41091257.descon(e,tp,eg,ep,ev,re,r,rp) +function s.descon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSpecialSummonSetCard(0xee) end -function c41091257.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end -function c41091257.desop(e,tp,eg,ep,ev,re,r,rp) +function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) From a3e89cd2cb06ce73d7cb8485ea1bb676fc691092 Mon Sep 17 00:00:00 2001 From: Vury Leo Date: Sat, 13 Sep 2025 01:37:57 +0900 Subject: [PATCH 2/2] fix --- c20584712.lua | 2 +- c35699.lua | 2 +- c41091257.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/c20584712.lua b/c20584712.lua index eceb561512..563509ba75 100644 --- a/c20584712.lua +++ b/c20584712.lua @@ -27,7 +27,7 @@ end function s.desop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end local dc=Duel.GetFirstTarget() - if not dc:IsRelateToEffect(e) then return end + if not (dc:IsRelateToChain() and dc:IsOnField()) then return end Duel.ConfirmDecktop(1-tp,1) local g=Duel.GetDecktopGroup(1-tp,1) local tc=g:GetFirst() diff --git a/c35699.lua b/c35699.lua index eae242ce73..cef1da1a1c 100644 --- a/c35699.lua +++ b/c35699.lua @@ -82,7 +82,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) - local tg=g:Filter(Card.IsRelateToEffect,nil,e) + local tg=g:Filter(aux.AND(Card.IsRelateToChain,Card.IsOnField),nil,e) if tg:GetCount()>0 then Duel.Destroy(tg,REASON_EFFECT) end diff --git a/c41091257.lua b/c41091257.lua index 4113b6d333..18e6a292df 100644 --- a/c41091257.lua +++ b/c41091257.lua @@ -56,7 +56,7 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) then + if tc:IsRelateToChain() and tc:IsOnField() then Duel.Destroy(tc,REASON_EFFECT) end end