diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 3bfc3ac08..a169b1275 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -581,6 +581,7 @@ BattleScript_AffectionBasedStatusHeal:: jumpifstatus BS_ATTACKER, STATUS1_PARALYSIS, BattleScript_AffectionBasedStatus_HealParalysisString jumpifstatus BS_ATTACKER, STATUS1_BURN, BattleScript_AffectionBasedStatus_HealBurnString jumpifstatus BS_ATTACKER, STATUS1_FREEZE, BattleScript_AffectionBasedStatus_HealFreezeString + jumpifstatus BS_ATTACKER, STATUS1_FROSTBITE, BattleScript_AffectionBasedStatus_HealFrostbiteString end2 BattleScript_AffectionBasedStatus_HealPoisonString: printstring STRINGID_ATTACKEREXPELLEDTHEPOISON @@ -596,6 +597,9 @@ BattleScript_AffectionBasedStatus_HealBurnString: goto BattleScript_AffectionBasedStatusHeal_Continue BattleScript_AffectionBasedStatus_HealFreezeString: printstring STRINGID_ATTACKERMELTEDTHEICE + goto BattleScript_AffectionBasedStatusHeal_Continue +BattleScript_AffectionBasedStatus_HealFrostbiteString: + printstring STRINGID_ATTACKERHEALEDITSFROSTBITE BattleScript_AffectionBasedStatusHeal_Continue: waitmessage B_WAIT_TIME_LONG clearstatus BS_ATTACKER @@ -9580,6 +9584,18 @@ BattleScript_BerryCureFrzRet:: removeitem BS_SCRIPTING return +BattleScript_BerryCureFsbEnd2:: + call BattleScript_BerryCureFrzRet + end2 + +BattleScript_BerryCureFsbRet:: + playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT + printstring STRINGID_PKMNSITEMHEALEDFROSTBITE + waitmessage B_WAIT_TIME_LONG + updatestatusicon BS_SCRIPTING + removeitem BS_SCRIPTING + return + BattleScript_BerryCureSlpEnd2:: call BattleScript_BerryCureSlpRet end2 diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 9b9156eb6..6fcdcac25 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -197,6 +197,8 @@ extern const u8 BattleScript_BerryCureBrnEnd2[]; extern const u8 BattleScript_BerryCureBrnRet[]; extern const u8 BattleScript_BerryCureFrzEnd2[]; extern const u8 BattleScript_BerryCureFrzRet[]; +extern const u8 BattleScript_BerryCureFsbEnd2[]; +extern const u8 BattleScript_BerryCureFsbRet[]; extern const u8 BattleScript_BerryCureSlpEnd2[]; extern const u8 BattleScript_BerryCureSlpRet[]; extern const u8 BattleScript_BerryCureConfusionEnd2[]; diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index b482a3594..4e8cd9ab8 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -653,8 +653,10 @@ #define STRINGID_ITEMRESTOREDSPECIESPP 651 #define STRINGID_PKMNHURTBYFROSTBITE 652 #define STRINGID_PKMNGOTFROSTBITE 653 +#define STRINGID_PKMNSITEMHEALEDFROSTBITE 654 +#define STRINGID_ATTACKERHEALEDITSFROSTBITE 655 -#define BATTLESTRINGS_COUNT 654 +#define BATTLESTRINGS_COUNT 656 // This is the string id that gBattleStringsTable starts with. // String ids before this (e.g. STRINGID_INTROMSG) are not in the table, diff --git a/src/battle_message.c b/src/battle_message.c index e77182f1b..39d862057 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -493,6 +493,7 @@ static const u8 sText_BerrySuffix[] = _(" BERRY"); static const u8 sText_PkmnsItemCuredParalysis[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\ncured paralysis!"); static const u8 sText_PkmnsItemCuredPoison[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\ncured poison!"); static const u8 sText_PkmnsItemHealedBurn[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nhealed its burn!"); +static const u8 sText_PkmnsItemHealedFrostbite[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nhealed its frostbite!"); static const u8 sText_PkmnsItemDefrostedIt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\ndefrosted it!"); static const u8 sText_PkmnsItemWokeIt[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nwoke it from its sleep!"); static const u8 sText_PkmnsItemSnappedOut[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ITEM}\nsnapped it out of confusion!"); @@ -770,6 +771,7 @@ static const u8 sText_AttackerExpelledThePoison[] = _("{B_ATK_NAME_WITH_PREFIX} static const u8 sText_AttackerShookItselfAwake[] = _("{B_ATK_NAME_WITH_PREFIX} shook itself awake!"); static const u8 sText_AttackerBrokeThroughParalysis[] = _("{B_ATK_NAME_WITH_PREFIX} gathered all its energy\nto overcome its paralysis!"); static const u8 sText_AttackerHealedItsBurn[] = _("{B_ATK_NAME_WITH_PREFIX} healed its burn with\nits sheer determination!"); +static const u8 sText_AttackerHealedItsFrostbite[] = _("{B_ATK_NAME_WITH_PREFIX} healed its frostbite with\nits sheer determination!"); static const u8 sText_AttackerMeltedTheIce[] = _("{B_ATK_NAME_WITH_PREFIX} melted the ice with\nits fiery determination!"); static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!"); static const u8 sText_AttackerLostElectricType[] = _("{B_ATK_NAME_WITH_PREFIX} used up all\nof its electricity!"); @@ -1432,6 +1434,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_PKMNSABILITYPREVENTSABILITY - BATTLESTRINGS_TABLE_START] = sText_PkmnsAbilityPreventsAbility, [STRINGID_PKMNHURTBYFROSTBITE - BATTLESTRINGS_TABLE_START] = sText_PkmnHurtByFrostbite, [STRINGID_PKMNGOTFROSTBITE - BATTLESTRINGS_TABLE_START] = sText_PkmnGotFrostbite, + [STRINGID_PKMNSITEMHEALEDFROSTBITE - BATTLESTRINGS_TABLE_START] = sText_PkmnsItemHealedFrostbite, + [STRINGID_ATTACKERHEALEDITSFROSTBITE - BATTLESTRINGS_TABLE_START] = sText_AttackerHealedItsFrostbite, }; const u16 gTrainerUsedItemStringIds[] = @@ -1898,7 +1902,7 @@ const u16 gRoomsStringIds[] = const u16 gStatusConditionsStringIds[] = { - STRINGID_PKMNWASPOISONED, STRINGID_PKMNBADLYPOISONED, STRINGID_PKMNWASBURNED, STRINGID_PKMNWASPARALYZED, STRINGID_PKMNFELLASLEEP + STRINGID_PKMNWASPOISONED, STRINGID_PKMNBADLYPOISONED, STRINGID_PKMNWASBURNED, STRINGID_PKMNWASPARALYZED, STRINGID_PKMNFELLASLEEP, STRINGID_PKMNGOTFROSTBITE }; const u8 gText_PkmnIsEvolving[] = _("What?\n{STR_VAR_1} is evolving!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7273b03ae..ecf902393 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10144,6 +10144,8 @@ static void Cmd_various(void) gBattleCommunication[MULTISTRING_CHOOSER] = 3; else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP) && CanSleep(gBattlerTarget)) gBattleCommunication[MULTISTRING_CHOOSER] = 4; + else if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE) && CanBeFrozen(gBattlerTarget)) + gBattleCommunication[MULTISTRING_CHOOSER] = 5; else { gBattlescriptCurrInstr = cmd->failInstr; @@ -14370,7 +14372,7 @@ static void Cmd_cureifburnedparalysedorpoisoned(void) { CMD_ARGS(const u8 *failInstr); - if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) + if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE)) { gBattleMons[gBattlerAttacker].status1 = 0; gBattlescriptCurrInstr = cmd->nextInstr; @@ -15696,7 +15698,7 @@ static void Cmd_handleballthrow(void) if (gBattleMons[gBattlerTarget].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) odds *= 2; - if (gBattleMons[gBattlerTarget].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) + if (gBattleMons[gBattlerTarget].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON | STATUS1_FROSTBITE)) odds = (odds * 15) / 10; if (gBattleResults.catchAttempts[gLastUsedItem - FIRST_BALL] < 255) diff --git a/src/battle_util.c b/src/battle_util.c index 993a0d5ab..456936fad 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4916,7 +4916,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move StringCopy(gBattleTextBuff1, gStatusConditionString_ParalysisJpn); if (gBattleMons[battler].status1 & STATUS1_BURN) StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); - if (gBattleMons[battler].status1 & STATUS1_FREEZE) + if (gBattleMons[battler].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); gBattleMons[battler].status1 = 0; @@ -5957,7 +5957,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_MAGMA_ARMOR: - if (gBattleMons[battler].status1 & STATUS1_FREEZE) + if (gBattleMons[battler].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) { StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); effect = 1; @@ -6904,6 +6904,13 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) gBattlescriptCurrInstr = BattleScript_BerryCureFrzRet; effect = ITEM_STATUS_CHANGE; } + if (gBattleMons[battlerId].status1 & STATUS1_FROSTBITE && !UnnerveOn(battlerId, gLastUsedItem)) + { + gBattleMons[battlerId].status1 &= ~STATUS1_FROSTBITE; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_BerryCureFsbRet; + effect = ITEM_STATUS_CHANGE; + } break; case HOLD_EFFECT_CURE_SLP: if (gBattleMons[battlerId].status1 & STATUS1_SLEEP && !UnnerveOn(battlerId, gLastUsedItem)) @@ -6952,7 +6959,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) if (gBattleMons[battlerId].status1 & STATUS1_BURN) StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); - if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) + if (gBattleMons[battlerId].status1 & STATUS1_FREEZE || gBattleMons[battlerId].status1 & STATUS1_FROSTBITE) StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION) @@ -7125,6 +7132,12 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) BattleScriptExecute(BattleScript_BerryCureFrzEnd2); effect = ITEM_STATUS_CHANGE; } + if (gBattleMons[battlerId].status1 & STATUS1_FROSTBITE && !UnnerveOn(battlerId, gLastUsedItem)) + { + gBattleMons[battlerId].status1 &= ~STATUS1_FROSTBITE; + BattleScriptExecute(BattleScript_BerryCureFsbEnd2); + effect = ITEM_STATUS_CHANGE; + } break; case HOLD_EFFECT_CURE_SLP: if (gBattleMons[battlerId].status1 & STATUS1_SLEEP && !UnnerveOn(battlerId, gLastUsedItem)) @@ -7160,7 +7173,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); i++; } - if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) + if (gBattleMons[battlerId].status1 & STATUS1_FREEZE || gBattleMons[battlerId].status1 & STATUS1_FROSTBITE) { StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); i++; @@ -7443,6 +7456,12 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) BattleScriptExecute(BattleScript_BerryCureFrzEnd2); effect = ITEM_STATUS_CHANGE; } + if (gBattleMons[battlerId].status1 & STATUS1_FROSTBITE && !UnnerveOn(battlerId, gLastUsedItem)) + { + gBattleMons[battlerId].status1 &= ~STATUS1_FROSTBITE; + BattleScriptExecute(BattleScript_BerryCureFsbEnd2); + effect = ITEM_STATUS_CHANGE; + } break; case HOLD_EFFECT_CURE_SLP: if (gBattleMons[battlerId].status1 & STATUS1_SLEEP && !UnnerveOn(battlerId, gLastUsedItem)) @@ -7486,7 +7505,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) StringCopy(gBattleTextBuff1, gStatusConditionString_BurnJpn); i++; } - if (gBattleMons[battlerId].status1 & STATUS1_FREEZE) + if (gBattleMons[battlerId].status1 & STATUS1_FREEZE || gBattleMons[battlerId].status1 & STATUS1_FROSTBITE) { StringCopy(gBattleTextBuff1, gStatusConditionString_IceJpn); i++; @@ -9054,7 +9073,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe switch (gBattleMoves[move].effect) { case EFFECT_FACADE: - if (gBattleMons[battlerAtk].status1 & (STATUS1_BURN | STATUS1_PSN_ANY | STATUS1_PARALYSIS)) + if (gBattleMons[battlerAtk].status1 & (STATUS1_BURN | STATUS1_PSN_ANY | STATUS1_PARALYSIS | STATUS1_FROSTBITE)) MulModifier(&modifier, UQ_4_12(2.0)); break; case EFFECT_BRINE: