From 54dccc851283d4b5013c6bb9997b695bee79007d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 17 Dec 2017 20:38:01 +0100 Subject: [PATCH] give batter script command names --- asm/macros/event.inc | 6 ++++-- data/event_scripts.s | 14 +++++++------- data/script_cmd_table.inc | 4 ++-- src/scrcmd.c | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 7f86f8dc8..a88db5f1f 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -663,11 +663,13 @@ .byte 0x5d .endm - .macro gotobattleendscript + @ Goes to address after the trainerbattle command (called by the battle functions, see battle_setup.c) + .macro gotopostbattlescript .byte 0x5e .endm - .macro gototrainerscript + @ Goes to address specified in the trainerbattle command (called by the battle functions, see battle_setup.c) + .macro gotobeatenscript .byte 0x5f .endm diff --git a/data/event_scripts.s b/data/event_scripts.s index 5c2021617..8bd35d0d1 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -861,7 +861,7 @@ EventScript_271362:: @ 8271362 goto EventScript_ShowTrainerIntroMsg EventScript_271389:: @ 8271389 - gotobattleendscript + gotopostbattlescript EventScript_TryDoDoubleTrainerBattle:: @ 827138A lock @@ -885,14 +885,14 @@ EventScript_NotEnoughMonsForDoubleBattle:: @ 82713BA end EventScript_2713C1:: @ 82713C1 - gotobattleendscript + gotopostbattlescript EventScript_2713C2:: @ 82713C2 applymovement VAR_LAST_TALKED, Movement_27143A waitmovement 0 special SetUpTrainerEncounterMusic trainerbattlebegin - gotobattleendscript + gotopostbattlescript EventScript_2713D1:: @ 82713D1 call EventScript_27142F @@ -910,7 +910,7 @@ EventScript_2713D1:: @ 82713D1 end EventScript_2713F7:: @ 82713F7 - gotobattleendscript + gotopostbattlescript EventScript_TryDoDoubleRematchBattle:: @ 82713F8 specialvar VAR_RESULT, IsTrainerReadyForRematch @@ -930,7 +930,7 @@ EventScript_TryDoDoubleRematchBattle:: @ 82713F8 end EventScript_271427:: @ 8271427 - gotobattleendscript + gotopostbattlescript EventScript_NotEnoughMonsForDoubleRematchBattle:: @ 8271428 special ShowTrainerCantBattleSpeech @@ -972,7 +972,7 @@ EventScript_DoTrainerBattle:: @ 8271454 goto_eq EventScript_271491 EventScript_271491:: @ 8271491 - gototrainerscript + gotobeatenscript releaseall end @@ -4094,7 +4094,7 @@ EventScript_TryGetTrainerScript:: @ 82742E6 end EventScript_GotoTrainerScript:: @ 82742F6 - gototrainerscript + gotobeatenscript releaseall end diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index a50cb6afe..96f42dfb0 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -94,8 +94,8 @@ gScriptCmdTable:: @ 81DB67C .4byte ScrCmd_turnobject .4byte ScrCmd_trainerbattle .4byte ScrCmd_dotrainerbattle - .4byte ScrCmd_gotobattleendscript - .4byte ScrCmd_gototrainerscript + .4byte ScrCmd_gotopostbattlescript + .4byte ScrCmd_gotobeatenscript .4byte ScrCmd_checktrainerflag .4byte ScrCmd_settrainerflag .4byte ScrCmd_cleartrainerflag diff --git a/src/scrcmd.c b/src/scrcmd.c index 8f67d1990..1b10501fc 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1979,13 +1979,13 @@ bool8 ScrCmd_dotrainerbattle(struct ScriptContext *ctx) return TRUE; } -bool8 ScrCmd_gotobattleendscript(struct ScriptContext *ctx) +bool8 ScrCmd_gotopostbattlescript(struct ScriptContext *ctx) { ctx->scriptPtr = BattleSetup_GetScriptAddrAfterBattle(); return FALSE; } -bool8 ScrCmd_gototrainerscript(struct ScriptContext *ctx) +bool8 ScrCmd_gotobeatenscript(struct ScriptContext *ctx) { ctx->scriptPtr = BattleSetup_GetTrainerPostBattleScript(); return FALSE;