Skip to content

Commit

Permalink
Merge pull request #308 from lhearachel/build-refactor-trainers
Browse files Browse the repository at this point in the history
Refactor trainer data build
  • Loading branch information
lhearachel authored Nov 22, 2024
2 parents 2cc5d28 + 59fba4b commit 63e7e00
Show file tree
Hide file tree
Showing 978 changed files with 2,336 additions and 434 deletions.
4 changes: 3 additions & 1 deletion asm/macros/scrcmd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
.include "consts/sdat.inc"
.include "consts/species.inc"

#include "res/trainers/trdata.naix"

.macro Noop
.short 0
.endm
Expand Down Expand Up @@ -1263,7 +1265,7 @@
.short \arg0
.endm

.macro StartTrainerBattle enemyTrainer1, enemyTrainer2
.macro StartTrainerBattle enemyTrainer1, enemyTrainer2=0
.short 229
.short \enemyTrainer1
.short \enemyTrainer2
Expand Down
8 changes: 5 additions & 3 deletions res/field/scripts/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1148,9 +1148,11 @@ scr_seq_narc = custom_target('scr_seq.narc',
'-p', '@OUTPUT0@',
'-o', scr_seq_narc_order,
'-n'
]
],
depends: [
trdata_narc,
],
)

nitrofs_files += scr_seq_narc

nitrofs_files += scr_seq_narc[0]
naix_headers += scr_seq_narc[1]
28 changes: 14 additions & 14 deletions res/field/scripts/scripts_battleground.s
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ _032F:
CloseMessage
IncrementGameRecord RECORD_UNK_057
Call _0605
StartTrainerBattle 0x4005, 0
StartTrainerBattle 0x4005
CheckWonBattle 0x8000
Return

Expand Down Expand Up @@ -396,55 +396,55 @@ _0605:
Return

_06B0:
SetVar 0x4005, 0x35A
SetVar 0x4005, trainer_leader_roark_rematch
Return

_06B8:
SetVar 0x4005, 0x359
SetVar 0x4005, trainer_leader_gardenia_rematch
Return

_06C0:
SetVar 0x4005, 0x35B
SetVar 0x4005, trainer_leader_wake_rematch
Return

_06C8:
SetVar 0x4005, 0x356
SetVar 0x4005, trainer_leader_maylene_rematch
Return

_06D0:
SetVar 0x4005, 0x35C
SetVar 0x4005, trainer_leader_fantina_rematch
Return

_06D8:
SetVar 0x4005, 0x355
SetVar 0x4005, trainer_leader_candice_rematch
Return

_06E0:
SetVar 0x4005, 0x358
SetVar 0x4005, trainer_leader_byron_rematch
Return

_06E8:
SetVar 0x4005, 0x357
SetVar 0x4005, trainer_leader_volkner_rematch
Return

_06F0:
SetVar 0x4005, 0x361
SetVar 0x4005, trainer_trainer_cheryl_battleground
Return

_06F8:
SetVar 0x4005, 0x35D
SetVar 0x4005, trainer_trainer_riley_battleground
Return

_0700:
SetVar 0x4005, 0x35F
SetVar 0x4005, trainer_trainer_marley_battleground
Return

_0708:
SetVar 0x4005, 0x35E
SetVar 0x4005, trainer_trainer_buck_battleground
Return

_0710:
SetVar 0x4005, 0x360
SetVar 0x4005, trainer_trainer_mira_battleground
Return

_0718:
Expand Down
6 changes: 3 additions & 3 deletions res/field/scripts/scripts_canalave_city.s
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ _028A:
GoTo _02DF

_02DF:
StartTrainerBattle 0x1DC, 0
StartTrainerBattle trainer_rival_canalave_city_piplup
GoTo _0303

_02EB:
StartTrainerBattle 0x1DD, 0
StartTrainerBattle trainer_rival_canalave_city_turtwig
GoTo _0303

_02F7:
StartTrainerBattle 0x1DE, 0
StartTrainerBattle trainer_rival_canalave_city_chimchar
GoTo _0303

