diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-03 10:44:07 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-06-03 10:44:07 -0400 |
commit | f0e5b99495efd355001ce35f97100fd2d139220b (patch) | |
tree | 9fd4f2b5980fc54a3c5f7e94ff6b4b75e7d0b6d0 | |
parent | 94d18de93b94905a411775e4d00854e98fdfcdc5 (diff) |
PlayBattleMusic
-rw-r--r-- | Hard-coded-logic.md | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Hard-coded-logic.md b/Hard-coded-logic.md index 34f3975..b1b5045 100644 --- a/Hard-coded-logic.md +++ b/Hard-coded-logic.md @@ -135,15 +135,20 @@ This is caused by `InitEnemyTrainer` in [engine/battle/core.asm](../blob/master/ This is caused by `PlayBattleMusic` in [engine/battle/start_battle.asm](../blob/master/engine/battle/start_battle.asm). The routine's logic is: 1. If `[wBattleType]` is `BATTLETYPE_SUICUNE` or `BATTLETYPE_ROAMING`, play `MUSIC_SUICUNE_BATTLE`. -2. If it's a wild battle, play `MUSIC_KANTO_WILD_BATTLE` if we're in Kanto, `MUSIC_JOHTO_WILD_BATTLE_NIGHT` in Johto at night, or `MUSIC_JOHTO_WILD_BATTLE` during morning and day. -3. If `[wOtherTrainerClass]` is `CHAMPION` or `RED`, play `MUSIC_CHAMPION_BATTLE`. -4. If `[wOtherTrainerClass]` is `GRUNTM` or `GRUNTF`, play `MUSIC_ROCKET_BATTLE`. (They should have included `EXECUTIVEM`, `EXECUTIVEF`, and `SCIENTIST` too…) -5. If `[wOtherTrainerClass]` is listed under `KantoGymLeaders` in [data/trainers/leaders.asm](../blob/master/data/trainers/leaders.asm), play `MUSIC_KANTO_GYM_LEADER_BATTLE`. -6. If `[wOtherTrainerClass]` is listed under `GymLeaders` in [data/trainers/leaders.asm](../blob/master/data/trainers/leaders.asm), play `MUSIC_JOHTO_GYM_LEADER_BATTLE`. (`CHAMPION`, `RED`, and the Kanto Gym leaders are listed but have already been accounted for at this point.) -7. If `[wOtherTrainerClass]` is `RIVAL2` and `[wOtherTrainerID]` is at least `RIVAL2_2_CHIKORITA` (i.e. we're battling our rival in Indigo Plateau), play `MUSIC_CHAMPION_BATTLE`. -8. If `[wOtherTrainerClass]` is `RIVAL1` or `RIVAL2`, play `MUSIC_RIVAL_BATTLE`. -9. If it's a link battle, play `MUSIC_JOHTO_TRAINER_BATTLE`. -10. Play `MUSIC_KANTO_TRAINER_BATTLE` if we're in Kanto or `MUSIC_JOHTO_TRAINER_BATTLE` if we're in Johto. +2. If it's a wild battle... + 1. ...if we're in Kanto, play `MUSIC_KANTO_WILD_BATTLE`. + 2. ...if it's night (and we must be in Johto), play `MUSIC_JOHTO_WILD_BATTLE_NIGHT`. + 3. ...if we must be in Johto during morning or day, play `MUSIC_JOHTO_WILD_BATTLE`. +3. It must be a trainer battle; check the values of `[wOtherTrainerClass]` and `[wOtherTrainerID]`: + 1. If `[wOtherTrainerClass]` is `CHAMPION` or `RED`, play `MUSIC_CHAMPION_BATTLE`. + 2. If `[wOtherTrainerClass]` is `GRUNTM` or `GRUNTF`, play `MUSIC_ROCKET_BATTLE`. (They should have included `EXECUTIVEM`, `EXECUTIVEF`, and `SCIENTIST` too…) + 3. If `[wOtherTrainerClass]` is listed under `KantoGymLeaders` in [data/trainers/leaders.asm](../blob/master/data/trainers/leaders.asm), play `MUSIC_KANTO_GYM_LEADER_BATTLE`. + 4. If `[wOtherTrainerClass]` is listed under `GymLeaders` in [data/trainers/leaders.asm](../blob/master/data/trainers/leaders.asm), play `MUSIC_JOHTO_GYM_LEADER_BATTLE`. (`CHAMPION`, `RED`, and the Kanto Gym leaders are listed but were already handled in step 3.i.) + 5. If `[wOtherTrainerClass]` is `RIVAL2` and `[wOtherTrainerID]` is at least `RIVAL2_2_CHIKORITA` (i.e. we're battling our rival in Indigo Plateau), play `MUSIC_CHAMPION_BATTLE`. + 6. If `[wOtherTrainerClass]` is `RIVAL1` or `RIVAL2`, play `MUSIC_RIVAL_BATTLE`. +4. If it's a link battle, play `MUSIC_JOHTO_TRAINER_BATTLE`. +5. If we're in Kanto, play `MUSIC_KANTO_TRAINER_BATTLE`. +6. We must be in Johto; play `MUSIC_JOHTO_TRAINER_BATTLE`. ## `RIVAL1` and `RIVAL2` don't print their trainer class in battle |