Skip to content

Commit a3b539b

Browse files
committed
Script updates
- updated some cards to replace card IDs with their corresponding card constants
1 parent 8ff6744 commit a3b539b

File tree

8 files changed

+50
-50
lines changed

8 files changed

+50
-50
lines changed

official/c19974580.lua

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
--C・ドラゴン
2+
--Iron Chain Dragon
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
--synchro summon
5-
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
65
c:EnableReviveLimit()
7-
--atkup
6+
--Synchro Summon procedure: 1 Tuner + 1 or more non-Tuner monsters
7+
Synchro.AddProcedure(c,nil,1,1,Synchro.NonTuner(nil),1,99)
8+
--Gains 200 ATK for each "Iron Chain" monster banished
89
local e1=Effect.CreateEffect(c)
9-
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
1010
e1:SetDescription(aux.Stringid(id,0))
11+
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
1112
e1:SetType(EFFECT_TYPE_IGNITION)
1213
e1:SetHintTiming(TIMING_DAMAGE_STEP)
1314
e1:SetRange(LOCATION_MZONE)
1415
e1:SetTarget(s.attg)
1516
e1:SetOperation(s.atop)
1617
c:RegisterEffect(e1)
17-
--discard deck
18+
--Send the top 3 cards of your opponent's Deck to the GY
1819
local e2=Effect.CreateEffect(c)
1920
e2:SetDescription(aux.Stringid(id,1))
2021
e2:SetCategory(CATEGORY_DECKDES)
@@ -25,13 +26,13 @@ function s.initial_effect(c)
2526
e2:SetOperation(s.ddop)
2627
c:RegisterEffect(e2)
2728
end
28-
s.listed_series={0x25}
29+
s.listed_series={SET_IRON_CHAIN}
2930
function s.rfilter(c)
30-
return c:IsSetCard(0x25) and c:IsMonster() and c:IsAbleToRemove() and aux.SpElimFilter(c,true)
31+
return c:IsSetCard(SET_IRON_CHAIN) and c:IsMonster() and c:IsAbleToRemove() and aux.SpElimFilter(c,true)
3132
end
3233
function s.attg(e,tp,eg,ep,ev,re,r,rp,chk)
3334
if chk==0 then return Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
34-
if Duel.IsPlayerAffectedByEffect(tp,69832741) then
35+
if Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then
3536
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_MZONE)
3637
else
3738
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
@@ -47,7 +48,7 @@ function s.atop(e,tp,eg,ep,ev,re,r,rp)
4748
e1:SetType(EFFECT_TYPE_SINGLE)
4849
e1:SetCode(EFFECT_UPDATE_ATTACK)
4950
e1:SetValue(ct*200)
50-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
51+
e1:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
5152
c:RegisterEffect(e1)
5253
end
5354
end
@@ -60,4 +61,4 @@ function s.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
6061
end
6162
function s.ddop(e,tp,eg,ep,ev,re,r,rp)
6263
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)
63-
end
64+
end

official/c21011044.lua

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,32 @@ function s.initial_effect(c)
99
e1:SetCode(EVENT_FREE_CHAIN)
1010
e1:SetHintTiming(0,TIMING_MAIN_END)
1111
c:RegisterEffect(e1)
12-
--fusion
13-
local e2=Fusion.CreateSummonEff({handler=c,fusfilter=aux.FilterBoolFunction(Card.IsSetCard,0x9d),matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove),
12+
--Fusion Summon 1 "Shaddoll" monster
13+
local e2=Fusion.CreateSummonEff({handler=c,fusfilter=aux.FilterBoolFunction(Card.IsSetCard,SET_SHADDOLL),matfilter=Fusion.OnFieldMat(Card.IsAbleToRemove),
1414
extrafil=s.fextra,extraop=Fusion.BanishMaterial,stage2=s.sstage2,desc=aux.Stringid(id,0),extratg=s.extratarget})
1515
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TOGRAVE)
1616
e2:SetType(EFFECT_TYPE_QUICK_O)
1717
e2:SetHintTiming(0,TIMING_MAIN_END)
1818
e2:SetCountLimit(1,id)
19-
e2:SetCondition(s.spcon)
19+
e2:SetCondition(function() return Duel.IsMainPhase() end)
2020
e2:SetRange(LOCATION_SZONE)
2121
c:RegisterEffect(e2)
2222
end
23-
s.listed_series={0x9d}
24-
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
25-
return Duel.IsMainPhase()
26-
end
23+
s.listed_series={SET_SHADDOLL}
2724
function s.fextra(e,tp,mg)
28-
if not Duel.IsPlayerAffectedByEffect(tp,69832741) then
25+
if not Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) then
2926
return Duel.GetMatchingGroup(Fusion.IsMonsterFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,nil)
3027
end
3128
end
3229
function s.sstage2(e,tc,tp,sg,chk)
3330
if chk==1 then
31+
--It cannot attack directly
3432
local e1=Effect.CreateEffect(e:GetHandler())
35-
e1:SetType(EFFECT_TYPE_SINGLE)
3633
e1:SetDescription(aux.Stringid(id,2))
34+
e1:SetType(EFFECT_TYPE_SINGLE)
3735
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
3836
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
39-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
37+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
4038
tc:RegisterEffect(e1)
4139
local att=tc:GetAttribute()
4240
if Duel.IsExistingMatchingCard(s.sameatt,tp,0,LOCATION_MZONE,1,nil,att) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then

