Toxic Spikes print whether the target is poisoned or badly poisoned (#6814)

This commit is contained in:
spindrift64 2025-05-10 22:55:28 +02:00 committed by GitHub
parent 8d5d7c7fca
commit f4f82f2394
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 51 additions and 3 deletions

View File

@ -6223,6 +6223,14 @@ BattleScript_ToxicSpikesPoisoned::
waitstate
return
BattleScript_ToxicSpikesBadlyPoisoned::
printstring STRINGID_TOXICSPIKESBADLYPOISONED
waitmessage B_WAIT_TIME_LONG
statusanimation BS_SCRIPTING
updatestatusicon BS_SCRIPTING
waitstate
return
BattleScript_StickyWebOnSwitchIn::
savetarget
saveattacker

View File

@ -286,6 +286,7 @@ extern const u8 BattleScript_BadDreamsActivates[];
extern const u8 BattleScript_SwitchInAbilityMsg[];
extern const u8 BattleScript_SwitchInAbilityMsgRet[];
extern const u8 BattleScript_ToxicSpikesPoisoned[];
extern const u8 BattleScript_ToxicSpikesBadlyPoisoned[];
extern const u8 BattleScript_ToxicSpikesAbsorbed[];
extern const u8 BattleScript_StickyWebOnSwitchIn[];
extern const u8 BattleScript_SolarPowerActivates[];

View File

@ -729,8 +729,9 @@
#define STRINGID_ITDOESNTAFFECTTWOFOES 727
#define STRINGID_SENDCAUGHTMONPARTYORBOX 728
#define STRINGID_PKMNSENTTOPCAFTERCATCH 729
#define STRINGID_TOXICSPIKESBADLYPOISONED 730
#define BATTLESTRINGS_COUNT 730
#define BATTLESTRINGS_COUNT 731
// This is the string id that gBattleStringsTable starts with.
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,

View File

@ -638,6 +638,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_STEALTHROCKDMG] = COMPOUND_STRING("Pointed stones dug into {B_SCR_NAME_WITH_PREFIX2}!"),
[STRINGID_TOXICSPIKESABSORBED] = COMPOUND_STRING("The poison spikes disappeared from the ground around {B_SCR_TEAM2} team!"),
[STRINGID_TOXICSPIKESPOISONED] = COMPOUND_STRING("{B_SCR_NAME_WITH_PREFIX} was poisoned!"),
[STRINGID_TOXICSPIKESBADLYPOISONED] = COMPOUND_STRING("{B_SCR_NAME_WITH_PREFIX} was badly poisoned!"),
[STRINGID_STICKYWEBSWITCHIN] = COMPOUND_STRING("{B_SCR_NAME_WITH_PREFIX} was caught in a sticky web!"),
[STRINGID_HEALINGWISHCAMETRUE] = COMPOUND_STRING("The healing wish came true for {B_ATK_NAME_WITH_PREFIX2}!"),
[STRINGID_HEALINGWISHHEALED] = COMPOUND_STRING("{B_ATK_NAME_WITH_PREFIX} regained health!"),

View File

@ -8253,8 +8253,11 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
i = GetBattlerAbility(battler);
if (CanBePoisoned(gBattlerAttacker, battler, i))
{
if (gSideTimers[GetBattlerSide(battler)].toxicSpikesAmount >= 2)
u32 tspikes = 0;
if (gSideTimers[GetBattlerSide(battler)].toxicSpikesAmount >= 2) {
tspikes = 1;
gBattleMons[battler].status1 |= STATUS1_TOXIC_POISON;
}
else
gBattleMons[battler].status1 |= STATUS1_POISON;
@ -8262,7 +8265,10 @@ static bool32 DoSwitchInEffectsForBattler(u32 battler)
MarkBattlerForControllerExec(battler);
gBattleScripting.battler = battler;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_ToxicSpikesPoisoned;
if (tspikes == 0)
gBattlescriptCurrInstr = BattleScript_ToxicSpikesPoisoned;
else
gBattlescriptCurrInstr = BattleScript_ToxicSpikesBadlyPoisoned;
}
}
}

View File

@ -235,3 +235,34 @@ SINGLE_BATTLE_TEST("Toxic Spikes inflicts poison on switch in after Primal Rever
STATUS_ICON(player, poison: TRUE);
}
}
SINGLE_BATTLE_TEST("Toxic Spikes print normal poison for 1 layer")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WYNAUT);
} WHEN {
TURN { MOVE(player, MOVE_TOXIC_SPIKES); }
TURN { SWITCH(opponent, 1); }
TURN {}
} SCENE {
MESSAGE("The opposing Wynaut was poisoned!");
}
}
SINGLE_BATTLE_TEST("Toxic Spikes print bad poison for 2 layers")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WYNAUT);
} WHEN {
TURN { MOVE(player, MOVE_TOXIC_SPIKES); }
TURN { MOVE(player, MOVE_TOXIC_SPIKES); }
TURN { SWITCH(opponent, 1); }
TURN {}
} SCENE {
MESSAGE("The opposing Wynaut was badly poisoned!");
}
}