From 7efbb642d54634b2e4bba1d3faedf30671fe1e78 Mon Sep 17 00:00:00 2001 From: Zeta_Null Date: Tue, 10 Dec 2024 15:57:25 -0500 Subject: [PATCH] Johto Boy and HP Fix Mildly scuffed implementation of blue checking your gender to be able to call you Johto Boy/Girl/Kid Also fixed how fucking slow HP drain is when you have a lot. May require a make tidy to go into effect. --- engine/battle/anim_hp_bar.asm | 7 ++++--- maps/ViridianGym.asm | 38 +++++++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/engine/battle/anim_hp_bar.asm b/engine/battle/anim_hp_bar.asm index 3e413f9..fd4d6b7 100644 --- a/engine/battle/anim_hp_bar.asm +++ b/engine/battle/anim_hp_bar.asm @@ -179,12 +179,12 @@ LongAnim_UpdateVariables: ld c, a ld a, [hli] ld b, a -; BUG: HP bar animation is slow for high HP (see docs/bugs_and_glitches.md) +; BUG: HP bar animation is slow for high HP (see docs/bugs_and_glitches.md) - Fixed call ComputeHPBarPixels + ld a, e pop bc pop de pop hl - ld a, e ld hl, wCurHPBarPixels cp [hl] jr z, .loop @@ -370,13 +370,14 @@ ShortHPBar_CalcPixelFrame: ld b, 0 .loop -; BUG: HP bar animation off-by-one error for low HP (see docs/bugs_and_glitches.md) +; BUG: HP bar animation off-by-one error for low HP (see docs/bugs_and_glitches.md) - Fixed ld a, l sub HP_BAR_LENGTH_PX ld l, a ld a, h sbc $0 ld h, a + jr z, .done jr c, .done inc b jr .loop diff --git a/maps/ViridianGym.asm b/maps/ViridianGym.asm index 4df71b6..28b9472 100644 --- a/maps/ViridianGym.asm +++ b/maps/ViridianGym.asm @@ -13,8 +13,27 @@ ViridianGymBlueScript: checkflag ENGINE_EARTHBADGE iftrue .FightDone writetext LeaderBlueBeforeText + readvar VAR_PLAYERGENDER + ifequal FEMALE, .PlayerIsFemale + ifequal ENBY, .PlayerIsEnby + writetext LeaderBlueJohtoBoyText waitbutton - closetext + closetext + sjump .cont + +.PlayerIsFemale: + writetext LeaderBlueJohtoGirlText + waitbutton + closetext + sjump .cont + +.PlayerIsEnby: + writetext LeaderBlueJohtoNBText + waitbutton + closetext + sjump .cont + +.cont: winlosstext LeaderBlueWinText, 0 loadtrainer BLUE, BLUE1 startbattle @@ -89,9 +108,20 @@ LeaderBlueBeforeText: para "battling you right" line "now." - - para "Ready, JOHTO" - line "CHAMP?" + + para "" ; This is a stupid workaround because the game immediately overwrites the last bit of text after it's written with how I've coded this. + done ; I /could/ just have three copies of the same script but I hate that and don't want to. It's stupid and annoying. + +LeaderBlueJohtoBoyText: + text "Ready, JOHTO boy?" + done + +LeaderBlueJohtoGirlText: + text "Ready, JOHTO girl?" + done + +LeaderBlueJohtoNBText: + text "Ready, JOHTO kid?" done LeaderBlueWinText: