Fixed curse + Protean interaction (#5663)

Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
hedara90 2024-11-12 19:18:37 +01:00 committed by GitHub
parent b55c87f73f
commit a06dc03207
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View file

@ -4159,6 +4159,7 @@ BattleScript_EffectMinimize::
BattleScript_EffectCurse::
jumpiftype BS_ATTACKER, TYPE_GHOST, BattleScript_GhostCurse
attackcanceler
jumpiftype BS_ATTACKER, TYPE_GHOST, BattleScript_DoGhostCurse
attackstring
ppreduce
jumpifstat BS_ATTACKER, CMP_GREATER_THAN, STAT_SPEED, MIN_STAT_STAGE, BattleScript_CurseTrySpeed

View file

@ -34,3 +34,36 @@ SINGLE_BATTLE_TEST("Curse cuts the user's HP in half when used by Ghost-types")
HP_BAR(player, hp: maxHP / 2);
}
}
SINGLE_BATTLE_TEST("Curse applies to the user if used with Protean")
{
GIVEN {
PLAYER(SPECIES_KECLEON) { Ability(ABILITY_PROTEAN); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CURSE, target: player); }
} SCENE {
s32 playerMaxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP);
ABILITY_POPUP(player, ABILITY_PROTEAN);
ANIMATION(ANIM_TYPE_MOVE, MOVE_CURSE, player);
HP_BAR(player, damage: playerMaxHP / 2);
HP_BAR(player, damage: playerMaxHP / 4);
}
}
SINGLE_BATTLE_TEST("Curse applies to the opponent if user is afflicted by Trick-or-Treat in the same turn")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_TRICK_OR_TREAT); MOVE(player, MOVE_CURSE, target: player); }
} SCENE {
s32 playerMaxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP);
s32 opponentMaxHP = GetMonData(&OPPONENT_PARTY[0], MON_DATA_MAX_HP);
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRICK_OR_TREAT, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_CURSE, player);
HP_BAR(player, damage: playerMaxHP / 2);
HP_BAR(opponent, damage: opponentMaxHP / 4);
}
}