summaryrefslogtreecommitdiff
path: root/asm/macros/event.inc
diff options
context:
space:
mode:
Diffstat (limited to 'asm/macros/event.inc')
-rw-r--r--asm/macros/event.inc65
1 files changed, 50 insertions, 15 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc
index 33afdc3b3..8c6110b64 100644
--- a/asm/macros/event.inc
+++ b/asm/macros/event.inc
@@ -629,60 +629,95 @@
.endm
@ If the Trainer flag for Trainer index is not set, this command does absolutely nothing.
- .macro trainerbattle type:req, trainer:req, word:req, pointer1:req, pointer2, pointer3, pointer4
+ .macro trainerbattle type, trainer, local_id, pointer1, pointer2, pointer3, pointer4
.byte 0x5c
.byte \type
.2byte \trainer
- .2byte \word
- .if \type == 0
+ .2byte \local_id
+ .if \type == TRAINER_BATTLE_NORMAL
.4byte \pointer1 @ text
.4byte \pointer2 @ text
- .elseif \type == 1
+ .elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.4byte \pointer3 @ event script
- .elseif \type == 2
+ .elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.4byte \pointer3 @ event script
- .elseif \type == 3
+ .elseif \type == TRAINER_BATTLE_NORMAL_NO_INTRO_TEXT
.4byte \pointer1 @ text
- .elseif \type == 4
+ .elseif \type == TRAINER_BATTLE_DOUBLE
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.4byte \pointer3 @ text
- .elseif \type == 5
+ .elseif \type == TRAINER_BATTLE_REMATCH
.4byte \pointer1 @ text
.4byte \pointer2 @ text
- .elseif \type == 6
+ .elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.4byte \pointer3 @ text
.4byte \pointer4 @ event script
- .elseif \type == 7
+ .elseif \type == TRAINER_BATTLE_REMATCH_DOUBLE
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.4byte \pointer3 @ text
- .elseif \type == 8
+ .elseif \type == TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.4byte \pointer3 @ text
.4byte \pointer4 @ event script
- .elseif \type == 9
+ .elseif \type == TRAINER_BATTLE_9
.4byte \pointer1 @ text
.4byte \pointer2 @ text
- .elseif \type == 10
+ .elseif \type == TRAINER_BATTLE_SET_TRAINER_A
.4byte \pointer1 @ text
.4byte \pointer2 @ text
- .elseif \type == 11
+ .elseif \type == TRAINER_BATTLE_SET_TRAINER_B
.4byte \pointer1 @ text
.4byte \pointer2 @ text
- .elseif \type == 12
+ .elseif \type == TRAINER_BATTLE_12
.4byte \pointer1 @ text
.4byte \pointer2 @ text
.endif
.endm
+ NO_MUSIC = FALSE
+
+ @ Starts a normal trainer battle
+ .macro trainerbattle_normal trainer, intro_text, lose_text, event_script=FALSE, music=TRUE
+ .if \event_script == FALSE
+ trainerbattle TRAINER_BATTLE_NORMAL, \trainer, 0, \intro_text, \lose_text
+ .elseif \event_script != FALSE && \music == TRUE
+ trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, \trainer, 0, \intro_text, \lose_text, \event_script
+ .else
+ trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC, \trainer, 0, \intro_text, \lose_text, \event_script
+ .endif
+ .endm
+
+ @ Starts a double trainer battle
+ .macro trainerbattle_double trainer, intro_text, lose_text, not_enough_pkmn_text, event_script=FALSE, music=TRUE
+ .if \event_script == FALSE
+ trainerbattle TRAINER_BATTLE_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text
+ .elseif \event_script != FALSE && \music == TRUE
+ trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script
+ .else
+ trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script
+ .endif
+ .endm
+
+ .macro trainerbattle_rematch trainer, intro_text, lose_text
+ trainerbattle TRAINER_BATTLE_REMATCH, \trainer, 0, \intro_text, \lose_text
+ .endm
+
+ .macro trainerbattle_rematch_double trainer, intro_text, lose_text, not_enough_pkmn_text
+ trainerbattle TRAINER_BATTLE_REMATCH_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text
+ .endm
+
+ .macro trainerbattle_no_intro trainer, lose_text
+ trainerbattle TRAINER_BATTLE_NORMAL_NO_INTRO_TEXT, \trainer, 0, \lose_text
+ .endm
@ Starts a trainer battle using the battle information stored in RAM (usually by trainerbattle, which actually calls this command behind-the-scenes), and blocks script execution until the battle finishes.
.macro trainerbattlebegin