From 320b7c780a870b3923fe94793ca3a93d5eae00db Mon Sep 17 00:00:00 2001 From: Yoann Fievez Date: Sun, 14 Jun 2026 23:01:53 +0200 Subject: Rename wd49b to wPikachuEmotionModifier (#156) This variable serves as an override for Pikachu's emotion following specific events like refusing a Thunder Stone. It is automatically cleared when its mood normalizes. --- engine/events/pikachu_happiness.asm | 2 +- engine/events/poison.asm | 8 ++++---- engine/items/item_effects.asm | 8 ++++---- engine/pikachu/pikachu_emotions.asm | 2 +- engine/pokemon/evos_moves.asm | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'engine') diff --git a/engine/events/pikachu_happiness.asm b/engine/events/pikachu_happiness.asm index 32a69c2b..d952df34 100644 --- a/engine/events/pikachu_happiness.asm +++ b/engine/events/pikachu_happiness.asm @@ -73,7 +73,7 @@ ModifyPikachuHappiness:: jr c, .decreased cp b jr nc, .done - ld a, [wd49b] + ld a, [wPikachuEmotionModifier] and a jr nz, .done jr .update_mood diff --git a/engine/events/poison.asm b/engine/events/poison.asm index c2f7e8b3..e0464ae8 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -139,7 +139,7 @@ UpdatePikachuHappinessAndMood: ld hl, wPikachuMood ld a, [hl] cp 128 ; central value - jr z, .update_wd49b ; mood == 128, don't modify it + jr z, .clearEmotionModifier ; mood == 128, don't modify it jr c, .increaseMood ; mood < 128, must increase by 1 ; mood > 128, must decrease by 1 (so decrease by 2 and then increase by 1) dec a @@ -147,10 +147,10 @@ UpdatePikachuHappinessAndMood: .increaseMood inc a ld [hl], a -; if the mood has reached its "stable" central value, do not update wd49b +; if the mood has reached its "stable" central value, do not update the emotion modifier cp 128 ret nz -.update_wd49b +.clearEmotionModifier xor a - ld [wd49b], a ; variable used in other mood-related functions, to keep track if the mood was "stable" + ld [wPikachuEmotionModifier], a ; variable used in other mood-related functions, to keep track if the mood was "stable" ret diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 8efea6ae..a6bdf857 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -562,7 +562,7 @@ ItemUseBall: .skipShowingPokedexData ld a, $1 - ld [wd49b], a + ld [wPikachuEmotionModifier], a ld a, $85 ld [wPikachuMood], a ld a, [wPartyCount] @@ -819,7 +819,7 @@ ItemUseEvoStone: ld hl, RefusingText call PrintText ld a, $4 - ld [wd49b], a + ld [wPikachuEmotionModifier], a ld a, $82 ld [wPikachuMood], a jr .canceledItemUse @@ -2124,7 +2124,7 @@ FishingInit: ld a, SFX_HEAL_AILMENT call PlaySound ld a, $2 - ld [wd49b], a + ld [wPikachuEmotionModifier], a ld a, $81 ld [wPikachuMood], a ld c, 80 @@ -2507,7 +2507,7 @@ ItemUseTMHM: jr nz, .notTeachingThunderboltOrThunderToPikachu .teachingThunderboltOrThunderToPlayerPikachu ld a, $5 - ld [wd49b], a + ld [wPikachuEmotionModifier], a ld a, $85 ld [wPikachuMood], a .notTeachingThunderboltOrThunderToPikachu diff --git a/engine/pikachu/pikachu_emotions.asm b/engine/pikachu/pikachu_emotions.asm index 3fc08363..787b4f94 100644 --- a/engine/pikachu/pikachu_emotions.asm +++ b/engine/pikachu/pikachu_emotions.asm @@ -343,7 +343,7 @@ MapSpecificPikachuExpression: ldpikaemotion a, PikachuEmotion22 jr c, .play_emotion .notInLavenderTower - ld a, [wd49b] + ld a, [wPikachuEmotionModifier] and a jr z, .mood_based_emotion dec a diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index f4d5039a..e916075f 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -373,7 +373,7 @@ LearnMoveFromLevelUp: jr nz, .done .foundThunderOrThunderbolt ld a, $5 - ld [wd49b], a + ld [wPikachuEmotionModifier], a ld a, $85 ld [wPikachuMood], a .done -- cgit v1.3.1-sl0p