Pastel Veil switchin effect attempt

Battle script isn't working for partner for some reason.
This commit is contained in:
BuffelSaft 2021-11-02 23:06:10 +13:00
parent 40bced517a
commit 95435b5f7f
5 changed files with 34 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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[] =

View file

@ -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)
{