diff options
| author | dannye <33dannye@gmail.com> | 2026-01-17 22:38:33 -0600 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2026-01-17 22:38:33 -0600 |
| commit | bc2354dd6626ce28bb9561547ed2107cfa56c18e (patch) | |
| tree | 5902d4c3389253c76b7c3351e0d7dfecb551c28d /engine/battle/move_effects | |
| parent | Identify characters in `_OakSpeechText2B` and `Printer_GetMonStats.IDNo` (#144) (diff) | |
| parent | Use macros for `WildMonEncounterSlotChances` (#562) (diff) | |
| download | pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.gz pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.xz pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.zip | |
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/battle/move_effects')
| -rw-r--r-- | engine/battle/move_effects/haze.asm | 4 | ||||
| -rw-r--r-- | engine/battle/move_effects/substitute.asm | 4 | ||||
| -rw-r--r-- | engine/battle/move_effects/transform.asm | 14 |
3 files changed, 14 insertions, 8 deletions
diff --git a/engine/battle/move_effects/haze.asm b/engine/battle/move_effects/haze.asm index 76722d0e..0f89ad19 100644 --- a/engine/battle/move_effects/haze.asm +++ b/engine/battle/move_effects/haze.asm @@ -59,7 +59,7 @@ CureVolatileStatuses: ret ResetStatMods: - ld b, $8 + ld b, NUM_STAT_MODS .loop ld [hli], a dec b @@ -67,7 +67,7 @@ ResetStatMods: ret ResetStats: - ld b, $8 + ld b, (NUM_STATS - 1) * 2 ; doesn't reset STAT_HEALTH .loop ld a, [hli] ld [de], a diff --git a/engine/battle/move_effects/substitute.asm b/engine/battle/move_effects/substitute.asm index e4311209..01d5a8a3 100644 --- a/engine/battle/move_effects/substitute.asm +++ b/engine/battle/move_effects/substitute.asm @@ -37,8 +37,8 @@ SubstituteEffect_: sbc 0 pop bc jr c, .notEnoughHP ; underflow means user would be left with negative health - ; bug: since it only branches on carry, it will possibly leave user with 0 HP -.userHasZeroOrMoreHP + ; bug: since it only branches on carry, it will possibly leave user with 0 HP +; user has 0 or more HP ld [hli], a ; save resulting HP after subtraction into current HP ld [hl], d ld h, b diff --git a/engine/battle/move_effects/transform.asm b/engine/battle/move_effects/transform.asm index 775816c7..e8bafe04 100644 --- a/engine/battle/move_effects/transform.asm +++ b/engine/battle/move_effects/transform.asm @@ -2,17 +2,22 @@ TransformEffect_: ld hl, wBattleMonSpecies ld de, wEnemyMonSpecies ld bc, wEnemyBattleStatus3 + ; bug: on enemy's turn, a is overloaded with hWhoseTurn, + ; before the check for INVULNERABLE ld a, [wEnemyBattleStatus1] ldh a, [hWhoseTurn] and a jr nz, .hitTest +; player's turn ld hl, wEnemyMonSpecies ld de, wBattleMonSpecies ld bc, wPlayerBattleStatus3 ld [wPlayerMoveListIndex], a + ; bug: this should be target's BattleStatus1 (i.e. wEnemyBattleStatus1) ld a, [wPlayerBattleStatus1] .hitTest bit INVULNERABLE, a ; is mon invulnerable to typical attacks? (fly/dig) + ; this check doesn't work due to above bugs jp nz, .failed push hl push de @@ -82,14 +87,15 @@ TransformEffect_: ld a, [hli] ld [de], a inc de -; Attack, Defense, Speed, and Special stats +; Skip level and max HP inc hl inc hl inc hl inc de inc de inc de - ld bc, $8 +; Attack, Defense, Speed, and Special stats + ld bc, (NUM_STATS - 1) * 2 call CopyData ld bc, wBattleMonMoves - wBattleMonPP add hl, bc ; ld hl, wBattleMonMoves @@ -99,7 +105,7 @@ TransformEffect_: ld a, [hli] and a jr z, .lessThanFourMoves - ld a, $5 + ld a, 5 .lessThanFourMoves ld [de], a inc de @@ -129,7 +135,7 @@ TransformEffect_: ld l, e pop de .gotStatsOrModsToCopy - ld bc, $8 + ld bc, (NUM_STATS - 1) * 2 jp CopyData .failed |
