From 59f64c622bf2ed7a0fcc6d45975813bc55c84141 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 26 Nov 2017 17:26:11 +0100 Subject: [PATCH] name more battlescripts --- data/battle_scripts_1.s | 19 +++++++++---------- include/battle_scripts.h | 16 ++++++++-------- src/battle_2.c | 8 ++++---- src/battle_message.c | 2 +- src/battle_util.c | 10 +++++----- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a213225c6..5e7488108 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3087,7 +3087,7 @@ BattleScript_WildMonFled:: waitmessage 0x40 end2 -BattleScript_82DAAFE:: +BattleScript_PrintCantRunFromTrainer:: printstring STRINGID_NORUNNINGFROMTRAINERS end2 @@ -3096,7 +3096,7 @@ BattleScript_PrintFailedToRunString:: waitmessage 0x40 end2 -BattleScript_82DAB0B:: +BattleScript_PrintCantEscapeFromBattle:: printselectionstringfromtable gNoEscapeStringIds endselectionscript @@ -3463,7 +3463,7 @@ BattleScript_82DAEFE:: waitmessage 0x40 return -BattleScript_82DAF05:: +BattleScript_PerishSongTakesLife:: printstring STRINGID_PKMNPERISHCOUNTFELL waitmessage 0x40 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 @@ -3472,7 +3472,7 @@ BattleScript_82DAF05:: tryfaintmon ATTACKER, FALSE, NULL end2 -BattleScript_82DAF20:: +BattleScript_PerishSongCountGoesDown:: printstring STRINGID_PKMNPERISHCOUNTFELL waitmessage 0x40 end2 @@ -3533,7 +3533,7 @@ BattleScript_SpikesFree:: waitmessage 0x40 return -BattleScript_82DAFE4:: +BattleScript_MonTookFutureAttack:: printstring STRINGID_PKMNTOOKATTACK waitmessage 0x40 jumpifbyte NOT_EQUAL, cMULTISTRING_CHOOSER, 0x0, BattleScript_82DB001 @@ -3565,7 +3565,6 @@ BattleScript_82DB03F:: moveend 0x2, 0xE setbyte gBattleMoveFlags, 0 end2 - BattleScript_82DB058:: pause 0x20 setbyte gBattleMoveFlags, 0 @@ -3757,7 +3756,7 @@ BattleScript_MoveUsedWokeUp:: updatestatusicon ATTACKER return -BattleScript_82DB234:: +BattleScript_MonWokeUpInUproar:: printstring STRINGID_PKMNWOKEUPINUPROAR waitmessage 0x40 updatestatusicon ATTACKER @@ -3812,8 +3811,8 @@ BattleScript_MoveUsedFlinched:: waitmessage 0x40 goto BattleScript_MoveEnd -BattleScript_82DB2A6:: - printfromtable gUproarOvetTurnStringIds +BattleScript_PrintUproarOverTurns:: + printfromtable gUproarOverTurnStringIds waitmessage 0x40 end2 @@ -4575,7 +4574,7 @@ BattleScript_82DB992:: various ATTACKER, 0xC end2 -BattleScript_82DB9BA:: +BattleScript_AskIfWantsToForfeitMatch:: printselectionstring STRINGID_QUESTIONFORFEITMATCH various ATTACKER, VARIOUS_EMIT_YESNOBOX endselectionscript diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 9c3f4906a..5131778a8 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -378,9 +378,9 @@ extern const u8 BattleScript_SmokeBallEscape[]; extern const u8 BattleScript_RanAwayUsingMonAbility[]; extern const u8 BattleScript_GotAwaySafely[]; extern const u8 BattleScript_WildMonFled[]; -extern const u8 BattleScript_82DAAFE[]; +extern const u8 BattleScript_PrintCantRunFromTrainer[]; extern const u8 BattleScript_PrintFailedToRunString[]; -extern const u8 BattleScript_82DAB0B[]; +extern const u8 BattleScript_PrintCantEscapeFromBattle[]; extern const u8 BattleScript_PrintFullBox[]; extern const u8 BattleScript_ActionSwitch[]; extern const u8 BattleScript_82DAB35[]; @@ -432,8 +432,8 @@ extern const u8 BattleScript_82DAEB1[]; extern const u8 BattleScript_SpikesOngBank1[]; extern const u8 BattleScript_82DAEE8[]; extern const u8 BattleScript_82DAEFE[]; -extern const u8 BattleScript_82DAF05[]; -extern const u8 BattleScript_82DAF20[]; +extern const u8 BattleScript_PerishSongTakesLife[]; +extern const u8 BattleScript_PerishSongCountGoesDown[]; extern const u8 BattleScript_AllStatsUp[]; extern const u8 BattleScript_82DAF54[]; extern const u8 BattleScript_82DAF72[]; @@ -445,7 +445,7 @@ extern const u8 BattleScript_RapidSpinAway[]; extern const u8 BattleScript_WrapFree[]; extern const u8 BattleScript_LeechSeedFree[]; extern const u8 BattleScript_SpikesFree[]; -extern const u8 BattleScript_82DAFE4[]; +extern const u8 BattleScript_MonTookFutureAttack[]; extern const u8 BattleScript_82DB001[]; extern const u8 BattleScript_82DB008[]; extern const u8 BattleScript_82DB020[]; @@ -482,7 +482,7 @@ extern const u8 BattleScript_82DB1FE[]; extern const u8 BattleScript_FocusPunchSetUp[]; extern const u8 BattleScript_MoveUsedIsAsleep[]; extern const u8 BattleScript_MoveUsedWokeUp[]; -extern const u8 BattleScript_82DB234[]; +extern const u8 BattleScript_MonWokeUpInUproar[]; extern const u8 BattleScript_PoisonTurnDmg[]; extern const u8 BattleScript_82DB243[]; extern const u8 BattleScript_82DB245[]; @@ -493,7 +493,7 @@ extern const u8 BattleScript_MoveUsedUnfroze[]; extern const u8 BattleScript_DefrostedViaFireMove[]; extern const u8 BattleScript_MoveUsedIsParalyzed[]; extern const u8 BattleScript_MoveUsedFlinched[]; -extern const u8 BattleScript_82DB2A6[]; +extern const u8 BattleScript_PrintUproarOverTurns[]; extern const u8 BattleScript_ThrashConfuses[]; extern const u8 BattleScript_MoveUsedIsConfused[]; extern const u8 BattleScript_82DB2D4[]; @@ -611,7 +611,7 @@ extern const u8 BattleScript_82DB8E0[]; extern const u8 BattleScript_82DB8F3[]; extern const u8 BattleScript_82DB973[]; extern const u8 BattleScript_82DB992[]; -extern const u8 BattleScript_82DB9BA[]; +extern const u8 BattleScript_AskIfWantsToForfeitMatch[]; extern const u8 BattleScript_82DB9C1[]; extern const u8 BattleScript_82DB9C8[]; extern const u8 BattleScript_BallThrow[]; diff --git a/src/battle_2.c b/src/battle_2.c index b03e96622..8afca2f10 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -4083,7 +4083,7 @@ static void HandleTurnActionSelectionState(void) && gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_x4000000) && gBattleBufferB[gActiveBank][1] == ACTION_RUN) { - gSelectionBattleScripts[gActiveBank] = BattleScript_82DB9BA; + gSelectionBattleScripts[gActiveBank] = BattleScript_AskIfWantsToForfeitMatch; gBattleCommunication[gActiveBank] = 8; *(gBattleStruct->selectionScriptFinished + gActiveBank) = FALSE; *(gBattleStruct->stateIdAfterSelScript + gActiveBank) = STATE_BEFORE_ACTION_CHOSEN; @@ -4093,13 +4093,13 @@ static void HandleTurnActionSelectionState(void) && !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && gBattleBufferB[gActiveBank][1] == ACTION_RUN) { - BattleScriptExecute(BattleScript_82DAAFE); + BattleScriptExecute(BattleScript_PrintCantRunFromTrainer); gBattleCommunication[gActiveBank] = 1; } - else if (IsRunningFromBattleImpossible() != 0 + else if (IsRunningFromBattleImpossible() && gBattleBufferB[gActiveBank][1] == ACTION_RUN) { - gSelectionBattleScripts[gActiveBank] = BattleScript_82DAB0B; + gSelectionBattleScripts[gActiveBank] = BattleScript_PrintCantEscapeFromBattle; gBattleCommunication[gActiveBank] = STATE_SELECTION_SCRIPT; *(gBattleStruct->selectionScriptFinished + gActiveBank) = FALSE; *(gBattleStruct->stateIdAfterSelScript + gActiveBank) = STATE_BEFORE_ACTION_CHOSEN; diff --git a/src/battle_message.c b/src/battle_message.c index 35b9004ac..0dc468eca 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -964,7 +964,7 @@ const u16 gRestUsedStringIds[] = STRINGID_PKMNWENTTOSLEEP, STRINGID_PKMNSLEPTHEALTHY }; -const u16 gUproarOvetTurnStringIds[] = +const u16 gUproarOverTurnStringIds[] = { STRINGID_PKMNMAKINGUPROAR, STRINGID_PKMNCALMEDDOWN }; diff --git a/src/battle_util.c b/src/battle_util.c index 021251b35..904dfc032 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -963,7 +963,7 @@ u8 TurnBasedEffects(void) gBattleMons[gBankAttacker].status1 &= ~(STATUS_SLEEP); gBattleMons[gBankAttacker].status2 &= ~(STATUS2_NIGHTMARE); gBattleCommunication[MULTISTRING_CHOOSER] = 1; - BattleScriptExecute(BattleScript_82DB234); + BattleScriptExecute(BattleScript_MonWokeUpInUproar); gActiveBank = gBankAttacker; EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBank].status1); MarkBufferBankForExecution(gActiveBank); @@ -994,7 +994,7 @@ u8 TurnBasedEffects(void) gBattleCommunication[MULTISTRING_CHOOSER] = 1; CancelMultiTurnMoves(gActiveBank); } - BattleScriptExecute(BattleScript_82DB2A6); + BattleScriptExecute(BattleScript_PrintUproarOverTurns); effect = 1; } } @@ -1144,7 +1144,7 @@ bool8 sub_8041364(void) gBankAttacker = gWishFutureKnock.futureSightAttacker[gActiveBank]; gBattleMoveDamage = gWishFutureKnock.futureSightDmg[gActiveBank]; gSpecialStatuses[gBankTarget].moveturnLostHP = 0xFFFF; - BattleScriptExecute(BattleScript_82DAFE4); + BattleScriptExecute(BattleScript_MonTookFutureAttack); if (gWishFutureKnock.futureSightCounter[gActiveBank] == 0 && gWishFutureKnock.futureSightCounter[gActiveBank ^ BIT_MON] == 0) @@ -1178,12 +1178,12 @@ bool8 sub_8041364(void) { gStatuses3[gActiveBank] &= ~STATUS3_PERISH_SONG; gBattleMoveDamage = gBattleMons[gActiveBank].hp; - gBattlescriptCurrInstr = BattleScript_82DAF05; + gBattlescriptCurrInstr = BattleScript_PerishSongTakesLife; } else { gDisableStructs[gActiveBank].perishSongTimer1--; - gBattlescriptCurrInstr = BattleScript_82DAF20; + gBattlescriptCurrInstr = BattleScript_PerishSongCountGoesDown; } BattleScriptExecute(gBattlescriptCurrInstr); return TRUE;