diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 3cf9113196..80b50fb208 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2994,7 +2994,7 @@ BattleScript_EffectTelekinesis: settelekinesis BattleScript_ButItFailed attackanimation waitanimation - printstring STRINGID_PKMNIDENTIFIED + printstring STRINGID_HURLEDINTOTHEAIR waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1f9b48f478..d4cae009ce 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1559,6 +1559,14 @@ static bool32 AccuracyCalcHelper(u16 move) RecordAbilityBattle(gBattlerTarget, ABILITY_NO_GUARD); 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)) { diff --git a/test/battle/move_effect/roost.c b/test/battle/move_effect/roost.c index 15628597d8..3a46350ed3 100644 --- a/test/battle/move_effect/roost.c +++ b/test/battle/move_effect/roost.c @@ -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") { - KNOWN_FAILING; // Telekinesis currently says the pokemon was identified GIVEN { PLAYER(SPECIES_WOBBUFFET) { HP(1); } OPPONENT(SPECIES_WOBBUFFET); diff --git a/test/battle/move_effect/telekinesis.c b/test/battle/move_effect/telekinesis.c new file mode 100644 index 0000000000..7dbce2d1fd --- /dev/null +++ b/test/battle/move_effect/telekinesis.c @@ -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…"); + } +}