diff --git a/c26236560.lua b/c26236560.lua index 81723e4282..36c282c47b 100644 --- a/c26236560.lua +++ b/c26236560.lua @@ -1,45 +1,46 @@ --破械童子アルハ -function c26236560.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(26236560,0)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_HAND) - e1:SetCountLimit(1,26236560) - e1:SetTarget(c26236560.destg) - e1:SetOperation(c26236560.desop) + e1:SetCountLimit(1,id) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(26236560,1)) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) - e2:SetCountLimit(1,26236561) - e2:SetCondition(c26236560.spcon) - e2:SetTarget(c26236560.sptg) - e2:SetOperation(c26236560.spop) + e2:SetCountLimit(1,id+o) + e2:SetCondition(s.spcon) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) c:RegisterEffect(e2) end -function c26236560.desfilter(c,tp) +function s.desfilter(c,tp) return Duel.GetMZoneCount(tp,c)>0 end -function c26236560.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c26236560.desfilter(chkc,tp) end +function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.desfilter(chkc,tp) end if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.IsExistingTarget(c26236560.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end + and Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,c26236560.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) + local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end -function c26236560.desop(e,tp,eg,ep,ev,re,r,rp) +function s.desop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then + if tc:IsRelateToChain() and tc:IsOnField() and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToChain() then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end local e1=Effect.CreateEffect(c) @@ -47,29 +48,29 @@ function c26236560.desop(e,tp,eg,ep,ev,re,r,rp) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(c26236560.splimit) + e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end -function c26236560.splimit(e,c) +function s.splimit(e,c) return not c:IsRace(RACE_FIEND) end -function c26236560.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_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(26236560))) and c:IsPreviousLocation(LOCATION_ONFIELD) + return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(id))) and c:IsPreviousLocation(LOCATION_ONFIELD) end -function c26236560.spfilter(c,e,tp) - return c:IsSetCard(0x130) and not c:IsCode(26236560) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +function s.spfilter(c,e,tp) + return c:IsSetCard(0x130) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function c26236560.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.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(c26236560.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) end -function c26236560.spop(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,c26236560.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,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/c29479265.lua b/c29479265.lua index 74bf70f18f..f8cdab1ffb 100644 --- a/c29479265.lua +++ b/c29479265.lua @@ -1,65 +1,66 @@ --破械雙王神ライゴウ -function c29479265.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --link summon - aux.AddLinkProcedure(c,nil,2,nil,c29479265.lcheck) + aux.AddLinkProcedure(c,nil,2,nil,s.lcheck) c:EnableReviveLimit() --destroy local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(29479265,0)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,29479265) - e1:SetCondition(c29479265.descon1) - e1:SetTarget(c29479265.destg) - e1:SetOperation(c29479265.desop) + e1:SetCountLimit(1,id) + e1:SetCondition(s.descon1) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(29479265,1)) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetRange(LOCATION_MZONE) - e2:SetCountLimit(1,29479266) - e2:SetTarget(c29479265.destg) - e2:SetOperation(c29479265.desop) + e2:SetCountLimit(1,id+o) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(29479265,2)) + e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_MZONE) - e3:SetCountLimit(1,29479267) - e3:SetTarget(c29479265.destg) - e3:SetOperation(c29479265.desop) + e3:SetCountLimit(1,id+o*2) + e3:SetTarget(s.destg) + e3:SetOperation(s.desop) c:RegisterEffect(e3) end -function c29479265.lcheck(g) +function s.lcheck(g) return g:IsExists(Card.IsLinkType,1,nil,TYPE_LINK) end -function c29479265.cfilter(c) +function s.cfilter(c) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT) end -function c29479265.descon1(e,tp,eg,ep,ev,re,r,rp) - return (re==nil or not re:GetHandler():IsCode(29479265)) and eg:IsExists(c29479265.cfilter,1,nil) +function s.descon1(e,tp,eg,ep,ev,re,r,rp) + return (re==nil or not re:GetHandler():IsCode(id)) and eg:IsExists(s.cfilter,1,nil) end -function c29479265.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() end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end -function c29479265.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 + if tc:IsRelateToChain() and tc:IsOnField() then Duel.Destroy(tc,REASON_EFFECT) end end diff --git a/c41165831.lua b/c41165831.lua index f3f99e1dd9..2d416156df 100644 --- a/c41165831.lua +++ b/c41165831.lua @@ -1,5 +1,6 @@ --破械神シャバラ -function c41165831.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --special summon local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) @@ -8,66 +9,66 @@ function c41165831.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END) - e1:SetCountLimit(1,41165831) - e1:SetCondition(c41165831.spdcon) - e1:SetTarget(c41165831.spdtg) - e1:SetOperation(c41165831.spdop) + e1:SetCountLimit(1,id) + e1:SetCondition(s.spdcon) + e1:SetTarget(s.spdtg) + e1:SetOperation(s.spdop) c:RegisterEffect(e1) --set local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_TO_GRAVE) - e2:SetCountLimit(1,41165832) - e2:SetTarget(c41165831.settg) - e2:SetOperation(c41165831.setop) + e2:SetCountLimit(1,id+o) + e2:SetTarget(s.settg) + e2:SetOperation(s.setop) c:RegisterEffect(e2) end -function c41165831.spdcon(e,tp,eg,ep,ev,re,r,rp) +function s.spdcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 end -function c41165831.desfilter(c,tp) +function s.desfilter(c,tp) return (c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsRace(RACE_FIEND) or c:IsFacedown()) and Duel.GetMZoneCount(tp,c)>0 end -function c41165831.spdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.spdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() - if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c41165831.desfilter(chkc,tp) end + if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.desfilter(chkc,tp) end if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.IsExistingTarget(c41165831.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end + and Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,c41165831.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) + local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end -function c41165831.spdop(e,tp,eg,ep,ev,re,r,rp) +function s.spdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() - if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 - and c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then + if tc:IsRelateToChain() and tc:IsOnField() and Duel.Destroy(tc,REASON_EFFECT)~=0 + and c:IsRelateToChain() and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE) e1:SetRange(LOCATION_MZONE) e1:SetAbsoluteRange(tp,1,0) - e1:SetTarget(c41165831.splimit) + e1:SetTarget(s.splimit) e1:SetReset(RESET_EVENT+RESETS_STANDARD) c:RegisterEffect(e1,true) end end -function c41165831.splimit(e,c) +function s.splimit(e,c) return not c:IsRace(RACE_FIEND) end -function c41165831.setfilter(c) +function s.setfilter(c) return c:IsSetCard(0x130) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() end -function c41165831.settg(e,tp,eg,ep,ev,re,r,rp,chk) - if chk==0 then return Duel.IsExistingMatchingCard(c41165831.setfilter,tp,LOCATION_DECK,0,1,nil) end +function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end end -function c41165831.setop(e,tp,eg,ep,ev,re,r,rp) +function s.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) - local g=Duel.SelectMatchingCard(tp,c41165831.setfilter,tp,LOCATION_DECK,0,1,1,nil) + local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SSet(tp,g) end diff --git a/c5318639.lua b/c5318639.lua index d80b92e591..0d0eb44ad2 100644 --- a/c5318639.lua +++ b/c5318639.lua @@ -1,5 +1,6 @@ --サイクロン -function c5318639.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) @@ -7,23 +8,23 @@ function c5318639.initial_effect(c) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) - e1:SetTarget(c5318639.target) - e1:SetOperation(c5318639.activate) + e1:SetTarget(s.target) + e1:SetOperation(s.activate) c:RegisterEffect(e1) end -function c5318639.filter(c) +function s.filter(c) return c:IsType(TYPE_SPELL+TYPE_TRAP) end -function c5318639.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) - if chkc then return chkc:IsOnField() and c5318639.filter(chkc) and chkc~=e:GetHandler() end - if chk==0 then return Duel.IsExistingTarget(c5318639.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsOnField() and s.filter(chkc) and chkc~=e:GetHandler() end + if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,c5318639.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) + local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end -function c5318639.activate(e,tp,eg,ep,ev,re,r,rp) +function s.activate(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 diff --git a/c53417695.lua b/c53417695.lua index 3727319813..f9953c330f 100644 --- a/c53417695.lua +++ b/c53417695.lua @@ -1,67 +1,68 @@ --破械唱導 -function c53417695.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(53417695,0)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) - e1:SetCountLimit(1,53417695) - e1:SetTarget(c53417695.target) - e1:SetOperation(c53417695.activate) + e1:SetCountLimit(1,id) + e1:SetTarget(s.target) + e1:SetOperation(s.activate) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(53417695,1)) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) - e2:SetCountLimit(1,53417696) - e2:SetCondition(c53417695.spcon) - e2:SetTarget(c53417695.sptg) - e2:SetOperation(c53417695.spop) + e2:SetCountLimit(1,id+o) + e2:SetCondition(s.spcon) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) c:RegisterEffect(e2) end -function c53417695.desfilter(c,tp,ec) +function s.desfilter(c,tp,ec) return c:IsFaceup() and c:IsSetCard(0x130) and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,Group.FromCards(c,ec)) end -function c53417695.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return false end - if chk==0 then return Duel.IsExistingTarget(c53417695.desfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) end + if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g1=Duel.SelectTarget(tp,c53417695.desfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c) + local g1=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g2=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,Group.FromCards(g1:GetFirst(),c)) g1:Merge(g2) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0) end -function c53417695.activate(e,tp,eg,ep,ev,re,r,rp) - local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) +function s.activate(e,tp,eg,ep,ev,re,r,rp) + local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(aux.AND(Card.IsRelateToChain,Card.IsOnField),nil,e) if g:GetCount()==2 then Duel.Destroy(g,REASON_EFFECT) end end -function c53417695.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_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) end -function c53417695.spfilter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(0x130) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function c53417695.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.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(c53417695.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end -function c53417695.spop(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,c53417695.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,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/c53624265.lua b/c53624265.lua index 0742db9a72..8ef1b447e4 100644 --- a/c53624265.lua +++ b/c53624265.lua @@ -1,40 +1,41 @@ --破械童子ラキア -function c53624265.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(53624265,0)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,53624265) - e1:SetTarget(c53624265.destg) - e1:SetOperation(c53624265.desop) + e1:SetCountLimit(1,id) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(53624265,1)) + e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_DESTROYED) - e2:SetCountLimit(1,53624266) - e2:SetCondition(c53624265.spcon) - e2:SetTarget(c53624265.sptg) - e2:SetOperation(c53624265.spop) + e2:SetCountLimit(1,id+o) + e2:SetCondition(s.spcon) + e2:SetTarget(s.sptg) + e2:SetOperation(s.spop) c:RegisterEffect(e2) end -function c53624265.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(tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end -function c53624265.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 + if tc:IsRelateToChain() and tc:IsOnField() then Duel.Destroy(tc,REASON_EFFECT) end local e1=Effect.CreateEffect(e:GetHandler()) @@ -42,29 +43,29 @@ function c53624265.desop(e,tp,eg,ep,ev,re,r,rp) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) - e1:SetTarget(c53624265.splimit) + e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end -function c53624265.splimit(e,c) +function s.splimit(e,c) return not c:IsRace(RACE_FIEND) end -function c53624265.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_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(53624265))) and c:IsPreviousLocation(LOCATION_ONFIELD) + return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(id))) and c:IsPreviousLocation(LOCATION_ONFIELD) end -function c53624265.spfilter(c,e,tp) - return c:IsSetCard(0x130) and not c:IsCode(53624265) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) +function s.spfilter(c,e,tp) + return c:IsSetCard(0x130) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function c53624265.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.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(c53624265.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) end -function c53624265.spop(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,c53624265.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_DECK,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/c54807656.lua b/c54807656.lua index 3343b7a21e..d1034537bc 100644 --- a/c54807656.lua +++ b/c54807656.lua @@ -1,5 +1,6 @@ --破械神の慟哭 -function c54807656.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) @@ -7,65 +8,65 @@ function c54807656.initial_effect(c) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) - e2:SetDescription(aux.Stringid(54807656,0)) + e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_SZONE) - e2:SetCountLimit(1,54807656) - e2:SetCondition(c54807656.descon) - e2:SetTarget(c54807656.destg) - e2:SetOperation(c54807656.desop) + e2:SetCountLimit(1,id) + e2:SetCondition(s.descon) + e2:SetTarget(s.destg) + e2:SetOperation(s.desop) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) - e3:SetDescription(aux.Stringid(54807656,1)) + e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) - e3:SetCountLimit(1,54807657) - e3:SetCondition(c54807656.spcon) - e3:SetTarget(c54807656.sptg) - e3:SetOperation(c54807656.spop) + e3:SetCountLimit(1,id+o) + e3:SetCondition(s.spcon) + e3:SetTarget(s.sptg) + e3:SetOperation(s.spop) c:RegisterEffect(e3) end -function c54807656.cfilter(c,tp) +function s.cfilter(c,tp) return c:IsFaceup() and c:IsSetCard(0x130) and c:IsSummonType(SUMMON_TYPE_LINK) and c:IsSummonPlayer(tp) end -function c54807656.descon(e,tp,eg,ep,ev,re,r,rp) - return eg:IsExists(c54807656.cfilter,1,nil,tp) +function s.descon(e,tp,eg,ep,ev,re,r,rp) + return eg:IsExists(s.cfilter,1,nil,tp) end -function c54807656.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() end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end -function c54807656.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 + if tc:IsRelateToChain() and tc:IsOnField() then Duel.Destroy(tc,REASON_EFFECT) end end -function c54807656.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_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) end -function c54807656.spfilter(c,e,tp) +function s.spfilter(c,e,tp) return c:IsSetCard(0x130) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end -function c54807656.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.GetLocationCount(tp,LOCATION_MZONE)>0 - and Duel.IsExistingMatchingCard(c54807656.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end + and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end -function c54807656.spop(e,tp,eg,ep,ev,re,r,rp) +function s.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) - local g=Duel.SelectMatchingCard(tp,c54807656.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) + local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,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/c88554436.lua b/c88554436.lua index ed2b59319e..65e4db5b06 100644 --- a/c88554436.lua +++ b/c88554436.lua @@ -1,15 +1,16 @@ --破械神シュヤーマ -function c88554436.initial_effect(c) +local s,id,o=GetID() +function s.initial_effect(c) --destroy local e1=Effect.CreateEffect(c) - e1:SetDescription(aux.Stringid(88554436,0)) + e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_DESTROY) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_MZONE) - e1:SetCountLimit(1,88554436) - e1:SetTarget(c88554436.destg) - e1:SetOperation(c88554436.desop) + e1:SetCountLimit(1,id) + e1:SetTarget(s.destg) + e1:SetOperation(s.desop) c:RegisterEffect(e1) --special summon local e2=Effect.CreateEffect(c) @@ -17,23 +18,23 @@ function c88554436.initial_effect(c) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_GRAVE) - e2:SetCountLimit(1,88554437) - e2:SetTarget(c88554436.spdtg) - e2:SetOperation(c88554436.spdop) + e2:SetCountLimit(1,id+o) + e2:SetTarget(s.spdtg) + e2:SetOperation(s.spdop) c:RegisterEffect(e2) end -function c88554436.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(tp) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end -function c88554436.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) and Duel.Destroy(tc,REASON_EFFECT)>0 then + if tc:IsRelateToChain() and tc:IsOnField() and Duel.Destroy(tc,REASON_EFFECT)>0 then local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tc,TYPE_SPELL+TYPE_TRAP) - if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(88554436,1)) then + if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=g:Select(tp,1,1,nil) @@ -42,21 +43,21 @@ function c88554436.desop(e,tp,eg,ep,ev,re,r,rp) end end end -function c88554436.desfilter(c,tp) +function s.desfilter(c,tp) return (c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsRace(RACE_FIEND) or c:IsFacedown()) and Duel.GetMZoneCount(tp,c)>0 end -function c88554436.spdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) +function s.spdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() - if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c88554436.desfilter(chkc,tp) end + if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.desfilter(chkc,tp) end if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) - and Duel.IsExistingTarget(c88554436.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end + and Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) - local g=Duel.SelectTarget(tp,c88554436.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) + local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end -function c88554436.spdop(e,tp,eg,ep,ev,re,r,rp) +function s.spdop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0