Skip to content

Commit fff476a

Browse files
authored
Script updates (#1176)
- Replaced operators, reset values, hexadecimal values - Applied new cost functions and other modernization
1 parent 938cbf6 commit fff476a

File tree

11,187 files changed

+46117
-49217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,187 files changed

+46117
-49217
lines changed

card_counter_constants.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ CARD_CLEAR_WORLD = 33900648
2020
CARD_CLOCK_LIZARD = 51476410
2121
CARD_CRIMSON_DRAGON = 63436931
2222
CARD_CRYSTAL_GOD_TISTINA = 86999951
23+
CARD_CRYSTAL_TREE = 47408488
2324
CARD_CYBER_DRAGON = 70095154
2425
CARD_DARK_FUSION = 94820406
2526
CARD_DARK_MAGICIAN = 46986414

constant.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,5 +1018,6 @@ WIN_REASON_DEUCE = 0x54
10181018
WIN_REASON_DECK_MASTER = 0x56
10191019
WIN_REASON_DRAW_OF_FATE = 0x57
10201020
WIN_REASON_MUSICAL_SUMO = 0x58
1021+
WIN_REASON_SUMMER_SCHOOLWORK = 0x59
10211022
Duel.LoadScript("card_counter_constants.lua")
10221023
Duel.LoadScript("archetype_setcode_constants.lua")

official/c10000000.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--オベリスクの巨神兵
2+
--Obelisk the Tormentor
23
local s,id=GetID()
34
function s.initial_effect(c)
45
--summon with 3 tribute
@@ -51,7 +52,7 @@ function s.sumsuc(e,tp,eg,ep,ev,re,r,rp)
5152
Duel.SetChainLimitTillChainEnd(aux.FALSE)
5253
end
5354
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
54-
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
55+
return e:GetHandler():IsSpecialSummoned()
5556
end
5657
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
5758
if chk==0 then return true end
@@ -70,7 +71,7 @@ function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
7071
e1:SetType(EFFECT_TYPE_SINGLE)
7172
e1:SetProperty(EFFECT_FLAG_OATH)
7273
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
73-
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
74+
e1:SetReset(RESETS_STANDARD_PHASE_END)
7475
e:GetHandler():RegisterEffect(e1)
7576
local g=Duel.SelectReleaseGroupCost(tp,nil,2,2,false,aux.ReleaseCheckTarget,nil,dg)
7677
Duel.Release(g,REASON_COST)
@@ -83,4 +84,4 @@ end
8384
function s.desop(e,tp,eg,ep,ev,re,r,rp)
8485
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
8586
Duel.Destroy(g,REASON_EFFECT)
86-
end
87+
end

official/c10000010.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function s.initial_effect(c)
4040
e4:SetType(EFFECT_TYPE_IGNITION)
4141
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
4242
e4:SetRange(LOCATION_MZONE)
43-
e4:SetCost(s.descost)
43+
e4:SetCost(Cost.PayLP(1000))
4444
e4:SetTarget(s.destg)
4545
e4:SetOperation(s.desop)
4646
c:RegisterEffect(e4)
@@ -76,10 +76,6 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
7676
c:RegisterEffect(e2)
7777
end
7878
end
79-
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
80-
if chk==0 then return Duel.CheckLPCost(tp,1000) end
81-
Duel.PayLPCost(tp,1000)
82-
end
8379
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
8480
if chkc then return chkc:IsLocation(LOCATION_MZONE) end
8581
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end

official/c10000020.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function s.sumsuc(e,tp,eg,ep,ev,re,r,rp)
5959
Duel.SetChainLimitTillChainEnd(aux.FALSE)
6060
end
6161
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
62-
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
62+
return e:GetHandler():IsSpecialSummoned()
6363
end
6464
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
6565
if chk==0 then return true end
@@ -95,11 +95,11 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
9595
e1:SetType(EFFECT_TYPE_SINGLE)
9696
e1:SetCode(EFFECT_UPDATE_ATTACK)
9797
e1:SetValue(-2000)
98-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
98+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
9999
tc:RegisterEffect(e1)
100100
if preatk~=0 and tc:GetAttack()==0 then dg:AddCard(tc) end
101101
end
102102
if #dg==0 then return end
103103
Duel.BreakEffect()
104104
Duel.Destroy(dg,REASON_EFFECT)
105-
end
105+
end

official/c10000040.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function s.initial_effect(c)
3535
e4:SetOperation(s.winop)
3636
c:RegisterEffect(e4)
3737
end
38-
s.listed_names={10000000,CARD_RA,10000020}
38+
s.listed_names={CARD_OBELISK,CARD_RA,CARD_SLIFER}
3939
function s.spfilter(c,code)
4040
local code1,code2=c:GetOriginalCodeRule()
4141
return code1==code or code2==code
4242
end
4343
function s.rescon(sg,e,tp,mg)
44-
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,sg,Group.CreateGroup(),10000000,CARD_RA,10000020)
44+
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,sg,Group.CreateGroup(),CARD_OBELISK,CARD_RA,CARD_SLIFER)
4545
end
4646
function s.chk(c,sg,g,code,...)
4747
local code1,code2=c:GetOriginalCodeRule()
@@ -60,9 +60,9 @@ function s.spcon(e,c)
6060
if c==nil then return true end
6161
local tp=c:GetControler()
6262
local rg=Duel.GetReleaseGroup(tp)
63-
local g1=rg:Filter(s.spfilter,nil,10000000)
63+
local g1=rg:Filter(s.spfilter,nil,CARD_OBELISK)
6464
local g2=rg:Filter(s.spfilter,nil,CARD_RA)
65-
local g3=rg:Filter(s.spfilter,nil,10000020)
65+
local g3=rg:Filter(s.spfilter,nil,CARD_SLIFER)
6666
local g=g1:Clone()
6767
g:Merge(g2)
6868
g:Merge(g3)
@@ -71,9 +71,9 @@ function s.spcon(e,c)
7171
end
7272
function s.sptg(e,tp,eg,ep,ev,re,r,rp,c)
7373
local rg=Duel.GetReleaseGroup(tp)
74-
local g1=rg:Filter(s.spfilter,nil,10000000)
74+
local g1=rg:Filter(s.spfilter,nil,CARD_OBELISK)
7575
local g2=rg:Filter(s.spfilter,nil,CARD_RA)
76-
local g3=rg:Filter(s.spfilter,nil,10000020)
76+
local g3=rg:Filter(s.spfilter,nil,CARD_SLIFER)
7777
g1:Merge(g2)
7878
g1:Merge(g3)
7979
local g1=aux.SelectUnselectGroup(g1,e,tp,3,3,s.rescon,1,tp,HINTMSG_RELEASE,s.rescon,nil,true)