official/c21082832.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ function s.initial_effect(c)
55
--Activate
66
Ritual.AddProcEqual{handler=c,filter=s.ritualfil,extrafil=s.extrafil,extratg=s.extratg}
77
end
8-
s.listed_series={0xcf,0x1048}
8+
s.listed_series={SET_CHAOS,SET_NUMBER_C}
99
s.listed_names={CARD_DARK_MAGICIAN,CARD_BLUEEYES_W_DRAGON}
1010
function s.ritualfil(c)
11-
return (c:IsSetCard(0xcf) or c:IsSetCard(0x1048)) and c:IsRitualMonster()
11+
return c:IsSetCard({SET_CHAOS,SET_NUMBER_C}) and c:IsRitualMonster()
1212
end
1313
function s.mfilter(c)
14-
return not Duel.IsPlayerAffectedByEffect(c:GetControler(),69832741) and c:HasLevel() and c:IsCode(CARD_DARK_MAGICIAN,CARD_BLUEEYES_W_DRAGON)
14+
return not Duel.IsPlayerAffectedByEffect(c:GetControler(),CARD_SPIRIT_ELIMINATION) and c:HasLevel() and c:IsCode(CARD_DARK_MAGICIAN,CARD_BLUEEYES_W_DRAGON)
1515
and c:IsMonster() and c:IsAbleToRemove()
1616
end
1717
function s.extrafil(e,tp,eg,ep,ev,re,r,rp,chk)

official/c21179143.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local s,id=GetID()
44
function s.initial_effect(c)
55
--Activate
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetCode(EVENT_FREE_CHAIN)
@@ -13,9 +14,9 @@ function s.initial_effect(c)
1314
c:RegisterEffect(e1)
1415
end
1516
s.listed_names={TOKEN_REPTILIANNE}
16-
s.listed_series={0x3c}
17+
s.listed_series={SET_REPTILIANNE}
1718
function s.cfilter(c)
18-
return c:IsSetCard(0x3c) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
19+
return c:IsSetCard(SET_REPTILIANNE) and c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c,true)
1920
end
2021
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
2122
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
@@ -25,17 +26,17 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
2526
end
2627
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2728
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>1
28-
or (Duel.IsPlayerAffectedByEffect(tp,69832741) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
29-
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_REPTILIANNE,0x3c,TYPES_TOKEN,0,0,1,RACE_REPTILE,ATTRIBUTE_EARTH) end
29+
or (Duel.IsPlayerAffectedByEffect(tp,CARD_SPIRIT_ELIMINATION) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
30+
and Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_REPTILIANNE,SET_REPTILIANNE,TYPES_TOKEN,0,0,1,RACE_REPTILE,ATTRIBUTE_EARTH) end
3031
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
3132
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,0)
3233
end
3334
function s.activate(e,tp,eg,ep,ev,re,r,rp)
3435
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) or Duel.GetLocationCount(tp,LOCATION_MZONE)<2
35-
or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_REPTILIANNE,0x3c,TYPES_TOKEN,0,0,1,RACE_REPTILE,ATTRIBUTE_EARTH) then return end
36+
or not Duel.IsPlayerCanSpecialSummonMonster(tp,TOKEN_REPTILIANNE,SET_REPTILIANNE,TYPES_TOKEN,0,0,1,RACE_REPTILE,ATTRIBUTE_EARTH) then return end
3637
for i=1,2 do
3738
local token=Duel.CreateToken(tp,TOKEN_REPTILIANNE)
3839
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
3940
end
4041
Duel.SpecialSummonComplete()
41-
end
42+
end

official/c22211622.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
--覇王門無限
22
--Supreme King Gate Infinity
3-
43
local s,id=GetID()
54
function s.initial_effect(c)
65
--Enable pendulum summon
@@ -27,7 +26,7 @@ function s.initial_effect(c)
2726
e2:SetTarget(s.rctg)
2827
e2:SetOperation(s.rcop)
2928
c:RegisterEffect(e2)
30-
--Special summon 1 dragon Xyz or pendulum monster from extra deck
29+
--Special Summon 1 Dragon Xyz or Pendulum monster from your Extra Deck
3130
local e3=Effect.CreateEffect(c)
3231
e3:SetDescription(aux.Stringid(id,1))
3332
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
@@ -49,15 +48,15 @@ function s.initial_effect(c)
4948
e4:SetOperation(s.penop)
5049
c:RegisterEffect(e4)
5150
end
52-
s.listed_names={13331639}
51+
s.listed_names={CARD_ZARC}
5352
function s.splimcon(e)
5453
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)>0
5554
end
5655
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
5756
return (sumtype&SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
5857
end
5958
function s.rccon(e,tp,eg,ep,ev,re,r,rp)
60-
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,13331639),tp,LOCATION_ONFIELD,0,1,nil)
59+
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_ZARC),tp,LOCATION_ONFIELD,0,1,nil)
6160
end
6261
function s.rcfilter(c)
6362
return c:IsFaceup() and c:GetAttack()>0
@@ -79,7 +78,8 @@ function s.desfilter(c,e,tp,mc)
7978
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,Group.FromCards(c,mc))-- and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
8079
end
8180
function s.spfilter(c,e,tp,mg)
82-
return c:IsType(TYPE_XYZ+TYPE_PENDULUM) and c:IsRace(RACE_DRAGON) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
81+
return c:IsType(TYPE_XYZ|TYPE_PENDULUM) and c:IsRace(RACE_DRAGON)
82+
and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
8383
end
8484
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
8585
local c=e:GetHandler()

official/c24566654.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
--Crimson Fire
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
--Reflect
5+
--Your opponent takes twice the effect damage you would have taken
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetType(EFFECT_TYPE_ACTIVATE)
89
e1:SetCode(EVENT_CHAINING)
910
e1:SetCondition(s.condition)
1011
e1:SetOperation(s.operation)
1112
c:RegisterEffect(e1)
1213
end
13-
s.listed_names={70902743}
14+
s.listed_names={CARD_RED_DRAGON_ARCHFIEND}
1415
function s.condition(e,tp,eg,ep,ev,re,r,rp)
15-
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,70902743),tp,LOCATION_ONFIELD,0,1,nil)
16+
return Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsCode,CARD_RED_DRAGON_ARCHFIEND),tp,LOCATION_ONFIELD,0,1,nil)
1617
and ep==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and aux.damcon1(e,tp,eg,ep,ev,re,r,rp)
1718
end
1819
function s.operation(e,tp,eg,ep,ev,re,r,rp)
@@ -47,4 +48,4 @@ function s.dammul(e,re,val,r,rp,rc)
4748
if cc==0 or (r&REASON_EFFECT)==0 then return end
4849
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
4950
return cid==e:GetLabel() and val*2 or val
50-
end
51+
end

official/c24590232.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local s,id=GetID()
44
function s.initial_effect(c)
55
--Activate
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
@@ -21,7 +22,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2122
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
2223
end
2324
function s.filter1(c,e,tp)
24-
return c:IsType(TYPE_SYNCHRO) and c:GetLevel()<9 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),69832741))
25+
return c:IsType(TYPE_SYNCHRO) and c:GetLevel()<9 and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 or Duel.IsPlayerAffectedByEffect(e:GetHandlerPlayer(),CARD_SPIRIT_ELIMINATION))
2526
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,e,tp,c)
2627
end
2728
function s.filter2(c,e,tp,sc)
@@ -58,4 +59,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
5859
Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
5960
sc:CompleteProcedure()
6061
end
61-
end
62+
end

official/c2542230.lua

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local s,id=GetID()
44
function s.initial_effect(c)
55
--Activate
66
local e1=Effect.CreateEffect(c)
7+
e1:SetDescription(aux.Stringid(id,0))
78
e1:SetCategory(CATEGORY_EQUIP)
89
e1:SetType(EFFECT_TYPE_ACTIVATE)
910
e1:SetCode(EVENT_FREE_CHAIN)
@@ -12,14 +13,14 @@ function s.initial_effect(c)
1213
e1:SetTarget(s.target)
1314
e1:SetOperation(s.activate)
1415
c:RegisterEffect(e1)
15-
--to grave
16+
--Register when it is sent to the GY
1617
local e2=Effect.CreateEffect(c)
1718
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
1819
e2:SetCode(EVENT_TO_GRAVE)
1920
e2:SetOperation(s.regop)
2021
c:RegisterEffect(e2)
2122
end
22-
s.listed_names={70902743}
23+
s.listed_names={CARD_RED_DRAGON_ARCHFIEND}
2324
function s.filter(c)
2425
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO)
2526
end
@@ -74,17 +75,14 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
7475
e1:SetRange(LOCATION_GRAVE)
7576
e1:SetHintTiming(TIMING_END_PHASE)
7677
e1:SetCountLimit(1)
77-
e1:SetCondition(s.spcon)
78+
e1:SetCondition(function() return Duel.IsPhase(PHASE_END) end)
7879
e1:SetTarget(s.sptg)
7980
e1:SetOperation(s.spop)
80-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
81+
e1:SetReset(RESETS_STANDARD_PHASE_END)
8182
c:RegisterEffect(e1)
8283
end
83-
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
84-
return Duel.GetCurrentPhase()==PHASE_END
85-
end
8684
function s.spfilter(c,e,tp)
87-
return c:IsCode(70902743) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
85+
return c:IsCode(CARD_RED_DRAGON_ARCHFIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
8886
end
8987
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
9088
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
@@ -96,7 +94,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
9694
end
9795
function s.spop(e,tp,eg,ep,ev,re,r,rp)
9896
local tc=Duel.GetFirstTarget()
99-
if tc and tc:IsRelateToEffect(e) then
97+
if tc:IsRelateToEffect(e) then
10098
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
10199
end
102-
end
100+
end

0 commit comments

Comments
 (0)