Fix toxic debris setting hazards on the wrong side when hit by an ally (#8026)
This commit is contained in:
parent
5b4403ddfe
commit
8c87522415
@ -6048,9 +6048,8 @@ BattleScript_ToxicDebrisActivates::
|
||||
printstring STRINGID_POISONSPIKESSCATTERED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_ToxicDebrisRet:
|
||||
copybyte sBATTLER, gBattlerTarget
|
||||
copybyte gBattlerTarget, gBattlerAttacker
|
||||
copybyte gBattlerAttacker, sBATTLER
|
||||
restoretarget
|
||||
restoreattacker
|
||||
return
|
||||
|
||||
BattleScript_EarthEaterActivates::
|
||||
|
||||
@ -4959,7 +4959,10 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||
&& IsBattlerTurnDamaged(gBattlerTarget)
|
||||
&& (gSideTimers[GetBattlerSide(gBattlerAttacker)].toxicSpikesAmount != 2))
|
||||
{
|
||||
SWAP(gBattlerAttacker, gBattlerTarget, i);
|
||||
SaveBattlerTarget(gBattlerTarget);
|
||||
SaveBattlerAttacker(gBattlerAttacker);
|
||||
gBattlerAttacker = gBattlerTarget;
|
||||
gBattlerTarget = BATTLE_OPPOSITE(gBattlerAttacker);
|
||||
BattleScriptCall(BattleScript_ToxicDebrisActivates);
|
||||
effect++;
|
||||
}
|
||||
|
||||
@ -120,3 +120,23 @@ SINGLE_BATTLE_TEST("Air Balloon is popped after Toxic Debris activates")
|
||||
MESSAGE("Glimmora's Air Balloon popped!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Toxic Debris sets Toxic Spikes on the opposing side even when hit by an ally")
|
||||
{
|
||||
struct BattlePokemon *user = NULL;
|
||||
|
||||
PARAMETRIZE{ user = opponentLeft; }
|
||||
PARAMETRIZE{ user = opponentRight; }
|
||||
PARAMETRIZE{ user = playerRight; }
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_GLIMMORA) { Ability(ABILITY_TOXIC_DEBRIS); }
|
||||
PLAYER(SPECIES_WYNAUT) { }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WYNAUT) { }
|
||||
} WHEN {
|
||||
TURN { MOVE(user, MOVE_SCRATCH, target: playerLeft); }
|
||||
} SCENE {
|
||||
ABILITY_POPUP(playerLeft, ABILITY_TOXIC_DEBRIS);
|
||||
MESSAGE("Poison spikes were scattered on the ground all around the opposing team!");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user