official/c10000080.lua

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function s.initial_effect(c)
5252
e9:SetCategory(CATEGORY_SPECIAL_SUMMON)
5353
e9:SetType(EFFECT_TYPE_IGNITION)
5454
e9:SetRange(LOCATION_MZONE)
55-
e9:SetCost(s.spcost)
55+
e9:SetCost(Cost.SelfTribute)
5656
e9:SetTarget(s.sptg)
5757
e9:SetOperation(s.spop)
5858
c:RegisterEffect(e9)
@@ -66,7 +66,7 @@ function s.ttcon2(e,c,minc,zone,relzone,exeff)
6666
if type(ret)=="function" then
6767
ret={ret(exeff,c)}
6868
if #ret>1 then
69-
zone=(ret[2]>>16)&0x7f
69+
zone=(ret[2]>>16)&(ZONES_EMZ|ZONES_MMZ)
7070
end
7171
end
7272
end
@@ -80,7 +80,7 @@ function s.tttg2(e,tp,eg,ep,ev,re,r,rp,chk,c,minc,zone,relzone,exeff)
8080
if type(ret)=="function" then
8181
ret={ret(exeff,c)}
8282
if #ret>1 then
83-
zone=(ret[2]>>16)&0x7f
83+
zone=(ret[2]>>16)&(ZONES_EMZ|ZONES_MMZ)
8484
end
8585
end
8686
end
@@ -96,12 +96,12 @@ end
9696
function s.ttop2(e,tp,eg,ep,ev,re,r,rp,c,minc,zone,relzone,exeff)
9797
local g=e:GetLabelObject()
9898
c:SetMaterial(g)
99-
Duel.Release(g,REASON_SUMMON+REASON_MATERIAL)
99+
Duel.Release(g,REASON_SUMMON|REASON_MATERIAL)
100100
g:DeleteGroup()
101101
end
102102
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
103103
local c=e:GetHandler()
104-
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_PHASE+PHASE_END,0,2)
104+
c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD-RESET_TURN_SET|RESET_PHASE|PHASE_END,0,2)
105105
local e1=Effect.CreateEffect(c)
106106
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
107107
e1:SetCode(EVENT_PHASE+PHASE_END)
@@ -110,7 +110,7 @@ function s.retreg(e,tp,eg,ep,ev,re,r,rp)
110110
e1:SetCountLimit(1)
111111
e1:SetCondition(s.retcon)
112112
e1:SetOperation(s.retop)
113-
e1:SetReset(RESET_PHASE+PHASE_END,2)
113+
e1:SetReset(RESET_PHASE|PHASE_END,2)
114114
Duel.RegisterEffect(e1,tp)
115115
end
116116
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
@@ -123,37 +123,33 @@ function s.retop(e,tp,eg,ep,ev,re,r,rp)
123123
e1:SetType(EFFECT_TYPE_SINGLE)
124124
e1:SetCode(EFFECT_SET_CONTROL)
125125
e1:SetValue(c:GetOwner())
126-
e1:SetReset(RESET_EVENT+RESETS_STANDARD-(RESET_TOFIELD+RESET_TEMP_REMOVE+RESET_TURN_SET))
126+
e1:SetReset(RESET_EVENT|RESETS_STANDARD-(RESET_TOFIELD|RESET_TEMP_REMOVE|RESET_TURN_SET))
127127
c:RegisterEffect(e1)
128128
end
129-
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
130-
if chk==0 then return e:GetHandler():IsReleasable() end
131-
Duel.Release(e:GetHandler(),REASON_COST)
132-
end
133129
function s.filter(c,e,tp)
134130
return c:IsCode(CARD_RA) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
135131
end
136132
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
137133
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
138134
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
139-
if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
140-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
135+
if chk==0 then return ft>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,e,tp) end
136+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
141137
end
142138
function s.spop(e,tp,eg,ep,ev,re,r,rp)
143139
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
144140
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
145-
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
141+
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,e,tp)
146142
local tc=g:GetFirst()
147143
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then
148144
local e1=Effect.CreateEffect(e:GetHandler())
149145
e1:SetType(EFFECT_TYPE_SINGLE)
150146
e1:SetCode(EFFECT_SET_ATTACK)
151147
e1:SetValue(4000)
152-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
148+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
153149
tc:RegisterEffect(e1)
154150
local e2=e1:Clone()
155151
e2:SetCode(EFFECT_SET_DEFENSE)
156152
tc:RegisterEffect(e2)
157153
end
158154
Duel.SpecialSummonComplete()
159-
end
155+
end

