Fixes Eject Pack / Intimidate issue (#5902)

This commit is contained in:
Alex 2024-12-29 22:24:09 +01:00 committed by GitHub
parent a10f63e317
commit e64da065e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -8322,6 +8322,18 @@ u32 ItemBattleEffects(enum ItemEffect caseID, u32 battler, bool32 moveTurn)
gBattlescriptCurrInstr = BattleScript_WhiteHerbRet;
}
break;
case HOLD_EFFECT_EJECT_PACK:
if (gProtectStructs[battler].statFell
&& gProtectStructs[battler].disableEjectPack == 0
&& CountUsablePartyMons(battler) > 0)
{
gBattleScripting.battler = battler;
gPotentialItemEffectBattler = battler;
effect = ITEM_STATS_CHANGE;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_EjectPackActivates;
}
break;
}
break;
}

View file

@ -85,3 +85,19 @@ SINGLE_BATTLE_TEST("Eject Pack will miss timing to switch out user if Emergency
EXPECT(opponent->species == SPECIES_WYNAUT);
}
}
SINGLE_BATTLE_TEST("Eject Pack activates once intimidate mon switches in")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }
} WHEN {
TURN { SWITCH(opponent, 1); SEND_OUT(player, 1); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
MESSAGE("Wobbuffet is switched out with the Eject Pack!");
}
}