fix telekinesis not working (#3763)
* fix telekinesis not working * typo * remove one roost known failing --------- Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
parent
e1d4bcc04e
commit
64f8635496
4 changed files with 79 additions and 2 deletions
|
@ -2994,7 +2994,7 @@ BattleScript_EffectTelekinesis:
|
||||||
settelekinesis BattleScript_ButItFailed
|
settelekinesis BattleScript_ButItFailed
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
printstring STRINGID_PKMNIDENTIFIED
|
printstring STRINGID_HURLEDINTOTHEAIR
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
|
|
|
@ -1559,6 +1559,14 @@ static bool32 AccuracyCalcHelper(u16 move)
|
||||||
RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD);
|
RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
// If the target is under the effects of Telekinesis, and the move isn't a OH-KO move, move hits.
|
||||||
|
else if (gStatuses3[gBattlerTarget] & STATUS3_TELEKINESIS
|
||||||
|
&& !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)
|
||||||
|
&& gBattleMoves[move].effect != EFFECT_OHKO)
|
||||||
|
{
|
||||||
|
JumpIfMoveFailed(7, move);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (gBattleStruct->zmove.active && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE))
|
if (gBattleStruct->zmove.active && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE))
|
||||||
{
|
{
|
||||||
|
|
|
@ -415,7 +415,6 @@ SINGLE_BATTLE_TEST("Roost does not suppress the ungrounded effect of Magnet Rise
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("Roost does not suppress the ungrounded effect of Telekinesis")
|
SINGLE_BATTLE_TEST("Roost does not suppress the ungrounded effect of Telekinesis")
|
||||||
{
|
{
|
||||||
KNOWN_FAILING; // Telekinesis currently says the pokemon was identified
|
|
||||||
GIVEN {
|
GIVEN {
|
||||||
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
|
||||||
OPPONENT(SPECIES_WOBBUFFET);
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
|
70
test/battle/move_effect/telekinesis.c
Normal file
70
test/battle/move_effect/telekinesis.c
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "test/battle.h"
|
||||||
|
|
||||||
|
ASSUMPTIONS
|
||||||
|
{
|
||||||
|
ASSUME(gBattleMoves[MOVE_TELEKINESIS].effect == EFFECT_TELEKINESIS);
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Telekinesis makes the target unable to avoid any attacks made against it")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_MINIMIZE].effect == EFFECT_MINIMIZE); // Raises evs by 2
|
||||||
|
ASSUME(gBattleMoves[MOVE_SCREECH].accuracy < 100);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WYNAUT);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_TELEKINESIS); MOVE(opponent, MOVE_MINIMIZE); }
|
||||||
|
TURN { MOVE(player, MOVE_SCREECH, hit:FALSE); }
|
||||||
|
} SCENE {
|
||||||
|
MESSAGE("Wobbuffet used Telekinesis!");
|
||||||
|
MESSAGE("Foe Wynaut was hurled into the air!");
|
||||||
|
MESSAGE("Foe Wynaut used Minimize!");
|
||||||
|
MESSAGE("Wobbuffet used Screech!");
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCREECH, player);
|
||||||
|
NOT MESSAGE("Wobbuffet's attack missed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Telekinesis ends after 3 turns")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WYNAUT);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_TELEKINESIS); }
|
||||||
|
TURN { }
|
||||||
|
TURN { }
|
||||||
|
} SCENE {
|
||||||
|
MESSAGE("Wobbuffet used Telekinesis!");
|
||||||
|
MESSAGE("Foe Wynaut was hurled into the air!");
|
||||||
|
MESSAGE("Wobbuffet used Celebrate!");
|
||||||
|
MESSAGE("Wobbuffet used Celebrate!");
|
||||||
|
MESSAGE("Foe Wynaut was freed from the telekinesis!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Telekinesis makes the target immune to Ground-type attacks")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_BULLDOZE].type == TYPE_GROUND);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WYNAUT);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLDOZE); }
|
||||||
|
TURN { MOVE(player, MOVE_TELEKINESIS); }
|
||||||
|
TURN { MOVE(player, MOVE_BULLDOZE); }
|
||||||
|
} SCENE {
|
||||||
|
MESSAGE("Wobbuffet used Bulldoze!");
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLDOZE, player);
|
||||||
|
HP_BAR(opponent);
|
||||||
|
MESSAGE("Wobbuffet used Telekinesis!");
|
||||||
|
MESSAGE("Foe Wynaut was hurled into the air!");
|
||||||
|
MESSAGE("Wobbuffet used Bulldoze!");
|
||||||
|
NONE_OF {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLDOZE, player);
|
||||||
|
HP_BAR(opponent);
|
||||||
|
}
|
||||||
|
MESSAGE("It doesn't affect Foe Wynaut…");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue