Fixed curse + Protean interaction (#5663)
Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
parent
b55c87f73f
commit
a06dc03207
2 changed files with 34 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue