sovereignx/test/battle/ability/swarm.c
Eduardo Quezada D'Ottone 6d1d6a5d5f
Fixed test battle move category assumptions (#4051)
* Fixed move category assumptions

* Update test/battle/ai_check_viability.c

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2024-01-24 10:43:57 +01:00

29 lines
1.3 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Swarm boosts Bug-type moves in a pinch", s16 damage)
{
u16 hp;
PARAMETRIZE { hp = 99; }
PARAMETRIZE { hp = 33; }
GIVEN {
ASSUME(gBattleMoves[MOVE_BUG_BITE].type == TYPE_BUG);
ASSUME(gBattleMoves[MOVE_BUG_BITE].power == 60);
ASSUME(gBattleMoves[MOVE_BUG_BITE].category == BATTLE_CATEGORY_PHYSICAL);
ASSUME(gSpeciesInfo[SPECIES_LEDYBA].types[0] == TYPE_BUG);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] == TYPE_PSYCHIC);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[1] == TYPE_PSYCHIC);
PLAYER(SPECIES_LEDYBA) { Ability(ABILITY_SWARM); MaxHP(99); HP(hp); Attack(45); }
OPPONENT(SPECIES_WOBBUFFET) { Defense(121); }
} WHEN {
TURN { MOVE(player, MOVE_BUG_BITE); }
} SCENE {
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
// Due to numerics related to rounding on each applied multiplier,
// the 50% move power increase doesn't manifest as a 50% damage increase, but as a 44% damage increase in this case.
// Values obtained from https://calc.pokemonshowdown.com (Neutral nature and 0 IVs on both sides)
EXPECT_EQ(results[0].damage, 50);
EXPECT_EQ(results[1].damage, 72);
}
}