ebdc9ffc39
* Fixed some moves' on-hit effects bypassing Substitutes where they shouldn't. Fixed Sparkling Aria interaction with Shield Dust in Singles vs Doubles. Fixed Wake-Up Slap and Smelling Salts getting boosted damage where they shouldn't vs Substitutes. * Cleaned up check for Sparkling Aria+Shield Dust interaction and fixed for agbcc. Fixed logic for checking if moves should do extra damage on statused targets. Wrote tests for Wake-Up Slap and Smelling Salts receicing extra damage on statused targets. Wrote tests to check Thousand Arrows type effectiveness vs ungrounded Flying types. * Update src/battle_util.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update src/battle_script_commands.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update src/battle_script_commands.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/ability/shield_dust.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/item_effect/covert_cloak.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/item_effect/covert_cloak.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/item_effect/covert_cloak.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/move_effect/smelling_salts.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/move_effect/thousand_arrows.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/move_effect/wake_up_slap.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/move_effect/wake_up_slap.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> * Update test/battle/move_effect/wake_up_slap.c Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com> --------- Co-authored-by: Hedara <hedara90@gmail.com> Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
101 lines
3.2 KiB
C
101 lines
3.2 KiB
C
#include "global.h"
|
|
#include "test/battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gMovesInfo[MOVE_SALT_CURE].effect == EFFECT_SALT_CURE);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Salt Cure inflicts 1/8 of the target's maximum HP as damage per turn")
|
|
{
|
|
u32 j;
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_SALT_CURE); }
|
|
for (j = 0; j < 3; j++)
|
|
TURN {}
|
|
} SCENE {
|
|
s32 maxHP = GetMonData(&OPPONENT_PARTY[0], MON_DATA_MAX_HP);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
|
|
MESSAGE("Foe Wobbuffet is being salt cured!");
|
|
for (j = 0; j < 4; j++) {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
|
|
HP_BAR(opponent, damage: maxHP / 8);
|
|
MESSAGE("Foe Wobbuffet is hurt by Salt Cure!");
|
|
}
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Salt Cure inflicts 1/4 to Water/Steel types of their maximum HP as damage per turn")
|
|
{
|
|
u32 species;
|
|
|
|
PARAMETRIZE { species = SPECIES_LAPRAS; };
|
|
PARAMETRIZE { species = SPECIES_JIRACHI; };
|
|
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(species);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_SALT_CURE); }
|
|
TURN {}
|
|
} SCENE {
|
|
s32 maxHP = GetMonData(&OPPONENT_PARTY[0], MON_DATA_MAX_HP);
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
|
|
HP_BAR(opponent, damage: maxHP / 4);
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
|
|
HP_BAR(opponent, damage: maxHP / 4);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Salt Cure is removed when the afflicted Pokémon is switched out")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_SALT_CURE); }
|
|
TURN { SWITCH(opponent, 1); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
|
|
MESSAGE("Foe Wobbuffet is being salt cured!");
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
|
|
MESSAGE("Foe Wobbuffet is hurt by Salt Cure!");
|
|
NONE_OF {
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
|
|
MESSAGE("Foe Wobbuffet is hurt by Salt Cure!");
|
|
}
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("If Salt Cure faints the target no status will be applied")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
|
|
} WHEN {
|
|
TURN { MOVE(player, MOVE_SALT_CURE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
|
|
NOT MESSAGE("Foe Wobbuffet is being salt cured!");
|
|
MESSAGE("Foe Wobbuffet fainted!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Salt Cure does not get applied if hitting a Substitute")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SUBSTITUTE); MOVE(player, MOVE_SALT_CURE); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
|
|
MESSAGE("The SUBSTITUTE took damage for Foe Wobbuffet!");
|
|
NOT MESSAGE("Foe Wobbuffet is being salt cured!");
|
|
}
|
|
}
|