diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d8d471b330..329c5d3182 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5909,6 +5909,7 @@ BattleScript_WonderRoomEnds:: BattleScript_MagicRoomEnds:: printstring STRINGID_MAGICROOMENDS waitmessage B_WAIT_TIME_LONG + tryhealingitem end2 BattleScript_GrassyTerrainEnds:: @@ -7396,6 +7397,7 @@ BattleScript_YawnEnd: BattleScript_EmbargoEndTurn:: printstring STRINGID_EMBARGOENDS waitmessage B_WAIT_TIME_LONG + tryhealingitem end2 BattleScript_TelekinesisEndTurn:: diff --git a/include/battle.h b/include/battle.h index 68a0367106..7121b7d5bd 100644 --- a/include/battle.h +++ b/include/battle.h @@ -102,7 +102,7 @@ struct DisableStruct u8 embargoTimer; u8 magnetRiseTimer; u8 telekinesisTimer; - u8 healBlockTimer; + u16 healBlockTimer; u8 laserFocusTimer; u16 throatChopTimer; u8 wrapTurns; diff --git a/include/constants/battle.h b/include/constants/battle.h index d932031012..13a91ade64 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -581,6 +581,9 @@ enum MoveEffects #define HANDLE_TYPE_PRIMAL_REVERSION 1 #define HANDLE_TYPE_ULTRA_BURST 2 +// Constants for Torment +#define PERMANENT_TORMENT 0xF + // Constants for B_VAR_STARTING_STATUS // Timer value controlled by B_VAR_STARTING_STATUS_TIMER enum StartingStatus diff --git a/src/battle_end_turn.c b/src/battle_end_turn.c index 8c147c3840..04bc121b00 100644 --- a/src/battle_end_turn.c +++ b/src/battle_end_turn.c @@ -168,12 +168,13 @@ static void HandleEndTurnWeather(u32 battler, u32 *effect) static void HandleEndTurnWeatherDamage(u32 battler, u32 *effect) { u32 ability = GetBattlerAbility(battler); - u32 currBattleWeather = 0xFF; + u32 currBattleWeather = GetCurrentBattleWeather(); if (currBattleWeather == 0xFF) { + // If there is no weather on the field, no need to check other battlers so go to next state gBattleStruct->turnEffectsBattlerId = 0; - gBattleStruct->endTurnEventsCounter++; // If there is no weather on the field, no need to check other battlers so go to next state + gBattleStruct->endTurnEventsCounter++; return; } @@ -182,7 +183,6 @@ static void HandleEndTurnWeatherDamage(u32 battler, u32 *effect) if (!IsBattlerAlive(battler) || !HasWeatherEffect()) return; - currBattleWeather = GetCurrentBattleWeather(); switch (currBattleWeather) { diff --git a/test/battle/ability/emergency_exit.c b/test/battle/ability/emergency_exit.c index e17987ba09..6e97619b61 100644 --- a/test/battle/ability/emergency_exit.c +++ b/test/battle/ability/emergency_exit.c @@ -48,7 +48,7 @@ SINGLE_BATTLE_TEST("Emergency Exit switches out when going below 50% max-HP but } } -SINGLE_BATTLE_TEST("Emergency Exit activ out when taking taking residual damage and falling under 50% max-hp damage - Burn") +SINGLE_BATTLE_TEST("Emergency Exit activates when taking residual damage and falling under 50% max-hp - Burn") { GIVEN { PLAYER(SPECIES_WOBBUFFET); @@ -62,7 +62,7 @@ SINGLE_BATTLE_TEST("Emergency Exit activ out when taking taking residual damage } } -SINGLE_BATTLE_TEST("Emergency Exit activ out when taking taking residual damage and falling under 50% max-hp damage - Weather") +SINGLE_BATTLE_TEST("Emergency Exit activates when taking residual damage and falling under 50% max-hp - Weather") { GIVEN { PLAYER(SPECIES_WOBBUFFET); @@ -76,7 +76,7 @@ SINGLE_BATTLE_TEST("Emergency Exit activ out when taking taking residual damage } } -SINGLE_BATTLE_TEST("Emergency Exit activ out when taking taking residual damage and falling under 50% max-hp damage - Salt Cure") +SINGLE_BATTLE_TEST("Emergency Exit activates when taking residual damage and falling under 50% max-hp - Salt Cure") { GIVEN { PLAYER(SPECIES_WOBBUFFET);