From 2aa4d2da3836cad4e422c2f722970ae795105c39 Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Tue, 25 Apr 2023 19:38:47 +0200 Subject: [PATCH] Fix Ice Heal message --- include/constants/item_effects.h | 2 +- src/item.c | 2 +- src/item_use.c | 2 +- src/party_menu.c | 18 ++++++++++-------- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/constants/item_effects.h b/include/constants/item_effects.h index 7cd4a58f4..fca792451 100644 --- a/include/constants/item_effects.h +++ b/include/constants/item_effects.h @@ -74,7 +74,7 @@ #define ITEM_EFFECT_CURE_POISON 3 #define ITEM_EFFECT_CURE_SLEEP 4 #define ITEM_EFFECT_CURE_BURN 5 -#define ITEM_EFFECT_CURE_FREEZE 6 +#define ITEM_EFFECT_CURE_FREEZE_FROSTBITE 6 #define ITEM_EFFECT_CURE_PARALYSIS 7 #define ITEM_EFFECT_CURE_CONFUSION 8 #define ITEM_EFFECT_CURE_INFATUATION 9 diff --git a/src/item.c b/src/item.c index d07e93782..2c6937244 100644 --- a/src/item.c +++ b/src/item.c @@ -941,7 +941,7 @@ u8 ItemId_GetBattleUsage(u16 itemId) case ITEM_EFFECT_CURE_POISON: case ITEM_EFFECT_CURE_SLEEP: case ITEM_EFFECT_CURE_BURN: - case ITEM_EFFECT_CURE_FREEZE: + case ITEM_EFFECT_CURE_FREEZE_FROSTBITE: case ITEM_EFFECT_CURE_PARALYSIS: case ITEM_EFFECT_CURE_ALL_STATUS: case ITEM_EFFECT_CURE_CONFUSION: diff --git a/src/item_use.c b/src/item_use.c index 3a838288b..86764be3b 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -1244,7 +1244,7 @@ void ItemUseOutOfBattle_EnigmaBerry(u8 taskId) case ITEM_EFFECT_CURE_POISON: case ITEM_EFFECT_CURE_SLEEP: case ITEM_EFFECT_CURE_BURN: - case ITEM_EFFECT_CURE_FREEZE: + case ITEM_EFFECT_CURE_FREEZE_FROSTBITE: case ITEM_EFFECT_CURE_PARALYSIS: case ITEM_EFFECT_CURE_ALL_STATUS: case ITEM_EFFECT_ATK_EV: diff --git a/src/party_menu.c b/src/party_menu.c index 1623201b1..4eb09c138 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4317,7 +4317,7 @@ static bool8 IsHPRecoveryItem(u16 item) return FALSE; } -static void GetMedicineItemEffectMessage(u16 item) +static void GetMedicineItemEffectMessage(u16 item, u32 statusCured) { switch (GetItemEffectType(item)) { @@ -4330,10 +4330,11 @@ static void GetMedicineItemEffectMessage(u16 item) case ITEM_EFFECT_CURE_BURN: StringExpandPlaceholders(gStringVar4, gText_PkmnBurnHealed); break; - case ITEM_EFFECT_CURE_FREEZE: - StringExpandPlaceholders(gStringVar4, gText_PkmnThawedOut); - // TO DO: if it heals frostbite, use the following instead: - // StringExpandPlaceholders(gStringVar4, gText_PkmnFrostbiteHealed); + case ITEM_EFFECT_CURE_FREEZE_FROSTBITE: + if (statusCured & STATUS1_FREEZE) + StringExpandPlaceholders(gStringVar4, gText_PkmnThawedOut); + if (statusCured & STATUS1_FROSTBITE) + StringExpandPlaceholders(gStringVar4, gText_PkmnFrostbiteHealed); break; case ITEM_EFFECT_CURE_PARALYSIS: StringExpandPlaceholders(gStringVar4, gText_PkmnCuredOfParalysis); @@ -4497,6 +4498,7 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc task) struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId]; u16 item = gSpecialVar_ItemId; bool8 canHeal, cannotUse; + u32 oldStatus = GetMonData(mon, MON_DATA_STATUS); if (NotUsingHPEVItemOnShedinja(mon, item) == FALSE) { @@ -4549,7 +4551,7 @@ void ItemUseCB_Medicine(u8 taskId, TaskFunc task) else { GetMonNickname(mon, gStringVar1); - GetMedicineItemEffectMessage(item); + GetMedicineItemEffectMessage(item, oldStatus); DisplayPartyMenuMessage(gStringVar4, TRUE); ScheduleBgCopyTilemapToVram(2); gTasks[taskId].func = task; @@ -4976,7 +4978,7 @@ static void TryUseItemOnMove(u8 taskId) RemoveBagItem(item, 1); move = GetMonData(mon, MON_DATA_MOVE1 + *moveSlot); StringCopy(gStringVar1, gMoveNames[move]); - GetMedicineItemEffectMessage(item); + GetMedicineItemEffectMessage(item, 0); DisplayPartyMenuMessage(gStringVar4, TRUE); ScheduleBgCopyTilemapToVram(2); gTasks[taskId].func = Task_ClosePartyMenuAfterText; @@ -5826,7 +5828,7 @@ u8 GetItemEffectType(u16 item) else if (statusCure == ITEM3_BURN) return ITEM_EFFECT_CURE_BURN; else if (statusCure == ITEM3_FREEZE) - return ITEM_EFFECT_CURE_FREEZE; + return ITEM_EFFECT_CURE_FREEZE_FROSTBITE; else if (statusCure == ITEM3_PARALYSIS) return ITEM_EFFECT_CURE_PARALYSIS; else if (statusCure == ITEM3_CONFUSION)