Skip to content

Commit

Permalink
Tests for BurnUp/DoublShock
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine committed Apr 29, 2023
1 parent e179344 commit 4146f01
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -16541,7 +16541,6 @@ void BS_ItemCureStatus(void) {
NATIVE_ARGS();
struct Pokemon *party = GetBattlerParty(gBattlerAttacker);


// Heal Status1 conditions.
HealStatusConditions(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], gBattleStruct->itemPartyIndex[gBattlerAttacker], GetItemStatus1Mask(gLastUsedItem), gBattlerAttacker);

Expand Down
57 changes: 57 additions & 0 deletions test/move_effect_burn_up.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include "global.h"
#include "test_battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_BURN_UP].effect == EFFECT_BURN_UP);
}

SINGLE_BATTLE_TEST("Burn Up user loses it's typing", s16 damage)
{
s16 stabDamage;
s16 nonStabDamage;

GIVEN {
PLAYER(SPECIES_CYNDAQUIL);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BURN_UP); }
TURN { MOVE(player, MOVE_BURN_UP); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BURN_UP, player);
MESSAGE("Cyndaquil burned itself out!");
MESSAGE("Cyndaquil used Burn Up!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Burn Up fails if the user isn't a fire type", s16 damage)
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BURN_UP); }
} SCENE {
NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_BURN_UP, player); }
MESSAGE("Wobbuffet used Burn Up!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Burn Up user loses it's typing if enemy faints", s16 damage)
{
s16 stabDamage;
s16 nonStabDamage;

GIVEN {
PLAYER(SPECIES_CYNDAQUIL);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
} WHEN {
TURN { MOVE(player, MOVE_BURN_UP); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BURN_UP, player);
HP_BAR(opponent, hp: 0);
MESSAGE("Cyndaquil burned itself out!");
}
}
57 changes: 57 additions & 0 deletions test/move_effect_double_shock.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include "global.h"
#include "test_battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_DOUBLE_SHOCK].effect == EFFECT_DOUBLE_SHOCK);
}

SINGLE_BATTLE_TEST("Double Shock user loses it's typing", s16 damage)
{
s16 stabDamage;
s16 nonStabDamage;

GIVEN {
PLAYER(SPECIES_PIKACHU);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player);
MESSAGE("Pikachu used up all of its electricity!");
MESSAGE("Pikachu used Double Shock!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Double Shock fails if the user isn't a fire type", s16 damage)
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player); }
MESSAGE("Wobbuffet used Double Shock!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Double Shock user loses it's typing if enemy faints", s16 damage)
{
s16 stabDamage;
s16 nonStabDamage;

GIVEN {
PLAYER(SPECIES_PIKACHU);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player);
HP_BAR(opponent, hp: 0);
MESSAGE("Pikachu used up all of its electricity!");
}
}

0 comments on commit 4146f01

Please sign in to comment.