diff options
author | mid-kid <esteve.varela@gmail.com> | 2018-07-24 21:54:11 +0000 |
---|---|---|
committer | mid-kid <esteve.varela@gmail.com> | 2018-07-24 21:54:11 +0000 |
commit | ff896711ab0f78133924cc89a61c36c27b2c9a57 (patch) | |
tree | bbd5ded821c1831e1037705f1300773fcb18da06 | |
parent | 517f9d193db42334df35a6f0299763fa359c52f8 (diff) |
Updated Hard coded logic (markdown)
-rw-r--r-- | Hard-coded-logic.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Hard-coded-logic.md b/Hard-coded-logic.md index c83ccf8..c1c067a 100644 --- a/Hard-coded-logic.md +++ b/Hard-coded-logic.md @@ -11,6 +11,7 @@ Much of the game logic can be changed via the files in [data/](../blob/master/da - [Trainer classes with different battle music](#trainer-classes-with-different-battle-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) ## Tilesets that have per-mapgroup roofs @@ -270,3 +271,21 @@ This is caused by `PlaceEnemysName` in [home/text.asm](../blob/master/home/text. cp RIVAL2 jr z, .rival ``` + + +## Vital Throw always goes last + +Most move effects' priorities are specified in `MoveEffectPriorities` in [data/moves/effects_priorities.asm](../blob/master/data/moves/effects_priorities.asm). +...except for Vital Throw. This move shares its effect with a lot of other moves, and they couldn't be bothered to make a new move effect ID for it like `EFFECT_PRIORITY_HIT`, so they hard-coded this case, in `GetMovePriority` of [engine/battle/core.asm](../blob/master/engine/battle/core.asm): + +```asm +GetMovePriority: +; Return the priority (0-3) of move a. + + ld b, a + + ; Vital Throw goes last. + cp VITAL_THROW + ld a, 0 + ret z +```
\ No newline at end of file |