diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 69af61a12..c03384cfb 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6738,6 +6738,15 @@ BattleScript_SandstreamActivates:: call BattleScript_WeatherFormChanges end3 +BattleScript_SandSpitActivates:: + pause 0x20 + call BattleScript_AbilityPopUp + printstring STRINGID_ASANDSTORMKICKEDUP + waitstate + playanimation BS_BATTLER_0, B_ANIM_SANDSTORM_CONTINUES, NULL + call BattleScript_WeatherFormChanges + return + BattleScript_ShedSkinActivates:: call BattleScript_AbilityPopUp printstring STRINGID_PKMNSXCUREDYPROBLEM diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 097e907c5..f97c992c9 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -353,5 +353,6 @@ extern const u8 BattleScript_AnnounceAirLockCloudNine[]; extern const u8 BattleScript_BattlerAbilityStatRaiseOnSwitchIn[]; extern const u8 BattleScript_CottonDownActivates[]; extern const u8 BattleScript_BallFetch[]; +extern const u8 BattleScript_SandSpitActivates[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 526a68c58..7f1737ac1 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -560,8 +560,9 @@ #define STRINGID_SCREENCLEANERENTERS 556 #define STRINGID_FETCHEDPOKEBALL 557 #define STRINGID_BATTLERABILITYRAISEDSTAT 558 +#define STRINGID_ASANDSTORMKICKEDUP 559 -#define BATTLESTRINGS_COUNT 559 +#define BATTLESTRINGS_COUNT 560 //// multichoice message IDs // switch in ability message diff --git a/src/battle_message.c b/src/battle_message.c index 9ca2b7cce..2fec453b0 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -687,9 +687,11 @@ static const u8 sText_ComatoseActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} i static const u8 sText_ScreenCleanerActivates[] = _("All screens on the field were\ncleansed!"); static const u8 sText_FetchedPokeBall[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} found\na {B_LAST_ITEM}!"); static const u8 sText_BattlerAbilityRaisedStat[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nraised its {B_BUFF1}!"); +static const u8 sText_ASandstormKickedUp[] = _("A sandstorm kicked up!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_ASANDSTORMKICKEDUP - 12] = sText_ASandstormKickedUp, [STRINGID_BATTLERABILITYRAISEDSTAT - 12] = sText_BattlerAbilityRaisedStat, [STRINGID_FETCHEDPOKEBALL - 12] = sText_FetchedPokeBall, [STRINGID_STATWASNOTLOWERED - 12] = sText_StatWasNotLowered, diff --git a/src/battle_util.c b/src/battle_util.c index c1270453f..73304c8fe 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4650,6 +4650,19 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_SAND_SPIT: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && TARGET_TURN_DAMAGED + && !(WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY) + && TryChangeBattleWeather(battler, ENUM_WEATHER_SANDSTORM, TRUE)) + { + gBattleScripting.battler = gActiveBattler = battler; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_SandSpitActivates; + effect++; + } + break; } break; case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker