summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2022-01-10 21:07:19 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2022-01-10 21:07:19 -0500
commite41078e383236e9cd99e54e5a141ad7a2242424c (patch)
tree871b72de42769bb1c7f01942524a4cf29b7dc12a
parent4ffef604b4d71c97930548a53f4ffe5db522243e (diff)
Document `PlayVictoryMusic`
-rw-r--r--Hard-coded-logic.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/Hard-coded-logic.md b/Hard-coded-logic.md
index 1c1cc01..b833a50 100644
--- a/Hard-coded-logic.md
+++ b/Hard-coded-logic.md
@@ -9,6 +9,7 @@ Much of the game logic can be changed via the files in [data/](../blob/master/da
- [Landmark limits when scrolling in the Town Map](#landmark-limits-when-scrolling-in-the-town-map)
- [Spawn points when you start and finish the game](#spawn-points-when-you-start-and-finish-the-game)
- [Trainer classes with different battle music](#trainer-classes-with-different-battle-music)
+- [Trainer classes with different victory music](#trainer-classes-with-different-victory-music)
- [`RIVAL1`'s first Pokémon has no held item](#rival1s-first-pokémon-has-no-held-item)
- [`RIVAL1` and `RIVAL2` don't print their trainer class in battle](#rival1-and-rival2-dont-print-their-trainer-class-in-battle)
- [Vital Throw always goes last](#vital-throw-always-goes-last)
@@ -179,6 +180,18 @@ This is caused by `PlayBattleMusic` in [engine/battle/start_battle.asm](../blob/
6. We must be in Johto; play `MUSIC_JOHTO_TRAINER_BATTLE`.
+## Trainer classes with different victory music
+
+This is caused by `PlayVictoryMusic` in [engine/battle/core.asm](../blob/master/engine/battle/core.asm). The routine's logic is:
+
+1. Play `MUSIC_NONE`, silencing the battle music.
+2. If `[wBattleMode]` is not `WILD_BATTLE` (and so must be `TRAINER_BATTLE`):
+ 1. If `[wOtherTrainerClass]` is listed under `GymLeaders` in [data/trainers/leaders.asm](../blob/master/data/trainers/leaders.asm), play `MUSIC_GYM_VICTORY`.
+ 2. It must be a regular trainer battle; play `MUSIC_TRAINER_VICTORY`.
+3. It must a wild battle. If any mon is holding an Exp. Share, or we collect money from Pay Day, or we have not lost the battle, play `MUSIC_WILD_VICTORY`.
+4. Do not play any victory music.
+
+
## `RIVAL1` and `RIVAL2` don't print their trainer class in battle
Both of these classes are named "RIVAL", but battles just print "SILVER wants to battle!", not "RIVAL SILVER wants to battle!"