Class StruggleTests

java.lang.Object
com.pixelmonmod.pixelmon.api.test.impl.move.StruggleTests

public class StruggleTests extends Object
Tests for Struggle
  • Constructor Details

    • StruggleTests

      public StruggleTests()
  • Method Details

    • testStruggleCanCriticallyHit

      public static CompletableFuture<TestResult> testStruggleCanCriticallyHit(BattleTestHelper helper)
      Struggle is capable of striking a critical hit.

      In this test, a Scatterbug that holds a Razor Claw and knows the move Struggle faces a Spewpa that knows the move Harden.

           Before Turn 1
           The Scatterbug is given the Pumped status to raise its critical-hit ratio stage to 3.
           Turn 1
           The Scatterbug uses Struggle.
           The Spewpa uses Harden.
           -
           We verify that the Scatterbug's attack critically hit.
       
    • testStruggleIsUsedWhenOnlyMoveIsDisabledBySlowerAttacker

      public static CompletableFuture<TestResult> testStruggleIsUsedWhenOnlyMoveIsDisabledBySlowerAttacker(BattleTestHelper helper)
      Struggle cannot be learned like other moves, but it will be automatically used by any Pokémon that is ordered to attack when it has no usable moves.

      In this test, a Scatterbug that knows the move Sleep Talk faces a Jigglypuff that knows the move Disable.

           Turn 1
           The Scatterbug uses Sleep Talk.
           The Jigglypuff uses Disable. The Scatterbug can no longer use Sleep Talk.
           Turn 2
           The Scatterbug "selects" Sleep Talk but is forced to use Struggle.
           The Jigglypuff uses Disable.
           -
           After Turn 1
           We verify that the Scatterbug has the Disable status.
           We verify that the Jigglypuff's Sleep Talk attack has disabled set to true.
           After Turn 2
           We verify that the Scatterbug has the Disable status.
           We verify that the Jigglypuff's Sleep Talk attack has disabled set to true.
           We verify that the Scatterbug's last attack was Struggle.
       
    • testUsingStrugglePreventsMegaEvolving

      public static CompletableFuture<TestResult> testUsingStrugglePreventsMegaEvolving(BattleTestHelper helper)
      If a Pokémon is forced to use Struggle, it will not be able to Mega Evolve, Ultra Burst, use a Z-Move, Dynamax, or Terastallize on the same turn, as the menu from which this option would be selected never appears.

      In this test, an Audino that holds an Audinite knows the move Struggle faces a Drowzee that knows the move Sleep Talk.

           Turn 1
           The Audino uses Struggle.
           The Drowzee uses Sleep Talk.
           -
           After Turn 1
           We verify that the Audino is not Mega Evolved.
       
    • testUsingStrugglePreventsDynamaxing

      public static CompletableFuture<TestResult> testUsingStrugglePreventsDynamaxing(BattleTestHelper helper)
      If a Pokémon is forced to use Struggle, it will not be able to Mega Evolve, Ultra Burst, use a Z-Move, Dynamax, or Terastallize on the same turn, as the menu from which this option would be selected never appears.

      In this test, a Scatterbug that knows the move Struggle faces a Drowzee that knows the move Sleep Talk.

           Turn 1
           The Scatterbug uses Struggle.
           The Drowzee uses Sleep Talk.
           -
           After Turn 1
           We verify that the Scatterbug is not Dynamaxed.
       
    • testStruggleCannotTurnIntoAMaxMove

      public static CompletableFuture<TestResult> testStruggleCannotTurnIntoAMaxMove(BattleTestHelper helper)
      If a Dynamax Pokémon is forced to use Struggle, it will not turn into a Max Move.

      In this test, a Scatterbug that knows the move String Shot faces a Drowzee that knows the move Sleep Talk. The Scatterbug's String Shot has only 1 PP.

           Turn 1
           The Scatterbug Dynamaxes.
           The Scatterbug selects String Shot and uses Max Guard.
           The Drowzee uses Sleep Talk. The Sleep Talk fails.
           Turn 2
           The Drowzee uses Sleep Talk.
           The Scatterbug uses Struggle.
           -
           Before Turn 1
           We verify that the Scatterbug's String Shot has only 1 PP.
           After Turn 1
           We verify that the Scatterbug is Dynamaxed.
           We verify that the Scatterbug's last move was Max Guard.
           We verify that the Scatterbug's String Shot/Max Guard has 0 PP.
           After Turn 2
           We verify that the Scatterbug is Dynamaxed.
           We verify that the Scatterbug's last attack was Struggle.
       
    • testStruggleDealsAtLeastOneDamage

      public static CompletableFuture<TestResult> testStruggleDealsAtLeastOneDamage(BattleTestHelper helper)
      Struggle deals at least one damage.

      In this test, a Shedinja that knows the move Struggle faces a Spearow that knows the move Sleep Talk.

           Turn 1
           The Spearow uses Sleep Talk.
           The Shedinja uses Struggle.
           -
           We verify that the Shedinja fainted from using Struggle.
       
    • testStruggleBypassesAccuracyChecks

      public static CompletableFuture<TestResult> testStruggleBypassesAccuracyChecks(BattleTestHelper helper)
      Struggle now bypasses accuracy checks to always hit, unless the target is in the semi-invulnerable turn of a move such as Dig or Fly.

      In this test, a Scatterbug that knows the move Struggle faces a Spewpa that knows the move Harden.

           Before Turn 1
           The Spewpa has its Evasion raised six stages.
           Turn 1
           The Scatterbug uses Struggle.
           The Spewpa uses Harden.
           -
           We verify that the Scatterbug's attack did not miss.
       
    • testStruggleCanNotBeCopiedByMirrorMove

      public static CompletableFuture<TestResult> testStruggleCanNotBeCopiedByMirrorMove(BattleTestHelper helper)
      From Gen IV and onwards, Struggle can no longer be copied by Mirror Move.

      In this test, a Fearow that knows the move Struggle faces a Spearow that knows the move Mirror Move.

           Turn 1
           The Fearow uses Struggle.
           The Spearow uses Mirror Move.
           -
           We verify that the Spearow's attack was Mirror Move.
           We verify that the Spearow's temporary attack was not Struggle.
           We verify that the Spearow's attack failed.
       
    • testStruggleRecoilRoundingOne

      public static CompletableFuture<TestResult> testStruggleRecoilRoundingOne(BattleTestHelper helper)
      Struggle's recoil calculation is now subject to standard rounding; for example, a Pokémon with 201 maximum HP using Struggle will have its recoil round down to 50.

      In this test, a Staryu that knows the move Struggle faces a Spewpa that knows the move Harden.

           Turn 1
           The Staryu uses Struggle.
           The Spewpa uses Harden.
           -
           Before Turn 1
           We verify that the Staryu has exactly 201 HP.
           After Turn 1
           We verify that the Staryu's has exactly 151 HP.
       
    • testStruggleRecoilRoundingTwo

      public static CompletableFuture<TestResult> testStruggleRecoilRoundingTwo(BattleTestHelper helper)
      Struggle's recoil calculation is now subject to standard rounding; for example, a Pokémon with 201 maximum HP using Struggle will have its recoil round down to 50, but 202 or 203 HP will round up to 51 recoil damage.

      In this test, a Staryu with 4 HP EVs that knows the move Struggle faces a Spewpa that knows the move Harden.

           Turn 1
           The Staryu uses Struggle.
           The Spewpa uses Harden.
           -
           Before Turn 1
           We verify that the Staryu has exactly 202 HP.
           After Turn 1
           We verify that the Staryu's has exactly 151 HP.
       
    • testStruggleRecoilRoundingThree

      public static CompletableFuture<TestResult> testStruggleRecoilRoundingThree(BattleTestHelper helper)
      Struggle's recoil calculation is now subject to standard rounding; for example, a Pokémon with 201 maximum HP using Struggle will have its recoil round down to 50, but 202 or 203 HP will round up to 51 recoil damage.

      In this test, a Staryu with 8 HP EVs that knows the move Struggle faces a Spewpa that knows the move Harden.

           Turn 1
           The Staryu uses Struggle.
           The Spewpa uses Harden.
           -
           Before Turn 1
           We verify that the Staryu has exactly 203 HP.
           After Turn 1
           We verify that the Staryu's has exactly 152 HP.
       
    • testStruggleDoesNotActivateChilanBerries

      public static CompletableFuture<TestResult> testStruggleDoesNotActivateChilanBerries(BattleTestHelper helper)
      From Gen V and onwards, Struggle no longer activates the Chilan Berry.

      In this test, a Scatterbug that knows the move Struggle faces a Spewpa that holds a Chilan Berry and knows the move Harden.

           Turn 1
           The Scatterbug uses Struggle.
           The Spewpa uses Harden.
           -
           We verify that the Spewpa is missing some HP.
           We verify that the Spewpa has a Chilan Berry as its held item.
       
    • testStruggleAffectedByTechnician

      public static CompletableFuture<TestResult> testStruggleAffectedByTechnician(BattleTestHelper helper)
      From Gen V and onwards, Struggle's power is boosted by Technician.

      In this Single Battle test, a Grapploct with the Limber ability that knows the move Struggle and a Grapploct with the Technician ability that also knows the move Struggle are on a team. They face a Fearow that knows Sleep Talk. A Single Battle must be used because Struggle always picks a random adjacent opponent to target.

           Turn 1
           The Fearow uses Sleep Talk.
           The Grapploct with Limber attacks the first Fearow with Struggle.
           Turn 2
           The Grapploct with Limber switches out to be replaced by the Grapploct with Technician.
           The Fearow uses Sleep Talk.
           Turn 3
           The Fearow uses Sleep Talk.
           The Grapploct with Technician uses Struggle.
           -
           We verify that the Fearow took more damage from the Grapploct with Technician than the Grapploct with Limber.