diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index dc0a1900e..d627008da 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8926,3 +8926,11 @@ BattleScript_DarkTypePreventsPrankster:: waitmessage B_WAIT_TIME_LONG orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT goto BattleScript_MoveEnd + +BattleScript_PastelVeilActivates:: + call BattleScript_AbilityPopUp + printfromtable gSwitchInAbilityStringIds + curestatus BS_SCRIPTING + updatestatusicon BS_SCRIPTING + waitmessage B_WAIT_TIME_LONG + end3 diff --git a/include/battle_scripts.h b/include/battle_scripts.h index ec95a4549..5875eaa68 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -402,5 +402,6 @@ extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; extern const u8 BattleScript_PrimalReversion[]; extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; +extern const u8 BattleScript_PastelVeilActivates[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index a84f0ff34..95a37223d 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -598,8 +598,9 @@ #define STRINGID_BUTHOOPACANTUSEIT 595 #define STRINGID_BROKETHROUGHPROTECTION 596 #define STRINGID_PASTELVEILPROTECTED 597 +#define STRINGID_PASTELVEILENTERS 598 -#define BATTLESTRINGS_COUNT 598 +#define BATTLESTRINGS_COUNT 599 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. @@ -834,6 +835,7 @@ #define B_MSG_SWITCHIN_SCREENCLEANER 12 #define B_MSG_SWITCHIN_ASONE 13 #define B_MSG_SWITCHIN_CURIOUS_MEDICINE 14 +#define B_MSG_SWITCHIN_PASTEL_VEIL 15 // gMentalHerbCureStringIds #define B_MSG_MENTALHERBCURE_INFATUATION 0 diff --git a/src/battle_message.c b/src/battle_message.c index f6569f039..3a17a7240 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -724,9 +724,11 @@ static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFI static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!"); static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); static const u8 sText_PastelVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby a pastel veil!"); +static const u8 sText_PastelVeilEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s poisoning\nwas cured!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PASTELVEILENTERS - 12] = sText_PastelVeilEnters, [STRINGID_PASTELVEILPROTECTED -12] = sText_PastelVeilProtected, [STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection, [STRINGID_BUTPOKEMONCANTUSETHEMOVE - 12] = sText_ButPokemonCantUseTheMove, @@ -1373,6 +1375,7 @@ const u16 gSwitchInAbilityStringIds[] = [B_MSG_SWITCHIN_SCREENCLEANER] = STRINGID_SCREENCLEANERENTERS, [B_MSG_SWITCHIN_ASONE] = STRINGID_ASONEENTERS, [B_MSG_SWITCHIN_CURIOUS_MEDICINE] = STRINGID_CURIOUSMEDICINEENTERS, + [B_MSG_SWITCHIN_PASTEL_VEIL] = STRINGID_PASTELVEILENTERS, }; const u16 gMissStringIds[] = diff --git a/src/battle_util.c b/src/battle_util.c index 5dbe42227..0600d37e8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4061,6 +4061,25 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_PASTEL_VEIL: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + u32 side = GetBattlerSide(battler); + + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (IsBattlerAlive(i) && GetBattlerSide(i) == side + && (gBattleMons[i].status1 & STATUS1_POISON || gBattleMons[i].status1 & STATUS1_TOXIC_POISON)) + { + gActiveBattler = gBattleScripting.battler = gEffectBattler = i; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PASTEL_VEIL; + BattleScriptPushCursorAndCallback(BattleScript_PastelVeilActivates); + effect++; + } + } + gSpecialStatuses[battler].switchInAbilityDone = 1; + } + break; case ABILITY_ANTICIPATION: if (!gSpecialStatuses[battler].switchInAbilityDone) {