mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Fix for Burn Up/Double Shock (#2962)
This commit is contained in:
parent
176c6750aa
commit
2d6282fece
@ -1444,8 +1444,9 @@ BattleScript_EffectBurnUp:
|
|||||||
goto BattleScript_ButItFailed
|
goto BattleScript_ButItFailed
|
||||||
|
|
||||||
BattleScript_BurnUpWorks:
|
BattleScript_BurnUpWorks:
|
||||||
setmoveeffect MOVE_EFFECT_BURN_UP | MOVE_EFFECT_CERTAIN
|
setmoveeffect MOVE_EFFECT_BURN_UP | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
|
||||||
goto BattleScript_EffectHit
|
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||||
|
goto BattleScript_HitFromCritCalc
|
||||||
|
|
||||||
BattleScript_BurnUpRemoveType::
|
BattleScript_BurnUpRemoveType::
|
||||||
losetype BS_ATTACKER, TYPE_FIRE
|
losetype BS_ATTACKER, TYPE_FIRE
|
||||||
@ -1461,8 +1462,9 @@ BattleScript_EffectDoubleShock:
|
|||||||
goto BattleScript_ButItFailed
|
goto BattleScript_ButItFailed
|
||||||
|
|
||||||
BattleScript_DoubleShockWorks:
|
BattleScript_DoubleShockWorks:
|
||||||
setmoveeffect MOVE_EFFECT_DOUBLE_SHOCK | MOVE_EFFECT_CERTAIN
|
setmoveeffect MOVE_EFFECT_DOUBLE_SHOCK | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
|
||||||
goto BattleScript_EffectHit
|
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||||
|
goto BattleScript_HitFromCritCalc
|
||||||
|
|
||||||
BattleScript_DoubleShockRemoveType::
|
BattleScript_DoubleShockRemoveType::
|
||||||
losetype BS_ATTACKER, TYPE_ELECTRIC
|
losetype BS_ATTACKER, TYPE_ELECTRIC
|
||||||
|
53
test/move_effect_burn_up.c
Normal file
53
test/move_effect_burn_up.c
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "test_battle.h"
|
||||||
|
|
||||||
|
ASSUMPTIONS
|
||||||
|
{
|
||||||
|
ASSUME(gBattleMoves[MOVE_BURN_UP].effect == EFFECT_BURN_UP);
|
||||||
|
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FIRE || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FIRE);
|
||||||
|
ASSUME(gSpeciesInfo[SPECIES_CYNDAQUIL].types[0] == TYPE_FIRE || gSpeciesInfo[SPECIES_CYNDAQUIL].types[1] == TYPE_FIRE);
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Burn Up user loses its Fire-type")
|
||||||
|
{
|
||||||
|
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")
|
||||||
|
{
|
||||||
|
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 its Fire-type if enemy faints")
|
||||||
|
{
|
||||||
|
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!");
|
||||||
|
}
|
||||||
|
}
|
53
test/move_effect_double_shock.c
Normal file
53
test/move_effect_double_shock.c
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "test_battle.h"
|
||||||
|
|
||||||
|
ASSUMPTIONS
|
||||||
|
{
|
||||||
|
ASSUME(gBattleMoves[MOVE_DOUBLE_SHOCK].effect == EFFECT_DOUBLE_SHOCK);
|
||||||
|
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC);
|
||||||
|
ASSUME(gSpeciesInfo[SPECIES_PIKACHU].types[0] == TYPE_ELECTRIC || gSpeciesInfo[SPECIES_PIKACHU].types[1] == TYPE_ELECTRIC);
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type")
|
||||||
|
{
|
||||||
|
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 an Electric-type")
|
||||||
|
{
|
||||||
|
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 its Electric-type if enemy faints")
|
||||||
|
{
|
||||||
|
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!");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user