diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index cfe0eb041..634a6130a 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -4486,4 +4486,14 @@ BattleScript_MoveUsedIsThroatChopPrevented:: printstring STRINGID_PKMNCANTUSEMOVETHROATCHOP waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd + +BattleScript_PrimalWeatherBlocksMove:: + jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_ATTACKSTRING_PRINTED, BattleScript_MoveEnd @in case of multi-target moves, if move fails once, no point in printing the message twice + accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON + attackstring + pause B_WAIT_TIME_SHORT + ppreduce + printfromtable gPrimalWeatherBlocksStringIds + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd \ No newline at end of file diff --git a/include/battle_scripts.h b/include/battle_scripts.h index d8e16d01a..3a9cebb21 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -467,5 +467,6 @@ extern const u8 BattleScript_MoveUsedUnfrostbite[]; extern const u8 BattleScript_PowderMoveNoEffect[]; extern const u8 BattleScript_MoveUsedPowder[]; extern const u8 BattleScript_MoveUsedIsThroatChopPrevented[]; +extern const u8 BattleScript_PrimalWeatherBlocksMove[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index dadf4991b..69551c2ab 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -404,8 +404,10 @@ #define STRINGID_SAFETYGOGGLESPROTECTED 402 #define STRINGID_POWDEREXPLODES 403 #define STRINGID_PKMNCANTUSEMOVETHROATCHOP 404 +#define STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN 405 +#define STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT 406 -#define BATTLESTRINGS_COUNT 405 +#define BATTLESTRINGS_COUNT 407 // 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 0df1358c6..09f53f058 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -534,6 +534,8 @@ static const u8 sText_PkmnFrostbiteHealedBy[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B static const u8 sText_SafetyGogglesProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is not affected\nthanks to its {B_LAST_ITEM}!"); static const u8 sText_PowderExplodes[] = _("When the flame touched the powder\non the Pokémon, it exploded!"); static const u8 sText_PkmnCantUseMoveThroatChop[] = _("{B_ATK_NAME_WITH_PREFIX} can't use\n{B_CURRENT_MOVE} due to Throat Chop!\p"); +static const u8 sText_MoveFizzledOutInTheHeavyRain[] = _("The Fire-type attack fizzled out\nin the heavy rain!"); +static const u8 sText_MoveEvaporatedInTheHarshSunlight[] = _("The Water-type attack evaporated\nin the harsh sunlight!"); const u16 gTrainerUsedItemStringIds[] = @@ -938,6 +940,8 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT - BATTLESTRINGS_TABLE_ST [STRINGID_SAFETYGOGGLESPROTECTED - BATTLESTRINGS_TABLE_START] = sText_SafetyGogglesProtected, [STRINGID_POWDEREXPLODES - BATTLESTRINGS_TABLE_START] = sText_PowderExplodes, [STRINGID_PKMNCANTUSEMOVETHROATCHOP - BATTLESTRINGS_TABLE_START] = sText_PkmnCantUseMoveThroatChop, + [STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN - BATTLESTRINGS_TABLE_START] = sText_MoveFizzledOutInTheHeavyRain, + [STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT - BATTLESTRINGS_TABLE_START] = sText_MoveEvaporatedInTheHarshSunlight, }; const u16 gMagicCoatBounceStringIds[] = @@ -1237,6 +1241,12 @@ const u16 gWeatherStartsStringIds[] = [WEATHER_ABNORMAL] = STRINGID_ITISRAINING }; +const u16 gPrimalWeatherBlocksStringIds[] = +{ + [B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN] = STRINGID_MOVEFIZZLEDOUTINTHEHEAVYRAIN, + [B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN] = STRINGID_MOVEEVAPORATEDINTHEHARSHSUNLIGHT, +}; + const u16 gInobedientStringIds[] = { [B_MSG_LOAFING] = STRINGID_PKMNLOAFING, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b6d6fb22d..d555bfe18 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -933,6 +933,7 @@ static void Cmd_attackcanceler(void) u16 attackerAbility = GetBattlerAbility(gBattlerAttacker); GET_MOVE_TYPE(gCurrentMove, moveType); + // TODO: dynamax // Weight-based moves are blocked by Dynamax. // if (IsDynamaxed(gBattlerTarget) && IsMoveBlockedByDynamax(gCurrentMove)) // { @@ -959,20 +960,19 @@ static void Cmd_attackcanceler(void) if (WEATHER_HAS_EFFECT && gMovesInfo[gCurrentMove].power) { - // TODO: battlescripts if (moveType == TYPE_FIRE && (gBattleWeather & B_WEATHER_RAIN_PRIMAL)) { - // gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN; - // BattleScriptPushCursor(); - // gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; - // return; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_FIZZLED_BY_RAIN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; + return; } else if (moveType == TYPE_WATER && (gBattleWeather & B_WEATHER_SUN_PRIMAL)) { - // gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN; - // BattleScriptPushCursor(); - // gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; - // return; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PRIMAL_WEATHER_EVAPORATED_IN_SUN; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_PrimalWeatherBlocksMove; + return; } }