_0303:
Expand Down
18 changes: 9 additions & 9 deletions res/field/scripts/scripts_canalave_city_gym.s
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _0016:
ScrCmd_1CD 9, 35, 0, 0, 0
Message 0
CloseMessage
StartTrainerBattle 250, 0
StartTrainerBattle trainer_leader_byron
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _0120
Message 1
Expand All @@ -31,14 +31,14 @@ _0016:
WaitSound
GiveBadge BADGE_ID_MINE
ScrCmd_260 23
SetTrainerFlag 232
SetTrainerFlag 0x100
SetTrainerFlag 0x101
SetTrainerFlag 0x117
SetTrainerFlag 0x11B
SetTrainerFlag 0x13A
SetTrainerFlag 0x16F
ScrCmd_1CD 10, 35, 250, 0, 0
SetTrainerFlag trainer_black_belt_david
SetTrainerFlag trainer_worker_jackson
SetTrainerFlag trainer_worker_gary
SetTrainerFlag trainer_ace_trainer_cesar
SetTrainerFlag trainer_ace_trainer_breanna
SetTrainerFlag trainer_black_belt_ricky
SetTrainerFlag trainer_worker_gerardo
ScrCmd_1CD 10, 35, trainer_leader_byron, 0, 0
ClearFlag 0x1B2
ClearFlag 0x2CC
ClearFlag 0x1B8
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_celestic_town.s
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _0063:
_006E:
Message 2
CloseMessage
StartTrainerBattle 0x1A0, 0
StartTrainerBattle trainer_galactic_grunt_celestic_town
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _0191
Message 4
Expand Down
4 changes: 2 additions & 2 deletions res/field/scripts/scripts_celestic_town_cave.s
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ _0181:
_019D:
Message 8
CloseMessage
StartTrainerBattle 0x391, 0
StartTrainerBattle trainer_galactic_boss_cyrus_celestic_town_ruins
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _0393
Call _01C3
Expand Down Expand Up @@ -466,7 +466,7 @@ _0538:
GoToIfEq 0x800C, 1, _057A
Message 8
CloseMessage
StartTrainerBattle 0x391, 0
StartTrainerBattle trainer_galactic_boss_cyrus_celestic_town_ruins
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _0393
Call _01C3
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_distortion_world_b7f.s
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ _0096:
FacePlayer
Message 5
CloseMessage
StartTrainerBattle 0x194, 0
StartTrainerBattle trainer_galactic_boss_cyrus_distortion_world
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _01CE
SetVar 0x4055, 10
Expand Down
24 changes: 12 additions & 12 deletions res/field/scripts/scripts_eterna_city_gym.s
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ _0094:
ScrCmd_1CD 9, 67, 0, 0, 0
Message 0
CloseMessage
StartTrainerBattle 0x13B, 0
StartTrainerBattle trainer_leader_gardenia
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _01C3
Message 1
Expand All @@ -77,12 +77,12 @@ _0094:
WaitSound
GiveBadge BADGE_ID_FOREST
ScrCmd_260 23
SetTrainerFlag 0x103
SetTrainerFlag 0x104
SetTrainerFlag 0x144
SetTrainerFlag 0x15C
SetTrainerFlag trainer_aroma_lady_jenna
SetTrainerFlag trainer_aroma_lady_angela
SetTrainerFlag trainer_lass_caroline
SetTrainerFlag trainer_beauty_lindsay
ClearFlag 0x1FC
ScrCmd_1CD 10, 67, 0x13B, 0, 0
ScrCmd_1CD 10, 67, trainer_leader_gardenia, 0, 0
Message 3
GoTo _0177
End
Expand Down Expand Up @@ -149,10 +149,10 @@ _01C9:
LockAll
FacePlayer
GoToIfGe 0x40AE, 1, _0211
ScrCmd_0EA 0x144
ScrCmd_0EA trainer_lass_caroline
Message 6
CloseMessage
StartTrainerBattle 0x144, 0
StartTrainerBattle trainer_lass_caroline
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _01C3
Message 7
Expand All @@ -175,12 +175,12 @@ _021C:
LockAll
FacePlayer
GoToIfGe 0x40AE, 2, _0270
ScrCmd_0EA 0x103
ScrCmd_0EA trainer_aroma_lady_jenna
SetVar 0x8007, 3
Call _02DA
Message 8
CloseMessage
StartTrainerBattle 0x103, 0
StartTrainerBattle trainer_aroma_lady_jenna
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _01C3
Message 9
Expand All @@ -203,12 +203,12 @@ _027B:
LockAll
FacePlayer
GoToIfGe 0x40AE, 3, _02CF
ScrCmd_0EA 0x104
ScrCmd_0EA trainer_aroma_lady_angela
SetVar 0x8007, 4
Call _02DA
Message 10
CloseMessage
StartTrainerBattle 0x104, 0
StartTrainerBattle trainer_aroma_lady_angela
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _01C3
Message 11
Expand Down
4 changes: 2 additions & 2 deletions res/field/scripts/scripts_floaroma_meadow.s
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ _001E:
_0024:
LockAll
Call _00CC
StartTrainerBattle 0x128, 0
StartTrainerBattle trainer_galactic_grunt_floaroma_meadow_1
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _006E
Call _00EE
StartTrainerBattle 0x129, 0
StartTrainerBattle trainer_galactic_grunt_floaroma_meadow_2
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _006E
Call _010E
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_galactic_hq_4f.s
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ _0064:
GoTo _0074

_0074:
StartTrainerBattle 0x193, 0
StartTrainerBattle trainer_galactic_boss_cyrus_galactic_hq
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _00E1
Message 2
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_galactic_hq_control_room.s
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ _0059:
GoToIfSet 173, _0114
Message 0
CloseMessage
StartTrainerBattle 0x199, 0
StartTrainerBattle trainer_commander_saturn_galactic_hq
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _011F
SetFlag 173
Expand Down
20 changes: 10 additions & 10 deletions res/field/scripts/scripts_hearthome_city_dp_gym_leader_room.s
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _0096:
ScrCmd_1CD 9, 100, 0, 0, 0
Message 0
CloseMessage
StartTrainerBattle 0x13E, 0
StartTrainerBattle trainer_leader_fantina
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _01DC
Message 1
Expand All @@ -55,15 +55,15 @@ _0096:
WaitSound
GiveBadge BADGE_ID_RELIC
ScrCmd_260 23
SetTrainerFlag 0x10A
SetTrainerFlag 0x118
SetTrainerFlag 0x11C
SetTrainerFlag 0x145
SetTrainerFlag 0x14A
SetTrainerFlag 0x154
SetTrainerFlag 0x157
SetTrainerFlag 0x165
ScrCmd_1CD 10, 100, 0x13E, 0, 0
SetTrainerFlag trainer_camper_drew
SetTrainerFlag trainer_ace_trainer_allen
SetTrainerFlag trainer_ace_trainer_catherine
SetTrainerFlag trainer_lass_molly
SetTrainerFlag trainer_picnicker_cheyenne
SetTrainerFlag trainer_school_kid_chance
SetTrainerFlag trainer_school_kid_mackenzie
SetTrainerFlag trainer_youngster_donny
ScrCmd_1CD 10, 100, trainer_leader_fantina, 0, 0
SetVar 0x407B, 1
SetFlag 0x206
ClearFlag 0x207
Expand Down
20 changes: 10 additions & 10 deletions res/field/scripts/scripts_hearthome_city_gym_leader_room.s
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ _00BB:
Message 0
CloseMessage
SetFlag 142
StartTrainerBattle 0x13E, 0
StartTrainerBattle trainer_leader_fantina
ClearFlag 142
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _0248
Expand All @@ -70,15 +70,15 @@ _00BB:
WaitSound
GiveBadge BADGE_ID_RELIC
ScrCmd_260 23
SetTrainerFlag 0x10A
SetTrainerFlag 0x118
SetTrainerFlag 0x11C
SetTrainerFlag 0x145
SetTrainerFlag 0x14A
SetTrainerFlag 0x154
SetTrainerFlag 0x157
SetTrainerFlag 0x165
ScrCmd_1CD 10, 91, 0x13E, 0, 0
SetTrainerFlag trainer_camper_drew
SetTrainerFlag trainer_ace_trainer_allen
SetTrainerFlag trainer_ace_trainer_catherine
SetTrainerFlag trainer_lass_molly
SetTrainerFlag trainer_picnicker_cheyenne
SetTrainerFlag trainer_school_kid_chance
SetTrainerFlag trainer_school_kid_mackenzie
SetTrainerFlag trainer_youngster_donny
ScrCmd_1CD 10, 91, trainer_leader_fantina, 0, 0
SetVar 0x407B, 1
SetFlag 0x206
ClearFlag 0x207
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_iron_island_b2f_left_room.s
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ _01AA:
Message 8
CloseMessage
SetHasPartner
StartTrainerBattle 0x343, 0x344
StartTrainerBattle trainer_galactic_grunt_iron_island_1, trainer_galactic_grunt_iron_island_2
ClearHasPartner
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _037D
Expand Down
2 changes: 1 addition & 1 deletion res/field/scripts/scripts_lake_verity.s
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ _0230:
WaitMovement
Message 9
CloseMessage
StartTrainerBattle 0x195, 0
StartTrainerBattle trainer_commander_mars_lake_verity
CheckWonBattle 0x800C
GoToIfEq 0x800C, 0, _02DB
Message 10
Expand Down
Loading

0 comments on commit 63e7e00

Please sign in to comment.