official/c10000090.lua

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function s.initial_effect(c)
3434
e4:SetCategory(CATEGORY_TOGRAVE)
3535
e4:SetType(EFFECT_TYPE_IGNITION)
3636
e4:SetRange(LOCATION_MZONE)
37-
e4:SetCost(s.tgcost)
37+
e4:SetCost(Cost.PayLP(1000))
3838
e4:SetTarget(s.tgtg)
3939
e4:SetOperation(s.tgop)
4040
c:RegisterEffect(e4)
@@ -71,10 +71,6 @@ end
7171
function s.efilter(e,te)
7272
return te:GetOwner()~=e:GetOwner()
7373
end
74-
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
75-
if chk==0 then return Duel.CheckLPCost(tp,1000) end
76-
Duel.PayLPCost(tp,1000)
77-
end
7874
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
7975
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
8076
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,PLAYER_ALL,LOCATION_MZONE)
@@ -93,16 +89,16 @@ end
9389
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
9490
if chk==0 then return true end
9591
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
96-
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
92+
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE)
9793
end
9894
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
9995
local c=e:GetHandler()
10096
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_GRAVE) then
10197
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
10298
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
103-
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
99+
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp)
104100
if #g>0 then
105101
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
106102
end
107103
end
108-
end
104+
end

official/c10004783.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
--宝玉の解放
2+
--Crystal Release
23
local s,id=GetID()
34
function s.initial_effect(c)
4-
aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsSetCard,0x1034))
5+
aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsSetCard,SET_CRYSTAL_BEAST))
56
--Atk up
67
local e2=Effect.CreateEffect(c)
78
e2:SetType(EFFECT_TYPE_EQUIP)
@@ -19,12 +20,12 @@ function s.initial_effect(c)
1920
e4:SetOperation(s.tfop)
2021
c:RegisterEffect(e4)
2122
end
22-
s.listed_series={0x1034}
23+
s.listed_series={SET_CRYSTAL_BEAST}
2324
function s.tfcon(e,tp,eg,ep,ev,re,r,rp)
2425
return (e:GetHandler():GetPreviousLocation()&LOCATION_ONFIELD)~=0
2526
end
2627
function s.tffilter(c)
27-
return c:IsSetCard(0x1034) and not c:IsForbidden()
28+
return c:IsSetCard(SET_CRYSTAL_BEAST) and not c:IsForbidden()
2829
end
2930
function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
3031
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
@@ -41,9 +42,9 @@ function s.tfop(e,tp,eg,ep,ev,re,r,rp)
4142
e1:SetCode(EFFECT_CHANGE_TYPE)
4243
e1:SetType(EFFECT_TYPE_SINGLE)
4344
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
44-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
45+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
4546
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
4647
tc:RegisterEffect(e1)
47-
Duel.RaiseEvent(tc,EVENT_CUSTOM+47408488,e,0,tp,0,0)
48+
Duel.RaiseEvent(tc,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0)
4849
end
49-
end
50+
end

official/c10012614.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--勇気の旗印
2+
--Banner of Courage
23
local s,id=GetID()
34
function s.initial_effect(c)
45
--activate
@@ -17,7 +18,5 @@ function s.initial_effect(c)
1718
c:RegisterEffect(e2)
1819
end
1920
function s.con(e)
20-
local ph=Duel.GetCurrentPhase()
21-
local tp=Duel.GetTurnPlayer()
22-
return tp==e:GetHandlerPlayer() and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
23-
end
21+
return Duel.IsTurnPlayer(e:GetHandlerPlayer()) and Duel.IsBattlePhase()
22+
end

0 commit comments

Comments
 (0)