sovereignx/test/battle/ability/sheer_force.c
Nephrite 4a1a6c5625
Battlemove refactored (recoil, crit and Z moves) (#3575)
* Unified EFFECT_RECOIL

Combined EFFECT_RECOIL_25/33/50/33_STATUS into a single EFFECT; added an extra field to BattleMove 'secondaryData' that contains the franction of HP recoil; argument still holds status effect for Flare Blitz/Volt Tackle

* BattleMove struct change

Added critrate, recoil, multihit fields, made zMove into a union of effect/powerOverride for status/non-status moves respectively. Added new recoil field and zMove field to all moves. To-do: crit rate, multihit

* Critrate field added

Moves use a critRate field instead of a flag - obsoletes EFFECT_ALWAYS_CRIT

* Just a little define

Makes clear that critBoost = 3 means ALWAYS CRIT

* Added a proper recoil field

Just to make it unambiguous and flexible - can finally have a move with 69% recoil.

* Fixed AI damage calculation for multi-strike moves

* Fixes + removed unused effects

* Tests fixes

Two to fix: pass when run in isolation but not when the whole group is run, which is annoying...

* Minor fixes

* Minor tweaks

* Fixed move effects

* recoil tests

---------

Co-authored-by: Alex <alexthenotes@gmail.com>
2023-12-19 16:10:07 +01:00

56 lines
2 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Sheer Force boosts power, but removes secondary effects of moves", s16 damage)
{
s32 j;
u32 ability = 0, move = 0;
for (j = 1; j < MOVES_COUNT; j++)
{
if (gBattleMoves[j].sheerForceBoost && j != MOVE_ORDER_UP)
{
PARAMETRIZE { ability = ABILITY_ANGER_POINT; move = j; }
PARAMETRIZE { ability = ABILITY_SHEER_FORCE; move = j; }
}
}
GIVEN {
PLAYER(SPECIES_TAUROS) { Ability(ability); Status1(move == MOVE_SNORE ? STATUS1_SLEEP : STATUS1_NONE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, move); }
if (gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE) {
TURN { SKIP_TURN(player); }
TURN { ; }
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
if (ability == ABILITY_SHEER_FORCE) {
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
STATUS_ICON(opponent, STATUS1_FREEZE);
STATUS_ICON(opponent, STATUS1_POISON);
STATUS_ICON(opponent, STATUS1_BURN);
STATUS_ICON(opponent, STATUS1_TOXIC_POISON);
STATUS_ICON(opponent, STATUS1_PARALYSIS);
MESSAGE("Wobbuffet is confused!");
MESSAGE("Wobbuffet flinched!");
}
// Volt Tackle/Flare Blitz edge case: recoil happens, but target isn't statused
if (gBattleMoves[move].effect == EFFECT_RECOIL)
{
HP_BAR(player);
MESSAGE("Tauros is hit with recoil!");
}
}
} FINALLY {
s32 j;
for (j = 0; j < gBattleTestRunnerState->parametersCount; j+=2)
{
EXPECT_GT(results[j+1].damage, results[j].damage);
}
}
}