From 78439b4a02ea0fa09dd8de61d640451938a5a709 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Tue, 25 Feb 2025 20:03:46 -0800 Subject: [PATCH] Update to ESLint 9 (#10926) ESLint has a whole new config format, so I figure it's a good time to make the config system saner. - First, we no longer have separate eslint-no-types configs. Lint performance shouldn't be enough of a problem to justify the relevant maintenance complexity. - Second, our base config should work out-of-the-box now. `npx eslint` will work as expected, without any CLI flags. You should still use `npm run lint` which adds the `--cached` flag for performance. - Third, whatever updates I did fixed style linting, which apparently has been bugged for quite some time, considering all the obvious mixed-tabs-and-spaces issues I found in the upgrade. Also here are some changes to our style rules. In particular: - Curly brackets (for objects etc) now have spaces inside them. Sorry for the huge change. ESLint doesn't support our old style, and most projects use Prettier style, so we might as well match them in this way. See https://github.com/eslint-stylistic/eslint-stylistic/issues/415 - String + number concatenation is no longer allowed. We now consistently use template strings for this. --- .eslintrc-no-types.json | 359 - .eslintrc.json | 51 - .github/workflows/test.yml | 2 +- .vscode/settings.json | 6 +- build | 6 +- config/formats.ts | 90 +- data/abilities.ts | 414 +- data/cg-team-data.ts | 36 +- data/cg-teams.ts | 60 +- data/conditions.ts | 44 +- data/items.ts | 54 +- data/mods/fullpotential/scripts.ts | 2 +- data/mods/gen1/conditions.ts | 7 +- data/mods/gen1/moves.ts | 26 +- data/mods/gen1/pokedex.ts | 304 +- data/mods/gen1/rulesets.ts | 2 +- data/mods/gen1/scripts.ts | 22 +- data/mods/gen1jpn/moves.ts | 2 +- data/mods/gen1jpn/rulesets.ts | 60 +- data/mods/gen1stadium/conditions.ts | 4 +- data/mods/gen1stadium/moves.ts | 8 +- data/mods/gen1stadium/scripts.ts | 20 +- data/mods/gen2/conditions.ts | 6 +- data/mods/gen2/moves.ts | 34 +- data/mods/gen2/rulesets.ts | 60 +- data/mods/gen2/scripts.ts | 8 +- data/mods/gen2doubles/scripts.ts | 8 +- data/mods/gen2stadium2/conditions.ts | 2 +- data/mods/gen2stadium2/moves.ts | 2 +- data/mods/gen2stadium2/scripts.ts | 6 +- data/mods/gen3/abilities.ts | 6 +- data/mods/gen3/conditions.ts | 2 +- data/mods/gen3/moves.ts | 44 +- data/mods/gen3/scripts.ts | 14 +- data/mods/gen4/abilities.ts | 26 +- data/mods/gen4/conditions.ts | 2 +- data/mods/gen4/items.ts | 4 +- data/mods/gen4/moves.ts | 136 +- data/mods/gen4/scripts.ts | 6 +- data/mods/gen5/abilities.ts | 4 +- data/mods/gen5/conditions.ts | 4 +- data/mods/gen5/moves.ts | 94 +- data/mods/gen5/pokedex.ts | 104 +- data/mods/gen6/abilities.ts | 8 +- data/mods/gen6/moves.ts | 26 +- data/mods/gen6/pokedex.ts | 118 +- data/mods/gen7/abilities.ts | 6 +- data/mods/gen7/moves.ts | 32 +- data/mods/gen7/pokedex.ts | 46 +- data/mods/gen7letsgo/scripts.ts | 4 +- data/mods/gen7pokebilities/abilities.ts | 18 +- data/mods/gen8/abilities.ts | 12 +- data/mods/gen8/moves.ts | 34 +- data/mods/gen8/pokedex.ts | 56 +- data/mods/gen8/rulesets.ts | 4 +- data/mods/gen8bdsp/moves.ts | 2 +- data/mods/gen8linked/moves.ts | 22 +- data/mods/gen8linked/scripts.ts | 22 +- data/mods/gen9dlc1/abilities.ts | 8 +- data/mods/gen9dlc1/moves.ts | 12 +- data/mods/gen9dlc1/pokedex.ts | 4 +- data/mods/gen9predlc/abilities.ts | 8 +- data/mods/gen9predlc/pokedex.ts | 8 +- data/mods/gen9ssb/abilities.ts | 162 +- data/mods/gen9ssb/conditions.ts | 28 +- data/mods/gen9ssb/moves.ts | 452 +- data/mods/gen9ssb/pokedex.ts | 486 +- data/mods/gen9ssb/random-teams.ts | 368 +- data/mods/gen9ssb/rulesets.ts | 4 +- data/mods/gen9ssb/scripts.ts | 116 +- data/mods/littlecolosseum/abilities.ts | 10 +- data/mods/littlecolosseum/moves.ts | 14 +- data/mods/littlecolosseum/pokedex.ts | 66 +- data/mods/littlecolosseum/scripts.ts | 2 +- data/mods/mixandmega/items.ts | 4 +- data/mods/mixandmega/scripts.ts | 10 +- data/mods/partnersincrime/abilities.ts | 2 +- data/mods/partnersincrime/moves.ts | 12 +- data/mods/partnersincrime/scripts.ts | 28 +- data/mods/passiveaggressive/abilities.ts | 4 +- data/mods/passiveaggressive/conditions.ts | 2 +- data/mods/passiveaggressive/items.ts | 2 +- data/mods/passiveaggressive/moves.ts | 8 +- data/mods/passiveaggressive/scripts.ts | 12 +- data/mods/pokebilities/abilities.ts | 26 +- data/mods/pokemoves/abilities.ts | 4 +- data/mods/randomroulette/scripts.ts | 8 +- data/mods/sharedpower/abilities.ts | 4 +- data/mods/sharingiscaring/scripts.ts | 12 +- data/mods/thecardgame/abilities.ts | 2 +- data/mods/thecardgame/moves.ts | 2 +- data/mods/thecardgame/scripts.ts | 2 +- data/mods/trademarked/scripts.ts | 6 +- data/moves.ts | 2706 ++++---- data/pokedex.ts | 6158 ++++++++--------- data/pokemongo.ts | 2030 +++--- data/random-battles/gen1/teams.ts | 20 +- data/random-battles/gen2/teams.ts | 44 +- data/random-battles/gen3/teams.ts | 23 +- data/random-battles/gen4/teams.ts | 13 +- data/random-battles/gen5/teams.ts | 27 +- data/random-battles/gen6/teams.ts | 53 +- data/random-battles/gen7/teams.ts | 112 +- data/random-battles/gen7apex/teams.ts | 6 +- data/random-battles/gen7letsgo/teams.ts | 60 +- data/random-battles/gen8/teams.ts | 386 +- data/random-battles/gen8bdsp/teams.ts | 208 +- data/random-battles/gen9/teams.ts | 125 +- data/random-battles/gen9baby/teams.ts | 21 +- data/random-battles/gen9cap/teams.ts | 20 +- data/rulesets.ts | 52 +- data/tags.ts | 2 +- data/text/abilities.ts | 2 +- data/text/default.ts | 2 +- data/text/items.ts | 2 +- data/text/moves.ts | 2 +- data/text/pokedex.ts | 2 +- data/typechart.ts | 60 +- eslint-ps-standard.mjs | 435 ++ eslint.config.mjs | 111 + lib/crashlogger.ts | 2 +- lib/dashycode.ts | 7 +- lib/database.ts | 19 +- lib/fs.ts | 31 +- lib/index.ts | 12 +- lib/net.ts | 4 +- lib/postgres.ts | 12 +- lib/process-manager.ts | 35 +- lib/repl.ts | 4 +- lib/sql.ts | 41 +- lib/streams.ts | 49 +- lib/utils.ts | 30 +- package-lock.json | 1969 +++--- package.json | 18 +- server/artemis/index.ts | 6 +- server/artemis/local.ts | 8 +- server/artemis/remote.ts | 26 +- server/chat-commands/admin.ts | 46 +- server/chat-commands/avatars.tsx | 33 +- server/chat-commands/core.ts | 61 +- server/chat-commands/info.ts | 122 +- server/chat-commands/moderation.ts | 93 +- server/chat-commands/room-settings.ts | 28 +- server/chat-formatter.ts | 6 +- server/chat-jsx.tsx | 24 +- server/chat-plugins/abuse-monitor.ts | 128 +- server/chat-plugins/announcements.ts | 4 +- server/chat-plugins/auction.ts | 20 +- server/chat-plugins/battlesearch.ts | 38 +- server/chat-plugins/calculator.ts | 8 +- server/chat-plugins/cg-teams-leveling.ts | 4 +- server/chat-plugins/chat-monitor.ts | 43 +- server/chat-plugins/chatlog.ts | 89 +- server/chat-plugins/daily-spotlight.ts | 11 +- server/chat-plugins/datasearch.ts | 381 +- server/chat-plugins/friends.ts | 34 +- server/chat-plugins/github.ts | 18 +- server/chat-plugins/hangman.ts | 20 +- server/chat-plugins/helptickets-auto.ts | 59 +- server/chat-plugins/helptickets.ts | 143 +- server/chat-plugins/hosts.ts | 10 +- server/chat-plugins/mafia.ts | 177 +- server/chat-plugins/modlog-viewer.ts | 26 +- server/chat-plugins/othermetas.ts | 38 +- server/chat-plugins/permalocks.ts | 18 +- server/chat-plugins/poll.ts | 34 +- server/chat-plugins/quotes.ts | 27 +- server/chat-plugins/randombattles/index.ts | 74 +- server/chat-plugins/randombattles/ssb.ts | 23 +- server/chat-plugins/randombattles/winrates.ts | 37 +- server/chat-plugins/repeats.ts | 8 +- server/chat-plugins/responder.ts | 21 +- server/chat-plugins/room-events.ts | 33 +- server/chat-plugins/room-faqs.ts | 12 +- server/chat-plugins/sample-teams.ts | 12 +- server/chat-plugins/scavenger-games.ts | 62 +- server/chat-plugins/scavengers.ts | 146 +- server/chat-plugins/seasons.ts | 16 +- server/chat-plugins/smogtours.ts | 8 +- server/chat-plugins/suspect-tests.ts | 10 +- server/chat-plugins/teams.ts | 11 +- server/chat-plugins/the-studio.ts | 30 +- server/chat-plugins/thing-of-the-day.ts | 62 +- server/chat-plugins/trivia/database.ts | 43 +- server/chat-plugins/trivia/transactions.ts | 14 +- server/chat-plugins/trivia/trivia.ts | 284 +- server/chat-plugins/uno.ts | 24 +- server/chat-plugins/username-prefixes.ts | 6 +- server/chat-plugins/usersearch.tsx | 50 +- server/chat-plugins/wifi.tsx | 248 +- server/chat-plugins/youtube.ts | 36 +- server/chat.ts | 185 +- server/config-loader.ts | 20 +- server/friends.ts | 69 +- server/global-types.ts | 12 +- server/global-variables.d.ts | 32 +- server/index.ts | 34 +- server/ip-tools.ts | 24 +- server/ladders-challenges.ts | 2 +- server/ladders-local.ts | 18 +- server/ladders-remote.ts | 4 +- server/ladders.ts | 18 +- server/loginserver.ts | 17 +- server/modlog/index.ts | 61 +- server/modlog/transactions.ts | 4 +- server/monitor.ts | 18 +- server/private-messages/database.ts | 6 +- server/private-messages/index.ts | 20 +- server/punishments.ts | 152 +- server/replays.ts | 9 +- server/room-battle-bestof.ts | 35 +- server/room-battle.ts | 52 +- server/room-game.ts | 18 +- server/room-minor-activity.ts | 14 +- server/roomlogs.ts | 18 +- server/rooms.ts | 115 +- server/sockets.ts | 31 +- server/team-validator-async.ts | 14 +- server/tournaments/generator-elimination.ts | 46 +- server/tournaments/generator-round-robin.ts | 6 +- server/tournaments/index.ts | 63 +- server/user-groups.ts | 10 +- server/users.ts | 40 +- server/verifier.ts | 24 +- sim/battle-actions.ts | 60 +- sim/battle-queue.ts | 5 +- sim/battle-stream.ts | 10 +- sim/battle.ts | 191 +- sim/dex-abilities.ts | 14 +- sim/dex-conditions.ts | 28 +- sim/dex-data.ts | 37 +- sim/dex-formats.ts | 40 +- sim/dex-items.ts | 34 +- sim/dex-moves.ts | 42 +- sim/dex-species.ts | 71 +- sim/dex.ts | 52 +- sim/examples/battle-stream-example.ts | 4 +- sim/field.ts | 20 +- sim/global-types.ts | 52 +- sim/index.ts | 16 +- sim/pokemon.ts | 116 +- sim/prng.ts | 4 +- sim/side.ts | 27 +- sim/state.ts | 21 +- sim/team-validator.ts | 125 +- sim/teams.ts | 57 +- sim/tools/exhaustive-runner.ts | 62 +- sim/tools/multi-random-runner.ts | 11 +- sim/tools/random-player-ai.ts | 20 +- sim/tools/runner.ts | 46 +- test/assert.js | 19 +- test/common.js | 8 +- test/lib/dashycode.js | 24 +- test/lib/postgres.js | 8 +- test/lib/sql.js | 6 +- test/random-battles/all-gens.js | 39 +- test/random-battles/gen1.js | 4 +- test/random-battles/gen5.js | 4 +- test/random-battles/gen6.js | 6 +- test/random-battles/gen7.js | 6 +- test/random-battles/gen8.js | 13 +- test/random-battles/gen9.js | 10 +- test/random-battles/tools.js | 2 +- test/server/cg-teams.js | 14 +- test/server/chat-commands/moderation.js | 2 +- test/server/chat-plugins/chat-monitor.js | 4 +- test/server/chat-plugins/friends.js | 4 +- test/server/chat-plugins/hangman.js | 8 +- test/server/chat-plugins/repeats.js | 6 +- test/server/chat-plugins/responder.js | 8 +- test/server/chat-plugins/trivia.js | 46 +- test/server/chat-plugins/username-prefixes.js | 8 +- test/server/chat-plugins/youtube.js | 8 +- test/server/chat.js | 6 +- test/server/ip-tools.js | 26 +- test/server/ladders.js | 14 +- test/server/modlog.js | 68 +- test/server/punishments.js | 32 +- test/server/room-battle.js | 16 +- test/server/rooms.js | 70 +- test/server/sockets.js | 22 +- test/server/users.js | 60 +- test/sim/abilities/aftermath.js | 10 +- test/sim/abilities/angerpoint.js | 28 +- test/sim/abilities/arenatrap.js | 18 +- test/sim/abilities/asone.js | 12 +- test/sim/abilities/battlearmor.js | 20 +- test/sim/abilities/berserk.js | 28 +- test/sim/abilities/cheekpouch.js | 16 +- test/sim/abilities/clearbody.js | 48 +- test/sim/abilities/cloudnine.js | 66 +- test/sim/abilities/colorchange.js | 16 +- test/sim/abilities/comatose.js | 42 +- test/sim/abilities/commander.js | 208 +- test/sim/abilities/contrary.js | 26 +- test/sim/abilities/costar.js | 64 +- test/sim/abilities/cursedbody.js | 12 +- test/sim/abilities/damp.js | 22 +- test/sim/abilities/dancer.js | 118 +- test/sim/abilities/dazzling.js | 16 +- test/sim/abilities/defiant.js | 22 +- test/sim/abilities/deltastream.js | 78 +- test/sim/abilities/desolateland.js | 104 +- test/sim/abilities/disguise.js | 66 +- test/sim/abilities/download.js | 46 +- test/sim/abilities/dryskin.js | 34 +- test/sim/abilities/emergencyexit.js | 224 +- test/sim/abilities/flashfire.js | 44 +- test/sim/abilities/flowergift.js | 34 +- test/sim/abilities/flowerveil.js | 31 +- test/sim/abilities/frisk.js | 30 +- test/sim/abilities/gluttony.js | 22 +- test/sim/abilities/guarddog.js | 12 +- test/sim/abilities/gulpmissile.js | 44 +- test/sim/abilities/hospitality.js | 20 +- test/sim/abilities/hungerswitch.js | 36 +- test/sim/abilities/iceface.js | 32 +- test/sim/abilities/illusion.js | 44 +- test/sim/abilities/immunity.js | 22 +- test/sim/abilities/imposter.js | 26 +- test/sim/abilities/intimidate.js | 86 +- test/sim/abilities/intrepidsword.js | 36 +- test/sim/abilities/klutz.js | 40 +- test/sim/abilities/levitate.js | 56 +- test/sim/abilities/lightningrod.js | 96 +- test/sim/abilities/liquidooze.js | 38 +- test/sim/abilities/magicbounce.js | 74 +- test/sim/abilities/magicguard.js | 38 +- test/sim/abilities/magician.js | 16 +- test/sim/abilities/magnetpull.js | 40 +- test/sim/abilities/mirrorarmor.js | 34 +- test/sim/abilities/moxie.js | 24 +- test/sim/abilities/multiscale.js | 16 +- test/sim/abilities/mummy.js | 28 +- test/sim/abilities/myceliummight.js | 26 +- test/sim/abilities/naturalcure.js | 10 +- test/sim/abilities/neutralizinggas.js | 244 +- test/sim/abilities/normalize.js | 68 +- test/sim/abilities/opportunist.js | 18 +- test/sim/abilities/owntempo.js | 10 +- test/sim/abilities/parentalbond.js | 34 +- test/sim/abilities/pastelveil.js | 78 +- test/sim/abilities/pickpocket.js | 32 +- test/sim/abilities/pickup.js | 100 +- test/sim/abilities/poisontouch.js | 60 +- test/sim/abilities/prankster.js | 72 +- test/sim/abilities/pressure.js | 162 +- test/sim/abilities/primordialsea.js | 106 +- test/sim/abilities/protean.js | 80 +- test/sim/abilities/protosynthesis.js | 72 +- test/sim/abilities/rattled.js | 16 +- test/sim/abilities/receiver.js | 28 +- test/sim/abilities/ripen.js | 46 +- test/sim/abilities/rockhead.js | 34 +- test/sim/abilities/roughskin.js | 10 +- test/sim/abilities/sapsipper.js | 16 +- test/sim/abilities/screencleaner.js | 20 +- test/sim/abilities/serenegrace.js | 46 +- test/sim/abilities/shadowtag.js | 52 +- test/sim/abilities/sheerforce.js | 40 +- test/sim/abilities/shellarmor.js | 20 +- test/sim/abilities/shielddust.js | 62 +- test/sim/abilities/shieldsdown.js | 16 +- test/sim/abilities/simple.js | 32 +- test/sim/abilities/slowstart.js | 26 +- test/sim/abilities/soulheart.js | 42 +- test/sim/abilities/stancechange.js | 10 +- test/sim/abilities/steelyspirit.js | 28 +- test/sim/abilities/stickyhold.js | 22 +- test/sim/abilities/stormdrain.js | 116 +- test/sim/abilities/sturdy.js | 58 +- test/sim/abilities/suctioncups.js | 26 +- test/sim/abilities/swordofruin.js | 18 +- test/sim/abilities/symbiosis.js | 96 +- test/sim/abilities/synchronize.js | 10 +- test/sim/abilities/technician.js | 50 +- test/sim/abilities/terashell.js | 69 +- test/sim/abilities/thickfat.js | 22 +- test/sim/abilities/trace.js | 48 +- test/sim/abilities/truant.js | 40 +- test/sim/abilities/unaware.js | 52 +- test/sim/abilities/unburden.js | 46 +- test/sim/abilities/unnerve.js | 36 +- test/sim/abilities/victorystar.js | 46 +- test/sim/abilities/wanderingspirit.js | 20 +- test/sim/abilities/windrider.js | 20 +- test/sim/abilities/wonderguard.js | 22 +- test/sim/abilities/zenmode.js | 16 +- test/sim/choice-parser.js | 334 +- test/sim/data.js | 32 +- test/sim/decisions.js | 967 ++- test/sim/dex.js | 30 +- test/sim/events.js | 28 +- test/sim/items/abilityshield.js | 102 +- test/sim/items/adrenalineorb.js | 74 +- test/sim/items/assaultvest.js | 16 +- test/sim/items/boosterenergy.js | 12 +- test/sim/items/choiceitem.js | 10 +- test/sim/items/drives.js | 36 +- test/sim/items/ejectpack.js | 126 +- test/sim/items/eviolite.js | 24 +- test/sim/items/flameorb.js | 26 +- test/sim/items/focussash.js | 30 +- test/sim/items/heavydutyboots.js | 20 +- test/sim/items/ironball.js | 52 +- test/sim/items/jabocaberry.js | 22 +- test/sim/items/keeberry.js | 10 +- test/sim/items/lansatberry.js | 18 +- test/sim/items/leftovers.js | 20 +- test/sim/items/leppaberry.js | 10 +- test/sim/items/lifeorb.js | 18 +- test/sim/items/lumberry.js | 22 +- test/sim/items/mail.js | 36 +- test/sim/items/metronome.js | 42 +- test/sim/items/mirrorherb.js | 34 +- test/sim/items/plates.js | 36 +- test/sim/items/protectivepads.js | 58 +- test/sim/items/punchingglove.js | 34 +- test/sim/items/quickclaw.js | 20 +- test/sim/items/redcard.js | 32 +- test/sim/items/ringtarget.js | 30 +- test/sim/items/rockyhelmet.js | 10 +- test/sim/items/roomservice.js | 24 +- test/sim/items/safetygoggles.js | 18 +- test/sim/items/seeds.js | 40 +- test/sim/items/shedshell.js | 40 +- test/sim/items/shellbell.js | 26 +- test/sim/items/sitrusberry.js | 34 +- test/sim/items/weaknesspolicy.js | 60 +- test/sim/items/whiteherb.js | 52 +- test/sim/misc/accuracy.js | 50 +- test/sim/misc/arceus.js | 32 +- test/sim/misc/ateabilities.js | 18 +- test/sim/misc/confusion.js | 12 +- test/sim/misc/critical.js | 12 +- test/sim/misc/dynamax.js | 130 +- test/sim/misc/endlessbattleclause.js | 109 +- test/sim/misc/faint-order.js | 94 +- test/sim/misc/fainted-forme-regression.js | 82 +- test/sim/misc/fusion-combo.js | 52 +- test/sim/misc/hazards.js | 80 +- test/sim/misc/inversebattle.js | 104 +- test/sim/misc/megaevolution.js | 76 +- test/sim/misc/mixandmega.js | 12 +- test/sim/misc/multi-battle.js | 18 +- test/sim/misc/ogerpon.js | 10 +- test/sim/misc/overflowstatmod.js | 20 +- test/sim/misc/partnersincrime.js | 44 +- test/sim/misc/pledgemoves.js | 48 +- test/sim/misc/prng.js | 48 +- test/sim/misc/recoil.js | 10 +- test/sim/misc/silvally.js | 20 +- test/sim/misc/sleepclausemod.js | 12 +- test/sim/misc/speed.js | 16 +- test/sim/misc/statdownoverflow.js | 20 +- test/sim/misc/state.js | 34 +- test/sim/misc/statuses.js | 175 +- test/sim/misc/statusmoves.js | 44 +- test/sim/misc/target-resolution.js | 300 +- test/sim/misc/teampreview.js | 32 +- test/sim/misc/terapagos.js | 18 +- test/sim/misc/terastal.js | 88 +- test/sim/misc/terastellar.js | 46 +- test/sim/misc/trapmoves.js | 210 +- test/sim/misc/turn-order.js | 140 +- test/sim/misc/twoturnmoves.js | 46 +- test/sim/misc/typechange.js | 40 +- test/sim/misc/weather.js | 40 +- test/sim/misc/weight.js | 80 +- test/sim/misc/zmoves.js | 28 +- test/sim/moves/acupressure.js | 48 +- test/sim/moves/afteryou.js | 46 +- test/sim/moves/allyswitch.js | 110 +- test/sim/moves/assist.js | 36 +- test/sim/moves/assurance.js | 30 +- test/sim/moves/aurawheel.js | 10 +- test/sim/moves/batonpass.js | 28 +- test/sim/moves/belch.js | 36 +- test/sim/moves/bellydrum.js | 28 +- test/sim/moves/bide.js | 56 +- test/sim/moves/boomburst.js | 10 +- test/sim/moves/brickbreak.js | 52 +- test/sim/moves/bugbuzz.js | 20 +- test/sim/moves/burningbulwark.js | 20 +- test/sim/moves/burningjealousy.js | 36 +- test/sim/moves/camouflage.js | 42 +- test/sim/moves/ceaselessedge.js | 54 +- test/sim/moves/charge.js | 32 +- test/sim/moves/chatter.js | 20 +- test/sim/moves/chloroblast.js | 28 +- test/sim/moves/clangoroussoulblaze.js | 24 +- test/sim/moves/clearsmog.js | 34 +- test/sim/moves/conversion2.js | 18 +- test/sim/moves/copycat.js | 16 +- test/sim/moves/counter.js | 260 +- test/sim/moves/courtchange.js | 26 +- test/sim/moves/curse.js | 100 +- test/sim/moves/destinybond.js | 58 +- test/sim/moves/disable.js | 68 +- test/sim/moves/doodle.js | 40 +- test/sim/moves/dragoncheer.js | 104 +- test/sim/moves/dragondarts.js | 218 +- test/sim/moves/echoedvoice.js | 20 +- test/sim/moves/electricterrain.js | 58 +- test/sim/moves/embargo.js | 34 +- test/sim/moves/encore.js | 108 +- test/sim/moves/explosion.js | 38 +- test/sim/moves/fakeout.js | 38 +- test/sim/moves/fellstinger.js | 16 +- test/sim/moves/fling.js | 34 +- test/sim/moves/focuspunch.js | 82 +- test/sim/moves/followme.js | 88 +- test/sim/moves/foresight.js | 26 +- test/sim/moves/furycutter.js | 16 +- test/sim/moves/futuresight.js | 162 +- test/sim/moves/gearup.js | 28 +- test/sim/moves/gigatonhammer.js | 16 +- test/sim/moves/glaiverush.js | 22 +- test/sim/moves/glare.js | 20 +- test/sim/moves/gmaxchistrike.js | 50 +- test/sim/moves/gmaxsteelsurge.js | 16 +- test/sim/moves/gmaxvolcalith.js | 78 +- test/sim/moves/gmaxwildfire.js | 44 +- test/sim/moves/grassyterrain.js | 62 +- test/sim/moves/gravity.js | 28 +- test/sim/moves/haze.js | 86 +- test/sim/moves/healbell.js | 50 +- test/sim/moves/healblock.js | 140 +- test/sim/moves/healingwish.js | 108 +- test/sim/moves/highjumpkick.js | 34 +- test/sim/moves/hydrosteam.js | 28 +- test/sim/moves/hyperbeam.js | 56 +- test/sim/moves/hypervoice.js | 20 +- test/sim/moves/icespinner.js | 34 +- test/sim/moves/imprison.js | 42 +- test/sim/moves/ingrain.js | 38 +- test/sim/moves/instruct.js | 14 +- test/sim/moves/judgment.js | 14 +- test/sim/moves/kingsshield.js | 28 +- test/sim/moves/knockoff.js | 72 +- test/sim/moves/lashout.js | 48 +- test/sim/moves/leechseed.js | 16 +- test/sim/moves/magicroom.js | 42 +- test/sim/moves/magneticflux.js | 28 +- test/sim/moves/maxguard.js | 34 +- test/sim/moves/mefirst.js | 18 +- test/sim/moves/memento.js | 36 +- test/sim/moves/metalburst.js | 44 +- test/sim/moves/mightycleave.js | 8 +- test/sim/moves/mindblown.js | 16 +- test/sim/moves/miracleeye.js | 30 +- test/sim/moves/mirrormove.js | 68 +- test/sim/moves/mistyterrain.js | 52 +- test/sim/moves/nightmare.js | 34 +- test/sim/moves/noretreat.js | 16 +- test/sim/moves/orderup.js | 16 +- test/sim/moves/painsplit.js | 16 +- test/sim/moves/partingshot.js | 36 +- test/sim/moves/perishsong.js | 34 +- test/sim/moves/photongeyser.js | 50 +- test/sim/moves/pledge.js | 24 +- test/sim/moves/pollenpuff.js | 90 +- test/sim/moves/psyblade.js | 16 +- test/sim/moves/psychicnoise.js | 22 +- test/sim/moves/psychup.js | 68 +- test/sim/moves/pursuit.js | 84 +- test/sim/moves/quash.js | 48 +- test/sim/moves/rage.js | 12 +- test/sim/moves/ragefist.js | 58 +- test/sim/moves/ragepowder.js | 50 +- test/sim/moves/rapidspin.js | 36 +- test/sim/moves/reflecttype.js | 22 +- test/sim/moves/relicsong.js | 38 +- test/sim/moves/revivalblessing.js | 52 +- test/sim/moves/rollout.js | 90 +- test/sim/moves/roost.js | 64 +- test/sim/moves/round.js | 20 +- test/sim/moves/shedtail.js | 10 +- test/sim/moves/sheercold.js | 20 +- test/sim/moves/shelltrap.js | 28 +- test/sim/moves/skillswap.js | 18 +- test/sim/moves/skydrop.js | 220 +- test/sim/moves/sleeptalk.js | 16 +- test/sim/moves/smellingsalts.js | 10 +- test/sim/moves/snarl.js | 20 +- test/sim/moves/snatch.js | 82 +- test/sim/moves/sparklingaria.js | 24 +- test/sim/moves/spectralthief.js | 44 +- test/sim/moves/spikes.js | 28 +- test/sim/moves/spite.js | 16 +- test/sim/moves/stealthrock.js | 42 +- test/sim/moves/stockpile.js | 12 +- test/sim/moves/stompingtantrum.js | 106 +- test/sim/moves/stoneaxe.js | 54 +- test/sim/moves/struggle.js | 10 +- test/sim/moves/substitute.js | 88 +- test/sim/moves/sunsteelstrike.js | 16 +- test/sim/moves/syrupbomb.js | 24 +- test/sim/moves/tarshot.js | 46 +- test/sim/moves/taunt.js | 16 +- test/sim/moves/teattime.js | 52 +- test/sim/moves/teleport.js | 20 +- test/sim/moves/terablast.js | 26 +- test/sim/moves/terastarstorm.js | 34 +- test/sim/moves/thief.js | 22 +- test/sim/moves/thousandarrows.js | 70 +- test/sim/moves/thrash.js | 58 +- test/sim/moves/thunderwave.js | 10 +- test/sim/moves/toxic.js | 30 +- test/sim/moves/transform.js | 222 +- test/sim/moves/trick.js | 52 +- test/sim/moves/trickroom.js | 56 +- test/sim/moves/trumpcard.js | 28 +- test/sim/moves/uproar.js | 26 +- test/sim/moves/uturn.js | 12 +- test/sim/moves/weatherball.js | 58 +- test/sim/moves/wish.js | 58 +- test/sim/moves/wonderroom.js | 26 +- test/sim/moves/yawn.js | 22 +- test/sim/team-validator/basic.js | 124 +- test/sim/team-validator/breeding.js | 130 +- test/sim/team-validator/custom-rules.js | 114 +- test/sim/team-validator/events.js | 94 +- test/sim/team-validator/formes.js | 62 +- test/sim/team-validator/misc.js | 132 +- test/sim/tools/exhaustive-runner.js | 6 +- test/sim/tools/multi-random-runner.js | 6 +- test/tools/build/sucrase.js | 2 +- test/tools/modlog/converter.js | 9 +- test/users-utils.js | 2 +- tools/build-utils.js | 4 +- tools/modlog/converter.ts | 2 +- tools/set-import/importer.ts | 59 +- tools/set-import/index.js | 6 +- tools/simulate/index.js | 15 +- tools/team-generation-benchmark.js | 11 +- tsconfig.json | 2 + 637 files changed, 21544 insertions(+), 21441 deletions(-) delete mode 100644 .eslintrc-no-types.json delete mode 100644 .eslintrc.json create mode 100644 eslint-ps-standard.mjs create mode 100644 eslint.config.mjs diff --git a/.eslintrc-no-types.json b/.eslintrc-no-types.json deleted file mode 100644 index 400da9d8a3..0000000000 --- a/.eslintrc-no-types.json +++ /dev/null @@ -1,359 +0,0 @@ -{ - "root": true, - "parserOptions": { - "ecmaVersion": 11, - "sourceType": "script", - "ecmaFeatures": { - "globalReturn": true - } - }, - "ignorePatterns": [ - "logs/", - "node_modules/", - "dist/", - "data/**/learnsets.ts", - "tools/set-import/importer.js", - "tools/set-import/sets", - "tools/modlog/converter.js", - "server/global-variables.d.ts" - ], - "env": { - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "rules": { - // TODO: add/revisit - // "spaced-comment": ["error", "always", {"exceptions": ["*"]}], - // "no-use-before-define": "off", - - // test only (should never be committed, but useful when testing) - "no-debugger": "warn", - "no-unused-vars": ["warn", {"args": "none"}], - "no-warning-comments": "off", - "prefer-const": ["warn", {"destructuring": "all"}], - - // PS code (code specific to PS) - "consistent-return": "off", // sim event handlers mix them for ergonomics - "func-style": "off", // used to type event handlers - "no-console": "off", - "no-control-regex": "off", // used to find invalid data in chat messages - "no-invalid-this": "off", // `this` is used to pass context to sim event handlers, chat commands, etc - "no-loop-func": "off", // synchronous - "no-restricted-modules": ["error", "moment", "request", "sugar"], - "no-sync": "off", - "no-void": "off", // used for spawning Promises only - "strict": ["error", "global"], - - // bad code, modern (new code patterns we don't like because they're less readable or performant) - "no-restricted-globals": ["error", "Proxy", "Reflect", "Symbol", "WeakSet"], - - // bad code, deprecated (deprecated/bad patterns that should be written a different way) - "eqeqeq": "error", - "func-names": "off", // has minor advantages but way too verbose, hurting readability - "guard-for-in": "off", // guarding is a deprecated pattern, we just use no-extend-native instead - "init-declarations": "off", // TypeScript lets us delay initialization safely - "no-caller": "error", - "no-eval": "error", - "no-extend-native": "error", - "no-implied-eval": "error", - "no-inner-declarations": ["error", "functions"], - "no-iterator": "error", - "no-labels": ["error", {"allowLoop": true, "allowSwitch": true}], - "no-multi-str": "error", - "no-new-func": "error", - "no-new-wrappers": "error", - "no-path-concat": "off", // Windows supports `/` as a path separator; concat is more readable - "no-proto": "error", - "no-restricted-syntax": ["error", "WithStatement"], - "no-sparse-arrays": "error", - "no-var": "error", - "no-with": "error", - - // probably bugs (code with no reason to exist, probably typoes) - "array-callback-return": "error", - "block-scoped-var": "error", // not actually used; precluded by no-var - "callback-return": [2, ["callback", "cb", "done"]], - "consistent-this": "off", // we use arrow functions instead - "constructor-super": "error", - "default-case": "off", // hopefully TypeScript will let us skip `default` for things that are exhaustive - "no-bitwise": "off", // used in Dashycode - "no-case-declarations": "off", // meh, we have no-shadow - "no-duplicate-case": "error", - "no-empty": ["error", {"allowEmptyCatch": true}], - "no-extra-bind": "error", - "no-extra-label": "error", - "no-fallthrough": "error", - "no-label-var": "error", - "no-new-require": "error", - "no-new": "error", - "no-redeclare": "error", - "no-return-await": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-shadow-restricted-names": "error", - "no-shadow": "off", - "no-template-curly-in-string": "error", - "no-throw-literal": "error", - "no-undef": "off", - "no-unmodified-loop-condition": "error", - "no-unused-expressions": "error", - "no-unsafe-finally": "error", - "no-unused-labels": "error", - "use-isnan": "error", - "valid-typeof": "error", - - // style choices - "no-constant-condition": ["error", {"checkLoops": false}], - "no-lonely-if": "off", - "radix": ["error", "as-needed"], - - // naming style - "camelcase": "off", // mostly only so we can import `child_process` - "id-length": "off", - "id-match": "off", - "new-cap": ["error", {"newIsCap": true, "capIsNew": false}], - "no-underscore-dangle": "off", - - // syntax style (local syntactical, usually autofixable formatting decisions) - "arrow-parens": "off", - "arrow-body-style": "error", - "brace-style": ["error", "1tbs", {"allowSingleLine": true}], - "comma-dangle": ["error", {"arrays": "always-multiline", "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline", "functions": "ignore"}], - "comma-style": ["error", "last"], - "curly": ["error", "multi-line", "consistent"], - "dot-notation": "off", - "new-parens": "error", - "no-array-constructor": "error", - "no-div-regex": "error", - "no-duplicate-imports": "error", - "no-extra-parens": "off", - "no-floating-decimal": "error", - "no-mixed-requires": "error", - "no-multi-spaces": "error", - "no-new-object": "error", - "no-octal-escape": "error", - "no-return-assign": ["error", "except-parens"], - "no-undef-init": "off", - "no-unneeded-ternary": "error", - "no-useless-call": "error", - "no-useless-computed-key": "error", - "no-useless-concat": "off", - "no-useless-rename": "error", - "object-shorthand": ["error", "methods"], - "one-var": "off", - "operator-assignment": "off", - "prefer-arrow-callback": "off", - "quote-props": "off", - "quotes": "off", - "semi": ["error", "always"], - "sort-vars": "off", - "vars-on-top": "off", - "wrap-iife": ["error", "inside"], - "wrap-regex": "off", - "yoda": ["error", "never", { "exceptRange": true }], - - // whitespace - "array-bracket-spacing": ["error", "never"], - "arrow-spacing": ["error", {"before": true, "after": true}], - "block-spacing": ["error", "always"], - "comma-spacing": ["error", {"before": false, "after": true}], - "computed-property-spacing": ["error", "never"], - "dot-location": ["error", "property"], - "eol-last": ["error", "always"], - "func-call-spacing": "error", - "function-paren-newline": ["error", "consistent"], - "indent": ["error", "tab", {"flatTernaryExpressions": true}], - "key-spacing": "error", - "keyword-spacing": ["error", {"before": true, "after": true}], - "lines-around-comment": "off", - "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], - "no-multiple-empty-lines": ["error", {"max": 2, "maxEOF": 1}], - "no-trailing-spaces": ["error", {"ignoreComments": false}], - "object-curly-spacing": ["error", "never"], - "operator-linebreak": ["error", "after"], - "padded-blocks": ["error", "never"], - "padding-line-between-statements": "off", - "rest-spread-spacing": ["error", "never"], - "semi-spacing": ["error", {"before": false, "after": true}], - "space-before-blocks": ["error", "always"], - "space-before-function-paren": ["error", {"anonymous": "always", "named": "never"}], - "space-in-parens": ["error", "never"], - "space-infix-ops": "error", - "space-unary-ops": ["error", {"words": true, "nonwords": false}], - "template-curly-spacing": ["error", "never"] - }, - "overrides": [ - { - "files": [ - "./config/*.ts", "./data/**/*.ts", "./lib/*.ts", "./server/**/*.ts", "./server/**/*.tsx", "./sim/**/*.ts", - "./tools/set-import/*.ts", "./tools/modlog/*.ts", "./translations/**/*.ts" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 11, - "sourceType": "module", - "tsconfigRootDir": ".", - "project": ["./tsconfig.json"] - }, - "extends": [ - "plugin:@typescript-eslint/recommended" - ], - "rules": { - // TODO revisit - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/member-ordering": "off", - // "@typescript-eslint/no-extraneous-class": "error", - // "@typescript-eslint/no-type-alias": "error", - "@typescript-eslint/prefer-optional-chain": "off", - // "@typescript-eslint/consistent-type-imports": "error", // TODO after no-duplicate-imports fix - - // test only (should never be committed, but useful when testing) - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": ["warn", {"args": "none"}], - "max-len": ["warn", { - "code": 120, "tabWidth": 0, - // see bottom of file for source - "ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const |readonly )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:Utils\\.html|(?:this\\.)?(?:room\\.)?tr|\\$\\()?['\"`/]" - }], - "prefer-const": ["warn", {"destructuring": "all"}], // typescript-eslint/recommended forces this so we need to re-override - - // PS code (code specific to PS) - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/unbound-method": "off", // used for sim event handlers, command handlers, etc - "new-parens": "off", // used for the `new class {...}` pattern - "no-prototype-builtins": "off", - "no-shadow": "off", - "@typescript-eslint/no-shadow": "error", - "@typescript-eslint/no-var-requires": "off", - - // typescript-eslint defaults too strict - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-unsafe-argument": "off", - - // probably bugs - "@typescript-eslint/ban-types": ["error", { - "extendDefaults": true, - "types": { - "object": false - } - }], - "@typescript-eslint/no-dupe-class-members": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-extra-non-null-assertion": "error", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-non-null-asserted-optional-chain": "error", - "no-dupe-class-members": "off", - "no-unused-expressions": "off", // ternary is used to convert callbacks to Promises - "@typescript-eslint/no-unused-expressions": ["error", {"allowTernary": true}], // ternary is used to convert callbacks to Promises - - // naming style - "@typescript-eslint/naming-convention": ["error", { - "selector": ["class", "interface", "typeAlias"], - "format": ["PascalCase"] - }], - - // syntax style (local syntactical, usually autofixable formatting decisions) - "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": "error", - "@typescript-eslint/consistent-type-assertions": ["error", {"assertionStyle": "as"}], - "@typescript-eslint/consistent-type-definitions": ["error", "interface"], - "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], - "@typescript-eslint/member-delimiter-style": ["error", {"overrides": {"typeLiteral": { - "multiline": {"delimiter": "comma", "requireLast": true}, - "singleline": {"delimiter": "comma", "requireLast": false} - }}}], - "@typescript-eslint/no-parameter-properties": "error", - // `source` and `target` are frequently used as variables that may point to `this` - // or to another `Pokemon` object, depending on how the given method is invoked - "@typescript-eslint/no-this-alias": ["error", {"allowedNames": ["source", "target"]}], - "@typescript-eslint/prefer-as-const": "error", - "@typescript-eslint/prefer-for-of": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/prefer-includes": "error", - "@typescript-eslint/prefer-namespace-keyword": "error", - "prefer-object-spread": "error", - "@typescript-eslint/triple-slash-reference": "error", - "@typescript-eslint/unified-signatures": "error", - - // syntax style, overriding base - "quotes": "off", - "@typescript-eslint/quotes": "off", - "semi": "off", - "@typescript-eslint/semi": ["error", "always"], - "func-call-spacing": "off", - "@typescript-eslint/func-call-spacing": "error", - - // whitespace - "@typescript-eslint/type-annotation-spacing": "error", - "spaced-comment": ["error", "always", {"exceptions": ["*", "/"]}], - - // whitespace, overriding base - "indent": "off", - "@typescript-eslint/indent": ["error", "tab", {"flatTernaryExpressions": true}] - } - }, - { - "files": ["./translations/**/*.ts"], - "rules": { - "no-template-curly-in-string": "off" - } - }, - { - "env": { - "mocha": true - }, - "files": ["test/**/*.js"] - }, - { - "files": ["build"], - "rules": { - "no-var": "off" - } - }, - { - "files": ["server/chat-plugins/private/*"], - "parserOptions": { - "ecmaVersion": 2021 - } - } - ] -} - -/* -REGEXFREE SOURCE FOR IGNOREPATTERN: https://zarel.github.io/regexfree/ - - # indentation - ^\s* - # possibly commented out - (\/\/\ \s*)? - - ( - # define a variable, append to a variable, or define a single-arg arrow function - (export\ )? (let\ |const\ |readonly\ )? [a-zA-Z0-9_$.]+ (\ \+?=>?\ ) - | - # define a property (oversize arrays are only allowed in properties) - [a-zA-Z0-9$]+:\ \[? - | - # optionally return or throw - (return\ |throw\ )? - # call a function or constructor - (new\ )?([a-zA-Z0-9$.]+\()? - )? - - ( - Utils\.html - | - (this\.)?(room\.)?tr - | - \$\( - )? - - # start of string or regex - ['"`\/] -*/ diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index d605211188..0000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "extends": "./.eslintrc-no-types.json", - "overrides": [ - { - "files": ["./config/*.ts", "./data/**/*.ts", "./lib/*.ts", "./server/**/*.ts", "./server/**/*.tsx", "./sim/**/*.ts", "./tools/set-import/*.ts"], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 11, - "sourceType": "module", - "tsconfigRootDir": ".", - "project": ["./tsconfig.json"] - }, - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "./.eslintrc-no-types.json" - ], - "rules": { - // TODO investigate - "@typescript-eslint/restrict-plus-operands": "off", - // "@typescript-eslint/restrict-plus-operands": ["error", {"checkCompoundAssignments": true}], - // "@typescript-eslint/switch-exhaustiveness-check": "error", - - // typescript-eslint defaults too strict - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-return": "off", - "@typescript-eslint/restrict-template-expressions": "off", - - // probably bugs - "@typescript-eslint/no-floating-promises": "error", - "@typescript-eslint/no-for-in-array": "error", - "@typescript-eslint/no-misused-promises": "error", - "@typescript-eslint/no-throw-literal": "error", - "@typescript-eslint/no-unnecessary-condition": "off", // sadly, we use not-null assertions so commonly that these are often necessary - - // syntax style (local syntactical, usually autofixable formatting decisions) - "@typescript-eslint/no-unnecessary-qualifier": "off", - - // Disabled because of a bug in typescript-eslint. - // See https://github.com/typescript-eslint/typescript-eslint/issues/4554 - "@typescript-eslint/no-unnecessary-type-arguments": "off", - - "@typescript-eslint/no-unnecessary-type-assertion": "error", - "@typescript-eslint/prefer-regexp-exec": "error", - "@typescript-eslint/prefer-string-starts-ends-with": "error" - } - } - ] -} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b944b73c9..05266cb7d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [18.x] steps: - uses: actions/checkout@v3 diff --git a/.vscode/settings.json b/.vscode/settings.json index 9270d1946f..5ed2c96891 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,6 @@ { "editor.insertSpaces": false, - "editor.formatOnSave": false, "typescript.tsdk": "node_modules/typescript/lib", "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false, - "typescript.format.semicolons": "insert", - "eslint.options": { - "configFile": ".eslintrc.json" - } + "typescript.format.semicolons": "insert" } diff --git a/build b/build index 47a058fd30..629bf1d126 100755 --- a/build +++ b/build @@ -2,10 +2,10 @@ "use strict"; try { - // technically this was introduced in Node 15, but we'll ask for the most recent LTS with it to be safe - Promise.any([null]); + // technically this was introduced in Node 17, but we'll ask for the most recent LTS with it to be safe + structuredClone({}); } catch (e) { - console.log("We require Node.js version 16 or later; you're using " + process.version); + console.log("We require Node.js version 18 or later; you're using " + process.version); process.exit(1); } diff --git a/config/formats.ts b/config/formats.ts index 1a6348071f..a0ad9b4a0f 100644 --- a/config/formats.ts +++ b/config/formats.ts @@ -154,7 +154,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen9', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -230,7 +230,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen9', gameType: 'doubles', searchShow: false, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, debug: true, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], @@ -531,12 +531,12 @@ export const Formats: import('../sim/dex-formats').FormatList = [ ], battle: { endTurn() { - // @ts-ignore Hack + // @ts-expect-error Hack for (const pokemon of this.getAllActive(false, true)) { // turn counter hasn't been incremented yet if (this.turn & 1 && pokemon.position === (this.turn & 2 ? 0 : 1) && pokemon.hp && pokemon.allies().length) { - pokemon.volatiles['commanding'] = this.initEffectState({id: 'commanding', name: 'Commanding', target: pokemon}); - pokemon.volatiles['gastroacid'] = this.initEffectState({id: 'gastroacid', name: 'Gastro Acid', target: pokemon}); + pokemon.volatiles['commanding'] = this.initEffectState({ id: 'commanding', name: 'Commanding', target: pokemon }); + pokemon.volatiles['gastroacid'] = this.initEffectState({ id: 'gastroacid', name: 'Gastro Acid', target: pokemon }); this.add('-message', `${pokemon.side.name}'s ${pokemon.name !== pokemon.species.name ? `${pokemon.name} (${pokemon.species.name})` : pokemon.name} will be skipped next turn.`); } else { pokemon.removeVolatile('commanding'); @@ -734,7 +734,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ if (!format.getSharedPower) format = this.dex.formats.get('gen9sharedpower'); for (const ability of format.getSharedPower!(pokemon)) { const effect = 'ability:' + ability; - pokemon.volatiles[effect] = this.initEffectState({id: this.toID(effect), target: pokemon}); + pokemon.volatiles[effect] = this.initEffectState({ id: this.toID(effect), target: pokemon }); if (!pokemon.m.abils) pokemon.m.abils = []; if (!pokemon.m.abils.includes(effect)) pokemon.m.abils.push(effect); } @@ -1007,8 +1007,8 @@ export const Formats: import('../sim/dex-formats').FormatList = [ Object.assign(t.side.slotConditions[t.position]['futuremove'], { duration: 3, move: moveData.id, - source: source, - moveData: moveData, + source, + moveData, }); this.add('-message', `${source.name} foresaw an attack!`); return this.NOT_FAIL; @@ -1075,10 +1075,12 @@ export const Formats: import('../sim/dex-formats').FormatList = [ move.secondaries?.some(secondary => secondary.boosts?.accuracy && secondary.boosts?.accuracy < 0); const flinchMove = move.secondaries?.some(secondary => secondary.volatileStatus === 'flinch'); const freezeMove = move.secondaries?.some(secondary => secondary.status === 'frz') || move.id === 'triattack'; - if (this.ruleTable.isRestricted(`move:${move.id}`) || + if ( + this.ruleTable.isRestricted(`move:${move.id}`) || ((accuracyLoweringMove || move.ohko || move.multihit || move.id === 'beatup' || move.flags['charge'] || move.priority > 0 || move.damageCallback || flinchMove || freezeMove) && - !this.ruleTable.has(`+move:${move.id}`))) { + !this.ruleTable.has(`+move:${move.id}`)) + ) { problems.push(`The move ${move.name} can't be used as an item.`); } return problems.length ? problems : null; @@ -1096,7 +1098,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ onModifyMove(move, pokemon, target) { const forte: ActiveMove = pokemon.m.forte; if (move.category !== 'Status' && forte) { - move.flags = {...move.flags, ...forte.flags}; + move.flags = { ...move.flags, ...forte.flags }; if (forte.self) { if (forte.self.onHit && move.self?.onHit) { for (const i in forte.self) { @@ -1104,11 +1106,11 @@ export const Formats: import('../sim/dex-formats').FormatList = [ (move.self as any)[i] = (forte.self as any)[i]; } } else { - move.self = {...(move.self || {}), ...forte.self}; + move.self = { ...(move.self || {}), ...forte.self }; } } if (forte.selfBoost?.boosts) { - if (!move.selfBoost?.boosts) move.selfBoost = {boosts: {}}; + if (!move.selfBoost?.boosts) move.selfBoost = { boosts: {} }; let boostid: BoostID; for (boostid in forte.selfBoost.boosts) { if (!move.selfBoost.boosts![boostid]) move.selfBoost.boosts![boostid] = 0; @@ -1340,7 +1342,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ onValidateTeam(team, f, teamHas) { if (this.ruleTable.has('abilityclause')) { const abilityTable = new this.dex.Multiset(); - const base: {[k: string]: string} = { + const base: { [k: string]: string } = { airlock: 'cloudnine', armortail: 'queenlymajesty', battlearmor: 'shellarmor', @@ -1454,7 +1456,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ }, battle: { spreadModify(baseStats, set) { - const modStats: SparseStatsTable = {atk: 10, def: 10, spa: 10, spd: 10, spe: 10}; + const modStats: SparseStatsTable = { atk: 10, def: 10, spa: 10, spd: 10, spe: 10 }; const tr = this.trunc; const nature = this.dex.natures.get(set.nature); let statName: keyof StatsTable; @@ -1524,13 +1526,13 @@ export const Formats: import('../sim/dex-formats').FormatList = [ if (!pokemon.m.innate && !BAD_ABILITIES.includes(this.toID(ally.ability))) { pokemon.m.innate = 'ability:' + ally.ability; if (!ngas || ally.getAbility().flags['cantsuppress'] || pokemon.hasItem('Ability Shield')) { - pokemon.volatiles[pokemon.m.innate] = this.initEffectState({id: pokemon.m.innate, target: pokemon, pic: ally}); + pokemon.volatiles[pokemon.m.innate] = this.initEffectState({ id: pokemon.m.innate, target: pokemon, pic: ally }); } } if (!ally.m.innate && !BAD_ABILITIES.includes(this.toID(pokemon.ability))) { ally.m.innate = 'ability:' + pokemon.ability; if (!ngas || pokemon.getAbility().flags['cantsuppress'] || ally.hasItem('Ability Shield')) { - ally.volatiles[ally.m.innate] = this.initEffectState({id: ally.m.innate, target: ally, pic: pokemon}); + ally.volatiles[ally.m.innate] = this.initEffectState({ id: ally.m.innate, target: ally, pic: pokemon }); } } } @@ -1542,7 +1544,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ delete pokemon.m.innate; } const ally = pokemon.side.active.find(mon => mon && mon !== pokemon && !mon.fainted); - if (ally && ally.m.innate) { + if (ally?.m.innate) { ally.removeVolatile(ally.m.innate); delete ally.m.innate; } @@ -1553,7 +1555,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ delete pokemon.m.innate; } const ally = pokemon.side.active.find(mon => mon && mon !== pokemon && !mon.fainted); - if (ally && ally.m.innate) { + if (ally?.m.innate) { ally.removeVolatile(ally.m.innate); delete ally.m.innate; } @@ -1618,7 +1620,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ for (const innate of pokemon.m.innates) { if (pokemon.hasAbility(innate)) continue; const effect = 'ability:' + innate; - pokemon.volatiles[effect] = this.initEffectState({id: this.toID(effect), target: pokemon}); + pokemon.volatiles[effect] = this.initEffectState({ id: this.toID(effect), target: pokemon }); } } }, @@ -1688,11 +1690,11 @@ export const Formats: import('../sim/dex-formats').FormatList = [ set.moves.splice(i, 1); } } - const allowedPokemoves = this.ruleTable.valueRules.get('allowedpokemoves') || 1; - if (pokemoves > Number(allowedPokemoves)) { + const allowedPokemoves = Number(this.ruleTable.valueRules.get('allowedpokemoves') || '1'); + if (pokemoves > allowedPokemoves) { problems.push( `${set.species} has ${pokemoves} Pokemoves.`, - `(Pok\u00e9mon can only have ${allowedPokemoves} Pokemove${allowedPokemoves + '' === '1' ? '' : 's'} each.)` + `(Pok\u00e9mon can only have ${allowedPokemoves} Pokemove${allowedPokemoves === 1 ? '' : 's'} each.)` ); } if (this.validateSet(set, teamHas)) { @@ -1812,7 +1814,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ for (const item of format.getSharedItems!(pokemon)) { if (pokemon.m.sharedItemsUsed.includes(item)) continue; const effect = 'item:' + item; - pokemon.volatiles[effect] = this.initEffectState({id: this.toID(effect), target: pokemon}); + pokemon.volatiles[effect] = this.initEffectState({ id: this.toID(effect), target: pokemon }); } }, }, @@ -1861,7 +1863,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ move.category = 'Physical'; } if (teraType === "Stellar") { - move.self = {boosts: {atk: -1, spa: -1}}; + move.self = { boosts: { atk: -1, spa: -1 } }; } } } @@ -1890,7 +1892,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ if (move.spreadHit) { // multi-target modifier (doubles only) const spreadModifier = move.spreadModifier || (this.battle.gameType === 'freeforall' ? 0.5 : 0.75); - this.battle.debug('Spread modifier: ' + spreadModifier); + this.battle.debug(`Spread modifier: ${spreadModifier}`); baseDamage = this.battle.modify(baseDamage, spreadModifier); } else if (move.multihitType === 'parentalbond' && move.hit > 1) { // Parental Bond modifier @@ -2575,7 +2577,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ // that a pokemon is on a team through the onStart even triggering // at the start of a match, users with pokemon names will need their // statuses to end in "user". - name = name + 'user'; + name = `${name}user`; } // Add the mon's status effect to it as a volatile. const status = this.dex.conditions.get(name); @@ -2617,7 +2619,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ if (!format.getSharedPower) format = this.dex.formats.get('gen9sharedpower'); for (const ability of format.getSharedPower!(pokemon)) { const effect = 'ability:' + ability; - pokemon.volatiles[effect] = this.initEffectState({id: this.toID(effect), target: pokemon}); + pokemon.volatiles[effect] = this.initEffectState({ id: this.toID(effect), target: pokemon }); if (!pokemon.m.abils) pokemon.m.abils = []; if (!pokemon.m.abils.includes(effect)) pokemon.m.abils.push(effect); } @@ -3075,7 +3077,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ banlist: ['Nonexistent'], onModifySpecies(species, target, source, effect) { if (!target) return; - return {...species, ...(target.set as any).hc}; + return { ...species, ...(target.set as any).hc }; }, onSwitchIn(pokemon) { this.add('-start', pokemon, 'typechange', pokemon.getTypes(true).join('/'), '[silent]'); @@ -3360,7 +3362,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen8', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -3433,7 +3435,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen8', gameType: 'doubles', searchShow: false, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, debug: true, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], @@ -3557,7 +3559,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen7', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -3630,7 +3632,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen7', gameType: 'doubles', searchShow: false, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, debug: true, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], @@ -3751,7 +3753,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen6', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -3804,7 +3806,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen6', gameType: 'doubles', searchShow: false, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, debug: true, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], @@ -3821,7 +3823,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen6', gameType: 'triples', searchShow: false, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, debug: true, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], @@ -3950,7 +3952,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen5', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -3995,7 +3997,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ gameType: 'doubles', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -4005,7 +4007,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ gameType: 'triples', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions, for serious (other than team preview) ruleset: ['Team Preview', 'Cancel Mod'], }, @@ -4111,7 +4113,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen4', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions ruleset: ['Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -4146,7 +4148,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ gameType: 'doubles', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, // no restrictions ruleset: ['Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, @@ -4227,7 +4229,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen3', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, ruleset: ['HP Percentage Mod', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, { @@ -4312,7 +4314,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen2', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, ruleset: ['HP Percentage Mod', 'Cancel Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, { @@ -4393,7 +4395,7 @@ export const Formats: import('../sim/dex-formats').FormatList = [ mod: 'gen1', searchShow: false, debug: true, - battle: {trunc: Math.trunc}, + battle: { trunc: Math.trunc }, ruleset: ['HP Percentage Mod', 'Cancel Mod', 'Desync Clause Mod', 'Max Team Size = 24', 'Max Move Count = 24', 'Max Level = 9999', 'Default Level = 100'], }, ]; diff --git a/data/abilities.ts b/data/abilities.ts index 22b0078f5c..21a8a105d9 100644 --- a/data/abilities.ts +++ b/data/abilities.ts @@ -132,7 +132,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onHit(target, source, move) { if (!target.hp) return; if (move?.effectType === 'Move' && target.getMoveHitData(move).crit) { - this.boost({atk: 12}, target, target); + this.boost({ atk: 12 }, target, target); } }, flags: {}, @@ -168,7 +168,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (!lastAttackedBy) return; const damage = move.multihit ? move.totalDamage : lastAttackedBy.damage; if (target.hp <= target.maxhp / 2 && target.hp + damage > target.maxhp / 2) { - this.boost({atk: 1, spa: 1, spe: 1, def: -1, spd: -1}, target, target); + this.boost({ atk: 1, spa: 1, spe: 1, def: -1, spd: -1 }, target, target); } }, flags: {}, @@ -227,11 +227,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const armorTailHolder = this.effectState.target; if ((source.isAlly(armorTailHolder) || move.target === 'all') && move.priority > 0.1) { this.attrLastMove('[still]'); - this.add('cant', armorTailHolder, 'ability: Armor Tail', move, '[of] ' + target); + this.add('cant', armorTailHolder, 'ability: Armor Tail', move, `[of] ${target}`); return false; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Armor Tail", rating: 2.5, num: 296, @@ -241,12 +241,12 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (['attract', 'disable', 'encore', 'healblock', 'taunt', 'torment'].includes(status.id)) { if (effect.effectType === 'Move') { const effectHolder = this.effectState.target; - this.add('-block', target, 'ability: Aroma Veil', '[of] ' + effectHolder); + this.add('-block', target, 'ability: Aroma Veil', `[of] ${effectHolder}`); } return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Aroma Veil", rating: 2, num: 165, @@ -267,10 +267,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, onSourceAfterFaint(length, target, source, effect) { if (effect && effect.effectType === 'Move') { - this.boost({atk: length}, source, source, this.dex.abilities.get('chillingneigh')); + this.boost({ atk: length }, source, source, this.dex.abilities.get('chillingneigh')); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "As One (Glastrier)", rating: 3.5, num: 266, @@ -291,10 +291,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, onSourceAfterFaint(length, target, source, effect) { if (effect && effect.effectType === 'Move') { - this.boost({spa: length}, source, source, this.dex.abilities.get('grimneigh')); + this.boost({ spa: length }, source, source, this.dex.abilities.get('grimneigh')); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "As One (Spectrier)", rating: 3.5, num: 267, @@ -308,7 +308,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (target === source || move.category === 'Status') return; move.hasAuraBreak = true; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Aura Break", rating: 1, num: 188, @@ -350,7 +350,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, battlearmor: { onCriticalHit: false, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Battle Armor", rating: 1, num: 4, @@ -360,12 +360,12 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (effect?.effectType !== 'Move') return; if (source.abilityState.battleBondTriggered) return; if (source.species.id === 'greninjabond' && source.hp && !source.transformed && source.side.foePokemonLeft()) { - this.boost({atk: 1, spa: 1, spe: 1}, source, source, this.effect); + this.boost({ atk: 1, spa: 1, spe: 1 }, source, source, this.effect); this.add('-activate', source, 'ability: Battle Bond'); source.abilityState.battleBondTriggered = true; } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Battle Bond", rating: 3.5, num: 210, @@ -392,7 +392,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onSourceAfterFaint(length, target, source, effect) { if (effect && effect.effectType === 'Move') { const bestStat = source.getBestStat(true, true); - this.boost({[bestStat]: length}, source); + this.boost({ [bestStat]: length }, source); } }, flags: {}, @@ -428,7 +428,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (!lastAttackedBy) return; const damage = move.multihit && !move.smartTarget ? move.totalDamage : lastAttackedBy.damage; if (target.hp <= target.maxhp / 2 && target.hp + damage > target.maxhp / 2) { - this.boost({spa: 1}, target, target); + this.boost({ spa: 1 }, target, target); } }, flags: {}, @@ -442,11 +442,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (boost.def && boost.def < 0) { delete boost.def; if (!(effect as ActiveMove).secondaries && effect.id !== 'octolock') { - this.add("-fail", target, "unboost", "Defense", "[from] ability: Big Pecks", "[of] " + target); + this.add("-fail", target, "unboost", "Defense", "[from] ability: Big Pecks", `[of] ${target}`); } } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Big Pecks", rating: 0.5, num: 145, @@ -478,7 +478,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Bulletproof", rating: 3, num: 171, @@ -495,7 +495,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { chillingneigh: { onSourceAfterFaint(length, target, source, effect) { if (effect && effect.effectType === 'Move') { - this.boost({atk: length}, source); + this.boost({ atk: length }, source); } }, flags: {}, @@ -526,10 +526,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } if (showMsg && !(effect as ActiveMove).secondaries && effect.id !== 'octolock') { - this.add("-fail", target, "unboost", "[from] ability: Clear Body", "[of] " + target); + this.add("-fail", target, "unboost", "[from] ability: Clear Body", `[of] ${target}`); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Clear Body", rating: 2, num: 29, @@ -590,7 +590,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return false; }, // Permanent sleep "status" implemented in the relevant sleep-checking effects - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Comatose", rating: 4, num: 213, @@ -622,7 +622,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { // Cancel all actions this turn for pokemon if applicable this.queue.cancelAction(pokemon); // Add volatiles to both pokemon - this.add('-activate', pokemon, 'ability: Commander', '[of] ' + ally); + this.add('-activate', pokemon, 'ability: Commander', `[of] ${ally}`); pokemon.addVolatile('commanding'); ally.addVolatile('commanded', pokemon); // Continued in conditions.ts in the volatiles @@ -631,7 +631,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { pokemon.removeVolatile('commanding'); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1 }, name: "Commander", rating: 0, num: 279, @@ -649,7 +649,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } if (statsLowered) { - this.boost({spa: 2}, target, target, null, false, true); + this.boost({ spa: 2 }, target, target, null, false, true); } }, flags: {}, @@ -677,7 +677,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { boost[i]! *= -1; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Contrary", rating: 4.5, num: 126, @@ -725,7 +725,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-ability', target, 'Cotton Down'); activated = true; } - this.boost({spe: -1}, pokemon, target, null, true); + this.boost({ spe: -1 }, pokemon, target, null, true); } }, flags: {}, @@ -771,7 +771,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onStart(pokemon) { for (const ally of pokemon.adjacentAllies()) { ally.clearBoosts(); - this.add('-clearboost', ally, '[from] ability: Curious Medicine', '[of] ' + pokemon); + this.add('-clearboost', ally, '[from] ability: Curious Medicine', `[of] ${pokemon}`); } }, flags: {}, @@ -810,7 +810,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onAnyTryMove(target, source, effect) { if (['explosion', 'mindblown', 'mistyexplosion', 'selfdestruct'].includes(effect.id)) { this.attrLastMove('[still]'); - this.add('cant', this.effectState.target, 'ability: Damp', effect, '[of] ' + target); + this.add('cant', this.effectState.target, 'ability: Damp', effect, `[of] ${target}`); return false; } }, @@ -819,7 +819,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return false; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Damp", rating: 0.5, num: 6, @@ -852,7 +852,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onStart(pokemon) { if (pokemon.shieldBoost) return; pokemon.shieldBoost = true; - this.boost({def: 1}, pokemon); + this.boost({ def: 1 }, pokemon); }, flags: {}, name: "Dauntless Shield", @@ -869,11 +869,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const dazzlingHolder = this.effectState.target; if ((source.isAlly(dazzlingHolder) || move.target === 'all') && move.priority > 0.1) { this.attrLastMove('[still]'); - this.add('cant', dazzlingHolder, 'ability: Dazzling', move, '[of] ' + target); + this.add('cant', dazzlingHolder, 'ability: Dazzling', move, `[of] ${target}`); return false; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Dazzling", rating: 2.5, num: 219, @@ -909,7 +909,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } if (statsLowered) { - this.boost({atk: 2}, target, target, null, false, true); + this.boost({ atk: 2 }, target, target, null, false, true); } }, flags: {}, @@ -1021,9 +1021,9 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { totalspd += target.getStat('spd', false, true); } if (totaldef && totaldef >= totalspd) { - this.boost({spa: 1}); + this.boost({ spa: 1 }); } else if (totalspd) { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } }, flags: {}, @@ -1094,7 +1094,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.damage(target.baseMaxhp / 8, target, target); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Dry Skin", rating: 3, num: 87, @@ -1115,7 +1115,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Earth Eater", rating: 3.5, num: 297, @@ -1162,10 +1162,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (pokemon.baseSpecies.name === 'Ogerpon-Cornerstone-Tera' && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; - this.boost({def: 1}, pokemon); + this.boost({ def: 1 }, pokemon); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Embody Aspect (Cornerstone)", rating: 3.5, num: 304, @@ -1175,10 +1175,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (pokemon.baseSpecies.name === 'Ogerpon-Hearthflame-Tera' && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; - this.boost({atk: 1}, pokemon); + this.boost({ atk: 1 }, pokemon); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Embody Aspect (Hearthflame)", rating: 3.5, num: 303, @@ -1188,10 +1188,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (pokemon.baseSpecies.name === 'Ogerpon-Teal-Tera' && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; - this.boost({spe: 1}, pokemon); + this.boost({ spe: 1 }, pokemon); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Embody Aspect (Teal)", rating: 3.5, num: 301, @@ -1201,10 +1201,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (pokemon.baseSpecies.name === 'Ogerpon-Wellspring-Tera' && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; - this.boost({spd: 1}, pokemon); + this.boost({ spd: 1 }, pokemon); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Embody Aspect (Wellspring)", rating: 3.5, num: 302, @@ -1249,7 +1249,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.75); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Filter", rating: 3, num: 111, @@ -1315,7 +1315,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-end', target, 'ability: Flash Fire', '[silent]'); }, }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Flash Fire", rating: 3.5, num: 18, @@ -1352,7 +1352,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(1.5); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, breakable: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, breakable: 1 }, name: "Flower Gift", rating: 1, num: 122, @@ -1370,7 +1370,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } if (showMsg && !(effect as ActiveMove).secondaries) { const effectHolder = this.effectState.target; - this.add('-block', target, 'ability: Flower Veil', '[of] ' + effectHolder); + this.add('-block', target, 'ability: Flower Veil', `[of] ${effectHolder}`); } }, onAllySetStatus(status, target, source, effect) { @@ -1378,7 +1378,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.debug('interrupting setStatus with Flower Veil'); if (effect.name === 'Synchronize' || (effect.effectType === 'Move' && !effect.secondaries)) { const effectHolder = this.effectState.target; - this.add('-block', target, 'ability: Flower Veil', '[of] ' + effectHolder); + this.add('-block', target, 'ability: Flower Veil', `[of] ${effectHolder}`); } return null; } @@ -1387,11 +1387,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (target.hasType('Grass') && status.id === 'yawn') { this.debug('Flower Veil blocking yawn'); const effectHolder = this.effectState.target; - this.add('-block', target, 'ability: Flower Veil', '[of] ' + effectHolder); + this.add('-block', target, 'ability: Flower Veil', `[of] ${effectHolder}`); return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Flower Veil", rating: 0, num: 166, @@ -1403,7 +1403,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (move.flags['contact']) mod /= 2; return this.chainModify(mod); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Fluffy", rating: 3.5, num: 218, @@ -1437,7 +1437,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { pokemon.formeChange(forme, this.effect, false, '0', '[msg]'); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1 }, name: "Forecast", rating: 2, num: 59, @@ -1464,7 +1464,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } if (!warnMoves.length) return; const [warnMoveName, warnTarget] = this.sample(warnMoves); - this.add('-activate', pokemon, 'ability: Forewarn', warnMoveName, '[of] ' + warnTarget); + this.add('-activate', pokemon, 'ability: Forewarn', warnMoveName, `[of] ${warnTarget}`); }, flags: {}, name: "Forewarn", @@ -1478,7 +1478,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.75); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Friend Guard", rating: 0, num: 132, @@ -1487,7 +1487,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onStart(pokemon) { for (const target of pokemon.foes()) { if (target.item) { - this.add('-item', target, target.getItem().name, '[from] ability: Frisk', '[of] ' + pokemon); + this.add('-item', target, target.getItem().name, '[from] ability: Frisk', `[of] ${pokemon}`); } } }, @@ -1508,7 +1508,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } if (showMsg && !(effect as ActiveMove).secondaries && effect.id !== 'octolock') { - this.add("-fail", target, "unboost", "[from] ability: Full Metal Body", "[of] " + target); + this.add("-fail", target, "unboost", "[from] ability: Full Metal Body", `[of] ${target}`); } }, flags: {}, @@ -1521,7 +1521,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onModifyDef(def) { return this.chainModify(2); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Fur Coat", rating: 4, num: 169, @@ -1575,7 +1575,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Good as Gold", rating: 5, num: 283, @@ -1584,7 +1584,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onDamagingHit(damage, target, source, move) { if (this.checkMoveMakesContact(move, source, target, true)) { this.add('-ability', target, 'Gooey'); - this.boost({spe: -1}, source, target, null, true); + this.boost({ spe: -1 }, source, target, null, true); } }, flags: {}, @@ -1640,7 +1640,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onModifyDef(pokemon) { if (this.field.isTerrain('grassyterrain')) return this.chainModify(1.5); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Grass Pelt", rating: 0.5, num: 179, @@ -1657,7 +1657,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { grimneigh: { onSourceAfterFaint(length, target, source, effect) { if (effect && effect.effectType === 'Move') { - this.boost({spa: length}, source); + this.boost({ spa: length }, source); } }, flags: {}, @@ -1675,10 +1675,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onTryBoost(boost, target, source, effect) { if (effect.name === 'Intimidate' && boost.atk) { delete boost.atk; - this.boost({atk: 1}, target, target, null, false, true); + this.boost({ atk: 1 }, target, target, null, false, true); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Guard Dog", rating: 2, num: 275, @@ -1689,7 +1689,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (['cramorantgulping', 'cramorantgorging'].includes(target.species.id)) { this.damage(source.baseMaxhp / 4, source, target); if (target.species.id === 'cramorantgulping') { - this.boost({def: -1}, source, target, null, true); + this.boost({ def: -1 }, source, target, null, true); } else { source.trySetStatus('par', target, move); } @@ -1703,7 +1703,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { source.formeChange(forme, effect); } }, - flags: {cantsuppress: 1, notransform: 1}, + flags: { cantsuppress: 1, notransform: 1 }, name: "Gulp Missile", rating: 2.5, num: 241, @@ -1791,7 +1791,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return damage / 2; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Heatproof", rating: 2, num: 85, @@ -1801,7 +1801,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onModifyWeight(weighthg) { return weighthg * 2; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Heavy Metal", rating: 0, num: 134, @@ -1841,7 +1841,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const targetForme = pokemon.species.name === 'Morpeko' ? 'Morpeko-Hangry' : 'Morpeko'; pokemon.formeChange(targetForme); }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Hunger Switch", rating: 1, num: 258, @@ -1884,11 +1884,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (boost.atk && boost.atk < 0) { delete boost.atk; if (!(effect as ActiveMove).secondaries) { - this.add("-fail", target, "unboost", "Attack", "[from] ability: Hyper Cutter", "[of] " + target); + this.add("-fail", target, "unboost", "Attack", "[from] ability: Hyper Cutter", `[of] ${target}`); } } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Hyper Cutter", rating: 1.5, num: 52, @@ -1970,7 +1970,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Ice Scales", rating: 4, num: 246, @@ -1981,14 +1981,14 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (boost.accuracy && boost.accuracy < 0) { delete boost.accuracy; if (!(effect as ActiveMove).secondaries) { - this.add("-fail", target, "unboost", "accuracy", "[from] ability: Illuminate", "[of] " + target); + this.add("-fail", target, "unboost", "accuracy", "[from] ability: Illuminate", `[of] ${target}`); } } }, onModifyMove(move) { move.ignoreEvasion = true; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Illuminate", rating: 0.5, num: 35, @@ -2029,7 +2029,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onFaint(pokemon) { pokemon.illusion = null; }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1 }, name: "Illusion", rating: 4.5, num: 149, @@ -2048,7 +2048,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } return false; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Immunity", rating: 2, num: 17, @@ -2064,7 +2064,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { pokemon.transformInto(target, this.dex.abilities.get('imposter')); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1 }, name: "Imposter", rating: 5, num: 150, @@ -2097,10 +2097,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onTryBoost(boost, target, source, effect) { if (effect.name === 'Intimidate' && boost.atk) { delete boost.atk; - this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Inner Focus', '[of] ' + target); + this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Inner Focus', `[of] ${target}`); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Inner Focus", rating: 1, num: 39, @@ -2125,7 +2125,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Insomnia", rating: 1.5, num: 15, @@ -2141,7 +2141,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (target.volatiles['substitute']) { this.add('-immune', target); } else { - this.boost({atk: -1}, target, pokemon, null, true); + this.boost({ atk: -1 }, target, pokemon, null, true); } } }, @@ -2154,7 +2154,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onStart(pokemon) { if (pokemon.swordBoost) return; pokemon.swordBoost = true; - this.boost({atk: 1}, pokemon); + this.boost({ atk: 1 }, pokemon); }, flags: {}, name: "Intrepid Sword", @@ -2189,7 +2189,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { justified: { onDamagingHit(damage, target, source, move) { if (move.type === 'Dark') { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } }, flags: {}, @@ -2203,14 +2203,14 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (boost.accuracy && boost.accuracy < 0) { delete boost.accuracy; if (!(effect as ActiveMove).secondaries) { - this.add("-fail", target, "unboost", "accuracy", "[from] ability: Keen Eye", "[of] " + target); + this.add("-fail", target, "unboost", "accuracy", "[from] ability: Keen Eye", `[of] ${target}`); } } }, onModifyMove(move) { move.ignoreEvasion = true; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Keen Eye", rating: 0.5, num: 51, @@ -2243,14 +2243,14 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Leaf Guard", rating: 0.5, num: 102, }, levitate: { // airborneness implemented in sim/pokemon.js:Pokemon#isGrounded - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Levitate", rating: 3.5, num: 26, @@ -2275,7 +2275,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onModifyWeight(weighthg) { return this.trunc(weighthg / 2); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Light Metal", rating: 1, num: 135, @@ -2283,7 +2283,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { lightningrod: { onTryHit(target, source, move) { if (target !== source && move.type === 'Electric') { - if (!this.boost({spa: 1})) { + if (!this.boost({ spa: 1 })) { this.add('-immune', target, '[from] ability: Lightning Rod'); } return null; @@ -2300,7 +2300,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.effectState.target; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Lightning Rod", rating: 3, num: 31, @@ -2319,7 +2319,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } return false; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Limber", rating: 2, num: 7, @@ -2333,7 +2333,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (this.checkMoveMakesContact(move, source, target, !source.isAlly(target))) { const oldAbility = source.setAbility('lingeringaroma', target); if (oldAbility) { - this.add('-activate', target, 'ability: Lingering Aroma', this.dex.abilities.get(oldAbility).name, '[of] ' + source); + this.add('-activate', target, 'ability: Lingering Aroma', this.dex.abilities.get(oldAbility).name, `[of] ${source}`); } } }, @@ -2344,7 +2344,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, liquidooze: { onSourceTryHeal(damage, target, source, effect) { - this.debug("Heal is occurring: " + target + " <- " + source + " :: " + effect.id); + this.debug(`Heal is occurring: ${target} <- ${source} :: ${effect.id}`); const canOoze = ['drain', 'leechseed', 'strengthsap']; if (canOoze.includes(effect.id)) { this.damage(damage); @@ -2386,7 +2386,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = false; - this.actions.useMove(newMove, target, {target: source}); + this.actions.useMove(newMove, target, { target: source }); return null; }, onAllyTryHitSide(target, source, move) { @@ -2396,13 +2396,13 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = false; - this.actions.useMove(newMove, this.effectState.target, {target: source}); + this.actions.useMove(newMove, this.effectState.target, { target: source }); return null; }, condition: { duration: 1, }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Magic Bounce", rating: 4, num: 156, @@ -2430,7 +2430,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { target.item = yourItem.id; // bypass setItem so we don't break choicelock or anything return; } - this.add('-item', source, yourItem, '[from] ability: Magician', '[of] ' + target); + this.add('-item', source, yourItem, '[from] ability: Magician', `[of] ${target}`); } }, flags: {}, @@ -2448,7 +2448,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onImmunity(type, pokemon) { if (type === 'frz') return false; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Magma Armor", rating: 0.5, num: 40, @@ -2478,7 +2478,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(1.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Marvel Scale", rating: 2.5, num: 63, @@ -2548,7 +2548,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (boost.accuracy && boost.accuracy < 0) { delete boost.accuracy; if (!(effect as ActiveMove).secondaries) { - this.add("-fail", target, "unboost", "accuracy", "[from] ability: Mind's Eye", "[of] " + target); + this.add("-fail", target, "unboost", "accuracy", "[from] ability: Mind's Eye", `[of] ${target}`); } } }, @@ -2561,7 +2561,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { move.ignoreImmunity['Normal'] = true; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Mind's Eye", rating: 0, num: 300, @@ -2598,7 +2598,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Mirror Armor", rating: 2, num: 240, @@ -2661,13 +2661,13 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { motordrive: { onTryHit(target, source, move) { if (target !== source && move.type === 'Electric') { - if (!this.boost({spe: 1})) { + if (!this.boost({ spe: 1 })) { this.add('-immune', target, '[from] ability: Motor Drive'); } return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Motor Drive", rating: 3, num: 78, @@ -2675,7 +2675,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { moxie: { onSourceAfterFaint(length, target, source, effect) { if (effect && effect.effectType === 'Move') { - this.boost({atk: length}, source); + this.boost({ atk: length }, source); } }, flags: {}, @@ -2690,14 +2690,14 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Multiscale", rating: 3.5, num: 136, }, multitype: { // Multitype's type-changing itself is implemented in statuses.js - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Multitype", rating: 4, num: 121, @@ -2711,7 +2711,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (this.checkMoveMakesContact(move, source, target, !source.isAlly(target))) { const oldAbility = source.setAbility('mummy', target); if (oldAbility) { - this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, '[of] ' + source); + this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, `[of] ${source}`); } } }, @@ -2794,7 +2794,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { // It's not possible to know what pokemon were cured // Unlike a -hint, this is real information that battlers need, so we use a -message - this.add('-message', "(" + cureList.length + " of " + pokemon.side.name + "'s pokemon " + (cureList.length === 1 ? "was" : "were") + " cured by Natural Cure.)"); + this.add('-message', `(${cureList.length} of ${pokemon.side.name}'s pokemon ${cureList.length === 1 ? "was" : "were"} cured by Natural Cure.)`); for (const pkmn of cureList) { pkmn.showCure = false; @@ -2891,7 +2891,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Neutralizing Gas", rating: 3.5, num: 256, @@ -2959,10 +2959,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onTryBoost(boost, target, source, effect) { if (effect.name === 'Intimidate' && boost.atk) { delete boost.atk; - this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Oblivious', '[of] ' + target); + this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Oblivious', `[of] ${target}`); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Oblivious", rating: 1.5, num: 12, @@ -2975,7 +2975,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { let i: BoostID; for (i in boost) { if (boost[i]! > 0) { - boostPlus[i] = (boostPlus[i] || 0) + boost[i]; + boostPlus[i] = (boostPlus[i] || 0) + boost[i]!; } } }, @@ -3035,7 +3035,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Overcoat", rating: 2, num: 142, @@ -3078,10 +3078,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onTryBoost(boost, target, source, effect) { if (effect.name === 'Intimidate' && boost.atk) { delete boost.atk; - this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Own Tempo', '[of] ' + target); + this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Own Tempo', `[of] ${target}`); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Own Tempo", rating: 1.5, num: 20, @@ -3089,7 +3089,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { parentalbond: { onPrepareHit(source, target, move) { if (move.category === 'Status' || move.multihit || move.flags['noparentalbond'] || move.flags['charge'] || - move.flags['futuremove'] || move.spreadHit || move.isZ || move.isMax) return; + move.flags['futuremove'] || move.spreadHit || move.isZ || move.isMax) return; move.multihit = 2; move.multihitType = 'parentalbond'; }, @@ -3134,11 +3134,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (!['psn', 'tox'].includes(status.id)) return; if ((effect as Move)?.status) { const effectHolder = this.effectState.target; - this.add('-block', target, 'ability: Pastel Veil', '[of] ' + effectHolder); + this.add('-block', target, 'ability: Pastel Veil', `[of] ${effectHolder}`); } return false; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Pastel Veil", rating: 2, num: 257, @@ -3169,8 +3169,8 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { source.item = yourItem.id; return; } - this.add('-enditem', source, yourItem, '[silent]', '[from] ability: Pickpocket', '[of] ' + source); - this.add('-item', target, yourItem, '[from] ability: Pickpocket', '[of] ' + source); + this.add('-enditem', source, yourItem, '[silent]', '[from] ability: Pickpocket', `[of] ${source}`); + this.add('-item', target, yourItem, '[from] ability: Pickpocket', `[of] ${source}`); } }, flags: {}, @@ -3267,7 +3267,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { target.addVolatile('confusion'); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1 }, name: "Poison Puppeteer", rating: 3, num: 310, @@ -3302,7 +3302,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { pokemon.maxhp = newMaxHP; this.add('-heal', pokemon, pokemon.getHealth, '[silent]'); }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Power Construct", rating: 5, num: 211, @@ -3313,10 +3313,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const ability = target.getAbility(); if (ability.flags['noreceiver'] || ability.id === 'noability') return; if (this.effectState.target.setAbility(ability)) { - this.add('-ability', this.effectState.target, ability, '[from] ability: Power of Alchemy', '[of] ' + target); + this.add('-ability', this.effectState.target, ability, '[from] ability: Power of Alchemy', `[of] ${target}`); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1 }, name: "Power of Alchemy", rating: 0, num: 223, @@ -3484,7 +3484,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-end', pokemon, 'Protosynthesis'); }, }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Protosynthesis", rating: 3, num: 281, @@ -3512,7 +3512,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Punk Rock", rating: 3.5, num: 244, @@ -3554,7 +3554,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Purifying Salt", rating: 4, num: 272, @@ -3620,7 +3620,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-end', pokemon, 'Quark Drive'); }, }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, name: "Quark Drive", rating: 3, num: 282, @@ -3635,11 +3635,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const dazzlingHolder = this.effectState.target; if ((source.isAlly(dazzlingHolder) || move.target === 'all') && move.priority > 0.1) { this.attrLastMove('[still]'); - this.add('cant', dazzlingHolder, 'ability: Queenly Majesty', move, '[of] ' + target); + this.add('cant', dazzlingHolder, 'ability: Queenly Majesty', move, `[of] ${target}`); return false; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Queenly Majesty", rating: 2.5, num: 214, @@ -3683,12 +3683,12 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { rattled: { onDamagingHit(damage, target, source, move) { if (['Dark', 'Bug', 'Ghost'].includes(move.type)) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); } }, onAfterBoost(boost, target, source, effect) { if (effect?.name === 'Intimidate' && boost.atk) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); } }, flags: {}, @@ -3702,10 +3702,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const ability = target.getAbility(); if (ability.flags['noreceiver'] || ability.id === 'noability') return; if (this.effectState.target.setAbility(ability)) { - this.add('-ability', this.effectState.target, ability, '[from] ability: Receiver', '[of] ' + target); + this.add('-ability', this.effectState.target, ability, '[from] ability: Receiver', `[of] ${target}`); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1 }, name: "Receiver", rating: 0, num: 222, @@ -3812,7 +3812,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, rkssystem: { // RKS System's type-changing itself is implemented in statuses.js - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "RKS System", rating: 4, num: 225, @@ -3929,7 +3929,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify([3277, 4096]); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Sand Veil", rating: 1.5, num: 8, @@ -3938,7 +3938,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onTryHitPriority: 1, onTryHit(target, source, move) { if (target !== source && move.type === 'Grass') { - if (!this.boost({atk: 1})) { + if (!this.boost({ atk: 1 })) { this.add('-immune', target, '[from] ability: Sap Sipper'); } return null; @@ -3947,10 +3947,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onAllyTryHitSide(target, source, move) { if (source === this.effectState.target || !target.isAlly(source)) return; if (move.type === 'Grass') { - this.boost({atk: 1}, this.effectState.target); + this.boost({ atk: 1 }, this.effectState.target); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Sap Sipper", rating: 3, num: 157, @@ -3985,7 +3985,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Schooling", rating: 3, num: 208, @@ -4002,7 +4002,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onTryBoost(boost, target, source, effect) { if (effect.name === 'Intimidate' && boost.atk) { delete boost.atk; - this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Scrappy', '[of] ' + target); + this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Scrappy', `[of] ${target}`); } }, flags: {}, @@ -4135,7 +4135,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, shellarmor: { onCriticalHit: false, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Shell Armor", rating: 1, num: 75, @@ -4145,7 +4145,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.debug('Shield Dust prevent secondary'); return secondaries.filter(effect => !!(effect.self || effect.dustproof)); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Shield Dust", rating: 2, num: 19, @@ -4190,7 +4190,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-immune', target, '[from] ability: Shields Down'); return null; }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Shields Down", rating: 3, num: 197, @@ -4203,7 +4203,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { boost[i]! *= 2; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Simple", rating: 4, num: 86, @@ -4293,7 +4293,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify([3277, 4096]); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Snow Cloak", rating: 1.5, num: 81, @@ -4332,7 +4332,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.75); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Solid Rock", rating: 3, num: 116, @@ -4340,7 +4340,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { soulheart: { onAnyFaintPriority: 1, onAnyFaint() { - this.boost({spa: 1}, this.effectState.target); + this.boost({ spa: 1 }, this.effectState.target); }, flags: {}, name: "Soul-Heart", @@ -4359,7 +4359,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-immune', this.effectState.target, '[from] ability: Soundproof'); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Soundproof", rating: 2, num: 43, @@ -4369,7 +4369,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onResidualSubOrder: 2, onResidual(pokemon) { if (pokemon.activeTurns) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); } }, flags: {}, @@ -4417,7 +4417,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, stamina: { onDamagingHit(damage, target, source, effect) { - this.boost({def: 1}); + this.boost({ def: 1 }); }, flags: {}, name: "Stamina", @@ -4432,7 +4432,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const targetForme = (move.id === 'kingsshield' ? 'Aegislash' : 'Aegislash-Blade'); if (attacker.species.name !== targetForme) attacker.formeChange(targetForme); }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Stance Change", rating: 4, num: 176, @@ -4452,7 +4452,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, steadfast: { onFlinch(pokemon) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); }, flags: {}, name: "Steadfast", @@ -4462,7 +4462,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { steamengine: { onDamagingHit(damage, target, source, move) { if (['Water', 'Fire'].includes(move.type)) { - this.boost({spe: 6}); + this.boost({ spe: 6 }); } }, flags: {}, @@ -4532,7 +4532,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return false; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Sticky Hold", rating: 1.5, num: 60, @@ -4540,7 +4540,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { stormdrain: { onTryHit(target, source, move) { if (target !== source && move.type === 'Water') { - if (!this.boost({spa: 1})) { + if (!this.boost({ spa: 1 })) { this.add('-immune', target, '[from] ability: Storm Drain'); } return null; @@ -4557,7 +4557,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.effectState.target; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Storm Drain", rating: 3, num: 114, @@ -4588,7 +4588,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return target.hp - 1; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Sturdy", rating: 3, num: 5, @@ -4599,7 +4599,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-activate', pokemon, 'ability: Suction Cups'); return null; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Suction Cups", rating: 1, num: 21, @@ -4622,7 +4622,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (target.volatiles['substitute']) { this.add('-immune', target); } else { - this.boost({evasion: -1}, target, pokemon, null, true); + this.boost({ evasion: -1 }, target, pokemon, null, true); } } }, @@ -4692,7 +4692,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (status.id === 'slp') { this.debug('Sweet Veil interrupts sleep'); const effectHolder = this.effectState.target; - this.add('-block', target, 'ability: Sweet Veil', '[of] ' + effectHolder); + this.add('-block', target, 'ability: Sweet Veil', `[of] ${effectHolder}`); return null; } }, @@ -4700,11 +4700,11 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { if (status.id === 'yawn') { this.debug('Sweet Veil blocking yawn'); const effectHolder = this.effectState.target; - this.add('-block', target, 'ability: Sweet Veil', '[of] ' + effectHolder); + this.add('-block', target, 'ability: Sweet Veil', `[of] ${effectHolder}`); return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Sweet Veil", rating: 2, num: 175, @@ -4733,7 +4733,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { source.item = myItem.id; return; } - this.add('-activate', source, 'ability: Symbiosis', myItem, '[of] ' + pokemon); + this.add('-activate', source, 'ability: Symbiosis', myItem, `[of] ${pokemon}`); }, flags: {}, name: "Symbiosis", @@ -4748,7 +4748,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-activate', target, 'ability: Synchronize'); // Hack to make status-prevention abilities think Synchronize is a status move // and show messages when activating against it. - source.trySetStatus(status, target, {status: status.id, id: 'synchronize'} as Effect); + source.trySetStatus(status, target, { status: status.id, id: 'synchronize' } as Effect); }, flags: {}, name: "Synchronize", @@ -4800,7 +4800,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Tangled Feet", rating: 1, num: 77, @@ -4809,7 +4809,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onDamagingHit(damage, target, source, move) { if (this.checkMoveMakesContact(move, source, target, true)) { this.add('-ability', target, 'Tangling Hair'); - this.boost({spe: -1}, source, target, null, true); + this.boost({ spe: -1 }, source, target, null, true); } }, flags: {}, @@ -4821,7 +4821,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onBasePowerPriority: 30, onBasePower(basePower, attacker, defender, move) { const basePowerAfterMultiplier = this.modify(basePower, this.event.modifier); - this.debug('Base Power: ' + basePowerAfterMultiplier); + this.debug(`Base Power: ${basePowerAfterMultiplier}`); if (basePowerAfterMultiplier <= 60) { this.debug('Technician boost'); return this.chainModify(1.5); @@ -4839,7 +4839,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Telepathy", rating: 0, num: 140, @@ -4853,7 +4853,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.field.clearTerrain(); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1 }, name: "Teraform Zero", rating: 3, num: 309, @@ -4867,7 +4867,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onAnyAfterMove() { delete this.effectState.resisted; }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, breakable: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, breakable: 1 }, name: "Tera Shell", rating: 3.5, num: 308, @@ -4889,7 +4889,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.add('-heal', pokemon, pokemon.getHealth, '[silent]'); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1 }, name: "Tera Shift", rating: 3, num: 307, @@ -4909,7 +4909,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { thermalexchange: { onDamagingHit(damage, target, source, move) { if (move.type === 'Fire') { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } }, onUpdate(pokemon) { @@ -4925,7 +4925,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } return false; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Thermal Exchange", rating: 2.5, num: 270, @@ -4945,7 +4945,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Thick Fat", rating: 3.5, num: 47, @@ -5062,10 +5062,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const target = this.sample(possibleTargets); const ability = target.getAbility(); if (pokemon.setAbility(ability)) { - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1 }, name: "Trace", rating: 2.5, num: 36, @@ -5148,7 +5148,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { boosts['accuracy'] = 0; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Unaware", rating: 4, num: 109, @@ -5253,7 +5253,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Vital Spirit", rating: 1.5, num: 72, @@ -5267,7 +5267,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Volt Absorb", rating: 3.5, num: 10, @@ -5282,9 +5282,9 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { const sourceAbility = source.setAbility('wanderingspirit', target); if (!sourceAbility) return; if (target.isAlly(source)) { - this.add('-activate', target, 'Skill Swap', '', '', '[of] ' + source); + this.add('-activate', target, 'Skill Swap', '', '', `[of] ${source}`); } else { - this.add('-activate', target, 'ability: Wandering Spirit', this.dex.abilities.get(sourceAbility).name, 'Wandering Spirit', '[of] ' + source); + this.add('-activate', target, 'ability: Wandering Spirit', this.dex.abilities.get(sourceAbility).name, 'Wandering Spirit', `[of] ${source}`); } target.setAbility(sourceAbility); } @@ -5303,7 +5303,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Water Absorb", rating: 3.5, num: 11, @@ -5344,7 +5344,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } return false; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Water Bubble", rating: 4.5, num: 199, @@ -5352,7 +5352,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { watercompaction: { onDamagingHit(damage, target, source, move) { if (move.type === 'Water') { - this.boost({def: 2}); + this.boost({ def: 2 }); } }, flags: {}, @@ -5374,7 +5374,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } return false; }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Water Veil", rating: 2, num: 41, @@ -5382,7 +5382,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { weakarmor: { onDamagingHit(damage, target, source, move) { if (move.category === 'Physical') { - this.boost({def: -1, spe: 2}, target, target); + this.boost({ def: -1, spe: 2 }, target, target); } }, flags: {}, @@ -5393,13 +5393,13 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { wellbakedbody: { onTryHit(target, source, move) { if (target !== source && move.type === 'Fire') { - if (!this.boost({def: 2})) { + if (!this.boost({ def: 2 })) { this.add('-immune', target, '[from] ability: Well-Baked Body'); } return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Well-Baked Body", rating: 3.5, num: 273, @@ -5416,10 +5416,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } } if (showMsg && !(effect as ActiveMove).secondaries && effect.id !== 'octolock') { - this.add("-fail", target, "unboost", "[from] ability: White Smoke", "[of] " + target); + this.add("-fail", target, "unboost", "[from] ability: White Smoke", `[of] ${target}`); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "White Smoke", rating: 2, num: 73, @@ -5461,12 +5461,12 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { windrider: { onStart(pokemon) { if (pokemon.side.sideConditions['tailwind']) { - this.boost({atk: 1}, pokemon, pokemon); + this.boost({ atk: 1 }, pokemon, pokemon); } }, onTryHit(target, source, move) { if (target !== source && move.flags['wind']) { - if (!this.boost({atk: 1}, target, target)) { + if (!this.boost({ atk: 1 }, target, target)) { this.add('-immune', target, '[from] ability: Wind Rider'); } return null; @@ -5475,10 +5475,10 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { onAllySideConditionStart(target, source, sideCondition) { const pokemon = this.effectState.target; if (sideCondition.id === 'tailwind') { - this.boost({atk: 1}, pokemon, pokemon); + this.boost({ atk: 1 }, pokemon, pokemon); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Wind Rider", rating: 3.5, // We do not want Brambleghast to get Infiltrator in Randbats @@ -5498,7 +5498,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return null; } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, failskillswap: 1, breakable: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, failskillswap: 1, breakable: 1 }, name: "Wonder Guard", rating: 5, num: 25, @@ -5511,7 +5511,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { return 50; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Wonder Skin", rating: 2, num: 147, @@ -5551,7 +5551,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } }, }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, name: "Zen Mode", rating: 0, num: 161, @@ -5571,7 +5571,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { this.effectState.heroMessageDisplayed = true; } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1 }, name: "Zero to Hero", rating: 5, num: 278, @@ -5591,7 +5591,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } }, isNonstandard: "CAP", - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Mountaineer", rating: 3, num: -2, @@ -5607,7 +5607,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; - this.actions.useMove(newMove, target, {target: source}); + this.actions.useMove(newMove, target, { target: source }); return null; }, onAllyTryHitSide(target, source, move) { @@ -5618,13 +5618,13 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { } const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; - this.actions.useMove(newMove, this.effectState.target, {target: source}); + this.actions.useMove(newMove, this.effectState.target, { target: source }); return null; }, condition: { duration: 1, }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Rebound", rating: 3, num: -3, diff --git a/data/cg-team-data.ts b/data/cg-team-data.ts index c3d80c0316..ee23587e63 100644 --- a/data/cg-team-data.ts +++ b/data/cg-team-data.ts @@ -1,37 +1,37 @@ // Data for computer-generated teams -export const MOVE_PAIRINGS: {[moveID: IDEntry]: IDEntry} = { +export const MOVE_PAIRINGS: { [moveID: IDEntry]: IDEntry } = { rest: 'sleeptalk', sleeptalk: 'rest', }; // Bonuses to move ratings by ability -export const ABILITY_MOVE_BONUSES: {[abilityID: IDEntry]: {[moveID: IDEntry]: number}} = { - drought: {sunnyday: 0.2, solarbeam: 2}, - contrary: {terablast: 2}, +export const ABILITY_MOVE_BONUSES: { [abilityID: IDEntry]: { [moveID: IDEntry]: number } } = { + drought: { sunnyday: 0.2, solarbeam: 2 }, + contrary: { terablast: 2 }, }; // Bonuses to move ratings by move type -export const ABILITY_MOVE_TYPE_BONUSES: {[abilityID: IDEntry]: {[typeName: string]: number}} = { - darkaura: {Dark: 1.33}, - dragonsmaw: {Dragon: 1.5}, - fairyaura: {Fairy: 1.33}, - steelworker: {Steel: 1.5}, - steelyspirit: {Steel: 1.5}, - transistor: {Electric: 1.3}, +export const ABILITY_MOVE_TYPE_BONUSES: { [abilityID: IDEntry]: { [typeName: string]: number } } = { + darkaura: { Dark: 1.33 }, + dragonsmaw: { Dragon: 1.5 }, + fairyaura: { Fairy: 1.33 }, + steelworker: { Steel: 1.5 }, + steelyspirit: { Steel: 1.5 }, + transistor: { Electric: 1.3 }, // -ate moves - pixilate: {Normal: 1.5 * 1.2}, - refrigerate: {Normal: 1.5 * 1.2}, - aerilate: {Normal: 1.5 * 1.2}, - normalize: {Normal: 1.2}, + pixilate: { Normal: 1.5 * 1.2 }, + refrigerate: { Normal: 1.5 * 1.2 }, + aerilate: { Normal: 1.5 * 1.2 }, + normalize: { Normal: 1.2 }, // weather - drizzle: {Water: 1.4, Fire: 0.6}, - drought: {Fire: 1.4, Water: 0.6}, + drizzle: { Water: 1.4, Fire: 0.6 }, + drought: { Fire: 1.4, Water: 0.6 }, }; // For moves whose quality isn't obvious from data // USE SPARINGLY! -export const HARDCODED_MOVE_WEIGHTS: {[moveID: IDEntry]: number} = { +export const HARDCODED_MOVE_WEIGHTS: { [moveID: IDEntry]: number } = { // Fails unless user is asleep snore: 0, // Hard to use diff --git a/data/cg-teams.ts b/data/cg-teams.ts index 496d43857c..aceaed42d6 100644 --- a/data/cg-teams.ts +++ b/data/cg-teams.ts @@ -33,8 +33,8 @@ * - Tracking type coverage to make it more likely that a moveset can hit every type */ -import {Dex, PRNG, SQL} from '../sim'; -import {EventMethods} from '../sim/dex-conditions'; +import { Dex, PRNG, SQL } from '../sim'; +import type { EventMethods } from '../sim/dex-conditions'; import { ABILITY_MOVE_BONUSES, ABILITY_MOVE_TYPE_BONUSES, @@ -45,13 +45,13 @@ import { } from './cg-team-data'; interface TeamStats { - hazardSetters: {[moveid: string]: number}; - typeWeaknesses: {[type: string]: number}; + hazardSetters: { [moveid: string]: number }; + typeWeaknesses: { [type: string]: number }; hazardRemovers: number; } interface MovesStats { - attackTypes: {[type: string]: number}; - setup: {atk: number, def: number, spa: number, spd: number, spe: number}; + attackTypes: { [type: string]: number }; + setup: { atk: number, def: number, spa: number, spd: number, spe: number }; noSleepTalk: number; hazards: number; stallingMoves: number; @@ -64,7 +64,7 @@ const MAX_WEAK_TO_SAME_TYPE = 3; /** An estimate of the highest raw speed in the metagame */ const TOP_SPEED = 300; -const levelOverride: {[speciesID: string]: number} = {}; +const levelOverride: { [speciesID: string]: number } = {}; export let levelUpdateInterval: NodeJS.Timeout | null = null; // can't import the function cg-teams-leveling.ts uses to this context for some reason @@ -95,7 +95,7 @@ async function updateLevels(database: SQL.DatabaseManager) { `INSERT INTO gen9_historical_levels (level, species_id, timestamp) VALUES (?, ?, ${Date.now()})` ); const data = await database.all('SELECT species_id, wins, losses, level FROM gen9computergeneratedteams'); - for (let {species_id, wins, losses, level} of data) { + for (let { species_id, wins, losses, level } of data) { const total = wins + losses; if (total > 10) { @@ -111,7 +111,7 @@ async function updateLevels(database: SQL.DatabaseManager) { } if (global.Config && Config.usesqlite && Config.usesqliteleveling) { - const database = SQL(module, {file: './databases/battlestats.db'}); + const database = SQL(module, { file: './databases/battlestats.db' }); // update every 2 hours void updateLevels(database); @@ -125,7 +125,7 @@ export default class TeamGenerator { forceLevel?: number; prng: PRNG; itemPool: Item[]; - specialItems: {[pokemon: string]: string}; + specialItems: { [pokemon: string]: string }; constructor(format: Format | string, seed: PRNG | PRNGSeed | null) { this.dex = Dex.forFormat(format); @@ -184,7 +184,7 @@ export default class TeamGenerator { const moves: Move[] = []; let movesStats: MovesStats = { - setup: {atk: 0, def: 0, spa: 0, spd: 0, spe: 0}, + setup: { atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }, attackTypes: {}, noSleepTalk: 0, hazards: 0, @@ -210,7 +210,7 @@ export default class TeamGenerator { // this is just a second reference the array because movePool gets set to point to a new array before the old one // gets mutated const movePoolCopy = movePool; - let interimMovePool: {move: IDEntry, weight: number}[] = []; + let interimMovePool: { move: IDEntry, weight: number }[] = []; while (moves.length < 4 && movePool.length) { let weights; if (!movePoolIsTrimmed) { @@ -218,7 +218,7 @@ export default class TeamGenerator { for (const moveID of movePool) { const move = this.dex.moves.get(moveID); const weight = this.getMoveWeight(move, teamStats, species, moves, movesStats, ability, level); - interimMovePool.push({move: moveID, weight}); + interimMovePool.push({ move: moveID, weight }); } interimMovePool.sort((a, b) => b.weight - a.weight); @@ -233,13 +233,13 @@ export default class TeamGenerator { const move = this.dex.moves.get(moveID); if (moves.includes(move)) continue; const weight = this.getMoveWeight(move, teamStats, species, moves, movesStats, ability, level); - interimMovePool.push({move: moveID, weight}); + interimMovePool.push({ move: moveID, weight }); } interimMovePool.sort((a, b) => b.weight - a.weight); moves.splice(0); movesStats = { - setup: {atk: 0, def: 0, spa: 0, spd: 0, spe: 0}, + setup: { atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }, attackTypes: {}, noSleepTalk: 0, hazards: 0, @@ -262,7 +262,7 @@ export default class TeamGenerator { ); } - const moveID = this.weightedRandomPick(movePool, weights, {remove: true}); + const moveID = this.weightedRandomPick(movePool, weights, { remove: true }); const move = this.dex.moves.get(moveID); moves.push(move); @@ -392,7 +392,7 @@ export default class TeamGenerator { moves: moves.map(m => m.name), nature: 'Quirky', gender: species.gender, - evs: {hp: 84, atk: 84, def: 84, spa: 84, spd: 84, spe: 84}, + evs: { hp: 84, atk: 84, def: 84, spa: 84, spd: 84, spe: 84 }, ivs, level, teraType, @@ -493,7 +493,7 @@ export default class TeamGenerator { weight *= 32; // these moves can also lessen the effectiveness of the user's team's own hazards - weight *= Math.pow(0.8, Object.values(teamStats.hazardSetters).reduce((total, num) => total + num, 0)); + weight *= 0.8 ** Object.values(teamStats.hazardSetters).reduce((total, num) => total + num, 0); } // boosts @@ -639,8 +639,8 @@ export default class TeamGenerator { if (move.category === 'Special') powerEstimate *= Math.max(0.5, 1 + specialSetup) / Math.max(0.5, 1 + physicalSetup); const abilityBonus = ( - ((ABILITY_MOVE_BONUSES[this.dex.toID(ability)] || {})[move.id] || 1) * - ((ABILITY_MOVE_TYPE_BONUSES[this.dex.toID(ability)] || {})[moveType] || 1) + (ABILITY_MOVE_BONUSES[this.dex.toID(ability)]?.[move.id] || 1) * + (ABILITY_MOVE_TYPE_BONUSES[this.dex.toID(ability)]?.[moveType] || 1) ); let weight = powerEstimate * abilityBonus; @@ -664,7 +664,7 @@ export default class TeamGenerator { if (move.flags.contact) { if (ability === 'Tough Claws') weight *= 1.3; if (ability === 'Unseen Fist') weight *= 1.1; - if (ability === 'Poison Touch') weight *= TeamGenerator.statusWeight('psn', 1 - Math.pow(0.7, numberOfHits)); + if (ability === 'Poison Touch') weight *= TeamGenerator.statusWeight('psn', 1 - (0.7 ** numberOfHits)); } if (move.flags.bite && ability === 'Strong Jaw') weight *= 1.5; // 5% boost for ability to break subs @@ -697,7 +697,7 @@ export default class TeamGenerator { } } } - if (ability === 'Toxic Chain') weight *= TeamGenerator.statusWeight('tox', 1 - Math.pow(0.7, numberOfHits)); + if (ability === 'Toxic Chain') weight *= TeamGenerator.statusWeight('tox', 1 - (0.7 ** numberOfHits)); // Special effect if something special happened earlier in the turn // More useful on slower Pokemon @@ -734,7 +734,7 @@ export default class TeamGenerator { // these two hazard removers don't clear hazards on the opponent's field, but can be blocked by type immunities if (['rapidspin', 'mortalspin'].includes(move.id)) { - weight *= 1 + 20 * Math.pow(0.25, teamStats.hazardRemovers); + weight *= 1 + 20 * (0.25 ** teamStats.hazardRemovers); } // these moves have a hard-coded 16x bonus @@ -845,10 +845,10 @@ export default class TeamGenerator { const abilityMod = ability === 'Simple' ? 2 : ability === 'Contrary' ? -1 : 1; const bodyPressMod = movesSoFar.some(m => m.id === 'bodyPress') ? 2 : 1; const electroBallMod = movesSoFar.some(m => m.id === 'electroball') ? 2 : 1; - for (const {chance, boosts} of [ - {chance: 1, boosts: move.boosts}, - {chance: 1, boosts: move.self?.boosts}, - {chance: 1, boosts: move.selfBoost?.boosts}, + for (const { chance, boosts } of [ + { chance: 1, boosts: move.boosts }, + { chance: 1, boosts: move.self?.boosts }, + { chance: 1, boosts: move.selfBoost?.boosts }, { chance: secondaryChance, boosts: move.secondary?.self?.boosts, @@ -883,8 +883,8 @@ export default class TeamGenerator { if (!['allAdjacentFoes', 'allAdjacent', 'foeSide', 'normal'].includes(move.target)) return 1; let averageNumberOfDebuffs = 0; - for (const {chance, boosts} of [ - {chance: 1, boosts: move.boosts}, + for (const { chance, boosts } of [ + { chance: 1, boosts: move.boosts }, { chance: move.secondary ? ((move.secondary.chance || 100) / 100) : 0, boosts: move.secondary?.boosts, @@ -1046,7 +1046,7 @@ export default class TeamGenerator { weightedRandomPick( choices: T[], weights: number[], - options?: {remove?: boolean} + options?: { remove?: boolean } ) { if (!choices.length) throw new Error(`Can't pick from an empty list`); if (choices.length !== weights.length) throw new Error(`Choices and weights must be the same length`); diff --git a/data/conditions.ts b/data/conditions.ts index 92470f9051..27506b4726 100644 --- a/data/conditions.ts +++ b/data/conditions.ts @@ -6,7 +6,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { if (sourceEffect && sourceEffect.id === 'flameorb') { this.add('-status', target, 'brn', '[from] item: Flame Orb'); } else if (sourceEffect && sourceEffect.effectType === 'Ability') { - this.add('-status', target, 'brn', '[from] ability: ' + sourceEffect.name, '[of] ' + source); + this.add('-status', target, 'brn', '[from] ability: ' + sourceEffect.name, `[of] ${source}`); } else { this.add('-status', target, 'brn'); } @@ -22,7 +22,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Ability') { - this.add('-status', target, 'par', '[from] ability: ' + sourceEffect.name, '[of] ' + source); + this.add('-status', target, 'par', '[from] ability: ' + sourceEffect.name, `[of] ${source}`); } else { this.add('-status', target, 'par'); } @@ -49,9 +49,9 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Ability') { - this.add('-status', target, 'slp', '[from] ability: ' + sourceEffect.name, '[of] ' + source); + this.add('-status', target, 'slp', '[from] ability: ' + sourceEffect.name, `[of] ${source}`); } else if (sourceEffect && sourceEffect.effectType === 'Move') { - this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name); + this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`); } else { this.add('-status', target, 'slp'); } @@ -85,7 +85,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Ability') { - this.add('-status', target, 'frz', '[from] ability: ' + sourceEffect.name, '[of] ' + source); + this.add('-status', target, 'frz', '[from] ability: ' + sourceEffect.name, `[of] ${source}`); } else { this.add('-status', target, 'frz'); } @@ -106,7 +106,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { }, onModifyMove(move, pokemon) { if (move.flags['defrost']) { - this.add('-curestatus', pokemon, 'frz', '[from] move: ' + move); + this.add('-curestatus', pokemon, 'frz', `[from] move: ${move}`); pokemon.clearStatus(); } }, @@ -126,7 +126,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Ability') { - this.add('-status', target, 'psn', '[from] ability: ' + sourceEffect.name, '[of] ' + source); + this.add('-status', target, 'psn', '[from] ability: ' + sourceEffect.name, `[of] ${source}`); } else { this.add('-status', target, 'psn'); } @@ -144,7 +144,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { if (sourceEffect && sourceEffect.id === 'toxicorb') { this.add('-status', target, 'tox', '[from] item: Toxic Orb'); } else if (sourceEffect && sourceEffect.effectType === 'Ability') { - this.add('-status', target, 'tox', '[from] ability: ' + sourceEffect.name, '[of] ' + source); + this.add('-status', target, 'tox', '[from] ability: ' + sourceEffect.name, `[of] ${source}`); } else { this.add('-status', target, 'tox'); } @@ -167,7 +167,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { if (sourceEffect?.id === 'lockedmove') { this.add('-start', target, 'confusion', '[fatigue]'); } else if (sourceEffect?.effectType === 'Ability') { - this.add('-start', target, 'confusion', '[from] ability: ' + sourceEffect.name, '[of] ' + source); + this.add('-start', target, 'confusion', '[from] ability: ' + sourceEffect.name, `[of] ${source}`); } else { this.add('-start', target, 'confusion'); } @@ -191,7 +191,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { this.activeTarget = pokemon; const damage = this.actions.getConfusionDamage(pokemon, 40); if (typeof damage !== 'number') throw new Error("Confusion damage not dealt"); - const activeMove = {id: this.toID('confused'), effectType: 'Move', type: '???'}; + const activeMove = { id: this.toID('confused'), effectType: 'Move', type: '???' }; this.damage(damage, pokemon, pokemon, activeMove as ActiveMove); return false; }, @@ -228,7 +228,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { return this.random(5, 7); }, onStart(pokemon, source) { - this.add('-activate', pokemon, 'move: ' + this.effectState.sourceEffect, '[of] ' + source); + this.add('-activate', pokemon, 'move: ' + this.effectState.sourceEffect, `[of] ${source}`); this.effectState.boundDivisor = source.hasItem('bindingband') ? 6 : 8; }, onResidualOrder: 13, @@ -444,7 +444,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { // this.effectState.counter should never be undefined here. // However, just in case, use 1 if it is undefined. const counter = this.effectState.counter || 1; - this.debug("Success chance: " + Math.round(100 / counter) + "%"); + this.debug(`Success chance: ${Math.round(100 / counter)}%`); const success = this.randomChance(1, counter); if (!success) delete pokemon.volatiles['stall']; return success; @@ -493,7 +493,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { if (this.gen <= 5) this.effectState.duration = 0; - this.add('-weather', 'RainDance', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'RainDance', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-weather', 'RainDance'); } @@ -528,7 +528,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { } }, onFieldStart(field, source, effect) { - this.add('-weather', 'PrimordialSea', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'PrimordialSea', '[from] ability: ' + effect.name, `[of] ${source}`); }, onFieldResidualOrder: 1, onFieldResidual() { @@ -567,7 +567,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { onFieldStart(battle, source, effect) { if (effect?.effectType === 'Ability') { if (this.gen <= 5) this.effectState.duration = 0; - this.add('-weather', 'SunnyDay', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'SunnyDay', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-weather', 'SunnyDay'); } @@ -606,7 +606,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { } }, onFieldStart(field, source, effect) { - this.add('-weather', 'DesolateLand', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'DesolateLand', '[from] ability: ' + effect.name, `[of] ${source}`); }, onImmunity(type, pokemon) { if (pokemon.hasItem('utilityumbrella')) return; @@ -642,7 +642,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { if (this.gen <= 5) this.effectState.duration = 0; - this.add('-weather', 'Sandstorm', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'Sandstorm', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-weather', 'Sandstorm'); } @@ -672,7 +672,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { if (this.gen <= 5) this.effectState.duration = 0; - this.add('-weather', 'Hail', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'Hail', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-weather', 'Hail'); } @@ -708,7 +708,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { if (this.gen <= 5) this.effectState.duration = 0; - this.add('-weather', 'Snowscape', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'Snowscape', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-weather', 'Snowscape'); } @@ -734,7 +734,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { } }, onFieldStart(field, source, effect) { - this.add('-weather', 'DeltaStream', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'DeltaStream', '[from] ability: ' + effect.name, `[of] ${source}`); }, onFieldResidualOrder: 1, onFieldResidual() { @@ -806,7 +806,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { name: "Commanded", noCopy: true, onStart(pokemon) { - this.boost({atk: 2, spa: 2, spe: 2, def: 2, spd: 2}, pokemon); + this.boost({ atk: 2, spa: 2, spe: 2, def: 2, spd: 2 }, pokemon); }, onDragOutPriority: 2, onDragOut() { @@ -880,7 +880,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = { duration: 2, onBasePower(relayVar, source, target, move) { let bp = Math.max(1, move.basePower); - bp *= Math.pow(2, source.volatiles['rolloutstorage'].contactHitCount); + bp *= 2 ** source.volatiles['rolloutstorage'].contactHitCount; if (source.volatiles['defensecurl']) { bp *= 2; } diff --git a/data/items.ts b/data/items.ts index 78e6d7a9e2..dc5b9cc129 100644 --- a/data/items.ts +++ b/data/items.ts @@ -162,7 +162,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, @@ -271,12 +271,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, onEat(pokemon) { - this.boost({spd: 1}); + this.boost({ spd: 1 }); }, num: 205, gen: 3, @@ -922,7 +922,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onStart(pokemon) { if (pokemon.volatiles['choicelock']) { - this.debug('removing choicelock: ' + pokemon.volatiles['choicelock']); + this.debug('removing choicelock'); } pokemon.removeVolatile('choicelock'); }, @@ -946,7 +946,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onStart(pokemon) { if (pokemon.volatiles['choicelock']) { - this.debug('removing choicelock: ' + pokemon.volatiles['choicelock']); + this.debug('removing choicelock'); } pokemon.removeVolatile('choicelock'); }, @@ -969,7 +969,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onStart(pokemon) { if (pokemon.volatiles['choicelock']) { - this.debug('removing choicelock: ' + pokemon.volatiles['choicelock']); + this.debug('removing choicelock'); } pokemon.removeVolatile('choicelock'); }, @@ -1037,7 +1037,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { } } if (showMsg && !(effect as ActiveMove).secondaries && effect.id !== 'octolock') { - this.add('-fail', target, 'unboost', '[from] item: Clear Amulet', '[of] ' + target); + this.add('-fail', target, 'unboost', '[from] item: Clear Amulet', `[of] ${target}`); } }, num: 1882, @@ -1179,7 +1179,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { if ( priority <= 0 && (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) ) { if (pokemon.eatItem()) { this.add('-activate', pokemon, 'item: Custap Berry', '[consumed]'); @@ -1304,7 +1304,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onAttractPriority: -100, onAttract(target, source) { - this.debug('attract intercepted: ' + target + ' from ' + source); + this.debug(`attract intercepted: ${target} from ${source}`); if (!source || source === target) return; if (!source.volatiles['attract']) source.addVolatile('attract', target); }, @@ -1841,7 +1841,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, @@ -2159,12 +2159,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, onEat(pokemon) { - this.boost({def: 1}); + this.boost({ def: 1 }); }, num: 202, gen: 3, @@ -2615,7 +2615,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, @@ -2872,7 +2872,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { } }, onEat(pokemon) { - this.boost({def: 1}); + this.boost({ def: 1 }); }, num: 687, gen: 6, @@ -2957,7 +2957,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, @@ -3092,12 +3092,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, onEat(pokemon) { - this.boost({atk: 1}); + this.boost({ atk: 1 }); }, num: 201, gen: 3, @@ -3388,7 +3388,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, @@ -3465,7 +3465,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { } }, onEat(pokemon) { - this.boost({spd: 1}); + this.boost({ spd: 1 }); }, num: 688, gen: 6, @@ -3728,7 +3728,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onResidual(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, @@ -3809,7 +3809,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { let i: BoostID; for (i in boost) { if (boost[i]! > 0) { - boostPlus[i] = (boostPlus[i] || 0) + boost[i]; + boostPlus[i] = (boostPlus[i] || 0) + boost[i]!; this.effectState.ready = true; } } @@ -4185,12 +4185,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, onEat(pokemon) { - this.boost({spa: 1}); + this.boost({ spa: 1 }); }, num: 204, gen: 3, @@ -5095,12 +5095,12 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, onEat(pokemon) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); }, num: 203, gen: 3, @@ -5544,7 +5544,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, @@ -7241,7 +7241,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = { }, onUpdate(pokemon) { if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && - pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { + pokemon.hasAbility('gluttony') && pokemon.abilityState.gluttony)) { pokemon.eatItem(); } }, diff --git a/data/mods/fullpotential/scripts.ts b/data/mods/fullpotential/scripts.ts index 94e8de04fa..89e4d75abb 100644 --- a/data/mods/fullpotential/scripts.ts +++ b/data/mods/fullpotential/scripts.ts @@ -80,7 +80,7 @@ export const Scripts: ModdedBattleScriptsData = { const isPhysical = move.category === 'Physical'; const defenseStat: StatIDExceptHP = move.overrideDefensiveStat || (isPhysical ? 'def' : 'spd'); - const statTable: {[k in StatIDExceptHP]: string} = {atk: 'Atk', def: 'Def', spa: 'SpA', spd: 'SpD', spe: 'Spe'}; + const statTable: { [k in StatIDExceptHP]: string } = { atk: 'Atk', def: 'Def', spa: 'SpA', spd: 'SpD', spe: 'Spe' }; let maxAttack = 0; diff --git a/data/mods/gen1/conditions.ts b/data/mods/gen1/conditions.ts index 1500810888..621193a452 100644 --- a/data/mods/gen1/conditions.ts +++ b/data/mods/gen1/conditions.ts @@ -41,7 +41,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa if (pokemon.removeVolatile('twoturnmove')) { if (pokemon.volatiles['invulnerability']) { this.hint(`In Gen 1, when a Dig/Fly user is fully paralyzed while semi-invulnerable, ` + - `it will remain semi-invulnerable until it switches out or fully executes Dig/Fly`, true); + `it will remain semi-invulnerable until it switches out or fully executes Dig/Fly`, true); } } pokemon.removeVolatile('partialtrappinglock'); @@ -55,7 +55,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Move') { - this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name); + this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`); } else { this.add('-status', target, 'slp'); } @@ -155,7 +155,6 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa pokemon.removeVolatile('lockedmove'); return false; } - return; }, }, flinch: { @@ -234,7 +233,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa const move = this.dex.moves.get(this.effectState.move); if (move.id) { this.debug('Forcing into ' + move.id); - this.queue.changeAction(pokemon, {choice: 'move', moveid: move.id}); + this.queue.changeAction(pokemon, { choice: 'move', moveid: move.id }); } }, }, diff --git a/data/mods/gen1/moves.ts b/data/mods/gen1/moves.ts index cfa7d6e585..5ea562beb3 100644 --- a/data/mods/gen1/moves.ts +++ b/data/mods/gen1/moves.ts @@ -53,7 +53,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return false; } const target = this.getRandomTarget(pokemon, 'Pound'); - this.actions.moveHit(target, pokemon, currentMove, {damage: this.effectState.damage * 2} as ActiveMove); + this.actions.moveHit(target, pokemon, currentMove, { damage: this.effectState.damage * 2 } as ActiveMove); pokemon.removeVolatile('bide'); return false; } @@ -175,7 +175,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { target: "normal", onHit(target, source) { source.setType(target.getTypes(true)); - this.add('-start', source, 'typechange', source.types.join('/'), '[from] move: Conversion', '[of] ' + target); + this.add('-start', source, 'typechange', source.types.join('/'), '[from] move: Conversion', `[of] ${target}`); }, }, counter: { @@ -217,7 +217,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return 2 * this.lastDamage; }, - flags: {contact: 1, protect: 1, metronome: 1}, + flags: { contact: 1, protect: 1, metronome: 1 }, }, crabhammer: { inherit: true, @@ -246,7 +246,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Disable", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'disable', onTryHit(target) { // This function should not return if the checks are met. Adding && undefined ensures this happens. @@ -402,7 +402,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { // in-game, so it is equivalent to just clear it. const silentHack = '|[silent]'; const silentHackVolatiles = ['disable', 'confusion']; - const hazeVolatiles: {[key: string]: string} = { + const hazeVolatiles: { [key: string]: string } = { 'disable': '', 'confusion': '', 'mist': 'Mist', @@ -485,7 +485,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Light Screen", pp: 30, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, volatileStatus: 'lightscreen', onTryHit(pokemon) { if (pokemon.volatiles['lightscreen']) { @@ -502,7 +502,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, mimic: { inherit: true, - flags: {protect: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, bypasssub: 1, metronome: 1 }, onHit(target, source) { const moveslot = source.moves.indexOf('mimic'); if (moveslot < 0) return false; @@ -611,7 +611,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onHit(target, source, move) { // Disable and exploding moves boost Rage even if they miss/fail, so they are dealt with separately. if (target.boosts.atk < 6 && (move.category !== 'Status' && !move.selfdestruct)) { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } }, }, @@ -662,7 +662,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Reflect", pp: 20, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, volatileStatus: 'reflect', onTryHit(pokemon) { if (pokemon.volatiles['reflect']) { @@ -815,7 +815,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Substitute", pp: 10, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, volatileStatus: 'substitute', onTryHit(target) { if (target.volatiles['substitute']) { @@ -876,8 +876,8 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { // Drain/recoil/secondary effect confusion do not happen if the substitute breaks if (target.volatiles['substitute']) { if (move.recoil) { - this.damage(this.clampIntRange(Math.floor(uncappedDamage * move.recoil[0] / move.recoil[1]), 1) - , source, target, 'recoil'); + this.damage(this.clampIntRange(Math.floor(uncappedDamage * move.recoil[0] / move.recoil[1]), 1), + source, target, 'recoil'); } if (move.drain) { const amount = this.clampIntRange(Math.floor(uncappedDamage * move.drain[0] / move.drain[1]), 1); @@ -899,7 +899,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { // Add here counter damage const lastAttackedBy = target.getLastAttackedBy(); if (!lastAttackedBy) { - target.attackedBy.push({source: source, move: move.id, damage: uncappedDamage, slot: source.getSlot(), thisTurn: true}); + target.attackedBy.push({ source, move: move.id, damage: uncappedDamage, slot: source.getSlot(), thisTurn: true }); } else { lastAttackedBy.move = move.id; lastAttackedBy.damage = uncappedDamage; diff --git a/data/mods/gen1/pokedex.ts b/data/mods/gen1/pokedex.ts index f918ae1928..d20fcc00a1 100644 --- a/data/mods/gen1/pokedex.ts +++ b/data/mods/gen1/pokedex.ts @@ -1,612 +1,612 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable = { missingno: { inherit: true, - baseStats: {hp: 33, atk: 136, def: 0, spa: 6, spd: 6, spe: 29}, + baseStats: { hp: 33, atk: 136, def: 0, spa: 6, spd: 6, spe: 29 }, }, bulbasaur: { inherit: true, - baseStats: {hp: 45, atk: 49, def: 49, spa: 65, spd: 65, spe: 45}, + baseStats: { hp: 45, atk: 49, def: 49, spa: 65, spd: 65, spe: 45 }, }, ivysaur: { inherit: true, - baseStats: {hp: 60, atk: 62, def: 63, spa: 80, spd: 80, spe: 60}, + baseStats: { hp: 60, atk: 62, def: 63, spa: 80, spd: 80, spe: 60 }, }, venusaur: { inherit: true, - baseStats: {hp: 80, atk: 82, def: 83, spa: 100, spd: 100, spe: 80}, + baseStats: { hp: 80, atk: 82, def: 83, spa: 100, spd: 100, spe: 80 }, }, charmander: { inherit: true, - baseStats: {hp: 39, atk: 52, def: 43, spa: 50, spd: 50, spe: 65}, + baseStats: { hp: 39, atk: 52, def: 43, spa: 50, spd: 50, spe: 65 }, }, charmeleon: { inherit: true, - baseStats: {hp: 58, atk: 64, def: 58, spa: 65, spd: 65, spe: 80}, + baseStats: { hp: 58, atk: 64, def: 58, spa: 65, spd: 65, spe: 80 }, }, charizard: { inherit: true, - baseStats: {hp: 78, atk: 84, def: 78, spa: 85, spd: 85, spe: 100}, + baseStats: { hp: 78, atk: 84, def: 78, spa: 85, spd: 85, spe: 100 }, }, squirtle: { inherit: true, - baseStats: {hp: 44, atk: 48, def: 65, spa: 50, spd: 50, spe: 43}, + baseStats: { hp: 44, atk: 48, def: 65, spa: 50, spd: 50, spe: 43 }, }, wartortle: { inherit: true, - baseStats: {hp: 59, atk: 63, def: 80, spa: 65, spd: 65, spe: 58}, + baseStats: { hp: 59, atk: 63, def: 80, spa: 65, spd: 65, spe: 58 }, }, blastoise: { inherit: true, - baseStats: {hp: 79, atk: 83, def: 100, spa: 85, spd: 85, spe: 78}, + baseStats: { hp: 79, atk: 83, def: 100, spa: 85, spd: 85, spe: 78 }, }, caterpie: { inherit: true, - baseStats: {hp: 45, atk: 30, def: 35, spa: 20, spd: 20, spe: 45}, + baseStats: { hp: 45, atk: 30, def: 35, spa: 20, spd: 20, spe: 45 }, }, metapod: { inherit: true, - baseStats: {hp: 50, atk: 20, def: 55, spa: 25, spd: 25, spe: 30}, + baseStats: { hp: 50, atk: 20, def: 55, spa: 25, spd: 25, spe: 30 }, }, butterfree: { inherit: true, - baseStats: {hp: 60, atk: 45, def: 50, spa: 80, spd: 80, spe: 70}, + baseStats: { hp: 60, atk: 45, def: 50, spa: 80, spd: 80, spe: 70 }, }, weedle: { inherit: true, - baseStats: {hp: 40, atk: 35, def: 30, spa: 20, spd: 20, spe: 50}, + baseStats: { hp: 40, atk: 35, def: 30, spa: 20, spd: 20, spe: 50 }, }, kakuna: { inherit: true, - baseStats: {hp: 45, atk: 25, def: 50, spa: 25, spd: 25, spe: 35}, + baseStats: { hp: 45, atk: 25, def: 50, spa: 25, spd: 25, spe: 35 }, }, beedrill: { inherit: true, - baseStats: {hp: 65, atk: 80, def: 40, spa: 45, spd: 45, spe: 75}, + baseStats: { hp: 65, atk: 80, def: 40, spa: 45, spd: 45, spe: 75 }, }, pidgey: { inherit: true, - baseStats: {hp: 40, atk: 45, def: 40, spa: 35, spd: 35, spe: 56}, + baseStats: { hp: 40, atk: 45, def: 40, spa: 35, spd: 35, spe: 56 }, }, pidgeotto: { inherit: true, - baseStats: {hp: 63, atk: 60, def: 55, spa: 50, spd: 50, spe: 71}, + baseStats: { hp: 63, atk: 60, def: 55, spa: 50, spd: 50, spe: 71 }, }, pidgeot: { inherit: true, - baseStats: {hp: 83, atk: 80, def: 75, spa: 70, spd: 70, spe: 91}, + baseStats: { hp: 83, atk: 80, def: 75, spa: 70, spd: 70, spe: 91 }, }, rattata: { inherit: true, - baseStats: {hp: 30, atk: 56, def: 35, spa: 25, spd: 25, spe: 72}, + baseStats: { hp: 30, atk: 56, def: 35, spa: 25, spd: 25, spe: 72 }, }, raticate: { inherit: true, - baseStats: {hp: 55, atk: 81, def: 60, spa: 50, spd: 50, spe: 97}, + baseStats: { hp: 55, atk: 81, def: 60, spa: 50, spd: 50, spe: 97 }, }, spearow: { inherit: true, - baseStats: {hp: 40, atk: 60, def: 30, spa: 31, spd: 31, spe: 70}, + baseStats: { hp: 40, atk: 60, def: 30, spa: 31, spd: 31, spe: 70 }, }, fearow: { inherit: true, - baseStats: {hp: 65, atk: 90, def: 65, spa: 61, spd: 61, spe: 100}, + baseStats: { hp: 65, atk: 90, def: 65, spa: 61, spd: 61, spe: 100 }, }, ekans: { inherit: true, - baseStats: {hp: 35, atk: 60, def: 44, spa: 40, spd: 40, spe: 55}, + baseStats: { hp: 35, atk: 60, def: 44, spa: 40, spd: 40, spe: 55 }, }, arbok: { inherit: true, - baseStats: {hp: 60, atk: 85, def: 69, spa: 65, spd: 65, spe: 80}, + baseStats: { hp: 60, atk: 85, def: 69, spa: 65, spd: 65, spe: 80 }, }, pikachu: { inherit: true, - baseStats: {hp: 35, atk: 55, def: 30, spa: 50, spd: 50, spe: 90}, + baseStats: { hp: 35, atk: 55, def: 30, spa: 50, spd: 50, spe: 90 }, }, raichu: { inherit: true, - baseStats: {hp: 60, atk: 90, def: 55, spa: 90, spd: 90, spe: 100}, + baseStats: { hp: 60, atk: 90, def: 55, spa: 90, spd: 90, spe: 100 }, }, sandshrew: { inherit: true, - baseStats: {hp: 50, atk: 75, def: 85, spa: 30, spd: 30, spe: 40}, + baseStats: { hp: 50, atk: 75, def: 85, spa: 30, spd: 30, spe: 40 }, }, sandslash: { inherit: true, - baseStats: {hp: 75, atk: 100, def: 110, spa: 55, spd: 55, spe: 65}, + baseStats: { hp: 75, atk: 100, def: 110, spa: 55, spd: 55, spe: 65 }, }, nidoranf: { inherit: true, - baseStats: {hp: 55, atk: 47, def: 52, spa: 40, spd: 40, spe: 41}, + baseStats: { hp: 55, atk: 47, def: 52, spa: 40, spd: 40, spe: 41 }, }, nidorina: { inherit: true, - baseStats: {hp: 70, atk: 62, def: 67, spa: 55, spd: 55, spe: 56}, + baseStats: { hp: 70, atk: 62, def: 67, spa: 55, spd: 55, spe: 56 }, }, nidoqueen: { inherit: true, - baseStats: {hp: 90, atk: 82, def: 87, spa: 75, spd: 75, spe: 76}, + baseStats: { hp: 90, atk: 82, def: 87, spa: 75, spd: 75, spe: 76 }, }, nidoranm: { inherit: true, - baseStats: {hp: 46, atk: 57, def: 40, spa: 40, spd: 40, spe: 50}, + baseStats: { hp: 46, atk: 57, def: 40, spa: 40, spd: 40, spe: 50 }, }, nidorino: { inherit: true, - baseStats: {hp: 61, atk: 72, def: 57, spa: 55, spd: 55, spe: 65}, + baseStats: { hp: 61, atk: 72, def: 57, spa: 55, spd: 55, spe: 65 }, }, nidoking: { inherit: true, - baseStats: {hp: 81, atk: 92, def: 77, spa: 75, spd: 75, spe: 85}, + baseStats: { hp: 81, atk: 92, def: 77, spa: 75, spd: 75, spe: 85 }, }, clefairy: { inherit: true, - baseStats: {hp: 70, atk: 45, def: 48, spa: 60, spd: 60, spe: 35}, + baseStats: { hp: 70, atk: 45, def: 48, spa: 60, spd: 60, spe: 35 }, }, clefable: { inherit: true, - baseStats: {hp: 95, atk: 70, def: 73, spa: 85, spd: 85, spe: 60}, + baseStats: { hp: 95, atk: 70, def: 73, spa: 85, spd: 85, spe: 60 }, }, vulpix: { inherit: true, - baseStats: {hp: 38, atk: 41, def: 40, spa: 65, spd: 65, spe: 65}, + baseStats: { hp: 38, atk: 41, def: 40, spa: 65, spd: 65, spe: 65 }, }, ninetales: { inherit: true, - baseStats: {hp: 73, atk: 76, def: 75, spa: 100, spd: 100, spe: 100}, + baseStats: { hp: 73, atk: 76, def: 75, spa: 100, spd: 100, spe: 100 }, }, jigglypuff: { inherit: true, - baseStats: {hp: 115, atk: 45, def: 20, spa: 25, spd: 25, spe: 20}, + baseStats: { hp: 115, atk: 45, def: 20, spa: 25, spd: 25, spe: 20 }, }, wigglytuff: { inherit: true, - baseStats: {hp: 140, atk: 70, def: 45, spa: 50, spd: 50, spe: 45}, + baseStats: { hp: 140, atk: 70, def: 45, spa: 50, spd: 50, spe: 45 }, }, zubat: { inherit: true, - baseStats: {hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 55}, + baseStats: { hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 55 }, }, golbat: { inherit: true, - baseStats: {hp: 75, atk: 80, def: 70, spa: 75, spd: 75, spe: 90}, + baseStats: { hp: 75, atk: 80, def: 70, spa: 75, spd: 75, spe: 90 }, }, oddish: { inherit: true, - baseStats: {hp: 45, atk: 50, def: 55, spa: 75, spd: 75, spe: 30}, + baseStats: { hp: 45, atk: 50, def: 55, spa: 75, spd: 75, spe: 30 }, }, gloom: { inherit: true, - baseStats: {hp: 60, atk: 65, def: 70, spa: 85, spd: 85, spe: 40}, + baseStats: { hp: 60, atk: 65, def: 70, spa: 85, spd: 85, spe: 40 }, }, vileplume: { inherit: true, - baseStats: {hp: 75, atk: 80, def: 85, spa: 100, spd: 100, spe: 50}, + baseStats: { hp: 75, atk: 80, def: 85, spa: 100, spd: 100, spe: 50 }, }, paras: { inherit: true, - baseStats: {hp: 35, atk: 70, def: 55, spa: 55, spd: 55, spe: 25}, + baseStats: { hp: 35, atk: 70, def: 55, spa: 55, spd: 55, spe: 25 }, }, parasect: { inherit: true, - baseStats: {hp: 60, atk: 95, def: 80, spa: 80, spd: 80, spe: 30}, + baseStats: { hp: 60, atk: 95, def: 80, spa: 80, spd: 80, spe: 30 }, }, venonat: { inherit: true, - baseStats: {hp: 60, atk: 55, def: 50, spa: 40, spd: 40, spe: 45}, + baseStats: { hp: 60, atk: 55, def: 50, spa: 40, spd: 40, spe: 45 }, }, venomoth: { inherit: true, - baseStats: {hp: 70, atk: 65, def: 60, spa: 90, spd: 90, spe: 90}, + baseStats: { hp: 70, atk: 65, def: 60, spa: 90, spd: 90, spe: 90 }, }, diglett: { inherit: true, - baseStats: {hp: 10, atk: 55, def: 25, spa: 45, spd: 45, spe: 95}, + baseStats: { hp: 10, atk: 55, def: 25, spa: 45, spd: 45, spe: 95 }, }, dugtrio: { inherit: true, - baseStats: {hp: 35, atk: 80, def: 50, spa: 70, spd: 70, spe: 120}, + baseStats: { hp: 35, atk: 80, def: 50, spa: 70, spd: 70, spe: 120 }, }, meowth: { inherit: true, - baseStats: {hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 90}, + baseStats: { hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 90 }, }, persian: { inherit: true, - baseStats: {hp: 65, atk: 70, def: 60, spa: 65, spd: 65, spe: 115}, + baseStats: { hp: 65, atk: 70, def: 60, spa: 65, spd: 65, spe: 115 }, }, psyduck: { inherit: true, - baseStats: {hp: 50, atk: 52, def: 48, spa: 50, spd: 50, spe: 55}, + baseStats: { hp: 50, atk: 52, def: 48, spa: 50, spd: 50, spe: 55 }, }, golduck: { inherit: true, - baseStats: {hp: 80, atk: 82, def: 78, spa: 80, spd: 80, spe: 85}, + baseStats: { hp: 80, atk: 82, def: 78, spa: 80, spd: 80, spe: 85 }, }, mankey: { inherit: true, - baseStats: {hp: 40, atk: 80, def: 35, spa: 35, spd: 35, spe: 70}, + baseStats: { hp: 40, atk: 80, def: 35, spa: 35, spd: 35, spe: 70 }, }, primeape: { inherit: true, - baseStats: {hp: 65, atk: 105, def: 60, spa: 60, spd: 60, spe: 95}, + baseStats: { hp: 65, atk: 105, def: 60, spa: 60, spd: 60, spe: 95 }, }, growlithe: { inherit: true, - baseStats: {hp: 55, atk: 70, def: 45, spa: 50, spd: 50, spe: 60}, + baseStats: { hp: 55, atk: 70, def: 45, spa: 50, spd: 50, spe: 60 }, }, arcanine: { inherit: true, - baseStats: {hp: 90, atk: 110, def: 80, spa: 80, spd: 80, spe: 95}, + baseStats: { hp: 90, atk: 110, def: 80, spa: 80, spd: 80, spe: 95 }, }, poliwag: { inherit: true, - baseStats: {hp: 40, atk: 50, def: 40, spa: 40, spd: 40, spe: 90}, + baseStats: { hp: 40, atk: 50, def: 40, spa: 40, spd: 40, spe: 90 }, }, poliwhirl: { inherit: true, - baseStats: {hp: 65, atk: 65, def: 65, spa: 50, spd: 50, spe: 90}, + baseStats: { hp: 65, atk: 65, def: 65, spa: 50, spd: 50, spe: 90 }, }, poliwrath: { inherit: true, - baseStats: {hp: 90, atk: 85, def: 95, spa: 70, spd: 70, spe: 70}, + baseStats: { hp: 90, atk: 85, def: 95, spa: 70, spd: 70, spe: 70 }, }, abra: { inherit: true, - baseStats: {hp: 25, atk: 20, def: 15, spa: 105, spd: 105, spe: 90}, + baseStats: { hp: 25, atk: 20, def: 15, spa: 105, spd: 105, spe: 90 }, }, kadabra: { inherit: true, - baseStats: {hp: 40, atk: 35, def: 30, spa: 120, spd: 120, spe: 105}, + baseStats: { hp: 40, atk: 35, def: 30, spa: 120, spd: 120, spe: 105 }, }, alakazam: { inherit: true, - baseStats: {hp: 55, atk: 50, def: 45, spa: 135, spd: 135, spe: 120}, + baseStats: { hp: 55, atk: 50, def: 45, spa: 135, spd: 135, spe: 120 }, }, machop: { inherit: true, - baseStats: {hp: 70, atk: 80, def: 50, spa: 35, spd: 35, spe: 35}, + baseStats: { hp: 70, atk: 80, def: 50, spa: 35, spd: 35, spe: 35 }, }, machoke: { inherit: true, - baseStats: {hp: 80, atk: 100, def: 70, spa: 50, spd: 50, spe: 45}, + baseStats: { hp: 80, atk: 100, def: 70, spa: 50, spd: 50, spe: 45 }, }, machamp: { inherit: true, - baseStats: {hp: 90, atk: 130, def: 80, spa: 65, spd: 65, spe: 55}, + baseStats: { hp: 90, atk: 130, def: 80, spa: 65, spd: 65, spe: 55 }, }, bellsprout: { inherit: true, - baseStats: {hp: 50, atk: 75, def: 35, spa: 70, spd: 70, spe: 40}, + baseStats: { hp: 50, atk: 75, def: 35, spa: 70, spd: 70, spe: 40 }, }, weepinbell: { inherit: true, - baseStats: {hp: 65, atk: 90, def: 50, spa: 85, spd: 85, spe: 55}, + baseStats: { hp: 65, atk: 90, def: 50, spa: 85, spd: 85, spe: 55 }, }, victreebel: { inherit: true, - baseStats: {hp: 80, atk: 105, def: 65, spa: 100, spd: 100, spe: 70}, + baseStats: { hp: 80, atk: 105, def: 65, spa: 100, spd: 100, spe: 70 }, }, tentacool: { inherit: true, - baseStats: {hp: 40, atk: 40, def: 35, spa: 100, spd: 100, spe: 70}, + baseStats: { hp: 40, atk: 40, def: 35, spa: 100, spd: 100, spe: 70 }, }, tentacruel: { inherit: true, - baseStats: {hp: 80, atk: 70, def: 65, spa: 120, spd: 120, spe: 100}, + baseStats: { hp: 80, atk: 70, def: 65, spa: 120, spd: 120, spe: 100 }, }, geodude: { inherit: true, - baseStats: {hp: 40, atk: 80, def: 100, spa: 30, spd: 30, spe: 20}, + baseStats: { hp: 40, atk: 80, def: 100, spa: 30, spd: 30, spe: 20 }, }, graveler: { inherit: true, - baseStats: {hp: 55, atk: 95, def: 115, spa: 45, spd: 45, spe: 35}, + baseStats: { hp: 55, atk: 95, def: 115, spa: 45, spd: 45, spe: 35 }, }, golem: { inherit: true, - baseStats: {hp: 80, atk: 110, def: 130, spa: 55, spd: 55, spe: 45}, + baseStats: { hp: 80, atk: 110, def: 130, spa: 55, spd: 55, spe: 45 }, }, ponyta: { inherit: true, - baseStats: {hp: 50, atk: 85, def: 55, spa: 65, spd: 65, spe: 90}, + baseStats: { hp: 50, atk: 85, def: 55, spa: 65, spd: 65, spe: 90 }, }, rapidash: { inherit: true, - baseStats: {hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105}, + baseStats: { hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105 }, }, slowpoke: { inherit: true, - baseStats: {hp: 90, atk: 65, def: 65, spa: 40, spd: 40, spe: 15}, + baseStats: { hp: 90, atk: 65, def: 65, spa: 40, spd: 40, spe: 15 }, }, slowbro: { inherit: true, - baseStats: {hp: 95, atk: 75, def: 110, spa: 80, spd: 80, spe: 30}, + baseStats: { hp: 95, atk: 75, def: 110, spa: 80, spd: 80, spe: 30 }, }, magnemite: { inherit: true, types: ["Electric"], - baseStats: {hp: 25, atk: 35, def: 70, spa: 95, spd: 95, spe: 45}, + baseStats: { hp: 25, atk: 35, def: 70, spa: 95, spd: 95, spe: 45 }, }, magneton: { inherit: true, types: ["Electric"], - baseStats: {hp: 50, atk: 60, def: 95, spa: 120, spd: 120, spe: 70}, + baseStats: { hp: 50, atk: 60, def: 95, spa: 120, spd: 120, spe: 70 }, }, farfetchd: { inherit: true, - baseStats: {hp: 52, atk: 65, def: 55, spa: 58, spd: 58, spe: 60}, + baseStats: { hp: 52, atk: 65, def: 55, spa: 58, spd: 58, spe: 60 }, }, doduo: { inherit: true, - baseStats: {hp: 35, atk: 85, def: 45, spa: 35, spd: 35, spe: 75}, + baseStats: { hp: 35, atk: 85, def: 45, spa: 35, spd: 35, spe: 75 }, }, dodrio: { inherit: true, - baseStats: {hp: 60, atk: 110, def: 70, spa: 60, spd: 60, spe: 100}, + baseStats: { hp: 60, atk: 110, def: 70, spa: 60, spd: 60, spe: 100 }, }, seel: { inherit: true, - baseStats: {hp: 65, atk: 45, def: 55, spa: 70, spd: 70, spe: 45}, + baseStats: { hp: 65, atk: 45, def: 55, spa: 70, spd: 70, spe: 45 }, }, dewgong: { inherit: true, - baseStats: {hp: 90, atk: 70, def: 80, spa: 95, spd: 95, spe: 70}, + baseStats: { hp: 90, atk: 70, def: 80, spa: 95, spd: 95, spe: 70 }, }, grimer: { inherit: true, - baseStats: {hp: 80, atk: 80, def: 50, spa: 40, spd: 40, spe: 25}, + baseStats: { hp: 80, atk: 80, def: 50, spa: 40, spd: 40, spe: 25 }, }, muk: { inherit: true, - baseStats: {hp: 105, atk: 105, def: 75, spa: 65, spd: 65, spe: 50}, + baseStats: { hp: 105, atk: 105, def: 75, spa: 65, spd: 65, spe: 50 }, }, shellder: { inherit: true, - baseStats: {hp: 30, atk: 65, def: 100, spa: 45, spd: 45, spe: 40}, + baseStats: { hp: 30, atk: 65, def: 100, spa: 45, spd: 45, spe: 40 }, }, cloyster: { inherit: true, - baseStats: {hp: 50, atk: 95, def: 180, spa: 85, spd: 85, spe: 70}, + baseStats: { hp: 50, atk: 95, def: 180, spa: 85, spd: 85, spe: 70 }, }, gastly: { inherit: true, - baseStats: {hp: 30, atk: 35, def: 30, spa: 100, spd: 100, spe: 80}, + baseStats: { hp: 30, atk: 35, def: 30, spa: 100, spd: 100, spe: 80 }, }, haunter: { inherit: true, - baseStats: {hp: 45, atk: 50, def: 45, spa: 115, spd: 115, spe: 95}, + baseStats: { hp: 45, atk: 50, def: 45, spa: 115, spd: 115, spe: 95 }, }, gengar: { inherit: true, - baseStats: {hp: 60, atk: 65, def: 60, spa: 130, spd: 130, spe: 110}, + baseStats: { hp: 60, atk: 65, def: 60, spa: 130, spd: 130, spe: 110 }, }, onix: { inherit: true, - baseStats: {hp: 35, atk: 45, def: 160, spa: 30, spd: 30, spe: 70}, + baseStats: { hp: 35, atk: 45, def: 160, spa: 30, spd: 30, spe: 70 }, }, drowzee: { inherit: true, - baseStats: {hp: 60, atk: 48, def: 45, spa: 90, spd: 90, spe: 42}, + baseStats: { hp: 60, atk: 48, def: 45, spa: 90, spd: 90, spe: 42 }, }, hypno: { inherit: true, - baseStats: {hp: 85, atk: 73, def: 70, spa: 115, spd: 115, spe: 67}, + baseStats: { hp: 85, atk: 73, def: 70, spa: 115, spd: 115, spe: 67 }, }, krabby: { inherit: true, - baseStats: {hp: 30, atk: 105, def: 90, spa: 25, spd: 25, spe: 50}, + baseStats: { hp: 30, atk: 105, def: 90, spa: 25, spd: 25, spe: 50 }, }, kingler: { inherit: true, - baseStats: {hp: 55, atk: 130, def: 115, spa: 50, spd: 50, spe: 75}, + baseStats: { hp: 55, atk: 130, def: 115, spa: 50, spd: 50, spe: 75 }, }, voltorb: { inherit: true, - baseStats: {hp: 40, atk: 30, def: 50, spa: 55, spd: 55, spe: 100}, + baseStats: { hp: 40, atk: 30, def: 50, spa: 55, spd: 55, spe: 100 }, }, electrode: { inherit: true, - baseStats: {hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 140}, + baseStats: { hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 140 }, }, exeggcute: { inherit: true, - baseStats: {hp: 60, atk: 40, def: 80, spa: 60, spd: 60, spe: 40}, + baseStats: { hp: 60, atk: 40, def: 80, spa: 60, spd: 60, spe: 40 }, }, exeggutor: { inherit: true, - baseStats: {hp: 95, atk: 95, def: 85, spa: 125, spd: 125, spe: 55}, + baseStats: { hp: 95, atk: 95, def: 85, spa: 125, spd: 125, spe: 55 }, }, cubone: { inherit: true, - baseStats: {hp: 50, atk: 50, def: 95, spa: 40, spd: 40, spe: 35}, + baseStats: { hp: 50, atk: 50, def: 95, spa: 40, spd: 40, spe: 35 }, }, marowak: { inherit: true, - baseStats: {hp: 60, atk: 80, def: 110, spa: 50, spd: 50, spe: 45}, + baseStats: { hp: 60, atk: 80, def: 110, spa: 50, spd: 50, spe: 45 }, }, hitmonlee: { inherit: true, - baseStats: {hp: 50, atk: 120, def: 53, spa: 35, spd: 35, spe: 87}, + baseStats: { hp: 50, atk: 120, def: 53, spa: 35, spd: 35, spe: 87 }, }, hitmonchan: { inherit: true, - baseStats: {hp: 50, atk: 105, def: 79, spa: 35, spd: 35, spe: 76}, + baseStats: { hp: 50, atk: 105, def: 79, spa: 35, spd: 35, spe: 76 }, }, lickitung: { inherit: true, - baseStats: {hp: 90, atk: 55, def: 75, spa: 60, spd: 60, spe: 30}, + baseStats: { hp: 90, atk: 55, def: 75, spa: 60, spd: 60, spe: 30 }, }, koffing: { inherit: true, - baseStats: {hp: 40, atk: 65, def: 95, spa: 60, spd: 60, spe: 35}, + baseStats: { hp: 40, atk: 65, def: 95, spa: 60, spd: 60, spe: 35 }, }, weezing: { inherit: true, - baseStats: {hp: 65, atk: 90, def: 120, spa: 85, spd: 85, spe: 60}, + baseStats: { hp: 65, atk: 90, def: 120, spa: 85, spd: 85, spe: 60 }, }, rhyhorn: { inherit: true, - baseStats: {hp: 80, atk: 85, def: 95, spa: 30, spd: 30, spe: 25}, + baseStats: { hp: 80, atk: 85, def: 95, spa: 30, spd: 30, spe: 25 }, }, rhydon: { inherit: true, - baseStats: {hp: 105, atk: 130, def: 120, spa: 45, spd: 45, spe: 40}, + baseStats: { hp: 105, atk: 130, def: 120, spa: 45, spd: 45, spe: 40 }, }, chansey: { inherit: true, - baseStats: {hp: 250, atk: 5, def: 5, spa: 105, spd: 105, spe: 50}, + baseStats: { hp: 250, atk: 5, def: 5, spa: 105, spd: 105, spe: 50 }, }, tangela: { inherit: true, - baseStats: {hp: 65, atk: 55, def: 115, spa: 100, spd: 100, spe: 60}, + baseStats: { hp: 65, atk: 55, def: 115, spa: 100, spd: 100, spe: 60 }, }, kangaskhan: { inherit: true, - baseStats: {hp: 105, atk: 95, def: 80, spa: 40, spd: 40, spe: 90}, + baseStats: { hp: 105, atk: 95, def: 80, spa: 40, spd: 40, spe: 90 }, }, horsea: { inherit: true, - baseStats: {hp: 30, atk: 40, def: 70, spa: 70, spd: 70, spe: 60}, + baseStats: { hp: 30, atk: 40, def: 70, spa: 70, spd: 70, spe: 60 }, }, seadra: { inherit: true, - baseStats: {hp: 55, atk: 65, def: 95, spa: 95, spd: 95, spe: 85}, + baseStats: { hp: 55, atk: 65, def: 95, spa: 95, spd: 95, spe: 85 }, }, goldeen: { inherit: true, - baseStats: {hp: 45, atk: 67, def: 60, spa: 50, spd: 50, spe: 63}, + baseStats: { hp: 45, atk: 67, def: 60, spa: 50, spd: 50, spe: 63 }, }, seaking: { inherit: true, - baseStats: {hp: 80, atk: 92, def: 65, spa: 80, spd: 80, spe: 68}, + baseStats: { hp: 80, atk: 92, def: 65, spa: 80, spd: 80, spe: 68 }, }, staryu: { inherit: true, - baseStats: {hp: 30, atk: 45, def: 55, spa: 70, spd: 70, spe: 85}, + baseStats: { hp: 30, atk: 45, def: 55, spa: 70, spd: 70, spe: 85 }, }, starmie: { inherit: true, - baseStats: {hp: 60, atk: 75, def: 85, spa: 100, spd: 100, spe: 115}, + baseStats: { hp: 60, atk: 75, def: 85, spa: 100, spd: 100, spe: 115 }, }, mrmime: { inherit: true, - baseStats: {hp: 40, atk: 45, def: 65, spa: 100, spd: 100, spe: 90}, + baseStats: { hp: 40, atk: 45, def: 65, spa: 100, spd: 100, spe: 90 }, }, scyther: { inherit: true, - baseStats: {hp: 70, atk: 110, def: 80, spa: 55, spd: 55, spe: 105}, + baseStats: { hp: 70, atk: 110, def: 80, spa: 55, spd: 55, spe: 105 }, }, jynx: { inherit: true, - baseStats: {hp: 65, atk: 50, def: 35, spa: 95, spd: 95, spe: 95}, + baseStats: { hp: 65, atk: 50, def: 35, spa: 95, spd: 95, spe: 95 }, }, electabuzz: { inherit: true, - baseStats: {hp: 65, atk: 83, def: 57, spa: 85, spd: 85, spe: 105}, + baseStats: { hp: 65, atk: 83, def: 57, spa: 85, spd: 85, spe: 105 }, }, magmar: { inherit: true, - baseStats: {hp: 65, atk: 95, def: 57, spa: 85, spd: 85, spe: 93}, + baseStats: { hp: 65, atk: 95, def: 57, spa: 85, spd: 85, spe: 93 }, }, pinsir: { inherit: true, - baseStats: {hp: 65, atk: 125, def: 100, spa: 55, spd: 55, spe: 85}, + baseStats: { hp: 65, atk: 125, def: 100, spa: 55, spd: 55, spe: 85 }, }, tauros: { inherit: true, - baseStats: {hp: 75, atk: 100, def: 95, spa: 70, spd: 70, spe: 110}, + baseStats: { hp: 75, atk: 100, def: 95, spa: 70, spd: 70, spe: 110 }, }, magikarp: { inherit: true, - baseStats: {hp: 20, atk: 10, def: 55, spa: 20, spd: 20, spe: 80}, + baseStats: { hp: 20, atk: 10, def: 55, spa: 20, spd: 20, spe: 80 }, }, gyarados: { inherit: true, - baseStats: {hp: 95, atk: 125, def: 79, spa: 100, spd: 100, spe: 81}, + baseStats: { hp: 95, atk: 125, def: 79, spa: 100, spd: 100, spe: 81 }, }, lapras: { inherit: true, - baseStats: {hp: 130, atk: 85, def: 80, spa: 95, spd: 95, spe: 60}, + baseStats: { hp: 130, atk: 85, def: 80, spa: 95, spd: 95, spe: 60 }, }, ditto: { inherit: true, - baseStats: {hp: 48, atk: 48, def: 48, spa: 48, spd: 48, spe: 48}, + baseStats: { hp: 48, atk: 48, def: 48, spa: 48, spd: 48, spe: 48 }, }, eevee: { inherit: true, - baseStats: {hp: 55, atk: 55, def: 50, spa: 65, spd: 65, spe: 55}, + baseStats: { hp: 55, atk: 55, def: 50, spa: 65, spd: 65, spe: 55 }, }, vaporeon: { inherit: true, - baseStats: {hp: 130, atk: 65, def: 60, spa: 110, spd: 110, spe: 65}, + baseStats: { hp: 130, atk: 65, def: 60, spa: 110, spd: 110, spe: 65 }, }, jolteon: { inherit: true, - baseStats: {hp: 65, atk: 65, def: 60, spa: 110, spd: 110, spe: 130}, + baseStats: { hp: 65, atk: 65, def: 60, spa: 110, spd: 110, spe: 130 }, }, flareon: { inherit: true, - baseStats: {hp: 65, atk: 130, def: 60, spa: 110, spd: 110, spe: 65}, + baseStats: { hp: 65, atk: 130, def: 60, spa: 110, spd: 110, spe: 65 }, }, porygon: { inherit: true, - baseStats: {hp: 65, atk: 60, def: 70, spa: 75, spd: 75, spe: 40}, + baseStats: { hp: 65, atk: 60, def: 70, spa: 75, spd: 75, spe: 40 }, }, omanyte: { inherit: true, - baseStats: {hp: 35, atk: 40, def: 100, spa: 90, spd: 90, spe: 35}, + baseStats: { hp: 35, atk: 40, def: 100, spa: 90, spd: 90, spe: 35 }, }, omastar: { inherit: true, - baseStats: {hp: 70, atk: 60, def: 125, spa: 115, spd: 115, spe: 55}, + baseStats: { hp: 70, atk: 60, def: 125, spa: 115, spd: 115, spe: 55 }, }, kabuto: { inherit: true, - baseStats: {hp: 30, atk: 80, def: 90, spa: 45, spd: 45, spe: 55}, + baseStats: { hp: 30, atk: 80, def: 90, spa: 45, spd: 45, spe: 55 }, }, kabutops: { inherit: true, - baseStats: {hp: 60, atk: 115, def: 105, spa: 70, spd: 70, spe: 80}, + baseStats: { hp: 60, atk: 115, def: 105, spa: 70, spd: 70, spe: 80 }, }, aerodactyl: { inherit: true, - baseStats: {hp: 80, atk: 105, def: 65, spa: 60, spd: 60, spe: 130}, + baseStats: { hp: 80, atk: 105, def: 65, spa: 60, spd: 60, spe: 130 }, }, snorlax: { inherit: true, - baseStats: {hp: 160, atk: 110, def: 65, spa: 65, spd: 65, spe: 30}, + baseStats: { hp: 160, atk: 110, def: 65, spa: 65, spd: 65, spe: 30 }, }, articuno: { inherit: true, - baseStats: {hp: 90, atk: 85, def: 100, spa: 125, spd: 125, spe: 85}, + baseStats: { hp: 90, atk: 85, def: 100, spa: 125, spd: 125, spe: 85 }, }, zapdos: { inherit: true, - baseStats: {hp: 90, atk: 90, def: 85, spa: 125, spd: 125, spe: 100}, + baseStats: { hp: 90, atk: 90, def: 85, spa: 125, spd: 125, spe: 100 }, }, moltres: { inherit: true, - baseStats: {hp: 90, atk: 100, def: 90, spa: 125, spd: 125, spe: 90}, + baseStats: { hp: 90, atk: 100, def: 90, spa: 125, spd: 125, spe: 90 }, }, dratini: { inherit: true, - baseStats: {hp: 41, atk: 64, def: 45, spa: 50, spd: 50, spe: 50}, + baseStats: { hp: 41, atk: 64, def: 45, spa: 50, spd: 50, spe: 50 }, }, dragonair: { inherit: true, - baseStats: {hp: 61, atk: 84, def: 65, spa: 70, spd: 70, spe: 70}, + baseStats: { hp: 61, atk: 84, def: 65, spa: 70, spd: 70, spe: 70 }, }, dragonite: { inherit: true, - baseStats: {hp: 91, atk: 134, def: 95, spa: 100, spd: 100, spe: 80}, + baseStats: { hp: 91, atk: 134, def: 95, spa: 100, spd: 100, spe: 80 }, }, mewtwo: { inherit: true, - baseStats: {hp: 106, atk: 110, def: 90, spa: 154, spd: 154, spe: 130}, + baseStats: { hp: 106, atk: 110, def: 90, spa: 154, spd: 154, spe: 130 }, }, mew: { inherit: true, - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, }, }; diff --git a/data/mods/gen1/rulesets.ts b/data/mods/gen1/rulesets.ts index 942fe0f4fe..6d246c9793 100644 --- a/data/mods/gen1/rulesets.ts +++ b/data/mods/gen1/rulesets.ts @@ -36,7 +36,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable }, onModifySpecies(species) { const newSpecies = this.dex.deepClone(species); - const stats: {[k: string]: number} = { + const stats: { [k: string]: number } = { hp: newSpecies.baseStats.spe, atk: newSpecies.baseStats.spa, def: newSpecies.baseStats.def, diff --git a/data/mods/gen1/scripts.ts b/data/mods/gen1/scripts.ts index a78a2bffc2..3e99393887 100644 --- a/data/mods/gen1/scripts.ts +++ b/data/mods/gen1/scripts.ts @@ -26,7 +26,7 @@ export const Scripts: ModdedBattleScriptsData = { pokemon: { inherit: true, getStat(statName, unmodified) { - // @ts-ignore - type checking prevents 'hp' from being passed, but we're paranoid + // @ts-expect-error type checking prevents 'hp' from being passed, but we're paranoid if (statName === 'hp') throw new Error("Please read `maxhp` directly"); if (unmodified) return this.baseStoredStats[statName]; return this.modifiedStats![statName]; @@ -160,8 +160,8 @@ export const Scripts: ModdedBattleScriptsData = { let lockedMove = this.battle.runEvent('LockMove', pokemon); if (lockedMove === true) lockedMove = false; if ( - (!lockedMove && - (!pokemon.volatiles['partialtrappinglock'] || pokemon.volatiles['partialtrappinglock'].locked !== target)) + !lockedMove && + (!pokemon.volatiles['partialtrappinglock'] || pokemon.volatiles['partialtrappinglock'].locked !== target) ) { pokemon.deductPP(move, null, target); } else { @@ -181,7 +181,7 @@ export const Scripts: ModdedBattleScriptsData = { this.battle.hint("In Gen 1, if a player is forced to use a move with 0 PP, the move will underflow to have 63 PP."); } } - this.useMove(move, pokemon, {target, sourceEffect}); + this.useMove(move, pokemon, { target, sourceEffect }); // Restore PP if the move is the first turn of a charging move. Save the move from which PP should be deducted if the move succeeds. if (pokemon.volatiles['twoturnmove']) { pokemon.deductPP(move, -1, target); @@ -215,7 +215,7 @@ export const Scripts: ModdedBattleScriptsData = { // The charging turn of a two-turn move does not update pokemon.lastMove if (!TWO_TURN_MOVES.includes(move.id) || pokemon.volatiles['twoturnmove']) pokemon.lastMove = move; - const moveResult = this.useMoveInner(moveOrMoveName, pokemon, {target, sourceEffect}); + const moveResult = this.useMoveInner(moveOrMoveName, pokemon, { target, sourceEffect }); if (move.id !== 'metronome') { if (move.id !== 'mirrormove' || @@ -293,8 +293,8 @@ export const Scripts: ModdedBattleScriptsData = { return false; } - if (sourceEffect) attrs += '|[from]' + this.battle.dex.conditions.get(sourceEffect); - this.battle.addMove('move', pokemon, move.name, target + attrs); + if (sourceEffect) attrs += `|[from]${this.battle.dex.conditions.get(sourceEffect)}`; + this.battle.addMove('move', pokemon, move.name, `${target}${attrs}`); if (!this.battle.singleEvent('Try', move, null, pokemon, target, move)) { return true; @@ -321,9 +321,9 @@ export const Scripts: ModdedBattleScriptsData = { // Disable and Selfdestruct/Explosion boost rage, regardless of whether they miss/fail. if (target.boosts.atk < 6 && (move.selfdestruct || move.id === 'disable') && target.volatiles['rage']) { - this.battle.boost({atk: 1}, target, pokemon, this.dex.conditions.get('rage')); + this.battle.boost({ atk: 1 }, target, pokemon, this.dex.conditions.get('rage')); this.battle.hint(`In Gen 1, using ${move.name} causes the target to build Rage, ` + - `even if it misses or fails`, true); + `even if it misses or fails`, true); } // Go ahead with results of the used move. @@ -394,7 +394,7 @@ export const Scripts: ModdedBattleScriptsData = { } // If a sleep inducing move is used while the user is recharging, the accuracy is true. - if (move.status === 'slp' && target && target.volatiles['mustrecharge']) { + if (move.status === 'slp' && target?.volatiles['mustrecharge']) { accuracy = true; } @@ -971,7 +971,7 @@ export const Scripts: ModdedBattleScriptsData = { if (typeof effect === 'string') effect = this.dex.conditions.get(effect); if (!target?.hp) return 0; let success = null; - boost = this.runEvent('TryBoost', target, source, effect, {...boost}); + boost = this.runEvent('TryBoost', target, source, effect, { ...boost }); let i: BoostID; for (i in boost) { const currentBoost: SparseBoostsTable = {}; diff --git a/data/mods/gen1jpn/moves.ts b/data/mods/gen1jpn/moves.ts index c865231b9d..9680bfb6cc 100644 --- a/data/mods/gen1jpn/moves.ts +++ b/data/mods/gen1jpn/moves.ts @@ -65,7 +65,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { // Add here counter damage const lastAttackedBy = target.getLastAttackedBy(); if (!lastAttackedBy) { - target.attackedBy.push({source: source, move: move.id, damage: uncappedDamage, thisTurn: true, slot: source.getSlot()}); + target.attackedBy.push({ source, move: move.id, damage: uncappedDamage, thisTurn: true, slot: source.getSlot() }); } else { lastAttackedBy.move = move.id; lastAttackedBy.damage = uncappedDamage; diff --git a/data/mods/gen1jpn/rulesets.ts b/data/mods/gen1jpn/rulesets.ts index cd12e27ecf..29d433d8d3 100644 --- a/data/mods/gen1jpn/rulesets.ts +++ b/data/mods/gen1jpn/rulesets.ts @@ -22,40 +22,40 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable 'Flareon + Tackle + Growl', 'Flareon + Focus Energy + Ember', ], onValidateSet(set) { - const rgb97Legality: {[speciesid: string]: {[moveid: string]: 'illegal' | number}} = { - charizard: {fly: 'illegal'}, + const rgb97Legality: { [speciesid: string]: { [moveid: string]: 'illegal' | number } } = { + charizard: { fly: 'illegal' }, butterfree: { confusion: 12, poisonpowder: 15, stunspore: 16, sleeppowder: 17, supersonic: 21, psybeam: 34, flash: 'illegal', gust: 'illegal', }, - fearow: {payday: 'illegal'}, - pikachu: {quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal'}, - raichu: {quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal'}, - nidoranf: {doublekick: 43}, - nidorina: {doublekick: 43}, - nidoqueen: {doublekick: 43}, - nidoranm: {doublekick: 43}, - nidorino: {doublekick: 43}, - nidoking: {doublekick: 43}, - venonat: {poisonpowder: 24, supersonic: 'illegal', confusion: 'illegal'}, - venomoth: {poisonpowder: 24, supersonic: 'illegal'}, - diglett: {cut: 'illegal'}, - dugtrio: {cut: 'illegal'}, - psyduck: {amnesia: 'illegal'}, - golduck: {amnesia: 'illegal'}, - mankey: {lowkick: 'illegal', screech: 'illegal'}, - primeape: {lowkick: 'illegal', screech: 'illegal'}, - kadabra: {kinesis: 'illegal'}, - alakazam: {kinesis: 'illegal'}, - rapidash: {payday: 'illegal'}, - cubone: {tailwhip: 'illegal', headbutt: 'illegal'}, - marowak: {tailwhip: 'illegal', headbutt: 'illegal'}, - chansey: {tailwhip: 'illegal'}, - tangela: {absorb: 29, growth: 49, vinewhip: 'illegal'}, - scyther: {wingattack: 'illegal'}, - pinsir: {bind: 'illegal'}, - magikarp: {dragonrage: 'illegal'}, - eevee: {quickattack: 27, tailwhip: 31, bite: 37, growl: 'illegal', focusenergy: 'illegal'}, + fearow: { payday: 'illegal' }, + pikachu: { quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal' }, + raichu: { quickattack: 16, tailwhip: 'illegal', slam: 'illegal', lightscreen: 'illegal' }, + nidoranf: { doublekick: 43 }, + nidorina: { doublekick: 43 }, + nidoqueen: { doublekick: 43 }, + nidoranm: { doublekick: 43 }, + nidorino: { doublekick: 43 }, + nidoking: { doublekick: 43 }, + venonat: { poisonpowder: 24, supersonic: 'illegal', confusion: 'illegal' }, + venomoth: { poisonpowder: 24, supersonic: 'illegal' }, + diglett: { cut: 'illegal' }, + dugtrio: { cut: 'illegal' }, + psyduck: { amnesia: 'illegal' }, + golduck: { amnesia: 'illegal' }, + mankey: { lowkick: 'illegal', screech: 'illegal' }, + primeape: { lowkick: 'illegal', screech: 'illegal' }, + kadabra: { kinesis: 'illegal' }, + alakazam: { kinesis: 'illegal' }, + rapidash: { payday: 'illegal' }, + cubone: { tailwhip: 'illegal', headbutt: 'illegal' }, + marowak: { tailwhip: 'illegal', headbutt: 'illegal' }, + chansey: { tailwhip: 'illegal' }, + tangela: { absorb: 29, growth: 49, vinewhip: 'illegal' }, + scyther: { wingattack: 'illegal' }, + pinsir: { bind: 'illegal' }, + magikarp: { dragonrage: 'illegal' }, + eevee: { quickattack: 27, tailwhip: 31, bite: 37, growl: 'illegal', focusenergy: 'illegal' }, vaporeon: { quickattack: 27, tailwhip: 31, watergun: 31, bite: 37, acidarmor: 42, haze: 44, mist: 48, hydropump: 54, growl: 'illegal', focusenergy: 'illegal', aurorabeam: 'illegal', diff --git a/data/mods/gen1stadium/conditions.ts b/data/mods/gen1stadium/conditions.ts index b7c6a0fe29..8709455f95 100644 --- a/data/mods/gen1stadium/conditions.ts +++ b/data/mods/gen1stadium/conditions.ts @@ -37,7 +37,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Move') { - this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name); + this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`); } else { this.add('-status', target, 'slp'); } @@ -108,7 +108,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa duration: 2, onBeforeMovePriority: 1, onStart(target, source, effect) { - this.add('-activate', target, 'move: ' + effect, '[of] ' + source); + this.add('-activate', target, `move: ${effect}`, `[of] ${source}`); }, onBeforeMove(pokemon) { if (this.effectState.source && (!this.effectState.source.isActive || this.effectState.source.hp <= 0)) { diff --git a/data/mods/gen1stadium/moves.ts b/data/mods/gen1stadium/moves.ts index 3837e7d898..5a6ff54571 100644 --- a/data/mods/gen1stadium/moves.ts +++ b/data/mods/gen1stadium/moves.ts @@ -59,7 +59,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { pokemon.removeVolatile('bide'); return false; } - this.actions.moveHit(target, pokemon, move, {damage: this.effectState.totalDamage * 2} as ActiveMove); + this.actions.moveHit(target, pokemon, move, { damage: this.effectState.totalDamage * 2 } as ActiveMove); pokemon.removeVolatile('bide'); return false; } @@ -167,7 +167,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onLockMove: 'rage', onHit(target, source, move) { if (target.boosts.atk < 6 && (move.category !== 'Status' || move.id === 'disable')) { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } }, }, @@ -270,7 +270,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { // Add here counter damage const lastAttackedBy = target.getLastAttackedBy(); if (!lastAttackedBy) { - target.attackedBy.push({source: source, move: move.id, damage: damage, slot: source.getSlot(), thisTurn: true}); + target.attackedBy.push({ source, move: move.id, damage, slot: source.getSlot(), thisTurn: true }); } else { lastAttackedBy.move = move.id; lastAttackedBy.damage = damage; @@ -287,7 +287,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, struggle: { inherit: true, - ignoreImmunity: {'Normal': true}, + ignoreImmunity: { 'Normal': true }, }, wrap: { inherit: true, diff --git a/data/mods/gen1stadium/scripts.ts b/data/mods/gen1stadium/scripts.ts index 711946942d..1d16e45333 100644 --- a/data/mods/gen1stadium/scripts.ts +++ b/data/mods/gen1stadium/scripts.ts @@ -81,7 +81,7 @@ export const Scripts: ModdedBattleScriptsData = { this.battle.setActiveMove(move, pokemon, target); if (pokemon.moveThisTurn || !this.battle.runEvent('BeforeMove', pokemon, target, move)) { - this.battle.debug('' + pokemon.fullname + ' move interrupted; movedThisTurn: ' + pokemon.moveThisTurn); + this.battle.debug(`${pokemon.fullname} move interrupted; movedThisTurn: ${pokemon.moveThisTurn}`); this.battle.clearActiveMove(true); // This is only run for sleep this.battle.runEvent('AfterMoveSelf', pokemon, target, move); @@ -103,14 +103,14 @@ export const Scripts: ModdedBattleScriptsData = { } else { sourceEffect = move; } - this.battle.actions.useMove(move, pokemon, {target, sourceEffect}); + this.battle.actions.useMove(move, pokemon, { target, sourceEffect }); }, // This function deals with AfterMoveSelf events. // This leads with partial trapping moves shenanigans after the move has been used. useMove(moveOrMoveName, pokemon, options) { let sourceEffect = options?.sourceEffect; let target = options?.target; - const moveResult = this.useMoveInner(moveOrMoveName, pokemon, {target, sourceEffect}); + const moveResult = this.useMoveInner(moveOrMoveName, pokemon, { target, sourceEffect }); if (!sourceEffect && this.battle.effect.id) sourceEffect = this.battle.effect; const baseMove = this.battle.dex.moves.get(moveOrMoveName); @@ -199,8 +199,8 @@ export const Scripts: ModdedBattleScriptsData = { return false; } - if (sourceEffect) attrs += '|[from]' + this.battle.dex.conditions.get(sourceEffect); - this.battle.addMove('move', pokemon, move.name, target + attrs); + if (sourceEffect) attrs += `|[from]${this.battle.dex.conditions.get(sourceEffect)}`; + this.battle.addMove('move', pokemon, move.name, `${target}${attrs}`); if (!this.battle.singleEvent('Try', move, null, pokemon, target, move)) { return true; @@ -609,26 +609,26 @@ export const Scripts: ModdedBattleScriptsData = { let critChance = source.species.baseStats['spe'] + 76; // Now we right logical shift it two places, essentially dividing by 4 and flooring it. - critChance = critChance >> 2; + critChance >>= 2; // Now we check for focus energy volatile. if (source.volatiles['focusenergy']) { // If it exists, crit chance is multiplied by 4 and floored with a logical left shift. - critChance = critChance << 2; + critChance <<= 2; // Then we add 160. critChance += 160; } else { // If it is not active, we left shift it by 1. - critChance = critChance << 1; + critChance <<= 1; } // Now we check for the move's critical hit ratio. if (move.critRatio === 2) { // High crit ratio, we multiply the result so far by 4. - critChance = critChance << 2; + critChance <<= 2; } else if (move.critRatio === 1) { // Normal hit ratio, we divide the crit chance by 2 and floor the result again. - critChance = critChance >> 1; + critChance >>= 1; } // Now we make sure it's a number between 1 and 255. diff --git a/data/mods/gen2/conditions.ts b/data/mods/gen2/conditions.ts index 08f6a70a3e..928a551fdb 100644 --- a/data/mods/gen2/conditions.ts +++ b/data/mods/gen2/conditions.ts @@ -29,7 +29,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Move') { - this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name); + this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`); } else { this.add('-status', target, 'slp'); } @@ -192,7 +192,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa const move = this.dex.moves.get(this.effectState.move); if (move.id) { this.debug('Forcing into ' + move.id); - this.queue.changeAction(pokemon, {choice: 'move', moveid: move.id}); + this.queue.changeAction(pokemon, { choice: 'move', moveid: move.id }); } }, }, @@ -223,7 +223,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa }, onStallMove() { const counter = Math.floor(this.effectState.counter) || 127; - this.debug("Success chance: " + Math.round(counter * 1000 / 255) / 10 + "% (" + counter + "/255)"); + this.debug(`Success chance: ${Math.round(counter * 1000 / 255) / 10}% (${counter}/255)`); return this.randomChance(counter, 255); }, onRestart() { diff --git a/data/mods/gen2/moves.ts b/data/mods/gen2/moves.ts index 58797d8721..c3a3bb79af 100644 --- a/data/mods/gen2/moves.ts +++ b/data/mods/gen2/moves.ts @@ -23,7 +23,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return false; } if (target.hp <= target.maxhp / 2) { - this.boost({atk: 2}, null, null, this.dex.conditions.get('bellydrum2')); + this.boost({ atk: 2 }, null, null, this.dex.conditions.get('bellydrum2')); return false; } this.directDamage(target.maxhp / 2); @@ -45,7 +45,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } boosts = target.boosts.atk - originalStage; target.boosts.atk = originalStage; - this.boost({atk: boosts}); + this.boost({ atk: boosts }); }, }, bide: { @@ -93,7 +93,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { damage: this.effectState.totalDamage * 2, category: "Physical", priority: 0, - flags: {contact: 1, protect: 1}, + flags: { contact: 1, protect: 1 }, effectType: 'Move', type: 'Normal', } as unknown as ActiveMove; @@ -140,7 +140,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, condition: { onStart(pokemon, source) { - this.add('-start', pokemon, 'Curse', '[of] ' + source); + this.add('-start', pokemon, 'Curse', `[of] ${source}`); }, onAfterMoveSelf(pokemon) { this.damage(pokemon.baseMaxhp / 4); @@ -231,7 +231,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, explosion: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1, noparentalbond: 1, nosketch: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, noparentalbond: 1, nosketch: 1 }, }, flail: { inherit: true, @@ -398,16 +398,16 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, meanlook: { inherit: true, - flags: {reflectable: 1, mirror: 1, metronome: 1}, + flags: { reflectable: 1, mirror: 1, metronome: 1 }, }, metronome: { inherit: true, - flags: {failencore: 1, nosketch: 1}, + flags: { failencore: 1, nosketch: 1 }, }, mimic: { inherit: true, accuracy: 100, - flags: {protect: 1, bypasssub: 1, allyanim: 1, failencore: 1, noassist: 1, nosketch: 1}, + flags: { protect: 1, bypasssub: 1, allyanim: 1, failencore: 1, noassist: 1, nosketch: 1 }, }, mindreader: { inherit: true, @@ -434,7 +434,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, mirrormove: { inherit: true, - flags: {metronome: 1, failencore: 1, nosketch: 1}, + flags: { metronome: 1, failencore: 1, nosketch: 1 }, onHit(pokemon) { const noMirror = ['metronome', 'mimic', 'mirrormove', 'sketch', 'sleeptalk', 'transform']; const target = pokemon.side.foe.active[0]; @@ -456,7 +456,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Mist", pp: 30, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, volatileStatus: 'mist', condition: { onStart(pokemon) { @@ -548,7 +548,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onResidualOrder: 4, onResidual(pokemon) { const duration = pokemon.volatiles['perishsong'].duration; - this.add('-start', pokemon, 'perish' + duration); + this.add('-start', pokemon, `perish${duration}`); }, }, }, @@ -724,11 +724,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, selfdestruct: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1, noparentalbond: 1, nosketch: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, noparentalbond: 1, nosketch: 1 }, }, sketch: { inherit: true, - flags: {bypasssub: 1, failencore: 1, noassist: 1, nosketch: 1}, + flags: { bypasssub: 1, failencore: 1, noassist: 1, nosketch: 1 }, onHit() { // Sketch always fails in Link Battles this.add('-nothing'); @@ -754,7 +754,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, sleeptalk: { inherit: true, - flags: {failencore: 1, nosleeptalk: 1, nosketch: 1}, + flags: { failencore: 1, nosleeptalk: 1, nosketch: 1 }, onHit(pokemon) { const moves = []; for (const moveSlot of pokemon.moveSlots) { @@ -780,7 +780,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, spiderweb: { inherit: true, - flags: {reflectable: 1, mirror: 1, metronome: 1}, + flags: { reflectable: 1, mirror: 1, metronome: 1 }, }, spikes: { inherit: true, @@ -909,7 +909,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { target.item = yourItem.id; // bypass setItem so we don't break choicelock or anything return; } - this.add('-item', source, yourItem, '[from] move: Thief', '[of] ' + target); + this.add('-item', source, yourItem, '[from] move: Thief', `[of] ${target}`); }, }, }, @@ -930,7 +930,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, transform: { inherit: true, - flags: {bypasssub: 1, metronome: 1, failencore: 1, nosketch: 1}, + flags: { bypasssub: 1, metronome: 1, failencore: 1, nosketch: 1 }, }, triattack: { inherit: true, diff --git a/data/mods/gen2/rulesets.ts b/data/mods/gen2/rulesets.ts index 55a7175287..72919d415c 100644 --- a/data/mods/gen2/rulesets.ts +++ b/data/mods/gen2/rulesets.ts @@ -1,4 +1,4 @@ -import type {Learnset} from "../../../sim/dex-species"; +import type { Learnset } from "../../../sim/dex-species"; export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable = { obtainablemoves: { @@ -47,34 +47,34 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable name: 'NC 2000 Move Legality', desc: "Prevents Pok\u00e9mon from having moves that would only be obtainable in Pok\u00e9mon Crystal.", onValidateSet(set) { - const illegalCombos: {[speciesid: string]: {[moveid: string]: 'E' | 'L' | 'S'}} = { - arbok: {crunch: 'E'}, - sandslash: {metalclaw: 'E'}, - golduck: {crosschop: 'E'}, - marowak: {swordsdance: 'E'}, - electabuzz: {crosschop: 'E'}, - magmar: {crosschop: 'E'}, - jolteon: {batonpass: 'L'}, - vaporeon: {batonpass: 'L'}, - flareon: {batonpass: 'L'}, - espeon: {batonpass: 'L'}, - umbreon: {batonpass: 'L'}, - dragonite: {extremespeed: 'S'}, - meganium: {swordsdance: 'E'}, - typhlosion: {submission: 'E'}, - ariados: {agility: 'L'}, - yanma: {wingattack: 'L'}, - murkrow: {skyattack: 'E'}, - qwilfish: {spikes: 'L'}, - sneasel: {metalclaw: 'L'}, - ursaring: {metalclaw: 'E'}, - piloswine: {amnesia: 'L'}, - skarmory: {skyattack: 'E'}, - donphan: {watergun: 'E'}, - suicune: {aurorabeam: 'L'}, - dugtrio: {triattack: 'L'}, - magneton: {triattack: 'L'}, - cloyster: {spikes: 'L'}, + const illegalCombos: { [speciesid: string]: { [moveid: string]: 'E' | 'L' | 'S' } } = { + arbok: { crunch: 'E' }, + sandslash: { metalclaw: 'E' }, + golduck: { crosschop: 'E' }, + marowak: { swordsdance: 'E' }, + electabuzz: { crosschop: 'E' }, + magmar: { crosschop: 'E' }, + jolteon: { batonpass: 'L' }, + vaporeon: { batonpass: 'L' }, + flareon: { batonpass: 'L' }, + espeon: { batonpass: 'L' }, + umbreon: { batonpass: 'L' }, + dragonite: { extremespeed: 'S' }, + meganium: { swordsdance: 'E' }, + typhlosion: { submission: 'E' }, + ariados: { agility: 'L' }, + yanma: { wingattack: 'L' }, + murkrow: { skyattack: 'E' }, + qwilfish: { spikes: 'L' }, + sneasel: { metalclaw: 'L' }, + ursaring: { metalclaw: 'E' }, + piloswine: { amnesia: 'L' }, + skarmory: { skyattack: 'E' }, + donphan: { watergun: 'E' }, + suicune: { aurorabeam: 'L' }, + dugtrio: { triattack: 'L' }, + magneton: { triattack: 'L' }, + cloyster: { spikes: 'L' }, }; const moveSources: NonNullable = Object.fromEntries( @@ -82,7 +82,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable ); const species = this.dex.species.get(set.species); - for (const {learnset} of this.dex.species.getFullLearnset(species.id)) { + for (const { learnset } of this.dex.species.getFullLearnset(species.id)) { for (const moveid in moveSources) { moveSources[moveid].push(...(learnset[moveid] || [])); } diff --git a/data/mods/gen2/scripts.ts b/data/mods/gen2/scripts.ts index f35160ef2b..169b06bc30 100644 --- a/data/mods/gen2/scripts.ts +++ b/data/mods/gen2/scripts.ts @@ -8,7 +8,7 @@ export const Scripts: ModdedBattleScriptsData = { pokemon: { inherit: true, getStat(statName, unboosted, unmodified, fastReturn) { - // @ts-ignore - type checking prevents 'hp' from being passed, but we're paranoid + // @ts-expect-error type checking prevents 'hp' from being passed, but we're paranoid if (statName === 'hp') throw new Error("Please read `maxhp` directly"); // base stat @@ -107,7 +107,7 @@ export const Scripts: ModdedBattleScriptsData = { // THIS IS PURELY A SANITY CHECK // DO NOT TAKE ADVANTAGE OF THIS TO PREVENT A POKEMON FROM MOVING; // USE this.battle.queue.cancelMove INSTEAD - this.battle.debug('' + pokemon.fullname + ' INCONSISTENT STATE, ALREADY MOVED: ' + pokemon.moveThisTurn); + this.battle.debug(`${pokemon.fullname} INCONSISTENT STATE, ALREADY MOVED: ${pokemon.moveThisTurn}`); this.battle.clearActiveMove(true); return; } @@ -135,7 +135,7 @@ export const Scripts: ModdedBattleScriptsData = { } } pokemon.moveUsed(move); - this.battle.actions.useMove(move, pokemon, {target, sourceEffect: options?.sourceEffect}); + this.battle.actions.useMove(move, pokemon, { target, sourceEffect: options?.sourceEffect }); this.battle.singleEvent('AfterMove', move, null, pokemon, target, move); if (!move.selfSwitch && pokemon.side.foe.active[0].hp) this.battle.runEvent('AfterMoveSelf', pokemon, target, move); }, @@ -626,7 +626,7 @@ export const Scripts: ModdedBattleScriptsData = { } if (move.id === 'present') { - const typeIndexes: {[k: string]: number} = { + const typeIndexes: { [k: string]: number } = { Normal: 0, Fighting: 1, Flying: 2, Poison: 3, Ground: 4, Rock: 5, Bug: 7, Ghost: 8, Steel: 9, Fire: 20, Water: 21, Grass: 22, Electric: 23, Psychic: 24, Ice: 25, Dragon: 26, Dark: 27, }; diff --git a/data/mods/gen2doubles/scripts.ts b/data/mods/gen2doubles/scripts.ts index 75b256fe7d..e2f3cc7e63 100644 --- a/data/mods/gen2doubles/scripts.ts +++ b/data/mods/gen2doubles/scripts.ts @@ -4,7 +4,7 @@ export const Scripts: ModdedBattleScriptsData = { pokemon: { inherit: true, getStat(statName, unboosted, unmodified, fastReturn) { - // @ts-ignore - type checking prevents 'hp' from being passed, but we're paranoid + // @ts-expect-error type checking prevents 'hp' from being passed, but we're paranoid if (statName === 'hp') throw new Error("Please read `maxhp` directly"); // base stat @@ -212,7 +212,7 @@ export const Scripts: ModdedBattleScriptsData = { } if (move.id === 'present') { - const typeIndexes: {[k: string]: number} = { + const typeIndexes: { [k: string]: number } = { Normal: 0, Fighting: 1, Flying: 2, Poison: 3, Ground: 4, Rock: 5, Bug: 7, Ghost: 8, Steel: 9, Fire: 20, Water: 21, Grass: 22, Electric: 23, Psychic: 24, Ice: 25, Dragon: 26, Dark: 27, }; @@ -293,11 +293,11 @@ export const Scripts: ModdedBattleScriptsData = { } // Attempting to add correct spread damage nerf - const {targets} = source.getMoveTargets(move, target); + const { targets } = source.getMoveTargets(move, target); if (targets.length > 1) move.spreadHit = true; if (move.spreadHit && move.target === 'allAdjacentFoes') { const spreadModifier = move.spreadModifier || 0.5; - this.battle.debug('Spread modifier: ' + spreadModifier); + this.battle.debug(`Spread modifier: ${spreadModifier}`); damage = this.battle.modify(damage, spreadModifier); } diff --git a/data/mods/gen2stadium2/conditions.ts b/data/mods/gen2stadium2/conditions.ts index 3ced97f51a..0ea3d92f0e 100644 --- a/data/mods/gen2stadium2/conditions.ts +++ b/data/mods/gen2stadium2/conditions.ts @@ -46,7 +46,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Move') { - this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name); + this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`); } else { this.add('-status', target, 'slp'); } diff --git a/data/mods/gen2stadium2/moves.ts b/data/mods/gen2stadium2/moves.ts index 9a34450484..f7192fc539 100644 --- a/data/mods/gen2stadium2/moves.ts +++ b/data/mods/gen2stadium2/moves.ts @@ -25,7 +25,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } boosts = target.boosts.atk - originalStage; target.boosts.atk = originalStage; - this.boost({atk: boosts}); + this.boost({ atk: boosts }); }, }, destinybond: { diff --git a/data/mods/gen2stadium2/scripts.ts b/data/mods/gen2stadium2/scripts.ts index 6992fc9d43..41aa864e7b 100644 --- a/data/mods/gen2stadium2/scripts.ts +++ b/data/mods/gen2stadium2/scripts.ts @@ -7,7 +7,7 @@ export const Scripts: ModdedBattleScriptsData = { pokemon: { inherit: true, getStat(statName, unboosted, unmodified, fastReturn) { - // @ts-ignore - type checking prevents 'hp' from being passed, but we're paranoid + // @ts-expect-error type checking prevents 'hp' from being passed, but we're paranoid if (statName === 'hp') throw new Error("Please read `maxhp` directly"); // base stat @@ -478,7 +478,7 @@ export const Scripts: ModdedBattleScriptsData = { if (typeof effect === 'string') effect = this.dex.conditions.get(effect); if (!target?.hp) return 0; let success = null; - boost = this.runEvent('TryBoost', target, source, effect, {...boost}); + boost = this.runEvent('TryBoost', target, source, effect, { ...boost }); let i: BoostID; for (i in boost) { const currentBoost: SparseBoostsTable = {}; @@ -547,7 +547,7 @@ export const Scripts: ModdedBattleScriptsData = { this.queue.clear(); // Fainting clears accumulated Bide damage for (const pokemon of this.getAllActive()) { - if (pokemon.volatiles['bide'] && pokemon.volatiles['bide'].damage) { + if (pokemon.volatiles['bide']?.damage) { pokemon.volatiles['bide'].damage = 0; this.hint("Desync Clause Mod activated!"); this.hint("In Gen 1, Bide's accumulated damage is reset to 0 when a Pokemon faints."); diff --git a/data/mods/gen3/abilities.ts b/data/mods/gen3/abilities.ts index 969632d3ff..cc782ff53d 100644 --- a/data/mods/gen3/abilities.ts +++ b/data/mods/gen3/abilities.ts @@ -85,7 +85,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (target.volatiles['substitute']) { this.add('-immune', target); } else { - this.boost({atk: -1}, target, pokemon, null, true); + this.boost({ atk: -1 }, target, pokemon, null, true); } } }, @@ -98,7 +98,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.effectState.target; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Lightning Rod", rating: 0, num: 32, @@ -182,7 +182,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (!target || target.fainted) return; const ability = target.getAbility(); if (pokemon.setAbility(ability)) { - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); } }, flags: {}, diff --git a/data/mods/gen3/conditions.ts b/data/mods/gen3/conditions.ts index 381451eab1..79d353ebba 100644 --- a/data/mods/gen3/conditions.ts +++ b/data/mods/gen3/conditions.ts @@ -4,7 +4,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Move') { - this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name); + this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`); } else { this.add('-status', target, 'slp'); } diff --git a/data/mods/gen3/moves.ts b/data/mods/gen3/moves.ts index a0798ea47a..cd76a0756e 100644 --- a/data/mods/gen3/moves.ts +++ b/data/mods/gen3/moves.ts @@ -18,11 +18,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, ancientpower: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, }, assist: { inherit: true, - flags: {metronome: 1, noassist: 1, nosleeptalk: 1}, + flags: { metronome: 1, noassist: 1, nosleeptalk: 1 }, }, astonish: { inherit: true, @@ -100,7 +100,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { damage: this.effectState.totalDamage * 2, category: "Physical", priority: 0, - flags: {contact: 1, protect: 1}, + flags: { contact: 1, protect: 1 }, effectType: 'Move', type: 'Normal', } as unknown as ActiveMove; @@ -182,7 +182,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, covet: { inherit: true, - flags: {protect: 1, mirror: 1, noassist: 1}, + flags: { protect: 1, mirror: 1, noassist: 1 }, }, crunch: { inherit: true, @@ -200,7 +200,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { disable: { inherit: true, accuracy: 55, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'disable', condition: { durationCallback() { @@ -257,7 +257,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Doom Desire", basePower: 120, category: "Physical", - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, willCrit: false, type: '???', } as unknown as ActiveMove; @@ -265,15 +265,15 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { Object.assign(target.side.slotConditions[target.position]['futuremove'], { duration: 3, move: 'doomdesire', - source: source, + source, moveData: { id: 'doomdesire', name: "Doom Desire", accuracy: 85, basePower: 0, - damage: damage, + damage, category: "Physical", - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, effectType: 'Move', type: '???', }, @@ -339,11 +339,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, fakeout: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, feintattack: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, flail: { inherit: true, @@ -363,7 +363,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, }, @@ -469,7 +469,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, mimic: { inherit: true, - flags: {protect: 1, bypasssub: 1, allyanim: 1, failencore: 1, noassist: 1, failmimic: 1}, + flags: { protect: 1, bypasssub: 1, allyanim: 1, failencore: 1, noassist: 1, failmimic: 1 }, }, mirrorcoat: { inherit: true, @@ -499,7 +499,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, mirrormove: { inherit: true, - flags: {metronome: 1, failencore: 1, nosleeptalk: 1, noassist: 1}, + flags: { metronome: 1, failencore: 1, nosleeptalk: 1, noassist: 1 }, onTryHit() { }, onHit(pokemon) { const noMirror = [ @@ -544,7 +544,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, overheat: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, }, petaldance: { inherit: true, @@ -572,7 +572,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, }, @@ -582,7 +582,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, sketch: { inherit: true, - flags: {bypasssub: 1, failencore: 1, noassist: 1, failmimic: 1, nosketch: 1}, + flags: { bypasssub: 1, failencore: 1, noassist: 1, failmimic: 1, nosketch: 1 }, }, sleeptalk: { inherit: true, @@ -593,7 +593,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const pp = moveSlot.pp; const move = this.dex.moves.get(moveid); if (moveid && !move.flags['nosleeptalk'] && !move.flags['charge']) { - moves.push({move: moveid, pp: pp}); + moves.push({ move: moveid, pp }); } } if (!moves.length) { @@ -640,7 +640,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, struggle: { inherit: true, - flags: {contact: 1, protect: 1, noassist: 1, failencore: 1, failmimic: 1, nosketch: 1}, + flags: { contact: 1, protect: 1, noassist: 1, failencore: 1, failmimic: 1, nosketch: 1 }, accuracy: 100, recoil: [1, 4], struggleRecoil: false, @@ -651,7 +651,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, taunt: { inherit: true, - flags: {protect: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, bypasssub: 1, metronome: 1 }, condition: { duration: 2, onStart(target) { @@ -679,11 +679,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, teeterdance: { inherit: true, - flags: {protect: 1, metronome: 1}, + flags: { protect: 1, metronome: 1 }, }, tickle: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, uproar: { inherit: true, diff --git a/data/mods/gen3/scripts.ts b/data/mods/gen3/scripts.ts index 9cacecfc49..277192e5c2 100644 --- a/data/mods/gen3/scripts.ts +++ b/data/mods/gen3/scripts.ts @@ -50,7 +50,7 @@ export const Scripts: ModdedBattleScriptsData = { // and the user's ally, like Earthquake and Explosion, don't get affected by spread modifiers if (move.spreadHit && move.target === 'allAdjacentFoes') { const spreadModifier = move.spreadModifier || 0.5; - this.battle.debug('Spread modifier: ' + spreadModifier); + this.battle.debug(`Spread modifier: ${spreadModifier}`); baseDamage = this.battle.modify(baseDamage, spreadModifier); } @@ -163,7 +163,7 @@ export const Scripts: ModdedBattleScriptsData = { let movename = move.name; if (move.id === 'hiddenpower') movename = 'Hidden Power'; if (sourceEffect) attrs += `|[from]${this.dex.conditions.get(sourceEffect)}`; - this.battle.addMove('move', pokemon, movename, target + attrs); + this.battle.addMove('move', pokemon, movename, `${target}${attrs}`); if (!target) { this.battle.attrLastMove('[notarget]'); @@ -171,7 +171,7 @@ export const Scripts: ModdedBattleScriptsData = { return false; } - const {targets, pressureTargets} = pokemon.getMoveTargets(move, target); + const { targets, pressureTargets } = pokemon.getMoveTargets(move, target); if (!sourceEffect || sourceEffect.id === 'pursuit') { let extraPP = 0; @@ -328,7 +328,7 @@ export const Scripts: ModdedBattleScriptsData = { let boost: number; if (accuracy !== true) { if (!move.ignoreAccuracy) { - boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); if (boost > 0) { accuracy *= boostTable[boost]; @@ -337,7 +337,7 @@ export const Scripts: ModdedBattleScriptsData = { } } if (!move.ignoreEvasion) { - boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); boost = this.battle.clampIntRange(boosts['evasion'], -6, 6); if (boost > 0) { accuracy /= boostTable[boost]; @@ -417,7 +417,7 @@ export const Scripts: ModdedBattleScriptsData = { accuracy = move.accuracy; if (accuracy !== true) { if (!move.ignoreAccuracy) { - boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); if (boost > 0) { accuracy *= boostTable[boost]; @@ -426,7 +426,7 @@ export const Scripts: ModdedBattleScriptsData = { } } if (!move.ignoreEvasion) { - boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); boost = this.battle.clampIntRange(boosts['evasion'], -6, 6); if (boost > 0) { accuracy /= boostTable[boost]; diff --git a/data/mods/gen4/abilities.ts b/data/mods/gen4/abilities.ts index 44ecd00958..1731fc5d18 100644 --- a/data/mods/gen4/abilities.ts +++ b/data/mods/gen4/abilities.ts @@ -11,7 +11,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onAfterSubDamage(damage, target, source, move) { if (!target.hp) return; if (move && move.effectType === 'Move' && target.getMoveHitData(move).crit) { - target.setBoost({atk: 6}); + target.setBoost({ atk: 6 }); this.add('-setboost', target, 'atk', 12, '[from] ability: Anger Point'); } }, @@ -83,9 +83,9 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa totalspd += target.getStat('spd', false, true); } if (totaldef && totaldef >= totalspd) { - this.boost({spa: 1}); + this.boost({ spa: 1 }); } else if (totalspd) { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } }, }, @@ -155,11 +155,11 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(1.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, forecast: { inherit: true, - flags: {notrace: 1}, + flags: { notrace: 1 }, }, forewarn: { inherit: true, @@ -191,7 +191,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onStart(pokemon) { const target = pokemon.side.randomFoe(); if (target?.item && !target.itemState.knockedOff) { - this.add('-item', '', target.getItem().name, '[from] ability: Frisk', '[of] ' + pokemon); + this.add('-item', '', target.getItem().name, '[from] ability: Frisk', `[of] ${pokemon}`); } }, }, @@ -238,7 +238,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa } else if (target.volatiles['substitutebroken']?.move === 'uturn') { this.hint("In Gen 4, if U-turn breaks Substitute the incoming Intimidate does nothing."); } else { - this.boost({atk: -1}, target, pokemon, null, true); + this.boost({ atk: -1 }, target, pokemon, null, true); } } }, @@ -247,7 +247,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa inherit: true, onSetStatus(status, target, source, effect) { if (effect && effect.id === 'rest') { - return; + // do nothing } else if (this.field.isWeather('sunnyday')) { return false; } @@ -261,7 +261,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa liquidooze: { inherit: true, onSourceTryHeal(damage, target, source, effect) { - this.debug("Heal is occurring: " + target + " <- " + source + " :: " + effect.id); + this.debug(`Heal is occurring: ${target} <- ${source} :: ${effect.id}`); const canOoze = ['drain', 'leechseed']; if (canOoze.includes(effect.id) && this.activeMove?.id !== 'dreameater') { this.damage(damage, null, null, null, true); @@ -410,7 +410,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa boosts[key]! *= 2; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Simple", rating: 4, num: 86, @@ -506,7 +506,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Thick Fat", rating: 3.5, num: 47, @@ -535,10 +535,10 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return; } if (pokemon.setAbility(ability)) { - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); } }, - flags: {notrace: 1}, + flags: { notrace: 1 }, }, unburden: { inherit: true, diff --git a/data/mods/gen4/conditions.ts b/data/mods/gen4/conditions.ts index 576737c7e4..558424f014 100644 --- a/data/mods/gen4/conditions.ts +++ b/data/mods/gen4/conditions.ts @@ -24,7 +24,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa effectType: 'Status', onStart(target, source, sourceEffect) { if (sourceEffect && sourceEffect.effectType === 'Move') { - this.add('-status', target, 'slp', '[from] move: ' + sourceEffect.name); + this.add('-status', target, 'slp', `[from] move: ${sourceEffect.name}`); } else { this.add('-status', target, 'slp'); } diff --git a/data/mods/gen4/items.ts b/data/mods/gen4/items.ts index 7dac3b389a..1a5577d4aa 100644 --- a/data/mods/gen4/items.ts +++ b/data/mods/gen4/items.ts @@ -89,7 +89,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = { }, onCustap(pokemon) { const action = this.queue.willMove(pokemon); - this.debug('custap action: ' + action); + this.debug(`custap action: ${action?.moveid}`); if (action && pokemon.eatItem()) { this.queue.cancelAction(pokemon); this.add('-message', "Custap Berry activated."); @@ -241,7 +241,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = { condition: { duration: 1, onAfterMoveSecondarySelf(source, target, move) { - if (move && move.effectType === 'Move' && source && source.volatiles['lifeorb']) { + if (move && move.effectType === 'Move' && source?.volatiles['lifeorb']) { this.damage(source.baseMaxhp / 10, source, source, this.dex.items.get('lifeorb')); source.removeVolatile('lifeorb'); } diff --git a/data/mods/gen4/moves.ts b/data/mods/gen4/moves.ts index 581a675c83..ddd4fa9c52 100644 --- a/data/mods/gen4/moves.ts +++ b/data/mods/gen4/moves.ts @@ -1,7 +1,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { acupressure: { inherit: true, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onHit(target) { if (target.volatiles['substitute']) { return false; @@ -35,7 +35,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, aquaring: { inherit: true, - flags: {metronome: 1}, + flags: { metronome: 1 }, condition: { onStart(pokemon) { this.add('-start', pokemon, 'Aqua Ring'); @@ -151,7 +151,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { damage: this.effectState.totalDamage * 2, category: "Physical", priority: 1, - flags: {contact: 1, protect: 1}, + flags: { contact: 1, protect: 1 }, ignoreImmunity: true, effectType: 'Move', type: 'Normal', @@ -207,7 +207,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, conversion: { inherit: true, - flags: {metronome: 1}, + flags: { metronome: 1 }, onHit(target) { const possibleTypes = target.moveSlots.map(moveSlot => { const move = this.dex.moves.get(moveSlot.id); @@ -257,19 +257,19 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, basePowerCallback(pokemon, target) { const bp = Math.floor(target.hp * 120 / target.maxhp) + 1; - this.debug('BP for ' + target.hp + '/' + target.maxhp + " HP: " + bp); + this.debug(`BP for ${target.hp}/${target.maxhp} HP: ${bp}`); return bp; }, }, curse: { inherit: true, - flags: {metronome: 1}, + flags: { metronome: 1 }, onModifyMove(move, source, target) { if (!source.hasType('Ghost')) { delete move.volatileStatus; delete move.onHit; - move.self = {boosts: {atk: 1, def: 1, spe: -1}}; - move.target = move.nonGhostTarget as MoveTarget; + move.self = { boosts: { atk: 1, def: 1, spe: -1 } }; + move.target = move.nonGhostTarget!; } else if (target?.volatiles['substitute']) { delete move.volatileStatus; delete move.onHit; @@ -277,7 +277,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, condition: { onStart(pokemon, source) { - this.add('-start', pokemon, 'Curse', '[of] ' + source); + this.add('-start', pokemon, 'Curse', `[of] ${source}`); }, onResidualOrder: 10, onResidualSubOrder: 8, @@ -289,7 +289,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, defog: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, detect: { inherit: true, @@ -317,7 +317,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { disable: { inherit: true, accuracy: 80, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'disable', condition: { durationCallback() { @@ -375,7 +375,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Doom Desire", basePower: 120, category: "Special", - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, willCrit: false, type: '???', } as unknown as ActiveMove; @@ -383,15 +383,15 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { Object.assign(target.side.slotConditions[target.position]['futuremove'], { duration: 3, move: 'doomdesire', - source: source, + source, moveData: { id: 'doomdesire', name: "Doom Desire", accuracy: 85, basePower: 0, - damage: damage, + damage, category: "Special", - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, effectType: 'Move', type: '???', }, @@ -417,7 +417,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, embargo: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTryHit(pokemon) { if (pokemon.ability === 'multitype' || pokemon.item === 'griseousorb') { return false; @@ -438,7 +438,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, encore: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1, failencore: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1, failencore: 1 }, volatileStatus: 'encore', condition: { durationCallback() { @@ -535,7 +535,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, }, @@ -552,7 +552,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (!this.singleEvent('TakeItem', item, source.itemState, source, source, move, item)) return false; if (!item.fling) return false; move.basePower = item.fling.basePower; - this.debug('BP: ' + move.basePower); + this.debug(`BP: ${move.basePower}`); if (item.isBerry) { move.onHit = function (foe) { if (this.singleEvent('Eat', item, null, foe, null, null)) { @@ -566,9 +566,9 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else { if (!move.secondaries) move.secondaries = []; if (item.fling.status) { - move.secondaries.push({status: item.fling.status}); + move.secondaries.push({ status: item.fling.status }); } else if (item.fling.volatileStatus) { - move.secondaries.push({volatileStatus: item.fling.volatileStatus}); + move.secondaries.push({ volatileStatus: item.fling.volatileStatus }); } } source.addVolatile('fling'); @@ -591,7 +591,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, foresight: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, furycutter: { inherit: true, @@ -620,7 +620,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Future Sight", basePower: 80, category: "Special", - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, willCrit: false, type: '???', } as unknown as ActiveMove; @@ -628,15 +628,15 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { Object.assign(target.side.slotConditions[target.position]['futuremove'], { duration: 3, move: 'futuresight', - source: source, + source, moveData: { id: 'futuresight', name: "Future Sight", accuracy: 90, basePower: 0, - damage: damage, + damage, category: "Special", - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, effectType: 'Move', type: '???', }, @@ -752,7 +752,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, healblock: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, condition: { duration: 5, durationCallback(target, source, effect) { @@ -793,7 +793,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, healingwish: { inherit: true, - flags: {heal: 1, metronome: 1}, + flags: { heal: 1, metronome: 1 }, onAfterMove(pokemon) { pokemon.switchFlag = true; }, @@ -830,7 +830,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, imprison: { inherit: true, - flags: {bypasssub: 1, metronome: 1}, + flags: { bypasssub: 1, metronome: 1 }, onTryHit(pokemon) { for (const target of pokemon.foes()) { for (const move of pokemon.moves) { @@ -880,7 +880,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const item = target.getItem(); if (this.runEvent('TakeItem', target, source, move, item)) { target.itemState.knockedOff = true; - this.add('-enditem', target, item.name, '[from] move: Knock Off', '[of] ' + source); + this.add('-enditem', target, item.name, '[from] move: Knock Off', `[of] ${source}`); this.hint("In Gens 3-4, Knock Off only makes the target's item unusable; it cannot obtain a new item.", true); } }, @@ -953,7 +953,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, luckychant: { inherit: true, - flags: {metronome: 1}, + flags: { metronome: 1 }, condition: { duration: 5, onSideStart(side) { @@ -968,7 +968,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, lunardance: { inherit: true, - flags: {heal: 1, metronome: 1}, + flags: { heal: 1, metronome: 1 }, onAfterMove(pokemon) { pokemon.switchFlag = true; }, @@ -1009,7 +1009,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { target.removeVolatile('magiccoat'); const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; - this.actions.useMove(newMove, target, {target: source}); + this.actions.useMove(newMove, target, { target: source }); return null; }, }, @@ -1020,7 +1020,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, magnetrise: { inherit: true, - flags: {gravity: 1, metronome: 1}, + flags: { gravity: 1, metronome: 1 }, volatileStatus: 'magnetrise', condition: { duration: 5, @@ -1049,11 +1049,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, metalburst: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, metronome: { inherit: true, - flags: {noassist: 1, failcopycat: 1, nosleeptalk: 1, failmimic: 1}, + flags: { noassist: 1, failcopycat: 1, nosleeptalk: 1, failmimic: 1 }, onHit(pokemon) { const moves = this.dex.moves.all().filter(move => ( (![2, 4].includes(this.gen) || !pokemon.moves.includes(move.id)) && @@ -1107,7 +1107,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, miracleeye: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, mirrormove: { inherit: true, @@ -1115,7 +1115,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onHit(pokemon) { const lastAttackedBy = pokemon.getLastAttackedBy(); if (!lastAttackedBy?.source.lastMove || !lastAttackedBy.move) { - return false; + return false; } const noMirror = [ 'acupressure', 'aromatherapy', 'assist', 'chatter', 'copycat', 'counter', 'curse', 'doomdesire', 'feint', 'focuspunch', 'futuresight', 'gravity', 'hail', 'haze', 'healbell', 'helpinghand', 'lightscreen', 'luckychant', 'magiccoat', 'mefirst', 'metronome', 'mimic', 'mirrorcoat', 'mirrormove', 'mist', 'mudsport', 'naturepower', 'perishsong', 'psychup', 'raindance', 'reflect', 'roleplay', 'safeguard', 'sandstorm', 'sketch', 'sleeptalk', 'snatch', 'spikes', 'spitup', 'stealthrock', 'struggle', 'sunnyday', 'tailwind', 'toxicspikes', 'transform', 'watersport', @@ -1197,7 +1197,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, naturepower: { inherit: true, - flags: {metronome: 1}, + flags: { metronome: 1 }, onHit(pokemon) { this.actions.useMove('triattack', pokemon); }, @@ -1221,7 +1221,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, odorsleuth: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, outrage: { inherit: true, @@ -1255,7 +1255,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onResidualOrder: 12, onResidual(pokemon) { const duration = pokemon.volatiles['perishsong'].duration; - this.add('-start', pokemon, 'perish' + duration); + this.add('-start', pokemon, `perish${duration}`); }, }, }, @@ -1272,7 +1272,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, powertrick: { inherit: true, - flags: {metronome: 1}, + flags: { metronome: 1 }, }, protect: { inherit: true, @@ -1299,7 +1299,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, psychup: { inherit: true, - flags: {snatch: 1, bypasssub: 1, metronome: 1}, + flags: { snatch: 1, bypasssub: 1, metronome: 1 }, }, pursuit: { inherit: true, @@ -1335,12 +1335,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { self: { onHit(pokemon) { if (pokemon.removeVolatile('leechseed')) { - this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon); + this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', `[of] ${pokemon}`); } const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb']; for (const condition of sideConditions) { if (pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', `[of] ${pokemon}`); } } if (pokemon.volatiles['partiallytrapped']) { @@ -1351,7 +1351,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, recycle: { inherit: true, - flags: {metronome: 1}, + flags: { metronome: 1 }, }, reflect: { inherit: true, @@ -1399,13 +1399,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, }, roar: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, }, rockblast: { inherit: true, @@ -1491,7 +1491,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return false; } if (target.lastMove.flags['nosketch'] || source.moves.includes(target.lastMove.id)) { - return false; + return false; } const sketchIndex = source.moves.indexOf('sketch'); if (sketchIndex < 0) return false; @@ -1530,7 +1530,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, snatch: { inherit: true, - flags: {bypasssub: 1, noassist: 1, failcopycat: 1}, + flags: { bypasssub: 1, noassist: 1, failcopycat: 1 }, condition: { duration: 1, onStart(pokemon) { @@ -1544,7 +1544,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return; } snatchUser.removeVolatile('snatch'); - this.add('-activate', snatchUser, 'move: Snatch', '[of] ' + source); + this.add('-activate', snatchUser, 'move: Snatch', `[of] ${source}`); this.actions.useMove(move.id, snatchUser); return null; }, @@ -1552,11 +1552,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, snore: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, metronome: 1 }, }, spikes: { inherit: true, - flags: {metronome: 1, mustpressure: 1}, + flags: { metronome: 1, mustpressure: 1 }, condition: { // this is a side condition onSideStart(side) { @@ -1577,11 +1577,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, spite: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, stealthrock: { inherit: true, - flags: {metronome: 1, mustpressure: 1}, + flags: { metronome: 1, mustpressure: 1 }, condition: { // this is a side condition onSideStart(side) { @@ -1590,7 +1590,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onEntryHazard(pokemon) { if (pokemon.hasItem('heavydutyboots')) return; const typeMod = this.clampIntRange(pokemon.runEffectiveness(this.dex.getActiveMove('stealthrock')), -6, 6); - this.damage(pokemon.maxhp * Math.pow(2, typeMod) / 8); + this.damage(pokemon.maxhp * 2 ** typeMod / 8); }, }, }, @@ -1728,7 +1728,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, taunt: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, condition: { durationCallback() { return this.random(3, 6); @@ -1765,7 +1765,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, torment: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, toxic: { inherit: true, @@ -1773,7 +1773,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, toxicspikes: { inherit: true, - flags: {metronome: 1, mustpressure: 1}, + flags: { metronome: 1, mustpressure: 1 }, condition: { // this is a side condition onSideStart(side) { @@ -1788,10 +1788,10 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onEntryHazard(pokemon) { if (!pokemon.isGrounded()) return; if (pokemon.hasType('Poison')) { - this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, 'move: Toxic Spikes', `[of] ${pokemon}`); pokemon.side.removeSideCondition('toxicspikes'); } else if (pokemon.volatiles['substitute'] || pokemon.hasType('Steel')) { - return; + // do nothing } else if (this.effectState.layers >= 2) { pokemon.trySetStatus('tox', pokemon.side.foe.active[0]); } else { @@ -1802,7 +1802,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, transform: { inherit: true, - flags: {bypasssub: 1, metronome: 1, failencore: 1}, + flags: { bypasssub: 1, metronome: 1, failencore: 1 }, }, trick: { inherit: true, @@ -1823,9 +1823,9 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(target, source) { if (source?.hasAbility('persistent')) { - this.add('-fieldstart', 'move: Trick Room', '[of] ' + source, '[persistent]'); + this.add('-fieldstart', 'move: Trick Room', `[of] ${source}`, '[persistent]'); } else { - this.add('-fieldstart', 'move: Trick Room', '[of] ' + source); + this.add('-fieldstart', 'move: Trick Room', `[of] ${source}`); } }, onFieldRestart(target, source) { @@ -1902,11 +1902,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, whirlwind: { inherit: true, - flags: {protect: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, wish: { inherit: true, - flags: {heal: 1, metronome: 1}, + flags: { heal: 1, metronome: 1 }, slotCondition: 'Wish', condition: { duration: 2, @@ -1941,7 +1941,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, basePowerCallback(pokemon, target) { const bp = Math.floor(target.hp * 120 / target.maxhp) + 1; - this.debug('BP for ' + target.hp + '/' + target.maxhp + " HP: " + bp); + this.debug(`BP for ${target.hp}/${target.maxhp} HP: ${bp}`); return bp; }, }, @@ -1951,7 +1951,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { noCopy: true, // doesn't get copied by Baton Pass duration: 2, onStart(target, source) { - this.add('-start', target, 'move: Yawn', '[of] ' + source); + this.add('-start', target, 'move: Yawn', `[of] ${source}`); }, onResidualOrder: 10, onResidualSubOrder: 19, diff --git a/data/mods/gen4/scripts.ts b/data/mods/gen4/scripts.ts index 995a600cfa..67f54d423d 100644 --- a/data/mods/gen4/scripts.ts +++ b/data/mods/gen4/scripts.ts @@ -48,7 +48,7 @@ export const Scripts: ModdedBattleScriptsData = { // Double battle multi-hit if (move.spreadHit) { const spreadModifier = move.spreadModifier || (this.battle.gameType === 'freeforall' ? 0.5 : 0.75); - this.battle.debug('Spread modifier: ' + spreadModifier); + this.battle.debug(`Spread modifier: ${spreadModifier}`); baseDamage = this.battle.modify(baseDamage, spreadModifier); } @@ -147,7 +147,7 @@ export const Scripts: ModdedBattleScriptsData = { let boost!: number; if (accuracy !== true) { if (!move.ignoreAccuracy) { - boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); if (boost > 0) { accuracy *= boostTable[boost]; @@ -156,7 +156,7 @@ export const Scripts: ModdedBattleScriptsData = { } } if (!move.ignoreEvasion) { - boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); boost = this.battle.clampIntRange(boosts['evasion'], -6, 6); if (boost > 0) { accuracy /= boostTable[boost]; diff --git a/data/mods/gen5/abilities.ts b/data/mods/gen5/abilities.ts index 032dacaf24..783f94fc9f 100644 --- a/data/mods/gen5/abilities.ts +++ b/data/mods/gen5/abilities.ts @@ -21,7 +21,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onStart(pokemon) { const target = pokemon.side.randomFoe(); if (target?.item) { - this.add('-item', '', target.getItem().name, '[from] ability: Frisk', '[of] ' + pokemon); + this.add('-item', '', target.getItem().name, '[from] ability: Frisk', `[of] ${pokemon}`); } }, }, @@ -42,7 +42,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = false; - this.actions.useMove(newMove, this.effectState.target, {target: source}); + this.actions.useMove(newMove, this.effectState.target, { target: source }); return null; }, }, diff --git a/data/mods/gen5/conditions.ts b/data/mods/gen5/conditions.ts index ed35741577..5fae79b079 100644 --- a/data/mods/gen5/conditions.ts +++ b/data/mods/gen5/conditions.ts @@ -8,7 +8,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa partiallytrapped: { inherit: true, onStart(pokemon, source) { - this.add('-activate', pokemon, 'move: ' + this.effectState.sourceEffect, '[of] ' + source); + this.add('-activate', pokemon, 'move: ' + this.effectState.sourceEffect, `[of] ${source}`); this.effectState.boundDivisor = source.hasItem('bindingband') ? 8 : 16; }, onResidual(pokemon) { @@ -34,7 +34,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa if (counter >= 256) { return this.randomChance(1, 2 ** 32); } - this.debug("Success chance: " + Math.round(100 / counter) + "%"); + this.debug(`Success chance: ${Math.round(100 / counter)}%`); return this.randomChance(1, counter); }, onRestart() { diff --git a/data/mods/gen5/moves.ts b/data/mods/gen5/moves.ts index 11521fe57b..f1ada17943 100644 --- a/data/mods/gen5/moves.ts +++ b/data/mods/gen5/moves.ts @@ -1,7 +1,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { absorb: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, acidarmor: { inherit: true, @@ -68,7 +68,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, bestow: { inherit: true, - flags: {protect: 1, mirror: 1, noassist: 1, failcopycat: 1}, + flags: { protect: 1, mirror: 1, noassist: 1, failcopycat: 1 }, }, blizzard: { inherit: true, @@ -76,11 +76,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, block: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, }, bounce: { inherit: true, - flags: {contact: 1, charge: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, metronome: 1, nosleeptalk: 1}, + flags: { contact: 1, charge: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, metronome: 1, nosleeptalk: 1 }, }, bubble: { inherit: true, @@ -88,7 +88,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, bugbuzz: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, metronome: 1 }, }, camouflage: { inherit: true, @@ -160,22 +160,22 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { defog: { inherit: true, onHit(pokemon) { - if (!pokemon.volatiles['substitute']) this.boost({evasion: -1}); + if (!pokemon.volatiles['substitute']) this.boost({ evasion: -1 }); const sideConditions = ['reflect', 'lightscreen', 'safeguard', 'mist', 'spikes', 'toxicspikes', 'stealthrock']; for (const condition of sideConditions) { if (pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Defog', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Defog', `[of] ${pokemon}`); } } }, }, dig: { inherit: true, - flags: {contact: 1, charge: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1, nosleeptalk: 1}, + flags: { contact: 1, charge: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1, nosleeptalk: 1 }, }, dive: { inherit: true, - flags: {contact: 1, charge: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1, nosleeptalk: 1}, + flags: { contact: 1, charge: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1, nosleeptalk: 1 }, }, dracometeor: { inherit: true, @@ -187,22 +187,22 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, drainpunch: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, }, dreameater: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, echoedvoice: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, metronome: 1 }, }, electroball: { inherit: true, basePowerCallback(pokemon, target) { const ratio = Math.floor(pokemon.getStat('spe') / Math.max(1, target.getStat('spe'))); const bp = [40, 60, 80, 120, 150][Math.min(ratio, 4)]; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, }, @@ -216,11 +216,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, feint: { inherit: true, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, }, finalgambit: { inherit: true, - flags: {contact: 1, protect: 1, metronome: 1}, + flags: { contact: 1, protect: 1, metronome: 1 }, }, fireblast: { inherit: true, @@ -243,7 +243,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, fly: { inherit: true, - flags: {contact: 1, charge: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, metronome: 1}, + flags: { contact: 1, charge: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, metronome: 1 }, }, followme: { inherit: true, @@ -277,7 +277,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { Object.assign(target.side.slotConditions[target.position]['futuremove'], { duration: 3, move: 'futuresight', - source: source, + source, moveData: { id: 'futuresight', name: "Future Sight", @@ -285,7 +285,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { basePower: 100, category: "Special", priority: 0, - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, ignoreImmunity: false, effectType: 'Move', type: 'Psychic', @@ -297,7 +297,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, gigadrain: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, glare: { inherit: true, @@ -305,7 +305,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, grasswhistle: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1 }, }, grasspledge: { inherit: true, @@ -320,7 +320,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, growl: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1 }, }, growth: { inherit: true, @@ -335,13 +335,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { basePowerCallback(pokemon, target) { let power = Math.floor(25 * target.getStat('spe') / Math.max(1, pokemon.getStat('spe'))) + 1; if (power > 150) power = 150; - this.debug('BP: ' + power); + this.debug(`BP: ${power}`); return power; }, }, healbell: { inherit: true, - flags: {snatch: 1, sound: 1, metronome: 1}, + flags: { snatch: 1, sound: 1, metronome: 1 }, onHit(target, source) { this.add('-activate', source, 'move: Heal Bell'); const allies = [...target.side.pokemon, ...target.side.allySide?.pokemon || []]; @@ -368,7 +368,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { basePower: 0, basePowerCallback(pokemon) { const bp = pokemon.hpPower || 70; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, }, @@ -438,7 +438,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, hornleech: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, }, hurricane: { inherit: true, @@ -450,7 +450,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, hypervoice: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, metronome: 1 }, }, icebeam: { inherit: true, @@ -477,7 +477,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, leechlife: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, }, lick: { inherit: true, @@ -534,7 +534,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = this.effectState.pranksterBoosted; - this.actions.useMove(newMove, target, {target: source}); + this.actions.useMove(newMove, target, { target: source }); return null; }, onAllyTryHitSide(target, source, move) { @@ -544,7 +544,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = false; - this.actions.useMove(newMove, this.effectState.target, {target: source}); + this.actions.useMove(newMove, this.effectState.target, { target: source }); return null; }, }, @@ -559,15 +559,15 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, meanlook: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, }, megadrain: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, metalsound: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1 }, }, meteormash: { inherit: true, @@ -626,7 +626,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, perishsong: { inherit: true, - flags: {sound: 1, distance: 1, metronome: 1}, + flags: { sound: 1, distance: 1, metronome: 1 }, }, pinmissile: { inherit: true, @@ -706,7 +706,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { ragepowder: { inherit: true, priority: 3, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, }, reflect: { inherit: true, @@ -739,12 +739,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, relicsong: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1}, + flags: { protect: 1, mirror: 1, sound: 1 }, }, roar: { inherit: true, accuracy: 100, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, }, rocktomb: { inherit: true, @@ -754,7 +754,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, round: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, metronome: 1 }, }, sacredsword: { inherit: true, @@ -766,7 +766,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, screech: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1 }, }, secretpower: { inherit: true, @@ -779,11 +779,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, shadowforce: { inherit: true, - flags: {contact: 1, charge: 1, mirror: 1, metronome: 1, nosleeptalk: 1}, + flags: { contact: 1, charge: 1, mirror: 1, metronome: 1, nosleeptalk: 1 }, }, sing: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1 }, }, skillswap: { inherit: true, @@ -793,7 +793,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (targetAbility === sourceAbility) { return false; } - this.add('-activate', source, 'move: Skill Swap', this.dex.abilities.get(targetAbility), this.dex.abilities.get(sourceAbility), '[of] ' + target); + this.add('-activate', source, 'move: Skill Swap', this.dex.abilities.get(targetAbility), this.dex.abilities.get(sourceAbility), `[of] ${target}`); source.setAbility(targetAbility); target.setAbility(sourceAbility); }, @@ -805,7 +805,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, skydrop: { inherit: true, - flags: {contact: 1, charge: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, metronome: 1, nosleeptalk: 1}, + flags: { contact: 1, charge: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, metronome: 1, nosleeptalk: 1 }, onTryHit(target, source, move) { if (target.fainted) return false; if (source.removeVolatile(move.id)) { @@ -841,12 +841,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, snarl: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1}, + flags: { protect: 1, mirror: 1, sound: 1 }, }, snore: { inherit: true, basePower: 40, - flags: {protect: 1, mirror: 1, sound: 1}, + flags: { protect: 1, mirror: 1, sound: 1 }, }, soak: { inherit: true, @@ -937,7 +937,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, supersonic: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, metronome: 1 }, }, surf: { inherit: true, @@ -989,7 +989,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, uproar: { inherit: true, - flags: {protect: 1, mirror: 1, sound: 1, metronome: 1, nosleeptalk: 1}, + flags: { protect: 1, mirror: 1, sound: 1, metronome: 1, nosleeptalk: 1 }, }, vinewhip: { inherit: true, @@ -1032,7 +1032,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { whirlwind: { inherit: true, accuracy: 100, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, }, wideguard: { inherit: true, diff --git a/data/mods/gen5/pokedex.ts b/data/mods/gen5/pokedex.ts index 06f3e54db5..18022594d2 100644 --- a/data/mods/gen5/pokedex.ts +++ b/data/mods/gen5/pokedex.ts @@ -37,31 +37,31 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, butterfree: { inherit: true, - baseStats: {hp: 60, atk: 45, def: 50, spa: 80, spd: 80, spe: 70}, + baseStats: { hp: 60, atk: 45, def: 50, spa: 80, spd: 80, spe: 70 }, }, beedrill: { inherit: true, - baseStats: {hp: 65, atk: 80, def: 40, spa: 45, spd: 80, spe: 75}, + baseStats: { hp: 65, atk: 80, def: 40, spa: 45, spd: 80, spe: 75 }, }, pidgeot: { inherit: true, - baseStats: {hp: 83, atk: 80, def: 75, spa: 70, spd: 70, spe: 91}, + baseStats: { hp: 83, atk: 80, def: 75, spa: 70, spd: 70, spe: 91 }, }, pikachu: { inherit: true, - baseStats: {hp: 35, atk: 55, def: 30, spa: 50, spd: 40, spe: 90}, + baseStats: { hp: 35, atk: 55, def: 30, spa: 50, spd: 40, spe: 90 }, }, raichu: { inherit: true, - baseStats: {hp: 60, atk: 90, def: 55, spa: 90, spd: 80, spe: 100}, + baseStats: { hp: 60, atk: 90, def: 55, spa: 90, spd: 80, spe: 100 }, }, nidoqueen: { inherit: true, - baseStats: {hp: 90, atk: 82, def: 87, spa: 75, spd: 85, spe: 76}, + baseStats: { hp: 90, atk: 82, def: 87, spa: 75, spd: 85, spe: 76 }, }, nidoking: { inherit: true, - baseStats: {hp: 81, atk: 92, def: 77, spa: 85, spd: 75, spe: 85}, + baseStats: { hp: 81, atk: 92, def: 77, spa: 85, spd: 75, spe: 85 }, }, clefairy: { inherit: true, @@ -70,38 +70,38 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable clefable: { inherit: true, types: ["Normal"], - baseStats: {hp: 95, atk: 70, def: 73, spa: 85, spd: 90, spe: 60}, + baseStats: { hp: 95, atk: 70, def: 73, spa: 85, spd: 90, spe: 60 }, }, jigglypuff: { inherit: true, types: ["Normal"], - abilities: {0: "Cute Charm", H: "Friend Guard"}, + abilities: { 0: "Cute Charm", H: "Friend Guard" }, }, wigglytuff: { inherit: true, types: ["Normal"], - baseStats: {hp: 140, atk: 70, def: 45, spa: 75, spd: 50, spe: 45}, - abilities: {0: "Cute Charm", H: "Frisk"}, + baseStats: { hp: 140, atk: 70, def: 45, spa: 75, spd: 50, spe: 45 }, + abilities: { 0: "Cute Charm", H: "Frisk" }, }, vileplume: { inherit: true, - baseStats: {hp: 75, atk: 80, def: 85, spa: 100, spd: 90, spe: 50}, + baseStats: { hp: 75, atk: 80, def: 85, spa: 100, spd: 90, spe: 50 }, }, poliwrath: { inherit: true, - baseStats: {hp: 90, atk: 85, def: 95, spa: 70, spd: 90, spe: 70}, + baseStats: { hp: 90, atk: 85, def: 95, spa: 70, spd: 90, spe: 70 }, }, alakazam: { inherit: true, - baseStats: {hp: 55, atk: 50, def: 45, spa: 135, spd: 85, spe: 120}, + baseStats: { hp: 55, atk: 50, def: 45, spa: 135, spd: 85, spe: 120 }, }, victreebel: { inherit: true, - baseStats: {hp: 80, atk: 105, def: 65, spa: 100, spd: 60, spe: 70}, + baseStats: { hp: 80, atk: 105, def: 65, spa: 100, spd: 60, spe: 70 }, }, golem: { inherit: true, - baseStats: {hp: 80, atk: 110, def: 130, spa: 55, spd: 65, spe: 45}, + baseStats: { hp: 80, atk: 110, def: 130, spa: 55, spd: 65, spe: 45 }, }, mrmime: { inherit: true, @@ -113,7 +113,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, zapdos: { inherit: true, - abilities: {0: "Pressure", H: "Lightning Rod"}, + abilities: { 0: "Pressure", H: "Lightning Rod" }, unreleasedHidden: true, }, moltres: { @@ -159,7 +159,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable igglybuff: { inherit: true, types: ["Normal"], - abilities: {0: "Cute Charm", H: "Friend Guard"}, + abilities: { 0: "Cute Charm", H: "Friend Guard" }, }, togepi: { inherit: true, @@ -175,11 +175,11 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, ampharos: { inherit: true, - baseStats: {hp: 90, atk: 75, def: 75, spa: 115, spd: 90, spe: 55}, + baseStats: { hp: 90, atk: 75, def: 75, spa: 115, spd: 90, spe: 55 }, }, bellossom: { inherit: true, - baseStats: {hp: 75, atk: 80, def: 85, spa: 90, spd: 100, spe: 50}, + baseStats: { hp: 75, atk: 80, def: 85, spa: 90, spd: 100, spe: 50 }, }, marill: { inherit: true, @@ -188,11 +188,11 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable azumarill: { inherit: true, types: ["Water"], - baseStats: {hp: 100, atk: 50, def: 80, spa: 50, spd: 80, spe: 50}, + baseStats: { hp: 100, atk: 50, def: 80, spa: 50, spd: 80, spe: 50 }, }, jumpluff: { inherit: true, - baseStats: {hp: 75, atk: 55, def: 70, spa: 55, spd: 85, spe: 110}, + baseStats: { hp: 75, atk: 55, def: 70, spa: 55, spd: 85, spe: 110 }, }, snubbull: { inherit: true, @@ -256,7 +256,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, beautifly: { inherit: true, - baseStats: {hp: 60, atk: 70, def: 50, spa: 90, spd: 50, spe: 65}, + baseStats: { hp: 60, atk: 70, def: 50, spa: 90, spd: 50, spe: 65 }, }, ralts: { inherit: true, @@ -272,7 +272,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, exploud: { inherit: true, - baseStats: {hp: 104, atk: 91, def: 63, spa: 91, spd: 63, spe: 68}, + baseStats: { hp: 104, atk: 91, def: 63, spa: 91, spd: 63, spe: 68 }, }, azurill: { inherit: true, @@ -284,31 +284,31 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, plusle: { inherit: true, - abilities: {0: "Plus"}, + abilities: { 0: "Plus" }, }, minun: { inherit: true, - abilities: {0: "Minus"}, + abilities: { 0: "Minus" }, }, kecleon: { inherit: true, - abilities: {0: "Color Change"}, + abilities: { 0: "Color Change" }, }, feebas: { inherit: true, - abilities: {0: "Swift Swim", H: "Adaptability"}, + abilities: { 0: "Swift Swim", H: "Adaptability" }, }, milotic: { inherit: true, - abilities: {0: "Marvel Scale", H: "Cute Charm"}, + abilities: { 0: "Marvel Scale", H: "Cute Charm" }, }, duskull: { inherit: true, - abilities: {0: "Levitate"}, + abilities: { 0: "Levitate" }, }, dusclops: { inherit: true, - abilities: {0: "Pressure"}, + abilities: { 0: "Pressure" }, }, regirock: { inherit: true, @@ -360,15 +360,15 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, starly: { inherit: true, - abilities: {0: "Keen Eye"}, + abilities: { 0: "Keen Eye" }, }, staraptor: { inherit: true, - baseStats: {hp: 85, atk: 120, def: 70, spa: 50, spd: 50, spe: 100}, + baseStats: { hp: 85, atk: 120, def: 70, spa: 50, spd: 50, spe: 100 }, }, roserade: { inherit: true, - baseStats: {hp: 60, atk: 70, def: 55, spa: 125, spd: 105, spe: 90}, + baseStats: { hp: 60, atk: 70, def: 55, spa: 125, spd: 105, spe: 90 }, }, mimejr: { inherit: true, @@ -380,7 +380,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, dusknoir: { inherit: true, - abilities: {0: "Pressure"}, + abilities: { 0: "Pressure" }, }, snivy: { inherit: true, @@ -420,7 +420,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, stoutland: { inherit: true, - baseStats: {hp: 85, atk: 100, def: 90, spa: 45, spd: 90, spe: 80}, + baseStats: { hp: 85, atk: 100, def: 90, spa: 45, spd: 90, spe: 80 }, }, pansage: { inherit: true, @@ -448,32 +448,32 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, unfezant: { inherit: true, - baseStats: {hp: 80, atk: 105, def: 80, spa: 65, spd: 55, spe: 93}, + baseStats: { hp: 80, atk: 105, def: 80, spa: 65, spd: 55, spe: 93 }, }, gigalith: { inherit: true, - baseStats: {hp: 85, atk: 135, def: 130, spa: 60, spd: 70, spe: 25}, + baseStats: { hp: 85, atk: 135, def: 130, spa: 60, spd: 70, spe: 25 }, }, seismitoad: { inherit: true, - baseStats: {hp: 105, atk: 85, def: 75, spa: 85, spd: 75, spe: 74}, + baseStats: { hp: 105, atk: 85, def: 75, spa: 85, spd: 75, spe: 74 }, }, leavanny: { inherit: true, - baseStats: {hp: 75, atk: 103, def: 80, spa: 70, spd: 70, spe: 92}, + baseStats: { hp: 75, atk: 103, def: 80, spa: 70, spd: 70, spe: 92 }, }, venipede: { inherit: true, - abilities: {0: "Poison Point", 1: "Swarm", H: "Quick Feet"}, + abilities: { 0: "Poison Point", 1: "Swarm", H: "Quick Feet" }, }, whirlipede: { inherit: true, - abilities: {0: "Poison Point", 1: "Swarm", H: "Quick Feet"}, + abilities: { 0: "Poison Point", 1: "Swarm", H: "Quick Feet" }, }, scolipede: { inherit: true, - baseStats: {hp: 60, atk: 90, def: 89, spa: 55, spd: 69, spe: 112}, - abilities: {0: "Poison Point", 1: "Swarm", H: "Quick Feet"}, + baseStats: { hp: 60, atk: 90, def: 89, spa: 55, spd: 69, spe: 112 }, + abilities: { 0: "Poison Point", 1: "Swarm", H: "Quick Feet" }, }, cottonee: { inherit: true, @@ -485,11 +485,11 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, basculinbluestriped: { inherit: true, - abilities: {0: "Rock Head", 1: "Adaptability", H: "Mold Breaker", S: "Reckless"}, + abilities: { 0: "Rock Head", 1: "Adaptability", H: "Mold Breaker", S: "Reckless" }, }, krookodile: { inherit: true, - baseStats: {hp: 95, atk: 117, def: 70, spa: 65, spd: 70, spe: 92}, + baseStats: { hp: 95, atk: 117, def: 70, spa: 65, spd: 70, spe: 92 }, }, gothita: { inherit: true, @@ -497,17 +497,17 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, gothorita: { inherit: true, - abilities: {0: "Frisk", H: "Shadow Tag"}, + abilities: { 0: "Frisk", H: "Shadow Tag" }, maleOnlyHidden: true, }, gothitelle: { inherit: true, - abilities: {0: "Frisk", H: "Shadow Tag"}, + abilities: { 0: "Frisk", H: "Shadow Tag" }, maleOnlyHidden: true, }, ferrothorn: { inherit: true, - abilities: {0: "Iron Barbs"}, + abilities: { 0: "Iron Barbs" }, }, klink: { inherit: true, @@ -515,17 +515,17 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, litwick: { inherit: true, - abilities: {0: "Flash Fire", 1: "Flame Body", H: "Shadow Tag"}, + abilities: { 0: "Flash Fire", 1: "Flame Body", H: "Shadow Tag" }, unreleasedHidden: true, }, lampent: { inherit: true, - abilities: {0: "Flash Fire", 1: "Flame Body", H: "Shadow Tag"}, + abilities: { 0: "Flash Fire", 1: "Flame Body", H: "Shadow Tag" }, unreleasedHidden: true, }, chandelure: { inherit: true, - abilities: {0: "Flash Fire", 1: "Flame Body", H: "Shadow Tag"}, + abilities: { 0: "Flash Fire", 1: "Flame Body", H: "Shadow Tag" }, unreleasedHidden: true, }, rufflet: { diff --git a/data/mods/gen6/abilities.ts b/data/mods/gen6/abilities.ts index 5d91c41eb8..1da8541209 100644 --- a/data/mods/gen6/abilities.ts +++ b/data/mods/gen6/abilities.ts @@ -32,7 +32,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa liquidooze: { inherit: true, onSourceTryHeal(damage, target, source, effect) { - this.debug("Heal is occurring: " + target + " <- " + source + " :: " + effect.id); + this.debug(`Heal is occurring: ${target} <- ${source} :: ${effect.id}`); const canOoze = ['drain', 'leechseed']; if (canOoze.includes(effect.id)) { this.damage(damage, null, null, null, true); @@ -108,20 +108,20 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa source.item = myItem.id; return; } - this.add('-activate', source, 'ability: Symbiosis', myItem, '[of] ' + pokemon); + this.add('-activate', source, 'ability: Symbiosis', myItem, `[of] ${pokemon}`); }, }, weakarmor: { inherit: true, onDamagingHit(damage, target, source, move) { if (move.category === 'Physical') { - this.boost({def: -1, spe: 1}, target, target); + this.boost({ def: -1, spe: 1 }, target, target); } }, rating: 0.5, }, zenmode: { inherit: true, - flags: {failroleplay: 1, noentrain: 1, notrace: 1}, + flags: { failroleplay: 1, noentrain: 1, notrace: 1 }, }, }; diff --git a/data/mods/gen6/moves.ts b/data/mods/gen6/moves.ts index b1f6f389e6..3bfecf66d9 100644 --- a/data/mods/gen6/moves.ts +++ b/data/mods/gen6/moves.ts @@ -5,11 +5,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, assist: { inherit: true, - flags: {noassist: 1, failcopycat: 1, nosleeptalk: 1}, + flags: { noassist: 1, failcopycat: 1, nosleeptalk: 1 }, }, copycat: { inherit: true, - flags: {noassist: 1, failcopycat: 1, nosleeptalk: 1}, + flags: { noassist: 1, failcopycat: 1, nosleeptalk: 1 }, }, darkvoid: { inherit: true, @@ -83,7 +83,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, basePower: 30, onAfterMoveSecondarySelf(pokemon, target, move) { - if (!target || target.fainted || target.hp <= 0) this.boost({atk: 2}, pokemon, pokemon, move); + if (!target || target.fainted || target.hp <= 0) this.boost({ atk: 2 }, pokemon, pokemon, move); }, }, flyingpress: { @@ -97,7 +97,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, mefirst: { inherit: true, - flags: {protect: 1, bypasssub: 1, noassist: 1, failcopycat: 1, failmefirst: 1, nosleeptalk: 1}, + flags: { protect: 1, bypasssub: 1, noassist: 1, failcopycat: 1, failmefirst: 1, nosleeptalk: 1 }, }, minimize: { inherit: true, @@ -124,7 +124,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, metronome: { inherit: true, - flags: {noassist: 1, failcopycat: 1, nosleeptalk: 1}, + flags: { noassist: 1, failcopycat: 1, nosleeptalk: 1 }, }, mistyterrain: { inherit: true, @@ -151,7 +151,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { - this.add('-fieldstart', 'move: Misty Terrain', '[from] ability: ' + effect, '[of] ' + source); + this.add('-fieldstart', 'move: Misty Terrain', `[from] ability: ${effect}`, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Misty Terrain'); } @@ -169,7 +169,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, naturepower: { inherit: true, - flags: {nosleeptalk: 1, noassist: 1, failcopycat: 1}, + flags: { nosleeptalk: 1, noassist: 1, failcopycat: 1 }, }, paraboliccharge: { inherit: true, @@ -178,7 +178,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { partingshot: { inherit: true, onHit(target, source) { - this.boost({atk: -1, spa: -1}, target, source); + this.boost({ atk: -1, spa: -1 }, target, source); }, }, powder: { @@ -201,7 +201,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, rockblast: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, sheercold: { inherit: true, @@ -209,7 +209,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, sleeptalk: { inherit: true, - flags: {nosleeptalk: 1, noassist: 1, failcopycat: 1}, + flags: { nosleeptalk: 1, noassist: 1, failcopycat: 1 }, }, stockpile: { inherit: true, @@ -218,18 +218,18 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onStart(target) { this.effectState.layers = 1; this.add('-start', target, 'stockpile' + this.effectState.layers); - this.boost({def: 1, spd: 1}, target, target); + this.boost({ def: 1, spd: 1 }, target, target); }, onRestart(target) { if (this.effectState.layers >= 3) return false; this.effectState.layers++; this.add('-start', target, 'stockpile' + this.effectState.layers); - this.boost({def: 1, spd: 1}, target, target); + this.boost({ def: 1, spd: 1 }, target, target); }, onEnd(target) { const layers = this.effectState.layers * -1; this.effectState.layers = 0; - this.boost({def: layers, spd: layers}, target, target); + this.boost({ def: layers, spd: layers }, target, target); this.add('-end', target, 'Stockpile'); }, }, diff --git a/data/mods/gen6/pokedex.ts b/data/mods/gen6/pokedex.ts index 8bf3af4e71..60f096b9f7 100644 --- a/data/mods/gen6/pokedex.ts +++ b/data/mods/gen6/pokedex.ts @@ -5,7 +5,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, arbok: { inherit: true, - baseStats: {hp: 60, atk: 85, def: 69, spa: 65, spd: 79, spe: 80}, + baseStats: { hp: 60, atk: 85, def: 69, spa: 65, spd: 79, spe: 80 }, }, pikachu: { inherit: true, @@ -13,112 +13,112 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, dugtrio: { inherit: true, - baseStats: {hp: 35, atk: 80, def: 50, spa: 50, spd: 70, spe: 120}, + baseStats: { hp: 35, atk: 80, def: 50, spa: 50, spd: 70, spe: 120 }, }, alakazammega: { inherit: true, - baseStats: {hp: 55, atk: 50, def: 65, spa: 175, spd: 95, spe: 150}, + baseStats: { hp: 55, atk: 50, def: 65, spa: 175, spd: 95, spe: 150 }, }, farfetchd: { inherit: true, - baseStats: {hp: 52, atk: 65, def: 55, spa: 58, spd: 62, spe: 60}, + baseStats: { hp: 52, atk: 65, def: 55, spa: 58, spd: 62, spe: 60 }, }, dodrio: { inherit: true, - baseStats: {hp: 60, atk: 110, def: 70, spa: 60, spd: 60, spe: 100}, + baseStats: { hp: 60, atk: 110, def: 70, spa: 60, spd: 60, spe: 100 }, }, gengar: { inherit: true, - abilities: {0: "Levitate"}, + abilities: { 0: "Levitate" }, }, electrode: { inherit: true, - baseStats: {hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 140}, + baseStats: { hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 140 }, }, exeggutor: { inherit: true, - baseStats: {hp: 95, atk: 95, def: 85, spa: 125, spd: 65, spe: 55}, + baseStats: { hp: 95, atk: 95, def: 85, spa: 125, spd: 65, spe: 55 }, }, noctowl: { inherit: true, - baseStats: {hp: 100, atk: 50, def: 50, spa: 76, spd: 96, spe: 70}, + baseStats: { hp: 100, atk: 50, def: 50, spa: 76, spd: 96, spe: 70 }, }, ariados: { inherit: true, - baseStats: {hp: 70, atk: 90, def: 70, spa: 60, spd: 60, spe: 40}, + baseStats: { hp: 70, atk: 90, def: 70, spa: 60, spd: 60, spe: 40 }, }, qwilfish: { inherit: true, - baseStats: {hp: 65, atk: 95, def: 75, spa: 55, spd: 55, spe: 85}, + baseStats: { hp: 65, atk: 95, def: 75, spa: 55, spd: 55, spe: 85 }, }, magcargo: { inherit: true, - baseStats: {hp: 50, atk: 50, def: 120, spa: 80, spd: 80, spe: 30}, + baseStats: { hp: 50, atk: 50, def: 120, spa: 80, spd: 80, spe: 30 }, }, corsola: { inherit: true, - baseStats: {hp: 55, atk: 55, def: 85, spa: 65, spd: 85, spe: 35}, + baseStats: { hp: 55, atk: 55, def: 85, spa: 65, spd: 85, spe: 35 }, }, mantine: { inherit: true, - baseStats: {hp: 65, atk: 40, def: 70, spa: 80, spd: 140, spe: 70}, + baseStats: { hp: 65, atk: 40, def: 70, spa: 80, spd: 140, spe: 70 }, }, raikou: { inherit: true, - abilities: {0: "Pressure", H: "Volt Absorb"}, + abilities: { 0: "Pressure", H: "Volt Absorb" }, unreleasedHidden: true, }, entei: { inherit: true, - abilities: {0: "Pressure", H: "Flash Fire"}, + abilities: { 0: "Pressure", H: "Flash Fire" }, unreleasedHidden: true, }, suicune: { inherit: true, - abilities: {0: "Pressure", H: "Water Absorb"}, + abilities: { 0: "Pressure", H: "Water Absorb" }, unreleasedHidden: true, }, swellow: { inherit: true, - baseStats: {hp: 60, atk: 85, def: 60, spa: 50, spd: 50, spe: 125}, + baseStats: { hp: 60, atk: 85, def: 60, spa: 50, spd: 50, spe: 125 }, }, wingull: { inherit: true, - abilities: {0: "Keen Eye", H: "Rain Dish"}, + abilities: { 0: "Keen Eye", H: "Rain Dish" }, }, pelipper: { inherit: true, - baseStats: {hp: 60, atk: 50, def: 100, spa: 85, spd: 70, spe: 65}, - abilities: {0: "Keen Eye", H: "Rain Dish"}, + baseStats: { hp: 60, atk: 50, def: 100, spa: 85, spd: 70, spe: 65 }, + abilities: { 0: "Keen Eye", H: "Rain Dish" }, }, masquerain: { inherit: true, - baseStats: {hp: 70, atk: 60, def: 62, spa: 80, spd: 82, spe: 60}, + baseStats: { hp: 70, atk: 60, def: 62, spa: 80, spd: 82, spe: 60 }, }, delcatty: { inherit: true, - baseStats: {hp: 70, atk: 65, def: 65, spa: 55, spd: 55, spe: 70}, + baseStats: { hp: 70, atk: 65, def: 65, spa: 55, spd: 55, spe: 70 }, }, volbeat: { inherit: true, - baseStats: {hp: 65, atk: 73, def: 55, spa: 47, spd: 75, spe: 85}, - abilities: {0: "Illuminate", 1: "Swarm", H: "Prankster"}, + baseStats: { hp: 65, atk: 73, def: 55, spa: 47, spd: 75, spe: 85 }, + abilities: { 0: "Illuminate", 1: "Swarm", H: "Prankster" }, }, illumise: { inherit: true, - baseStats: {hp: 65, atk: 47, def: 55, spa: 73, spd: 75, spe: 85}, + baseStats: { hp: 65, atk: 47, def: 55, spa: 73, spd: 75, spe: 85 }, }, torkoal: { inherit: true, - abilities: {0: "White Smoke", H: "Shell Armor"}, + abilities: { 0: "White Smoke", H: "Shell Armor" }, }, lunatone: { inherit: true, - baseStats: {hp: 70, atk: 55, def: 65, spa: 95, spd: 85, spe: 70}, + baseStats: { hp: 70, atk: 55, def: 65, spa: 95, spd: 85, spe: 70 }, }, solrock: { inherit: true, - baseStats: {hp: 70, atk: 95, def: 85, spa: 55, spd: 65, spe: 70}, + baseStats: { hp: 70, atk: 95, def: 85, spa: 55, spd: 65, spe: 70 }, }, castform: { inherit: true, @@ -134,7 +134,7 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, chimecho: { inherit: true, - baseStats: {hp: 65, atk: 50, def: 70, spa: 95, spd: 80, spe: 65}, + baseStats: { hp: 65, atk: 50, def: 70, spa: 95, spd: 80, spe: 65 }, }, latiasmega: { inherit: true, @@ -255,19 +255,19 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, roggenrola: { inherit: true, - abilities: {0: "Sturdy", H: "Sand Force"}, + abilities: { 0: "Sturdy", H: "Sand Force" }, }, boldore: { inherit: true, - abilities: {0: "Sturdy", H: "Sand Force"}, + abilities: { 0: "Sturdy", H: "Sand Force" }, }, gigalith: { inherit: true, - abilities: {0: "Sturdy", H: "Sand Force"}, + abilities: { 0: "Sturdy", H: "Sand Force" }, }, woobat: { inherit: true, - baseStats: {hp: 55, atk: 45, def: 43, spa: 55, spd: 43, spe: 72}, + baseStats: { hp: 55, atk: 45, def: 43, spa: 55, spd: 43, spe: 72 }, }, audinomega: { inherit: true, @@ -279,19 +279,19 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, crustle: { inherit: true, - baseStats: {hp: 70, atk: 95, def: 125, spa: 65, spd: 75, spe: 45}, + baseStats: { hp: 70, atk: 95, def: 125, spa: 65, spd: 75, spe: 45 }, }, vanillite: { inherit: true, - abilities: {0: "Ice Body", H: "Weak Armor"}, + abilities: { 0: "Ice Body", H: "Weak Armor" }, }, vanillish: { inherit: true, - abilities: {0: "Ice Body", H: "Weak Armor"}, + abilities: { 0: "Ice Body", H: "Weak Armor" }, }, vanilluxe: { inherit: true, - abilities: {0: "Ice Body", H: "Weak Armor"}, + abilities: { 0: "Ice Body", H: "Weak Armor" }, }, deerling: { inherit: true, @@ -299,20 +299,20 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, cubchoo: { inherit: true, - abilities: {0: "Snow Cloak", H: "Rattled"}, + abilities: { 0: "Snow Cloak", H: "Rattled" }, }, beartic: { inherit: true, - baseStats: {hp: 95, atk: 110, def: 80, spa: 70, spd: 80, spe: 50}, - abilities: {0: "Snow Cloak", H: "Swift Swim"}, + baseStats: { hp: 95, atk: 110, def: 80, spa: 70, spd: 80, spe: 50 }, + abilities: { 0: "Snow Cloak", H: "Swift Swim" }, }, cryogonal: { inherit: true, - baseStats: {hp: 70, atk: 50, def: 30, spa: 95, spd: 135, spe: 105}, + baseStats: { hp: 70, atk: 50, def: 30, spa: 95, spd: 135, spe: 105 }, }, greninja: { inherit: true, - abilities: {0: "Torrent", H: "Protean"}, + abilities: { 0: "Torrent", H: "Protean" }, }, vivillon: { inherit: true, @@ -324,66 +324,66 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, zygarde: { inherit: true, - abilities: {0: "Aura Break"}, + abilities: { 0: "Aura Break" }, }, necturna: { inherit: true, - baseStats: {hp: 64, atk: 120, def: 100, spa: 85, spd: 120, spe: 81}, + baseStats: { hp: 64, atk: 120, def: 100, spa: 85, spd: 120, spe: 81 }, }, malaconda: { inherit: true, - abilities: {0: "Harvest", 1: "Infiltrator"}, + abilities: { 0: "Harvest", 1: "Infiltrator" }, }, naviathan: { inherit: true, - abilities: {0: "Water Veil", 1: "Heatproof", H: "Light Metal"}, + abilities: { 0: "Water Veil", 1: "Heatproof", H: "Light Metal" }, }, crucibellemega: { inherit: true, - baseStats: {hp: 106, atk: 135, def: 75, spa: 85, spd: 125, spe: 114}, + baseStats: { hp: 106, atk: 135, def: 75, spa: 85, spd: 125, spe: 114 }, }, syclant: { inherit: true, - abilities: {0: "Compound Eyes", 1: "Mountaineer"}, + abilities: { 0: "Compound Eyes", 1: "Mountaineer" }, }, revenankh: { inherit: true, - abilities: {0: "Air Lock", H: "Shed Skin"}, + abilities: { 0: "Air Lock", H: "Shed Skin" }, }, pyroak: { inherit: true, - abilities: {0: "Rock Head", 1: "Battle Armor"}, + abilities: { 0: "Rock Head", 1: "Battle Armor" }, }, fidgit: { inherit: true, - abilities: {0: "Persistent", 1: "Vital Spirit"}, + abilities: { 0: "Persistent", 1: "Vital Spirit" }, }, stratagem: { inherit: true, - abilities: {0: "Levitate", 1: "Technician"}, + abilities: { 0: "Levitate", 1: "Technician" }, }, arghonaut: { inherit: true, - abilities: {0: "Unaware"}, + abilities: { 0: "Unaware" }, }, kitsunoh: { inherit: true, - abilities: {0: "Frisk", 1: "Limber"}, + abilities: { 0: "Frisk", 1: "Limber" }, }, cyclohm: { inherit: true, - abilities: {0: "Shield Dust", 1: "Static"}, + abilities: { 0: "Shield Dust", 1: "Static" }, }, colossoil: { inherit: true, - abilities: {0: "Rebound", 1: "Guts"}, + abilities: { 0: "Rebound", 1: "Guts" }, }, krilowatt: { inherit: true, - abilities: {0: "Trace", 1: "Magic Guard"}, + abilities: { 0: "Trace", 1: "Magic Guard" }, }, voodoom: { inherit: true, - abilities: {0: "Volt Absorb", 1: "Lightning Rod"}, + abilities: { 0: "Volt Absorb", 1: "Lightning Rod" }, }, }; diff --git a/data/mods/gen7/abilities.ts b/data/mods/gen7/abilities.ts index 6d57c8da20..58de4aeae9 100644 --- a/data/mods/gen7/abilities.ts +++ b/data/mods/gen7/abilities.ts @@ -24,11 +24,11 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa }, darkaura: { inherit: true, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, fairyaura: { inherit: true, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, innerfocus: { inherit: true, @@ -73,7 +73,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa rattled: { onDamagingHit(damage, target, source, move) { if (['Dark', 'Bug', 'Ghost'].includes(move.type)) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); } }, name: "Rattled", diff --git a/data/mods/gen7/moves.ts b/data/mods/gen7/moves.ts index 18d0c1e60b..2ddb18802c 100644 --- a/data/mods/gen7/moves.ts +++ b/data/mods/gen7/moves.ts @@ -126,7 +126,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, onHit(target, source, move) { let success = false; - if (!target.volatiles['substitute'] || move.infiltrates) success = !!this.boost({evasion: -1}); + if (!target.volatiles['substitute'] || move.infiltrates) success = !!this.boost({ evasion: -1 }); const removeTarget = [ 'reflect', 'lightscreen', 'auroraveil', 'safeguard', 'mist', 'spikes', 'toxicspikes', 'stealthrock', 'stickyweb', ]; @@ -134,13 +134,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { for (const targetCondition of removeTarget) { if (target.side.removeSideCondition(targetCondition)) { if (!removeAll.includes(targetCondition)) continue; - this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Defog', '[of] ' + source); + this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Defog', `[of] ${source}`); success = true; } } for (const sideCondition of removeAll) { if (source.side.removeSideCondition(sideCondition)) { - this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Defog', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Defog', `[of] ${source}`); success = true; } } @@ -171,7 +171,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, dragonhammer: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, }, dragonrage: { inherit: true, @@ -214,7 +214,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(field, source, effect) { if (effect && effect.effectType === 'Ability') { - this.add('-fieldstart', 'move: Electric Terrain', '[from] ability: ' + effect, '[of] ' + source); + this.add('-fieldstart', 'move: Electric Terrain', `[from] ability: ${effect}`, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Electric Terrain'); } @@ -337,7 +337,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(field, source, effect) { if (effect && effect.effectType === 'Ability') { - this.add('-fieldstart', 'move: Grassy Terrain', '[from] ability: ' + effect, '[of] ' + source); + this.add('-fieldstart', 'move: Grassy Terrain', `[from] ability: ${effect}`, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Grassy Terrain'); } @@ -506,7 +506,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, howl: { inherit: true, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { atk: 1, }, @@ -578,13 +578,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } } if (this.checkMoveMakesContact(move, source, target)) { - this.boost({atk: -2}, source, target, this.dex.getActiveMove("King's Shield")); + this.boost({ atk: -2 }, source, target, this.dex.getActiveMove("King's Shield")); } return this.NOT_FAIL; }, onHit(target, source, move) { if (move.isZOrMaxPowered && this.checkMoveMakesContact(move, source, target)) { - this.boost({atk: -2}, source, target, this.dex.getActiveMove("King's Shield")); + this.boost({ atk: -2 }, source, target, this.dex.getActiveMove("King's Shield")); } }, }, @@ -665,7 +665,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, moongeistbeam: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, moonlight: { inherit: true, @@ -733,7 +733,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, naturesmadness: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, }, needlearm: { inherit: true, @@ -761,7 +761,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, pollenpuff: { inherit: true, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, onHit(target, source) { if (source.isAlly(target)) { if (!this.heal(Math.floor(target.baseMaxhp * 0.5))) { @@ -813,7 +813,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(field, source, effect) { if (effect && effect.effectType === 'Ability') { - this.add('-fieldstart', 'move: Psychic Terrain', '[from] ability: ' + effect, '[of] ' + source); + this.add('-fieldstart', 'move: Psychic Terrain', `[from] ability: ${effect}`, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Psychic Terrain'); } @@ -1037,7 +1037,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, sunsteelstrike: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, }, supersonicskystrike: { inherit: true, @@ -1072,7 +1072,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (myItem) source.item = myItem.id; return false; } - this.add('-activate', source, 'move: Trick', '[of] ' + target); + this.add('-activate', source, 'move: Trick', `[of] ${target}`); if (myItem) { target.setItem(myItem); this.add('-item', target, myItem, '[from] move: Switcheroo'); @@ -1172,7 +1172,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (myItem) source.item = myItem.id; return false; } - this.add('-activate', source, 'move: Trick', '[of] ' + target); + this.add('-activate', source, 'move: Trick', `[of] ${target}`); if (myItem) { target.setItem(myItem); this.add('-item', target, myItem, '[from] move: Trick'); diff --git a/data/mods/gen7/pokedex.ts b/data/mods/gen7/pokedex.ts index b4662fc1b2..6f8c4bbbeb 100644 --- a/data/mods/gen7/pokedex.ts +++ b/data/mods/gen7/pokedex.ts @@ -1,39 +1,39 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable = { pikachuoriginal: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, pikachuhoenn: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, pikachusinnoh: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, pikachuunova: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, pikachukalos: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, pikachualola: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, pikachupartner: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, koffing: { inherit: true, - abilities: {0: "Levitate"}, + abilities: { 0: "Levitate" }, }, weezing: { inherit: true, - abilities: {0: "Levitate"}, + abilities: { 0: "Levitate" }, }, ralts: { inherit: true, @@ -80,32 +80,32 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, heatran: { inherit: true, - abilities: {0: "Flash Fire", H: "Flame Body"}, + abilities: { 0: "Flash Fire", H: "Flame Body" }, unreleasedHidden: true, }, aegislash: { inherit: true, - baseStats: {hp: 60, atk: 50, def: 150, spa: 50, spd: 150, spe: 60}, + baseStats: { hp: 60, atk: 50, def: 150, spa: 50, spd: 150, spe: 60 }, }, aegislashblade: { inherit: true, - baseStats: {hp: 60, atk: 150, def: 50, spa: 150, spd: 50, spe: 60}, + baseStats: { hp: 60, atk: 150, def: 50, spa: 150, spd: 50, spe: 60 }, }, pumpkaboosmall: { inherit: true, - abilities: {0: "Pickup", 1: "Frisk"}, + abilities: { 0: "Pickup", 1: "Frisk" }, }, pumpkaboolarge: { inherit: true, - abilities: {0: "Pickup", 1: "Frisk"}, + abilities: { 0: "Pickup", 1: "Frisk" }, }, gourgeistsmall: { inherit: true, - abilities: {0: "Pickup", 1: "Frisk"}, + abilities: { 0: "Pickup", 1: "Frisk" }, }, gourgeistlarge: { inherit: true, - abilities: {0: "Pickup", 1: "Frisk"}, + abilities: { 0: "Pickup", 1: "Frisk" }, }, hawlucha: { inherit: true, @@ -147,28 +147,28 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, tapukoko: { inherit: true, - abilities: {0: "Electric Surge"}, + abilities: { 0: "Electric Surge" }, }, tapulele: { inherit: true, - abilities: {0: "Psychic Surge"}, + abilities: { 0: "Psychic Surge" }, }, tapubulu: { inherit: true, - abilities: {0: "Grassy Surge"}, + abilities: { 0: "Grassy Surge" }, }, tapufini: { inherit: true, - abilities: {0: "Misty Surge"}, + abilities: { 0: "Misty Surge" }, }, pyroak: { inherit: true, - baseStats: {hp: 120, atk: 70, def: 105, spa: 95, spd: 90, spe: 60}, - abilities: {0: "Rock Head", 1: "Battle Armor", H: "White Smoke"}, + baseStats: { hp: 120, atk: 70, def: 105, spa: 95, spd: 90, spe: 60 }, + abilities: { 0: "Rock Head", 1: "Battle Armor", H: "White Smoke" }, }, voodoom: { inherit: true, - baseStats: {hp: 90, atk: 85, def: 80, spa: 105, spd: 80, spe: 110}, + baseStats: { hp: 90, atk: 85, def: 80, spa: 105, spd: 80, spe: 110 }, }, mumbao: { inherit: true, diff --git a/data/mods/gen7letsgo/scripts.ts b/data/mods/gen7letsgo/scripts.ts index 0530d4d759..1dfd0e85c5 100644 --- a/data/mods/gen7letsgo/scripts.ts +++ b/data/mods/gen7letsgo/scripts.ts @@ -15,7 +15,7 @@ export const Scripts: ModdedBattleScriptsData = { init() { this.modData('Abilities', 'noability').isNonstandard = null; for (const i in this.data.Pokedex) { - this.modData('Pokedex', i).abilities = {0: 'No Ability'}; + this.modData('Pokedex', i).abilities = { 0: 'No Ability' }; delete this.modData('Pokedex', i).requiredItem; } }, @@ -62,7 +62,7 @@ export const Scripts: ModdedBattleScriptsData = { * Given a table of base stats and a pokemon set, return the actual stats. */ spreadModify(baseStats, set) { - const modStats: StatsTable = {hp: 10, atk: 10, def: 10, spa: 10, spd: 10, spe: 10}; + const modStats: StatsTable = { hp: 10, atk: 10, def: 10, spa: 10, spd: 10, spe: 10 }; let statName: StatID; for (statName in modStats) { const stat = baseStats[statName]; diff --git a/data/mods/gen7pokebilities/abilities.ts b/data/mods/gen7pokebilities/abilities.ts index 2c2a17f34b..a56b598724 100644 --- a/data/mods/gen7pokebilities/abilities.ts +++ b/data/mods/gen7pokebilities/abilities.ts @@ -10,7 +10,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (this.checkMoveMakesContact(move, source, target, !source.isAlly(target))) { const oldAbility = source.setAbility('mummy', target); if (oldAbility) { - this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, '[of] ' + source); + this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, `[of] ${source}`); } } } else { @@ -22,13 +22,13 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (abil === source.ability) { const oldAbility = source.setAbility('mummy', target); if (oldAbility) { - this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, '[of] ' + source); + this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, `[of] ${source}`); } } else { source.removeVolatile('ability:' + abil); source.addVolatile('ability:mummy', source); if (abil) { - this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(abil).name, '[of] ' + source); + this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(abil).name, `[of] ${source}`); } } } @@ -48,12 +48,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa .filter(val => !this.dex.abilities.get(val).flags['noreceiver'] && !additionalBannedAbilities.includes(val)); if (!possibleAbilities.length) return; const ability = this.dex.abilities.get(possibleAbilities[this.random(possibleAbilities.length)]); - this.add('-ability', pokemon, ability, '[from] ability: Power of Alchemy', '[of] ' + ally); + this.add('-ability', pokemon, ability, '[from] ability: Power of Alchemy', `[of] ${ally}`); if (isAbility) { pokemon.setAbility(ability); } else { pokemon.removeVolatile("ability:powerofalchemy"); - pokemon.addVolatile("ability:" + ability, pokemon); + pokemon.addVolatile(`ability:${ability}`, pokemon); } }, }, @@ -70,12 +70,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa .filter(val => !this.dex.abilities.get(val).flags['noreceiver'] && !additionalBannedAbilities.includes(val)); if (!possibleAbilities.length) return; const ability = this.dex.abilities.get(possibleAbilities[this.random(possibleAbilities.length)]); - this.add('-ability', pokemon, ability, '[from] ability: Receiver', '[of] ' + ally); + this.add('-ability', pokemon, ability, '[from] ability: Receiver', `[of] ${ally}`); if (isAbility) { pokemon.setAbility(ability); } else { pokemon.removeVolatile("ability:receiver"); - pokemon.addVolatile("ability:" + ability, pokemon); + pokemon.addVolatile(`ability:${ability}`, pokemon); } }, }, @@ -103,12 +103,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa continue; } const ability = this.dex.abilities.get(this.sample(possibleAbilities)); - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); if (isAbility) { pokemon.setAbility(ability); } else { pokemon.removeVolatile("ability:trace"); - pokemon.addVolatile("ability:" + ability, pokemon); + pokemon.addVolatile(`ability:${ability}`, pokemon); } return; } diff --git a/data/mods/gen8/abilities.ts b/data/mods/gen8/abilities.ts index 14767f4859..b5f22de9de 100644 --- a/data/mods/gen8/abilities.ts +++ b/data/mods/gen8/abilities.ts @@ -187,7 +187,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa } } if (statsLowered) { - this.boost({spa: 2}, target, target, null, false, true); + this.boost({ spa: 2 }, target, target, null, false, true); } }, rating: 2.5, @@ -235,7 +235,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa dauntlessshield: { inherit: true, onStart(pokemon) { - this.boost({def: 1}, pokemon); + this.boost({ def: 1 }, pokemon); }, rating: 3.5, }, @@ -264,7 +264,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa } } if (statsLowered) { - this.boost({atk: 2}, target, target, null, false, true); + this.boost({ atk: 2 }, target, target, null, false, true); } }, rating: 2.5, @@ -407,7 +407,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa }, gulpmissile: { inherit: true, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1 }, rating: 2.5, }, guts: { @@ -517,7 +517,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa intrepidsword: { inherit: true, onStart(pokemon) { - this.boost({atk: 1}, pokemon); + this.boost({ atk: 1 }, pokemon); }, rating: 4, }, @@ -1198,7 +1198,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa }, wonderguard: { inherit: true, - flags: {failroleplay: 1, noreceiver: 1, failskillswap: 1, breakable: 1}, + flags: { failroleplay: 1, noreceiver: 1, failskillswap: 1, breakable: 1 }, rating: 5, }, wonderskin: { diff --git a/data/mods/gen8/moves.ts b/data/mods/gen8/moves.ts index c75c911025..b7bf08fa4f 100644 --- a/data/mods/gen8/moves.ts +++ b/data/mods/gen8/moves.ts @@ -14,7 +14,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, assist: { inherit: true, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, auroraveil: { inherit: true, @@ -32,7 +32,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, belch: { inherit: true, - flags: {protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, blizzard: { inherit: true, @@ -54,7 +54,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, celebrate: { inherit: true, - flags: {nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, charge: { inherit: true, @@ -96,7 +96,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, copycat: { inherit: true, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, coreenforcer: { inherit: true, @@ -114,7 +114,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, onModifyMove(move, source, target) { if (!source.hasType('Ghost')) { - move.target = move.nonGhostTarget as MoveTarget; + move.target = move.nonGhostTarget!; } }, target: "randomNormal", @@ -126,7 +126,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { darkvoid: { inherit: true, isNonstandard: "Past", - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, }, doubleironbash: { inherit: true, @@ -134,7 +134,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, dragonhammer: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, }, dualchop: { inherit: true, @@ -146,7 +146,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, eternabeam: { inherit: true, - flags: {recharge: 1, protect: 1, mirror: 1, failinstruct: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, failinstruct: 1 }, isNonstandard: null, }, fishiousrend: { @@ -184,7 +184,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, futuresight: { inherit: true, - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, }, geargrind: { inherit: true, @@ -229,12 +229,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { holdhands: { inherit: true, isNonstandard: null, - flags: {bypasssub: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { bypasssub: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, hyperspacefury: { inherit: true, isNonstandard: "Past", - flags: {mirror: 1, bypasssub: 1}, + flags: { mirror: 1, bypasssub: 1 }, }, hyperspacehole: { inherit: true, @@ -372,7 +372,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, metronome: { inherit: true, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, milkdrink: { inherit: true, @@ -388,11 +388,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, mirrorcoat: { inherit: true, - flags: {protect: 1, failmefirst: 1, noassist: 1, failcopycat: 1}, + flags: { protect: 1, failmefirst: 1, noassist: 1, failcopycat: 1 }, }, mirrormove: { inherit: true, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, mistball: { inherit: true, @@ -405,7 +405,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { naturepower: { inherit: true, isNonstandard: null, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, naturesmadness: { inherit: true, @@ -509,7 +509,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, sleeptalk: { inherit: true, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, }, snaptrap: { inherit: true, @@ -532,7 +532,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onSwitchIn(pokemon) { if (!pokemon.isGrounded() || pokemon.hasItem('heavydutyboots')) return; this.add('-activate', pokemon, 'move: Sticky Web'); - this.boost({spe: -1}, pokemon, this.effectState.source, this.dex.getActiveMove('stickyweb')); + this.boost({ spe: -1 }, pokemon, this.effectState.source, this.dex.getActiveMove('stickyweb')); }, }, }, diff --git a/data/mods/gen8/pokedex.ts b/data/mods/gen8/pokedex.ts index 40bfb40478..4b0acb59d8 100644 --- a/data/mods/gen8/pokedex.ts +++ b/data/mods/gen8/pokedex.ts @@ -1,39 +1,39 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable = { growlithehisui: { inherit: true, - abilities: {0: "Intimidate", 1: "Flash Fire", H: "Justified"}, + abilities: { 0: "Intimidate", 1: "Flash Fire", H: "Justified" }, }, arcaninehisui: { inherit: true, - abilities: {0: "Intimidate", 1: "Flash Fire", H: "Justified"}, + abilities: { 0: "Intimidate", 1: "Flash Fire", H: "Justified" }, }, typhlosionhisui: { inherit: true, - abilities: {0: "Blaze", H: "Flash Fire"}, + abilities: { 0: "Blaze", H: "Flash Fire" }, }, sneaselhisui: { inherit: true, - abilities: {0: "Inner Focus", 1: "Keen Eye", H: "Poison Touch"}, + abilities: { 0: "Inner Focus", 1: "Keen Eye", H: "Poison Touch" }, }, shiftry: { inherit: true, - abilities: {0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket"}, + abilities: { 0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket" }, }, piplup: { inherit: true, - abilities: {0: "Torrent", H: "Defiant"}, + abilities: { 0: "Torrent", H: "Defiant" }, }, prinplup: { inherit: true, - abilities: {0: "Torrent", H: "Defiant"}, + abilities: { 0: "Torrent", H: "Defiant" }, }, empoleon: { inherit: true, - abilities: {0: "Torrent", H: "Defiant"}, + abilities: { 0: "Torrent", H: "Defiant" }, }, gallade: { inherit: true, - abilities: {0: "Steadfast", H: "Justified"}, + abilities: { 0: "Steadfast", H: "Justified" }, }, giratinaorigin: { inherit: true, @@ -41,15 +41,15 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, cresselia: { inherit: true, - baseStats: {hp: 120, atk: 70, def: 120, spa: 75, spd: 130, spe: 85}, + baseStats: { hp: 120, atk: 70, def: 120, spa: 75, spd: 130, spe: 85 }, }, samurotthisui: { inherit: true, - abilities: {0: "Torrent", H: "Shell Armor"}, + abilities: { 0: "Torrent", H: "Shell Armor" }, }, braviaryhisui: { inherit: true, - abilities: {0: "Keen Eye", 1: "Sheer Force", H: "Defiant"}, + abilities: { 0: "Keen Eye", 1: "Sheer Force", H: "Defiant" }, }, spewpa: { inherit: true, @@ -57,68 +57,68 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable }, vivillonfancy: { inherit: true, - abilities: {0: "Shield Dust", 1: "Compound Eyes"}, + abilities: { 0: "Shield Dust", 1: "Compound Eyes" }, prevo: undefined, evoLevel: undefined, }, vivillonpokeball: { inherit: true, - abilities: {0: "Shield Dust", 1: "Compound Eyes"}, + abilities: { 0: "Shield Dust", 1: "Compound Eyes" }, }, sliggoohisui: { inherit: true, - abilities: {0: "Sap Sipper", 1: "Overcoat", H: "Gooey"}, + abilities: { 0: "Sap Sipper", 1: "Overcoat", H: "Gooey" }, }, goodrahisui: { inherit: true, - abilities: {0: "Sap Sipper", 1: "Overcoat", H: "Gooey"}, + abilities: { 0: "Sap Sipper", 1: "Overcoat", H: "Gooey" }, }, decidueyehisui: { inherit: true, - abilities: {0: "Overgrow", H: "Long Reach"}, + abilities: { 0: "Overgrow", H: "Long Reach" }, }, zacian: { inherit: true, - baseStats: {hp: 92, atk: 130, def: 115, spa: 80, spd: 115, spe: 138}, + baseStats: { hp: 92, atk: 130, def: 115, spa: 80, spd: 115, spe: 138 }, }, zaciancrowned: { inherit: true, - baseStats: {hp: 92, atk: 170, def: 115, spa: 80, spd: 115, spe: 148}, + baseStats: { hp: 92, atk: 170, def: 115, spa: 80, spd: 115, spe: 148 }, }, zamazenta: { inherit: true, - baseStats: {hp: 92, atk: 130, def: 115, spa: 80, spd: 115, spe: 138}, + baseStats: { hp: 92, atk: 130, def: 115, spa: 80, spd: 115, spe: 138 }, }, zamazentacrowned: { inherit: true, - baseStats: {hp: 92, atk: 130, def: 145, spa: 80, spd: 145, spe: 128}, + baseStats: { hp: 92, atk: 130, def: 145, spa: 80, spd: 145, spe: 128 }, }, kleavor: { inherit: true, - abilities: {0: "Swarm", 1: "Sheer Force", H: "Steadfast"}, + abilities: { 0: "Swarm", 1: "Sheer Force", H: "Steadfast" }, }, basculegion: { inherit: true, - abilities: {0: "Rattled", 1: "Adaptability", H: "Mold Breaker"}, + abilities: { 0: "Rattled", 1: "Adaptability", H: "Mold Breaker" }, }, basculegionf: { inherit: true, - abilities: {0: "Rattled", 1: "Adaptability", H: "Mold Breaker"}, + abilities: { 0: "Rattled", 1: "Adaptability", H: "Mold Breaker" }, }, sneasler: { inherit: true, - abilities: {0: "Pressure", H: "Poison Touch"}, + abilities: { 0: "Pressure", H: "Poison Touch" }, evoType: "useItem", evoItem: "Razor Claw", evoCondition: "during the day", }, enamorus: { inherit: true, - abilities: {0: "Healer", H: "Contrary"}, + abilities: { 0: "Healer", H: "Contrary" }, }, kitsunoh: { inherit: true, - baseStats: {hp: 80, atk: 103, def: 85, spa: 55, spd: 80, spe: 110}, - abilities: {0: "Frisk", 1: "Limber", H: "Iron Fist"}, + baseStats: { hp: 80, atk: 103, def: 85, spa: 55, spd: 80, spe: 110 }, + abilities: { 0: "Frisk", 1: "Limber", H: "Iron Fist" }, }, }; diff --git a/data/mods/gen8/rulesets.ts b/data/mods/gen8/rulesets.ts index 58b0abca1f..26a14f6859 100644 --- a/data/mods/gen8/rulesets.ts +++ b/data/mods/gen8/rulesets.ts @@ -35,7 +35,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable desc: `Pokémon below OU get their stats, excluding HP, boosted. UU/RUBL get +10, RU/NUBL get +20, NU/PUBL get +30, and PU or lower get +40.`, onModifySpecies(species, target, source, effect) { if (!species.baseStats) return; - const boosts: {[tier: string]: number} = { + const boosts: { [tier: string]: number } = { uu: 10, rubl: 10, ru: 20, @@ -79,7 +79,7 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable const typesSet = new Set(species.types); const bonusType = this.dex.types.get(target.set.name); if (bonusType.exists) typesSet.add(bonusType.name); - return {...species, types: [...typesSet]}; + return { ...species, types: [...typesSet] }; }, }, godlygiftmod: { diff --git a/data/mods/gen8bdsp/moves.ts b/data/mods/gen8bdsp/moves.ts index 70ac8215ff..652300f589 100644 --- a/data/mods/gen8bdsp/moves.ts +++ b/data/mods/gen8bdsp/moves.ts @@ -125,7 +125,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, dragonhammer: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, }, drumbeating: { inherit: true, diff --git a/data/mods/gen8linked/moves.ts b/data/mods/gen8linked/moves.ts index 0a2265dfde..4cf9d26437 100644 --- a/data/mods/gen8linked/moves.ts +++ b/data/mods/gen8linked/moves.ts @@ -2,7 +2,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { pursuit: { inherit: true, beforeTurnCallback(pokemon, target) { - // @ts-ignore + // @ts-expect-error modded const linkedMoves: [string, string] = pokemon.getLinkedMoves(); if (linkedMoves.length) { if (linkedMoves[0] !== 'pursuit' && linkedMoves[1] === 'pursuit') return; @@ -21,11 +21,11 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const action = this.queue.willMove(target); if (action) { // Mod-specific: Me First copies the first move in the link - // @ts-ignore + // @ts-expect-error modded const move = this.dex.getActiveMove(action.linked?.[0] || action.move); if (move.category !== 'Status' && !move.flags['failmefirst']) { pokemon.addVolatile('mefirst'); - this.actions.useMove(move, pokemon, {target}); + this.actions.useMove(move, pokemon, { target }); return null; } } @@ -50,7 +50,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { this.add('-fail', source); return null; } - // @ts-ignore + // @ts-expect-error modded if (!action.linked) { if (action.move.category === 'Status' && action.move.id !== 'mefirst') { this.attrLastMove('[still]'); @@ -58,7 +58,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return null; } } else { - // @ts-ignore + // @ts-expect-error modded for (const linkedMove of action.linked) { if (linkedMove.category !== 'Status' || linkedMove.id === 'mefirst') return; } @@ -132,7 +132,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { ) { return false; } - this.add('-singleturn', target, 'move: Instruct', '[of] ' + source); + this.add('-singleturn', target, 'move: Instruct', `[of] ${source}`); this.actions.runMove(lastMove.id, target, target.lastMoveTargetLoc!); }, }, @@ -140,10 +140,10 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, onTryHit(target, pokemon) { const move: Move | ActiveMove | null = target.m.lastMoveAbsolute; - if (!move || !move.flags['mirror'] || move.isZ || move.isMax) { + if (!move?.flags['mirror'] || move.isZ || move.isMax) { return false; } - this.actions.useMove(move.id, pokemon, {target}); + this.actions.useMove(move.id, pokemon, { target }); return null; }, }, @@ -173,7 +173,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return false; } else { if (effect.id === 'cursedbody') { - this.add('-start', pokemon, 'Disable', moveSlot.move, '[from] ability: Cursed Body', '[of] ' + source); + this.add('-start', pokemon, 'Disable', moveSlot.move, '[from] ability: Cursed Body', `[of] ${source}`); } else { this.add('-start', pokemon, 'Disable', moveSlot.move); } @@ -213,7 +213,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { let lastMove: Move | ActiveMove | null = target.m.lastMoveAbsolute; if (!lastMove || target.volatiles['dynamax']) return false; if ((lastMove as ActiveMove).isZOrMaxPowered) lastMove = this.dex.moves.get(lastMove.baseMove); - // @ts-ignore + // @ts-expect-error modded const linkedMoves: [string, string] = target.getLinkedMoves(true); const moveIndex = target.moves.indexOf(lastMove.id); if (linkedMoves.includes(lastMove.id) && this.dex.moves.get((linkedMoves[0])).flags['failencore'] && @@ -273,7 +273,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const index = target.moves.indexOf(lastMove.id); if (index === -1) return; // no last move - // @ts-ignore + // @ts-expect-error modded if (target.hasLinkedMove(lastMove.id)) { // TODO: Check instead whether the last executed move was linked if (target.moveSlots[0].pp <= 0 || target.moveSlots[1].pp <= 0) { diff --git a/data/mods/gen8linked/scripts.ts b/data/mods/gen8linked/scripts.ts index d83234099d..3970a194af 100644 --- a/data/mods/gen8linked/scripts.ts +++ b/data/mods/gen8linked/scripts.ts @@ -99,16 +99,16 @@ export const Scripts: ModdedBattleScriptsData = { if (!action.pokemon.isActive) return false; if (action.pokemon.fainted) return false; // Linked moves - // @ts-ignore + // @ts-expect-error modded if (action.linked) { - // @ts-ignore + // @ts-expect-error modded const linkedMoves: ActiveMove[] = action.linked; for (let i = linkedMoves.length - 1; i >= 0; i--) { const validTarget = this.validTargetLoc(action.targetLoc, action.pokemon, linkedMoves[i].target); const targetLoc = validTarget ? action.targetLoc : 0; const pseudoAction: Action = { choice: 'move', priority: action.priority, speed: action.speed, pokemon: action.pokemon, - targetLoc: targetLoc, moveid: linkedMoves[i].id, move: linkedMoves[i], mega: action.mega, + targetLoc, moveid: linkedMoves[i].id, move: linkedMoves[i], mega: action.mega, order: action.order, fractionalPriority: action.fractionalPriority, originalTarget: action.originalTarget, }; this.queue.unshift(pseudoAction); @@ -389,7 +389,7 @@ export const Scripts: ModdedBattleScriptsData = { this.battle.add('-zpower', pokemon); pokemon.side.zMoveUsed = true; } - const moveDidSomething = this.useMove(baseMove, pokemon, {target, sourceEffect, zMove, maxMove}); + const moveDidSomething = this.useMove(baseMove, pokemon, { target, sourceEffect, zMove, maxMove }); this.battle.lastSuccessfulMoveThisTurn = moveDidSomething ? this.battle.activeMove && this.battle.activeMove.id : null; if (this.battle.activeMove) move = this.battle.activeMove; this.battle.singleEvent('AfterMove', move, null, pokemon, target, move); @@ -416,7 +416,7 @@ export const Scripts: ModdedBattleScriptsData = { this.battle.add('-activate', dancer, 'ability: Dancer'); const dancersTarget = !target!.isAlly(dancer) && pokemon.isAlly(dancer) ? target! : pokemon; this.runMove(move.id, dancer, dancer.getLocOf(dancersTarget), - {sourceEffect: this.dex.abilities.get('dancer'), externalMove: true}); + { sourceEffect: this.dex.abilities.get('dancer'), externalMove: true }); } } if (noLock && pokemon.volatiles['lockedmove']) delete pokemon.volatiles['lockedmove']; @@ -433,7 +433,7 @@ export const Scripts: ModdedBattleScriptsData = { if (!action.side && action.pokemon) action.side = action.pokemon.side; if (!action.move && action.moveid) action.move = this.battle.dex.getActiveMove(action.moveid); if (!action.order) { - const orders: {[choice: string]: number} = { + const orders: { [choice: string]: number } = { team: 1, start: 2, instaswitch: 3, @@ -482,9 +482,11 @@ export const Scripts: ModdedBattleScriptsData = { } action.fractionalPriority = this.battle.runEvent('FractionalPriority', action.pokemon, null, action.move, 0); const linkedMoves: [string, string] = action.pokemon.getLinkedMoves(); - if (linkedMoves.length && - !(action.pokemon.getItem().isChoice || action.pokemon.hasAbility('gorillatactics')) && - !action.zmove && !action.maxMove) { + if ( + linkedMoves.length && + !(action.pokemon.getItem().isChoice || action.pokemon.hasAbility('gorillatactics')) && + !action.zmove && !action.maxMove + ) { const decisionMove = this.battle.toID(action.move); if (linkedMoves.includes(decisionMove)) { action.linked = linkedMoves.map(moveid => this.battle.dex.getActiveMove(moveid)); @@ -543,7 +545,7 @@ export const Scripts: ModdedBattleScriptsData = { return ret; }, hasLinkedMove(moveid) { - // @ts-ignore + // @ts-expect-error modded const linkedMoves: ID[] = this.getLinkedMoves(true); if (!linkedMoves.length) return false; return linkedMoves.some(x => x === moveid); diff --git a/data/mods/gen9dlc1/abilities.ts b/data/mods/gen9dlc1/abilities.ts index ad0c66018f..c1d4999a78 100644 --- a/data/mods/gen9dlc1/abilities.ts +++ b/data/mods/gen9dlc1/abilities.ts @@ -1,11 +1,11 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTable = { commander: { inherit: true, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, }, gulpmissile: { inherit: true, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1 }, }, protosynthesis: { inherit: true, @@ -63,7 +63,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa this.add('-end', pokemon, 'Protosynthesis'); }, }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1, cantsuppress: 1 }, }, quarkdrive: { inherit: true, @@ -112,6 +112,6 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa this.add('-end', pokemon, 'Quark Drive'); }, }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1, cantsuppress: 1 }, }, }; diff --git a/data/mods/gen9dlc1/moves.ts b/data/mods/gen9dlc1/moves.ts index 24dd9b9282..b562f6160a 100644 --- a/data/mods/gen9dlc1/moves.ts +++ b/data/mods/gen9dlc1/moves.ts @@ -1,7 +1,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { aeroblast: { inherit: true, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1 }, isNonstandard: "Past", }, alluringvoice: { @@ -14,7 +14,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, bitterblade: { inherit: true, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, }, blueflare: { inherit: true, @@ -42,7 +42,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, darkvoid: { inherit: true, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, }, decorate: { inherit: true, @@ -90,7 +90,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, hyperspacefury: { inherit: true, - flags: {mirror: 1, bypasssub: 1}, + flags: { mirror: 1, bypasssub: 1 }, }, iceburn: { inherit: true, @@ -107,7 +107,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, matchagotcha: { inherit: true, - flags: {protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, metronome: 1 }, }, mightycleave: { inherit: true, @@ -140,7 +140,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, revivalblessing: { inherit: true, - flags: {heal: 1}, + flags: { heal: 1 }, }, rockwrecker: { inherit: true, diff --git a/data/mods/gen9dlc1/pokedex.ts b/data/mods/gen9dlc1/pokedex.ts index 3df76f7db6..3c9465d5f8 100644 --- a/data/mods/gen9dlc1/pokedex.ts +++ b/data/mods/gen9dlc1/pokedex.ts @@ -1,8 +1,8 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable = { cresceidon: { inherit: true, - baseStats: {hp: 80, atk: 32, def: 111, spa: 88, spd: 99, spe: 125}, - abilities: {0: "Multiscale", 1: "Rough Skin"}, + baseStats: { hp: 80, atk: 32, def: 111, spa: 88, spd: 99, spe: 125 }, + abilities: { 0: "Multiscale", 1: "Rough Skin" }, eggGroups: ["Undiscovered"], }, }; diff --git a/data/mods/gen9predlc/abilities.ts b/data/mods/gen9predlc/abilities.ts index 47e904d8d6..9cc18a8ce4 100644 --- a/data/mods/gen9predlc/abilities.ts +++ b/data/mods/gen9predlc/abilities.ts @@ -1,15 +1,15 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTable = { commander: { inherit: true, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1 }, }, gulpmissile: { inherit: true, - flags: {cantsuppress: 1, notransform: 1}, + flags: { cantsuppress: 1, notransform: 1 }, }, hadronengine: { inherit: true, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1 }, }, illuminate: { inherit: true, @@ -24,7 +24,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa }, orichalcumpulse: { inherit: true, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1, notransform: 1 }, }, supersweetsyrup: { inherit: true, diff --git a/data/mods/gen9predlc/pokedex.ts b/data/mods/gen9predlc/pokedex.ts index 8d215ef7e7..9b6818352f 100644 --- a/data/mods/gen9predlc/pokedex.ts +++ b/data/mods/gen9predlc/pokedex.ts @@ -1,18 +1,18 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable = { shiftry: { inherit: true, - abilities: {0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket"}, + abilities: { 0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket" }, }, piplup: { inherit: true, - abilities: {0: "Torrent", H: "Defiant"}, + abilities: { 0: "Torrent", H: "Defiant" }, }, prinplup: { inherit: true, - abilities: {0: "Torrent", H: "Defiant"}, + abilities: { 0: "Torrent", H: "Defiant" }, }, empoleon: { inherit: true, - abilities: {0: "Torrent", H: "Defiant"}, + abilities: { 0: "Torrent", H: "Defiant" }, }, }; diff --git a/data/mods/gen9ssb/abilities.ts b/data/mods/gen9ssb/abilities.ts index f204cef348..d4cc2cc38f 100644 --- a/data/mods/gen9ssb/abilities.ts +++ b/data/mods/gen9ssb/abilities.ts @@ -1,5 +1,5 @@ -import {ssbSets} from "./random-teams"; -import {changeSet, getName, PSEUDO_WEATHERS} from "./scripts"; +import { ssbSets } from "./random-teams"; +import { changeSet, getName, PSEUDO_WEATHERS } from "./scripts"; const STRONG_WEATHERS = ['desolateland', 'primordialsea', 'deltastream', 'deserteddunes', 'millenniumcastle']; @@ -29,7 +29,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(1.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, gen: 9, }, @@ -71,7 +71,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify([powMod[this.effectState.fallen], 20]); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Akir @@ -116,7 +116,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onTryBoost(boost, target, source, effect) { if (effect.name === 'Intimidate' && boost.atk) { delete boost.atk; - this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Paw Prints', '[of] ' + target); + this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Paw Prints', `[of] ${target}`); } }, onModifyMove(move) { @@ -124,7 +124,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa move.ignoreAbility = true; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Alexander489 @@ -134,7 +134,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onBasePowerPriority: 30, onBasePower(basePower, attacker, defender, move) { const basePowerAfterMultiplier = this.modify(basePower, this.event.modifier); - this.debug('Base Power: ' + basePowerAfterMultiplier); + this.debug(`Base Power: ${basePowerAfterMultiplier}`); if (basePowerAfterMultiplier <= 60) { this.debug('Confirmed Town boost'); return this.chainModify(1.5); @@ -184,13 +184,13 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa name: "Served Cold", onTryHit(target, source, move) { if (target !== source && move.type === 'Ice') { - if (!this.boost({def: 2})) { + if (!this.boost({ def: 2 })) { this.add('-immune', target, '[from] ability: Served Cold'); } return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // aQrator @@ -263,7 +263,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa boosts['accuracy'] = 0; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, gen: 9, }, @@ -326,7 +326,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, gen: 9, }, @@ -360,7 +360,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa } } if (showMsg && !(effect as ActiveMove).secondaries && effect.id !== 'octolock') { - this.add("-fail", target, "unboost", "[from] ability: Supervised Learning", "[of] " + target); + this.add("-fail", target, "unboost", "[from] ability: Supervised Learning", `[of] ${target}`); } }, flags: {}, @@ -380,7 +380,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // ausma @@ -398,7 +398,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa this.heal(pokemon.maxhp / 3); if (this.field.pseudoWeather['trickroom']) { this.field.removePseudoWeather('trickroom'); - this.boost({spe: 2}, pokemon, pokemon, this.effect); + this.boost({ spe: 2 }, pokemon, pokemon, this.effect); } }, flags: {}, @@ -415,7 +415,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa move.accuracy = 40; const target = pokemon.foes()[0]; if (target && !target.fainted) { - this.actions.useMove(move, pokemon, {target, sourceEffect: effect}); + this.actions.useMove(move, pokemon, { target, sourceEffect: effect }); } } }, @@ -464,7 +464,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.75); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Breadey @@ -564,7 +564,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (target !== source && move.type === 'Fire') { if (target.setType('Water')) { this.add('-start', target, 'typechange', 'Water', '[from] ability: Melting Point'); - this.boost({spe: 2}, target, source, this.dex.abilities.get('meltingpoint')); + this.boost({ spe: 2 }, target, source, this.dex.abilities.get('meltingpoint')); } else { this.add('-immune', target, '[from] ability: Melting Point'); } @@ -617,11 +617,11 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const speciesid = pokemon.species.id === 'mimikyutotem' ? 'Mimikyu-Busted-Totem' : 'Mimikyu-Busted'; pokemon.formeChange(speciesid, this.effect, true); this.damage(pokemon.baseMaxhp / 8, pokemon, pokemon, this.dex.species.get(speciesid)); - this.boost({atk: 1, spe: 1}); + this.boost({ atk: 1, spe: 1 }); this.add(`c:|${getName('clerica')}|oop`); } }, - flags: {breakable: 1, failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { breakable: 1, failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, }, // Clouds @@ -651,7 +651,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return false; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Coolcodename @@ -666,7 +666,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Corthius @@ -762,7 +762,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa for (const ally of pokemon.side.pokemon) { if (!ally.hp || ally === pokemon) continue; if (ally.heal(this.modify(ally.baseMaxhp, pokemon.hp > pokemon.maxhp / 4 ? 0.05 : 0.1))) { - this.add('-heal', ally, ally.getHealth, '[from] ability: Coalescence', '[of] ' + pokemon); + this.add('-heal', ally, ally.getHealth, '[from] ability: Coalescence', `[of] ${pokemon}`); } } }, @@ -832,13 +832,13 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onTryHitPriority: 1, onTryHit(target, source, move) { if (target !== source && move.type === 'Ice') { - if (!this.boost({atk: 1})) { + if (!this.boost({ atk: 1 })) { this.add('-immune', target, '[from] ability: Snowballer'); } return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Fame @@ -873,14 +873,14 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onResidualOrder: 29, onResidual(pokemon) { if (!this.effectState.gamblingAddiction && pokemon.hp && pokemon.hp < pokemon.maxhp / 4) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); this.heal(pokemon.maxhp); const move = this.dex.moves.get('finalgambit'); const finalGambit = { move: move.name, id: move.id, - pp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, - maxpp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, + pp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, + maxpp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, target: move.target, disabled: false, used: false, @@ -959,7 +959,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa this.add( 'message', `${name} hacked into PS and looked at ${name === 'Hecate' ? 'her' : 'their'} opponent's sets. ` + - `${warnTarget.name}'s move ${warnMoveName} drew ${name === 'Hecate' ? 'her' : 'their'} eye.` + `${warnTarget.name}'s move ${warnMoveName} drew ${name === 'Hecate' ? 'her' : 'their'} eye.` ); this.add(`c:|${getName(name)}|Interesting. With that in mind, bring it!`); }, @@ -996,7 +996,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onTryHit(target, source, move) { // Storm Drain if (target !== source && move.type === 'Water') { - if (!this.boost({spa: 1})) { + if (!this.boost({ spa: 1 })) { this.add('-immune', target, '[from] ability: Hydrostatic Positivity'); } return null; @@ -1004,7 +1004,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa // Motor Drive if (target !== source && move.type === 'Electric') { - if (!this.boost({spe: 1})) { + if (!this.boost({ spe: 1 })) { this.add('-immune', target, '[from] ability: Hydrostatic Positivity'); } return null; @@ -1070,7 +1070,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (pokemon.baseSpecies.baseSpecies !== 'Kyurem' || pokemon.transformed || !pokemon.hp) return; changeSet(this, pokemon, ssbSets['Imperial']); }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, }, // in the hills @@ -1084,7 +1084,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Irpachuza @@ -1164,7 +1164,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa ]; for (const sideCondition of remove) { if (side.removeSideCondition(sideCondition)) { - this.add('-sideend', side, this.dex.conditions.get(sideCondition).name, '[from] ability: Anfield', '[of] ' + target); + this.add('-sideend', side, this.dex.conditions.get(sideCondition).name, '[from] ability: Anfield', `[of] ${target}`); } } } @@ -1213,7 +1213,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify([5120, 4096]); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, cantsuppress: 1 }, }, // kingbaruk @@ -1273,7 +1273,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Kry @@ -1307,7 +1307,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.75); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Lasen @@ -1321,12 +1321,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const displayText = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const targetCondition of Object.keys(target.sideConditions)) { if (target.removeSideCondition(targetCondition) && displayText.includes(targetCondition)) { - this.add('-sideend', target, this.dex.conditions.get(targetCondition).name, '[from] ability: Idealized World', '[of] ' + pokemon); + this.add('-sideend', target, this.dex.conditions.get(targetCondition).name, '[from] ability: Idealized World', `[of] ${pokemon}`); } } for (const sideCondition of Object.keys(pokemon.side.sideConditions)) { if (pokemon.side.removeSideCondition(sideCondition) && displayText.includes(sideCondition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(sideCondition).name, '[from] ability: Idealized World', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(sideCondition).name, '[from] ability: Idealized World', `[of] ${pokemon}`); } } this.field.clearTerrain(); @@ -1377,7 +1377,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa pokemon.maybeTrapped = true; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Lyna @@ -1398,7 +1398,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = false; - this.actions.useMove(newMove, target, {target: source}); + this.actions.useMove(newMove, target, { target: source }); return null; }, onAllyTryHitSide(target, source, move) { @@ -1408,13 +1408,13 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = false; - this.actions.useMove(newMove, this.effectState.target, {target: source}); + this.actions.useMove(newMove, this.effectState.target, { target: source }); return null; }, condition: { duration: 1, }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Maia @@ -1432,7 +1432,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa source.trySetStatus('brn', target); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Mathy @@ -1470,7 +1470,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa ]; for (const sideCondition of remove) { if (side.removeSideCondition(sideCondition)) { - this.add('-sideend', side, this.dex.conditions.get(sideCondition).name, '[from] ability: End Round', '[of] ' + pokemon); + this.add('-sideend', side, this.dex.conditions.get(sideCondition).name, '[from] ability: End Round', `[of] ${pokemon}`); } } } @@ -1505,10 +1505,10 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa } } mon.clearBoosts(); - this.add('-clearboost', mon, '[from] ability: End Round', '[of] ' + pokemon); + this.add('-clearboost', mon, '[from] ability: End Round', `[of] ${pokemon}`); } }, - flags: {cantsuppress: 1}, + flags: { cantsuppress: 1 }, }, // Meteordash @@ -1522,7 +1522,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onModifyDef(def) { return this.chainModify(2); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Mex @@ -1549,7 +1549,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onSourceHit(target, source, move) { if (move.flags['contact'] && move.category === 'Physical') { this.add('-activate', source, 'ability: The Rolling Spheal'); - this.boost({spe: 1}, source, source, move); + this.boost({ spe: 1 }, source, source, move); } }, condition: { @@ -1641,7 +1641,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Ney @@ -1697,9 +1697,9 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const sourceAbility = source.setAbility('drifting', target); if (!sourceAbility) return; if (target.isAlly(source)) { - this.add('-activate', target, 'Skill Swap', '', '', '[of] ' + source); + this.add('-activate', target, 'Skill Swap', '', '', `[of] ${source}`); } else { - this.add('-activate', target, 'ability: Drifting', this.dex.abilities.get(sourceAbility).name, 'Drifting', '[of] ' + source); + this.add('-activate', target, 'ability: Drifting', this.dex.abilities.get(sourceAbility).name, 'Drifting', `[of] ${source}`); } target.setAbility(sourceAbility); } @@ -1738,7 +1738,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa this.add(`c:|${getName('PartMan')}|That's it. Get ready to be rapid-fire hugged.`); target.clearBoosts(); this.add('-clearboost', target); - this.boost({atk: 1, def: -1, spa: 1, spd: -1, spe: 1}); + this.boost({ atk: 1, def: -1, spa: 1, spd: -1, spe: 1 }); const details = target.getUpdatedDetails(); target.details = details; this.add('replace', target, details); @@ -1750,9 +1750,9 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa }, onStart(pokemon) { if (!pokemon.set.shiny) { - this.boost({atk: -1, def: 1, spa: -1, spd: 1}); + this.boost({ atk: -1, def: 1, spa: -1, spd: 1 }); } else { - this.boost({atk: 1, def: -1, spa: 1, spd: -1, spe: 1}); + this.boost({ atk: 1, def: -1, spa: 1, spd: -1, spe: 1 }); } }, }, @@ -1890,7 +1890,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa shortDesc: "Boosts Sp. Atk by 2 and sets a 25% Wish upon switch-in.", name: "Anti-Pelau", onStart(target) { - this.boost({spa: 2}, target); + this.boost({ spa: 2 }, target); const wish = this.dex.getActiveMove('wish'); wish.condition = { duration: 2, @@ -2010,9 +2010,9 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa totalspd += target.getStat('spd', false, true); } if (totaldef && totaldef >= totalspd) { - this.boost({spa: 1}); + this.boost({ spa: 1 }); } else if (totalspd) { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } // n.b. only affects Hackmons @@ -2037,10 +2037,10 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const target = this.sample(possibleTargets); const ability = target.getAbility(); if (pokemon.setAbility(ability)) { - this.add('-ability', pokemon, ability, '[from] ability: Monke See Monke Do', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Monke See Monke Do', `[of] ${target}`); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1 }, }, // Rio Vidal @@ -2048,7 +2048,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa shortDesc: "Stamina + Normal-type moves get +1 priority.", name: "Built Different", onDamagingHit(damage, target, source, effect) { - this.boost({def: 1}); + this.boost({ def: 1 }); }, onModifyPriority(priority, pokemon, target, move) { if (move?.type === 'Normal') return priority + 1; @@ -2217,7 +2217,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // skies @@ -2250,7 +2250,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa shortDesc: "Every turn, raises a random stat by 1 stage if the foe has more raised stats.", name: "Adaptive Engineering", onResidual(source) { - if (source === undefined || source.foes() === undefined || source.foes()[0] === undefined) return; + if (source?.foes()?.[0] === undefined) return; if (source.positiveBoosts() < source.foes()[0].positiveBoosts()) { const stats: BoostID[] = []; let stat: BoostID; @@ -2262,7 +2262,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa } if (stats.length) { const randomStat = this.sample(stats); - this.boost({[randomStat]: 1}, source, source); + this.boost({ [randomStat]: 1 }, source, source); } } }, @@ -2311,7 +2311,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa }, onSourceAfterFaint(length, target, source, effect) { if (effect && effect.effectType === 'Move') { - this.boost({atk: -length}, source); + this.boost({ atk: -length }, source); } }, flags: {}, @@ -2338,7 +2338,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (target.lastMove && target.lastMove.id !== 'struggle') { if (move.id === target.lastMove.id) { this.attrLastMove('[still]'); - this.add('cant', target, 'ability: Overasked Clause', move, '[of] ' + source); + this.add('cant', target, 'ability: Overasked Clause', move, `[of] ${source}`); return false; } } @@ -2356,7 +2356,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa } }, onDamagingHit(damage, target, source, effect) { - this.boost({def: 1}); + this.boost({ def: 1 }); }, }, @@ -2406,7 +2406,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const dazzlingHolder = this.effectState.target; if ((source.isAlly(dazzlingHolder) || move.target === 'all') && move.priority > 0.1) { this.attrLastMove('[still]'); - this.add('cant', target, 'ability: Sand Sleuth', move, '[of] ' + source); + this.add('cant', target, 'ability: Sand Sleuth', move, `[of] ${source}`); return false; } } @@ -2427,7 +2427,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return false; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // TheJesucristoOsAma @@ -2529,7 +2529,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onModifyDef(def) { return this.chainModify(2); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // umuwo @@ -2566,7 +2566,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onTryHit(target, source, move) { if (target === source || move.category === 'Status') return; if (target.runEffectiveness(move) > 0) { - this.boost({def: 1, spd: 1}, target); + this.boost({ def: 1, spd: 1 }, target); } }, flags: {}, @@ -2610,7 +2610,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(1.3); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Vistar @@ -2630,7 +2630,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.5); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // vmnunes @@ -2688,7 +2688,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return this.chainModify(0.75); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // xy01 @@ -2705,7 +2705,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (target.volatiles['substitute']) { this.add('-immune', target); } else { - this.boost({atk: -1, spa: -1}, target, pokemon, null, true); + this.boost({ atk: -1, spa: -1 }, target, pokemon, null, true); } } }, @@ -2725,10 +2725,10 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa didSomething = !!this.heal(target.baseMaxhp / 4); break; case 1: - didSomething = !!this.boost({spa: 1}, target, target); + didSomething = !!this.boost({ spa: 1 }, target, target); break; case 2: - didSomething = !!this.boost({spe: 1}, target, target); + didSomething = !!this.boost({ spe: 1 }, target, target); break; case 3: if (!target.volatiles['charge']) { @@ -2747,7 +2747,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // yeet dab xd @@ -2911,7 +2911,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa target.setAbility(this.sample(abilities), target); this.add('-ability', target, target.getAbility().name); }, - flags: {notrace: 1}, + flags: { notrace: 1 }, }, // YveltalNL @@ -2929,7 +2929,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa this.add('-immune', target); } else { if (this.dex.species.get(pokemon.species).heightm > this.dex.species.get(target.species).heightm) { - this.boost({atk: -1, spa: -1}, target, pokemon, null, true); + this.boost({ atk: -1, spa: -1 }, target, pokemon, null, true); } } } @@ -2962,7 +2962,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa changeSet(this, pokemon, ssbSets['Zarel'], true); } }, - flags: {failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1}, + flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1, notransform: 1 }, }, // zoro @@ -2990,7 +2990,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa // Yes, this looks very patchwork-y. declaring new persistent global variables seems to be a no-go here // so i repurposed one which should likely not affect anything else - have tested with clerica/zoro on both sides // and their disguise/sturdy state is unaffected by modifying anything here. but let wg know if this breaks stuff. - flags: {breakable: 1}, + flags: { breakable: 1 }, }, // Modified abilities diff --git a/data/mods/gen9ssb/conditions.ts b/data/mods/gen9ssb/conditions.ts index 18357f0c95..41627e5730 100644 --- a/data/mods/gen9ssb/conditions.ts +++ b/data/mods/gen9ssb/conditions.ts @@ -1,8 +1,8 @@ -import {ssbSets} from "./random-teams"; -import {changeSet, getName, enemyStaff} from './scripts'; -import {ModdedConditionData} from "../../../sim/dex-conditions"; +import { ssbSets } from "./random-teams"; +import { changeSet, getName, enemyStaff } from './scripts'; +import type { ModdedConditionData } from "../../../sim/dex-conditions"; -export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: string}} = { +export const Conditions: { [id: IDEntry]: ModdedConditionData & { innateName?: string } } = { /* // Example: userid: { @@ -496,7 +496,7 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str shortDesc: "This Pokemon's Defense is raised 2 stages if hit by a Fire move; Fire immunity.", onTryHit(target, source, move) { if (!target.illusion && target !== source && move.type === 'Fire') { - if (!this.boost({def: 2})) { + if (!this.boost({ def: 2 })) { this.add('-immune', target, '[from] ability: Well-Baked Body'); } return null; @@ -619,7 +619,7 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str if (target.illusion) return; if (effect.name === 'Intimidate' && boost.atk) { delete boost.atk; - this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Oblivious', '[of] ' + target); + this.add('-fail', target, 'unboost', 'Attack', '[from] ability: Oblivious', `[of] ${target}`); } }, }, @@ -2667,7 +2667,7 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str if (pokemon.illusion) return; pokemon.abilityState.gluttony = true; this.add('-activate', pokemon, 'ability: Nutrient Boost'); - this.boost({def: 1, spd: 1}, pokemon); + this.boost({ def: 1, spd: 1 }, pokemon); }, onSwitchOut() { this.add(`c:|${getName('WarriorGallade')}|amidst this tactical retreat, you didn't think i forgot about the pokeradar, did you? you can bet that my return with even more questions will be __eventful__ :3`); @@ -3069,7 +3069,7 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str onFieldStart(battle, source, effect) { if (effect?.effectType === 'Ability') { if (this.gen <= 5) this.effectState.duration = 0; - this.add('-weather', 'StormSurge', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'StormSurge', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-weather', 'StormSurge'); } @@ -3107,7 +3107,7 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str } }, onFieldStart(field, source, effect) { - this.add('-weather', 'DesertedDunes', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-weather', 'DesertedDunes', '[from] ability: ' + effect.name, `[of] ${source}`); }, onFieldResidualOrder: 1, onFieldResidual() { @@ -3179,16 +3179,16 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str } if (effect.name === 'Cute Charm') { - this.add('-start', pokemon, 'Attract', '[from] ability: Cute Charm', '[of] ' + source); + this.add('-start', pokemon, 'Attract', '[from] ability: Cute Charm', `[of] ${source}`); } else if (effect.name === 'Destiny Knot') { - this.add('-start', pokemon, 'Attract', '[from] item: Destiny Knot', '[of] ' + source); + this.add('-start', pokemon, 'Attract', '[from] item: Destiny Knot', `[of] ${source}`); } else { this.add('-start', pokemon, 'Attract'); } }, onUpdate(pokemon) { if (this.effectState.source && !this.effectState.source.isActive && pokemon.volatiles['attract']) { - this.debug('Removing Attract volatile on ' + pokemon); + this.debug(`Removing Attract volatile on ${pokemon}`); pokemon.removeVolatile('attract'); } }, @@ -3329,13 +3329,13 @@ export const Conditions: {[id: IDEntry]: ModdedConditionData & {innateName?: str this.activeTarget = pokemon; const damage = this.actions.getConfusionDamage(pokemon, 40); if (typeof damage !== 'number') throw new Error("Confusion damage not dealt"); - const activeMove = {id: this.toID('confused'), effectType: 'Move', type: '???'}; + const activeMove = { id: this.toID('confused'), effectType: 'Move', type: '???' }; this.damage(damage, pokemon, pokemon, activeMove as ActiveMove); if (this.effectState.sourceEffect?.id === 'cringedadjoke') { for (const target of this.getAllActive()) { if (target === pokemon) continue; if (target.volatiles['cringedadjoke']) { - this.boost({atk: 1, def: 1}, target); + this.boost({ atk: 1, def: 1 }, target); } } } diff --git a/data/mods/gen9ssb/moves.ts b/data/mods/gen9ssb/moves.ts index ccd39a14ae..c54359263a 100644 --- a/data/mods/gen9ssb/moves.ts +++ b/data/mods/gen9ssb/moves.ts @@ -1,6 +1,6 @@ -import {ssbSets} from "./random-teams"; -import {PSEUDO_WEATHERS, changeSet, getName} from "./scripts"; -import {Teams} from '../../../sim/teams'; +import { ssbSets } from "./random-teams"; +import { PSEUDO_WEATHERS, changeSet, getName } from "./scripts"; +import { Teams } from '../../../sim/teams'; export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { /* @@ -52,7 +52,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -107,7 +107,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onHit(pokemon) { pokemon.trySetStatus('brn'); this.add('-anim', pokemon, 'Shift Gear', pokemon); - this.boost({spe: 2, atk: 1}); + this.boost({ spe: 2, atk: 1 }); }, secondary: null, target: "self", @@ -125,7 +125,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 5, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onPrepareHit(target, source, move) { this.add('-anim', source, 'Trick Room', target); this.add('-anim', source, 'Clangerous Soul', source); @@ -168,7 +168,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } const foe = source.foes()[0]; if (!foe) return; - const success = this.boost({atk: -1, spa: -1}, foe, source); + const success = this.boost({ atk: -1, spa: -1 }, foe, source); if (!success && !foe.hasAbility('mirrorarmor')) { delete move.selfSwitch; } @@ -203,7 +203,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Spicier Extract", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, powder: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -233,7 +233,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Scumhunt", pp: 10, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -283,7 +283,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 1, - flags: {protect: 1, reflectable: 1}, + flags: { protect: 1, reflectable: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -293,10 +293,10 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onHit(target, source, move) { if (this.randomChance(1, 2)) { target.addVolatile('confusion'); - this.boost({spa: 2, spd: 2}, source); + this.boost({ spa: 2, spd: 2 }, source); } else { source.addVolatile('confusion'); - this.boost({spa: -1, spd: -1}, source); + this.boost({ spa: -1, spd: -1 }, source); } }, secondary: null, @@ -321,7 +321,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onPrepareHit(target, source) { this.add('-anim', source, 'Recycle', target); }, - flags: {snatch: 1}, + flags: { snatch: 1 }, onHit(pokemon) { if (!pokemon.item && pokemon.lastItem) { const item = pokemon.lastItem; @@ -366,7 +366,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 5, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -425,7 +425,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return -6; } }, - flags: {failcopycat: 1}, + flags: { failcopycat: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -509,7 +509,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, failcopycat: 1}, + flags: { protect: 1, mirror: 1, failcopycat: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -559,7 +559,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -583,7 +583,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Automated Response", pp: 10, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -646,7 +646,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Anyone can be killed", pp: 10, priority: 0, - flags: {protect: 1, sound: 1, bypasssub: 1, mirror: 1}, + flags: { protect: 1, sound: 1, bypasssub: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -657,10 +657,10 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { duration: 3, onResidualOrder: 3, onStart(target, source, sourceEffect) { - this.boost({spa: 2}, source); + this.boost({ spa: 2 }, source); }, onEnd(target) { - this.boost({spa: -2}, target); + this.boost({ spa: -2 }, target); }, }, onPrepareHit(target, source) { @@ -681,7 +681,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -712,7 +712,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -723,7 +723,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { chance: 100, onHit(target, source, move) { if (source.volatiles['protosynthesis']) { - this.boost({def: 1}, source, source, move); + this.boost({ def: 1 }, source, source, move); } }, }, @@ -744,7 +744,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onModifyPriority(priority, source, target, move) { if (source.species.id === 'mismagius') return priority + 6; }, - flags: {snatch: 1, metronome: 1, protect: 1, failcopycat: 1}, + flags: { snatch: 1, metronome: 1, protect: 1, failcopycat: 1 }, priorityChargeCallback(pokemon) { if (pokemon.species.id === 'mismagius') return; pokemon.addVolatile('sigilsstorm'); @@ -835,7 +835,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else if (chance <= 70) { for (const condition of sideConditions) { if (source.side.removeSideCondition(condition)) { - this.add('-sideend', source.side, this.dex.conditions.get(condition).name, '[from] move: Sigil\'s Storm', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(condition).name, '[from] move: Sigil\'s Storm', `[of] ${source}`); } } } else if (chance <= 80) { @@ -862,7 +862,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Prep Time", pp: 5, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spa: 2, spe: 1, @@ -887,7 +887,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "yu-gi-oh reference", pp: 5, priority: -6, - flags: {protect: 1, bullet: 1}, + flags: { protect: 1, bullet: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -915,7 +915,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onModifyPriority(priority, pokemon, target) { if (!target) return; const move = this.queue.willMove(target)?.moveid; @@ -925,7 +925,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } }, onAfterMoveSecondarySelf(pokemon, target, move) { - if (!target || target.fainted || target.hp <= 0) this.boost({atk: 3}, pokemon, pokemon, move); + if (!target || target.fainted || target.hp <= 0) this.boost({ atk: 3 }, pokemon, pokemon, move); }, secondary: null, target: "normal", @@ -973,7 +973,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Shatter and Scatter", pp: 10, priority: 4, - flags: {failinstruct: 1, failcopycat: 1}, + flags: { failinstruct: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'shatterandscatter', onTry(source) { @@ -1023,7 +1023,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { let statDebuff = 'spe'; if (move.category === 'Special') statDebuff = 'spa'; if (move.category === 'Physical') statDebuff = 'atk'; - const success = this.boost({[statDebuff]: -2}, source, target, this.dex.getActiveMove("Shatter and Scatter")); + const success = this.boost({ [statDebuff]: -2 }, source, target, this.dex.getActiveMove("Shatter and Scatter")); if (success) { target.formeChange('Sableye', this.dex.getActiveMove('Shatter and Scatter'), true); target.canMegaEvo = 'Sableye-Mega'; @@ -1036,7 +1036,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { let statDebuff = 'spe'; if (move.category === 'Special') statDebuff = 'spa'; if (move.category === 'Physical') statDebuff = 'atk'; - const success = this.boost({[statDebuff]: -2}, source, target, this.dex.getActiveMove("Shatter and Scatter")); + const success = this.boost({ [statDebuff]: -2 }, source, target, this.dex.getActiveMove("Shatter and Scatter")); if (success) { target.formeChange('Sableye', this.dex.getActiveMove('Shatter and Scatter'), true); target.canMegaEvo = 'Sableye-Mega'; @@ -1061,7 +1061,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, bypasssub: 1, failcopycat: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, failcopycat: 1 }, onTry(source) { if (source.species.name === 'Cosmog') { return; @@ -1080,7 +1080,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { source.addVolatile('trapped', source, move, 'trapper'); source.addVolatile('perishsong'); this.add('-start', source, 'perish3', '[silent]'); - this.boost({atk: 1}, source, source, move); + this.boost({ atk: 1 }, source, source, move); this.add(`c:|${getName('Billo')}|This is a streamer mon, you're banned from the room.`); } else { changeSet(this, source, ssbSets['Billo-Lunala'], true); @@ -1102,7 +1102,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 3, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'veto', onPrepareHit(pokemon) { @@ -1162,7 +1162,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Steam Eruption'); }, @@ -1225,7 +1225,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 40, priority: 6, - flags: {protect: 1, mirror: 1, cantusetwice: 1, failcopycat: 1}, + flags: { protect: 1, mirror: 1, cantusetwice: 1, failcopycat: 1 }, onTry(source) { if (source.species.baseSpecies === 'Dunsparce') { return; @@ -1255,12 +1255,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { case 0: newMoves.push('hyperdrill', 'combattorque', 'extremespeed'); role = 'Fast Attacker'; - this.boost({atk: 2, spe: 4}); + this.boost({ atk: 2, spe: 4 }); break; case 1: newMoves.push('coil', 'bodyslam', 'healorder'); role = 'Bulky Setup'; - this.boost({atk: 1, def: 1, spd: 2}); + this.boost({ atk: 1, def: 1, spd: 2 }); break; case 2: const varMoves = ['Ceaseless Edge', 'Stone Axe', 'Mortal Spin', 'G-Max Steelsurge']; @@ -1268,12 +1268,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const move2 = this.sample(varMoves.filter(i => i !== move1)); newMoves.push('healorder', move1, move2); role = 'Bulky Support'; - this.boost({def: 2, spd: 2}); + this.boost({ def: 2, spd: 2 }); break; case 3: newMoves.push('bloodmoon', 'bloodmoon', 'bloodmoon'); role = 'Wallbreaker'; - this.boost({spa: 6}); + this.boost({ spa: 6 }); break; // removing moveslots becomes very messy so this was the next best thing } @@ -1311,7 +1311,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 5, priority: 0, - flags: {contact: 1, protect: 1}, + flags: { contact: 1, protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1349,7 +1349,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, gravity: 1}, + flags: { contact: 1, protect: 1, mirror: 1, gravity: 1 }, hasCrashDamage: true, onTryMove() { this.attrLastMove('[still]'); @@ -1376,7 +1376,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "The user restores 1/2 of its maximum HP, rounded half up. If the user is not currently under the effect of Magnet Rise, it gains the effect of Magnet Rise for 3 turns, causing it to be immune to all Ground-type moves except Thousand Arrows for the duration.", pp: 10, priority: 0, - flags: {snatch: 1, heal: 1, gravity: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, gravity: 1, metronome: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1418,7 +1418,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {protect: 1, contact: 1, mirror: 1}, + flags: { protect: 1, contact: 1, mirror: 1 }, multihit: [3, 7], self: { volatileStatus: 'summonmonsterviiifiendishmonstrouspiplupedecolossal', @@ -1472,7 +1472,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1499,7 +1499,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "(╯°o°)╯︵ ┻━┻", pp: 10, priority: 0, - flags: {protect: 1, failcopycat: 1, nosketch: 1}, + flags: { protect: 1, failcopycat: 1, nosketch: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1543,7 +1543,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Stockholm Syndrome", pp: 5, priority: 0, - flags: {bypasssub: 1}, + flags: { bypasssub: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1560,7 +1560,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } return target.addVolatile('trapped', source, move, 'trapper') || success; }, - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, secondary: null, target: "normal", type: "Ghost", @@ -1576,7 +1576,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Winds of Change", pp: 15, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, self: { sideCondition: 'tailwind', }, @@ -1614,7 +1614,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onHit(pokemon) { if (this.randomChance(7, 10)) { - this.boost({spa: 1, spe: 1}); + this.boost({ spa: 1, spe: 1 }); pokemon.addVolatile('focusenergy'); } else { pokemon.clearBoosts(); @@ -1637,7 +1637,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { pp: 10, priority: 0, multihit: [4, 5], - flags: {protect: 1, contact: 1}, + flags: { protect: 1, contact: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1664,7 +1664,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "This move's type cycles between Fire, Electric, and Ice depending on the current turn number, starting at Fire on turn 1, Electric on turn 2, Ice on turn 3, and repeating this pattern on future turns. For 5 turns, all Pokemon on the user's side of the field take 0.5x damage from physical attacks. This move fails if the user is Necrozma-Ultra.", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove(target, source, move) { switch (move.type) { case 'Fire': @@ -1711,7 +1711,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 5, priority: -7, - flags: {protect: 1, mirror: 1, bypasssub: 1, reflectable: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, reflectable: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1722,7 +1722,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onHit(target, source) { this.heal(source.maxhp / 4, source); - this.boost({atk: 2, spa: 2}); + this.boost({ atk: 2, spa: 2 }); target.addVolatile('taunt'); }, target: "normal", @@ -1747,7 +1747,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Trivial Pursuit", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Pursuit'); }, @@ -1815,7 +1815,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {reflectable: 1, mustpressure: 1}, + flags: { reflectable: 1, mustpressure: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1853,7 +1853,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Breath of Tiamat", pp: 20, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -1945,7 +1945,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Tea Party", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1}, + flags: { protect: 1, mirror: 1, heal: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2014,7 +2014,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Sustained Winds", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, wind: 1}, + flags: { protect: 1, mirror: 1, wind: 1 }, onPrepareHit() { this.attrLastMove('[anim] Bleakwind Storm'); }, @@ -2034,7 +2034,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Insert boar pun here", pp: 20, priority: 0, - flags: {protect: 1, contact: 1}, + flags: { protect: 1, contact: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2059,7 +2059,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Solidarity", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1}, + flags: { protect: 1, reflectable: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2097,7 +2097,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Rigged Dice", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1}, + flags: { protect: 1, reflectable: 1 }, selfSwitch: true, onTryMove() { this.attrLastMove('[still]'); @@ -2134,7 +2134,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Cringe Dad Joke", pp: 10, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2206,7 +2206,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Flat out falling", pp: 5, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2235,7 +2235,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2268,7 +2268,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Hasty Revolution", pp: 10, priority: 4, - flags: {protect: 1, mirror: 1, noassist: 1, failcopycat: 1}, + flags: { protect: 1, mirror: 1, noassist: 1, failcopycat: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2311,7 +2311,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Augur of Ebrietas", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Spirit Shackle'); }, @@ -2444,7 +2444,6 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { type: "Dark", }, - // HoeenHero reprogram: { accuracy: 100, @@ -2454,7 +2453,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Re-Program", pp: 10, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2470,7 +2469,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } if (source.addVolatile('lockon', target)) { this.add('-message', 'HoeenHero double checked their work and fixed any errors!'); - this.add('-activate', source, 'move: Lock-On', '[of] ' + target); + this.add('-activate', source, 'move: Lock-On', `[of] ${target}`); success = true; } if (success) { @@ -2491,7 +2490,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Wonder Wing", pp: 5, priority: 0, - flags: {contact: 1}, + flags: { contact: 1 }, // No negative contact effects implemented in Battle#checkMovesMakeContact onTryMove() { this.attrLastMove('[still]'); @@ -2538,7 +2537,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "If the user has not Terastallized, this move has a 70% chance to raise the user's Special Attack by 1 stage, has a 50% chance to paralyze the target, and combines the Water type in its type effectiveness. When the user has Terastallized, this move is a purely Water-type attack that gains Same-Type Attack Bonus with Water-types, and it has an 80% chance to raise the user's Special Attack by 1 stage, has a 60% chance to change the target's typing to Water, and is super effective against Water.", pp: 20, priority: 1, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onModifyMove(move, source, target) { if (source.terastallized) { move.type = 'Water'; @@ -2561,14 +2560,14 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { // None of these stack with Serene Grace if (!source.terastallized) { if (this.randomChance(70, 100)) { - this.boost({spa: 1}, source); + this.boost({ spa: 1 }, source); } if (this.randomChance(50, 100)) { if (target.isActive) target.trySetStatus('par', source, this.effect); } } else { if (this.randomChance(80, 100)) { - this.boost({spa: 1}, source); + this.boost({ spa: 1 }, source); } if (this.randomChance(60, 100)) { // Soak @@ -2593,7 +2592,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "This move becomes a physical attack that makes contact if the value of ((((2 * the user's level / 5 + 2) * 90 * X) / Y) / 50), where X is the user's Attack stat and Y is the target's Defense stat, is greater than the same value where X is the user's Special Attack stat and Y is the target's Special Defense stat. No stat modifiers other than stat stage changes are considered for this purpose. If the two values are equal, this move chooses a damage category at random.", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2628,7 +2627,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Hits three times. Power increases to 20 for the second hit and 40 for the third. The third hit is always a critical hit unless the target is under the effect of Lucky Chant or has the Battle Armor or Shell Armor Abilities. If this move deals damage, it applies the effect of Safeguard for 5 turns, protecting the user's team from confusion and non-volatile status conditions.", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, basePowerCallback(pokemon, target, move) { return [10, 20, 40][move.hit - 1]; }, @@ -2659,7 +2658,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Jirachi Ban Hammer", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Gigaton Hammer'); }, @@ -2684,7 +2683,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 1, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onPrepareHit(target, source) { this.attrLastMove('[anim] Doom Desire'); }, @@ -2710,7 +2709,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const unModdedDex = Dex.mod('base'); let depth = 0; while (!team.length) { - team = Teams.generate(randFormat, {name: target.side.name}); + team = Teams.generate(randFormat, { name: target.side.name }); if (depth >= 50) break; // Congrats you won the lottery! team = team.filter(p => { const baseSpecies = unModdedDex.species.get(p.species); @@ -2732,7 +2731,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { this.addMove('-anim', target, 'Wish', target); target.clearBoosts(); this.add('-clearboost', target); - // @ts-ignore set wants a sig but randbats sets don't have one + // @ts-expect-error set wants a sig but randbats sets don't have one changeSet(this, target, team[0], true); this.add(`c:|${getName((source.illusion || source).name)}|${msg}`); }, @@ -2751,7 +2750,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { shortDesc: "No additional effect.", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onPrepareHit(target, source) { this.attrLastMove('[anim] High Jump Kick'); }, @@ -2770,7 +2769,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Raises the user's Special Attack by 1 stage and Speed by 2 stages, and changes the weather to Snow, boosting the defense of Ice-types by 1.5x for 5 turns. Snow will not be set if the weather cannot be changed or if the weather is already Snow.", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spe: 2, spa: 1, @@ -2797,7 +2796,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { shortDesc: "Has 1/2 recoil.", desc: "If the target lost HP, the user takes recoil damage equal to 1/2 the HP lost by the target, rounded half up, but not less than 1 HP.", pp: 5, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [1, 2], secondary: null, priority: 0, @@ -2830,7 +2829,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "The user heals 1/4 of its maximum HP, then deals damage to the target equal to the user's current HP. If this attack is successful, the user faints.", pp: 5, priority: 0, - flags: {protect: 1, metronome: 1, noparentalbond: 1}, + flags: { protect: 1, metronome: 1, noparentalbond: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2849,7 +2848,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: ", (ac)", pp: 15, priority: 0, - flags: {reflectable: 1, mustpressure: 1}, + flags: { reflectable: 1, mustpressure: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -2933,12 +2932,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { for (const condition of sideConditions) { if (source.side.removeSideCondition(condition)) { success = true; - this.add('-sideend', source.side, this.dex.conditions.get(condition).name, '[from] move: , (ac)', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(condition).name, '[from] move: , (ac)', `[of] ${source}`); } } } else if (effect < 95) { const bestStat = target.getBestStat(true, true); - this.boost({[bestStat]: -1}, target); + this.boost({ [bestStat]: -1 }, target); success = true; } else { if (this.canSwitch(source.side)) { @@ -2963,7 +2962,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Stone Faced", pp: 15, priority: 0, - flags: {reflectable: 1, mustpressure: 1}, + flags: { reflectable: 1, mustpressure: 1 }, sideCondition: 'stealthrock', onPrepareHit(target, source) { this.attrLastMove('[anim] Scary Face'); @@ -2989,7 +2988,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {contact: 1, protect: 1}, + flags: { contact: 1, protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3022,7 +3021,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "For 6 turns, sets a field effect. Negates all weather conditions. Prevents Pokemon from falling asleep. Any status conditions and volatile status conditions applied to one Pokemon will also apply to all Pokemon on the field. Halves entry hazard damage.", pp: 5, priority: 0, - flags: {mirror: 1}, + flags: { mirror: 1 }, pseudoWeather: 'anfieldatmosphere', condition: { duration: 6, @@ -3040,9 +3039,9 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(target, source) { if (source?.hasAbility('persistent')) { - this.add('-fieldstart', 'move: Anfield Atmosphere', '[of] ' + source, '[persistent]'); + this.add('-fieldstart', 'move: Anfield Atmosphere', `[of] ${source}`, '[persistent]'); } else { - this.add('-fieldstart', 'move: Anfield Atmosphere', '[of] ' + source); + this.add('-fieldstart', 'move: Anfield Atmosphere', `[of] ${source}`); } for (const pokemon of this.getAllActive()) { if (pokemon.volatiles['confusion']) { @@ -3136,7 +3135,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Platinum Record", pp: 5, priority: 0, - flags: {sound: 1, heal: 1, protect: 1, mirror: 1}, + flags: { sound: 1, heal: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3177,7 +3176,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else { target.trySetStatus('brn', target); } - this.boost({spe: 1}, source); + this.boost({ spe: 1 }, source); }, onPrepareHit(target, source) { this.attrLastMove('[anim] Dark Void'); @@ -3197,7 +3196,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "The Better Water Shuriken", pp: 30, priority: 1, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, onTryMove() { @@ -3221,7 +3220,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "If this move is successful, the terrain becomes Electric Terrain.", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3258,7 +3257,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Attack of Opportunity", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3282,7 +3281,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { move.accuracy = true; move.onAfterMoveSecondarySelf = function (s, t, m) { if (!t || t.fainted || t.hp <= 0) { - this.boost({atk: 1}, s, s, m); + this.boost({ atk: 1 }, s, s, m); } }; } @@ -3405,7 +3404,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Heals the user for 50% of their maximum HP. Heals an additional 3% of the user's maximum HP for each team member on the user's side that has fainted.", pp: 5, priority: 0, - flags: {heal: 1}, + flags: { heal: 1 }, onModifyMove(move, source, target) { const fntAllies = source.side.pokemon.filter(ally => ally !== source && ally.fainted); if (move.heal) move.heal[0] = 50 + (3 * fntAllies.length); @@ -3430,7 +3429,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { basePower: 30, basePowerCallback(pokemon, target, move) { const bp = move.basePower + 20 * pokemon.positiveBoosts(); - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", @@ -3439,7 +3438,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Darkmoon Cackle", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3477,7 +3476,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Mystical Bonfire", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3503,13 +3502,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Praise the Moon", pp: 10, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1}, + flags: { charge: 1, protect: 1, mirror: 1 }, onTryMove(attacker, defender, move) { this.attrLastMove('[still]'); if (attacker.removeVolatile(move.id)) { return; } - this.boost({spa: 1}, attacker, attacker, move); + this.boost({ spa: 1 }, attacker, attacker, move); if (this.field.pseudoWeather['gravity']) { this.attrLastMove('[still]'); this.addMove('-anim', attacker, move.name, defender); @@ -3543,7 +3542,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3578,7 +3577,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Body Count", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Core Enforcer'); }, @@ -3598,7 +3597,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, contact: 1}, + flags: { protect: 1, mirror: 1, contact: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3628,7 +3627,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Salt Cure'); }, @@ -3690,7 +3689,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "User copies opponent's signature move and adds it to its own movepool, replacing this move. The user then uses the copied move immediately and gains the Imprison condition, preventing foes from using moves in the user's moveset. The PP of the copied move will be adjusted to match the PP the copied signature move is supposed to have. If the copied custom move would fail if used in this manner, Plagiarism fails and the user boosts all stats by 1 stage, except Accuracy and Evasion.", pp: 5, priority: 1, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1, failmimic: 1, nosketch: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1, failmimic: 1, nosketch: 1 }, onTry(source) { if (source.m.usedPlagiarism) { this.hint("Plagiarism only works once per switch-in."); @@ -3707,7 +3706,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const move = this.dex.getActiveMove(sigMoveName); if (!target || this.queue.willSwitch(target) || target.beingCalledBack || move.flags['failcopycat'] || move.flags['nosketch']) { - this.boost({spa: 1, spd: 1, spe: 1}, source, source, m); + this.boost({ spa: 1, spd: 1, spe: 1 }, source, source, m); return; } const plagiarismIndex = source.moves.indexOf('plagiarism'); @@ -3725,7 +3724,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { source.moveSlots[plagiarismIndex] = plagiarisedMove; this.add('-activate', source, 'move: Plagiarism', move.name); this.add('-message', `${source.name} plagiarised ${target.name}'s ${move.name}!`); - this.actions.useMove(move.id, source, {target}); + this.actions.useMove(move.id, source, { target }); delete target.volatiles['imprison']; source.addVolatile('imprison', source); source.m.usedPlagiarism = true; @@ -3754,7 +3753,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const condition of sideConditions) { if (pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Time Skip', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Time Skip', `[of] ${pokemon}`); } } // 9 turn addition so the +1 from endTurn totals to 10 turns @@ -3779,7 +3778,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "vruuuuuum", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3806,7 +3805,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 2, - flags: {mirror: 1, heal: 1}, + flags: { mirror: 1, heal: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3856,7 +3855,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, multihit: 2, onTryMove() { this.attrLastMove('[still]'); @@ -3897,7 +3896,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3950,7 +3949,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, dance: 1}, + flags: { contact: 1, protect: 1, mirror: 1, dance: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -3981,7 +3980,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {bypasssub: 1}, + flags: { bypasssub: 1 }, onPrepareHit(target, source) { this.attrLastMove('[anim] Haze'); this.attrLastMove('[anim] Sweet Kiss'); @@ -3992,7 +3991,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { for (const pokemon of this.getAllActive()) { pokemon.clearBoosts(); } - this.boost({atk: 1, def: 1}, source, source, move); + this.boost({ atk: 1, def: 1 }, source, source, move); }, slotCondition: 'nyaa', condition: { @@ -4021,13 +4020,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 5, priority: 1, - flags: {protect: 1}, + flags: { protect: 1 }, onTry(pokemon, target, move) { if (move.sourceEffect !== '3' && this.randomChance(1, 10)) { this.add('-message', "The move backfired!"); const activeMove = this.dex.getActiveMove(':3'); activeMove.hasBounced = true; - this.actions.useMove(activeMove, target, {target: pokemon}); + this.actions.useMove(activeMove, target, { target: pokemon }); return null; } }, @@ -4054,7 +4053,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { shortDesc: "Wish + Taunts the foe.", pp: 15, priority: 0, - flags: {snatch: 1, heal: 1, protect: 1, reflectable: 1, mirror: 1, bypasssub: 1}, + flags: { snatch: 1, heal: 1, protect: 1, reflectable: 1, mirror: 1, bypasssub: 1 }, self: { slotCondition: 'Wish', }, @@ -4084,7 +4083,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "If the user is not shiny, it switches out even if it is trapped and is replaced immediately by a selected party member, and if the user moved first this turn, the selected party member will be protected from most attacks made by other Pokemon this turn. If the user is shiny, this move instead becomes a 69 Base Power ???-type special attack.", pp: 5, priority: 0, - flags: {snatch: 1}, + flags: { snatch: 1 }, stallingMove: true, sideCondition: 'alting', onTryMove() { @@ -4102,7 +4101,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { move.accuracy = 100; move.basePower = 69; move.category = "Special"; - move.flags = {protect: 1, bypasssub: 1}; + move.flags = { protect: 1, bypasssub: 1 }; move.target = "normal"; delete move.selfSwitch; @@ -4154,7 +4153,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4196,7 +4195,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onHit(target, pokemon, move) { this.heal(pokemon.maxhp, pokemon, pokemon, move); pokemon.cureStatus(); - this.boost({def: 1, spd: 1}); + this.boost({ def: 1, spd: 1 }); (pokemon as any).level += 5; pokemon.details = pokemon.getUpdatedDetails(); this.add('-anim', pokemon, 'Geomancy', pokemon); @@ -4219,7 +4218,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { shortDesc: "10% chance to freeze the target.", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Blizzard'); }, @@ -4241,7 +4240,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "If the user is Volcarona, this move is Ice-type and, after dealing damage, transforms the user into a Snow Warning Frosmoth with Blizzard, Chilly Reception, and Aurora Veil. If the user is Frosmoth, this move is Fire-type and, after dealing damage, transforms the user into a Drought Volcarona with Torch Song, Morning Sun, and Solar Beam. This move fails if the user is neither Frosmoth nor Volcarona.", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, failcopycat: 1, nosketch: 1}, + flags: { protect: 1, mirror: 1, failcopycat: 1, nosketch: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4280,7 +4279,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "A random move is selected for use, and then the user's other three moves are replaced with random moves. Aura Wheel, Dark Void, Explosion, Final Gambit, Healing Wish, Hyperspace Fury, Lunar Dance, Memento, Misty Explosion, Revival Blessing, and Self-Destruct cannot be selected.", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4331,7 +4330,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4353,7 +4352,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Raises the user's Attack by 4 stages. Inflicts the Perish Song effect on the user, causing it to faint in three turns at the end of the turn.", pp: 10, priority: 0, - flags: {sound: 1, bypasssub: 1}, + flags: { sound: 1, bypasssub: 1 }, onTry(source) { if (source.m.usedPleek) { this.hint("Pleek... only works once per switch-in."); @@ -4366,7 +4365,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onHit(target, source, move) { this.add(`c:|${getName((source.illusion || source).name)}|Pleek...`); - this.boost({atk: 4}, source, source, move); + this.boost({ atk: 4 }, source, source, move); source.addVolatile('perishsong'); this.add('-start', source, 'perish3', '[silent]'); source.m.usedPleek = true; @@ -4386,7 +4385,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { critRatio: 2, pp: 10, priority: 0, - flags: {pulse: 1, protect: 1}, + flags: { pulse: 1, protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4431,25 +4430,25 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { secondary: { chance: 40, onHit(target, source, move) { - const table: {[k: string]: {volatileStatus?: string, status?: string}} = { - Normal: {volatileStatus: 'yawn'}, - Fire: {status: 'brn'}, - Water: {volatileStatus: 'aquaring'}, - Grass: {volatileStatus: 'leechseed'}, - Flying: {volatileStatus: 'confusion'}, - Fighting: {volatileStatus: 'partiallytrapped'}, - Poison: {status: 'tox'}, - Electric: {status: 'par'}, - Ground: {volatileStatus: 'trapped'}, - Rock: {volatileStatus: 'saltcure'}, - Psychic: {status: 'slp'}, - Ice: {status: 'frz'}, - Bug: {status: 'psn'}, - Ghost: {volatileStatus: 'disable'}, - Steel: {volatileStatus: 'flinch'}, - Dark: {volatileStatus: 'mustrecharge'}, - Dragon: {volatileStatus: 'taunt'}, - Fairy: {volatileStatus: 'attract'}, + const table: { [k: string]: { volatileStatus?: string, status?: string } } = { + Normal: { volatileStatus: 'yawn' }, + Fire: { status: 'brn' }, + Water: { volatileStatus: 'aquaring' }, + Grass: { volatileStatus: 'leechseed' }, + Flying: { volatileStatus: 'confusion' }, + Fighting: { volatileStatus: 'partiallytrapped' }, + Poison: { status: 'tox' }, + Electric: { status: 'par' }, + Ground: { volatileStatus: 'trapped' }, + Rock: { volatileStatus: 'saltcure' }, + Psychic: { status: 'slp' }, + Ice: { status: 'frz' }, + Bug: { status: 'psn' }, + Ghost: { volatileStatus: 'disable' }, + Steel: { volatileStatus: 'flinch' }, + Dark: { volatileStatus: 'mustrecharge' }, + Dragon: { volatileStatus: 'taunt' }, + Fairy: { volatileStatus: 'attract' }, }; let condition = table[move.type]; if (!condition) condition = table['Normal']; @@ -4474,7 +4473,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Causes damage to the target equal to 1/8 of its maximum HP (1/4 if the target is Normal or Fairy type), rounded down, and heals the user equal to 1/8 of its maximum HP, both at the end of each turn during effect. This effect ends when the target is no longer active.", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Guillotine'); }, @@ -4519,7 +4518,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Has a 100% chance to raise the user's Special Attack by 1 stage. This move's type depends on the user's primary type. If the user's primary type is typeless, this move's type is the user's secondary type if it has one, otherwise the added type from effects that add extra typings. This move is typeless if the user's type is typeless alone.", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4565,7 +4564,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const type = this.sample(this.dex.types.names().filter(i => i !== 'Stellar')); target.setType(type); this.add('-start', target, 'typechange', type, '[from] move: Reshape'); - this.boost({spa: 1}, source); + this.boost({ spa: 1 }, source); }, target: "normal", type: "Normal", @@ -4581,7 +4580,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Removes any terrain, weather, entry hazard, or other removable field condition, and then causes the user to switch out even if it is trapped and be replaced immediately by a selected party member. The user does not switch out if there are no unfainted party members, and the user will still attempt to switch out if there are no active field conditions.", pp: 5, priority: 0, - flags: {bypasssub: 1}, + flags: { bypasssub: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4596,7 +4595,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (player.removeSideCondition(targetCondition)) { success = true; if (displayText.includes(targetCondition)) { - this.add('-sideend', player, this.dex.conditions.get(targetCondition).name, '[from] move: Magic Trick', '[of] ' + source); + this.add('-sideend', player, this.dex.conditions.get(targetCondition).name, '[from] move: Magic Trick', `[of] ${source}`); } } } @@ -4643,7 +4642,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } if (stats.length) { const randomStat = this.sample(stats); - this.boost({[randomStat]: 3}, pokemon, pokemon, move); + this.boost({ [randomStat]: 3 }, pokemon, pokemon, move); this.actions.useMove('Baton Pass', target); } }, @@ -4663,7 +4662,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "If this move is successful, the terrain becomes Psychic Terrain.", pp: 5, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, terrain: 'psychicterrain', onTryMove() { this.attrLastMove('[still]'); @@ -4716,7 +4715,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4752,7 +4751,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { shortDesc: "Boosts Atk, Spe, and accuracy by 1 stage.", pp: 5, priority: 0, - flags: {sound: 1}, + flags: { sound: 1 }, boosts: { atk: 1, spe: 1, @@ -4780,7 +4779,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Nearly always moves first. The target's stat stages greater than 0 are stolen from it and applied to the user, and any present effects of Reflect, Light Screen, and Aurora Veil are moved from the target's side of the field to the user's, before dealing damage. Fails unless it is the user's first turn on the field.", pp: 5, priority: 2, - flags: {contact: 1, protect: 1, mirror: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, bite: 1 }, onTry(source) { if (source.activeMoveActions > 1) { this.hint("Confiscate only works on your first turn out."); @@ -4817,7 +4816,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Has a 100% chance to raise the user's Special Attack by 1 stage.", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4847,7 +4846,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Purification", pp: 5, priority: 0, - flags: {heal: 1, bypasssub: 1, allyanim: 1}, + flags: { heal: 1, bypasssub: 1, allyanim: 1 }, onPrepareHit() { this.attrLastMove('[anim] Moonlight'); }, @@ -4870,7 +4869,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Hexadecimal Fire", pp: 15, priority: 0, - flags: {heal: 1, bypasssub: 1, allyanim: 1}, + flags: { heal: 1, bypasssub: 1, allyanim: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4917,7 +4916,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -4939,13 +4938,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { for (const targetCondition of removeTarget) { if (targetSide.removeSideCondition(targetCondition)) { if (!removeAll.includes(targetCondition)) continue; - this.add('-sideend', targetSide, this.dex.conditions.get(targetCondition).name, '[from] move: Treacherous Traversal', '[of] ' + source); + this.add('-sideend', targetSide, this.dex.conditions.get(targetCondition).name, '[from] move: Treacherous Traversal', `[of] ${source}`); success = true; } } for (const sideCondition of removeAll) { if (source.side.removeSideCondition(sideCondition)) { - this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Treacherous Traversal', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Treacherous Traversal', `[of] ${source}`); success = true; } } @@ -5003,7 +5002,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Grass Gaming", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5021,7 +5020,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (source.hp) { const item = target.takeItem(); if (item) { - this.add('-enditem', target, item.name, '[from] move: Grass Gaming', '[of] ' + source); + this.add('-enditem', target, item.name, '[from] move: Grass Gaming', `[of] ${source}`); } } }, @@ -5048,7 +5047,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Like..?", pp: 5, priority: 0, - flags: {reflectable: 1, protect: 1}, + flags: { reflectable: 1, protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5082,7 +5081,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {contact: 1, protect: 1}, + flags: { contact: 1, protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5093,12 +5092,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onAfterHit(target, pokemon) { if (pokemon.hp && pokemon.removeVolatile('leechseed')) { - this.add('-end', pokemon, 'Leech Seed', '[from] move: Concept Relevant', '[of] ' + pokemon); + this.add('-end', pokemon, 'Leech Seed', '[from] move: Concept Relevant', `[of] ${pokemon}`); } const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const condition of sideConditions) { if (pokemon.hp && pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Concept Relevant', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Concept Relevant', `[of] ${pokemon}`); } } if (pokemon.hp && pokemon.volatiles['partiallytrapped']) { @@ -5121,12 +5120,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onAfterSubDamage(damage, target, pokemon) { if (pokemon.hp && pokemon.removeVolatile('leechseed')) { - this.add('-end', pokemon, 'Leech Seed', '[from] move: Concept Relevant', '[of] ' + pokemon); + this.add('-end', pokemon, 'Leech Seed', '[from] move: Concept Relevant', `[of] ${pokemon}`); } const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const condition of sideConditions) { if (pokemon.hp && pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Concept Relevant', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Concept Relevant', `[of] ${pokemon}`); } } if (pokemon.hp && pokemon.volatiles['partiallytrapped']) { @@ -5166,7 +5165,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Adaptive Beam", pp: 15, priority: 0, - flags: {sound: 1, protect: 1, bypasssub: 1}, + flags: { sound: 1, protect: 1, bypasssub: 1 }, stealsBoosts: true, onTryMove() { this.attrLastMove('[still]'); @@ -5204,7 +5203,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5227,7 +5226,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5274,7 +5273,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 5, priority: 0, - flags: {snatch: 1, dance: 1, metronome: 1}, + flags: { snatch: 1, dance: 1, metronome: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5304,7 +5303,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onModifyPriority(priority, pokemon) { if (!pokemon.item) return priority + 1; }, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onModifyMove(move, pokemon, target) { if (!pokemon.item) { move.flags['contact'] = 1; @@ -5349,7 +5348,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5377,7 +5376,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5400,7 +5399,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5425,7 +5424,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "A Soul for a Soul", pp: 5, priority: 1, - flags: {protect: 1, contact: 1}, + flags: { protect: 1, contact: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5458,7 +5457,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { this.attrLastMove('[still]'); }, onHit(pokemon) { - const success = !!this.boost({atk: 1, spe: 1}); + const success = !!this.boost({ atk: 1, spe: 1 }); return pokemon.addVolatile('risingsword') || success; }, condition: { @@ -5489,7 +5488,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "SAND EAT", pp: 10, priority: 4, - flags: {noassist: 1}, + flags: { noassist: 1 }, stallingMove: true, volatileStatus: 'protect', onTryMove() { @@ -5549,7 +5548,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Eternal Wish", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5560,7 +5559,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onHit(target, source, move) { let success = false; - if (!target.volatiles['substitute'] || move.infiltrates) success = !!this.boost({evasion: -1}); + if (!target.volatiles['substitute'] || move.infiltrates) success = !!this.boost({ evasion: -1 }); const removeTarget = [ 'reflect', 'lightscreen', 'auroraveil', 'safeguard', 'mist', 'spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge', ]; @@ -5570,13 +5569,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { for (const targetCondition of removeTarget) { if (target.side.removeSideCondition(targetCondition)) { if (!removeAll.includes(targetCondition)) continue; - this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Eternal Wish', '[of] ' + source); + this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Eternal Wish', `[of] ${source}`); success = true; } } for (const sideCondition of removeAll) { if (source.side.removeSideCondition(sideCondition)) { - this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Eternal Wish', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Eternal Wish', `[of] ${source}`); success = true; } } @@ -5616,7 +5615,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { pp: 1, noPPBoosts: true, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5644,7 +5643,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onPrepareHit() { this.attrLastMove('[anim] Future Sight'); }, @@ -5660,7 +5659,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } if (stats.length) { const randomStat = this.sample(stats); - this.boost({[randomStat]: 2}, pokemon, pokemon, move); + this.boost({ [randomStat]: 2 }, pokemon, pokemon, move); } } }, @@ -5679,7 +5678,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Symphonie du Ze\u0301ro", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5716,7 +5715,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { pp: 20, priority: 0, multihit: 2, - flags: {protect: 1, contact: 1}, + flags: { protect: 1, contact: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5751,7 +5750,6 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { type: "???", }, - // UT myboys: { accuracy: 100, @@ -5762,7 +5760,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "My Boys", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5793,7 +5791,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Boosts the user's Attack by 1 stage if the attack is not very effective, 2 stages if the attack is neutral, and 3 stages if the attack is super effective. Fails unless it is the user's first turn on the field.", pp: 15, priority: 3, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5814,7 +5812,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } else if (typeMod < 0) { boost = 1; } - this.boost({atk: boost}, pokemon, pokemon, move); + this.boost({ atk: boost }, pokemon, pokemon, move); }, secondary: null, target: "normal", @@ -5831,7 +5829,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "The target becomes badly poisoned, and all entry hazards and terrain effects are removed from both sides of the field. If the target already has a non-volatile status condition, the removal effect can still occur.", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5851,13 +5849,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { for (const targetCondition of removeTarget) { if (target.side.removeSideCondition(targetCondition)) { if (!removeAll.includes(targetCondition)) continue; - this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Your Crippling Interest', '[of] ' + source); + this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Your Crippling Interest', `[of] ${source}`); success = true; } } for (const sideCondition of removeAll) { if (source.side.removeSideCondition(sideCondition)) { - this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Your Crippling Interest', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Your Crippling Interest', `[of] ${source}`); success = true; } } @@ -5891,7 +5889,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onModifyPriority(priority, pokemon, target, move) { if (target?.terastallized) return 0; }, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -5923,7 +5921,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Virtual Avatar", pp: 10, priority: 0, - flags: {sound: 1, failcopycat: 1}, + flags: { sound: 1, failcopycat: 1 }, secondary: null, onTryMove() { this.attrLastMove('[still]'); @@ -6007,7 +6005,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, slicing: 1, wind: 1}, + flags: { charge: 1, protect: 1, mirror: 1, slicing: 1, wind: 1 }, critRatio: 2, onEffectiveness(typeMod, target, type, move) { return typeMod + this.dex.getEffectiveness('Dragon', type); @@ -6059,7 +6057,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Torrential Drain", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "allAdjacent", @@ -6116,7 +6114,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { this.add('-message', source.name + ' tried to copy the move!'); this.add('-anim', source, "Me First", target); move.overrideOffensiveStat = 'atk'; - this.actions.useMove(move, source, {target}); + this.actions.useMove(move, source, { target }); delete this.effectState.move; }, onBasePowerPriority: 12, @@ -6140,7 +6138,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { gen: 9, pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -6169,7 +6167,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { desc: "Badly poisons the target. If the infliction of status is successful, the target is forced to switch out and be replaced with a random unfainted ally. Fails if the target is the last unfainted Pokemon in its party, or if the target used Ingrain previously or has the Suction Cups Ability. This move will fail entirely if the target has a non-volatile status condition.", pp: 10, priority: -6, - flags: {reflectable: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1, noassist: 1, failcopycat: 1, wind: 1}, + flags: { reflectable: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1, noassist: 1, failcopycat: 1, wind: 1 }, forceSwitch: true, status: 'tox', secondary: null, @@ -6187,7 +6185,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "top kek", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -6201,7 +6199,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (!target.hasItem('Miracle Seed')) { const item = target.takeItem(); if (item) { - this.add('-enditem', target, item.name, '[from] move: top kek', '[of] ' + source); + this.add('-enditem', target, item.name, '[from] move: top kek', `[of] ${source}`); target.setItem('Miracle Seed', source, move); } } @@ -6222,7 +6220,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Whiteout", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, bullet: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -6265,7 +6263,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (target && !target.fainted) { this.add('-anim', target, "Baton Pass", target); target.addVolatile('focusenergy'); - this.boost({spe: 1}, target, this.effectState.source, this.dex.getActiveMove('tagyoureit')); + this.boost({ spe: 1 }, target, this.effectState.source, this.dex.getActiveMove('tagyoureit')); target.side.removeSlotCondition(target, 'tagyoureit'); } }, @@ -6286,12 +6284,12 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "High Ground", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 100, onHit(target, source, move) { if (this.dex.species.get(source.species).heightm > this.dex.species.get(target.species).heightm) { - this.boost({spa: 1}, source); + this.boost({ spa: 1 }, source); } }, }, @@ -6316,7 +6314,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Dud ur a fish", pp: 5, priority: 0, - flags: {heal: 1, snatch: 1}, + flags: { heal: 1, snatch: 1 }, onTryMove() { this.attrLastMove('[still]'); }, @@ -6349,7 +6347,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { shortDesc: "Confuses and paralyzes the target.", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1}, + flags: { protect: 1, reflectable: 1 }, onTryMove(pokemon, target, move) { this.attrLastMove('[still]'); if (this.randomChance(1, 256)) { @@ -6456,7 +6454,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Darkest Night", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, overrideOffensivePokemon: 'target', secondary: null, target: "normal", @@ -6531,7 +6529,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return; } this.add('-prepare', attacker, move.name); - this.boost({spa: 1}, attacker, attacker, move); + this.boost({ spa: 1 }, attacker, attacker, move); if (['raindance', 'primordialsea', 'stormsurge'].includes(attacker.effectiveWeather())) { this.attrLastMove('[still]'); this.addMove('-anim', attacker, move.name, defender); @@ -6638,7 +6636,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { - this.add('-fieldstart', 'move: Misty Terrain', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-fieldstart', 'move: Misty Terrain', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Misty Terrain'); } @@ -6755,7 +6753,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { }, onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { - this.add('-fieldstart', 'move: Psychic Terrain', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-fieldstart', 'move: Psychic Terrain', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Psychic Terrain'); } @@ -6777,7 +6775,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { return null; } if (source.hasAbility(['insomnia', 'vitalspirit'])) { - this.add('-fail', source, '[from] ability: ' + source.getAbility().name, '[of] ' + source); + this.add('-fail', source, '[from] ability: ' + source.getAbility().name, `[of] ${source}`); return null; } }, @@ -6846,7 +6844,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onSwitchIn(pokemon) { if (!pokemon.isGrounded() || pokemon.hasItem('heavydutyboots') || pokemon.hasAbility('eternalgenerator')) return; this.add('-activate', pokemon, 'move: Sticky Web'); - this.boost({spe: -1}, pokemon, pokemon.side.foe.active[0], this.dex.getActiveMove('stickyweb')); + this.boost({ spe: -1 }, pokemon, pokemon.side.foe.active[0], this.dex.getActiveMove('stickyweb')); }, }, }, @@ -6940,7 +6938,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { move.basePower *= 2; break; } - this.debug('BP: ' + move.basePower); + this.debug(`BP: ${move.basePower}`); }, }, wildboltstorm: { diff --git a/data/mods/gen9ssb/pokedex.ts b/data/mods/gen9ssb/pokedex.ts index c9818b0be8..8ce63367d9 100644 --- a/data/mods/gen9ssb/pokedex.ts +++ b/data/mods/gen9ssb/pokedex.ts @@ -9,1186 +9,1186 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable // aegii scizor: { inherit: true, - abilities: {0: "Unburden"}, + abilities: { 0: "Unburden" }, }, // Aelita melmetal: { inherit: true, - abilities: {0: "Fortified Metal"}, + abilities: { 0: "Fortified Metal" }, }, // Aethernum giratinaorigin: { inherit: true, - abilities: {0: "The Eminence in the Shadow"}, + abilities: { 0: "The Eminence in the Shadow" }, }, // Akir slowbro: { inherit: true, - abilities: {0: "Take it Slow"}, + abilities: { 0: "Take it Slow" }, }, // Alex sprigatito: { inherit: true, - baseStats: {hp: 90, atk: 61, def: 84, spa: 45, spd: 85, spe: 65}, - abilities: {0: "Pawprints"}, + baseStats: { hp: 90, atk: 61, def: 84, spa: 45, spd: 85, spe: 65 }, + abilities: { 0: "Pawprints" }, }, // Alexander489 charizard: { inherit: true, - abilities: {0: "Confirmed Town"}, + abilities: { 0: "Confirmed Town" }, }, // Apple applin: { inherit: true, - baseStats: {hp: 106, atk: 80, def: 110, spa: 120, spd: 80, spe: 44}, - abilities: {0: "Orchard's Gift"}, + baseStats: { hp: 106, atk: 80, def: 110, spa: 120, spd: 80, spe: 44 }, + abilities: { 0: "Orchard's Gift" }, }, // Appletun a la Mode appletun: { inherit: true, - abilities: {0: "Served Cold"}, + abilities: { 0: "Served Cold" }, }, // aQrator totodile: { inherit: true, - baseStats: {hp: 85, atk: 105, def: 100, spa: 79, spd: 83, spe: 78}, - abilities: {0: "Neverending fHunt"}, + baseStats: { hp: 85, atk: 105, def: 100, spa: 79, spd: 83, spe: 78 }, + abilities: { 0: "Neverending fHunt" }, }, // A Quag To The Past quagsire: { inherit: true, - baseStats: {hp: 130, atk: 100, def: 75, spa: 20, spd: 60, spe: 45}, - abilities: {0: "Quag of Ruin"}, + baseStats: { hp: 130, atk: 100, def: 75, spa: 20, spd: 60, spe: 45 }, + abilities: { 0: "Quag of Ruin" }, }, clodsire: { inherit: true, - baseStats: {hp: 130, atk: 60, def: 75, spa: 40, spd: 100, spe: 20}, - abilities: {0: "Clod of Ruin"}, + baseStats: { hp: 130, atk: 60, def: 75, spa: 40, spd: 100, spe: 20 }, + abilities: { 0: "Clod of Ruin" }, }, // Archas lilligant: { inherit: true, - abilities: {0: "Saintly Bullet"}, + abilities: { 0: "Saintly Bullet" }, }, // Arcueid deoxysattack: { inherit: true, - abilities: {0: "Marble Phantasm"}, + abilities: { 0: "Marble Phantasm" }, }, deoxysdefense: { inherit: true, - abilities: {0: "Marble Phantasm"}, + abilities: { 0: "Marble Phantasm" }, }, // Arsenal rabsca: { inherit: true, - baseStats: {hp: 100, atk: 50, def: 100, spa: 115, spd: 100, spe: 45}, - abilities: {0: "Absorb Phys"}, + baseStats: { hp: 100, atk: 50, def: 100, spa: 115, spd: 100, spe: 45 }, + abilities: { 0: "Absorb Phys" }, }, // Artemis genesect: { inherit: true, - abilities: {0: "Supervised Learning"}, + abilities: { 0: "Supervised Learning" }, }, // Arya trapinch: { inherit: true, types: ["Ground", "Dragon"], - baseStats: {hp: 80, atk: 100, def: 90, spa: 120, spd: 100, spe: 130}, - abilities: {0: "Punk Rock"}, + baseStats: { hp: 80, atk: 100, def: 90, spa: 120, spd: 100, spe: 130 }, + abilities: { 0: "Punk Rock" }, }, flygon: { inherit: true, - abilities: {0: "Tinted Lens"}, + abilities: { 0: "Tinted Lens" }, }, // Audiino audino: { inherit: true, - abilities: {0: "Mitosis"}, + abilities: { 0: "Mitosis" }, }, // ausma hatterene: { inherit: true, - abilities: {0: "Cascade"}, + abilities: { 0: "Cascade" }, }, // AuzBat swoobat: { inherit: true, - abilities: {0: "Magic Guard"}, + abilities: { 0: "Magic Guard" }, }, // avarice sinistchamasterpiece: { inherit: true, - abilities: {0: "Serene Grace"}, + abilities: { 0: "Serene Grace" }, }, // Beowulf beedrill: { inherit: true, - abilities: {0: "Intrepid Sword"}, + abilities: { 0: "Intrepid Sword" }, }, // berry regirock: { inherit: true, - abilities: {0: "Sturdy"}, + abilities: { 0: "Sturdy" }, }, // Bert122 sableye: { inherit: true, - abilities: {0: "Prankster"}, + abilities: { 0: "Prankster" }, }, sableyemega: { inherit: true, - abilities: {0: "Pestering Assault"}, + abilities: { 0: "Pestering Assault" }, }, // Billo cosmog: { inherit: true, - abilities: {0: "Wonder Guard"}, + abilities: { 0: "Wonder Guard" }, }, solgaleo: { inherit: true, - abilities: {0: "Magic Guard"}, + abilities: { 0: "Magic Guard" }, }, // blazeofvictory sylveon: { inherit: true, - abilities: {0: "Prismatic Lens"}, + abilities: { 0: "Prismatic Lens" }, }, // Blitz chiyu: { inherit: true, types: ["Water", "Dark"], - abilities: {0: "Blitz of Ruin"}, + abilities: { 0: "Blitz of Ruin" }, }, // Breadey dachsbun: { inherit: true, - abilities: {0: "Painful Exit"}, + abilities: { 0: "Painful Exit" }, }, // Cake dunsparce: { inherit: true, - abilities: {0: "Scrappy"}, + abilities: { 0: "Scrappy" }, }, // chaos ironjugulis: { inherit: true, - abilities: {0: "Transistor"}, + abilities: { 0: "Transistor" }, }, // Chloe tsareena: { inherit: true, - abilities: {0: "Acetosa"}, + abilities: { 0: "Acetosa" }, }, // Chris ragingbolt: { inherit: true, - abilities: {0: "Astrothunder"}, + abilities: { 0: "Astrothunder" }, }, // ciran rapidash: { inherit: true, - abilities: {0: "Defiant"}, + abilities: { 0: "Defiant" }, }, // Clefable clefable: { inherit: true, - abilities: {0: "That's Hacked"}, + abilities: { 0: "That's Hacked" }, }, // Clementine avalugg: { inherit: true, - abilities: {0: "Melting Point"}, + abilities: { 0: "Melting Point" }, }, avalugghisui: { inherit: true, types: ["Ice"], - baseStats: {hp: 95, atk: 46, def: 44, spa: 184, spd: 117, spe: 95}, - abilities: {0: "Melting Point"}, + baseStats: { hp: 95, atk: 46, def: 44, spa: 184, spd: 117, spe: 95 }, + abilities: { 0: "Melting Point" }, }, // clerica mimikyu: { inherit: true, - abilities: {0: "Masquerade"}, + abilities: { 0: "Masquerade" }, }, mimikyubusted: { inherit: true, - abilities: {0: "Masquerade"}, + abilities: { 0: "Masquerade" }, }, // Clouds corvisquire: { inherit: true, - baseStats: {hp: 98, atk: 87, def: 105, spa: 53, spd: 85, spe: 67}, - abilities: {0: "Jet Stream"}, + baseStats: { hp: 98, atk: 87, def: 105, spa: 53, spd: 85, spe: 67 }, + abilities: { 0: "Jet Stream" }, }, // Coolcodename victini: { inherit: true, - abilities: {0: "Firewall"}, + abilities: { 0: "Firewall" }, }, // Corthius thwackey: { inherit: true, - abilities: {0: "Grassy Emperor"}, + abilities: { 0: "Grassy Emperor" }, }, // Dawn of Artemis necrozma: { inherit: true, - abilities: {0: "Form Change"}, + abilities: { 0: "Form Change" }, }, necrozmaultra: { inherit: true, - abilities: {0: "Form Change"}, + abilities: { 0: "Form Change" }, }, // DaWoblefet wobbuffet: { inherit: true, - abilities: {0: "Shadow Artifice"}, + abilities: { 0: "Shadow Artifice" }, }, // deftinwolf yveltal: { inherit: true, - abilities: {0: "Sharpness"}, + abilities: { 0: "Sharpness" }, }, // dhelmise slowkinggalar: { inherit: true, - abilities: {0: "Coalescence"}, + abilities: { 0: "Coalescence" }, }, // DianaNicole abomasnow: { inherit: true, - abilities: {0: "Snow Warning"}, + abilities: { 0: "Snow Warning" }, }, abomasnowmega: { inherit: true, - abilities: {0: "Flash Fire"}, + abilities: { 0: "Flash Fire" }, }, // EasyOnTheHills snorlax: { inherit: true, - abilities: {0: "Immunity"}, + abilities: { 0: "Immunity" }, }, // Elliot sinistea: { inherit: true, - baseStats: {hp: 69, atk: 65, def: 114, spa: 134, spd: 65, spe: 70}, - abilities: {0: "Natural Cure"}, + baseStats: { hp: 69, atk: 65, def: 114, spa: 134, spd: 65, spe: 70 }, + abilities: { 0: "Natural Cure" }, }, // Elly thundurus: { inherit: true, - abilities: {0: "Storm Surge"}, + abilities: { 0: "Storm Surge" }, }, // Emboar02 emboar: { inherit: true, - abilities: {0: "Hogwash"}, + abilities: { 0: "Hogwash" }, }, // Fame jumpluff: { inherit: true, - abilities: {0: "Social Jumpluff Warrior"}, + abilities: { 0: "Social Jumpluff Warrior" }, }, // Felucia vespiquen: { inherit: true, - abilities: {0: "Mountaineer"}, + abilities: { 0: "Mountaineer" }, }, // Froggeh toxicroak: { inherit: true, - abilities: {0: "Super Luck"}, + abilities: { 0: "Super Luck" }, }, // Frostyicelad qwilfishhisui: { inherit: true, - abilities: {0: "Almost Frosty"}, + abilities: { 0: "Almost Frosty" }, }, // Frozoid gible: { inherit: true, - baseStats: {hp: 65, atk: 110, def: 55, spa: 50, spd: 55, spe: 108}, - abilities: {0: "Snowballer"}, + baseStats: { hp: 65, atk: 110, def: 55, spa: 50, spd: 55, spe: 108 }, + abilities: { 0: "Snowballer" }, }, // Ganjafin wiglett: { inherit: true, - baseStats: {hp: 80, atk: 60, def: 80, spa: 60, spd: 80, spe: 100}, - abilities: {0: "Gambling Addiction"}, + baseStats: { hp: 80, atk: 60, def: 80, spa: 60, spd: 80, spe: 100 }, + abilities: { 0: "Gambling Addiction" }, }, // Haste Inky falinks: { inherit: true, - abilities: {0: "Simple"}, + abilities: { 0: "Simple" }, }, // havi gastly: { inherit: true, - baseStats: {hp: 60, atk: 65, def: 60, spa: 130, spd: 75, spe: 110}, - abilities: {0: "Mensis Cage"}, + baseStats: { hp: 60, atk: 65, def: 60, spa: 130, spd: 75, spe: 110 }, + abilities: { 0: "Mensis Cage" }, }, // Hecate mewtwo: { inherit: true, - abilities: {0: "Hacking"}, + abilities: { 0: "Hacking" }, }, mewtwomegax: { inherit: true, - abilities: {0: "Hacking"}, + abilities: { 0: "Hacking" }, }, // HiZo zoroarkhisui: { inherit: true, - abilities: {0: "Justified"}, + abilities: { 0: "Justified" }, }, // HoeenHero ludicolo: { inherit: true, - abilities: {0: "Misspelled"}, + abilities: { 0: "Misspelled" }, }, // hsy ursaluna: { inherit: true, - abilities: {0: "Hustle"}, + abilities: { 0: "Hustle" }, }, // Hydrostatics pichuspikyeared: { inherit: true, - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: 'Hydrostatic Positivity'}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: 'Hydrostatic Positivity' }, types: ["Electric", "Water"], }, // Imperial kyurem: { inherit: true, - abilities: {0: "Frozen Fortuity"}, + abilities: { 0: "Frozen Fortuity" }, }, kyuremblack: { inherit: true, - abilities: {0: "Frozen Fortuity"}, + abilities: { 0: "Frozen Fortuity" }, }, kyuremwhite: { inherit: true, - abilities: {0: "Frozen Fortuity"}, + abilities: { 0: "Frozen Fortuity" }, }, // in the hills gligar: { inherit: true, - abilities: {0: "Illiterit"}, + abilities: { 0: "Illiterit" }, }, // ironwater jirachi: { inherit: true, - abilities: {0: "Good as Gold"}, + abilities: { 0: "Good as Gold" }, }, // Irpachuza mrmime: { inherit: true, - abilities: {0: "Mime knows best"}, + abilities: { 0: "Mime knows best" }, }, // Isaiah medicham: { inherit: true, - abilities: {0: "Psychic Surge"}, + abilities: { 0: "Psychic Surge" }, }, // J0rdy004 vulpixalola: { inherit: true, - baseStats: {hp: 73, atk: 67, def: 75, spa: 81, spd: 100, spe: 109}, - abilities: {0: "Fortifying Frost"}, + baseStats: { hp: 73, atk: 67, def: 75, spa: 81, spd: 100, spe: 109 }, + abilities: { 0: "Fortifying Frost" }, }, // Kalalokki flamigo: { inherit: true, - abilities: {0: "Scrappy"}, + abilities: { 0: "Scrappy" }, }, // Karthik staraptor: { inherit: true, - abilities: {0: "Tough Claws"}, + abilities: { 0: "Tough Claws" }, }, // ken jigglypuff: { inherit: true, - baseStats: {hp: 115, atk: 65, def: 99, spa: 65, spd: 115, spe: 111}, - abilities: {0: "Aroma Veil"}, + baseStats: { hp: 115, atk: 65, def: 99, spa: 65, spd: 115, spe: 111 }, + abilities: { 0: "Aroma Veil" }, }, // kenn larvitar: { inherit: true, - baseStats: {hp: 100, atk: 84, def: 70, spa: 65, spd: 70, spe: 61}, - abilities: {0: "Deserted Dunes"}, + baseStats: { hp: 100, atk: 84, def: 70, spa: 65, spd: 70, spe: 61 }, + abilities: { 0: "Deserted Dunes" }, }, // Kennedy cinderace: { inherit: true, - abilities: {0: "Anfield"}, + abilities: { 0: "Anfield" }, otherFormes: ["Cinderace-Gmax"], }, cinderacegmax: { inherit: true, types: ["Fire", "Ice"], - baseStats: {hp: 84, atk: 119, def: 78, spa: 77, spd: 81, spe: 105}, - abilities: {0: "You'll Never Walk Alone"}, + baseStats: { hp: 84, atk: 119, def: 78, spa: 77, spd: 81, spe: 105 }, + abilities: { 0: "You'll Never Walk Alone" }, weightkg: 103, }, // keys rayquaza: { inherit: true, - abilities: {0: "Defeatist"}, + abilities: { 0: "Defeatist" }, }, rayquazamega: { inherit: true, - abilities: {0: "Defeatist"}, + abilities: { 0: "Defeatist" }, requiredMove: "Protector of the Skies", }, // kingbaruk wigglytuff: { inherit: true, - abilities: {0: "Peer Pressure"}, + abilities: { 0: "Peer Pressure" }, }, // Kiwi minccino: { inherit: true, - abilities: {0: "Sure Hit Sorcery"}, + abilities: { 0: "Sure Hit Sorcery" }, }, // Klmondo cloyster: { inherit: true, - abilities: {0: "Super Skilled"}, + abilities: { 0: "Super Skilled" }, }, // kolohe pikachu: { inherit: true, - baseStats: {hp: 45, atk: 80, def: 50, spa: 75, spd: 60, spe: 120}, - abilities: {0: "Soul Surfer"}, + baseStats: { hp: 45, atk: 80, def: 50, spa: 75, spd: 60, spe: 120 }, + abilities: { 0: "Soul Surfer" }, }, // Kry mawile: { inherit: true, - abilities: {0: "Flash Freeze"}, + abilities: { 0: "Flash Freeze" }, }, // Lasen zekrom: { inherit: true, - abilities: {0: "Idealized World"}, + abilities: { 0: "Idealized World" }, }, // Lets go shuckles shuckle: { inherit: true, - abilities: {0: "Persistent"}, + abilities: { 0: "Persistent" }, }, // Lily togedemaru: { inherit: true, - abilities: {0: "Unaware"}, + abilities: { 0: "Unaware" }, }, // Loethalion ralts: { inherit: true, - abilities: {0: "Psychic Surge"}, + abilities: { 0: "Psychic Surge" }, }, // Lumari ponytagalar: { inherit: true, - baseStats: {hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105}, - abilities: {0: "Pyrotechnic"}, + baseStats: { hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105 }, + abilities: { 0: "Pyrotechnic" }, }, // Lunell vaporeon: { inherit: true, - abilities: {0: "Low Tide, High Tide"}, + abilities: { 0: "Low Tide, High Tide" }, }, // Lyna dragonair: { inherit: true, - baseStats: {hp: 82, atk: 80, def: 80, spa: 80, spd: 80, spe: 80}, - abilities: {0: "Magic Aura"}, + baseStats: { hp: 82, atk: 80, def: 80, spa: 80, spd: 80, spe: 80 }, + abilities: { 0: "Magic Aura" }, }, // Maia litwick: { inherit: true, - abilities: {0: "Power Abuse"}, + abilities: { 0: "Power Abuse" }, }, // marillvibes marill: { inherit: true, - baseStats: {hp: 100, atk: 50, def: 80, spa: 60, spd: 80, spe: 50}, - abilities: {0: "Huge Power"}, + baseStats: { hp: 100, atk: 50, def: 80, spa: 60, spd: 80, spe: 50 }, + abilities: { 0: "Huge Power" }, }, // Mathy furret: { inherit: true, - baseStats: {hp: 105, atk: 96, def: 84, spa: 45, spd: 75, spe: 110}, - abilities: {0: "Dynamic Typing"}, + baseStats: { hp: 105, atk: 96, def: 84, spa: 45, spd: 75, spe: 110 }, + abilities: { 0: "Dynamic Typing" }, }, // Merritty torchic: { inherit: true, - baseStats: {hp: 65, atk: 60, def: 60, spa: 80, spd: 70, spe: 85}, - abilities: {0: "End Round"}, + baseStats: { hp: 65, atk: 60, def: 60, spa: 80, spd: 70, spe: 85 }, + abilities: { 0: "End Round" }, }, // Meteordash tatsugiri: { inherit: true, - abilities: {0: "TatsuGlare"}, + abilities: { 0: "TatsuGlare" }, }, // Mex dialga: { inherit: true, - abilities: {0: "Time Dilation"}, + abilities: { 0: "Time Dilation" }, }, // Miojo spheal: { inherit: true, - baseStats: {hp: 110, atk: 95, def: 90, spa: 80, spd: 90, spe: 65}, - abilities: {0: "The Rolling Spheal"}, + baseStats: { hp: 110, atk: 95, def: 90, spa: 80, spd: 90, spe: 65 }, + abilities: { 0: "The Rolling Spheal" }, }, // Monkey infernape: { inherit: true, - abilities: {0: "Harambe Hit"}, + abilities: { 0: "Harambe Hit" }, }, // MyPearl latios: { inherit: true, - abilities: {0: "Eon Call"}, + abilities: { 0: "Eon Call" }, }, latias: { inherit: true, - abilities: {0: "Eon Call"}, + abilities: { 0: "Eon Call" }, }, // Neko chienpao: { inherit: true, - abilities: {0: "Weatherproof"}, + abilities: { 0: "Weatherproof" }, }, // Ney banette: { inherit: true, - abilities: {0: "Insomnia"}, + abilities: { 0: "Insomnia" }, }, banettemega: { inherit: true, - abilities: {0: "Prankster Plus"}, + abilities: { 0: "Prankster Plus" }, }, // Notater517 incineroar: { inherit: true, - abilities: {0: "Vent Crosser"}, + abilities: { 0: "Vent Crosser" }, }, // nya delcatty: { inherit: true, types: ["Fairy"], - baseStats: {hp: 80, atk: 65, def: 80, spa: 70, spd: 80, spe: 90}, - abilities: {0: "Adorable Grace"}, + baseStats: { hp: 80, atk: 65, def: 80, spa: 70, spd: 80, spe: 90 }, + abilities: { 0: "Adorable Grace" }, }, // pants annihilape: { inherit: true, - abilities: {0: "Drifting"}, + abilities: { 0: "Drifting" }, }, // PartMan chandelure: { inherit: true, - abilities: {0: "C- Tier Shitposter"}, + abilities: { 0: "C- Tier Shitposter" }, }, // Pastor Gigas regigigas: { inherit: true, - abilities: {0: "God's Mercy"}, + abilities: { 0: "God's Mercy" }, }, // Peary klinklang: { inherit: true, - abilities: {0: "Levitate"}, + abilities: { 0: "Levitate" }, }, // phoopes jynx: { inherit: true, - baseStats: {hp: 65, atk: 50, def: 35, spa: 115, spd: 115, spe: 95}, - abilities: {0: "I Did It Again"}, + baseStats: { hp: 65, atk: 50, def: 35, spa: 115, spd: 115, spe: 95 }, + abilities: { 0: "I Did It Again" }, }, // Pissog volcarona: { inherit: true, - abilities: {0: "Drought"}, + abilities: { 0: "Drought" }, }, frosmoth: { inherit: true, - abilities: {0: "Snow Warning"}, + abilities: { 0: "Snow Warning" }, }, // pokemonvortex pokestarsmeargle: { inherit: true, - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Prankster"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Prankster" }, }, // Princess Autumn altaria: { inherit: true, - abilities: {0: "Last Hymn"}, + abilities: { 0: "Last Hymn" }, }, altariamega: { inherit: true, - abilities: {0: "Last Hymn"}, + abilities: { 0: "Last Hymn" }, }, // ptoad politoed: { inherit: true, - abilities: {0: "Drizzle"}, + abilities: { 0: "Drizzle" }, }, // Pulse_kS hydreigon: { inherit: true, - abilities: {0: "Pulse Luck"}, + abilities: { 0: "Pulse Luck" }, }, // PYRO kingambit: { inherit: true, - abilities: {0: "Hardcore Hustle"}, + abilities: { 0: "Hardcore Hustle" }, }, // Quite Quiet ribombee: { inherit: true, - abilities: {0: "Fancy Scarf"}, + abilities: { 0: "Fancy Scarf" }, }, // quziel chromera: { inherit: true, - abilities: {0: "High Performance Computing"}, + abilities: { 0: "High Performance Computing" }, }, // R8 chansey: { inherit: true, - abilities: {0: "Anti-Pelau"}, + abilities: { 0: "Anti-Pelau" }, }, // Rainshaft xerneas: { inherit: true, - abilities: {0: "Rainy's Aura"}, + abilities: { 0: "Rainy's Aura" }, }, // Ransei audinomega: { inherit: true, - abilities: {0: "Healer", 1: "Ultra Mystik"}, + abilities: { 0: "Healer", 1: "Ultra Mystik" }, }, // ReturnToMonkey oranguru: { inherit: true, - abilities: {0: "Monke See Monke Do"}, + abilities: { 0: "Monke See Monke Do" }, }, // Rio Vidal archaludon: { inherit: true, - abilities: {0: "Built Different"}, + abilities: { 0: "Built Different" }, }, // Rissoux arcaninehisui: { inherit: true, - abilities: {0: "Hard Headed"}, + abilities: { 0: "Hard Headed" }, }, // RSB growlithe: { inherit: true, - baseStats: {hp: 70, atk: 86, def: 60, spa: 86, spd: 66, spe: 76}, - abilities: {0: "Hot Pursuit"}, + baseStats: { hp: 70, atk: 86, def: 60, spa: 86, spd: 66, spe: 76 }, + abilities: { 0: "Hot Pursuit" }, }, // Rumia duskull: { inherit: true, types: ["Ghost", "Dark"], - baseStats: {hp: 50, atk: 55, def: 90, spa: 90, spd: 55, spe: 55}, - abilities: {0: "Youkai of the Dusk"}, + baseStats: { hp: 50, atk: 55, def: 90, spa: 90, spd: 55, spe: 55 }, + abilities: { 0: "Youkai of the Dusk" }, }, // Scotteh suicune: { inherit: true, - abilities: {0: "Water Absorb"}, + abilities: { 0: "Water Absorb" }, }, // SexyMalasada typhlosion: { inherit: true, - abilities: {0: "Ancestry Ritual"}, + abilities: { 0: "Ancestry Ritual" }, }, typhlosionhisui: { inherit: true, - abilities: {0: "Ancestry Ritual"}, + abilities: { 0: "Ancestry Ritual" }, }, // sharp_claw sneasel: { inherit: true, - baseStats: {hp: 55, atk: 105, def: 95, spa: 35, spd: 95, spe: 135}, - abilities: {0: "Regenerator"}, + baseStats: { hp: 55, atk: 105, def: 95, spa: 35, spd: 95, spe: 135 }, + abilities: { 0: "Regenerator" }, }, sneaselhisui: { inherit: true, - baseStats: {hp: 55, atk: 135, def: 75, spa: 35, spd: 85, spe: 135}, - abilities: {0: "Regenerator"}, + baseStats: { hp: 55, atk: 135, def: 75, spa: 35, spd: 85, spe: 135 }, + abilities: { 0: "Regenerator" }, }, // Siegfried ampharos: { inherit: true, - abilities: {0: "Static"}, + abilities: { 0: "Static" }, }, ampharosmega: { inherit: true, - abilities: {0: "Magical Mystery Charge"}, + abilities: { 0: "Magical Mystery Charge" }, }, // Sificon hoppip: { inherit: true, - baseStats: {hp: 75, atk: 55, def: 70, spa: 55, spd: 95, spe: 110}, - abilities: {0: "Perfectly Imperfect"}, + baseStats: { hp: 75, atk: 55, def: 70, spa: 55, spd: 95, spe: 110 }, + abilities: { 0: "Perfectly Imperfect" }, }, // skies chespin: { inherit: true, - baseStats: {hp: 88, atk: 107, def: 122, spa: 74, spd: 75, spe: 64}, - abilities: {0: "Spikes of Wrath"}, + baseStats: { hp: 88, atk: 107, def: 122, spa: 74, spd: 75, spe: 64 }, + abilities: { 0: "Spikes of Wrath" }, }, // snake fidgit: { inherit: true, - abilities: {0: "Persistent"}, + abilities: { 0: "Persistent" }, }, // Soft Flex magnezone: { inherit: true, - abilities: {0: "Adaptive Engineering"}, + abilities: { 0: "Adaptive Engineering" }, }, // Solaros & Lunaris scovillain: { inherit: true, - abilities: {0: "Ride the Sun!"}, + abilities: { 0: "Ride the Sun!" }, }, // Spiderz ironthorns: { inherit: true, types: ['Dark', 'Ground'], - abilities: {0: "Poison Heal"}, + abilities: { 0: "Poison Heal" }, }, // spoo hemogoblin: { inherit: true, - abilities: {0: "I Can Hear The Heart Beating As One"}, + abilities: { 0: "I Can Hear The Heart Beating As One" }, }, // Steorra kitsunoh: { inherit: true, - abilities: {0: "Ghostly Hallow"}, + abilities: { 0: "Ghostly Hallow" }, }, // Struchni aggron: { inherit: true, - abilities: {0: "Overasked Clause"}, + abilities: { 0: "Overasked Clause" }, }, // Sulo reuniclus: { inherit: true, - abilities: {0: "Protection of the Gelatin"}, + abilities: { 0: "Protection of the Gelatin" }, }, // Swiffix piplup: { inherit: true, - baseStats: {hp: 64, atk: 66, def: 68, spa: 81, spd: 76, spe: 50}, - abilities: {0: "Stinky"}, + baseStats: { hp: 64, atk: 66, def: 68, spa: 81, spd: 76, spe: 50 }, + abilities: { 0: "Stinky" }, }, // Syrinix ceruledge: { inherit: true, - abilities: {0: "Sword of Ruin"}, + abilities: { 0: "Sword of Ruin" }, }, // Teclis gallade: { inherit: true, - abilities: {0: "Sharpness"}, + abilities: { 0: "Sharpness" }, }, // Tenshi sandshrew: { inherit: true, - baseStats: {hp: 50, atk: 115, def: 130, spa: 50, spd: 65, spe: 98}, - abilities: {0: "Sand Sleuth"}, + baseStats: { hp: 50, atk: 115, def: 130, spa: 50, spd: 65, spe: 98 }, + abilities: { 0: "Sand Sleuth" }, }, // TheJesuchristoOsAma arceus: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusbug: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusdark: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusdragon: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceuselectric: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusfairy: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusfighting: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusfire: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusflying: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusghost: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusgrass: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusground: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusice: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceuspoison: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceuspsychic: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceusrock: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceussteel: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, arceuswater: { inherit: true, - abilities: {0: "The Grace of Jesus Christ"}, + abilities: { 0: "The Grace of Jesus Christ" }, }, // Tico floetteeternal: { inherit: true, - abilities: {0: "Eternal Generator"}, + abilities: { 0: "Eternal Generator" }, }, // trace delphox: { inherit: true, - abilities: {0: "Eyes of Eternity"}, + abilities: { 0: "Eyes of Eternity" }, }, // Tuthur screamtail: { inherit: true, - abilities: {0: "Poison Heal"}, + abilities: { 0: "Poison Heal" }, }, // Two of Roses luxray: { inherit: true, - abilities: {0: "As We See"}, + abilities: { 0: "As We See" }, }, // UT talonflame: { inherit: true, - abilities: {0: "Gale Guard"}, + abilities: { 0: "Gale Guard" }, }, // Valerian lucario: { inherit: true, - abilities: {0: "Full Bloom"}, + abilities: { 0: "Full Bloom" }, }, // Venous mantine: { inherit: true, - abilities: {0: "Concrete Over Water"}, + abilities: { 0: "Concrete Over Water" }, }, // Violet ogerpon: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, ogerpontealtera: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, ogerponcornerstone: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, ogerponcornerstonetera: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, ogerponhearthflame: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, ogerponhearthflametera: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, ogerponwellspring: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, ogerponwellspringtera: { inherit: true, - abilities: {0: "See No Evil, Hear No Evil, Speak No Evil"}, + abilities: { 0: "See No Evil, Hear No Evil, Speak No Evil" }, }, // Vistar zeraora: { inherit: true, - abilities: {0: "Prankster"}, + abilities: { 0: "Prankster" }, }, // vmnunes shayminsky: { inherit: true, - abilities: {0: "Wild Growth"}, + abilities: { 0: "Wild Growth" }, }, // WarriorGallade tropius: { inherit: true, - abilities: {0: "Primeval Harvest"}, + abilities: { 0: "Primeval Harvest" }, }, // Waves wailord: { inherit: true, - abilities: {0: "Primordial Sea"}, + abilities: { 0: "Primordial Sea" }, }, // WigglyTree sudowoodo: { inherit: true, - abilities: {0: "Tree Stance"}, - baseStats: {hp: 70, atk: 100, def: 115, spa: 30, spd: 65, spe: 50}, + abilities: { 0: "Tree Stance" }, + baseStats: { hp: 70, atk: 100, def: 115, spa: 30, spd: 65, spe: 50 }, }, // xy01 blissey: { inherit: true, - abilities: {0: "Panic"}, + abilities: { 0: "Panic" }, }, // yeet dab xd kecleon: { inherit: true, - abilities: {0: "Treasure Bag"}, + abilities: { 0: "Treasure Bag" }, }, // Yellow Paint rotomfrost: { inherit: true, - abilities: {0: "Yellow Magic"}, + abilities: { 0: "Yellow Magic" }, }, ninetalesalola: { inherit: true, - abilities: {0: "Party Up"}, + abilities: { 0: "Party Up" }, }, // YveltalNL farigiraf: { inherit: true, - abilities: {0: "Height Advantage"}, + abilities: { 0: "Height Advantage" }, }, // za greedent: { inherit: true, - abilities: {0: "Troll"}, + abilities: { 0: "Troll" }, }, // Zalm weedle: { inherit: true, - baseStats: {hp: 100, atk: 90, def: 100, spa: 35, spd: 90, spe: 100}, - abilities: {0: "Water Bubble"}, + baseStats: { hp: 100, atk: 90, def: 100, spa: 35, spd: 90, spe: 100 }, + abilities: { 0: "Water Bubble" }, }, // Zarel meloetta: { inherit: true, - abilities: {0: "Tempo Change"}, + abilities: { 0: "Tempo Change" }, }, meloettapirouette: { inherit: true, - abilities: {0: "Tempo Change"}, + abilities: { 0: "Tempo Change" }, }, // zee lilliganthisui: { inherit: true, - abilities: {0: "Chlorophyll"}, + abilities: { 0: "Chlorophyll" }, }, // zoro umbreon: { inherit: true, - abilities: {0: "Nine Lives"}, + abilities: { 0: "Nine Lives" }, }, }; diff --git a/data/mods/gen9ssb/random-teams.ts b/data/mods/gen9ssb/random-teams.ts index 45bc5d9487..1e60728bf8 100644 --- a/data/mods/gen9ssb/random-teams.ts +++ b/data/mods/gen9ssb/random-teams.ts @@ -7,8 +7,8 @@ export interface SSBSet { gender: GenderName | GenderName[]; moves: (string | string[])[]; signatureMove: string; - evs?: {hp?: number, atk?: number, def?: number, spa?: number, spd?: number, spe?: number}; - ivs?: {hp?: number, atk?: number, def?: number, spa?: number, spd?: number, spe?: number}; + evs?: { hp?: number, atk?: number, def?: number, spa?: number, spd?: number, spe?: number }; + ivs?: { hp?: number, atk?: number, def?: number, spa?: number, spd?: number, spe?: number }; nature?: string | string[]; shiny?: number | boolean; level?: number; @@ -16,7 +16,7 @@ export interface SSBSet { skip?: string; teraType?: string | string[]; } -interface SSBSets {[k: string]: SSBSet} +interface SSBSets { [k: string]: SSBSet } export const ssbSets: SSBSets = { /* @@ -40,127 +40,127 @@ export const ssbSets: SSBSets = { species: 'Scizor', ability: 'Unburden', item: 'Lansat Berry', gender: 'M', moves: ['Acrobatics', 'Attack Order', ['Cross Chop', 'Night Slash']], signatureMove: 'Equip Aegislash', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Adamant', teraType: 'Flying', + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Adamant', teraType: 'Flying', }, Aelita: { species: 'Melmetal', ability: 'Fortified Metal', item: 'Leftovers', gender: '', moves: ['Heavy Slam', 'Bitter Blade', 'Liquidation'], signatureMove: 'Smelt', - evs: {hp: 252, atk: 4, spd: 252}, nature: 'Careful', teraType: 'Steel', shiny: true, + evs: { hp: 252, atk: 4, spd: 252 }, nature: 'Careful', teraType: 'Steel', shiny: true, }, Aethernum: { species: 'Giratina-Origin', ability: 'The Eminence in the Shadow', item: 'Griseous Core', gender: '', moves: ['Fiery Wrath', 'Lunar Blessing', 'Dragon Energy'], signatureMove: 'I. AM. ATOMIC.', - evs: {atk: 4, spa: 252, spe: 252}, nature: 'Hasty', teraType: 'Dark', shiny: true, + evs: { atk: 4, spa: 252, spe: 252 }, nature: 'Hasty', teraType: 'Dark', shiny: true, }, Akir: { species: 'Slowbro', ability: 'Take it Slow', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Future Sight', 'Slack Off', 'Steam Eruption'], signatureMove: 'Free Switch Button', - evs: {hp: 248, def: 8, spa: 252}, ivs: {spe: 0}, nature: 'Relaxed', teraType: 'Fairy', + evs: { hp: 248, def: 8, spa: 252 }, ivs: { spe: 0 }, nature: 'Relaxed', teraType: 'Fairy', }, Alex: { species: 'Sprigatito', ability: 'Pawprints', item: 'Eviolite', gender: '', moves: [['Charm', 'Tickle'], 'Protect', 'Soak'], signatureMove: 'Spicier Extract', - evs: {hp: 252, def: 4, spd: 252}, nature: 'Careful', teraType: 'Water', + evs: { hp: 252, def: 4, spd: 252 }, nature: 'Careful', teraType: 'Water', }, Alexander489: { species: 'Charizard', ability: 'Confirmed Town', item: 'Heavy-Duty Boots', gender: 'M', moves: ['No Retreat', 'Bitter Blade', 'Dual Wingbeat'], signatureMove: 'Scumhunt', - evs: {atk: 252, spa: 4, spe: 252}, nature: 'Naughty', teraType: 'Fire', shiny: true, + evs: { atk: 252, spa: 4, spe: 252 }, nature: 'Naughty', teraType: 'Fire', shiny: true, }, Apple: { species: 'Applin', ability: 'Orchard\'s Gift', item: 'Lum Berry', gender: ['M', 'F'], moves: ['Apple Acid', 'Leech Seed', 'Dragon Pulse'], signatureMove: 'Wopple or Flopple', - evs: {hp: 252, spa: 4, spd: 252}, nature: 'Sassy', shiny: 2, teraType: 'Dragon', + evs: { hp: 252, spa: 4, spd: 252 }, nature: 'Sassy', shiny: 2, teraType: 'Dragon', }, 'Appletun a la Mode': { species: 'Appletun', ability: 'Served Cold', item: 'Sitrus Berry', gender: 'F', moves: ['Freeze-Dry', 'Apple Acid', 'Fickle Beam'], signatureMove: "Extra Course", - evs: {hp: 252, spa: 4, spd: 252}, nature: 'Calm', teraType: 'Ground', + evs: { hp: 252, spa: 4, spd: 252 }, nature: 'Calm', teraType: 'Ground', }, aQrator: { species: 'Totodile', ability: 'Neverending fHunt', item: 'Eviolite', gender: 'F', moves: ['Whirlpool', 'Noble Roar', 'Slack Off'], signatureMove: "Tori's Stori", - evs: {hp: 252, def: 4, spd: 252}, nature: 'Sassy', teraType: 'Fighting', + evs: { hp: 252, def: 4, spd: 252 }, nature: 'Sassy', teraType: 'Fighting', }, 'A Quag To The Past': { species: 'Quagsire', ability: 'Quag of Ruin', item: 'Leftovers', gender: 'M', moves: ['Surging Strikes', 'Precipice Blades', 'Gunk Shot'], signatureMove: 'Sire Switch', - evs: {hp: 252, def: 4, spd: 252}, nature: 'Careful', teraType: 'Water', + evs: { hp: 252, def: 4, spd: 252 }, nature: 'Careful', teraType: 'Water', }, 'A Quag To The Past-Clodsire': { species: 'Clodsire', ability: 'Clod of Ruin', item: 'Leftovers', gender: 'M', moves: ['Coil', 'Strength Sap', 'Toxic'], signatureMove: 'Sire Switch', - evs: {hp: 252, def: 4, spd: 252}, nature: 'Careful', teraType: 'Poison', skip: 'A Quag To The Past', + evs: { hp: 252, def: 4, spd: 252 }, nature: 'Careful', teraType: 'Poison', skip: 'A Quag To The Past', }, Archas: { species: 'Lilligant', ability: 'Saintly Bullet', item: 'Lilligantium Z', gender: 'F', moves: ['Giga Drain', 'Snipe Shot', 'Aeroblast'], signatureMove: 'Quiver Dance', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', }, Arcueid: { species: 'Deoxys-Defense', ability: 'Marble Phantasm', item: 'Heavy-Duty Boots', gender: 'N', moves: [['Lunar Blessing', 'Jungle Healing'], 'Body Press', ['Toxic', 'Will-O-Wisp', 'Topsy-Turvy']], signatureMove: 'Funny Vamp', - evs: {hp: 248, def: 252, spd: 8}, nature: 'Bold', teraType: 'Fairy', shiny: true, + evs: { hp: 248, def: 252, spd: 8 }, nature: 'Bold', teraType: 'Fairy', shiny: true, }, 'Arcueid-Attack': { species: 'Deoxys-Attack', ability: 'Marble Phantasm', item: 'Heavy-Duty Boots', gender: 'N', moves: ['Moonblast', 'Photon Geyser', 'Flamethrower'], signatureMove: 'Funny Vamp', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Fairy', shiny: true, skip: 'Arcueid', + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Fairy', shiny: true, skip: 'Arcueid', }, Arsenal: { species: 'Rabsca', ability: 'Absorb Phys', item: 'Covert Cloak', gender: 'N', moves: ['Recover', 'Calm Mind', 'Speed Swap'], signatureMove: 'Megidolaon', - evs: {hp: 4, spa: 252, spd: 252}, nature: 'Modest', teraType: 'Stellar', shiny: true, + evs: { hp: 4, spa: 252, spd: 252 }, nature: 'Modest', teraType: 'Stellar', shiny: true, }, Artemis: { species: 'Genesect', ability: 'Supervised Learning', item: 'Choice Specs', gender: 'N', moves: [], signatureMove: 'Automated Response', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Serious', shiny: true, + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Serious', shiny: true, }, Arya: { species: 'Flygon', ability: 'Tinted Lens', item: 'Flygonite', gender: 'F', moves: ['Clanging Scales', 'Roost', 'Bug Buzz'], signatureMove: 'Anyone can be killed', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', }, Audiino: { species: 'Audino', ability: 'Mitosis', item: 'Leftovers', gender: 'N', moves: ['Recover', 'Moongeist Beam', 'Hyper Voice'], signatureMove: 'Thinking In Progress', - evs: {hp: 252, def: 4, spa: 252}, nature: 'Modest', teraType: 'Ghost', + evs: { hp: 252, def: 4, spa: 252 }, nature: 'Modest', teraType: 'Ghost', }, autumn: { species: 'Flutter Mane', ability: 'Protosynthesis', item: 'Booster Energy', gender: 'N', moves: ['Moonblast', 'Taunt', 'Strength Sap'], signatureMove: 'Season\'s Smite', - evs: {def: 8, spa: 244, spe: 252}, nature: 'Timid', teraType: 'Fairy', + evs: { def: 8, spa: 244, spe: 252 }, nature: 'Timid', teraType: 'Fairy', }, ausma: { species: 'Hatterene', ability: 'Cascade', item: 'Leftovers', gender: 'F', moves: ['Light of Ruin', 'Strength Sap', 'Substitute'], signatureMove: 'Sigil\'s Storm', - evs: {hp: 252, def: 4, spa: 252}, ivs: {atk: 0, spe: 0}, nature: 'Modest', teraType: 'Fairy', + evs: { hp: 252, def: 4, spa: 252 }, ivs: { atk: 0, spe: 0 }, nature: 'Modest', teraType: 'Fairy', }, 'ausma-Mismagius': { species: 'Mismagius', ability: 'Levitate', item: 'Leftovers', gender: 'F', moves: ['Light of Ruin', 'Strength Sap', 'Substitute'], signatureMove: 'Sigil\'s Storm', - evs: {spa: 252, spd: 4, spe: 252}, ivs: {atk: 0}, nature: 'Modest', teraType: 'Fairy', skip: 'ausma', + evs: { spa: 252, spd: 4, spe: 252 }, ivs: { atk: 0 }, nature: 'Modest', teraType: 'Fairy', skip: 'ausma', }, 'ausma-Fennekin': { species: 'Fennekin', ability: 'Blaze', item: '', gender: '', @@ -172,67 +172,67 @@ export const ssbSets: SSBSets = { species: 'Swoobat', ability: 'Magic Guard', item: 'Focus Sash', gender: 'M', moves: ['Stored Power', 'Hurricane', ['Roost', 'Focus Blast']], signatureMove: 'Prep Time', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Psychic', shiny: 8192, + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Psychic', shiny: 8192, }, avarice: { species: 'Sinistcha-Masterpiece', ability: 'Serene Grace', item: ['Covert Cloak', 'Leftovers'], gender: 'N', moves: ['Strength Sap', 'Calm Mind', 'Matcha Gotcha'], signatureMove: 'yu-gi-oh reference', - evs: {hp: 252, def: 160, spe: 90}, nature: 'Bold', teraType: 'Steel', + evs: { hp: 252, def: 160, spe: 90 }, nature: 'Bold', teraType: 'Steel', }, Beowulf: { species: 'Beedrill', ability: 'Intrepid Sword', item: 'Beedrillite', gender: 'M', moves: ['Poison Jab', 'X-Scissor', ['Earthquake', 'Volt Tackle', 'Glacial Lance']], signatureMove: 'Buzzer Stinger Counter', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Jolly', shiny: 2, + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Jolly', shiny: 2, }, berry: { species: 'Regirock', ability: 'Sturdy', item: 'Maranga Berry', gender: 'F', moves: ['Curse', 'Salt Cure', 'Stone Axe'], signatureMove: 'what kind', - evs: {hp: 252, atk: 4, spd: 252}, nature: 'Careful', teraType: 'Rock', + evs: { hp: 252, atk: 4, spd: 252 }, nature: 'Careful', teraType: 'Rock', }, Bert122: { species: 'Sableye', ability: 'Prankster', item: 'Sablenite', gender: '', moves: ['Metal Burst', 'Recover', 'Will-O-Wisp'], signatureMove: 'Shatter and Scatter', - evs: {hp: 252, def: 28, spd: 224}, ivs: {atk: 0, spe: 0}, nature: 'Relaxed', + evs: { hp: 252, def: 28, spd: 224 }, ivs: { atk: 0, spe: 0 }, nature: 'Relaxed', }, Billo: { species: 'Cosmog', ability: 'Wonder Guard', item: 'Eviolite', gender: 'N', moves: [], signatureMove: 'Hack Check', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', }, 'Billo-Solgaleo': { species: 'Solgaleo', ability: 'Magic Guard', item: 'Choice Scarf', gender: 'N', moves: ['Wave Crash', 'Volt Tackle', 'Flare Blitz'], signatureMove: 'Head Smash', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', skip: 'Billo', shiny: true, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', skip: 'Billo', shiny: true, }, 'Billo-Lunala': { species: 'Lunala', ability: 'Shadow Shield', item: 'Lunalium Z', gender: 'N', moves: ['Moongeist Beam', 'Moonblast', 'Ice Beam'], signatureMove: 'Thunderbolt', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', skip: 'Billo', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', skip: 'Billo', }, blazeofvictory: { species: 'Sylveon', ability: 'Prismatic Lens', item: 'Leftovers', gender: 'F', moves: ['Wish', 'Baton Pass', 'Hyper Voice'], signatureMove: 'Veto', - evs: {hp: 252, spa: 252, spe: 4}, nature: 'Modest', teraType: 'Fairy', + evs: { hp: 252, spa: 252, spe: 4 }, nature: 'Modest', teraType: 'Fairy', }, Blitz: { species: 'Chi-Yu', ability: 'Blitz of Ruin', item: 'Life Orb', gender: 'N', moves: ['Fiery Wrath', 'Lava Plume', 'Nasty Plot'], signatureMove: 'Geyser Blast', - evs: {def: 4, spa: 252, spe: 252}, nature: 'Modest', teraType: 'Water', shiny: true, + evs: { def: 4, spa: 252, spe: 252 }, nature: 'Modest', teraType: 'Water', shiny: true, }, Breadey: { species: 'Dachsbun', ability: 'Painful Exit', item: 'Leftovers', gender: '', moves: ['Protect', 'Rest', 'Play Rough'], signatureMove: 'Baker\'s Douze Off', - evs: {hp: 252, def: 252, spd: 4}, nature: 'Impish', teraType: 'Steel', + evs: { hp: 252, def: 252, spd: 4 }, nature: 'Impish', teraType: 'Steel', }, Cake: { species: 'Dunsparce', ability: 'Scrappy', item: 'Eviolite', gender: 'N', @@ -243,38 +243,38 @@ export const ssbSets: SSBSets = { 'Snatch', 'Heal Order', 'Parting Shot', 'Population Bomb', 'Metronome', ], signatureMove: 'Role System', - // eslint-disable-next-line max-len - evs: {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}, nature: 'Hardy', teraType: ['Ghost', 'Poison', 'Fairy'], shiny: 1024, level: 97, + // eslint-disable-next-line @stylistic/max-len + evs: { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }, nature: 'Hardy', teraType: ['Ghost', 'Poison', 'Fairy'], shiny: 1024, level: 97, }, chaos: { species: 'Iron Jugulis', ability: 'Transistor', item: 'Heavy-Duty Boots', gender: 'N', moves: [['Oblivion Wing', 'Hurricane'], ['Thunderclap', 'Volt Switch'], ['Defog', 'Roost']], signatureMove: 'Outage', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: ['Steel', 'Flying', 'Electric', 'Dark'], + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: ['Steel', 'Flying', 'Electric', 'Dark'], }, Chloe: { species: 'Tsareena', ability: 'Acetosa', item: 'Assault Vest', gender: 'F', moves: ['Rapid Spin', 'Fishious Rend', 'Stone Axe'], signatureMove: 'De Todas las Flores', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Grass', shiny: true, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Grass', shiny: true, }, Chris: { species: 'Raging Bolt', ability: 'Astrothunder', item: 'Leftovers', gender: 'N', moves: ['Thunder', 'Dragon Pulse', 'Calm Mind'], signatureMove: 'Antidote', - evs: {hp: 148, def: 156, spa: 204}, nature: 'Quiet', teraType: 'Steel', + evs: { hp: 148, def: 156, spa: 204 }, nature: 'Quiet', teraType: 'Steel', }, ciran: { species: 'Rapidash', ability: 'Defiant', item: 'Heavy-Duty Boots', gender: 'N', moves: ['Protect', 'Sketch', 'Bitter Blade'], signatureMove: 'Summon Monster VIII: Fiendish monstrous Piplupede, Colossal', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Poison', shiny: true, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Poison', shiny: true, }, Clefable: { species: 'Clefable', ability: 'That\'s Hacked', item: 'Leftovers', gender: 'M', moves: ['Cosmic Power', 'Soft-Boiled', 'Thunder Wave'], signatureMove: 'Giveaway!', - evs: {hp: 252, def: 200, spd: 56}, nature: 'Calm', teraType: 'Any', shiny: true, + evs: { hp: 252, def: 200, spd: 56 }, nature: 'Calm', teraType: 'Any', shiny: true, }, Clementine: { species: 'Avalugg', ability: 'Melting Point', item: 'Heavy-Duty Boots', gender: '', @@ -292,651 +292,651 @@ export const ssbSets: SSBSets = { species: 'Mimikyu', ability: 'Masquerade', item: 'Ghostium Z', gender: 'F', moves: ['Protect', 'Substitute', 'Phantom Force'], signatureMove: 'Stockholm Syndrome', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', }, Clouds: { species: 'Corvisquire', ability: 'Jet Stream', item: 'Leftovers', gender: 'M', moves: ['Brave Bird', 'Roost', 'Defog'], signatureMove: 'Winds of Change', - evs: {hp: 252, atk: 4, def: 252}, nature: 'Jolly', teraType: 'Flying', shiny: 822, + evs: { hp: 252, atk: 4, def: 252 }, nature: 'Jolly', teraType: 'Flying', shiny: 822, }, Coolcodename: { species: 'Victini', ability: 'Firewall', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Searing Shot', 'Psychic', 'Dazzling Gleam'], signatureMove: 'Haxer\'s Will', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Fairy', shiny: 1024, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Fairy', shiny: 1024, }, Corthius: { species: 'Thwackey', ability: 'Grassy Emperor', item: 'Eviolite', gender: 'M', moves: ['Swords Dance', 'U-turn', 'Close Combat'], signatureMove: 'Monkey Beat Up', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Adamant', shiny: 69, + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Adamant', shiny: 69, }, 'Dawn of Artemis': { species: 'Necrozma', ability: 'Form Change', item: 'Expert Belt', gender: 'F', moves: ['Calm Mind', 'Photon Geyser', 'Earth Power'], signatureMove: 'Magical Focus', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Psychic', shiny: 8192, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Psychic', shiny: 8192, }, 'Dawn of Artemis-Ultra': { species: 'Necrozma-Ultra', ability: 'Form Change', item: 'Expert Belt', gender: 'F', moves: ['Swords Dance', 'Photon Geyser', 'Outrage'], signatureMove: 'Magical Focus', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Dragon', skip: 'Dawn of Artemis', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Dragon', skip: 'Dawn of Artemis', }, DaWoblefet: { species: 'Wobbuffet', ability: 'Shadow Artifice', item: 'Iapapa Berry', gender: 'M', moves: ['Counter', 'Mirror Coat', 'Encore'], signatureMove: 'Super Ego Inflation', - evs: {hp: 252, def: 252, spd: 4}, ivs: {spe: 0}, nature: 'Relaxed', teraType: 'Fairy', + evs: { hp: 252, def: 252, spd: 4 }, ivs: { spe: 0 }, nature: 'Relaxed', teraType: 'Fairy', }, deftinwolf: { species: 'Yveltal', ability: 'Sharpness', item: 'Dread Plate', gender: '', moves: ['Aerial Ace', 'Ceaseless Edge', 'Cross Poison'], signatureMove: 'Trivial Pursuit', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Adamant', teraType: 'Poison', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Adamant', teraType: 'Poison', }, dhelmise: { species: 'Slowking-Galar', ability: 'Coalescence', item: 'Black Sludge', gender: 'N', moves: ['Sludge Bomb', 'Psychic Noise', 'Parting Shot'], signatureMove: 'Biotic Orb', - evs: {hp: 252, def: 252, spa: 4}, nature: 'Bold', teraType: ['Psychic', 'Poison'], + evs: { hp: 252, def: 252, spa: 4 }, nature: 'Bold', teraType: ['Psychic', 'Poison'], }, DianaNicole: { species: 'Abomasnow', ability: 'Snow Warning', item: 'Abomasite', gender: 'F', moves: ['Giga Drain', 'Earth Power', 'Blizzard'], signatureMove: 'Breath of Tiamat', - evs: {hp: 252, def: 4, spa: 252}, nature: 'Modest', shiny: true, + evs: { hp: 252, def: 4, spa: 252 }, nature: 'Modest', shiny: true, }, EasyOnTheHills: { species: 'Snorlax', ability: 'Immunity', item: 'Life Orb', gender: 'M', moves: ['Darkest Lariat', 'Body Slam', 'Heavy Slam'], signatureMove: 'Snack Time', - evs: {hp: 252, atk: 252, spd: 4}, nature: 'Adamant', teraType: 'Ghost', shiny: true, + evs: { hp: 252, atk: 252, spd: 4 }, nature: 'Adamant', teraType: 'Ghost', shiny: true, }, Elliot: { species: 'Sinistea', ability: 'Natural Cure', item: 'Focus Sash', gender: 'N', moves: ['Moonblast', 'Shadow Ball', 'Teatime'], signatureMove: 'Tea Party', - evs: {def: 4, spa: 252, spe: 252}, nature: 'Modest', teraType: 'Water', shiny: true, + evs: { def: 4, spa: 252, spe: 252 }, nature: 'Modest', teraType: 'Water', shiny: true, }, Elly: { species: 'Thundurus', ability: 'Storm Surge', item: 'Heavy-Duty Boots', gender: 'F', moves: ['Wildbolt Storm', 'Sandsear Storm', 'Volt Switch'], signatureMove: 'Sustained Winds', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Ground', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Ground', }, Emboar02: { species: 'Emboar', ability: 'Hogwash', item: 'Choice Band', gender: 'F', moves: ['Flare Blitz', 'Wave Crash', 'Volt Tackle'], signatureMove: 'Insert boar pun here', - // eslint-disable-next-line max-len - evs: {hp: 252, atk: 252, def: 4}, nature: 'Adamant', teraType: ['Fire', 'Water', 'Fighting', 'Electric'], shiny: 50 / 49, + // eslint-disable-next-line @stylistic/max-len + evs: { hp: 252, atk: 252, def: 4 }, nature: 'Adamant', teraType: ['Fire', 'Water', 'Fighting', 'Electric'], shiny: 50 / 49, }, Fame: { species: 'Jumpluff', ability: 'Social Jumpluff Warrior', item: 'Leftovers', gender: 'F', moves: ['Air Slash', 'Thunder Wave', 'Toxic'], signatureMove: 'Solidarity', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Fire', + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Fire', }, Felucia: { species: 'Vespiquen', ability: 'Mountaineer', item: 'Red Card', gender: 'F', moves: ['Strength Sap', ['Oblivion Wing', 'Night Shade'], ['Thief', 'Calm Mind', 'Toxic']], signatureMove: 'Rigged Dice', - evs: {hp: 252, def: 4, spd: 252}, nature: 'Calm', + evs: { hp: 252, def: 4, spd: 252 }, nature: 'Calm', }, Froggeh: { species: 'Toxicroak', ability: 'Super Luck', item: 'Leftovers', gender: 'M', moves: ['Gunk Shot', 'Sucker Punch', 'Drain Punch'], signatureMove: 'Cringe Dad Joke', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Adamant', teraType: 'Dark', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Adamant', teraType: 'Dark', }, Frostyicelad: { species: 'Qwilfish-Hisui', ability: 'Almost Frosty', item: 'Eviolite', gender: 'M', moves: ['Darkest Lariat', 'Recover', ['Dire Claw', 'Meteor Mash', 'Bitter Malice']], signatureMove: 'Puffy Spiky Destruction', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: ['Dark', 'Poison', 'Ghost', 'Steel'], shiny: 1024, + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: ['Dark', 'Poison', 'Ghost', 'Steel'], shiny: 1024, }, Frozoid: { species: 'Gible', ability: 'Snowballer', item: 'Eviolite', gender: 'M', moves: ['Dragon Dance', 'Dragon Rush', 'Precipice Blades'], signatureMove: 'Flat out falling', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Adamant', teraType: 'Any', shiny: true, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Adamant', teraType: 'Any', shiny: true, }, Ganjafin: { species: 'Wiglett', ability: 'Gambling Addiction', item: 'Eviolite', gender: 'M', moves: ['Wrap', 'Cosmic Power', 'Strength Sap'], signatureMove: 'Wiggling Strike', - evs: {hp: 252, def: 4, spe: 252}, nature: 'Timid', teraType: 'Grass', shiny: 2, + evs: { hp: 252, def: 4, spe: 252 }, nature: 'Timid', teraType: 'Grass', shiny: 2, }, 'Haste Inky': { species: 'Falinks', ability: 'Simple', item: 'Sitrus Berry', gender: 'N', moves: ['Superpower', 'Ice Hammer', 'Throat Chop'], signatureMove: 'Hasty Revolution', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Dark', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Dark', }, havi: { species: 'Gastly', ability: 'Mensis Cage', item: 'Leftovers', gender: 'F', moves: ['Astral Barrage', 'Moonblast', 'Substitute'], signatureMove: 'Augur of Ebrietas', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Ghost', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Ghost', }, Hecate: { species: 'Mewtwo', ability: 'Hacking', item: 'Mewtwonite X', gender: 'F', moves: ['Photon Geyser', 'Drain Punch', 'Iron Head'], signatureMove: 'Testing in Production', - evs: {atk: 252, spa: 4, spe: 252}, nature: 'Jolly', + evs: { atk: 252, spa: 4, spe: 252 }, nature: 'Jolly', }, HiZo: { species: 'Zoroark-Hisui', ability: 'Justified', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Last Respects', 'Blood Moon', 'Spirit Break'], signatureMove: 'Scapegoat', - evs: {atk: 252, spa: 4, spe: 252}, nature: 'Naive', teraType: 'Fairy', + evs: { atk: 252, spa: 4, spe: 252 }, nature: 'Naive', teraType: 'Fairy', }, HoeenHero: { species: 'Ludicolo', ability: 'Misspelled', item: 'Life Orb', gender: 'M', moves: [['Hydro Pump', 'Surf'], 'Giga Drain', 'Ice Beam'], signatureMove: 'Re-Program', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Water', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Water', }, hsy: { species: 'Ursaluna', ability: 'Hustle', item: 'Blunder Policy', gender: 'M', moves: ['Drill Peck', 'Egg Bomb', 'Headlong Rush'], signatureMove: 'Wonder Wing', - evs: {hp: 252, atk: 252, spe: 4}, nature: 'Adamant', teraType: 'Flying', + evs: { hp: 252, atk: 252, spe: 4 }, nature: 'Adamant', teraType: 'Flying', }, Hydrostatics: { species: 'Pichu-Spiky-eared', ability: 'Hydrostatic Positivity', item: 'Eviolite', gender: 'M', moves: ['Hydro Pump', 'Thunder', 'Ice Beam'], signatureMove: 'Hydrostatics', - evs: {def: 4, spa: 252, spe: 252}, nature: 'Modest', teraType: 'Water', shiny: 2, + evs: { def: 4, spa: 252, spe: 252 }, nature: 'Modest', teraType: 'Water', shiny: 2, }, Imperial: { species: 'Kyurem', ability: 'Frozen Fortuity', item: 'Never-Melt Ice', gender: 'N', moves: ['Chilly Reception', 'Fusion Bolt', 'Fusion Flare'], signatureMove: 'Storm Shroud', - evs: {atk: 128, spa: 128, spe: 252}, nature: 'Docile', teraType: 'Ice', shiny: 193, + evs: { atk: 128, spa: 128, spe: 252 }, nature: 'Docile', teraType: 'Ice', shiny: 193, }, 'Imperial-Black': { species: 'Kyurem-Black', ability: 'Frozen Fortuity', item: 'Never-Melt Ice', gender: 'N', moves: ['Mountain Gale', 'Fusion Bolt', 'Ice Shard'], signatureMove: 'Storm Shroud', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Adamant', teraType: 'Electric', shiny: 193, skip: 'Imperial', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Adamant', teraType: 'Electric', shiny: 193, skip: 'Imperial', }, 'Imperial-White': { species: 'Kyurem-White', ability: 'Frozen Fortuity', item: 'Never-Melt Ice', gender: 'N', moves: ['Ice Beam', 'Freeze-Dry', 'Fusion Flare'], signatureMove: 'Storm Shroud', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Modest', teraType: 'Fire', shiny: 193, skip: 'Imperial', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Modest', teraType: 'Fire', shiny: 193, skip: 'Imperial', }, 'in the hills': { species: 'Gligar', ability: 'Illiterit', item: 'Eviolite', gender: 'M', moves: ['Roost', 'Knock Off', 'Tidy Up'], signatureMove: '10-20-40', - evs: {hp: 252, def: 4, spd: 252}, nature: 'Careful', teraType: 'Water', + evs: { hp: 252, def: 4, spd: 252 }, nature: 'Careful', teraType: 'Water', }, ironwater: { species: 'Jirachi', ability: 'Good as Gold', item: 'Leftovers', gender: 'N', moves: ['Swords Dance', 'Zen Headbutt', 'Hammer Arm'], signatureMove: 'Jirachi Ban Hammer', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Steel', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Steel', }, 'Irpachuza!': { species: 'Mr. Mime', ability: 'Mime knows best', item: 'Irpatuzinium Z', gender: 'M', moves: [['Destiny Bond', 'Lunar Dance'], 'Parting Shot', 'Taunt'], signatureMove: 'Fleur Cannon', - evs: {hp: 252, spa: 4, spd: 252}, nature: 'Modest', + evs: { hp: 252, spa: 4, spd: 252 }, nature: 'Modest', }, Isaiah: { species: 'Medicham', ability: 'Psychic Surge', item: 'Medichamite', gender: 'M', moves: ['Close Combat', 'Knock Off', 'Triple Axel'], signatureMove: 'Simple Gameplan', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', shiny: true, + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', shiny: true, }, 'J0rdy004 ♫': { species: 'Vulpix-Alola', ability: 'Fortifying Frost', item: 'Never-Melt Ice', gender: 'N', moves: ['Blizzard', 'Focus Blast', 'Recover'], signatureMove: 'Snowy Samba', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', shiny: 4, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', shiny: 4, }, Kalalokki: { species: 'Flamigo', ability: 'Scrappy', item: 'Choice Band', gender: 'M', moves: ['Brave Bird', 'Sucker Punch', ['Drain Punch', 'Rapid Spin']], signatureMove: 'Knot Weak', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: ['Fighting', 'Flying'], + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: ['Fighting', 'Flying'], }, Karthik: { species: 'Staraptor', ability: 'Tough Claws', item: 'Choice Scarf', gender: 'M', moves: ['Brave Bird', 'Head Smash', ['Flare Blitz', 'Wave Crash']], signatureMove: 'Salvaged Sacrifice', - evs: {hp: 252, atk: 4, spe: 252}, nature: 'Adamant', teraType: 'Flying', + evs: { hp: 252, atk: 4, spe: 252 }, nature: 'Adamant', teraType: 'Flying', }, ken: { species: 'Jigglypuff', ability: 'Aroma Veil', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Dazzling Gleam', 'Heal Order', 'Mortal Spin'], signatureMove: ', (ac)', - evs: {hp: 252, def: 252, spa: 4}, nature: 'Bold', teraType: 'Any', + evs: { hp: 252, def: 252, spa: 4 }, nature: 'Bold', teraType: 'Any', }, kenn: { species: 'Larvitar', ability: 'Deserted Dunes', item: 'Eviolite', gender: 'M', moves: ['Salt Cure', 'Shore Up', ['Precipice Blades', 'Headlong Rush']], signatureMove: 'Stone Faced', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Adamant', teraType: 'Rock', shiny: true, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Adamant', teraType: 'Rock', shiny: true, }, Kennedy: { species: 'Cinderace', ability: 'Anfield', item: 'Berserk Gene', gender: 'M', moves: ['Blaze Kick', ['Triple Kick', 'Trop Kick'], 'U-turn'], signatureMove: 'Hat-Trick', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Any', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Any', }, keys: { species: 'Rayquaza', ability: 'Defeatist', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Oblivion Wing', 'Sizzly Slide', 'Bouncy Bubble'], signatureMove: 'Protector of the Skies', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', shiny: 10, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', shiny: 10, }, kingbaruk: { species: 'Wigglytuff', ability: 'Peer Pressure', item: 'Silk Scarf', gender: 'M', moves: ['Trump Card', 'Encore', ['Protect', 'Thunder Wave']], signatureMove: 'Platinum Record', - evs: {hp: 252, def: 4, spa: 252}, nature: 'Modest', teraType: 'Normal', + evs: { hp: 252, def: 4, spa: 252 }, nature: 'Modest', teraType: 'Normal', }, Kiwi: { species: 'Minccino', ability: 'Sure Hit Sorcery', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Dynamic Punch', 'Substitute', 'Noble Roar'], signatureMove: 'Mad Manifest', - evs: {hp: 252, atk: 144, spe: 112}, nature: 'Adamant', teraType: 'Fighting', shiny: true, + evs: { hp: 252, atk: 144, spe: 112 }, nature: 'Adamant', teraType: 'Fighting', shiny: true, }, Klmondo: { species: 'Cloyster', ability: 'Super Skilled', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Victory Dance', 'Icicle Spear', 'Rock Blast'], signatureMove: 'The Better Water Shuriken', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Adamant', teraType: 'Water', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Adamant', teraType: 'Water', }, 'kolohe ✮彡': { species: 'Pikachu', ability: 'Soul Surfer', item: 'Light Ball', gender: '', moves: ['Thunder', 'Volt Switch', 'Bouncy Bubble'], signatureMove: 'Hang Ten', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Water', + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Water', }, Kry: { species: 'Mawile', ability: 'Flash Freeze', item: 'Mawilite', gender: 'M', moves: ['Sucker Punch', 'Fire Lash', 'Play Rough'], signatureMove: 'Attack of Opportunity', - evs: {hp: 252, atk: 252, spd: 4}, nature: 'Adamant', shiny: 1024, + evs: { hp: 252, atk: 252, spd: 4 }, nature: 'Adamant', shiny: 1024, }, Lasen: { species: 'Zekrom', ability: 'Idealized World', item: 'Leftovers', gender: 'M', moves: ['Volt Switch', 'Fusion Bolt', 'Dragon Claw'], signatureMove: 'Rise Above', - evs: {hp: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Fire', + evs: { hp: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Fire', }, 'Lets go shuckles': { species: 'Shuckle', ability: 'Persistent', item: 'Berry Juice', gender: 'M', moves: ['Diamond Storm', 'Headlong Rush', ['Glacial Lance', 'U-turn']], signatureMove: 'Shuckle Power', - evs: {hp: 252, def: 252, spd: 4}, ivs: {spe: 0}, nature: 'Relaxed', teraType: 'Ground', shiny: 213, + evs: { hp: 252, def: 252, spd: 4 }, ivs: { spe: 0 }, nature: 'Relaxed', teraType: 'Ground', shiny: 213, }, Lily: { species: 'Togedemaru', ability: 'Unaware', item: 'Leftovers', gender: 'F', moves: ['Victory Dance', 'Plasma Fists', 'Meteor Mash'], signatureMove: 'Power Up', - evs: {hp: 252, def: 4, spd: 252}, nature: 'Careful', teraType: 'Fairy', shiny: 1734, + evs: { hp: 252, def: 4, spd: 252 }, nature: 'Careful', teraType: 'Fairy', shiny: 1734, }, Loethalion: { species: 'Ralts', ability: 'Psychic Surge', item: 'Gardevoirite', gender: '', moves: ['Esper Wing', 'Calm Mind', 'Lunar Blessing'], signatureMove: 'Darkmoon Cackle', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', shiny: true, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', shiny: true, }, Lumari: { species: 'Ponyta-Galar', ability: 'Pyrotechnic', item: 'Eviolite', gender: 'F', moves: ['Substitute', 'Sappy Seed', 'Magical Torque'], signatureMove: 'Mystical Bonfire', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Fairy', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Fairy', }, Lunell: { species: 'Vaporeon', ability: 'Low Tide, High Tide', item: 'Leftovers', gender: 'F', moves: ['Hydro Pump', 'Thunder', 'Moonlight'], signatureMove: 'Praise the Moon', - evs: {hp: 252, def: 4, spa: 252}, nature: 'Calm', teraType: 'Fairy', shiny: 512, + evs: { hp: 252, def: 4, spa: 252 }, nature: 'Calm', teraType: 'Fairy', shiny: 512, }, 'Lyna 氷': { species: 'Dragonair', ability: 'Magic Aura', item: 'Eviolite', gender: 'F', moves: ['Victory Dance', 'V-create', 'Glacial Lance'], signatureMove: 'Wrath of Frozen Flames', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Dragon', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Dragon', }, Maia: { species: 'Litwick', ability: 'Power Abuse', item: 'Eviolite', gender: 'F', moves: ['Shadow Ball', 'Flamethrower', 'Giga Drain'], signatureMove: 'Body Count', - evs: {hp: 252, spa: 252, spd: 4}, nature: 'Modest', teraType: 'Ghost', + evs: { hp: 252, spa: 252, spd: 4 }, nature: 'Modest', teraType: 'Ghost', }, 'marillvibes ♫': { species: 'Marill', ability: 'Huge Power', item: 'Life Orb', gender: 'M', moves: ['Surging Strikes', 'Jet Punch', 'Close Combat'], signatureMove: 'Good Vibes Only', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Adamant', teraType: 'Water', shiny: true, + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Adamant', teraType: 'Water', shiny: true, }, Mathy: { species: 'Furret', ability: 'Dynamic Typing', item: 'Big Root', gender: 'M', moves: ['Bitter Blade', 'Swords Dance', 'Taunt'], signatureMove: 'Breaking Change', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Ghost', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Ghost', }, Merritty: { species: 'Torchic', ability: 'End Round', item: 'Eviolite', gender: 'M', moves: ['Quiver Dance', 'Fiery Dance', 'Strength Sap'], signatureMove: 'New Bracket', - evs: {hp: 4, def: 36, spa: 196, spd: 36, spe: 236}, nature: 'Timid', teraType: 'Flying', shiny: true, + evs: { hp: 4, def: 36, spa: 196, spd: 36, spe: 236 }, nature: 'Timid', teraType: 'Flying', shiny: true, }, Meteordash: { species: 'Tatsugiri', ability: 'TatsuGlare', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Spacial Rend', 'Steam Eruption', 'Glare'], signatureMove: 'Plagiarism', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Steel', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Steel', }, Mex: { species: 'Dialga', ability: 'Time Dilation', item: 'Adamant Orb', gender: 'N', moves: ['Dragon Pulse', 'Flash Cannon', ['Aura Sphere', 'Volt Switch', 'Meteor Beam']], signatureMove: 'Time Skip', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Steel', shiny: true, + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Steel', shiny: true, }, Miojo: { species: 'Spheal', ability: 'The Rolling Spheal', item: 'Choice Band', gender: '', moves: ['Liquidation', 'Collision Course', 'Flip Turn'], signatureMove: 'vruuuuuum', - evs: {hp: 8, atk: 252, spd: 4, spe: 244}, nature: 'Jolly', teraType: 'Fighting', shiny: 363, + evs: { hp: 8, atk: 252, spd: 4, spe: 244 }, nature: 'Jolly', teraType: 'Fighting', shiny: 363, }, Monkey: { species: 'Infernape', ability: 'Harambe Hit', item: 'Blunder Policy', gender: 'M', moves: ['Dynamic Punch', 'Plasma Fists', 'Fire Punch'], signatureMove: 'Banana Breakfast', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Jolly', teraType: 'Electric', shiny: 69, + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Jolly', teraType: 'Electric', shiny: 69, }, MyPearl: { species: 'Latios', ability: 'Eon Call', item: 'Soul Dew', gender: 'M', moves: ['Draco Meteor', 'Aura Sphere', 'Flip Turn'], signatureMove: 'Eon Assault', - evs: {hp: 252, def: 4, spe: 252}, ivs: {atk: 0}, nature: 'Timid', teraType: 'Steel', shiny: 50, + evs: { hp: 252, def: 4, spe: 252 }, ivs: { atk: 0 }, nature: 'Timid', teraType: 'Steel', shiny: 50, }, 'MyPearl-Latias': { species: 'Latias', ability: 'Eon Call', item: 'Soul Dew', gender: 'F', moves: ['Calm Mind', 'Recover', 'Thunder Wave'], signatureMove: 'Eon Assault', - evs: {hp: 252, def: 4, spe: 252}, ivs: {atk: 0}, nature: 'Timid', teraType: 'Steel', shiny: 50, skip: 'MyPearl', + evs: { hp: 252, def: 4, spe: 252 }, ivs: { atk: 0 }, nature: 'Timid', teraType: 'Steel', shiny: 50, skip: 'MyPearl', }, Neko: { species: 'Chien-Pao', ability: 'Weatherproof', item: 'Heavy-Duty Boots', gender: 'N', moves: ['Swords Dance', 'Bitter Blade', ['Crunch', 'Sucker Punch']], signatureMove: 'Quality Control Zoomies', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Fire', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Fire', }, Ney: { species: 'Banette', ability: 'Insomnia', item: 'Banettite', gender: 'M', moves: ['Destiny Bond', 'Will-O-Wisp', 'Parting Shot'], signatureMove: 'Shadow Dance', - evs: {hp: 252, atk: 252, def: 4}, ivs: {spe: 0}, nature: 'Brave', shiny: true, + evs: { hp: 252, atk: 252, def: 4 }, ivs: { spe: 0 }, nature: 'Brave', shiny: true, }, Notater517: { species: 'Incineroar', ability: 'Vent Crosser', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Ceaseless Edge', 'Pyro Ball', ['Rapid Spin', 'Encore']], signatureMove: '~nyaa', - evs: {hp: 252, atk: 252, spd: 4}, nature: 'Adamant', teraType: 'Steel', + evs: { hp: 252, atk: 252, spd: 4 }, nature: 'Adamant', teraType: 'Steel', }, 'nya~ ❤': { species: 'Delcatty', ability: 'Adorable Grace', item: 'Focus Band', gender: 'F', moves: ['Freeze-Dry', 'Flamethrower', 'Volt Switch'], signatureMove: ':3', - evs: {hp: 252, spa: 4, spe: 252}, nature: 'Naive', teraType: 'Ice', + evs: { hp: 252, spa: 4, spe: 252 }, nature: 'Naive', teraType: 'Ice', }, pants: { species: 'Annihilape', ability: 'Drifting', item: 'Leftovers', gender: 'M', moves: ['Rage Fist', 'Drain Punch', 'Dragon Dance'], signatureMove: 'Eerie Apathy', - evs: {hp: 240, spd: 252, spe: 16}, nature: 'Careful', teraType: 'Ghost', + evs: { hp: 240, spd: 252, spe: 16 }, nature: 'Careful', teraType: 'Ghost', }, PartMan: { species: 'Chandelure', ability: 'C- Tier Shitposter', item: 'Leek', gender: 'M', moves: ['Searing Shot', 'Hex', 'Morning Sun'], signatureMove: 'Alting', - evs: {hp: 252, spa: 69, spe: 188}, nature: 'Timid', + evs: { hp: 252, spa: 69, spe: 188 }, nature: 'Timid', }, 'Pastor Gigas': { species: 'Regigigas', ability: 'God\'s Mercy', item: 'Clear Amulet', gender: 'N', moves: ['Sacred Fire', 'Knock Off', 'Healing Wish'], signatureMove: 'Call to Repentance', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Adamant', teraType: 'Fairy', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Adamant', teraType: 'Fairy', }, Peary: { species: 'Klinklang', ability: 'Levitate', item: 'Pearyum Z', gender: '', moves: ['Lock On', 'Sheer Cold', 'Substitute'], signatureMove: 'Gear Grind', - evs: {hp: 252, def: 4, spe: 252}, nature: 'Jolly', + evs: { hp: 252, def: 4, spe: 252 }, nature: 'Jolly', }, phoopes: { species: 'Jynx', ability: 'I Did It Again', item: 'Focus Sash', gender: 'F', moves: ['Lovely Kiss', 'Psychic', 'Amnesia'], signatureMove: 'Gen 1 Blizzard', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Ice', + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Ice', }, Pissog: { species: 'Volcarona', ability: 'Drought', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Torch Song', 'Morning Sun', 'Solar Beam'], signatureMove: 'A Song Of Ice And Fire', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Fire', shiny: 1096, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Fire', shiny: 1096, }, 'Pissog-Frosmoth': { species: 'Frosmoth', ability: 'Snow Warning', item: 'Heavy-Duty Boots', gender: 'F', moves: ['Blizzard', 'Chilly Reception', 'Aurora Veil'], signatureMove: 'A Song Of Ice And Fire', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Ice', skip: 'Pissog', shiny: 1096, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Ice', skip: 'Pissog', shiny: 1096, }, pokemonvortex: { species: 'Pokestar Smeargle', ability: 'Prankster', item: 'Focus Sash', gender: 'N', moves: ['Spore', 'Extreme Evoboost', 'Substitute'], signatureMove: 'Roulette', - evs: {hp: 252, def: 4, spe: 252}, nature: 'Timid', teraType: 'Ghost', + evs: { hp: 252, def: 4, spe: 252 }, nature: 'Timid', teraType: 'Ghost', }, 'Princess Autumn': { species: 'Altaria', ability: 'Last Hymn', item: 'Altarianite', gender: 'F', moves: ['Earthquake', 'Amnesia', 'Roost'], signatureMove: 'Cotton Candy Crush', - evs: {hp: 248, spd: 164, spe: 96}, nature: 'Careful', shiny: 4, + evs: { hp: 248, spd: 164, spe: 96 }, nature: 'Careful', shiny: 4, }, ptoad: { species: 'Politoed', ability: 'Drizzle', item: 'Leftovers', gender: 'M', moves: ['Jet Punch', 'Ice Punch', 'Earthquake'], signatureMove: 'Pleek...', - evs: {hp: 252, atk: 252, spd: 4}, nature: 'Adamant', teraType: 'Water', + evs: { hp: 252, atk: 252, spd: 4 }, nature: 'Adamant', teraType: 'Water', }, Pulse_kS: { species: 'Hydreigon', ability: 'Pulse Luck', item: 'Quick Claw', gender: 'N', moves: ['Dark Pulse', 'Dragon Pulse', 'Origin Pulse'], signatureMove: 'Luck Pulse', - evs: {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}, nature: 'Serious', teraType: ['Steel', 'Poison'], + evs: { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }, nature: 'Serious', teraType: ['Steel', 'Poison'], }, PYRO: { species: 'Kingambit', ability: 'Hardcore Hustle', item: 'Leftovers', gender: 'M', moves: ['Kowtow Cleave', 'Sucker Punch', 'Swords Dance'], signatureMove: 'Meat Grinder', - evs: {hp: 252, atk: 252, def: 4}, nature: 'Adamant', teraType: 'Flying', + evs: { hp: 252, atk: 252, def: 4 }, nature: 'Adamant', teraType: 'Flying', }, 'Quite Quiet': { species: 'Ribombee', ability: 'Fancy Scarf', item: ['Life Orb', 'Leftovers'], gender: 'F', moves: ['Roost', 'Moonblast', ['Aura Sphere', 'U-turn']], signatureMove: '*Worried Noises*', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Flying', + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Flying', // The nature not being Quiet is a crime }, quziel: { species: 'Chromera', ability: 'High Performance Computing', item: 'Covert Cloak', gender: 'M', moves: ['Recover', 'Revelation Dance', 'Boomburst'], signatureMove: 'Reshape', - evs: {def: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Ghost', + evs: { def: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Ghost', }, R8: { species: 'Chansey', ability: 'Anti-Pelau', item: 'Eviolite', gender: 'N', moves: ['Ice Beam', 'Thunderbolt', 'Flamethrower'], signatureMove: 'Magic Trick', - evs: {hp: 252, spa: 252, spe: 4}, ivs: {atk: 0}, nature: 'Modest', teraType: 'Ice', shiny: 256, + evs: { hp: 252, spa: 252, spe: 4 }, ivs: { atk: 0 }, nature: 'Modest', teraType: 'Ice', shiny: 256, }, Rainshaft: { species: 'Xerneas', ability: 'Rainy\'s Aura', item: 'Rainium Z', gender: 'F', moves: ['Psychic Noise', 'Sing', 'Alluring Voice'], signatureMove: 'Sparkling Aria', - evs: {hp: 252, spa: 252, spe: 4}, nature: 'Mild', + evs: { hp: 252, spa: 252, spe: 4 }, nature: 'Mild', }, Ransei: { species: 'Audino-Mega', ability: 'Ultra Mystik', item: 'Safety Goggles', gender: 'M', moves: ['Psystrike', 'Transform', 'Light of Ruin'], signatureMove: 'Flood of Lore', - evs: {hp: 252, def: 4, spa: 252}, ivs: {spe: 0}, nature: 'Modest', shiny: 2, + evs: { hp: 252, def: 4, spa: 252 }, ivs: { spe: 0 }, nature: 'Modest', shiny: 2, }, ReturnToMonkey: { species: 'Oranguru', ability: 'Monke See Monke Do', item: 'Twisted Spoon', gender: 'M', moves: ['Hyper Voice', 'Psyshock', 'Focus Blast'], signatureMove: 'Monke Magic', - evs: {hp: 252, def: 4, spa: 252}, ivs: {spe: 0}, nature: 'Quiet', teraType: 'Fighting', + evs: { hp: 252, def: 4, spa: 252 }, ivs: { spe: 0 }, nature: 'Quiet', teraType: 'Fighting', }, 'Rio Vidal': { species: 'Archaludon', ability: 'Built Different', item: 'Leftovers', gender: 'M', moves: ['Body Press', 'Stealth Rock', 'Rapid Spin'], signatureMove: 'Metal Blast', - evs: {hp: 252, def: 252, spa: 4}, nature: 'Bold', teraType: 'Flying', + evs: { hp: 252, def: 252, spa: 4 }, nature: 'Bold', teraType: 'Flying', }, Rissoux: { species: 'Arcanine-Hisui', ability: 'Hard Headed', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Head Smash', 'Flare Blitz', 'Morning Sun'], signatureMove: 'Call of the Wild', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Jolly', teraType: 'Grass', + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Jolly', teraType: 'Grass', }, RSB: { species: 'Growlithe', ability: 'Hot Pursuit', item: 'Eviolite', gender: 'M', moves: ['Fire Fang', 'Thunder Fang', 'Morning Sun'], signatureMove: 'Confiscate', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Grass', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Grass', }, Rumia: { species: 'Duskull', ability: 'Youkai of the Dusk', item: 'Eviolite', gender: 'N', moves: ['Infernal Parade', 'Strength Sap', 'Mortal Spin'], signatureMove: 'Midnight Bird', - evs: {hp: 252, def: 252, spa: 4}, nature: 'Bold', teraType: 'Poison', shiny: true, + evs: { hp: 252, def: 252, spa: 4 }, nature: 'Bold', teraType: 'Poison', shiny: true, }, Scotteh: { species: 'Suicune', ability: 'Water Absorb', item: 'Leftovers', gender: '', moves: ['Calm Mind', 'Scald', 'Ice Beam'], signatureMove: 'Purification', - evs: {hp: 252, def: 252, spd: 4}, nature: 'Bold', teraType: 'Water', + evs: { hp: 252, def: 252, spd: 4 }, nature: 'Bold', teraType: 'Water', }, SexyMalasada: { species: 'Typhlosion', ability: 'Ancestry Ritual', item: 'Life Orb', gender: 'M', moves: ['Calm Mind', 'Aura Sphere', 'Flamethrower'], signatureMove: 'Hexadecimal Fire', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Ghost', shiny: true, + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Ghost', shiny: true, }, sharp_claw: { species: 'Sneasel', ability: 'Regenerator', item: 'Heavy-Duty Boots', gender: 'F', moves: ['Knock Off', 'Ice Spinner', 'Ice Shard'], signatureMove: 'Treacherous Traversal', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Poison', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Poison', }, 'sharp_claw-Rough': { species: 'Sneasel-Hisui', ability: 'Regenerator', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Combat Torque', 'Noxious Torque', 'Mach Punch'], signatureMove: 'Treacherous Traversal', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Poison', skip: 'sharp_claw', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Poison', skip: 'sharp_claw', }, Siegfried: { species: 'Ampharos', ability: 'Static', item: 'Ampharosite', gender: 'M', moves: ['Calm Mind', 'Thunderclap', 'Draco Meteor'], signatureMove: 'BoltBeam', - evs: {hp: 252, spa: 252, spd: 4}, nature: 'Modest', shiny: 64, + evs: { hp: 252, spa: 252, spd: 4 }, nature: 'Modest', shiny: 64, }, 'Sificon~': { species: 'Hoppip', ability: 'Perfectly Imperfect', item: 'Eviolite', gender: 'M', moves: ['Strength Sap', 'Spikes', 'Seismic Toss'], signatureMove: 'Grass Gaming', - evs: {hp: 252, def: 4, spe: 252}, ivs: {atk: 0}, nature: 'Timid', teraType: 'Dragon', + evs: { hp: 252, def: 4, spe: 252 }, ivs: { atk: 0 }, nature: 'Timid', teraType: 'Dragon', }, skies: { species: 'Chespin', ability: 'Spikes of Wrath', item: 'Sitrus Berry', gender: 'F', moves: ['Bulk Up', 'Strength Sap', 'Body Press'], signatureMove: 'Like..?', - evs: {hp: 252, atk: 4, def: 252}, nature: 'Impish', teraType: ['Water', 'Steel'], shiny: 15, + evs: { hp: 252, atk: 4, def: 252 }, nature: 'Impish', teraType: ['Water', 'Steel'], shiny: 15, }, snake: { species: 'Fidgit', ability: 'Persistent', item: ['Mental Herb', 'Covert Cloak', 'Leppa Berry'], gender: 'M', moves: ['Tailwind', 'Revival Blessing', 'Taunt'], signatureMove: 'Concept Relevant', - evs: {hp: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Water', + evs: { hp: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Water', }, 'Soft Flex': { species: 'Magnezone', ability: 'Adaptive Engineering', item: 'Leftovers', gender: 'N', moves: ['Thunderbolt', 'Substitute', 'Parabolic Charge'], signatureMove: 'Adaptive Beam', - evs: {hp: 248, def: 8, spe: 252}, nature: 'Timid', teraType: 'Flying', + evs: { hp: 248, def: 8, spe: 252 }, nature: 'Timid', teraType: 'Flying', }, 'Solaros & Lunaris': { species: 'Scovillain', ability: 'Ride the Sun!', item: 'Heavy-Duty Boots', gender: 'N', moves: ['Solar Beam', 'Growth', 'Moonlight'], signatureMove: 'Mind Melt', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Modest', teraType: 'Fire', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Modest', teraType: 'Fire', }, Spiderz: { species: 'Iron Thorns', ability: 'Poison Heal', item: 'Toxic Orb', gender: 'M', moves: ['Spiky Shield', 'Stone Axe', 'Thousand Arrows'], signatureMove: 'Shepherd of the Mafia Room', - evs: {hp: 252, atk: 252, spe: 4}, nature: 'Adamant', teraType: 'Steel', shiny: true, + evs: { hp: 252, atk: 252, spe: 4 }, nature: 'Adamant', teraType: 'Steel', shiny: true, }, spoo: { species: 'Hemogoblin', ability: 'I Can Hear The Heart Beating As One', item: 'Heavy-Duty Boots', gender: 'N', moves: ['Extreme Speed', 'Bitter Blade', 'Moonlight'], signatureMove: 'Cardio Training', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Adamant', teraType: 'Fairy', shiny: 32, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Adamant', teraType: 'Fairy', shiny: 32, }, Steorra: { species: 'Kitsunoh', ability: 'Ghostly Hallow', item: 'Choice Band', gender: '', moves: ['Meteor Mash', 'Shadow Strike', 'U-turn'], signatureMove: 'Phantom Weapon', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: ['Steel', 'Ghost'], shiny: 2, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: ['Steel', 'Ghost'], shiny: 2, }, Struchni: { species: 'Aggron', ability: 'Overasked Clause', item: 'Leftovers', gender: 'M', moves: ['Detect', 'Encore', 'U-turn'], signatureMove: '~randfact', - evs: {hp: 252, def: 16, spd: 240}, nature: 'Careful', teraType: 'Steel', + evs: { hp: 252, def: 16, spd: 240 }, nature: 'Careful', teraType: 'Steel', }, Sulo: { species: 'Reuniclus', ability: 'Protection of the Gelatin', item: 'Life Orb', gender: 'M', moves: ['Calm Mind', 'Draining Kiss', 'Stored Power'], signatureMove: 'Vengeful Mood', - evs: {hp: 252, def: 252, spd: 4}, nature: 'Bold', teraType: 'Fairy', shiny: true, + evs: { hp: 252, def: 252, spd: 4 }, nature: 'Bold', teraType: 'Fairy', shiny: true, }, Swiffix: { species: 'Piplup', ability: 'Stinky', item: 'Eviolite', gender: 'M', moves: ['Water Shuriken', 'Nasty Plot', 'Roost'], signatureMove: 'Stink Bomb', - evs: {hp: 252, def: 4, spa: 252}, nature: 'Modest', teraType: 'Water', + evs: { hp: 252, def: 4, spa: 252 }, nature: 'Modest', teraType: 'Water', }, Syrinix: { species: 'Ceruledge', ability: 'Sword of Ruin', item: 'Life Orb', gender: 'N', moves: ['Poltergeist', 'Swords Dance', 'Bitter Blade'], signatureMove: 'A Soul for a Soul', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Adamant', teraType: 'Fire', + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Adamant', teraType: 'Fire', }, Teclis: { species: 'Gallade', ability: 'Sharpness', item: 'Life Orb', gender: 'M', moves: ['Sacred Sword', 'Psycho Cut', 'Leaf Blade'], signatureMove: 'Rising Sword', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Adamant', teraType: 'Psychic', + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Adamant', teraType: 'Psychic', }, Tenshi: { species: 'Sandshrew', ability: 'Sand Sleuth', item: 'Eviolite', gender: 'M', moves: ['Precipice Blades', 'Dynamic Punch', 'Rapid Spin'], signatureMove: 'SAND EAT', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Ground', shiny: 10, + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Ground', shiny: 10, }, TheJesucristoOsAma: { species: 'Arceus', ability: 'The Grace Of Jesus Christ', gender: 'N', @@ -946,164 +946,164 @@ export const ssbSets: SSBSets = { ], moves: ['Earthquake', 'Surf', 'Judgment'], signatureMove: 'The Love Of Christ', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', }, Tico: { species: 'Floette-Eternal', ability: 'Eternal Generator', item: ['Covert Cloak', 'Red Card'], gender: 'M', moves: ['Light of Ruin', 'Lava Plume', 'Teleport'], signatureMove: 'Eternal Wish', - evs: {hp: 252, def: 16, spe: 240}, nature: 'Timid', teraType: ['Fire', 'Steel'], shiny: false, + evs: { hp: 252, def: 16, spe: 240 }, nature: 'Timid', teraType: ['Fire', 'Steel'], shiny: false, }, trace: { species: 'Delphox', ability: 'Eyes of Eternity', item: 'Life Orb', gender: 'F', moves: ['Calm Mind', 'Inferno', 'Recover'], signatureMove: 'Chronostasis', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Modest', teraType: 'Psychic', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Modest', teraType: 'Psychic', }, Tuthur: { species: 'Scream Tail', ability: 'Poison Heal', item: 'Toxic Orb', gender: 'M', moves: ['Spikes', 'Burning Bulwark', 'Encore'], signatureMove: 'Symphonie du Ze\u0301ro', - evs: {hp: 244, def: 12, spe: 252}, nature: 'Timid', teraType: 'Water', + evs: { hp: 244, def: 12, spe: 252 }, nature: 'Timid', teraType: 'Water', }, 'Two of Roses': { species: 'Luxray', ability: 'As We See', item: 'Mirror Herb', gender: 'M', moves: ['Knock Off', 'Supercell Slam', 'Trailblaze'], signatureMove: 'Dilly Dally', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Flying', shiny: 1024, + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Flying', shiny: 1024, }, UT: { species: 'Talonflame', ability: 'Gale Guard', item: 'Leftovers', gender: 'M', moves: ['Brave Bird', 'Roost', 'Defog'], signatureMove: 'My Boys', - evs: {hp: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Flying', + evs: { hp: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Flying', }, Valerian: { species: 'Lucario', ability: 'Full Bloom', item: 'Clear Amulet', gender: 'F', moves: ['Bullet Punch', 'Mach Punch', 'Parting Shot'], signatureMove: 'First Strike', - evs: {hp: 252, atk: 252, def: 4}, nature: 'Adamant', teraType: 'Fighting', + evs: { hp: 252, atk: 252, def: 4 }, nature: 'Adamant', teraType: 'Fighting', }, Venous: { species: 'Mantine', ability: 'Concrete Over Water', item: 'Leftovers', gender: '', moves: ['Scald', 'Roost', 'Clear Smog'], signatureMove: 'Your Crippling Interest', - evs: {hp: 248, def: 244, spd: 16}, nature: 'Calm', teraType: 'Normal', shiny: 5, + evs: { hp: 248, def: 244, spd: 16 }, nature: 'Calm', teraType: 'Normal', shiny: 5, }, 'Vio͜͡let': { species: 'Ogerpon', ability: 'See No Evil, Hear No Evil, Speak No Evil', item: 'Berry Juice', gender: 'F', moves: ['Crabhammer', 'Mighty Cleave', 'Fire Lash'], signatureMove: 'building character', - evs: {atk: 252, spd: 4, spe: 252}, nature: 'Jolly', teraType: 'Stellar', + evs: { atk: 252, spd: 4, spe: 252 }, nature: 'Jolly', teraType: 'Stellar', }, Vistar: { species: 'Zeraora', ability: 'Prankster', item: 'Throat Spray', gender: 'M', moves: ['Encore', 'Volt Switch', 'Copycat'], signatureMove: 'Virtual Avatar', - evs: {def: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Electric', + evs: { def: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Electric', }, 'Vistar-Idol': { species: 'Zeraora', ability: 'Virtual Idol', item: 'Throat Spray', gender: 'M', moves: ['Sparkling Aria', 'Torch Song', 'Teeter Dance'], signatureMove: 'Overdrive', - evs: {def: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Electric', shiny: true, skip: 'Vistar', + evs: { def: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Electric', shiny: true, skip: 'Vistar', }, vmnunes: { species: 'Shaymin-Sky', ability: 'Wild Growth', item: 'Big Root', gender: 'M', moves: ['Giga Drain', 'Oblivion Wing', 'Draining Kiss'], signatureMove: 'Gracidea\'s Blessing', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Timid', teraType: 'Fairy', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Timid', teraType: 'Fairy', }, WarriorGallade: { species: 'Tropius', ability: 'Primeval Harvest', item: 'Starf Berry', gender: ['M', 'M', 'F'], moves: ['Sunny Day', 'Natural Gift', ['Bitter Blade', 'Sappy Seed', 'Stored Power', 'Counter']], signatureMove: 'Fruitful Longbow', - // eslint-disable-next-line max-len - evs: {hp: 184, atk: 112, def: 36, spd: 88, spe: 88}, ivs: {spa: 29}, nature: 'Impish', teraType: ['Dragon', 'Psychic', 'Fighting'], shiny: 20, + // eslint-disable-next-line @stylistic/max-len + evs: { hp: 184, atk: 112, def: 36, spd: 88, spe: 88 }, ivs: { spa: 29 }, nature: 'Impish', teraType: ['Dragon', 'Psychic', 'Fighting'], shiny: 20, }, Waves: { species: 'Wailord', ability: 'Primordial Sea', item: 'Assault Vest', gender: 'M', moves: ['Water Spout', 'Hurricane', 'Thunder'], signatureMove: 'Torrential Drain', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Modest', teraType: 'Water', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Modest', teraType: 'Water', }, WigglyTree: { species: 'Sudowoodo', ability: 'Tree Stance', item: 'Liechi Berry', gender: 'M', moves: ['Shell Smash', 'Wood Hammer', 'Head Smash'], signatureMove: 'Perfect Mimic', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Adamant', teraType: 'Grass', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Adamant', teraType: 'Grass', }, 'XpRienzo ☑◡☑': { species: 'Reshiram', ability: 'Turboblaze', item: 'Choice Scarf', gender: 'M', moves: ['Draco Meteor', 'Volt Switch', 'Flash Cannon'], signatureMove: 'Scorching Truth', - evs: {spa: 252, spd: 4, spe: 252}, nature: 'Modest', teraType: 'Fire', + evs: { spa: 252, spd: 4, spe: 252 }, nature: 'Modest', teraType: 'Fire', }, xy01: { species: 'Blissey', ability: 'Panic', item: 'Heavy-Duty Boots', gender: 'M', moves: ['Soft-Boiled', 'Seismic Toss', 'Aromatherapy'], signatureMove: 'Poisonous Wind', - evs: {hp: 248, def: 252, spd: 8}, nature: 'Bold', teraType: 'Fairy', shiny: true, + evs: { hp: 248, def: 252, spd: 8 }, nature: 'Bold', teraType: 'Fairy', shiny: true, }, 'yeet dab xd': { species: 'Kecleon', ability: 'Treasure Bag', item: 'Silk Scarf', gender: 'M', happiness: 0, moves: ['Frustration', 'Shadow Sneak', 'Fake Out'], signatureMove: 'top kek', - evs: {hp: 252, atk: 4, spd: 252}, nature: 'Careful', teraType: 'Ghost', + evs: { hp: 252, atk: 4, spd: 252 }, nature: 'Careful', teraType: 'Ghost', }, 'Yellow Paint': { species: 'Rotom-Frost', ability: 'Yellow Magic', item: 'Chilan Berry', gender: 'N', moves: ['Thunderbolt', 'Blizzard', 'Ion Deluge'], signatureMove: 'Whiteout', - evs: {hp: 252, spa: 252, spe: 4}, nature: 'Modest', teraType: 'Steel', shiny: 2, + evs: { hp: 252, spa: 252, spe: 4 }, nature: 'Modest', teraType: 'Steel', shiny: 2, }, 'yuki ♪': { species: 'Ninetales-Alola', ability: 'Party Up', item: 'Light Clay', gender: '', moves: ['Blizzard', 'Aurora Veil', ['Encore', 'Lovely Kiss']], signatureMove: 'Tag, You\'re It!', - evs: {hp: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Ghost', + evs: { hp: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Ghost', }, YveltalNL: { species: 'Farigiraf', ability: 'Height Advantage', item: 'Leftovers', gender: 'M', moves: ['Freezing Glare', 'Ice Beam', 'Slack Off'], signatureMove: 'High Ground', - evs: {hp: 248, spa: 252, spe: 8}, nature: 'Modest', teraType: 'Ground', + evs: { hp: 248, spa: 252, spe: 8 }, nature: 'Modest', teraType: 'Ground', }, za: { species: 'Greedent', ability: 'Troll', item: 'Leftovers', gender: 'M', moves: ['Headbutt', 'Iron Head', 'Foul Play'], signatureMove: 'Shitpost', - evs: {hp: 252, def: 252, spe: 6}, nature: 'Impish', teraType: 'Steel', + evs: { hp: 252, def: 252, spe: 6 }, nature: 'Impish', teraType: 'Steel', }, Zalm: { species: 'Weedle', ability: 'Water Bubble', item: 'Clear Amulet', gender: '', moves: ['Surging Strikes', 'Attack Order', 'Dire Claw'], signatureMove: 'Dud ur a fish', - evs: {hp: 4, atk: 252, spe: 252}, nature: 'Adamant', teraType: 'Water', + evs: { hp: 4, atk: 252, spe: 252 }, nature: 'Adamant', teraType: 'Water', }, Zarel: { species: 'Meloetta', ability: 'Tempo Change', item: 'Leftovers', gender: 'M', moves: ['Psystrike', 'Armor Cannon', 'Obstruct'], signatureMove: '@ts-ignore', - evs: {def: 4, spa: 252, spe: 252}, nature: 'Timid', teraType: 'Stellar', + evs: { def: 4, spa: 252, spe: 252 }, nature: 'Timid', teraType: 'Stellar', }, 'Zarel-Pirouette': { species: 'Meloetta-Pirouette', ability: 'Tempo Change', item: 'Leftovers', gender: 'M', moves: ['Close Combat', 'Knock Off', 'Silk Trap'], signatureMove: '@ts-ignore', - evs: {atk: 252, def: 4, spe: 252}, nature: 'Jolly', teraType: 'Stellar', skip: 'Zarel', + evs: { atk: 252, def: 4, spe: 252 }, nature: 'Jolly', teraType: 'Stellar', skip: 'Zarel', }, zee: { species: 'Lilligant-Hisui', ability: 'Chlorophyll', item: 'Heat Rock', gender: 'F', moves: [['Close Combat', 'Axe Kick'], ['Solar Blade', 'Seed Bomb'], 'Victory Dance'], signatureMove: 'Solar Summon', - evs: {hp: 80, atk: 176, spe: 252}, nature: 'Adamant', teraType: 'Fire', + evs: { hp: 80, atk: 176, spe: 252 }, nature: 'Adamant', teraType: 'Fire', }, zoro: { species: 'Umbreon', ability: 'Nine Lives', item: 'Leftovers', gender: 'M', moves: ['Wish', 'Protect', 'Toxic'], signatureMove: 'Darkest Night', - evs: {hp: 252, def: 240, spd: 16}, nature: 'Calm', teraType: 'Steel', shiny: true, + evs: { hp: 252, def: 240, spd: 16 }, nature: 'Calm', teraType: 'Steel', shiny: true, }, }; @@ -1116,7 +1116,7 @@ const afdSSBSets: SSBSets = { }; export class RandomStaffBrosTeams extends RandomTeams { - randomStaffBrosTeam(options: {inBattle?: boolean} = {}) { + randomStaffBrosTeam(options: { inBattle?: boolean } = {}) { this.enforceNoDirectCustomBanlistChanges(); const team: PokemonSet[] = []; @@ -1141,7 +1141,7 @@ export class RandomStaffBrosTeams extends RandomTeams { if (global.Config?.disabledssbsets?.length) { pool = pool.filter(x => !global.Config.disabledssbsets.includes(this.dex.toID(x))); } - const typePool: {[k: string]: number} = {}; + const typePool: { [k: string]: number } = {}; let depth = 0; while (pool.length && team.length < this.maxTeamSize) { if (depth >= 200) throw new Error(`Infinite loop in Super Staff Bros team generation.`); @@ -1195,7 +1195,7 @@ export class RandomStaffBrosTeams extends RandomTeams { moves.push(this.dex.moves.get(move).name); } moves.push(this.dex.moves.get(ssbSet.signatureMove).name); - const ivs = {...{hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}, ...ssbSet.ivs}; + const ivs = { ...{ hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }, ...ssbSet.ivs }; if (!moves.map(x => this.dex.moves.get(x)).some(x => x.category === 'Physical')) { ivs.atk = 0; } @@ -1208,8 +1208,8 @@ export class RandomStaffBrosTeams extends RandomTeams { moves, nature: ssbSet.nature ? Array.isArray(ssbSet.nature) ? this.sampleNoReplace(ssbSet.nature) : ssbSet.nature : 'Serious', gender: ssbSet.gender ? this.sampleIfArray(ssbSet.gender) : this.sample(['M', 'F', 'N']), - evs: ssbSet.evs ? {...{hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}, ...ssbSet.evs} : - {hp: 84, atk: 84, def: 84, spa: 84, spd: 84, spe: 84}, + evs: ssbSet.evs ? { ...{ hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }, ...ssbSet.evs } : + { hp: 84, atk: 84, def: 84, spa: 84, spd: 84, spe: 84 }, ivs, level: this.adjustLevel || ssbSet.level || 100, happiness: typeof ssbSet.happiness === 'number' ? ssbSet.happiness : 255, diff --git a/data/mods/gen9ssb/rulesets.ts b/data/mods/gen9ssb/rulesets.ts index c5f7cf7d79..890d76a1f6 100644 --- a/data/mods/gen9ssb/rulesets.ts +++ b/data/mods/gen9ssb/rulesets.ts @@ -2,13 +2,13 @@ export const Rulesets: import('../../../sim/dex-formats').ModdedFormatDataTable sleepclausemod: { inherit: true, onSetStatus(status, target, source) { - if (source && source.isAlly(target)) { + if (source?.isAlly(target)) { return; } if (status.id === 'slp') { for (const pokemon of target.side.pokemon) { if (pokemon.hp && pokemon.status === 'slp') { - if (!pokemon.statusState.source || !pokemon.statusState.source.isAlly(pokemon)) { + if (!pokemon.statusState.source?.isAlly(pokemon)) { if (source.hasAbility('ididitagain')) { this.add('-ability', source, 'I Did It Again'); return; diff --git a/data/mods/gen9ssb/scripts.ts b/data/mods/gen9ssb/scripts.ts index 8e4b17e868..1054df0a2a 100644 --- a/data/mods/gen9ssb/scripts.ts +++ b/data/mods/gen9ssb/scripts.ts @@ -1,11 +1,12 @@ -import {SSBSet} from "./random-teams"; -import {ChosenAction} from '../../../sim/side'; -import {FS} from '../../../lib'; -import {toID} from '../../../sim/dex-data'; +import type { SSBSet } from "./random-teams"; +import type { ChosenAction } from '../../../sim/side'; +import { FS } from '../../../lib'; +import { toID } from '../../../sim/dex-data'; +import { type SwitchAction } from "../../../sim/battle-queue"; // Similar to User.usergroups. Cannot import here due to users.ts requiring Chat // This also acts as a cache, meaning ranks will only update when a hotpatch/restart occurs -const usergroups: {[userid: string]: string} = {}; +const usergroups: { [userid: string]: string } = {}; const usergroupData = FS('config/usergroups.csv').readIfExistsSync().split('\n'); for (const row of usergroupData) { if (!toID(row)) continue; @@ -15,7 +16,7 @@ for (const row of usergroupData) { usergroups[toID(cells[0])] = cells[1].trim() || ' '; } -const roomauth: {[roomid: string]: {[userid: string]: string}} = {}; +const roomauth: { [roomid: string]: { [userid: string]: string } } = {}; /** * Given a username and room, returns the auth they have in that room. Used for some conditional messages/effects. * Each room is cached on the first call until the process is restarted. @@ -38,7 +39,7 @@ export function getName(name: string): string { let group = usergroups[userid] || ' '; if (name === 'Artemis') group = '@'; if (name === 'Jeopard-E' || name === 'Ice Kyubs') group = '*'; - return Math.floor(Date.now() / 1000) + '|' + group + name; + return `${Math.floor(Date.now() / 1000)}|${group}${name}`; } export function enemyStaff(pokemon: Pokemon): string { @@ -76,7 +77,7 @@ export function changeSet(context: Battle, pokemon: Pokemon, newSet: SSBSet, cha const oldGender = pokemon.set.gender; if ((pokemon.set.gender !== newSet.gender) && !Array.isArray(newSet.gender)) { pokemon.set.gender = newSet.gender; - // @ts-ignore Shut up sharp_claw wanted this + // @ts-expect-error Shut up sharp_claw wanted this pokemon.gender = newSet.gender; } const oldShiny = pokemon.set.shiny; @@ -144,9 +145,8 @@ export function changeMoves(context: Battle, pokemon: Pokemon, newMoves: (string const moveSlot = { move: move.name, id: move.id, - // eslint-disable-next-line max-len - pp: ((move.noPPBoosts || move.isZ) ? Math.floor(move.pp * carryOver[slot]) : Math.floor((move.pp * (8 / 5)) * carryOver[slot])), - maxpp: ((move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5), + pp: Math.floor((move.noPPBoosts ? move.pp : move.pp * 8 / 5) * carryOver[slot]), + maxpp: (move.noPPBoosts ? move.pp : move.pp * 8 / 5), target: move.target, disabled: false, disabledSource: '', @@ -170,9 +170,9 @@ export const Scripts: ModdedBattleScriptsData = { if (!target?.hp) return 0; if (!target.isActive) return false; if (this.gen > 5 && !target.side.foePokemonLeft()) return false; - boost = this.runEvent('ChangeBoost', target, source, effect, {...boost}); + boost = this.runEvent('ChangeBoost', target, source, effect, { ...boost }); boost = target.getCappedBoost(boost); - boost = this.runEvent('TryBoost', target, source, effect, {...boost}); + boost = this.runEvent('TryBoost', target, source, effect, { ...boost }); let success = null; let boosted = isSecondary; let boostName: BoostID; @@ -295,7 +295,7 @@ export const Scripts: ModdedBattleScriptsData = { faintData = this.faintQueue.shift()!; const pokemon: Pokemon = faintData.target; if (!pokemon.fainted && - this.runEvent('BeforeFaint', pokemon, faintData.source, faintData.effect)) { + this.runEvent('BeforeFaint', pokemon, faintData.source, faintData.effect)) { if (!pokemon.isActive) { this.add('message', `${pokemon.name} was killed by ${pokemon.side.name}!`); // TODO: Custom Protocol needed for teambar update @@ -323,7 +323,7 @@ export const Scripts: ModdedBattleScriptsData = { this.queue.clear(); // Fainting clears accumulated Bide damage for (const pokemon of this.getAllActive()) { - if (pokemon.volatiles['bide'] && pokemon.volatiles['bide'].damage) { + if (pokemon.volatiles['bide']?.damage) { pokemon.volatiles['bide'].damage = 0; this.hint("Desync Clause Mod activated!"); this.hint("In Gen 1, Bide's accumulated damage is reset to 0 when a Pokemon faints."); @@ -389,7 +389,7 @@ export const Scripts: ModdedBattleScriptsData = { // pokemon.setAbility(species.abilities['0'], null, true); // pokemon.baseAbility = pokemon.ability; - const behemothMove: {[k: string]: string} = { + const behemothMove: { [k: string]: string } = { 'Zacian-Crowned': 'behemothblade', 'Zamazenta-Crowned': 'behemothbash', }; const ironHead = pokemon.baseMoves.indexOf('ironhead'); @@ -398,8 +398,8 @@ export const Scripts: ModdedBattleScriptsData = { pokemon.baseMoveSlots[ironHead] = { move: move.name, id: move.id, - pp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, - maxpp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, + pp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, + maxpp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, target: move.target, disabled: false, disabledSource: '', @@ -523,28 +523,23 @@ export const Scripts: ModdedBattleScriptsData = { this.add('-heal', action.target, action.target.getHealth, '[from] move: Revival Blessing'); action.pokemon.side.removeSlotCondition(action.pokemon, 'revivalblessing'); break; - // @ts-ignore I'm sorry but it takes a lot + // @ts-expect-error I'm sorry but it takes a lot case 'scapegoat': - // @ts-ignore + action = action as SwitchAction; const percent = (action.target.hp / action.target.baseMaxhp) * 100; - // @ts-ignore TODO: Client support for custom faint + // TODO: Client support for custom faint action.target.faint(); if (percent > 66) { this.add('message', `Your courage will be greatly rewarded.`); - // @ts-ignore - this.boost({atk: 3, spa: 3, spe: 3}, action.pokemon, action.pokemon, this.dex.moves.get('scapegoat')); + this.boost({ atk: 3, spa: 3, spe: 3 }, action.pokemon, action.pokemon, this.dex.moves.get('scapegoat') as any); } else if (percent > 33) { this.add('message', `Your offering was accepted.`); - // @ts-ignore - this.boost({atk: 2, spa: 2, spe: 2}, action.pokemon, action.pokemon, this.dex.moves.get('scapegoat')); + this.boost({ atk: 2, spa: 2, spe: 2 }, action.pokemon, action.pokemon, this.dex.moves.get('scapegoat') as any); } else { this.add('message', `Coward.`); - // @ts-ignore - this.boost({atk: 1, spa: 1, spe: 1}, action.pokemon, action.pokemon, this.dex.moves.get('scapegoat')); + this.boost({ atk: 1, spa: 1, spe: 1 }, action.pokemon, action.pokemon, this.dex.moves.get('scapegoat') as any); } - // @ts-ignore this.add(`c:|${getName((action.pokemon.illusion || action.pokemon).name)}|Don't worry, if this plan fails we can just blame ${action.target.name}`); - // @ts-ignore action.pokemon.side.removeSlotCondition(action.pokemon, 'scapegoat'); break; case 'runSwitch': @@ -633,8 +628,10 @@ export const Scripts: ModdedBattleScriptsData = { let reviveSwitch = false; // Used to ignore the fake switch for Revival Blessing if (switches[i] && !this.canSwitch(this.sides[i])) { for (const pokemon of this.sides[i].active) { - if (this.sides[i].slotConditions[pokemon.position]['revivalblessing'] || - this.sides[i].slotConditions[pokemon.position]['scapegoat']) { + if ( + this.sides[i].slotConditions[pokemon.position]['revivalblessing'] || + this.sides[i].slotConditions[pokemon.position]['scapegoat'] + ) { reviveSwitch = true; continue; } @@ -721,7 +718,7 @@ export const Scripts: ModdedBattleScriptsData = { if (move.spreadHit) { // multi-target modifier (doubles only) const spreadModifier = move.spreadModifier || (this.battle.gameType === 'freeforall' ? 0.5 : 0.75); - this.battle.debug('Spread modifier: ' + spreadModifier); + this.battle.debug(`Spread modifier: ${spreadModifier}`); baseDamage = this.battle.modify(baseDamage, spreadModifier); } else if (move.multihitType === 'parentalbond' && move.hit > 1) { // Parental Bond modifier @@ -906,7 +903,7 @@ export const Scripts: ModdedBattleScriptsData = { } this.battle.runEvent('BeforeSwitchIn', pokemon); if (sourceEffect) { - this.battle.add(isDrag ? 'drag' : 'switch', pokemon, pokemon.getFullDetails, '[from] ' + sourceEffect); + this.battle.add(isDrag ? 'drag' : 'switch', pokemon, pokemon.getFullDetails, `[from] ${sourceEffect}`); } else { this.battle.add(isDrag ? 'drag' : 'switch', pokemon, pokemon.getFullDetails); } @@ -919,7 +916,7 @@ export const Scripts: ModdedBattleScriptsData = { // runSwitch happens immediately so that Mold Breaker can make hazards bypass Clear Body and Levitate this.runSwitch(pokemon); } else { - this.battle.queue.insertChoice({choice: 'runSwitch', pokemon}); + this.battle.queue.insertChoice({ choice: 'runSwitch', pokemon }); } return true; @@ -1004,7 +1001,7 @@ export const Scripts: ModdedBattleScriptsData = { if (zMoveName) { const zMove = this.dex.moves.get(zMoveName); if (!zMove.isZ && zMove.category === 'Status') zMoveName = "Z-" + zMoveName; - zMoves.push({move: zMoveName, target: zMove.target}); + zMoves.push({ move: zMoveName, target: zMove.target }); } else { zMoves.push(null); } @@ -1061,11 +1058,11 @@ export const Scripts: ModdedBattleScriptsData = { if (accuracy !== true) { let boost = 0; if (!move.ignoreAccuracy) { - const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); } if (!move.ignoreEvasion) { - const boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); boost = this.battle.clampIntRange(boost - boosts['evasion'], -6, 6); } if (boost > 0) { @@ -1076,7 +1073,7 @@ export const Scripts: ModdedBattleScriptsData = { } } if (move.alwaysHit || (move.id === 'toxic' && this.battle.gen >= 8 && pokemon.hasType('Poison')) || - (move.target === 'self' && move.category === 'Status' && !target.isSemiInvulnerable())) { + (move.target === 'self' && move.category === 'Status' && !target.isSemiInvulnerable())) { accuracy = true; // bypasses ohko accuracy modifiers } else { accuracy = this.battle.runEvent('Accuracy', target, pokemon, move, accuracy); @@ -1103,7 +1100,7 @@ export const Scripts: ModdedBattleScriptsData = { } } if (!move.ohko && pokemon.hasItem('blunderpolicy') && pokemon.useItem()) { - this.battle.boost({spe: 2}, pokemon); + this.battle.boost({ spe: 2 }, pokemon); } hitResults[i] = false; continue; @@ -1202,7 +1199,7 @@ export const Scripts: ModdedBattleScriptsData = { const oldActiveMove = move; - const moveDidSomething = this.useMove(baseMove, pokemon, {target, sourceEffect, zMove, maxMove}); + const moveDidSomething = this.useMove(baseMove, pokemon, { target, sourceEffect, zMove, maxMove }); this.battle.lastSuccessfulMoveThisTurn = moveDidSomething ? this.battle.activeMove && this.battle.activeMove.id : null; if (this.battle.activeMove) move = this.battle.activeMove; this.battle.singleEvent('AfterMove', move, null, pokemon, target, move); @@ -1233,7 +1230,7 @@ export const Scripts: ModdedBattleScriptsData = { targetOf1stDance : pokemon; const dancersTargetLoc = dancer.getLocOf(dancersTarget); - this.runMove(move.id, dancer, dancersTargetLoc, {sourceEffect: dancer.getAbility(), externalMove: true}); + this.runMove(move.id, dancer, dancersTargetLoc, { sourceEffect: dancer.getAbility(), externalMove: true }); } } if (noLock && pokemon.volatiles['lockedmove']) delete pokemon.volatiles['lockedmove']; @@ -1278,7 +1275,7 @@ export const Scripts: ModdedBattleScriptsData = { if (!move.hasBounced) move.pranksterBoosted = this.battle.activeMove.pranksterBoosted; } const baseTarget = move.target; - let targetRelayVar = {target}; + let targetRelayVar = { target }; targetRelayVar = this.battle.runEvent('ModifyTarget', pokemon, target, move, targetRelayVar, true); if (targetRelayVar.target !== undefined) target = targetRelayVar.target; if (target === undefined) target = this.battle.getRandomTarget(pokemon, move); @@ -1320,7 +1317,7 @@ export const Scripts: ModdedBattleScriptsData = { attrs = '|[anim]' + movename + attrs; movename = 'Z-' + movename; } - this.battle.addMove('move', pokemon, movename, target + attrs); + this.battle.addMove('move', pokemon, movename, `${target}${attrs}`); if (zMove) this.runZPower(move, pokemon); @@ -1330,7 +1327,7 @@ export const Scripts: ModdedBattleScriptsData = { return false; } - const {targets, pressureTargets} = pokemon.getMoveTargets(move, target); + const { targets, pressureTargets } = pokemon.getMoveTargets(move, target); if (targets.length) { target = targets[targets.length - 1]; // in case of redirection } @@ -1469,7 +1466,7 @@ export const Scripts: ModdedBattleScriptsData = { const boostTable = [1, 4 / 3, 5 / 3, 2, 7 / 3, 8 / 3, 3]; if (accuracy !== true) { if (!move.ignoreAccuracy) { - const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); const boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); if (boost > 0) { accuracy *= boostTable[boost]; @@ -1478,7 +1475,7 @@ export const Scripts: ModdedBattleScriptsData = { } } if (!move.ignoreEvasion) { - const boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); const boost = this.battle.clampIntRange(boosts['evasion'], -6, 6); if (boost > 0) { accuracy /= boostTable[boost]; @@ -1517,7 +1514,7 @@ export const Scripts: ModdedBattleScriptsData = { // purposes of Counter, Metal Burst, and Mirror Coat. damage[i] = md === true || !md ? 0 : md; // Total damage dealt is accumulated for the purposes of recoil (Parental Bond). - move.totalDamage += damage[i] as number; + move.totalDamage += damage[i]; } if (move.mindBlownRecoil) { const hpBeforeRecoil = pokemon.hp; @@ -1557,7 +1554,7 @@ export const Scripts: ModdedBattleScriptsData = { } else { recoilDamage = this.battle.clampIntRange(this.battle.trunc(pokemon.maxhp / 4), 1); } - this.battle.directDamage(recoilDamage, pokemon, pokemon, {id: 'strugglerecoil'} as Condition); + this.battle.directDamage(recoilDamage, pokemon, pokemon, { id: 'strugglerecoil' } as Condition); if (pokemon.hp <= pokemon.maxhp / 2 && hpBeforeRecoil > pokemon.maxhp / 2) { this.battle.runEvent('EmergencyExit', pokemon, pokemon); } @@ -1583,7 +1580,7 @@ export const Scripts: ModdedBattleScriptsData = { this.battle.eachEvent('Update'); - this.afterMoveSecondaryEvent(targetsCopy.filter(val => !!val) as Pokemon[], pokemon, move); + this.afterMoveSecondaryEvent(targetsCopy.filter(val => !!val), pokemon, move); if (!move.negateSecondary && !(move.hasSheerForce && pokemon.hasAbility('sheerforce'))) { for (const [i, d] of damage.entries()) { @@ -1611,11 +1608,13 @@ export const Scripts: ModdedBattleScriptsData = { } else if (!this.battle.singleEvent('TryImmunity', move, {}, target, pokemon, move)) { this.battle.add('-immune', target); hitResults[i] = false; - } else if (this.battle.gen >= 7 && move.pranksterBoosted && + } else if ( + this.battle.gen >= 7 && move.pranksterBoosted && // Prankster Clone immunity (pokemon.hasAbility('prankster') || pokemon.hasAbility('youkaiofthedusk') || pokemon.volatiles['irpachuza'] || pokemon.hasAbility('neverendingfhunt')) && - !targets[i].isAlly(pokemon) && !this.dex.getImmunity('prankster', target)) { + !targets[i].isAlly(pokemon) && !this.dex.getImmunity('prankster', target) + ) { this.battle.debug('natural prankster immunity'); if (!target.illusion) this.battle.hint("Since gen 7, Dark is immune to Prankster moves."); this.battle.add('-immune', target); @@ -1636,8 +1635,7 @@ export const Scripts: ModdedBattleScriptsData = { } const move = this.dex.getActiveMove(moveOrMoveName); let hitResult: boolean | number | null = true; - let moveData = hitEffect as ActiveMove; - if (!moveData) moveData = move; + const moveData = hitEffect || move; if (!moveData.flags) moveData.flags = {}; if (move.target === 'all' && !isSelf) { hitResult = this.battle.singleEvent('TryHitField', moveData, {}, target || null, pokemon, move); @@ -1796,7 +1794,7 @@ export const Scripts: ModdedBattleScriptsData = { if (!target || (target.fainted && !target.isAlly(this)) && this.battle.gameType !== 'freeforall') { // If a targeted foe faints, the move is retargeted const possibleTarget = this.battle.getRandomTarget(this, move); - if (!possibleTarget) return {targets: [], pressureTargets: []}; + if (!possibleTarget) return { targets: [], pressureTargets: [] }; target = possibleTarget; } if (this.battle.activePerHalf > 1 && !move.tracksTarget) { @@ -1817,7 +1815,7 @@ export const Scripts: ModdedBattleScriptsData = { targets.push(target); } if (target.fainted && !move.flags['futuremove']) { - return {targets: [], pressureTargets: []}; + return { targets: [], pressureTargets: [] }; } if (selectedTarget !== target) { this.battle.retargetLastMove(target); @@ -1833,7 +1831,7 @@ export const Scripts: ModdedBattleScriptsData = { pressureTargets = this.foes(); } - return {targets, pressureTargets}; + return { targets, pressureTargets }; }, }, side: { @@ -1854,7 +1852,7 @@ export const Scripts: ModdedBattleScriptsData = { case 'switch': case 'instaswitch': case 'revivalblessing': - // @ts-ignore custom status falls through + // @ts-expect-error custom status falls through case 'scapegoat': return `switch ${action.target!.position + 1}`; case 'team': @@ -1938,7 +1936,7 @@ export const Scripts: ModdedBattleScriptsData = { // Should always subtract, but stop at 0 to prevent errors. this.choice.forcedSwitchesLeft = this.battle.clampIntRange(this.choice.forcedSwitchesLeft - 1, 0); pokemon.switchFlag = false; - // @ts-ignore custom request + // @ts-expect-error custom request this.choice.actions.push({ choice: 'scapegoat', pokemon, @@ -1994,7 +1992,7 @@ export const Scripts: ModdedBattleScriptsData = { if (!action.side && action.pokemon) action.side = action.pokemon.side; if (!action.move && action.moveid) action.move = this.battle.dex.getActiveMove(action.moveid); if (!action.order) { - const orders: {[choice: string]: number} = { + const orders: { [choice: string]: number } = { team: 1, start: 2, instaswitch: 3, diff --git a/data/mods/littlecolosseum/abilities.ts b/data/mods/littlecolosseum/abilities.ts index 5c56ed40d7..20f87a7c1b 100644 --- a/data/mods/littlecolosseum/abilities.ts +++ b/data/mods/littlecolosseum/abilities.ts @@ -74,10 +74,10 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa target.item = yourItem.id; // bypass setItem so we don't break choicelock or anything return; } - this.add('-item', source, yourItem, '[from] ability: Magic Resistance', '[of] ' + target); + this.add('-item', source, yourItem, '[from] ability: Magic Resistance', `[of] ${target}`); } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, name: "Magic Resistance", rating: 3.5, shortDesc: "This Pokemon steals foe's item after hitting them, and takes 50% damage from Fire/Ice.", @@ -93,7 +93,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa stall: { onBeforeMove(target, source, move) { if (move.category === 'Status') { - this.actions.useMove(move, target, {target: source}); + this.actions.useMove(move, target, { target: source }); } }, onFractionalPriority: -0.1, @@ -127,7 +127,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa return null; } }, - flags: {breakable: 1}, + flags: { breakable: 1 }, shortDesc: "Effects of Unware and Water Absorb.", name: "Go with the Flow", rating: 4, @@ -160,7 +160,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa onDamagingHit(damage, target, source, move) { target.addVolatile('charge'); }, - flags: {breakable: 1}, + flags: { breakable: 1 }, shortDesc: "Effects of Fluffy and Electromorphosis.", name: "Fluffy Charger", rating: 4, diff --git a/data/mods/littlecolosseum/moves.ts b/data/mods/littlecolosseum/moves.ts index 3725067076..dd097ea558 100644 --- a/data/mods/littlecolosseum/moves.ts +++ b/data/mods/littlecolosseum/moves.ts @@ -7,7 +7,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Surging Lava", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onPrepareHit(target, source, move) { this.attrLastMove('[still]'); this.add('-anim', source, "Morning Sun", target); @@ -19,7 +19,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { secondary: null, target: "self", type: "Fire", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cool", }, @@ -32,7 +32,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Stealth Rock", pp: 20, priority: 0, - flags: {reflectable: 1, snatch: 1}, + flags: { reflectable: 1, snatch: 1 }, sideCondition: 'stealthrock', condition: { // this is a side condition @@ -42,13 +42,13 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onSwitchIn(pokemon) { if (pokemon.hasItem('heavydutyboots') || pokemon.hasAbility('magmaticentrance') || pokemon.hasAbility('hover')) return; const typeMod = this.clampIntRange(pokemon.runEffectiveness(this.dex.getActiveMove('stealthrock')), -6, 6); - this.damage(pokemon.maxhp * Math.pow(2, typeMod) / 8); + this.damage(pokemon.maxhp * (2 ** typeMod) / 8); }, }, secondary: null, target: "foeSide", type: "Rock", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cool", }, spikes: { @@ -59,7 +59,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { name: "Spikes", pp: 20, priority: 0, - flags: {reflectable: 1, nonsky: 1, mustpressure: 1, snatch: 1}, + flags: { reflectable: 1, nonsky: 1, mustpressure: 1, snatch: 1 }, sideCondition: 'spikes', condition: { // this is a side condition @@ -82,7 +82,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { secondary: null, target: "foeSide", type: "Ground", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, }; diff --git a/data/mods/littlecolosseum/pokedex.ts b/data/mods/littlecolosseum/pokedex.ts index 7d40ecbddc..ab27cb3f8b 100644 --- a/data/mods/littlecolosseum/pokedex.ts +++ b/data/mods/littlecolosseum/pokedex.ts @@ -1,99 +1,99 @@ export const Pokedex: import('../../../sim/dex-species').ModdedSpeciesDataTable = { gastly: { inherit: true, - baseStats: {hp: 30, atk: 35, def: 30, spa: 70, spd: 35, spe: 60}, - abilities: {0: "Frisk", 1: "Protean", H: "Neutralizing Gas"}, + baseStats: { hp: 30, atk: 35, def: 30, spa: 70, spd: 35, spe: 60 }, + abilities: { 0: "Frisk", 1: "Protean", H: "Neutralizing Gas" }, }, swablu: { inherit: true, types: ["Fairy", "Flying"], - baseStats: {hp: 45, atk: 45, def: 60, spa: 45, spd: 75, spe: 50}, - abilities: {0: "Natural Cure", 1: "Scrappy", H: "Pixilate"}, + baseStats: { hp: 45, atk: 45, def: 60, spa: 45, spd: 75, spe: 50 }, + abilities: { 0: "Natural Cure", 1: "Scrappy", H: "Pixilate" }, }, slugma: { inherit: true, - baseStats: {hp: 30, atk: 40, def: 40, spa: 80, spd: 30, spe: 40}, - abilities: {0: "Flame Body", 1: "Weak Armor", H: "Magmatic Entrance"}, + baseStats: { hp: 30, atk: 40, def: 40, spa: 80, spd: 30, spe: 40 }, + abilities: { 0: "Flame Body", 1: "Weak Armor", H: "Magmatic Entrance" }, }, sprigatito: { inherit: true, - baseStats: {hp: 40, atk: 65, def: 54, spa: 31, spd: 45, spe: 75}, - abilities: {0: "Overgrow", H: "Entertainer"}, + baseStats: { hp: 40, atk: 65, def: 54, spa: 31, spd: 45, spe: 75 }, + abilities: { 0: "Overgrow", H: "Entertainer" }, }, dreepy: { inherit: true, - baseStats: {hp: 41, atk: 60, def: 40, spa: 42, spd: 40, spe: 82}, + baseStats: { hp: 41, atk: 60, def: 40, spa: 42, spd: 40, spe: 82 }, }, tepig: { inherit: true, types: ["Fire", "Ground"], - baseStats: {hp: 65, atk: 63, def: 50, spa: 35, spd: 50, spe: 45}, - abilities: {0: "Blaze", H: "Sap Sipper"}, + baseStats: { hp: 65, atk: 63, def: 50, spa: 35, spd: 50, spe: 45 }, + abilities: { 0: "Blaze", H: "Sap Sipper" }, }, meowthgalar: { inherit: true, - baseStats: {hp: 60, atk: 65, def: 65, spa: 40, spd: 40, spe: 40}, - abilities: {0: "Tough Claws", H: "Spiked Fur"}, + baseStats: { hp: 60, atk: 65, def: 65, spa: 40, spd: 40, spe: 40 }, + abilities: { 0: "Tough Claws", H: "Spiked Fur" }, }, toxel: { inherit: true, - baseStats: {hp: 60, atk: 48, def: 55, spa: 64, spd: 55, spe: 40}, - abilities: {0: "Rattled", 1: "Static", H: "Pickpocket"}, + baseStats: { hp: 60, atk: 48, def: 55, spa: 64, spd: 55, spe: 40 }, + abilities: { 0: "Rattled", 1: "Static", H: "Pickpocket" }, }, fletchling: { inherit: true, types: ["Fire", "Flying"], - baseStats: {hp: 45, atk: 50, def: 55, spa: 40, spd: 38, spe: 52}, + baseStats: { hp: 45, atk: 50, def: 55, spa: 40, spd: 38, spe: 52 }, }, spoink: { inherit: true, types: ["Psychic", "Rock"], - baseStats: {hp: 60, atk: 25, def: 35, spa: 70, spd: 75, spe: 70}, - abilities: {0: "Magic Resistance", 1: "Own Tempo", H: "Gluttony"}, + baseStats: { hp: 60, atk: 25, def: 35, spa: 70, spd: 75, spe: 70 }, + abilities: { 0: "Magic Resistance", 1: "Own Tempo", H: "Gluttony" }, }, cutiefly: { inherit: true, - baseStats: {hp: 50, atk: 35, def: 50, spa: 50, spd: 50, spe: 25}, - abilities: {0: "Oblivious", 1: "Shield Dust", H: "Hover"}, + baseStats: { hp: 50, atk: 35, def: 50, spa: 50, spd: 50, spe: 25 }, + abilities: { 0: "Oblivious", 1: "Shield Dust", H: "Hover" }, }, shieldon: { inherit: true, - abilities: {0: "Sturdy", 1: "Battle Armor", H: "Stall"}, + abilities: { 0: "Sturdy", 1: "Battle Armor", H: "Stall" }, }, wooperpaldea: { inherit: true, - baseStats: {hp: 55, atk: 65, def: 65, spa: 25, spd: 45, spe: 35}, + baseStats: { hp: 55, atk: 65, def: 65, spa: 25, spd: 45, spe: 35 }, }, wooper: { inherit: true, - baseStats: {hp: 55, atk: 65, def: 65, spa: 25, spd: 45, spe: 35}, - abilities: {0: "Damp", 1: "Go with the Flow"}, + baseStats: { hp: 55, atk: 65, def: 65, spa: 25, spd: 45, spe: 35 }, + abilities: { 0: "Damp", 1: "Go with the Flow" }, }, corphish: { inherit: true, types: ["Water", "Dark"], - baseStats: {hp: 50, atk: 80, def: 65, spa: 50, spd: 35, spe: 46}, - abilities: {0: "Adaptability", 1: "Hyper Cutter", H: "Shell Armor"}, + baseStats: { hp: 50, atk: 80, def: 65, spa: 50, spd: 35, spe: 46 }, + abilities: { 0: "Adaptability", 1: "Hyper Cutter", H: "Shell Armor" }, }, jangmoo: { inherit: true, types: ["Dragon", "Fairy"], - baseStats: {hp: 65, atk: 65, def: 65, spa: 55, spd: 55, spe: 55}, - abilities: {0: "Bulletproof", 1: "Overcoat", H: "Marvel Scale"}, + baseStats: { hp: 65, atk: 65, def: 65, spa: 55, spd: 55, spe: 55 }, + abilities: { 0: "Bulletproof", 1: "Overcoat", H: "Marvel Scale" }, }, mareep: { inherit: true, types: ["Electric", "Grass"], - baseStats: {hp: 55, atk: 40, def: 40, spa: 65, spd: 60, spe: 35}, - abilities: {0: "Static", H: "Fluffy Charger"}, + baseStats: { hp: 55, atk: 40, def: 40, spa: 65, spd: 60, spe: 35 }, + abilities: { 0: "Static", H: "Fluffy Charger" }, }, cetoddle: { inherit: true, - abilities: {0: "Thick Fat", 1: "Sheer Force", H: "Sliding Whale"}, + abilities: { 0: "Thick Fat", 1: "Sheer Force", H: "Sliding Whale" }, }, eevee: { inherit: true, - baseStats: {hp: 60, atk: 55, def: 50, spa: 45, spd: 65, spe: 55}, - abilities: {0: "Run Away", 1: "Supreme Survivor", H: "Anticipation"}, + baseStats: { hp: 60, atk: 55, def: 50, spa: 45, spd: 65, spe: 55 }, + abilities: { 0: "Run Away", 1: "Supreme Survivor", H: "Anticipation" }, }, }; diff --git a/data/mods/littlecolosseum/scripts.ts b/data/mods/littlecolosseum/scripts.ts index 56d30c3f51..aa60b4dd1b 100644 --- a/data/mods/littlecolosseum/scripts.ts +++ b/data/mods/littlecolosseum/scripts.ts @@ -106,6 +106,6 @@ export const Scripts: ModdedBattleScriptsData = { if ('magnetrise' in this.volatiles) return false; if ('telekinesis' in this.volatiles) return false; return item !== 'airballoon'; - }, + }, }, }; diff --git a/data/mods/mixandmega/items.ts b/data/mods/mixandmega/items.ts index 84000d8f0f..8fd9e5eab2 100644 --- a/data/mods/mixandmega/items.ts +++ b/data/mods/mixandmega/items.ts @@ -60,7 +60,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = { inherit: true, onSwitchIn(pokemon) { if (pokemon.isActive && !pokemon.species.isPrimal && !pokemon.transformed) { - // @ts-ignore + // @ts-expect-error modded const species: Species = this.actions.getMixedSpecies(pokemon.m.originalSpecies, 'Kyogre-Primal', pokemon); if (pokemon.m.originalSpecies === 'Kyogre') { pokemon.formeChange(species, this.effect, true); @@ -211,7 +211,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = { inherit: true, onSwitchIn(pokemon) { if (pokemon.isActive && !pokemon.species.isPrimal && !pokemon.transformed) { - // @ts-ignore + // @ts-expect-error modded const species: Species = this.actions.getMixedSpecies(pokemon.m.originalSpecies, 'Groudon-Primal', pokemon); if (pokemon.m.originalSpecies === 'Groudon') { pokemon.formeChange(species, this.effect, true); diff --git a/data/mods/mixandmega/scripts.ts b/data/mods/mixandmega/scripts.ts index 92cf0dee25..d78ed5991a 100644 --- a/data/mods/mixandmega/scripts.ts +++ b/data/mods/mixandmega/scripts.ts @@ -88,7 +88,7 @@ export const Scripts: ModdedBattleScriptsData = { if (subFormat.onTeamPreview) subFormat.onTeamPreview.call(this); } - this.queue.addChoice({choice: 'start'}); + this.queue.addChoice({ choice: 'start' }); this.midTurn = true; if (!this.requestState) this.turnLoop(); }, @@ -121,7 +121,7 @@ export const Scripts: ModdedBattleScriptsData = { pokemon.ability = this.toID(species.abilities['0']); pokemon.baseAbility = pokemon.ability; - const behemothMove: {[k: string]: string} = { + const behemothMove: { [k: string]: string } = { 'Rusted Sword': 'behemothblade', 'Rusted Shield': 'behemothbash', }; const ironHead = pokemon.baseMoves.indexOf('ironhead'); @@ -130,8 +130,8 @@ export const Scripts: ModdedBattleScriptsData = { pokemon.baseMoveSlots[ironHead] = { move: move.name, id: move.id, - pp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, - maxpp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, + pp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, + maxpp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, target: move.target, disabled: false, disabledSource: '', @@ -515,7 +515,7 @@ export const Scripts: ModdedBattleScriptsData = { mutateOriginalSpecies(speciesOrForme, deltas) { if (!deltas) throw new TypeError("Must specify deltas!"); const species = this.dex.deepClone(this.dex.species.get(speciesOrForme)); - species.abilities = {'0': deltas.ability}; + species.abilities = { '0': deltas.ability }; if (deltas.formeType === 'Arceus') { const secondType = species.types[1]; species.types = [deltas.type]; diff --git a/data/mods/partnersincrime/abilities.ts b/data/mods/partnersincrime/abilities.ts index 71f407e0fa..dd56c04bdd 100644 --- a/data/mods/partnersincrime/abilities.ts +++ b/data/mods/partnersincrime/abilities.ts @@ -62,7 +62,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const target = this.sample(possibleTargets); const ability = target.getAbility(); - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); if (isAbility) { pokemon.setAbility(ability); } else { diff --git a/data/mods/partnersincrime/moves.ts b/data/mods/partnersincrime/moves.ts index 06628842f2..e8cd7fb3e4 100644 --- a/data/mods/partnersincrime/moves.ts +++ b/data/mods/partnersincrime/moves.ts @@ -134,9 +134,9 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { const ally = source.side.active.find(mon => mon && mon !== source && !mon.fainted); const foeAlly = target.side.active.find(mon => mon && mon !== target && !mon.fainted); if (target.isAlly(source)) { - this.add('-activate', source, 'move: Skill Swap', '', '', '[of] ' + target); + this.add('-activate', source, 'move: Skill Swap', '', '', `[of] ${target}`); } else { - this.add('-activate', source, 'move: Skill Swap', targetAbility, sourceAbility, '[of] ' + target); + this.add('-activate', source, 'move: Skill Swap', targetAbility, sourceAbility, `[of] ${target}`); } this.singleEvent('End', sourceAbility, source.abilityState, source); if (ally?.m.innate) { @@ -151,8 +151,8 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } source.ability = targetAbility.id; - source.abilityState = this.initEffectState({id: this.toID(source.ability), target: source}); - if (source.m.innate && source.m.innate.endsWith(targetAbility.id)) { + source.abilityState = this.initEffectState({ id: this.toID(source.ability), target: source }); + if (source.m.innate?.endsWith(targetAbility.id)) { source.removeVolatile(source.m.innate); delete source.m.innate; } @@ -166,8 +166,8 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { } target.ability = sourceAbility.id; - target.abilityState = this.initEffectState({id: this.toID(target.ability), target: target}); - if (target.m.innate && target.m.innate.endsWith(sourceAbility.id)) { + target.abilityState = this.initEffectState({ id: this.toID(target.ability), target }); + if (target.m.innate?.endsWith(sourceAbility.id)) { target.removeVolatile(target.m.innate); delete target.m.innate; } diff --git a/data/mods/partnersincrime/scripts.ts b/data/mods/partnersincrime/scripts.ts index 360e966c5d..bf65e98148 100644 --- a/data/mods/partnersincrime/scripts.ts +++ b/data/mods/partnersincrime/scripts.ts @@ -24,9 +24,9 @@ export const Scripts: ModdedBattleScriptsData = { const volatileState = ally.volatiles[ally.m.innate]; if (volatileState) { const volatile = this.dex.conditions.getByID(ally.m.innate as ID); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup let callback = volatile[callbackName]; - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup if (this.gen >= 5 && !volatile.onSwitchIn && !volatile.onAnySwitchIn) { callback = volatile.onStart; } @@ -54,7 +54,7 @@ export const Scripts: ModdedBattleScriptsData = { handlers.shift(); const effect = handler.effect; if ((handler.effectHolder as Pokemon).fainted || (handler.state?.pic as Pokemon)?.fainted) continue; - if (eventid === 'Residual' && handler.end && handler.state && handler.state.duration) { + if (eventid === 'Residual' && handler.end && handler.state?.duration) { handler.state.duration--; if (!handler.state.duration) { const endCallArgs = handler.endCallArgs || [handler.effectHolder, effect.id]; @@ -88,7 +88,7 @@ export const Scripts: ModdedBattleScriptsData = { const ally = side.active.find(mon => mon && mon !== pokemon && !mon.fainted); let allyMoves = ally ? this.dex.deepClone(ally.moveSlots) : []; if (ally) { - // @ts-ignore + // @ts-expect-error modded allyMoves = allyMoves.filter(move => !pokemon.moves.includes(move.id) && ally.m.curMoves.includes(move.id)); for (const aMove of allyMoves) { aMove.pp = this.clampIntRange(aMove.maxpp - (pokemon.m.trackPP.get(aMove.id) || 0), 0); @@ -290,11 +290,11 @@ export const Scripts: ModdedBattleScriptsData = { delete ally.m.innate; } if (this.battle.effect && this.battle.effect.effectType === 'Move' && !isFromFormeChange) { - this.battle.add('-endability', this, this.battle.dex.abilities.get(oldAbility), '[from] move: ' + - this.battle.dex.moves.get(this.battle.effect.id)); + this.battle.add('-endability', this, this.battle.dex.abilities.get(oldAbility), + `[from] move: ${this.battle.dex.moves.get(this.battle.effect.id)}`); } this.ability = ability.id; - this.abilityState = this.battle.initEffectState({id: ability.id, target: this}); + this.abilityState = this.battle.initEffectState({ id: ability.id, target: this }); if (ability.id && this.battle.gen > 3) { this.battle.singleEvent('Start', ability, this.abilityState, this, source); if (ally && ally.ability !== this.ability) { @@ -309,7 +309,7 @@ export const Scripts: ModdedBattleScriptsData = { } } // Entrainment - if (this.m.innate && this.m.innate.endsWith(ability.id)) { + if (this.m.innate?.endsWith(ability.id)) { this.removeVolatile(this.m.innate); delete this.m.innate; } @@ -323,18 +323,20 @@ export const Scripts: ModdedBattleScriptsData = { if (!Array.isArray(ability)) { if (ownAbility === this.battle.toID(ability) || allyAbility === this.battle.toID(ability)) return true; } else { - if (ability.map(this.battle.toID).includes(ownAbility) || ability.map(this.battle.toID).includes(allyAbility)) { - return true; - } + if (ability.map(this.battle.toID).includes(ownAbility) || ability.map(this.battle.toID).includes(allyAbility)) { + return true; + } } return false; }, transformInto(pokemon, effect) { const species = pokemon.species; - if (pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) || + if ( + pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) || (pokemon.transformed && this.battle.gen >= 2) || (this.transformed && this.battle.gen >= 5) || species.name === 'Eternatus-Eternamax' || (['Ogerpon', 'Terapagos'].includes(species.baseSpecies) && - (this.terastallized || pokemon.terastallized))) { + (this.terastallized || pokemon.terastallized)) + ) { return false; } diff --git a/data/mods/passiveaggressive/abilities.ts b/data/mods/passiveaggressive/abilities.ts index bf5437a18f..dd6aae690a 100644 --- a/data/mods/passiveaggressive/abilities.ts +++ b/data/mods/passiveaggressive/abilities.ts @@ -28,7 +28,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const calc = calculate(this, target, source); if (calc) this.damage(calc * source.baseMaxhp / 4, source, target); if (target.species.id === 'cramorantgulping') { - this.boost({def: -1}, source, target, null, true); + this.boost({ def: -1 }, source, target, null, true); } else { source.trySetStatus('par', target, move); } @@ -59,7 +59,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon) { const move = battle.dex.getActiveMove('tackle'); move.type = source.getTypes()[0]; - const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6)); + const typeMod = 2 ** battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6); if (!pokemon.runImmunity(move.type)) return 0; return typeMod; } diff --git a/data/mods/passiveaggressive/conditions.ts b/data/mods/passiveaggressive/conditions.ts index a6ee835c6b..5ab023863d 100644 --- a/data/mods/passiveaggressive/conditions.ts +++ b/data/mods/passiveaggressive/conditions.ts @@ -50,7 +50,7 @@ export const Conditions: import('../../../sim/dex-conditions').ModdedConditionDa function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon) { const move = battle.dex.getActiveMove('tackle'); move.type = source.getTypes()[0]; - const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6)); + const typeMod = 2 ** battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6); if (!pokemon.runImmunity(move.type)) return 0; return typeMod; } diff --git a/data/mods/passiveaggressive/items.ts b/data/mods/passiveaggressive/items.ts index 22f829fecd..8cb7f8da57 100644 --- a/data/mods/passiveaggressive/items.ts +++ b/data/mods/passiveaggressive/items.ts @@ -62,7 +62,7 @@ export const Items: import('../../../sim/dex-items').ModdedItemDataTable = { function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon) { const move = battle.dex.getActiveMove('tackle'); move.type = source.getTypes()[0]; - const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6)); + const typeMod = 2 ** battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6); if (!pokemon.runImmunity(move.type)) return 0; return typeMod; } diff --git a/data/mods/passiveaggressive/moves.ts b/data/mods/passiveaggressive/moves.ts index 9043b7e84c..b79ce3312a 100644 --- a/data/mods/passiveaggressive/moves.ts +++ b/data/mods/passiveaggressive/moves.ts @@ -59,7 +59,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { inherit: true, condition: { onStart(pokemon, source) { - this.add('-start', pokemon, 'Curse', '[of] ' + source); + this.add('-start', pokemon, 'Curse', `[of] ${source}`); }, onResidualOrder: 12, onResidual(pokemon) { @@ -282,10 +282,10 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { onSwitchIn(pokemon) { if (!pokemon.isGrounded()) return; if (pokemon.hasType('Poison')) { - this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, 'move: Toxic Spikes', `[of] ${pokemon}`); pokemon.side.removeSideCondition('toxicspikes'); } else if (pokemon.hasType('Steel') || pokemon.hasItem('heavydutyboots')) { - return; + // do nothing } else if (this.effectState.layers >= 2) { pokemon.trySetStatus('tox', this.effectState.source); } else { @@ -299,7 +299,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon, moveid = 'tackle') { const move = battle.dex.getActiveMove(moveid); move.type = source.getTypes()[0]; - const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6)); + const typeMod = 2 ** battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6); if (!pokemon.runImmunity(move.type)) return 0; return typeMod; } diff --git a/data/mods/passiveaggressive/scripts.ts b/data/mods/passiveaggressive/scripts.ts index 017908a040..39a1e44077 100644 --- a/data/mods/passiveaggressive/scripts.ts +++ b/data/mods/passiveaggressive/scripts.ts @@ -60,7 +60,7 @@ export const Scripts: ModdedBattleScriptsData = { const boostTable = [1, 4 / 3, 5 / 3, 2, 7 / 3, 8 / 3, 3]; if (accuracy !== true) { if (!move.ignoreAccuracy) { - const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); const boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); if (boost > 0) { accuracy *= boostTable[boost]; @@ -69,7 +69,7 @@ export const Scripts: ModdedBattleScriptsData = { } } if (!move.ignoreEvasion) { - const boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); const boost = this.battle.clampIntRange(boosts['evasion'], -6, 6); if (boost > 0) { accuracy /= boostTable[boost]; @@ -108,7 +108,7 @@ export const Scripts: ModdedBattleScriptsData = { // purposes of Counter, Metal Burst, and Mirror Coat. damage[i] = md === true || !md ? 0 : md; // Total damage dealt is accumulated for the purposes of recoil (Parental Bond). - move.totalDamage += damage[i] as number; + move.totalDamage += damage[i]; } if (move.mindBlownRecoil) { const hpBeforeRecoil = pokemon.hp; @@ -150,7 +150,7 @@ export const Scripts: ModdedBattleScriptsData = { } else { recoilDamage = this.battle.clampIntRange(this.battle.trunc(pokemon.maxhp / 4), 1); } - this.battle.directDamage(recoilDamage, pokemon, pokemon, {id: 'strugglerecoil'} as Condition); + this.battle.directDamage(recoilDamage, pokemon, pokemon, { id: 'strugglerecoil' } as Condition); if (pokemon.hp <= pokemon.maxhp / 2 && hpBeforeRecoil > pokemon.maxhp / 2) { this.battle.runEvent('EmergencyExit', pokemon, pokemon); } @@ -176,7 +176,7 @@ export const Scripts: ModdedBattleScriptsData = { this.battle.eachEvent('Update'); - this.afterMoveSecondaryEvent(targetsCopy.filter(val => !!val) as Pokemon[], pokemon, move); + this.afterMoveSecondaryEvent(targetsCopy.filter(val => !!val), pokemon, move); if (!move.negateSecondary && !(move.hasSheerForce && pokemon.hasAbility('sheerforce'))) { for (const [i, d] of damage.entries()) { @@ -207,7 +207,7 @@ export const Scripts: ModdedBattleScriptsData = { function calculate(battle: Battle, source: Pokemon, pokemon: Pokemon, moveid = 'tackle') { const move = battle.dex.getActiveMove(moveid); move.type = source.getTypes()[0]; - const typeMod = Math.pow(2, battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6)); + const typeMod = 2 ** battle.clampIntRange(pokemon.runEffectiveness(move), -6, 6); if (!pokemon.runImmunity(move.type)) return 0; return typeMod; } diff --git a/data/mods/pokebilities/abilities.ts b/data/mods/pokebilities/abilities.ts index 78e3e84080..6b8574d196 100644 --- a/data/mods/pokebilities/abilities.ts +++ b/data/mods/pokebilities/abilities.ts @@ -10,7 +10,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (this.checkMoveMakesContact(move, source, target, !source.isAlly(target))) { const oldAbility = source.setAbility('mummy', target); if (oldAbility) { - this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, '[of] ' + source); + this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, `[of] ${source}`); } } } else { @@ -22,13 +22,13 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (abil === source.ability) { const oldAbility = source.setAbility('mummy', target); if (oldAbility) { - this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, '[of] ' + source); + this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, `[of] ${source}`); } } else { source.removeVolatile('ability:' + abil); source.addVolatile('ability:mummy', source); if (abil) { - this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(abil).name, '[of] ' + source); + this.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(abil).name, `[of] ${source}`); } } } @@ -105,12 +105,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa .filter(val => !this.dex.abilities.get(val).flags['noreceiver'] && !additionalBannedAbilities.includes(val)); if (!possibleAbilities.length) return; const ability = this.dex.abilities.get(possibleAbilities[this.random(possibleAbilities.length)]); - this.add('-ability', pokemon, ability, '[from] ability: Power of Alchemy', '[of] ' + ally); + this.add('-ability', pokemon, ability, '[from] ability: Power of Alchemy', `[of] ${ally}`); if (isAbility) { pokemon.setAbility(ability); } else { pokemon.removeVolatile("ability:powerofalchemy"); - pokemon.addVolatile("ability:" + ability, pokemon); + pokemon.addVolatile(`ability:${ability}`, pokemon); } }, }, @@ -127,12 +127,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa .filter(val => !this.dex.abilities.get(val).flags['noreceiver'] && !additionalBannedAbilities.includes(val)); if (!possibleAbilities.length) return; const ability = this.dex.abilities.get(possibleAbilities[this.random(possibleAbilities.length)]); - this.add('-ability', pokemon, ability, '[from] ability: Receiver', '[of] ' + ally); + this.add('-ability', pokemon, ability, '[from] ability: Receiver', `[of] ${ally}`); if (isAbility) { pokemon.setAbility(ability); } else { pokemon.removeVolatile("ability:receiver"); - pokemon.addVolatile("ability:" + ability, pokemon); + pokemon.addVolatile(`ability:${ability}`, pokemon); } }, }, @@ -160,12 +160,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa continue; } const ability = this.dex.abilities.get(this.sample(possibleAbilities)); - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); if (isAbility) { pokemon.setAbility(ability); } else { pokemon.removeVolatile("ability:trace"); - pokemon.addVolatile("ability:" + ability, pokemon); + pokemon.addVolatile(`ability:${ability}`, pokemon); } return; } @@ -182,9 +182,9 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa const sourceAbility = source.setAbility('wanderingspirit', target); if (!sourceAbility) return; if (target.isAlly(source)) { - this.add('-activate', target, 'Skill Swap', '', '', '[of] ' + source); + this.add('-activate', target, 'Skill Swap', '', '', `[of] ${source}`); } else { - this.add('-activate', target, 'ability: Wandering Spirit', this.dex.abilities.get(sourceAbility).name, 'Wandering Spirit', '[of] ' + source); + this.add('-activate', target, 'ability: Wandering Spirit', this.dex.abilities.get(sourceAbility).name, 'Wandering Spirit', `[of] ${source}`); } target.setAbility(sourceAbility); } @@ -202,9 +202,9 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa source.addVolatile('ability:wanderingspirit', source); } if (target.isAlly(source)) { - this.add('-activate', target, 'Skill Swap', '', '', '[of] ' + source); + this.add('-activate', target, 'Skill Swap', '', '', `[of] ${source}`); } else { - this.add('-activate', target, 'ability: Wandering Spirit', this.dex.abilities.get(sourceAbility).name, 'Wandering Spirit', '[of] ' + source); + this.add('-activate', target, 'ability: Wandering Spirit', this.dex.abilities.get(sourceAbility).name, 'Wandering Spirit', `[of] ${source}`); } if (sourceAbility === source.ability) { target.setAbility(sourceAbility); diff --git a/data/mods/pokemoves/abilities.ts b/data/mods/pokemoves/abilities.ts index 1860c91dcc..c39a5e2cf9 100644 --- a/data/mods/pokemoves/abilities.ts +++ b/data/mods/pokemoves/abilities.ts @@ -15,12 +15,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (isAbility) { if (pokemon.setAbility(ability)) { - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); } } else { pokemon.removeVolatile('ability:trace'); pokemon.addVolatile('ability:' + ability.id, pokemon); - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); } }, }, diff --git a/data/mods/randomroulette/scripts.ts b/data/mods/randomroulette/scripts.ts index 7832aab0fe..84342d1ba3 100644 --- a/data/mods/randomroulette/scripts.ts +++ b/data/mods/randomroulette/scripts.ts @@ -1,6 +1,6 @@ -import {PRNG} from '../../../sim/prng'; -import {Pokemon} from '../../../sim/pokemon'; -import {Teams} from '../../../sim/teams'; +import { PRNG } from '../../../sim/prng'; +import { Pokemon } from '../../../sim/pokemon'; +import { Teams } from '../../../sim/teams'; export const Scripts: ModdedBattleScriptsData = { start() { @@ -114,7 +114,7 @@ export const Scripts: ModdedBattleScriptsData = { if (subFormat.onTeamPreview) subFormat.onTeamPreview.call(this); } - this.queue.addChoice({choice: 'start'}); + this.queue.addChoice({ choice: 'start' }); this.midTurn = true; if (!this.requestState) this.turnLoop(); }, diff --git a/data/mods/sharedpower/abilities.ts b/data/mods/sharedpower/abilities.ts index 4cecc94b6a..c6700cc294 100644 --- a/data/mods/sharedpower/abilities.ts +++ b/data/mods/sharedpower/abilities.ts @@ -66,12 +66,12 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa if (isAbility) { if (pokemon.setAbility(ability)) { - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); } } else { pokemon.removeVolatile('ability:trace'); pokemon.addVolatile('ability:' + ability.id, pokemon); - this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target); + this.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`); } }, }, diff --git a/data/mods/sharingiscaring/scripts.ts b/data/mods/sharingiscaring/scripts.ts index 38a941f5d7..2ee6c6ca8c 100644 --- a/data/mods/sharingiscaring/scripts.ts +++ b/data/mods/sharingiscaring/scripts.ts @@ -1,4 +1,4 @@ -import {RESTORATIVE_BERRIES} from "../../../sim/pokemon"; +import { RESTORATIVE_BERRIES } from "../../../sim/pokemon"; export const Scripts: ModdedBattleScriptsData = { gen: 9, @@ -30,7 +30,7 @@ export const Scripts: ModdedBattleScriptsData = { const hasAnyItem = !!this.item || Object.keys(this.volatiles).some(v => v.startsWith('item:')); // Best to declare everything early because ally might have a gem that needs proccing if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect; - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; const item = (sourceEffect?.id.startsWith('item:')) ? sourceEffect as Item : this.getItem(); if ((!this.hp && !item.isGem) || !this.isActive) return false; if (!hasAnyItem) return false; @@ -38,7 +38,7 @@ export const Scripts: ModdedBattleScriptsData = { if (this.battle.runEvent('UseItem', this, null, null, item)) { switch (item.id.startsWith('item:') ? item.id.slice(5) : item.id) { case 'redcard': - this.battle.add('-enditem', this, item.fullname, '[of] ' + source); + this.battle.add('-enditem', this, item.fullname, `[of] ${source}`); break; default: if (item.isGem) { @@ -71,7 +71,7 @@ export const Scripts: ModdedBattleScriptsData = { eatItem(force, source, sourceEffect) { const hasAnyItem = !!this.item || Object.keys(this.volatiles).some(v => v.startsWith('item:')); if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect; - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; const item = (sourceEffect?.id.startsWith('item:')) ? sourceEffect as Item : this.getItem(); if (!hasAnyItem) return false; if ((!this.hp && this.battle.toID(item.name) !== 'jabocaberry' && this.battle.toID(item.name) !== 'rowapberry') || @@ -129,13 +129,13 @@ export const Scripts: ModdedBattleScriptsData = { const oldItem = this.getItem(); const oldItemState = this.itemState; this.item = item.id; - this.itemState = this.battle.initEffectState({id: item.id, target: this}); + this.itemState = this.battle.initEffectState({ id: item.id, target: this }); if (oldItem.exists) this.battle.singleEvent('End', oldItem, oldItemState, this); if (item.id) { this.battle.singleEvent('Start', item, this.itemState, this, source, effect); for (const ally of this.side.pokemon) { if (!ally.m.sharedItemsUsed) continue; - ally.m.sharedItemsUsed = ally.m.sharedItemsUsed.filter((i: ID) => i !== (item as Item).id); + ally.m.sharedItemsUsed = ally.m.sharedItemsUsed.filter((i: ID) => i !== item.id); } } return true; diff --git a/data/mods/thecardgame/abilities.ts b/data/mods/thecardgame/abilities.ts index 5dcf9c71d9..448bdfeb37 100644 --- a/data/mods/thecardgame/abilities.ts +++ b/data/mods/thecardgame/abilities.ts @@ -98,7 +98,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa inherit: true, onDamagingHit(damage, target, source, move) { if (['Dark', 'Grass', 'Psychic'].includes(move.type)) { - this.boost({spe: 1}); + this.boost({ spe: 1 }); } }, }, diff --git a/data/mods/thecardgame/moves.ts b/data/mods/thecardgame/moves.ts index f6f8319cb1..b20420379c 100644 --- a/data/mods/thecardgame/moves.ts +++ b/data/mods/thecardgame/moves.ts @@ -84,7 +84,7 @@ export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = { if (target.hasType('Normal')) return 0; } }, - ignoreImmunity: {'Fighting': true}, + ignoreImmunity: { 'Fighting': true }, }, trickortreat: { inherit: true, diff --git a/data/mods/thecardgame/scripts.ts b/data/mods/thecardgame/scripts.ts index d4175977c5..c338a1207b 100644 --- a/data/mods/thecardgame/scripts.ts +++ b/data/mods/thecardgame/scripts.ts @@ -80,7 +80,7 @@ export const Scripts: ModdedBattleScriptsData = { if (overriddenBerries.includes(id)) { // these berries were already modded in ./items.ts // so they have inherited references to the base dex naturalGift objects and need new ones - this.modData('Items', id).naturalGift = {...item.naturalGift, type}; + this.modData('Items', id).naturalGift = { ...item.naturalGift, type }; } else { // these were unmodded, so modData makes deep clones of them which makes this a safe write this.modData('Items', id).naturalGift.type = type; diff --git a/data/mods/trademarked/scripts.ts b/data/mods/trademarked/scripts.ts index dcee788474..7ade36cc4d 100644 --- a/data/mods/trademarked/scripts.ts +++ b/data/mods/trademarked/scripts.ts @@ -209,10 +209,12 @@ export const Scripts: ModdedBattleScriptsData = { }, transformInto(pokemon, effect) { const species = pokemon.species; - if (pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) || + if ( + pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) || (pokemon.transformed && this.battle.gen >= 2) || (this.transformed && this.battle.gen >= 5) || species.name === 'Eternatus-Eternamax' || (['Ogerpon', 'Terapagos'].includes(species.baseSpecies) && - (this.terastallized || pokemon.terastallized)) || this.terastallized === 'Stellar') { + (this.terastallized || pokemon.terastallized)) || this.terastallized === 'Stellar' + ) { return false; } diff --git a/data/moves.ts b/data/moves.ts index 808be59fda..05c508d124 100644 --- a/data/moves.ts +++ b/data/moves.ts @@ -26,7 +26,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Absorb", pp: 25, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "normal", @@ -41,7 +41,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Accelerock", pp: 20, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Rock", @@ -55,7 +55,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Acid", pp: 30, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -74,14 +74,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Acid Armor", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 2, }, secondary: null, target: "self", type: "Poison", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Tough", }, aciddownpour: { @@ -108,7 +108,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Acid Spray", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 100, boosts: { @@ -134,7 +134,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Acrobatics", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1 }, secondary: null, target: "any", type: "Flying", @@ -148,7 +148,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Acupressure", pp: 30, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, onHit(target) { const stats: BoostID[] = []; let stat: BoostID; @@ -169,7 +169,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "adjacentAllyOrSelf", type: "Normal", - zMove: {effect: 'crit2'}, + zMove: { effect: 'crit2' }, contestType: "Tough", }, aerialace: { @@ -180,7 +180,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aerial Ace", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1, slicing: 1 }, secondary: null, target: "any", type: "Flying", @@ -194,7 +194,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aeroblast", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, wind: 1 }, critRatio: 2, secondary: null, target: "any", @@ -209,7 +209,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "After You", pp: 15, priority: 0, - flags: {bypasssub: 1, allyanim: 1}, + flags: { bypasssub: 1, allyanim: 1 }, onHit(target) { if (this.activePerHalf === 1) return false; // fails in singles const action = this.queue.willMove(target); @@ -223,7 +223,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Cute", }, agility: { @@ -234,14 +234,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Agility", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spe: 2, }, secondary: null, target: "self", type: "Psychic", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cool", }, aircutter: { @@ -252,7 +252,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Air Cutter", pp: 25, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, slicing: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, slicing: 1, wind: 1 }, critRatio: 2, secondary: null, target: "allAdjacentFoes", @@ -267,7 +267,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Air Slash", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, slicing: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, slicing: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -300,7 +300,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Alluring Voice", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: { chance: 100, onHit(target, source, move) { @@ -320,7 +320,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ally Switch", pp: 15, priority: 2, - flags: {metronome: 1}, + flags: { metronome: 1 }, onPrepareHit(pokemon) { return pokemon.addVolatile('allyswitch'); }, @@ -352,7 +352,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { // this.effectState.counter should never be undefined here. // However, just in case, use 1 if it is undefined. const counter = this.effectState.counter || 1; - this.debug("Ally Switch success chance: " + Math.round(100 / counter) + "%"); + this.debug(`Ally Switch success chance: ${Math.round(100 / counter)}%`); const success = this.randomChance(1, counter); if (!success) { delete pokemon.volatiles['allyswitch']; @@ -367,7 +367,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Psychic", - zMove: {boost: {spe: 2}}, + zMove: { boost: { spe: 2 } }, contestType: "Clever", }, amnesia: { @@ -378,14 +378,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Amnesia", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spd: 2, }, secondary: null, target: "self", type: "Psychic", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, anchorshot: { @@ -397,7 +397,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Anchor Shot", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, onHit(target, source, move) { @@ -416,7 +416,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ancient Power", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, self: { @@ -441,7 +441,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Apple Acid", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 100, boosts: { @@ -459,7 +459,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aqua Cutter", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, slicing: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -474,7 +474,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aqua Jet", pp: 20, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Water", @@ -488,7 +488,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aqua Ring", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, volatileStatus: 'aquaring', condition: { onStart(pokemon) { @@ -502,7 +502,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Water", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Beautiful", }, aquastep: { @@ -513,7 +513,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aqua Step", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, dance: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, dance: 1, metronome: 1 }, secondary: { chance: 100, self: { @@ -534,7 +534,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aqua Tail", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Water", @@ -548,7 +548,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Armor Cannon", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { boosts: { def: -1, @@ -567,7 +567,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Arm Thrust", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", @@ -583,7 +583,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aromatherapy", pp: 5, priority: 0, - flags: {snatch: 1, distance: 1, metronome: 1}, + flags: { snatch: 1, distance: 1, metronome: 1 }, onHit(target, source, move) { this.add('-activate', source, 'move: Aromatherapy'); let success = false; @@ -606,7 +606,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, target: "allyTeam", type: "Grass", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Clever", }, aromaticmist: { @@ -617,14 +617,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aromatic Mist", pp: 20, priority: 0, - flags: {bypasssub: 1, metronome: 1}, + flags: { bypasssub: 1, metronome: 1 }, boosts: { spd: 1, }, secondary: null, target: "adjacentAlly", type: "Fairy", - zMove: {boost: {spd: 2}}, + zMove: { boost: { spd: 2 } }, contestType: "Beautiful", }, assist: { @@ -636,7 +636,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Assist", pp: 20, priority: 0, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onHit(target) { const moves = []; for (const pokemon of target.side.pokemon) { @@ -678,7 +678,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Assurance", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dark", @@ -692,7 +692,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Astonish", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -709,7 +709,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Astral Barrage", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "allAdjacentFoes", type: "Ghost", @@ -722,7 +722,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Attack Order", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -737,7 +737,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Attract", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'attract', condition: { noCopy: true, // doesn't get copied by Baton Pass @@ -752,16 +752,16 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } if (effect.name === 'Cute Charm') { - this.add('-start', pokemon, 'Attract', '[from] ability: Cute Charm', '[of] ' + source); + this.add('-start', pokemon, 'Attract', '[from] ability: Cute Charm', `[of] ${source}`); } else if (effect.name === 'Destiny Knot') { - this.add('-start', pokemon, 'Attract', '[from] item: Destiny Knot', '[of] ' + source); + this.add('-start', pokemon, 'Attract', '[from] item: Destiny Knot', `[of] ${source}`); } else { this.add('-start', pokemon, 'Attract'); } }, onUpdate(pokemon) { if (this.effectState.source && !this.effectState.source.isActive && pokemon.volatiles['attract']) { - this.debug('Removing Attract volatile on ' + pokemon); + this.debug(`Removing Attract volatile on ${pokemon}`); pokemon.removeVolatile('attract'); } }, @@ -783,7 +783,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, aurasphere: { @@ -794,7 +794,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aura Sphere", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, bullet: 1, pulse: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, bullet: 1, pulse: 1 }, secondary: null, target: "any", type: "Fighting", @@ -808,7 +808,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aura Wheel", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 100, self: { @@ -844,7 +844,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aurora Beam", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -863,7 +863,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Aurora Veil", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, sideCondition: 'auroraveil', onTry() { return this.field.isWeather(['hail', 'snowscape']); @@ -879,7 +879,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onAnyModifyDamage(damage, source, target, move) { if (target !== source && this.effectState.target.hasAlly(target)) { if ((target.side.getSideCondition('reflect') && this.getCategory(move) === 'Physical') || - (target.side.getSideCondition('lightscreen') && this.getCategory(move) === 'Special')) { + (target.side.getSideCondition('lightscreen') && this.getCategory(move) === 'Special')) { return; } if (!target.getMoveHitData(move).crit && !move.infiltrates) { @@ -901,7 +901,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Ice", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Beautiful", }, autotomize: { @@ -913,7 +913,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Autotomize", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onTryHit(pokemon) { const hasContrary = pokemon.hasAbility('contrary'); if ((!hasContrary && pokemon.boosts.spe === 6) || (hasContrary && pokemon.boosts.spe === -6)) { @@ -932,7 +932,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Steel", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, avalanche: { @@ -944,7 +944,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { p => p.source === target && p.damage > 0 && p.thisTurn ); if (damagedByTarget) { - this.debug('BP doubled for getting hit by ' + target); + this.debug(`BP doubled for getting hit by ${target}`); return move.basePower * 2; } return move.basePower; @@ -953,7 +953,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Avalanche", pp: 10, priority: -4, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ice", @@ -967,7 +967,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Axe Kick", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, hasCrashDamage: true, onMoveFail(target, source, move) { this.damage(source.baseMaxhp / 2, source, source, this.dex.conditions.get('High Jump Kick')); @@ -987,14 +987,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Baby-Doll Eyes", pp: 30, priority: 1, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, boosts: { atk: -1, }, secondary: null, target: "normal", type: "Fairy", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, baddybad: { @@ -1006,7 +1006,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Baddy Bad", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { sideCondition: 'reflect', }, @@ -1023,7 +1023,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Baneful Bunker", pp: 10, priority: 4, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'banefulbunker', onPrepareHit(pokemon) { @@ -1070,7 +1070,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Poison", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Tough", }, barbbarrage: { @@ -1081,7 +1081,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Barb Barrage", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, pokemon, target) { if (target.status === 'psn' || target.status === 'tox') { return this.chainModify(2); @@ -1103,7 +1103,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Barrage", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, multihit: [2, 5], secondary: null, target: "normal", @@ -1119,14 +1119,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Barrier", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 2, }, secondary: null, target: "self", type: "Psychic", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cool", }, batonpass: { @@ -1137,7 +1137,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Baton Pass", pp: 40, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, onHit(target) { if (!this.canSwitch(target.side) || target.volatiles['commanded']) { this.attrLastMove('[still]'); @@ -1154,7 +1154,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, beakblast: { @@ -1165,7 +1165,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Beak Blast", pp: 15, priority: -3, - flags: {protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1, bullet: 1}, + flags: { protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1, bullet: 1 }, priorityChargeCallback(pokemon) { pokemon.addVolatile('beakblast'); }, @@ -1196,14 +1196,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePowerCallback(pokemon, target, move) { const currentSpecies = move.allies!.shift()!.species; const bp = 5 + Math.floor(currentSpecies.baseStats.atk / 10); - this.debug('BP for ' + currentSpecies.name + ' hit: ' + bp); + this.debug(`BP for ${currentSpecies.name} hit: ${bp}`); return bp; }, category: "Physical", name: "Beat Up", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, allyanim: 1, metronome: 1 }, onModifyMove(move, pokemon) { move.allies = pokemon.side.pokemon.filter(ally => ally === pokemon || !ally.fainted && !ally.status); move.multihit = move.allies.length; @@ -1221,7 +1221,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Behemoth Bash", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, failcopycat: 1, failmimic: 1}, + flags: { contact: 1, protect: 1, mirror: 1, failcopycat: 1, failmimic: 1 }, secondary: null, target: "normal", type: "Steel", @@ -1234,7 +1234,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Behemoth Blade", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, failcopycat: 1, failmimic: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, failcopycat: 1, failmimic: 1, slicing: 1 }, secondary: null, target: "normal", type: "Steel", @@ -1247,7 +1247,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Belch", pp: 10, priority: 0, - flags: {protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onDisableMove(pokemon) { if (!pokemon.ateBerry) pokemon.disableMove('belch'); }, @@ -1264,18 +1264,18 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Belly Drum", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onHit(target) { if (target.hp <= target.maxhp / 2 || target.boosts.atk >= 6 || target.maxhp === 1) { // Shedinja clause return false; } this.directDamage(target.maxhp / 2); - this.boost({atk: 12}, target); + this.boost({ atk: 12 }, target); }, secondary: null, target: "self", type: "Normal", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Cute", }, bestow: { @@ -1287,7 +1287,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bestow", pp: 15, priority: 0, - flags: {mirror: 1, bypasssub: 1, allyanim: 1, noassist: 1, failcopycat: 1}, + flags: { mirror: 1, bypasssub: 1, allyanim: 1, noassist: 1, failcopycat: 1 }, onHit(target, source, move) { if (target.item) { return false; @@ -1298,12 +1298,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { source.item = myItem.id; return false; } - this.add('-item', target, myItem.name, '[from] move: Bestow', '[of] ' + source); + this.add('-item', target, myItem.name, '[from] move: Bestow', `[of] ${source}`); }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 2}}, + zMove: { boost: { spe: 2 } }, contestType: "Cute", }, bide: { @@ -1315,7 +1315,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bide", pp: 10, priority: 1, - flags: {contact: 1, protect: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { contact: 1, protect: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1 }, volatileStatus: 'bide', ignoreImmunity: true, beforeMoveCallback(pokemon) { @@ -1358,7 +1358,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { damage: this.effectState.totalDamage * 2, category: "Physical", priority: 1, - flags: {contact: 1, protect: 1}, + flags: { contact: 1, protect: 1 }, effectType: 'Move', type: 'Normal', }; @@ -1388,7 +1388,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bind", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -1403,7 +1403,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bite", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -1420,7 +1420,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bitter Blade", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1, slicing: 1 }, drain: [1, 2], secondary: null, target: "normal", @@ -1434,7 +1434,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bitter Malice", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -1468,7 +1468,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Blast Burn", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -1485,7 +1485,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Blaze Kick", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: { chance: 10, @@ -1523,7 +1523,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bleakwind Storm", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, onModifyMove(move, pokemon, target) { if (target && ['raindance', 'primordialsea'].includes(target.effectiveWeather())) { move.accuracy = true; @@ -1546,7 +1546,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Blizzard", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, onModifyMove(move) { if (this.field.isWeather(['hail', 'snowscape'])) move.accuracy = true; }, @@ -1566,14 +1566,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Block", pp: 5, priority: 0, - flags: {reflectable: 1, mirror: 1, metronome: 1}, + flags: { reflectable: 1, mirror: 1, metronome: 1 }, onHit(target, source, move) { return target.addVolatile('trapped', source, move, 'trapper'); }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, bloodmoon: { @@ -1584,7 +1584,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Blood Moon", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, cantusetwice: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, cantusetwice: 1 }, secondary: null, target: "normal", type: "Normal", @@ -1613,7 +1613,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Blue Flare", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, status: 'brn', @@ -1630,7 +1630,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Body Press", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, overrideOffensiveStat: 'def', secondary: null, target: "normal", @@ -1644,7 +1644,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Body Slam", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: { chance: 30, status: 'par', @@ -1670,7 +1670,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bolt Beak", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Electric", @@ -1683,7 +1683,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bolt Strike", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, status: 'par', @@ -1701,7 +1701,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bone Club", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, volatileStatus: 'flinch', @@ -1719,12 +1719,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bonemerang", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: 2, secondary: null, target: "normal", type: "Ground", - maxMove: {basePower: 130}, + maxMove: { basePower: 130 }, contestType: "Tough", }, bonerush: { @@ -1735,13 +1735,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bone Rush", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Ground", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, contestType: "Tough", }, boomburst: { @@ -1752,7 +1752,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Boomburst", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: null, target: "allAdjacent", type: "Normal", @@ -1812,7 +1812,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bouncy Bubble", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1}, + flags: { protect: 1, mirror: 1, heal: 1 }, drain: [1, 2], secondary: null, target: "normal", @@ -1827,7 +1827,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Branch Poke", pp: 40, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Grass", @@ -1840,7 +1840,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Brave Bird", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1 }, recoil: [33, 100], secondary: null, target: "any", @@ -1855,7 +1855,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Breaking Swipe", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: { chance: 100, boosts: { @@ -1889,7 +1889,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Brick Break", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTryHit(pokemon) { // will shatter screens through sub, before you hit pokemon.side.removeSideCondition('reflect'); @@ -1909,7 +1909,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Brine", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, pokemon, target) { if (target.hp * 2 <= target.maxhp) { return this.chainModify(2); @@ -1928,7 +1928,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Brutal Swing", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "allAdjacent", type: "Dark", @@ -1943,7 +1943,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bubble", pp: 30, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -1962,7 +1962,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bubble Beam", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -1981,11 +1981,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bug Bite", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onHit(target, source) { const item = target.getItem(); if (source.hp && item.isBerry && target.takeItem(source)) { - this.add('-enditem', target, item.name, '[from] stealeat', '[move] Bug Bite', '[of] ' + source); + this.add('-enditem', target, item.name, '[from] stealeat', '[move] Bug Bite', `[of] ${source}`); if (this.singleEvent('Eat', item, null, source, null, null)) { this.runEvent('EatItem', source, null, null, item); if (item.id === 'leppaberry') target.staleness = 'external'; @@ -2006,7 +2006,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bug Buzz", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -2025,7 +2025,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bulk Up", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { atk: 1, def: 1, @@ -2033,7 +2033,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Fighting", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Cool", }, bulldoze: { @@ -2044,7 +2044,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bulldoze", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -2063,7 +2063,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bullet Punch", pp: 30, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: null, target: "normal", type: "Steel", @@ -2077,13 +2077,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Bullet Seed", pp: 30, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Grass", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, burningbulwark: { @@ -2094,7 +2094,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Burning Bulwark", pp: 10, priority: 4, - flags: {metronome: 1, noassist: 1, failcopycat: 1}, + flags: { metronome: 1, noassist: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'burningbulwark', onPrepareHit(pokemon) { @@ -2150,7 +2150,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Burning Jealousy", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, onHit(target, source, move) { @@ -2172,7 +2172,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Burn Up", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, metronome: 1 }, onTryMove(pokemon, target, move) { if (pokemon.hasType('Fire')) return; this.add('-fail', pokemon, 'move: Burn Up'); @@ -2199,7 +2199,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Buzzy Buzz", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 100, status: 'par', @@ -2216,7 +2216,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Calm Mind", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spa: 1, spd: 1, @@ -2224,7 +2224,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Psychic", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, camouflage: { @@ -2236,7 +2236,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Camouflage", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onHit(target) { let newType = 'Normal'; if (this.field.isTerrain('electricterrain')) { @@ -2255,7 +2255,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Clever", }, captivate: { @@ -2267,7 +2267,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Captivate", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, onTryImmunity(pokemon, source) { return (pokemon.gender === 'M' && source.gender === 'F') || (pokemon.gender === 'F' && source.gender === 'M'); }, @@ -2277,7 +2277,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allAdjacentFoes", type: "Normal", - zMove: {boost: {spd: 2}}, + zMove: { boost: { spd: 2 } }, contestType: "Cute", }, catastropika: { @@ -2289,7 +2289,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Catastropika", pp: 1, priority: 0, - flags: {contact: 1}, + flags: { contact: 1 }, isZ: "pikaniumz", secondary: null, target: "normal", @@ -2304,7 +2304,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ceaseless Edge", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, onAfterHit(target, source, move) { if (!move.hasSheerForce && source.hp) { for (const side of source.side.foeSidesWithConditions()) { @@ -2331,14 +2331,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Celebrate", pp: 40, priority: 0, - flags: {nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onTryHit(target, source) { this.add('-activate', target, 'move: Celebrate'); }, secondary: null, target: "self", type: "Normal", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Cute", }, charge: { @@ -2349,7 +2349,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Charge", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, volatileStatus: 'charge', condition: { onStart(pokemon, source, effect) { @@ -2393,7 +2393,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Electric", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, chargebeam: { @@ -2404,7 +2404,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Charge Beam", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 70, self: { @@ -2425,14 +2425,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Charm", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, boosts: { atk: -2, }, secondary: null, target: "normal", type: "Fairy", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, chatter: { @@ -2464,7 +2464,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Chilling Water", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 100, boosts: { @@ -2501,7 +2501,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Chip Away", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, ignoreDefensive: true, ignoreEvasion: true, secondary: null, @@ -2517,7 +2517,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Chloroblast", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, // Recoil implemented in battle-actions.ts secondary: null, target: "normal", @@ -2531,7 +2531,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Circle Throw", pp: 10, priority: -6, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, noassist: 1, failcopycat: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, noassist: 1, failcopycat: 1 }, forceSwitch: true, target: "normal", type: "Fighting", @@ -2546,7 +2546,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Clamp", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -2561,7 +2561,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Clanging Scales", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, selfBoost: { boosts: { def: -1, @@ -2580,12 +2580,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Clangorous Soul", pp: 5, priority: 0, - flags: {snatch: 1, sound: 1, dance: 1}, + flags: { snatch: 1, sound: 1, dance: 1 }, onTry(source) { if (source.hp <= (source.maxhp * 33 / 100) || source.maxhp === 1) return false; }, onTryHit(pokemon, target, move) { - if (!this.boost(move.boosts as SparseBoostsTable)) return null; + if (!this.boost(move.boosts!)) return null; delete move.boosts; }, onHit(pokemon) { @@ -2611,7 +2611,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Clangorous Soulblaze", pp: 1, priority: 0, - flags: {sound: 1, bypasssub: 1}, + flags: { sound: 1, bypasssub: 1 }, selfBoost: { boosts: { atk: 1, @@ -2637,7 +2637,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Clear Smog", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onHit(target) { target.clearBoosts(); this.add('-clearboost', target); @@ -2655,7 +2655,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Close Combat", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, self: { boosts: { def: -1, @@ -2675,7 +2675,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Coaching", pp: 10, priority: 0, - flags: {bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { bypasssub: 1, allyanim: 1, metronome: 1 }, secondary: null, boosts: { atk: 1, @@ -2692,7 +2692,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Coil", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { atk: 1, def: 1, @@ -2701,7 +2701,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Poison", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Tough", }, collisioncourse: { @@ -2712,7 +2712,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Collision Course", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onBasePower(basePower, source, target, move) { if (target.runEffectiveness(move) > 0) { // Placeholder @@ -2754,12 +2754,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Comet Punch", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Normal", - maxMove: {basePower: 100}, + maxMove: { basePower: 100 }, contestType: "Tough", }, comeuppance: { @@ -2777,10 +2777,10 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Comeuppance", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, failmefirst: 1}, + flags: { contact: 1, protect: 1, mirror: 1, failmefirst: 1 }, onTry(source) { const lastDamagedBy = source.getLastDamagedBy(true); - if (lastDamagedBy === undefined || !lastDamagedBy.thisTurn) return false; + if (!lastDamagedBy?.thisTurn) return false; }, onModifyTarget(targetRelayVar, source, target, move) { const lastDamagedBy = source.getLastDamagedBy(true); @@ -2801,14 +2801,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Confide", pp: 20, priority: 0, - flags: {reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, boosts: { spa: -1, }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Cute", }, confuseray: { @@ -2819,12 +2819,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Confuse Ray", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, volatileStatus: 'confusion', secondary: null, target: "normal", type: "Ghost", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, confusion: { @@ -2835,7 +2835,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Confusion", pp: 25, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, volatileStatus: 'confusion', @@ -2853,7 +2853,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Constrict", pp: 35, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -2888,7 +2888,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Conversion", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onHit(target) { const type = this.dex.moves.get(target.moveSlots[0].id).type; if (target.hasType(type) || !target.setType(type)) return false; @@ -2897,7 +2897,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Beautiful", }, conversion2: { @@ -2908,7 +2908,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Conversion 2", pp: 30, priority: 0, - flags: {bypasssub: 1, metronome: 1}, + flags: { bypasssub: 1, metronome: 1 }, onHit(target, source) { if (!target.lastMoveUsed) { return false; @@ -2933,7 +2933,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Beautiful", }, copycat: { @@ -2944,7 +2944,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Copycat", pp: 20, priority: 0, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onHit(pokemon) { let move: Move | ActiveMove | null = this.lastMove; if (!move) return; @@ -2959,7 +2959,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {accuracy: 1}}, + zMove: { boost: { accuracy: 1 } }, contestType: "Cute", }, coreenforcer: { @@ -2971,7 +2971,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Core Enforcer", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onHit(target) { if (target.getAbility().flags['cantsuppress']) return; if (target.newlySwitched || this.queue.willMove(target)) return; @@ -2985,7 +2985,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allAdjacentFoes", type: "Dragon", - zMove: {basePower: 140}, + zMove: { basePower: 140 }, contestType: "Tough", }, corkscrewcrash: { @@ -3013,11 +3013,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Corrosive Gas", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { const item = target.takeItem(source); if (item) { - this.add('-enditem', target, item.name, '[from] move: Corrosive Gas', '[of] ' + source); + this.add('-enditem', target, item.name, '[from] move: Corrosive Gas', `[of] ${source}`); } else { this.add('-fail', target, 'move: Corrosive Gas'); } @@ -3034,7 +3034,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Cosmic Power", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 1, spd: 1, @@ -3042,7 +3042,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Psychic", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Beautiful", }, cottonguard: { @@ -3053,14 +3053,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Cotton Guard", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 3, }, secondary: null, target: "self", type: "Grass", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, cottonspore: { @@ -3071,14 +3071,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Cotton Spore", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1 }, boosts: { spe: -2, }, secondary: null, target: "allAdjacentFoes", type: "Grass", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, counter: { @@ -3093,7 +3093,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Counter", pp: 20, priority: -5, - flags: {contact: 1, protect: 1, failmefirst: 1, noassist: 1, failcopycat: 1}, + flags: { contact: 1, protect: 1, failmefirst: 1, noassist: 1, failcopycat: 1 }, beforeTurnCallback(pokemon) { pokemon.addVolatile('counter'); }, @@ -3124,7 +3124,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "scripted", type: "Fighting", - maxMove: {basePower: 75}, + maxMove: { basePower: 75 }, contestType: "Tough", }, courtchange: { @@ -3135,7 +3135,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Court Change", pp: 10, priority: 0, - flags: {mirror: 1, metronome: 1}, + flags: { mirror: 1, metronome: 1 }, onHitField(target, source) { const sideConditions = [ 'mist', 'lightscreen', 'reflect', 'spikes', 'safeguard', 'tailwind', 'toxicspikes', 'stealthrock', 'waterpledge', 'firepledge', 'grasspledge', 'stickyweb', 'auroraveil', 'luckychant', 'gmaxsteelsurge', 'gmaxcannonade', 'gmaxvinelash', 'gmaxwildfire', 'gmaxvolcalith', @@ -3146,7 +3146,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const offset = this.random(3) + 1; // the list of all sides in counterclockwise order const sides = [this.sides[0], this.sides[2]!, this.sides[1], this.sides[3]!]; - const temp: {[k: number]: typeof source.side.sideConditions} = {0: {}, 1: {}, 2: {}, 3: {}}; + const temp: { [k: number]: typeof source.side.sideConditions } = { 0: {}, 1: {}, 2: {}, 3: {} }; for (const side of sides) { for (const id in side.sideConditions) { if (!sideConditions.includes(id)) continue; @@ -3207,7 +3207,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Covet", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, failmefirst: 1, noassist: 1, failcopycat: 1}, + flags: { contact: 1, protect: 1, mirror: 1, failmefirst: 1, noassist: 1, failcopycat: 1 }, onAfterHit(target, source, move) { if (source.item || source.volatiles['gem']) { return; @@ -3223,7 +3223,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { target.item = yourItem.id; // bypass setItem so we don't break choicelock or anything return; } - this.add('-item', source, yourItem, '[from] move: Covet', '[of] ' + target); + this.add('-item', source, yourItem, '[from] move: Covet', `[of] ${target}`); }, secondary: null, target: "normal", @@ -3238,7 +3238,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Crabhammer", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -3274,7 +3274,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Fairy", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, crosschop: { @@ -3285,7 +3285,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Cross Chop", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -3300,7 +3300,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Cross Poison", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, secondary: { chance: 10, status: 'psn', @@ -3318,7 +3318,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Crunch", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondary: { chance: 20, boosts: { @@ -3337,7 +3337,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Crush Claw", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 50, boosts: { @@ -3356,19 +3356,19 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const hp = target.hp; const maxHP = target.maxhp; const bp = Math.floor(Math.floor((120 * (100 * Math.floor(hp * 4096 / maxHP)) + 2048 - 1) / 4096) / 100) || 1; - this.debug('BP for ' + hp + '/' + maxHP + " HP: " + bp); + this.debug(`BP for ${hp}/${maxHP} HP: ${bp}`); return bp; }, category: "Physical", name: "Crush Grip", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 190}, - maxMove: {basePower: 140}, + zMove: { basePower: 190 }, + maxMove: { basePower: 140 }, contestType: "Tough", }, curse: { @@ -3379,11 +3379,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Curse", pp: 10, priority: 0, - flags: {bypasssub: 1, metronome: 1}, + flags: { bypasssub: 1, metronome: 1 }, volatileStatus: 'curse', onModifyMove(move, source, target) { if (!source.hasType('Ghost')) { - move.target = move.nonGhostTarget as MoveTarget; + move.target = move.nonGhostTarget!; } else if (source.isAlly(target)) { move.target = 'randomNormal'; } @@ -3392,7 +3392,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (!source.hasType('Ghost')) { delete move.volatileStatus; delete move.onHit; - move.self = {boosts: {spe: -1, atk: 1, def: 1}}; + move.self = { boosts: { spe: -1, atk: 1, def: 1 } }; } else if (move.volatileStatus && target.volatiles['curse']) { return false; } @@ -3402,7 +3402,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, condition: { onStart(pokemon, source) { - this.add('-start', pokemon, 'Curse', '[of] ' + source); + this.add('-start', pokemon, 'Curse', `[of] ${source}`); }, onResidualOrder: 12, onResidual(pokemon) { @@ -3413,7 +3413,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { target: "normal", nonGhostTarget: "self", type: "Ghost", - zMove: {effect: 'curse'}, + zMove: { effect: 'curse' }, contestType: "Tough", }, cut: { @@ -3425,7 +3425,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Cut", pp: 30, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, secondary: null, target: "normal", type: "Normal", @@ -3439,7 +3439,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Darkest Lariat", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, ignoreEvasion: true, ignoreDefensive: true, secondary: null, @@ -3455,7 +3455,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dark Pulse", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, pulse: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, pulse: 1 }, secondary: { chance: 20, volatileStatus: 'flinch', @@ -3472,7 +3472,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dark Void", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1, nosketch: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1, nosketch: 1 }, status: 'slp', onTry(source, target, move) { if (source.species.name === 'Darkrai' || move.hasBounced) { @@ -3485,7 +3485,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allAdjacentFoes", type: "Dark", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, dazzlinggleam: { @@ -3496,7 +3496,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dazzling Gleam", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "allAdjacentFoes", type: "Fairy", @@ -3510,7 +3510,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Decorate", pp: 15, priority: 0, - flags: {allyanim: 1}, + flags: { allyanim: 1 }, secondary: null, boosts: { atk: 2, @@ -3527,7 +3527,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Defend Order", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 1, spd: 1, @@ -3535,7 +3535,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Bug", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, defensecurl: { @@ -3546,7 +3546,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Defense Curl", pp: 40, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 1, }, @@ -3558,7 +3558,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {accuracy: 1}}, + zMove: { boost: { accuracy: 1 } }, contestType: "Cute", }, defog: { @@ -3569,10 +3569,10 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Defog", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, onHit(target, source, move) { let success = false; - if (!target.volatiles['substitute'] || move.infiltrates) success = !!this.boost({evasion: -1}); + if (!target.volatiles['substitute'] || move.infiltrates) success = !!this.boost({ evasion: -1 }); const removeTarget = [ 'reflect', 'lightscreen', 'auroraveil', 'safeguard', 'mist', 'spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge', ]; @@ -3582,13 +3582,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { for (const targetCondition of removeTarget) { if (target.side.removeSideCondition(targetCondition)) { if (!removeAll.includes(targetCondition)) continue; - this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Defog', '[of] ' + source); + this.add('-sideend', target.side, this.dex.conditions.get(targetCondition).name, '[from] move: Defog', `[of] ${source}`); success = true; } } for (const sideCondition of removeAll) { if (source.side.removeSideCondition(sideCondition)) { - this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Defog', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: Defog', `[of] ${source}`); success = true; } } @@ -3598,7 +3598,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Flying", - zMove: {boost: {accuracy: 1}}, + zMove: { boost: { accuracy: 1 } }, contestType: "Cool", }, destinybond: { @@ -3609,7 +3609,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Destiny Bond", pp: 5, priority: 0, - flags: {bypasssub: 1, noassist: 1, failcopycat: 1}, + flags: { bypasssub: 1, noassist: 1, failcopycat: 1 }, volatileStatus: 'destinybond', onPrepareHit(pokemon) { return !pokemon.removeVolatile('destinybond'); @@ -3642,7 +3642,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Ghost", - zMove: {effect: 'redirect'}, + zMove: { effect: 'redirect' }, contestType: "Clever", }, detect: { @@ -3653,7 +3653,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Detect", pp: 5, priority: 4, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'protect', onPrepareHit(pokemon) { @@ -3665,7 +3665,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Fighting", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Cool", }, devastatingdrake: { @@ -3692,7 +3692,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Diamond Storm", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { chance: 50, boosts: { @@ -3759,7 +3759,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Disable", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'disable', onTryHit(target) { if (!target.lastMove || target.lastMove.isZ || target.lastMove.isMax || target.lastMove.id === 'struggle') { @@ -3790,7 +3790,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } } if (effect.effectType === 'Ability') { - this.add('-start', pokemon, 'Disable', pokemon.lastMove.name, '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-start', pokemon, 'Disable', pokemon.lastMove.name, '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-start', pokemon, 'Disable', pokemon.lastMove.name); } @@ -3818,7 +3818,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, disarmingvoice: { @@ -3829,7 +3829,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Disarming Voice", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: null, target: "allAdjacentFoes", type: "Fairy", @@ -3843,7 +3843,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Discharge", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'par', @@ -3860,7 +3860,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dire Claw", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 50, onHit(target, source) { @@ -3935,7 +3935,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dizzy Punch", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: { chance: 20, volatileStatus: 'confusion', @@ -3987,12 +3987,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Doom Desire", pp: 5, priority: 0, - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, onTry(source, target) { if (!target.side.addSlotCondition(target, 'futuremove')) return false; Object.assign(target.side.slotConditions[target.position]['futuremove'], { move: 'doomdesire', - source: source, + source, moveData: { id: 'doomdesire', name: "Doom Desire", @@ -4000,7 +4000,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 140, category: "Special", priority: 0, - flags: {metronome: 1, futuremove: 1}, + flags: { metronome: 1, futuremove: 1 }, effectType: 'Move', type: 'Steel', }, @@ -4021,7 +4021,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Double-Edge", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [33, 100], secondary: null, target: "normal", @@ -4036,13 +4036,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Double Hit", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 2, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 140}, - maxMove: {basePower: 120}, + zMove: { basePower: 140 }, + maxMove: { basePower: 120 }, contestType: "Cool", }, doubleironbash: { @@ -4054,7 +4054,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Double Iron Bash", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1 }, multihit: 2, secondary: { chance: 30, @@ -4062,8 +4062,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, target: "normal", type: "Steel", - zMove: {basePower: 180}, - maxMove: {basePower: 140}, + zMove: { basePower: 180 }, + maxMove: { basePower: 140 }, contestType: "Clever", }, doublekick: { @@ -4074,12 +4074,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Double Kick", pp: 30, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 2, secondary: null, target: "normal", type: "Fighting", - maxMove: {basePower: 80}, + maxMove: { basePower: 80 }, contestType: "Cool", }, doubleshock: { @@ -4090,7 +4090,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Double Shock", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryMove(pokemon, target, move) { if (pokemon.hasType('Electric')) return; this.add('-fail', pokemon, 'move: Double Shock'); @@ -4117,7 +4117,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Double Slap", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", @@ -4132,14 +4132,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Double Team", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { evasion: 1, }, secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cool", }, dracometeor: { @@ -4150,7 +4150,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Draco Meteor", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, self: { boosts: { spa: -2, @@ -4169,7 +4169,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Ascent", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1 }, self: { boosts: { def: -1, @@ -4188,7 +4188,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Breath", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'par', @@ -4205,7 +4205,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Cheer", pp: 15, priority: 0, - flags: {bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { bypasssub: 1, allyanim: 1, metronome: 1 }, volatileStatus: 'dragoncheer', condition: { onStart(target, source, effect) { @@ -4237,7 +4237,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Claw", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dragon", @@ -4251,7 +4251,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Dance", pp: 20, priority: 0, - flags: {snatch: 1, dance: 1, metronome: 1}, + flags: { snatch: 1, dance: 1, metronome: 1 }, boosts: { atk: 1, spe: 1, @@ -4259,7 +4259,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Dragon", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cool", }, dragondarts: { @@ -4270,13 +4270,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Darts", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, noparentalbond: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, noparentalbond: 1 }, multihit: 2, smartTarget: true, secondary: null, target: "normal", type: "Dragon", - maxMove: {basePower: 130}, + maxMove: { basePower: 130 }, }, dragonenergy: { num: 820, @@ -4284,14 +4284,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 150, basePowerCallback(pokemon, target, move) { const bp = move.basePower * pokemon.hp / pokemon.maxhp; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", name: "Dragon Energy", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "allAdjacentFoes", type: "Dragon", @@ -4304,7 +4304,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Hammer", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dragon", @@ -4318,7 +4318,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Pulse", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, pulse: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, pulse: 1 }, secondary: null, target: "any", type: "Dragon", @@ -4334,7 +4334,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Rage", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dragon", @@ -4348,7 +4348,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Rush", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, volatileStatus: 'flinch', @@ -4365,7 +4365,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dragon Tail", pp: 10, priority: -6, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, noassist: 1, failcopycat: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, noassist: 1, failcopycat: 1 }, forceSwitch: true, target: "normal", type: "Dragon", @@ -4379,7 +4379,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Draining Kiss", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [3, 4], secondary: null, target: "normal", @@ -4394,7 +4394,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Drain Punch", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, heal: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "normal", @@ -4409,7 +4409,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dream Eater", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], onTryImmunity(target) { return target.status === 'slp' || target.hasAbility('comatose'); @@ -4427,7 +4427,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Drill Peck", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1 }, secondary: null, target: "any", type: "Flying", @@ -4441,7 +4441,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Drill Run", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -4456,7 +4456,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Drum Beating", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 100, boosts: { @@ -4475,12 +4475,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dual Chop", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 2, secondary: null, target: "normal", type: "Dragon", - maxMove: {basePower: 130}, + maxMove: { basePower: 130 }, contestType: "Tough", }, dualwingbeat: { @@ -4491,12 +4491,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dual Wingbeat", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 2, secondary: null, target: "normal", type: "Flying", - maxMove: {basePower: 130}, + maxMove: { basePower: 130 }, }, dynamaxcannon: { num: 744, @@ -4506,7 +4506,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dynamax Cannon", pp: 5, priority: 0, - flags: {protect: 1, failencore: 1, nosleeptalk: 1, failcopycat: 1, failmimic: 1, failinstruct: 1, noparentalbond: 1}, + flags: { protect: 1, failencore: 1, nosleeptalk: 1, failcopycat: 1, failmimic: 1, failinstruct: 1, noparentalbond: 1 }, secondary: null, target: "normal", type: "Dragon", @@ -4519,7 +4519,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Dynamic Punch", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: { chance: 100, volatileStatus: 'confusion', @@ -4536,7 +4536,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Earth Power", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -4555,7 +4555,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Earthquake", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: null, target: "allAdjacent", type: "Ground", @@ -4570,14 +4570,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (this.field.pseudoWeather.echoedvoice) { bp = move.basePower * this.field.pseudoWeather.echoedvoice.multiplier; } - this.debug('BP: ' + move.basePower); + this.debug(`BP: ${move.basePower}`); return bp; }, category: "Special", name: "Echoed Voice", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, onTry() { this.field.addPseudoWeather('echoedvoice'); }, @@ -4608,14 +4608,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Eerie Impulse", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { spa: -2, }, secondary: null, target: "normal", type: "Electric", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, eeriespell: { @@ -4626,7 +4626,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Eerie Spell", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: { chance: 100, onHit(target) { @@ -4652,7 +4652,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Egg Bomb", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: null, target: "normal", type: "Normal", @@ -4666,7 +4666,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Electric Terrain", pp: 10, priority: 0, - flags: {nonsky: 1, metronome: 1}, + flags: { nonsky: 1, metronome: 1 }, terrain: 'electricterrain', condition: { duration: 5, @@ -4700,7 +4700,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { - this.add('-fieldstart', 'move: Electric Terrain', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-fieldstart', 'move: Electric Terrain', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Electric Terrain'); } @@ -4714,7 +4714,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Electric", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, electrify: { @@ -4726,7 +4726,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Electrify", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, allyanim: 1, metronome: 1 }, volatileStatus: 'electrify', onTryHit(target) { if (!this.queue.willMove(target) && target.activeTurns) return false; @@ -4747,7 +4747,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Electric", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, electroball: { @@ -4758,19 +4758,19 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { let ratio = Math.floor(pokemon.getStat('spe') / target.getStat('spe')); if (!isFinite(ratio)) ratio = 0; const bp = [40, 60, 80, 120, 150][Math.min(ratio, 4)]; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", name: "Electro Ball", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: null, target: "normal", type: "Electric", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, electrodrift: { @@ -4781,7 +4781,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Electro Drift", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onBasePower(basePower, source, target, move) { if (target.runEffectiveness(move) > 0) { // Placeholder @@ -4802,13 +4802,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Electro Shot", pp: 10, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { charge: 1, protect: 1, mirror: 1, metronome: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; } this.add('-prepare', attacker, move.name); - this.boost({spa: 1}, attacker, attacker, move); + this.boost({ spa: 1 }, attacker, attacker, move); if (['raindance', 'primordialsea'].includes(attacker.effectiveWeather())) { this.attrLastMove('[still]'); this.addMove('-anim', attacker, move.name, defender); @@ -4833,7 +4833,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Electroweb", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -4853,7 +4853,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Embargo", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, volatileStatus: 'embargo', condition: { duration: 5, @@ -4870,7 +4870,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, ember: { @@ -4881,7 +4881,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ember", pp: 25, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'brn', @@ -4898,7 +4898,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Encore", pp: 5, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1, failencore: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1, failencore: 1 }, volatileStatus: 'encore', condition: { duration: 3, @@ -4947,7 +4947,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Cute", }, endeavor: { @@ -4961,15 +4961,15 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Endeavor", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, noparentalbond: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, noparentalbond: 1 }, onTryImmunity(target, pokemon) { return pokemon.hp < target.hp; }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Tough", }, endure: { @@ -4980,7 +4980,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Endure", pp: 10, priority: 4, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'endure', onPrepareHit(pokemon) { @@ -5005,7 +5005,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Tough", }, energyball: { @@ -5016,7 +5016,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Energy Ball", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 10, boosts: { @@ -5035,7 +5035,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Entrainment", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onTryHit(target, source) { if (target === source || target.volatiles['dynamax']) return false; if ( @@ -5058,7 +5058,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Cute", }, eruption: { @@ -5067,14 +5067,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 150, basePowerCallback(pokemon, target, move) { const bp = move.basePower * pokemon.hp / pokemon.maxhp; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", name: "Eruption", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "allAdjacentFoes", type: "Fire", @@ -5088,7 +5088,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Esper Wing", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: { chance: 100, @@ -5110,7 +5110,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Eternabeam", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1}, + flags: { recharge: 1, protect: 1, mirror: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -5126,7 +5126,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Expanding Force", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, source) { if (this.field.isTerrain('psychicterrain') && source.isGrounded()) { this.debug('terrain buff'); @@ -5150,7 +5150,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Explosion", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, noparentalbond: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, noparentalbond: 1 }, selfdestruct: "always", secondary: null, target: "allAdjacent", @@ -5165,7 +5165,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Extrasensory", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, volatileStatus: 'flinch', @@ -5205,7 +5205,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Extreme Speed", pp: 5, priority: 2, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -5219,7 +5219,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Facade", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, pokemon) { if (pokemon.status && pokemon.status !== 'slp') { return this.chainModify(2); @@ -5238,7 +5238,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fairy Lock", pp: 10, priority: 0, - flags: {mirror: 1, bypasssub: 1, metronome: 1}, + flags: { mirror: 1, bypasssub: 1, metronome: 1 }, pseudoWeather: 'fairylock', condition: { duration: 2, @@ -5252,7 +5252,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Fairy", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, fairywind: { @@ -5263,7 +5263,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fairy Wind", pp: 30, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, secondary: null, target: "normal", type: "Fairy", @@ -5277,7 +5277,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fake Out", pp: 10, priority: 3, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTry(source) { if (source.activeMoveActions > 1) { this.hint("Fake Out only works on your first turn out."); @@ -5300,14 +5300,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fake Tears", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, boosts: { spd: -2, }, secondary: null, target: "normal", type: "Dark", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Cute", }, falsesurrender: { @@ -5318,7 +5318,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "False Surrender", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Dark", @@ -5331,7 +5331,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "False Swipe", pp: 40, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onDamagePriority: -20, onDamage(damage, target, source, effect) { if (damage >= target.hp) return target.hp - 1; @@ -5349,14 +5349,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Feather Dance", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, dance: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, dance: 1, allyanim: 1, metronome: 1 }, boosts: { atk: -2, }, secondary: null, target: "normal", type: "Flying", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Beautiful", }, feint: { @@ -5367,7 +5367,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Feint", pp: 10, priority: 2, - flags: {mirror: 1, noassist: 1, failcopycat: 1}, + flags: { mirror: 1, noassist: 1, failcopycat: 1 }, breaksProtect: true, // Breaking protection implemented in scripts.js secondary: null, @@ -5384,7 +5384,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Feint Attack", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dark", @@ -5398,9 +5398,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fell Stinger", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onAfterMoveSecondarySelf(pokemon, target, move) { - if (!target || target.fainted || target.hp <= 0) this.boost({atk: 3}, pokemon, pokemon, move); + if (!target || target.fainted || target.hp <= 0) this.boost({ atk: 3 }, pokemon, pokemon, move); }, secondary: null, target: "normal", @@ -5415,7 +5415,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fickle Beam", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, pokemon) { if (this.randomChance(3, 10)) { this.attrLastMove('[anim] Fickle Beam All Out'); @@ -5435,7 +5435,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fiery Dance", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, dance: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, dance: 1, metronome: 1 }, secondary: { chance: 50, self: { @@ -5456,7 +5456,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fiery Wrath", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 20, volatileStatus: 'flinch', @@ -5472,12 +5472,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fillet Away", pp: 10, priority: 0, - flags: {snatch: 1}, + flags: { snatch: 1 }, onTry(source) { if (source.hp <= source.maxhp / 2 || source.maxhp === 1) return false; }, onTryHit(pokemon, target, move) { - if (!this.boost(move.boosts as SparseBoostsTable)) return null; + if (!this.boost(move.boosts!)) return null; delete move.boosts; }, onHit(pokemon) { @@ -5506,11 +5506,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Final Gambit", pp: 5, priority: 0, - flags: {protect: 1, metronome: 1, noparentalbond: 1}, + flags: { protect: 1, metronome: 1, noparentalbond: 1 }, secondary: null, target: "normal", type: "Fighting", - zMove: {basePower: 180}, + zMove: { basePower: 180 }, contestType: "Tough", }, fireblast: { @@ -5521,7 +5521,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fire Blast", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'brn', @@ -5538,7 +5538,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fire Fang", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondaries: [ { chance: 10, @@ -5560,7 +5560,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fire Lash", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -5586,7 +5586,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fire Pledge", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1, pledgecombo: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1, pledgecombo: 1 }, onPrepareHit(target, source, move) { for (const action of this.queue.list as MoveAction[]) { if ( @@ -5606,7 +5606,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (move.sourceEffect === 'waterpledge') { move.type = 'Water'; move.forceSTAB = true; - move.self = {sideCondition: 'waterpledge'}; + move.self = { sideCondition: 'waterpledge' }; } if (move.sourceEffect === 'grasspledge') { move.type = 'Fire'; @@ -5643,7 +5643,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fire Punch", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: { chance: 10, status: 'brn', @@ -5660,7 +5660,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fire Spin", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -5675,7 +5675,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "First Impression", pp: 10, priority: 2, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTry(source) { if (source.activeMoveActions > 1) { this.hint("First Impression only works on your first turn out."); @@ -5704,7 +5704,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fishious Rend", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondary: null, target: "normal", type: "Water", @@ -5717,13 +5717,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fissure", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, ohko: true, secondary: null, target: "normal", type: "Ground", - zMove: {basePower: 180}, - maxMove: {basePower: 130}, + zMove: { basePower: 180 }, + maxMove: { basePower: 130 }, contestType: "Tough", }, flail: { @@ -5746,19 +5746,19 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Flail", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cute", }, flameburst: { @@ -5770,7 +5770,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flame Burst", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onHit(target, source, move) { for (const ally of target.adjacentAllies()) { this.damage(ally.baseMaxhp / 16, ally, source, this.dex.conditions.get('Flame Burst')); @@ -5794,7 +5794,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flame Charge", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, self: { @@ -5815,7 +5815,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flame Wheel", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, defrost: 1, metronome: 1 }, secondary: { chance: 10, status: 'brn', @@ -5832,7 +5832,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flamethrower", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'brn', @@ -5849,7 +5849,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flare Blitz", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, defrost: 1, metronome: 1 }, recoil: [33, 100], secondary: { chance: 10, @@ -5868,14 +5868,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flash", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { accuracy: -1, }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Beautiful", }, flashcannon: { @@ -5886,7 +5886,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flash Cannon", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -5905,7 +5905,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flatter", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, volatileStatus: 'confusion', boosts: { spa: 1, @@ -5913,7 +5913,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, fleurcannon: { @@ -5924,7 +5924,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fleur Cannon", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { boosts: { spa: -2, @@ -5943,14 +5943,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fling", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, allyanim: 1, metronome: 1, noparentalbond: 1}, + flags: { protect: 1, mirror: 1, allyanim: 1, metronome: 1, noparentalbond: 1 }, onPrepareHit(target, source, move) { if (source.ignoringItem()) return false; const item = source.getItem(); if (!this.singleEvent('TakeItem', item, source.itemState, source, source, move, item)) return false; if (!item.fling) return false; move.basePower = item.fling.basePower; - this.debug('BP: ' + move.basePower); + this.debug(`BP: ${move.basePower}`); if (item.isBerry) { move.onHit = function (foe) { if (this.singleEvent('Eat', item, null, foe, null, null)) { @@ -5964,9 +5964,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else { if (!move.secondaries) move.secondaries = []; if (item.fling.status) { - move.secondaries.push({status: item.fling.status}); + move.secondaries.push({ status: item.fling.status }); } else if (item.fling.volatileStatus) { - move.secondaries.push({volatileStatus: item.fling.volatileStatus}); + move.secondaries.push({ volatileStatus: item.fling.volatileStatus }); } } source.addVolatile('fling'); @@ -5995,7 +5995,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flip Turn", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, selfSwitch: true, secondary: null, target: "normal", @@ -6010,7 +6010,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Floaty Fall", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, gravity: 1}, + flags: { contact: 1, protect: 1, mirror: 1, gravity: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -6027,7 +6027,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Floral Healing", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, heal: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, heal: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { let success = false; if (this.field.isTerrain('grassyterrain')) { @@ -6047,7 +6047,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Fairy", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, flowershield: { @@ -6059,29 +6059,29 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flower Shield", pp: 10, priority: 0, - flags: {distance: 1, metronome: 1}, + flags: { distance: 1, metronome: 1 }, onHitField(t, source, move) { const targets: Pokemon[] = []; for (const pokemon of this.getAllActive()) { if ( pokemon.hasType('Grass') && (!pokemon.volatiles['maxguard'] || - this.runEvent('TryHit', pokemon, source, move)) - ) { + this.runEvent('TryHit', pokemon, source, move)) + ) { // This move affects every Grass-type Pokemon in play. targets.push(pokemon); - } + } } let success = false; for (const target of targets) { - success = this.boost({def: 1}, target, source, move) || success; + success = this.boost({ def: 1 }, target, source, move) || success; } return success; }, secondary: null, target: "all", type: "Fairy", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Beautiful", }, flowertrick: { @@ -6092,7 +6092,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Flower Trick", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, willCrit: true, secondary: null, target: "normal", @@ -6147,7 +6147,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { category: "Physical", name: "Flying Press", pp: 10, - flags: {contact: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, gravity: 1, distance: 1, nonsky: 1, metronome: 1 }, onEffectiveness(typeMod, target, type, move) { return typeMod + this.dex.getEffectiveness('Flying', type); }, @@ -6155,7 +6155,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "any", type: "Fighting", - zMove: {basePower: 170}, + zMove: { basePower: 170 }, contestType: "Tough", }, focusblast: { @@ -6166,7 +6166,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Focus Blast", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 10, boosts: { @@ -6185,7 +6185,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Focus Energy", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, volatileStatus: 'focusenergy', condition: { onStart(target, source, effect) { @@ -6205,7 +6205,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {accuracy: 1}}, + zMove: { boost: { accuracy: 1 } }, contestType: "Cool", }, focuspunch: { @@ -6216,7 +6216,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Focus Punch", pp: 20, priority: -3, - flags: {contact: 1, protect: 1, punch: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { + contact: 1, protect: 1, punch: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1, + }, priorityChargeCallback(pokemon) { pokemon.addVolatile('focuspunch'); }, @@ -6253,7 +6255,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Follow Me", pp: 20, priority: 2, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, volatileStatus: 'followme', onTry(source) { return this.activePerHalf > 1; @@ -6279,7 +6281,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, forcepalm: { @@ -6290,7 +6292,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Force Palm", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'par', @@ -6308,7 +6310,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Foresight", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'foresight', onTryHit(target) { if (target.volatiles['miracleeye']) return false; @@ -6330,7 +6332,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {effect: 'crit2'}, + zMove: { effect: 'crit2' }, contestType: "Clever", }, forestscurse: { @@ -6341,7 +6343,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Forest's Curse", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onHit(target) { if (target.hasType('Grass')) return false; if (!target.addType('Grass')) return false; @@ -6350,7 +6352,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Grass", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Clever", }, foulplay: { @@ -6361,7 +6363,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Foul Play", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, overrideOffensivePokemon: 'target', secondary: null, target: "normal", @@ -6376,7 +6378,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Freeze-Dry", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onEffectiveness(typeMod, target, type) { if (type === 'Water') return 1; }, @@ -6396,7 +6398,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Freeze Shock", pp: 5, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { charge: 1, protect: 1, mirror: 1, nosleeptalk: 1, failinstruct: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; @@ -6424,7 +6426,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Freezing Glare", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 10, status: 'frz', @@ -6441,7 +6443,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Freezy Frost", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onHit() { this.add('-clearallboost'); for (const pokemon of this.getAllActive()) { @@ -6461,7 +6463,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Frenzy Plant", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -6478,7 +6480,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Frost Breath", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, willCrit: true, secondary: null, target: "normal", @@ -6497,12 +6499,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Frustration", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cute", }, furyattack: { @@ -6513,7 +6515,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fury Attack", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", @@ -6529,14 +6531,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { pokemon.addVolatile('furycutter'); } const bp = this.clampIntRange(move.basePower * pokemon.volatiles['furycutter'].multiplier, 1, 160); - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Fury Cutter", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, condition: { duration: 2, onStart() { @@ -6562,12 +6564,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fury Swipes", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Normal", - maxMove: {basePower: 100}, + maxMove: { basePower: 100 }, contestType: "Tough", }, fusionbolt: { @@ -6578,7 +6580,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fusion Bolt", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, pokemon) { if (this.lastSuccessfulMoveThisTurn === 'fusionflare') { this.debug('double power'); @@ -6598,7 +6600,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Fusion Flare", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, metronome: 1 }, onBasePower(basePower, pokemon) { if (this.lastSuccessfulMoveThisTurn === 'fusionbolt') { this.debug('double power'); @@ -6618,13 +6620,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Future Sight", pp: 10, priority: 0, - flags: {allyanim: 1, metronome: 1, futuremove: 1}, + flags: { allyanim: 1, metronome: 1, futuremove: 1 }, ignoreImmunity: true, onTry(source, target) { if (!target.side.addSlotCondition(target, 'futuremove')) return false; Object.assign(target.side.slotConditions[target.position]['futuremove'], { move: 'futuresight', - source: source, + source, moveData: { id: 'futuresight', name: "Future Sight", @@ -6632,7 +6634,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 120, category: "Special", priority: 0, - flags: {allyanim: 1, metronome: 1, futuremove: 1}, + flags: { allyanim: 1, metronome: 1, futuremove: 1 }, ignoreImmunity: false, effectType: 'Move', type: 'Psychic', @@ -6654,7 +6656,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Gastro Acid", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, volatileStatus: 'gastroacid', onTryHit(target) { if (target.getAbility().flags['cantsuppress']) { @@ -6679,7 +6681,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Poison", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Tough", }, geargrind: { @@ -6691,13 +6693,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Gear Grind", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 2, secondary: null, target: "normal", type: "Steel", - zMove: {basePower: 180}, - maxMove: {basePower: 130}, + zMove: { basePower: 180 }, + maxMove: { basePower: 130 }, contestType: "Clever", }, gearup: { @@ -6709,7 +6711,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Gear Up", pp: 20, priority: 0, - flags: {snatch: 1, bypasssub: 1, metronome: 1}, + flags: { snatch: 1, bypasssub: 1, metronome: 1 }, onHitSide(side, source, move) { const targets = side.allies().filter(target => ( target.hasAbility(['plus', 'minus']) && @@ -6718,14 +6720,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (!targets.length) return false; let didSomething = false; for (const target of targets) { - didSomething = this.boost({atk: 1, spa: 1}, target, source, move, false, true) || didSomething; + didSomething = this.boost({ atk: 1, spa: 1 }, target, source, move, false, true) || didSomething; } return didSomething; }, secondary: null, target: "allySide", type: "Steel", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, genesissupernova: { @@ -6760,7 +6762,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Geomancy", pp: 10, priority: 0, - flags: {charge: 1, nonsky: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { charge: 1, nonsky: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; @@ -6780,7 +6782,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Fairy", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Beautiful", }, gigadrain: { @@ -6791,7 +6793,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Giga Drain", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "normal", @@ -6806,7 +6808,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Giga Impact", pp: 5, priority: 0, - flags: {contact: 1, recharge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, recharge: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -6823,7 +6825,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Gigaton Hammer", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, cantusetwice: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, cantusetwice: 1 }, secondary: null, target: "normal", type: "Steel", @@ -6852,7 +6854,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Glacial Lance", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "allAdjacentFoes", type: "Ice", @@ -6865,7 +6867,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Glaciate", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -6884,7 +6886,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Glaive Rush", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'glaiverush', }, @@ -6917,12 +6919,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Glare", pp: 30, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, status: 'par', secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Tough", }, glitzyglow: { @@ -6934,7 +6936,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Glitzy Glow", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { sideCondition: 'lightscreen', }, @@ -7202,7 +7204,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { self: { onHit(source) { for (const pokemon of source.foes()) { - this.boost({spe: -2}, pokemon); + this.boost({ spe: -2 }, pokemon); } }, }, @@ -7499,7 +7501,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const steelHazard = this.dex.getActiveMove('Stealth Rock'); steelHazard.type = 'Steel'; const typeMod = this.clampIntRange(pokemon.runEffectiveness(steelHazard), -6, 6); - this.damage(pokemon.maxhp * Math.pow(2, typeMod) / 8); + this.damage(pokemon.maxhp * (2 ** typeMod) / 8); }, }, secondary: null, @@ -7595,7 +7597,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { self: { onHit(source) { for (const pokemon of source.foes()) { - this.boost({evasion: -1}, pokemon); + this.boost({ evasion: -1 }, pokemon); } }, }, @@ -7788,13 +7790,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { for (const targetCondition of removeTarget) { if (source.side.foe.removeSideCondition(targetCondition)) { if (!removeAll.includes(targetCondition)) continue; - this.add('-sideend', source.side.foe, this.dex.conditions.get(targetCondition).name, '[from] move: G-Max Wind Rage', '[of] ' + source); + this.add('-sideend', source.side.foe, this.dex.conditions.get(targetCondition).name, '[from] move: G-Max Wind Rage', `[of] ${source}`); success = true; } } for (const sideCondition of removeAll) { if (source.side.removeSideCondition(sideCondition)) { - this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: G-Max Wind Rage', '[of] ' + source); + this.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] move: G-Max Wind Rage', `[of] ${source}`); success = true; } } @@ -7827,14 +7829,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", name: "Grass Knot", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, onTryHit(target, source, move) { if (target.volatiles['dynamax']) { this.add('-fail', source, 'move: Grass Knot', '[from] Dynamax'); @@ -7845,8 +7847,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Grass", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cute", }, grasspledge: { @@ -7864,7 +7866,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Grass Pledge", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1, pledgecombo: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1, pledgecombo: 1 }, onPrepareHit(target, source, move) { for (const action of this.queue.list as MoveAction[]) { if ( @@ -7920,12 +7922,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Grass Whistle", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, status: 'slp', secondary: null, target: "normal", type: "Grass", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, grassyglide: { @@ -7936,7 +7938,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Grassy Glide", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onModifyPriority(priority, source, target, move) { if (this.field.isTerrain('grassyterrain') && source.isGrounded()) { return priority + 1; @@ -7955,7 +7957,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Grassy Terrain", pp: 10, priority: 0, - flags: {nonsky: 1, metronome: 1}, + flags: { nonsky: 1, metronome: 1 }, terrain: 'grassyterrain', condition: { duration: 5, @@ -7979,7 +7981,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { - this.add('-fieldstart', 'move: Grassy Terrain', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-fieldstart', 'move: Grassy Terrain', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Grassy Terrain'); } @@ -8002,7 +8004,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Grass", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Beautiful", }, gravapple: { @@ -8013,7 +8015,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Grav Apple", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onBasePower(basePower) { if (this.field.getPseudoWeather('gravity')) { return this.chainModify(1.5); @@ -8036,7 +8038,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Gravity", pp: 5, priority: 0, - flags: {nonsky: 1, metronome: 1}, + flags: { nonsky: 1, metronome: 1 }, pseudoWeather: 'gravity', condition: { duration: 5, @@ -8115,7 +8117,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Psychic", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, growl: { @@ -8126,14 +8128,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Growl", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, boosts: { atk: -1, }, secondary: null, target: "allAdjacentFoes", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, growth: { @@ -8144,9 +8146,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Growth", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onModifyMove(move, pokemon) { - if (['sunnyday', 'desolateland'].includes(pokemon.effectiveWeather())) move.boosts = {atk: 2, spa: 2}; + if (['sunnyday', 'desolateland'].includes(pokemon.effectiveWeather())) move.boosts = { atk: 2, spa: 2 }; }, boosts: { atk: 1, @@ -8155,7 +8157,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Beautiful", }, grudge: { @@ -8167,7 +8169,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Grudge", pp: 5, priority: 0, - flags: {bypasssub: 1, metronome: 1}, + flags: { bypasssub: 1, metronome: 1 }, volatileStatus: 'grudge', condition: { onStart(pokemon) { @@ -8196,7 +8198,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Ghost", - zMove: {effect: 'redirect'}, + zMove: { effect: 'redirect' }, contestType: "Tough", }, guardianofalola: { @@ -8234,7 +8236,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Guard Split", pp: 10, priority: 0, - flags: {protect: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { const newdef = Math.floor((target.storedStats.def + source.storedStats.def) / 2); target.storedStats.def = newdef; @@ -8242,12 +8244,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const newspd = Math.floor((target.storedStats.spd + source.storedStats.spd) / 2); target.storedStats.spd = newspd; source.storedStats.spd = newspd; - this.add('-activate', source, 'move: Guard Split', '[of] ' + target); + this.add('-activate', source, 'move: Guard Split', `[of] ${target}`); }, secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, guardswap: { @@ -8258,7 +8260,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Guard Swap", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { const targetBoosts: SparseBoostsTable = {}; const sourceBoosts: SparseBoostsTable = {}; @@ -8277,7 +8279,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, guillotine: { @@ -8288,13 +8290,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Guillotine", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, ohko: true, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 180}, - maxMove: {basePower: 130}, + zMove: { basePower: 180 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, gunkshot: { @@ -8305,7 +8307,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Gunk Shot", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'psn', @@ -8322,7 +8324,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Gust", pp: 35, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, wind: 1 }, secondary: null, target: "any", type: "Flying", @@ -8336,19 +8338,19 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { let power = Math.floor(25 * target.getStat('spe') / pokemon.getStat('spe')) + 1; if (!isFinite(power)) power = 1; if (power > 150) power = 150; - this.debug('BP: ' + power); + this.debug(`BP: ${power}`); return power; }, category: "Physical", name: "Gyro Ball", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: null, target: "normal", type: "Steel", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, hail: { @@ -8360,12 +8362,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hail", pp: 10, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, weather: 'hail', secondary: null, target: "all", type: "Ice", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Beautiful", }, hammerarm: { @@ -8376,7 +8378,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hammer Arm", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, self: { boosts: { spe: -1, @@ -8395,14 +8397,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Happy Hour", pp: 30, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, onTryHit(target, source) { this.add('-activate', target, 'move: Happy Hour'); }, secondary: null, target: "allySide", type: "Normal", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Cute", }, harden: { @@ -8413,14 +8415,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Harden", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 1, }, secondary: null, target: "self", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Tough", }, hardpress: { @@ -8431,14 +8433,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const hp = target.hp; const maxHP = target.maxhp; const bp = Math.floor(Math.floor((100 * (100 * Math.floor(hp * 4096 / maxHP)) + 2048 - 1) / 4096) / 100) || 1; - this.debug('BP for ' + hp + '/' + maxHP + " HP: " + bp); + this.debug(`BP for ${hp}/${maxHP} HP: ${bp}`); return bp; }, category: "Physical", name: "Hard Press", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Steel", @@ -8451,7 +8453,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Haze", pp: 30, priority: 0, - flags: {bypasssub: 1, metronome: 1}, + flags: { bypasssub: 1, metronome: 1 }, onHitField() { this.add('-clearallboost'); for (const pokemon of this.getAllActive()) { @@ -8461,7 +8463,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Ice", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Beautiful", }, headbutt: { @@ -8472,7 +8474,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Headbutt", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -8490,7 +8492,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Head Charge", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [1, 4], secondary: null, target: "normal", @@ -8505,7 +8507,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Headlong Rush", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, self: { boosts: { def: -1, @@ -8524,7 +8526,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Head Smash", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [1, 2], secondary: null, target: "normal", @@ -8539,7 +8541,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Heal Bell", pp: 5, priority: 0, - flags: {snatch: 1, sound: 1, distance: 1, bypasssub: 1, metronome: 1}, + flags: { snatch: 1, sound: 1, distance: 1, bypasssub: 1, metronome: 1 }, onHit(target, source) { this.add('-activate', source, 'move: Heal Bell'); let success = false; @@ -8561,7 +8563,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, target: "allyTeam", type: "Normal", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Beautiful", }, healblock: { @@ -8573,7 +8575,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Heal Block", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, volatileStatus: 'healblock', condition: { duration: 5, @@ -8631,7 +8633,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allAdjacentFoes", type: "Psychic", - zMove: {boost: {spa: 2}}, + zMove: { boost: { spa: 2 } }, contestType: "Clever", }, healingwish: { @@ -8642,7 +8644,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Healing Wish", pp: 10, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onTryHit(source) { if (!this.canSwitch(source.side)) { this.attrLastMove('[still]'); @@ -8679,12 +8681,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Heal Order", pp: 10, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, heal: [1, 2], secondary: null, target: "self", type: "Bug", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, healpulse: { @@ -8695,7 +8697,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Heal Pulse", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, distance: 1, heal: 1, allyanim: 1, metronome: 1, pulse: 1}, + flags: { protect: 1, reflectable: 1, distance: 1, heal: 1, allyanim: 1, metronome: 1, pulse: 1 }, onHit(target, source) { let success = false; if (source.hasAbility('megalauncher')) { @@ -8715,7 +8717,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "any", type: "Psychic", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, heartstamp: { @@ -8727,7 +8729,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Heart Stamp", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -8744,7 +8746,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Heart Swap", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { const targetBoosts: SparseBoostsTable = {}; const sourceBoosts: SparseBoostsTable = {}; @@ -8763,7 +8765,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {effect: 'crit2'}, + zMove: { effect: 'crit2' }, contestType: "Clever", }, heatcrash: { @@ -8785,14 +8787,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else { bp = 40; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Heat Crash", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, onTryHit(target, pokemon, move) { if (target.volatiles['dynamax']) { this.add('-fail', pokemon, 'Dynamax'); @@ -8803,8 +8805,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Fire", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Tough", }, heatwave: { @@ -8815,7 +8817,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Heat Wave", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, secondary: { chance: 10, status: 'brn', @@ -8843,14 +8845,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else { bp = 40; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Heavy Slam", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, onTryHit(target, pokemon, move) { if (target.volatiles['dynamax']) { this.add('-fail', pokemon, 'Dynamax'); @@ -8861,8 +8863,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Steel", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Tough", }, helpinghand: { @@ -8873,7 +8875,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Helping Hand", pp: 20, priority: 5, - flags: {bypasssub: 1, noassist: 1, failcopycat: 1}, + flags: { bypasssub: 1, noassist: 1, failcopycat: 1 }, volatileStatus: 'helpinghand', onTryHit(target) { if (!target.newlySwitched && !this.queue.willMove(target)) return false; @@ -8882,11 +8884,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { duration: 1, onStart(target, source) { this.effectState.multiplier = 1.5; - this.add('-singleturn', target, 'Helping Hand', '[of] ' + source); + this.add('-singleturn', target, 'Helping Hand', `[of] ${source}`); }, onRestart(target, source) { this.effectState.multiplier *= 1.5; - this.add('-singleturn', target, 'Helping Hand', '[of] ' + source); + this.add('-singleturn', target, 'Helping Hand', `[of] ${source}`); }, onBasePowerPriority: 10, onBasePower(basePower) { @@ -8897,7 +8899,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "adjacentAlly", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, hex: { @@ -8915,11 +8917,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hex", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ghost", - zMove: {basePower: 160}, + zMove: { basePower: 160 }, contestType: "Clever", }, hiddenpower: { @@ -8931,7 +8933,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onModifyType(move, pokemon) { move.type = pokemon.hpType || 'Dark'; }, @@ -8950,7 +8952,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Bug", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Bug", @@ -8966,7 +8968,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Dark", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Dark", @@ -8982,7 +8984,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Dragon", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Dragon", @@ -8998,7 +9000,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Electric", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Electric", @@ -9014,7 +9016,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Fighting", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Fighting", @@ -9030,7 +9032,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Fire", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Fire", @@ -9046,7 +9048,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Flying", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Flying", @@ -9062,7 +9064,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Ghost", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Ghost", @@ -9078,7 +9080,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Grass", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Grass", @@ -9094,7 +9096,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Ground", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Ground", @@ -9110,7 +9112,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Ice", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Ice", @@ -9126,7 +9128,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Poison", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Poison", @@ -9142,7 +9144,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Psychic", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Psychic", @@ -9158,7 +9160,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Rock", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Rock", @@ -9174,7 +9176,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Steel", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Steel", @@ -9190,7 +9192,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hidden Power Water", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Water", @@ -9204,7 +9206,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "High Horsepower", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ground", @@ -9218,7 +9220,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "High Jump Kick", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, gravity: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, gravity: 1, metronome: 1 }, hasCrashDamage: true, onMoveFail(target, source, move) { this.damage(source.baseMaxhp / 2, source, source, this.dex.conditions.get('High Jump Kick')); @@ -9237,7 +9239,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hold Back", pp: 40, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onDamagePriority: -20, onDamage(damage, target, source, effect) { if (damage >= target.hp) return target.hp - 1; @@ -9256,11 +9258,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hold Hands", pp: 40, priority: 0, - flags: {bypasssub: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { bypasssub: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, secondary: null, target: "adjacentAlly", type: "Normal", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Cute", }, honeclaws: { @@ -9271,7 +9273,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hone Claws", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { atk: 1, accuracy: 1, @@ -9279,7 +9281,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Dark", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Cute", }, hornattack: { @@ -9290,7 +9292,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Horn Attack", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -9304,13 +9306,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Horn Drill", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, ohko: true, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 180}, - maxMove: {basePower: 130}, + zMove: { basePower: 180 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, hornleech: { @@ -9321,7 +9323,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Horn Leech", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "normal", @@ -9336,14 +9338,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Howl", pp: 40, priority: 0, - flags: {snatch: 1, sound: 1, metronome: 1}, + flags: { snatch: 1, sound: 1, metronome: 1 }, boosts: { atk: 1, }, secondary: null, target: "allies", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Cool", }, hurricane: { @@ -9354,7 +9356,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hurricane", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, wind: 1 }, onModifyMove(move, pokemon, target) { switch (target?.effectiveWeather()) { case 'raindance': @@ -9383,7 +9385,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hydro Cannon", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -9400,7 +9402,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hydro Pump", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Water", @@ -9414,7 +9416,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hydro Steam", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, metronome: 1 }, // Damage boost in Sun applied in conditions.ts thawsTarget: true, secondary: null, @@ -9445,7 +9447,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hyper Beam", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -9462,7 +9464,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hyper Drill", pp: 5, priority: 0, - flags: {contact: 1, mirror: 1}, + flags: { contact: 1, mirror: 1 }, secondary: null, target: "normal", type: "Normal", @@ -9477,7 +9479,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hyper Fang", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondary: { chance: 10, volatileStatus: 'flinch', @@ -9494,7 +9496,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hyperspace Fury", pp: 5, priority: 0, - flags: {mirror: 1, bypasssub: 1, nosketch: 1}, + flags: { mirror: 1, bypasssub: 1, nosketch: 1 }, breaksProtect: true, onTry(source) { if (source.species.name === 'Hoopa-Unbound') { @@ -9528,7 +9530,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hyperspace Hole", pp: 5, priority: 0, - flags: {mirror: 1, bypasssub: 1}, + flags: { mirror: 1, bypasssub: 1 }, breaksProtect: true, secondary: null, target: "normal", @@ -9543,7 +9545,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hyper Voice", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: null, target: "allAdjacentFoes", type: "Normal", @@ -9557,12 +9559,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Hypnosis", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, status: 'slp', secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, iceball: { @@ -9573,7 +9575,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { let bp = move.basePower; const iceballData = pokemon.volatiles['iceball']; if (iceballData?.hitCount) { - bp *= Math.pow(2, iceballData.contactHitCount); + bp *= 2 ** iceballData.contactHitCount; } if (iceballData && pokemon.status !== 'slp') { iceballData.hitCount++; @@ -9585,7 +9587,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (pokemon.volatiles['defensecurl']) { bp *= 2; } - this.debug("BP: " + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", @@ -9593,7 +9595,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Ball", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1, bullet: 1, noparentalbond: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1, bullet: 1, noparentalbond: 1 }, onModifyMove(move, pokemon, target) { if (pokemon.volatiles['iceball'] || pokemon.status === 'slp' || !target) return; pokemon.addVolatile('iceball'); @@ -9641,7 +9643,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Beam", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'frz', @@ -9658,7 +9660,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Burn", pp: 5, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { charge: 1, protect: 1, mirror: 1, nosleeptalk: 1, failinstruct: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; @@ -9686,7 +9688,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Fang", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondaries: [ { chance: 10, @@ -9708,7 +9710,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Hammer", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, self: { boosts: { spe: -1, @@ -9727,7 +9729,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Punch", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: { chance: 10, status: 'frz', @@ -9744,7 +9746,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Shard", pp: 30, priority: 1, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ice", @@ -9758,7 +9760,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ice Spinner", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onAfterHit(target, source) { if (source.hp) { this.field.clearTerrain(); @@ -9781,7 +9783,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Icicle Crash", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -9798,13 +9800,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Icicle Spear", pp: 30, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Ice", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, contestType: "Beautiful", }, icywind: { @@ -9815,7 +9817,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Icy Wind", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, secondary: { chance: 100, boosts: { @@ -9834,7 +9836,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Imprison", pp: 10, priority: 0, - flags: {snatch: 1, bypasssub: 1, metronome: 1, mustpressure: 1}, + flags: { snatch: 1, bypasssub: 1, metronome: 1, mustpressure: 1 }, volatileStatus: 'imprison', condition: { noCopy: true, @@ -9859,7 +9861,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Psychic", - zMove: {boost: {spd: 2}}, + zMove: { boost: { spd: 2 } }, contestType: "Clever", }, incinerate: { @@ -9870,7 +9872,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Incinerate", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onHit(pokemon, source) { const item = pokemon.getItem(); if ((item.isBerry || item.isGem) && pokemon.takeItem(source)) { @@ -9894,7 +9896,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Infernal Parade", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'brn', @@ -9910,7 +9912,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Inferno", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, status: 'brn', @@ -9943,7 +9945,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Infestation", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -9958,7 +9960,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ingrain", pp: 20, priority: 0, - flags: {snatch: 1, nonsky: 1, metronome: 1}, + flags: { snatch: 1, nonsky: 1, metronome: 1 }, volatileStatus: 'ingrain', condition: { onStart(pokemon) { @@ -9980,7 +9982,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Grass", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, instruct: { @@ -9991,7 +9993,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Instruct", pp: 15, priority: 0, - flags: {protect: 1, bypasssub: 1, allyanim: 1, failinstruct: 1}, + flags: { protect: 1, bypasssub: 1, allyanim: 1, failinstruct: 1 }, onHit(target, source) { if (!target.lastMove || target.volatiles['dynamax']) return false; const lastMove = target.lastMove; @@ -10004,7 +10006,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { ) { return false; } - this.add('-singleturn', target, 'move: Instruct', '[of] ' + source); + this.add('-singleturn', target, 'move: Instruct', `[of] ${source}`); this.queue.prioritizeAction(this.queue.resolveAction({ choice: 'move', pokemon: target, @@ -10015,7 +10017,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, iondeluge: { @@ -10027,7 +10029,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ion Deluge", pp: 25, priority: 1, - flags: {metronome: 1}, + flags: { metronome: 1 }, pseudoWeather: 'iondeluge', condition: { duration: 1, @@ -10046,7 +10048,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Electric", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Beautiful", }, irondefense: { @@ -10057,14 +10059,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Iron Defense", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 2, }, secondary: null, target: "self", type: "Steel", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Tough", }, ironhead: { @@ -10075,7 +10077,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Iron Head", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -10092,7 +10094,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Iron Tail", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, boosts: { @@ -10111,7 +10113,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ivy Cudgel", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, onPrepareHit(target, source, move) { if (move.type !== "Grass") { @@ -10143,7 +10145,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Jaw Lock", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, onHit(target, source, move) { source.addVolatile('trapped', target, move, 'trapper'); target.addVolatile('trapped', source, move, 'trapper'); @@ -10160,7 +10162,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Jet Punch", pp: 15, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1 }, secondary: null, target: "normal", type: "Water", @@ -10174,7 +10176,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Judgment", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onModifyType(move, pokemon) { if (pokemon.ignoringItem()) return; const item = pokemon.getItem(); @@ -10196,7 +10198,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Jump Kick", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, gravity: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, gravity: 1, metronome: 1 }, hasCrashDamage: true, onMoveFail(target, source, move) { this.damage(source.baseMaxhp / 2, source, source, this.dex.conditions.get('Jump Kick')); @@ -10214,7 +10216,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Jungle Healing", pp: 10, priority: 0, - flags: {heal: 1, bypasssub: 1, allyanim: 1}, + flags: { heal: 1, bypasssub: 1, allyanim: 1 }, onHit(pokemon) { const success = !!this.heal(this.modify(pokemon.maxhp, 0.25)); return pokemon.cureStatus() || success; @@ -10232,7 +10234,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Karate Chop", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -10248,14 +10250,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Kinesis", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { accuracy: -1, }, secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Clever", }, kingsshield: { @@ -10267,7 +10269,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "King's Shield", pp: 10, priority: 4, - flags: {noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { noassist: 1, failcopycat: 1, failinstruct: 1 }, stallingMove: true, volatileStatus: 'kingsshield', onPrepareHit(pokemon) { @@ -10301,20 +10303,20 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } } if (this.checkMoveMakesContact(move, source, target)) { - this.boost({atk: -1}, source, target, this.dex.getActiveMove("King's Shield")); + this.boost({ atk: -1 }, source, target, this.dex.getActiveMove("King's Shield")); } return this.NOT_FAIL; }, onHit(target, source, move) { if (move.isZOrMaxPowered && this.checkMoveMakesContact(move, source, target)) { - this.boost({atk: -1}, source, target, this.dex.getActiveMove("King's Shield")); + this.boost({ atk: -1 }, source, target, this.dex.getActiveMove("King's Shield")); } }, }, secondary: null, target: "self", type: "Steel", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cool", }, knockoff: { @@ -10325,7 +10327,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Knock Off", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, source, target, move) { const item = target.getItem(); if (!this.singleEvent('TakeItem', item, target.itemState, target, target, move, item)) return; @@ -10337,7 +10339,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (source.hp) { const item = target.takeItem(); if (item) { - this.add('-enditem', target, item.name, '[from] move: Knock Off', '[of] ' + source); + this.add('-enditem', target, item.name, '[from] move: Knock Off', `[of] ${source}`); } } }, @@ -10354,7 +10356,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Kowtow Cleave", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, secondary: null, target: "normal", type: "Dark", @@ -10368,11 +10370,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Land's Wrath", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: null, target: "allAdjacentFoes", type: "Ground", - zMove: {basePower: 185}, + zMove: { basePower: 185 }, contestType: "Beautiful", }, laserfocus: { @@ -10384,7 +10386,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Laser Focus", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, volatileStatus: 'laserfocus', condition: { duration: 2, @@ -10409,7 +10411,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Cool", }, lashout: { @@ -10420,7 +10422,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lash Out", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, source) { if (source.statsLoweredThisTurn) { this.debug('lashout buff'); @@ -10439,7 +10441,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Last Resort", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTry(source) { if (source.moveSlots.length < 2) return false; // Last Resort fails unless the user knows at least 2 moves let hasLastResort = false; // User must actually have Last Resort for it to succeed @@ -10468,7 +10470,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Last Respects", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ghost", @@ -10481,7 +10483,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lava Plume", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'brn', @@ -10498,7 +10500,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Leafage", pp: 40, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Grass", @@ -10512,7 +10514,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Leaf Blade", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -10527,7 +10529,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Leaf Storm", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, self: { boosts: { spa: -2, @@ -10547,7 +10549,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Leaf Tornado", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 50, boosts: { @@ -10566,7 +10568,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Leech Life", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "normal", @@ -10581,7 +10583,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Leech Seed", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, volatileStatus: 'leechseed', condition: { onStart(target) { @@ -10606,7 +10608,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Grass", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, leer: { @@ -10617,14 +10619,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Leer", pp: 30, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { def: -1, }, secondary: null, target: "allAdjacentFoes", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Cool", }, letssnuggleforever: { @@ -10636,7 +10638,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Let's Snuggle Forever", pp: 1, priority: 0, - flags: {contact: 1}, + flags: { contact: 1 }, isZ: "mimikiumz", secondary: null, target: "normal", @@ -10651,7 +10653,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lick", pp: 30, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'par', @@ -10668,7 +10670,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Life Dew", pp: 10, priority: 0, - flags: {snatch: 1, heal: 1, bypasssub: 1}, + flags: { snatch: 1, heal: 1, bypasssub: 1 }, heal: [1, 4], secondary: null, target: "allies", @@ -10683,7 +10685,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Light of Ruin", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, recoil: [1, 2], secondary: null, target: "normal", @@ -10698,7 +10700,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Light Screen", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, sideCondition: 'lightscreen', condition: { duration: 5, @@ -10729,7 +10731,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Psychic", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Beautiful", }, lightthatburnsthesky: { @@ -10760,7 +10762,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Liquidation", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, boosts: { @@ -10779,13 +10781,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lock-On", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTryHit(target, source) { if (source.volatiles['lockon']) return false; }, onHit(target, source) { source.addVolatile('lockon', target); - this.add('-activate', source, 'move: Lock-On', '[of] ' + target); + this.add('-activate', source, 'move: Lock-On', `[of] ${target}`); }, condition: { noCopy: true, // doesn't get copied by Baton Pass @@ -10801,7 +10803,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, lovelykiss: { @@ -10813,12 +10815,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lovely Kiss", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, status: 'slp', secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Beautiful", }, lowkick: { @@ -10841,14 +10843,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Low Kick", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTryHit(target, pokemon, move) { if (target.volatiles['dynamax']) { this.add('-fail', pokemon, 'Dynamax'); @@ -10859,7 +10861,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Fighting", - zMove: {basePower: 160}, + zMove: { basePower: 160 }, contestType: "Tough", }, lowsweep: { @@ -10870,7 +10872,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Low Sweep", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -10890,7 +10892,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lucky Chant", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, sideCondition: 'luckychant', condition: { duration: 5, @@ -10907,7 +10909,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Normal", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Cute", }, luminacrash: { @@ -10918,7 +10920,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lumina Crash", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -10936,7 +10938,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lunar Blessing", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onHit(pokemon) { const success = !!this.heal(this.modify(pokemon.maxhp, 0.25)); return pokemon.cureStatus() || success; @@ -10953,7 +10955,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lunar Dance", pp: 10, priority: 0, - flags: {snatch: 1, dance: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, dance: 1, heal: 1, metronome: 1 }, onTryHit(source) { if (!this.canSwitch(source.side)) { this.attrLastMove('[still]'); @@ -10998,7 +11000,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Lunge", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -11017,7 +11019,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Luster Purge", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 50, boosts: { @@ -11036,7 +11038,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mach Punch", pp: 30, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fighting", @@ -11050,7 +11052,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magical Leaf", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Grass", @@ -11085,7 +11087,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magic Coat", pp: 15, priority: 4, - flags: {metronome: 1}, + flags: { metronome: 1 }, volatileStatus: 'magiccoat', condition: { duration: 1, @@ -11103,7 +11105,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = this.effectState.pranksterBoosted; - this.actions.useMove(newMove, target, {target: source}); + this.actions.useMove(newMove, target, { target: source }); return null; }, onAllyTryHitSide(target, source, move) { @@ -11113,14 +11115,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const newMove = this.dex.getActiveMove(move.id); newMove.hasBounced = true; newMove.pranksterBoosted = false; - this.actions.useMove(newMove, this.effectState.target, {target: source}); + this.actions.useMove(newMove, this.effectState.target, { target: source }); return null; }, }, secondary: null, target: "self", type: "Psychic", - zMove: {boost: {spd: 2}}, + zMove: { boost: { spd: 2 } }, contestType: "Beautiful", }, magicpowder: { @@ -11131,7 +11133,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magic Powder", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1, powder: 1 }, onHit(target) { if (target.getTypes().join() === 'Psychic' || !target.setType('Psychic')) return false; this.add('-start', target, 'typechange', 'Psychic'); @@ -11148,7 +11150,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magic Room", pp: 10, priority: 0, - flags: {mirror: 1, metronome: 1}, + flags: { mirror: 1, metronome: 1 }, pseudoWeather: 'magicroom', condition: { duration: 5, @@ -11161,9 +11163,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onFieldStart(target, source) { if (source?.hasAbility('persistent')) { - this.add('-fieldstart', 'move: Magic Room', '[of] ' + source, '[persistent]'); + this.add('-fieldstart', 'move: Magic Room', `[of] ${source}`, '[persistent]'); } else { - this.add('-fieldstart', 'move: Magic Room', '[of] ' + source); + this.add('-fieldstart', 'move: Magic Room', `[of] ${source}`); } for (const mon of this.getAllActive()) { this.singleEvent('End', mon.getItem(), mon.itemState, mon); @@ -11182,7 +11184,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Psychic", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, magmastorm: { @@ -11193,7 +11195,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magma Storm", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -11209,7 +11211,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magnet Bomb", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: null, target: "normal", type: "Steel", @@ -11223,7 +11225,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magnetic Flux", pp: 20, priority: 0, - flags: {snatch: 1, distance: 1, bypasssub: 1, metronome: 1}, + flags: { snatch: 1, distance: 1, bypasssub: 1, metronome: 1 }, onHitSide(side, source, move) { const targets = side.allies().filter(ally => ( ally.hasAbility(['plus', 'minus']) && @@ -11233,14 +11235,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { let didSomething = false; for (const target of targets) { - didSomething = this.boost({def: 1, spd: 1}, target, source, move, false, true) || didSomething; + didSomething = this.boost({ def: 1, spd: 1 }, target, source, move, false, true) || didSomething; } return didSomething; }, secondary: null, target: "allySide", type: "Electric", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, magnetrise: { @@ -11251,7 +11253,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magnet Rise", pp: 10, priority: 0, - flags: {snatch: 1, gravity: 1, metronome: 1}, + flags: { snatch: 1, gravity: 1, metronome: 1 }, volatileStatus: 'magnetrise', onTry(source, target, move) { if (target.volatiles['smackdown'] || target.volatiles['ingrain']) return false; @@ -11278,7 +11280,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Electric", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Clever", }, magnitude: { @@ -11290,7 +11292,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Magnitude", pp: 30, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, onModifyMove(move, pokemon) { const i = this.random(100); if (i < 5) { @@ -11322,8 +11324,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allAdjacent", type: "Ground", - zMove: {basePower: 140}, - maxMove: {basePower: 140}, + zMove: { basePower: 140 }, + maxMove: { basePower: 140 }, contestType: "Tough", }, makeitrain: { @@ -11334,7 +11336,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Make It Rain", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { boosts: { spa: -1, @@ -11354,7 +11356,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Malicious Moonsault", pp: 1, priority: 0, - flags: {contact: 1}, + flags: { contact: 1 }, isZ: "inciniumz", secondary: null, target: "normal", @@ -11369,7 +11371,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Malignant Chain", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 50, status: 'tox', @@ -11386,7 +11388,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mat Block", pp: 10, priority: 0, - flags: {snatch: 1, nonsky: 1, noassist: 1, failcopycat: 1}, + flags: { snatch: 1, nonsky: 1, noassist: 1, failcopycat: 1 }, stallingMove: true, sideCondition: 'matblock', onTry(source) { @@ -11423,7 +11425,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Fighting", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cool", }, matchagotcha: { @@ -11434,7 +11436,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Matcha Gotcha", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, heal: 1, metronome: 1 }, drain: [1, 2], thawsTarget: true, secondary: { @@ -11459,7 +11461,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.alliesAndSelf()) { - this.boost({spe: 1}, pokemon); + this.boost({ spe: 1 }, pokemon); } }, }, @@ -11482,7 +11484,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.foes()) { - this.boost({spd: -1}, pokemon); + this.boost({ spd: -1 }, pokemon); } }, }, @@ -11526,7 +11528,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.foes()) { - this.boost({spa: -1}, pokemon); + this.boost({ spa: -1 }, pokemon); } }, }, @@ -11641,7 +11643,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.alliesAndSelf()) { - this.boost({atk: 1}, pokemon); + this.boost({ atk: 1 }, pokemon); } }, }, @@ -11706,7 +11708,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.alliesAndSelf()) { - this.boost({spa: 1}, pokemon); + this.boost({ spa: 1 }, pokemon); } }, }, @@ -11750,7 +11752,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.foes()) { - this.boost({def: -1}, pokemon); + this.boost({ def: -1 }, pokemon); } }, }, @@ -11773,7 +11775,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.alliesAndSelf()) { - this.boost({spd: 1}, pokemon); + this.boost({ spd: 1 }, pokemon); } }, }, @@ -11838,7 +11840,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.alliesAndSelf()) { - this.boost({def: 1}, pokemon); + this.boost({ def: 1 }, pokemon); } }, }, @@ -11861,7 +11863,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.foes()) { - this.boost({spe: -1}, pokemon); + this.boost({ spe: -1 }, pokemon); } }, }, @@ -11884,7 +11886,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(source) { if (!source.volatiles['dynamax']) return; for (const pokemon of source.foes()) { - this.boost({atk: -1}, pokemon); + this.boost({ atk: -1 }, pokemon); } }, }, @@ -11900,14 +11902,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mean Look", pp: 5, priority: 0, - flags: {reflectable: 1, mirror: 1, metronome: 1}, + flags: { reflectable: 1, mirror: 1, metronome: 1 }, onHit(target, source, move) { return target.addVolatile('trapped', source, move, 'trapper'); }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Beautiful", }, meditate: { @@ -11919,14 +11921,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Meditate", pp: 40, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { atk: 1, }, secondary: null, target: "self", type: "Psychic", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Beautiful", }, mefirst: { @@ -11952,7 +11954,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (move.category === 'Status' || move.flags['failmefirst']) return false; pokemon.addVolatile('mefirst'); - this.actions.useMove(move, pokemon, {target}); + this.actions.useMove(move, pokemon, { target }); return null; }, condition: { @@ -11966,7 +11968,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "adjacentFoe", type: "Normal", - zMove: {boost: {spe: 2}}, + zMove: { boost: { spe: 2 } }, contestType: "Clever", }, megadrain: { @@ -11977,12 +11979,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mega Drain", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "normal", type: "Grass", - zMove: {basePower: 120}, + zMove: { basePower: 120 }, contestType: "Clever", }, megahorn: { @@ -11993,7 +11995,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Megahorn", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Bug", @@ -12007,7 +12009,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mega Kick", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -12021,7 +12023,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mega Punch", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -12035,7 +12037,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Memento", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, boosts: { atk: -2, spa: -2, @@ -12044,7 +12046,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {effect: 'healreplacement'}, + zMove: { effect: 'healreplacement' }, contestType: "Tough", }, menacingmoonrazemaelstrom: { @@ -12079,10 +12081,10 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Metal Burst", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, failmefirst: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, failmefirst: 1 }, onTry(source) { const lastDamagedBy = source.getLastDamagedBy(true); - if (lastDamagedBy === undefined || !lastDamagedBy.thisTurn) return false; + if (!lastDamagedBy?.thisTurn) return false; }, onModifyTarget(targetRelayVar, source, target, move) { const lastDamagedBy = source.getLastDamagedBy(true); @@ -12103,7 +12105,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Metal Claw", pp: 35, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, self: { @@ -12124,14 +12126,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Metal Sound", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, boosts: { spd: -2, }, secondary: null, target: "normal", type: "Steel", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, meteorassault: { @@ -12143,7 +12145,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Meteor Assault", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, failinstruct: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, failinstruct: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -12159,13 +12161,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Meteor Beam", pp: 10, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { charge: 1, protect: 1, mirror: 1, metronome: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; } this.add('-prepare', attacker, move.name); - this.boost({spa: 1}, attacker, attacker, move); + this.boost({ spa: 1 }, attacker, attacker, move); if (!this.runEvent('ChargeMove', attacker, defender, move)) { return; } @@ -12184,7 +12186,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Meteor Mash", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: { chance: 20, self: { @@ -12205,7 +12207,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Metronome", pp: 10, priority: 0, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onHit(pokemon) { const moves = this.dex.moves.all().filter(move => ( (!move.isNonstandard || move.isNonstandard === 'Unobtainable') && @@ -12233,7 +12235,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mighty Cleave", pp: 5, priority: 0, - flags: {contact: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, mirror: 1, metronome: 1, slicing: 1 }, secondary: null, target: "normal", type: "Rock", @@ -12246,12 +12248,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Milk Drink", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, heal: [1, 2], secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, mimic: { @@ -12290,7 +12292,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {accuracy: 1}}, + zMove: { boost: { accuracy: 1 } }, contestType: "Cute", }, mindblown: { @@ -12302,7 +12304,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mind Blown", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, mindBlownRecoil: true, onAfterMove(pokemon, target, move) { if (move.mindBlownRecoil && !move.multihit) { @@ -12327,18 +12329,18 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mind Reader", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTryHit(target, source) { if (source.volatiles['lockon']) return false; }, onHit(target, source) { source.addVolatile('lockon', target); - this.add('-activate', source, 'move: Mind Reader', '[of] ' + target); + this.add('-activate', source, 'move: Mind Reader', `[of] ${target}`); }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, minimize: { @@ -12349,7 +12351,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Minimize", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, volatileStatus: 'minimize', condition: { noCopy: true, @@ -12378,7 +12380,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, miracleeye: { @@ -12390,7 +12392,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Miracle Eye", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'miracleeye', onTryHit(target) { if (target.volatiles['foresight']) return false; @@ -12412,7 +12414,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, mirrorcoat: { @@ -12427,7 +12429,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mirror Coat", pp: 20, priority: -5, - flags: {protect: 1, failmefirst: 1, noassist: 1}, + flags: { protect: 1, failmefirst: 1, noassist: 1 }, beforeTurnCallback(pokemon) { pokemon.addVolatile('mirrorcoat'); }, @@ -12469,20 +12471,20 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mirror Move", pp: 20, priority: 0, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onTryHit(target, pokemon) { const move = target.lastMove; if (!move?.flags['mirror'] || move.isZ || move.isMax) { return false; } - this.actions.useMove(move.id, pokemon, {target}); + this.actions.useMove(move.id, pokemon, { target }); return null; }, callsMove: true, secondary: null, target: "normal", type: "Flying", - zMove: {boost: {atk: 2}}, + zMove: { boost: { atk: 2 } }, contestType: "Clever", }, mirrorshot: { @@ -12494,7 +12496,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mirror Shot", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, boosts: { @@ -12513,7 +12515,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mist", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, sideCondition: 'mist', condition: { duration: 5, @@ -12545,7 +12547,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Ice", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Beautiful", }, mistball: { @@ -12556,7 +12558,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mist Ball", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 50, boosts: { @@ -12575,7 +12577,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Misty Explosion", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, selfdestruct: "always", onBasePower(basePower, source) { if (this.field.isTerrain('mistyterrain') && source.isGrounded()) { @@ -12595,7 +12597,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Misty Terrain", pp: 10, priority: 0, - flags: {nonsky: 1, metronome: 1}, + flags: { nonsky: 1, metronome: 1 }, terrain: 'mistyterrain', condition: { duration: 5, @@ -12628,7 +12630,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { - this.add('-fieldstart', 'move: Misty Terrain', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-fieldstart', 'move: Misty Terrain', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Misty Terrain'); } @@ -12642,7 +12644,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Fairy", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Beautiful", }, moonblast: { @@ -12653,7 +12655,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Moonblast", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, boosts: { @@ -12672,7 +12674,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Moongeist Beam", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, ignoreAbility: true, secondary: null, target: "normal", @@ -12687,7 +12689,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Moonlight", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onHit(pokemon) { let factor = 0.5; switch (pokemon.effectiveWeather()) { @@ -12713,7 +12715,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Fairy", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, morningsun: { @@ -12724,7 +12726,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Morning Sun", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onHit(pokemon) { let factor = 0.5; switch (pokemon.effectiveWeather()) { @@ -12750,7 +12752,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, mortalspin: { @@ -12761,16 +12763,16 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mortal Spin", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onAfterHit(target, pokemon, move) { if (!move.hasSheerForce) { if (pokemon.hp && pokemon.removeVolatile('leechseed')) { - this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon); + this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', `[of] ${pokemon}`); } const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const condition of sideConditions) { if (pokemon.hp && pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', `[of] ${pokemon}`); } } if (pokemon.hp && pokemon.volatiles['partiallytrapped']) { @@ -12781,12 +12783,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onAfterSubDamage(damage, target, pokemon, move) { if (!move.hasSheerForce) { if (pokemon.hp && pokemon.removeVolatile('leechseed')) { - this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', '[of] ' + pokemon); + this.add('-end', pokemon, 'Leech Seed', '[from] move: Mortal Spin', `[of] ${pokemon}`); } const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const condition of sideConditions) { if (pokemon.hp && pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Mortal Spin', `[of] ${pokemon}`); } } if (pokemon.hp && pokemon.volatiles['partiallytrapped']) { @@ -12809,7 +12811,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mountain Gale", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -12826,7 +12828,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mud Bomb", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 30, boosts: { @@ -12845,7 +12847,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mud Shot", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -12864,7 +12866,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mud-Slap", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -12884,12 +12886,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mud Sport", pp: 15, priority: 0, - flags: {nonsky: 1, metronome: 1}, + flags: { nonsky: 1, metronome: 1 }, pseudoWeather: 'mudsport', condition: { duration: 5, onFieldStart(field, source) { - this.add('-fieldstart', 'move: Mud Sport', '[of] ' + source); + this.add('-fieldstart', 'move: Mud Sport', `[of] ${source}`); }, onBasePowerPriority: 1, onBasePower(basePower, attacker, defender, move) { @@ -12907,7 +12909,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Ground", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Cute", }, muddywater: { @@ -12918,7 +12920,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Muddy Water", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: { chance: 30, boosts: { @@ -12938,7 +12940,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Multi-Attack", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onModifyType(move, pokemon) { if (pokemon.ignoringItem()) return; move.type = this.runEvent('Memory', pokemon, null, move, 'Normal'); @@ -12946,8 +12948,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 185}, - maxMove: {basePower: 95}, + zMove: { basePower: 185 }, + maxMove: { basePower: 95 }, contestType: "Tough", }, mysticalfire: { @@ -12958,7 +12960,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mystical Fire", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -12977,7 +12979,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Mystical Power", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, self: { @@ -12997,14 +12999,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Nasty Plot", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spa: 2, }, secondary: null, target: "self", type: "Dark", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, naturalgift: { @@ -13016,7 +13018,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Natural Gift", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onModifyType(move, pokemon) { if (pokemon.ignoringItem()) return; const item = pokemon.getItem(); @@ -13028,7 +13030,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const item = pokemon.getItem(); if (!item.naturalGift) return false; move.basePower = item.naturalGift.basePower; - this.debug('BP: ' + move.basePower); + this.debug(`BP: ${move.basePower}`); pokemon.setItem(''); pokemon.lastItem = item.id; pokemon.usedItemThisTurn = true; @@ -13037,8 +13039,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Clever", }, naturepower: { @@ -13050,7 +13052,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Nature Power", pp: 20, priority: 0, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onTryHit(target, pokemon) { let move = 'triattack'; if (this.field.isTerrain('electricterrain')) { @@ -13062,7 +13064,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else if (this.field.isTerrain('psychicterrain')) { move = 'psychic'; } - this.actions.useMove(move, pokemon, {target}); + this.actions.useMove(move, pokemon, { target }); return null; }, callsMove: true, @@ -13083,7 +13085,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Nature's Madness", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Fairy", @@ -13098,7 +13100,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Needle Arm", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -13131,7 +13133,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Night Daze", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 40, boosts: { @@ -13151,7 +13153,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Nightmare", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'nightmare', condition: { noCopy: true, @@ -13169,7 +13171,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Ghost", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, nightshade: { @@ -13181,7 +13183,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Night Shade", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ghost", @@ -13195,7 +13197,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Night Slash", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -13210,7 +13212,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Noble Roar", pp: 30, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, boosts: { atk: -1, spa: -1, @@ -13218,7 +13220,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Tough", }, noretreat: { @@ -13229,7 +13231,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "No Retreat", pp: 5, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, volatileStatus: 'noretreat', onTry(source, target, move) { if (source.volatiles['noretreat']) return false; @@ -13284,7 +13286,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Nuzzle", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, status: 'par', @@ -13302,7 +13304,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Oblivion Wing", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, distance: 1, heal: 1, metronome: 1 }, drain: [3, 4], secondary: null, target: "any", @@ -13318,7 +13320,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Obstruct", pp: 10, priority: 4, - flags: {failinstruct: 1}, + flags: { failinstruct: 1 }, stallingMove: true, volatileStatus: 'obstruct', onPrepareHit(pokemon) { @@ -13352,13 +13354,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } } if (this.checkMoveMakesContact(move, source, target)) { - this.boost({def: -2}, source, target, this.dex.getActiveMove("Obstruct")); + this.boost({ def: -2 }, source, target, this.dex.getActiveMove("Obstruct")); } return this.NOT_FAIL; }, onHit(target, source, move) { if (move.isZOrMaxPowered && this.checkMoveMakesContact(move, source, target)) { - this.boost({def: -2}, source, target, this.dex.getActiveMove("Obstruct")); + this.boost({ def: -2 }, source, target, this.dex.getActiveMove("Obstruct")); } }, }, @@ -13391,7 +13393,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Octazooka", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 50, boosts: { @@ -13411,14 +13413,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Octolock", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTryImmunity(target) { return this.dex.getImmunity('trapped', target); }, volatileStatus: 'octolock', condition: { onStart(pokemon, source) { - this.add('-start', pokemon, 'move: Octolock', '[of] ' + source); + this.add('-start', pokemon, 'move: Octolock', `[of] ${source}`); }, onResidualOrder: 14, onResidual(pokemon) { @@ -13428,10 +13430,10 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { this.add('-end', pokemon, 'Octolock', '[partiallytrapped]', '[silent]'); return; } - this.boost({def: -1, spd: -1}, pokemon, source, this.dex.getActiveMove('octolock')); + this.boost({ def: -1, spd: -1 }, pokemon, source, this.dex.getActiveMove('octolock')); }, onTrapPokemon(pokemon) { - if (this.effectState.source && this.effectState.source.isActive) pokemon.tryTrap(); + if (this.effectState.source?.isActive) pokemon.tryTrap(); }, }, secondary: null, @@ -13447,7 +13449,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Odor Sleuth", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, volatileStatus: 'foresight', onTryHit(target) { if (target.volatiles['miracleeye']) return false; @@ -13455,7 +13457,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Clever", }, ominouswind: { @@ -13467,7 +13469,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ominous Wind", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, self: { @@ -13492,20 +13494,20 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Order Up", pp: 10, priority: 0, - flags: {protect: 1}, + flags: { protect: 1 }, onAfterMoveSecondarySelf(pokemon, target, move) { if (!pokemon.volatiles['commanded']) return; const tatsugiri = pokemon.volatiles['commanded'].source; if (tatsugiri.baseSpecies.baseSpecies !== 'Tatsugiri') return; // Should never happen switch (tatsugiri.baseSpecies.forme) { case 'Droopy': - this.boost({def: 1}, pokemon, pokemon); + this.boost({ def: 1 }, pokemon, pokemon); break; case 'Stretchy': - this.boost({spe: 1}, pokemon, pokemon); + this.boost({ spe: 1 }, pokemon, pokemon); break; default: - this.boost({atk: 1}, pokemon, pokemon); + this.boost({ atk: 1 }, pokemon, pokemon); break; } }, @@ -13522,7 +13524,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Origin Pulse", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, pulse: 1}, + flags: { protect: 1, mirror: 1, pulse: 1 }, target: "allAdjacentFoes", type: "Water", contestType: "Beautiful", @@ -13535,7 +13537,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Outrage", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1 }, self: { volatileStatus: 'lockedmove', }, @@ -13557,7 +13559,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Overdrive", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1 }, secondary: null, target: "allAdjacentFoes", type: "Electric", @@ -13570,7 +13572,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Overheat", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, self: { boosts: { spa: -2, @@ -13589,7 +13591,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pain Split", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, allyanim: 1, metronome: 1 }, onHit(target, pokemon) { const targetHP = target.getUndynamaxedHP(); const averagehp = Math.floor((targetHP + pokemon.hp) / 2) || 1; @@ -13602,7 +13604,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, paraboliccharge: { @@ -13613,7 +13615,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Parabolic Charge", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, heal: 1, metronome: 1 }, drain: [1, 2], secondary: null, target: "allAdjacent", @@ -13628,9 +13630,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Parting Shot", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, onHit(target, source, move) { - const success = this.boost({atk: -1, spa: -1}, target, source); + const success = this.boost({ atk: -1, spa: -1 }, target, source); if (!success && !target.hasAbility('mirrorarmor')) { delete move.selfSwitch; } @@ -13639,7 +13641,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {effect: 'healreplacement'}, + zMove: { effect: 'healreplacement' }, contestType: "Cool", }, payback: { @@ -13658,7 +13660,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Payback", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dark", @@ -13672,7 +13674,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pay Day", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -13686,7 +13688,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Peck", pp: 35, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1 }, secondary: null, target: "any", type: "Flying", @@ -13700,7 +13702,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Perish Song", pp: 5, priority: 0, - flags: {sound: 1, distance: 1, bypasssub: 1, metronome: 1}, + flags: { sound: 1, distance: 1, bypasssub: 1, metronome: 1 }, onHitField(target, source, move) { let result = false; let message = false; @@ -13729,13 +13731,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onResidualOrder: 24, onResidual(pokemon) { const duration = pokemon.volatiles['perishsong'].duration; - this.add('-start', pokemon, 'perish' + duration); + this.add('-start', pokemon, `perish${duration}`); }, }, secondary: null, target: "all", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, petalblizzard: { @@ -13746,7 +13748,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Petal Blizzard", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, secondary: null, target: "allAdjacent", type: "Grass", @@ -13760,7 +13762,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Petal Dance", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, dance: 1, metronome: 1, failinstruct: 1}, + flags: { contact: 1, protect: 1, mirror: 1, dance: 1, metronome: 1, failinstruct: 1 }, self: { volatileStatus: 'lockedmove', }, @@ -13782,7 +13784,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Phantom Force", pp: 10, priority: 0, - flags: {contact: 1, charge: 1, mirror: 1, metronome: 1, nosleeptalk: 1, noassist: 1, failinstruct: 1}, + flags: { contact: 1, charge: 1, mirror: 1, metronome: 1, nosleeptalk: 1, noassist: 1, failinstruct: 1 }, breaksProtect: true, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { @@ -13812,7 +13814,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Photon Geyser", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onModifyMove(move, pokemon) { if (pokemon.getStat('atk', false, true) > pokemon.getStat('spa', false, true)) move.category = 'Physical'; }, @@ -13828,7 +13830,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 0, basePowerCallback(pokemon) { const bp = Math.floor((pokemon.happiness * 10) / 25) || 1; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", @@ -13836,7 +13838,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pika Papow", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Electric", @@ -13850,13 +13852,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pin Missile", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Bug", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, plasmafists: { @@ -13868,7 +13870,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Plasma Fists", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1 }, pseudoWeather: 'iondeluge', secondary: null, target: "normal", @@ -13883,14 +13885,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Play Nice", pp: 20, priority: 0, - flags: {reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, boosts: { atk: -1, }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, playrough: { @@ -13901,7 +13903,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Play Rough", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -13920,11 +13922,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pluck", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1 }, onHit(target, source) { const item = target.getItem(); if (source.hp && item.isBerry && target.takeItem(source)) { - this.add('-enditem', target, item.name, '[from] stealeat', '[move] Pluck', '[of] ' + source); + this.add('-enditem', target, item.name, '[from] stealeat', '[move] Pluck', `[of] ${source}`); if (this.singleEvent('Eat', item, null, source, null, null)) { this.runEvent('EatItem', source, null, null, item); if (item.id === 'leppaberry') target.staleness = 'external'; @@ -13945,7 +13947,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Poison Fang", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondary: { chance: 50, status: 'tox', @@ -13962,12 +13964,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Poison Gas", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, status: 'psn', secondary: null, target: "allAdjacentFoes", type: "Poison", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, poisonjab: { @@ -13978,7 +13980,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Poison Jab", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'psn', @@ -13995,12 +13997,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Poison Powder", pp: 35, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1 }, status: 'psn', secondary: null, target: "normal", type: "Poison", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, poisonsting: { @@ -14011,7 +14013,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Poison Sting", pp: 35, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'psn', @@ -14028,7 +14030,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Poison Tail", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: { chance: 10, @@ -14046,7 +14048,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pollen Puff", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, allyanim: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, allyanim: 1, metronome: 1, bullet: 1 }, onTryHit(target, source, move) { if (source.isAlly(target)) { move.basePower = 0; @@ -14087,7 +14089,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Poltergeist", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTry(source, target) { return !!target.item; }, @@ -14106,7 +14108,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Population Bomb", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, slicing: 1 }, multihit: 10, multiaccuracy: true, secondary: null, @@ -14121,7 +14123,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pounce", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: { chance: 100, boosts: { @@ -14140,7 +14142,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pound", pp: 35, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -14155,7 +14157,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Powder", pp: 20, priority: 1, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1, powder: 1 }, volatileStatus: 'powder', condition: { duration: 1, @@ -14175,7 +14177,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Bug", - zMove: {boost: {spd: 2}}, + zMove: { boost: { spd: 2 } }, contestType: "Clever", }, powdersnow: { @@ -14186,7 +14188,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Powder Snow", pp: 25, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'frz', @@ -14203,7 +14205,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Power Gem", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Rock", @@ -14218,7 +14220,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Power Shift", pp: 10, priority: 0, - flags: {snatch: 1}, + flags: { snatch: 1 }, volatileStatus: 'powershift', condition: { onStart(pokemon) { @@ -14257,7 +14259,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Power Split", pp: 10, priority: 0, - flags: {protect: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { const newatk = Math.floor((target.storedStats.atk + source.storedStats.atk) / 2); target.storedStats.atk = newatk; @@ -14265,12 +14267,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const newspa = Math.floor((target.storedStats.spa + source.storedStats.spa) / 2); target.storedStats.spa = newspa; source.storedStats.spa = newspa; - this.add('-activate', source, 'move: Power Split', '[of] ' + target); + this.add('-activate', source, 'move: Power Split', `[of] ${target}`); }, secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, powerswap: { @@ -14281,7 +14283,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Power Swap", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { const targetBoosts: SparseBoostsTable = {}; const sourceBoosts: SparseBoostsTable = {}; @@ -14300,7 +14302,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, powertrick: { @@ -14311,7 +14313,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Power Trick", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, volatileStatus: 'powertrick', condition: { onStart(pokemon) { @@ -14341,7 +14343,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Psychic", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Clever", }, powertrip: { @@ -14350,19 +14352,19 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 20, basePowerCallback(pokemon, target, move) { const bp = move.basePower + 20 * pokemon.positiveBoosts(); - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Power Trip", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dark", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Clever", }, poweruppunch: { @@ -14374,7 +14376,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Power-Up Punch", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: { chance: 100, self: { @@ -14395,7 +14397,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Power Whip", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Grass", @@ -14409,7 +14411,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Precipice Blades", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1 }, target: "allAdjacentFoes", type: "Ground", contestType: "Cool", @@ -14422,7 +14424,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Present", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onModifyMove(move, pokemon, target) { const rand = this.random(10); if (rand < 2) { @@ -14449,7 +14451,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Prismatic Laser", pp: 10, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -14466,7 +14468,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Protect", pp: 10, priority: 4, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'protect', onPrepareHit(pokemon) { @@ -14505,7 +14507,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, psybeam: { @@ -14516,7 +14518,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psybeam", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, volatileStatus: 'confusion', @@ -14533,7 +14535,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psyblade", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, secondary: null, onBasePower(basePower, source) { if (this.field.isTerrain('electricterrain')) { @@ -14552,7 +14554,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psych Up", pp: 10, priority: 0, - flags: {bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { bypasssub: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { let i: BoostID; for (i in target.boosts) { @@ -14575,7 +14577,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Clever", }, psychic: { @@ -14586,7 +14588,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psychic", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, boosts: { @@ -14605,7 +14607,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psychic Fangs", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, onTryHit(pokemon) { // will shatter screens through sub, before you hit pokemon.side.removeSideCondition('reflect'); @@ -14625,7 +14627,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psychic Noise", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: { chance: 100, volatileStatus: 'healblock', @@ -14641,7 +14643,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psychic Terrain", pp: 10, priority: 0, - flags: {nonsky: 1, metronome: 1}, + flags: { nonsky: 1, metronome: 1 }, terrain: 'psychicterrain', condition: { duration: 5, @@ -14676,7 +14678,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onFieldStart(field, source, effect) { if (effect?.effectType === 'Ability') { - this.add('-fieldstart', 'move: Psychic Terrain', '[from] ability: ' + effect.name, '[of] ' + source); + this.add('-fieldstart', 'move: Psychic Terrain', '[from] ability: ' + effect.name, `[of] ${source}`); } else { this.add('-fieldstart', 'move: Psychic Terrain'); } @@ -14690,7 +14692,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Psychic", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, psychoboost: { @@ -14701,7 +14703,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psycho Boost", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, self: { boosts: { spa: -2, @@ -14720,7 +14722,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psycho Cut", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, slicing: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -14736,7 +14738,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psycho Shift", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTryHit(target, source, move) { if (!source.status) return false; move.status = source.status; @@ -14749,7 +14751,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spa: 2}}, + zMove: { boost: { spa: 2 } }, contestType: "Clever", }, psyshieldbash: { @@ -14760,7 +14762,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psyshield Bash", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, self: { @@ -14781,7 +14783,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psyshock", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Psychic", @@ -14796,7 +14798,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psystrike", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Psychic", @@ -14814,7 +14816,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Psywave", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Psychic", @@ -14829,7 +14831,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pulverizing Pancake", pp: 1, priority: 0, - flags: {contact: 1}, + flags: { contact: 1 }, isZ: "snorliumz", secondary: null, target: "normal", @@ -14843,7 +14845,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePowerCallback(pokemon, target) { let power = 60 + 20 * target.positiveBoosts(); if (power > 200) power = 200; - this.debug('BP: ' + power); + this.debug(`BP: ${power}`); return power; }, category: "Physical", @@ -14851,12 +14853,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Punishment", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Dark", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, purify: { @@ -14868,7 +14870,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Purify", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, heal: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, heal: 1, metronome: 1 }, onHit(target, source) { if (!target.cureStatus()) { this.add('-fail', source); @@ -14880,7 +14882,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Poison", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Beautiful", }, pursuit: { @@ -14900,7 +14902,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pursuit", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, beforeTurnCallback(pokemon) { for (const side of this.sides) { if (side.hasAlly(pokemon)) continue; @@ -14965,7 +14967,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Pyro Ball", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, bullet: 1 }, secondary: { chance: 10, status: 'brn', @@ -14981,7 +14983,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Quash", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onHit(target) { if (this.activePerHalf === 1) return false; // fails in singles const action = this.queue.willMove(target); @@ -14993,7 +14995,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, quickattack: { @@ -15004,7 +15006,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Quick Attack", pp: 30, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -15018,7 +15020,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Quick Guard", pp: 15, priority: 3, - flags: {snatch: 1}, + flags: { snatch: 1 }, sideCondition: 'quickguard', onTry() { return !!this.queue.willAct(); @@ -15055,7 +15057,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Fighting", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cool", }, quiverdance: { @@ -15066,7 +15068,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Quiver Dance", pp: 20, priority: 0, - flags: {snatch: 1, dance: 1, metronome: 1}, + flags: { snatch: 1, dance: 1, metronome: 1 }, boosts: { spa: 1, spd: 1, @@ -15075,7 +15077,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Bug", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, rage: { @@ -15087,7 +15089,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rage", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'rage', }, @@ -15097,7 +15099,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onHit(target, source, move) { if (target !== source && move.category !== 'Status') { - this.boost({atk: 1}); + this.boost({ atk: 1 }); } }, onBeforeMovePriority: 100, @@ -15122,7 +15124,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rage Fist", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1 }, secondary: null, target: "normal", type: "Ghost", @@ -15135,7 +15137,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rage Powder", pp: 20, priority: 2, - flags: {noassist: 1, failcopycat: 1, powder: 1}, + flags: { noassist: 1, failcopycat: 1, powder: 1 }, volatileStatus: 'ragepowder', onTry(source) { return this.activePerHalf > 1; @@ -15160,7 +15162,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Bug", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, ragingbull: { @@ -15171,7 +15173,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Raging Bull", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, onTryHit(pokemon) { // will shatter screens through sub, before you hit pokemon.side.removeSideCondition('reflect'); @@ -15203,7 +15205,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Raging Fury", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { volatileStatus: 'lockedmove', }, @@ -15224,12 +15226,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rain Dance", pp: 5, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, weather: 'RainDance', secondary: null, target: "all", type: "Water", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Beautiful", }, rapidspin: { @@ -15240,16 +15242,16 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rapid Spin", pp: 40, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onAfterHit(target, pokemon, move) { if (!move.hasSheerForce) { if (pokemon.hp && pokemon.removeVolatile('leechseed')) { - this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon); + this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', `[of] ${pokemon}`); } const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const condition of sideConditions) { if (pokemon.hp && pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', `[of] ${pokemon}`); } } if (pokemon.hp && pokemon.volatiles['partiallytrapped']) { @@ -15260,12 +15262,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onAfterSubDamage(damage, target, pokemon, move) { if (!move.hasSheerForce) { if (pokemon.hp && pokemon.removeVolatile('leechseed')) { - this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', '[of] ' + pokemon); + this.add('-end', pokemon, 'Leech Seed', '[from] move: Rapid Spin', `[of] ${pokemon}`); } const sideConditions = ['spikes', 'toxicspikes', 'stealthrock', 'stickyweb', 'gmaxsteelsurge']; for (const condition of sideConditions) { if (pokemon.hp && pokemon.side.removeSideCondition(condition)) { - this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, this.dex.conditions.get(condition).name, '[from] move: Rapid Spin', `[of] ${pokemon}`); } } if (pokemon.hp && pokemon.volatiles['partiallytrapped']) { @@ -15293,7 +15295,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Razor Leaf", pp: 25, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, slicing: 1 }, critRatio: 2, secondary: null, target: "allAdjacentFoes", @@ -15308,7 +15310,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Razor Shell", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, secondary: { chance: 50, boosts: { @@ -15328,7 +15330,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Razor Wind", pp: 10, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; @@ -15354,12 +15356,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Recover", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, heal: [1, 2], secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, recycle: { @@ -15370,7 +15372,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Recycle", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onHit(pokemon) { if (pokemon.item || !pokemon.lastItem) return false; const item = pokemon.lastItem; @@ -15381,7 +15383,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {spe: 2}}, + zMove: { boost: { spe: 2 } }, contestType: "Clever", }, reflect: { @@ -15392,7 +15394,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Reflect", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, sideCondition: 'reflect', condition: { duration: 5, @@ -15423,7 +15425,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Psychic", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, reflecttype: { @@ -15434,7 +15436,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Reflect Type", pp: 15, priority: 0, - flags: {protect: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { if (source.species && (source.species.num === 493 || source.species.num === 773)) return false; if (source.terastallized) return false; @@ -15447,7 +15449,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { return false; } } - this.add('-start', source, 'typechange', '[from] move: Reflect Type', '[of] ' + target); + this.add('-start', source, 'typechange', '[from] move: Reflect Type', `[of] ${target}`); source.setType(newBaseTypes); source.addedType = target.addedType; source.knownType = target.isAlly(source) && target.knownType; @@ -15456,7 +15458,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, refresh: { @@ -15468,7 +15470,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Refresh", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onHit(pokemon) { if (['', 'slp', 'frz'].includes(pokemon.status)) return false; pokemon.cureStatus(); @@ -15476,7 +15478,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Cute", }, relicsong: { @@ -15487,7 +15489,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Relic Song", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1 }, secondary: { chance: 10, status: 'slp', @@ -15515,7 +15517,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rest", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onTry(source) { if (source.status === 'slp' || source.hasAbility('comatose')) return false; @@ -15525,11 +15527,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } // insomnia and vital spirit checks are separate so that the message is accurate in multi-ability mods if (source.hasAbility('insomnia')) { - this.add('-fail', source, '[from] ability: Insomnia', '[of] ' + source); + this.add('-fail', source, '[from] ability: Insomnia', `[of] ${source}`); return null; } if (source.hasAbility('vitalspirit')) { - this.add('-fail', source, '[from] ability: Vital Spirit', '[of] ' + source); + this.add('-fail', source, '[from] ability: Vital Spirit', `[of] ${source}`); return null; } }, @@ -15543,7 +15545,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Psychic", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, retaliate: { @@ -15554,7 +15556,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Retaliate", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, pokemon) { if (pokemon.side.faintedLastTurn) { this.debug('Boosted for a faint last turn'); @@ -15578,12 +15580,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Return", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cute", }, revelationdance: { @@ -15594,7 +15596,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Revelation Dance", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, dance: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, dance: 1, metronome: 1 }, onModifyType(move, pokemon) { const types = pokemon.getTypes(); let type = types[0]; @@ -15616,7 +15618,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { p => p.source === target && p.damage > 0 && p.thisTurn ); if (damagedByTarget) { - this.debug('BP doubled for getting hit by ' + target); + this.debug(`BP doubled for getting hit by ${target}`); return move.basePower * 2; } return move.basePower; @@ -15626,7 +15628,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Revenge", pp: 10, priority: -4, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fighting", @@ -15652,18 +15654,18 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } else { bp = 20; } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Reversal", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fighting", - zMove: {basePower: 160}, + zMove: { basePower: 160 }, contestType: "Cool", }, revivalblessing: { @@ -15675,7 +15677,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { pp: 1, noPPBoosts: true, priority: 0, - flags: {heal: 1, nosketch: 1}, + flags: { heal: 1, nosketch: 1 }, onTryHit(source) { if (!source.side.pokemon.filter(ally => ally.fainted).length) { return false; @@ -15709,11 +15711,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rising Voltage", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Electric", - maxMove: {basePower: 140}, + maxMove: { basePower: 140 }, }, roar: { num: 46, @@ -15723,12 +15725,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Roar", pp: 20, priority: -6, - flags: {reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, allyanim: 1, metronome: 1, noassist: 1, failcopycat: 1}, + flags: { reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, allyanim: 1, metronome: 1, noassist: 1, failcopycat: 1 }, forceSwitch: true, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cool", }, roaroftime: { @@ -15739,7 +15741,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Roar of Time", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, metronome: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -15756,13 +15758,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Blast", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Rock", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, contestType: "Tough", }, rockclimb: { @@ -15774,7 +15776,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Climb", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, volatileStatus: 'confusion', @@ -15791,14 +15793,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Polish", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spe: 2, }, secondary: null, target: "self", type: "Rock", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Tough", }, rockslide: { @@ -15809,7 +15811,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Slide", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -15826,7 +15828,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Smash", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 50, boosts: { @@ -15845,7 +15847,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Throw", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Rock", @@ -15859,7 +15861,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Tomb", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -15878,7 +15880,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rock Wrecker", pp: 5, priority: 0, - flags: {recharge: 1, protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { recharge: 1, protect: 1, mirror: 1, metronome: 1, bullet: 1 }, self: { volatileStatus: 'mustrecharge', }, @@ -15895,7 +15897,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Role Play", pp: 10, priority: 0, - flags: {bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { bypasssub: 1, allyanim: 1, metronome: 1 }, onTryHit(target, source) { if (target.ability === source.ability) return false; if (target.getAbility().flags['failroleplay'] || source.getAbility().flags['cantsuppress']) return false; @@ -15903,7 +15905,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onHit(target, source) { const oldAbility = source.setAbility(target.ability); if (oldAbility) { - this.add('-ability', source, source.getAbility().name, '[from] move: Role Play', '[of] ' + target); + this.add('-ability', source, source.getAbility().name, '[from] move: Role Play', `[of] ${target}`); return; } return oldAbility as false | null; @@ -15911,7 +15913,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Cute", }, rollingkick: { @@ -15923,7 +15925,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rolling Kick", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -15940,7 +15942,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { let bp = move.basePower; const rolloutData = pokemon.volatiles['rollout']; if (rolloutData?.hitCount) { - bp *= Math.pow(2, rolloutData.contactHitCount); + bp *= 2 ** rolloutData.contactHitCount; } if (rolloutData && pokemon.status !== 'slp') { rolloutData.hitCount++; @@ -15952,14 +15954,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (pokemon.volatiles['defensecurl']) { bp *= 2; } - this.debug("BP: " + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", name: "Rollout", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1, noparentalbond: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1, noparentalbond: 1 }, onModifyMove(move, pokemon, target) { if (pokemon.volatiles['rollout'] || pokemon.status === 'slp' || !target) return; pokemon.addVolatile('rollout'); @@ -16006,7 +16008,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Roost", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, heal: [1, 2], self: { volatileStatus: 'roost', @@ -16032,7 +16034,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Flying", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, rototiller: { @@ -16044,7 +16046,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Rototiller", pp: 10, priority: 0, - flags: {distance: 1, nonsky: 1, metronome: 1}, + flags: { distance: 1, nonsky: 1, metronome: 1 }, onHitField(target, source) { const targets: Pokemon[] = []; let anyAirborne = false; @@ -16061,13 +16063,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } if (!targets.length && !anyAirborne) return false; // Fails when there are no grounded Grass types or airborne Pokemon for (const pokemon of targets) { - this.boost({atk: 1, spa: 1}, pokemon, source); + this.boost({ atk: 1, spa: 1 }, pokemon, source); } }, secondary: null, target: "all", type: "Ground", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Tough", }, round: { @@ -16085,7 +16087,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Round", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, onTry(source, target, move) { for (const action of this.queue.list as MoveAction[]) { if (!action.pokemon || !action.move || action.maxMove || action.zmove) continue; @@ -16111,7 +16113,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Ruination", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Dark", @@ -16125,7 +16127,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sacred Fire", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, metronome: 1 }, secondary: { chance: 50, status: 'brn', @@ -16142,7 +16144,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sacred Sword", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, ignoreEvasion: true, ignoreDefensive: true, secondary: null, @@ -16158,7 +16160,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Safeguard", pp: 25, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, sideCondition: 'safeguard', condition: { duration: 5, @@ -16205,7 +16207,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Beautiful", }, saltcure: { @@ -16216,7 +16218,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Salt Cure", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, condition: { noCopy: true, onStart(pokemon) { @@ -16245,14 +16247,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sand Attack", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { accuracy: -1, }, secondary: null, target: "normal", type: "Ground", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Cute", }, sandsearstorm: { @@ -16263,7 +16265,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sandsear Storm", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, onModifyMove(move, pokemon, target) { if (target && ['raindance', 'primordialsea'].includes(target.effectiveWeather())) { move.accuracy = true; @@ -16284,12 +16286,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sandstorm", pp: 10, priority: 0, - flags: {metronome: 1, wind: 1}, + flags: { metronome: 1, wind: 1 }, weather: 'Sandstorm', secondary: null, target: "all", type: "Rock", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Tough", }, sandtomb: { @@ -16300,7 +16302,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sand Tomb", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -16316,7 +16318,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sappy Seed", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1 }, onHit(target, source) { if (target.hasType('Grass')) return null; target.addVolatile('leechseed', source); @@ -16350,7 +16352,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Scald", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, metronome: 1 }, thawsTarget: true, secondary: { chance: 30, @@ -16368,7 +16370,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Scale Shot", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], selfBoost: { boosts: { @@ -16379,8 +16381,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dragon", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, }, scaryface: { num: 184, @@ -16390,14 +16392,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Scary Face", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, boosts: { spe: -2, }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Tough", }, scorchingsands: { @@ -16408,7 +16410,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Scorching Sands", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, defrost: 1, metronome: 1 }, thawsTarget: true, secondary: { chance: 30, @@ -16425,7 +16427,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Scratch", pp: 35, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -16439,14 +16441,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Screech", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, boosts: { def: -2, }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Clever", }, searingshot: { @@ -16458,7 +16460,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Searing Shot", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 30, status: 'brn', @@ -16476,7 +16478,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Searing Sunraze Smash", pp: 1, priority: 0, - flags: {contact: 1}, + flags: { contact: 1 }, isZ: "solganiumz", ignoreAbility: true, secondary: null, @@ -16493,7 +16495,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Secret Power", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onModifyMove(move, pokemon) { if (this.field.isTerrain('')) return; move.secondaries = []; @@ -16540,7 +16542,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Secret Sword", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, slicing: 1}, + flags: { protect: 1, mirror: 1, slicing: 1 }, secondary: null, target: "normal", type: "Fighting", @@ -16554,7 +16556,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Seed Bomb", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: null, target: "normal", type: "Grass", @@ -16568,7 +16570,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Seed Flare", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 40, boosts: { @@ -16588,11 +16590,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Seismic Toss", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fighting", - maxMove: {basePower: 75}, + maxMove: { basePower: 75 }, contestType: "Tough", }, selfdestruct: { @@ -16603,7 +16605,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Self-Destruct", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, noparentalbond: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, noparentalbond: 1 }, selfdestruct: "always", secondary: null, target: "allAdjacent", @@ -16618,7 +16620,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shadow Ball", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 20, boosts: { @@ -16638,7 +16640,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shadow Bone", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, boosts: { @@ -16657,7 +16659,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shadow Claw", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -16672,7 +16674,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shadow Force", pp: 5, priority: 0, - flags: {contact: 1, charge: 1, mirror: 1, metronome: 1, nosleeptalk: 1, noassist: 1, failinstruct: 1}, + flags: { contact: 1, charge: 1, mirror: 1, metronome: 1, nosleeptalk: 1, noassist: 1, failinstruct: 1 }, breaksProtect: true, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { @@ -16702,7 +16704,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shadow Punch", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ghost", @@ -16716,7 +16718,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shadow Sneak", pp: 30, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ghost", @@ -16731,14 +16733,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sharpen", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { atk: 1, }, secondary: null, target: "self", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Cute", }, shatteredpsyche: { @@ -16793,7 +16795,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, }, sheercold: { num: 329, @@ -16803,13 +16805,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sheer Cold", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, ohko: 'Ice', target: "normal", type: "Ice", - zMove: {basePower: 180}, - maxMove: {basePower: 130}, + zMove: { basePower: 180 }, + maxMove: { basePower: 130 }, contestType: "Beautiful", }, shellsidearm: { @@ -16820,7 +16822,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shell Side Arm", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onPrepareHit(target, source, move) { if (!source.isAlly(target)) { this.attrLastMove('[anim] Shell Side Arm ' + move.category); @@ -16861,7 +16863,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shell Smash", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: -1, spd: -1, @@ -16872,7 +16874,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Tough", }, shelltrap: { @@ -16884,7 +16886,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shell Trap", pp: 5, priority: -3, - flags: {protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1}, + flags: { protect: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1 }, priorityChargeCallback(pokemon) { pokemon.addVolatile('shelltrap'); }, @@ -16923,7 +16925,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shelter", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 2, }, @@ -16939,7 +16941,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shift Gear", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spe: 2, atk: 1, @@ -16947,7 +16949,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Steel", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, shockwave: { @@ -16958,7 +16960,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shock Wave", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Electric", @@ -16972,7 +16974,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shore Up", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onHit(pokemon) { let factor = 0.5; if (this.field.isWeather('sandstorm')) { @@ -16988,7 +16990,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Ground", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, signalbeam: { @@ -17000,7 +17002,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Signal Beam", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, volatileStatus: 'confusion', @@ -17050,13 +17052,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } } if (this.checkMoveMakesContact(move, source, target)) { - this.boost({spe: -1}, source, target, this.dex.getActiveMove("Silk Trap")); + this.boost({ spe: -1 }, source, target, this.dex.getActiveMove("Silk Trap")); } return this.NOT_FAIL; }, onHit(target, source, move) { if (move.isZOrMaxPowered && this.checkMoveMakesContact(move, source, target)) { - this.boost({spe: -1}, source, target, this.dex.getActiveMove("Silk Trap")); + this.boost({ spe: -1 }, source, target, this.dex.getActiveMove("Silk Trap")); } }, }, @@ -17072,7 +17074,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Silver Wind", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, self: { @@ -17097,7 +17099,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Simple Beam", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onTryHit(target) { if (target.getAbility().flags['cantsuppress'] || target.ability === 'simple' || target.ability === 'truant') { return false; @@ -17114,7 +17116,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Cute", }, sing: { @@ -17125,12 +17127,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sing", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, status: 'slp', secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Cute", }, sinisterarrowraid: { @@ -17158,7 +17160,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sizzly Slide", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, defrost: 1}, + flags: { contact: 1, protect: 1, mirror: 1, defrost: 1 }, secondary: { chance: 100, status: 'brn', @@ -17202,7 +17204,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Clever", }, skillswap: { @@ -17213,7 +17215,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Skill Swap", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, onTryHit(target, source) { const targetAbility = target.getAbility(); const sourceAbility = source.getAbility(); @@ -17229,16 +17231,16 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const targetAbility = target.getAbility(); const sourceAbility = source.getAbility(); if (target.isAlly(source)) { - this.add('-activate', source, 'move: Skill Swap', '', '', '[of] ' + target); + this.add('-activate', source, 'move: Skill Swap', '', '', `[of] ${target}`); } else { - this.add('-activate', source, 'move: Skill Swap', targetAbility, sourceAbility, '[of] ' + target); + this.add('-activate', source, 'move: Skill Swap', targetAbility, sourceAbility, `[of] ${target}`); } this.singleEvent('End', sourceAbility, source.abilityState, source); this.singleEvent('End', targetAbility, target.abilityState, target); source.ability = targetAbility.id; target.ability = sourceAbility.id; - source.abilityState = this.initEffectState({id: this.toID(source.ability), target: source}); - target.abilityState = this.initEffectState({id: this.toID(target.ability), target: target}); + source.abilityState = this.initEffectState({ id: this.toID(source.ability), target: source }); + target.abilityState = this.initEffectState({ id: this.toID(target.ability), target }); source.volatileStaleness = undefined; if (!target.isAlly(source)) target.volatileStaleness = 'external'; this.singleEvent('Start', targetAbility, source.abilityState, source); @@ -17247,7 +17249,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, skittersmack: { @@ -17258,7 +17260,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Skitter Smack", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -17277,13 +17279,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Skull Bash", pp: 10, priority: 0, - flags: {contact: 1, charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { contact: 1, charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; } this.add('-prepare', attacker, move.name); - this.boost({def: 1}, attacker, attacker, move); + this.boost({ def: 1 }, attacker, attacker, move); if (!this.runEvent('ChargeMove', attacker, defender, move)) { return; } @@ -17303,7 +17305,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sky Attack", pp: 5, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, distance: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { charge: 1, protect: 1, mirror: 1, distance: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1 }, critRatio: 2, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { @@ -17448,7 +17450,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sky Uppercut", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fighting", @@ -17462,12 +17464,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Slack Off", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, heal: [1, 2], secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, slam: { @@ -17478,7 +17480,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Slam", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -17492,7 +17494,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Slash", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -17507,12 +17509,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sleep Powder", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1 }, status: 'slp', secondary: null, target: "normal", type: "Grass", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, sleeptalk: { @@ -17523,7 +17525,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sleep Talk", pp: 10, priority: 0, - flags: {failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { failencore: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, sleepUsable: true, onTry(source) { return source.status === 'slp' || source.hasAbility('comatose'); @@ -17550,7 +17552,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'crit2'}, + zMove: { effect: 'crit2' }, contestType: "Cute", }, sludge: { @@ -17561,7 +17563,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sludge", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'psn', @@ -17578,7 +17580,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sludge Bomb", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 30, status: 'psn', @@ -17595,7 +17597,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sludge Wave", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'psn', @@ -17612,7 +17614,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Smack Down", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, volatileStatus: 'smackdown', condition: { noCopy: true, @@ -17659,7 +17661,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Smart Strike", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Steel", @@ -17681,7 +17683,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Smelling Salts", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onHit(target) { if (target.status === 'par') target.cureStatus(); }, @@ -17698,7 +17700,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Smog", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 40, status: 'psn', @@ -17715,14 +17717,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Smokescreen", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { accuracy: -1, }, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {evasion: 1}}, + zMove: { boost: { evasion: 1 } }, contestType: "Clever", }, snaptrap: { @@ -17734,7 +17736,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Snap Trap", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -17748,7 +17750,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Snarl", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1 }, secondary: { chance: 100, boosts: { @@ -17768,7 +17770,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Snatch", pp: 10, priority: 4, - flags: {bypasssub: 1, mustpressure: 1, noassist: 1, failcopycat: 1}, + flags: { bypasssub: 1, mustpressure: 1, noassist: 1, failcopycat: 1 }, volatileStatus: 'snatch', condition: { duration: 1, @@ -17783,7 +17785,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { return; } snatchUser.removeVolatile('snatch'); - this.add('-activate', snatchUser, 'move: Snatch', '[of] ' + source); + this.add('-activate', snatchUser, 'move: Snatch', `[of] ${source}`); this.actions.useMove(move.id, snatchUser); return null; }, @@ -17791,7 +17793,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Dark", - zMove: {boost: {spe: 2}}, + zMove: { boost: { spe: 2 } }, contestType: "Clever", }, snipeshot: { @@ -17802,7 +17804,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Snipe Shot", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, tracksTarget: true, secondary: null, @@ -17817,7 +17819,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Snore", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1 }, sleepUsable: true, onTry(source) { return source.status === 'slp' || source.hasAbility('comatose'); @@ -17852,7 +17854,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Soak", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onHit(target) { if (target.getTypes().join() === 'Water' || !target.setType('Water')) { // Soak should animate even when it fails. @@ -17865,7 +17867,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Water", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Cute", }, softboiled: { @@ -17876,12 +17878,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Soft-Boiled", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, heal: [1, 2], secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, solarbeam: { @@ -17892,7 +17894,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Solar Beam", pp: 10, priority: 0, - flags: {charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; @@ -17929,7 +17931,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Solar Blade", pp: 10, priority: 0, - flags: {contact: 1, charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1, slicing: 1}, + flags: { contact: 1, charge: 1, protect: 1, mirror: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1, slicing: 1 }, onTryMove(attacker, defender, move) { if (attacker.removeVolatile(move.id)) { return; @@ -17968,7 +17970,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sonic Boom", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -17983,7 +17985,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Soul-Stealing 7-Star Strike", pp: 1, priority: 0, - flags: {contact: 1}, + flags: { contact: 1 }, isZ: "marshadiumz", secondary: null, target: "normal", @@ -17998,7 +18000,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spacial Rend", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -18013,7 +18015,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spark", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, status: 'par', @@ -18030,7 +18032,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sparkling Aria", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: { dustproof: true, chance: 100, @@ -18056,7 +18058,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sparkly Swirl", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, self: { onHit(pokemon, source, move) { this.add('-activate', source, 'move: Aromatherapy'); @@ -18082,7 +18084,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spectral Thief", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, bypasssub: 1}, + flags: { contact: 1, protect: 1, mirror: 1, bypasssub: 1 }, stealsBoosts: true, // Boost stealing implemented in scripts.js secondary: null, @@ -18098,17 +18100,17 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Speed Swap", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1 }, onHit(target, source) { const targetSpe = target.storedStats.spe; target.storedStats.spe = source.storedStats.spe; source.storedStats.spe = targetSpe; - this.add('-activate', source, 'move: Speed Swap', '[of] ' + target); + this.add('-activate', source, 'move: Speed Swap', `[of] ${target}`); }, secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, spicyextract: { @@ -18119,7 +18121,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spicy Extract", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1 }, boosts: { atk: 2, def: -2, @@ -18137,14 +18139,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spider Web", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, onHit(target, source, move) { return target.addVolatile('trapped', source, move, 'trapper'); }, secondary: null, target: "normal", type: "Bug", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, spikecannon: { @@ -18156,12 +18158,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spike Cannon", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Normal", - maxMove: {basePower: 120}, + maxMove: { basePower: 120 }, contestType: "Cool", }, spikes: { @@ -18172,7 +18174,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spikes", pp: 20, priority: 0, - flags: {reflectable: 1, nonsky: 1, metronome: 1, mustpressure: 1}, + flags: { reflectable: 1, nonsky: 1, metronome: 1, mustpressure: 1 }, sideCondition: 'spikes', condition: { // this is a side condition @@ -18194,7 +18196,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "foeSide", type: "Ground", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, spikyshield: { @@ -18205,7 +18207,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spiky Shield", pp: 10, priority: 4, - flags: {noassist: 1, failcopycat: 1}, + flags: { noassist: 1, failcopycat: 1 }, stallingMove: true, volatileStatus: 'spikyshield', onPrepareHit(pokemon) { @@ -18252,7 +18254,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Grass", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Tough", }, spinout: { @@ -18263,7 +18265,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spin Out", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, self: { boosts: { spe: -2, @@ -18281,7 +18283,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spirit Break", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: { chance: 100, boosts: { @@ -18299,7 +18301,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spirit Shackle", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, onHit(target, source, move) { @@ -18322,7 +18324,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spit Up", pp: 10, priority: 0, - flags: {protect: 1, metronome: 1}, + flags: { protect: 1, metronome: 1 }, onTry(source) { return !!source.volatiles['stockpile']; }, @@ -18342,7 +18344,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spite", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, onHit(target) { let move: Move | ActiveMove | null = target.lastMove; if (!move || move.isZ) return false; @@ -18355,7 +18357,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Ghost", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Tough", }, splash: { @@ -18366,7 +18368,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Splash", pp: 40, priority: 0, - flags: {gravity: 1, metronome: 1}, + flags: { gravity: 1, metronome: 1 }, onTry(source, target, move) { // Additional Gravity check for Z-move variant if (this.field.getPseudoWeather('Gravity')) { @@ -18380,7 +18382,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {atk: 3}}, + zMove: { boost: { atk: 3 } }, contestType: "Cute", }, splinteredstormshards: { @@ -18414,7 +18416,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Splishy Splash", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 30, status: 'par', @@ -18431,12 +18433,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spore", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1 }, status: 'slp', secondary: null, target: "normal", type: "Grass", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, spotlight: { @@ -18448,7 +18450,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Spotlight", pp: 15, priority: 3, - flags: {protect: 1, reflectable: 1, allyanim: 1, noassist: 1, failcopycat: 1}, + flags: { protect: 1, reflectable: 1, allyanim: 1, noassist: 1, failcopycat: 1 }, volatileStatus: 'spotlight', onTryHit(target) { if (this.activePerHalf === 1) return false; @@ -18470,7 +18472,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Cute", }, springtidestorm: { @@ -18481,7 +18483,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Springtide Storm", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, wind: 1}, + flags: { protect: 1, mirror: 1, wind: 1 }, secondary: { chance: 30, boosts: { @@ -18499,7 +18501,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stealth Rock", pp: 20, priority: 0, - flags: {reflectable: 1, metronome: 1, mustpressure: 1}, + flags: { reflectable: 1, metronome: 1, mustpressure: 1 }, sideCondition: 'stealthrock', condition: { // this is a side condition @@ -18509,13 +18511,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onSwitchIn(pokemon) { if (pokemon.hasItem('heavydutyboots')) return; const typeMod = this.clampIntRange(pokemon.runEffectiveness(this.dex.getActiveMove('stealthrock')), -6, 6); - this.damage(pokemon.maxhp * Math.pow(2, typeMod) / 8); + this.damage(pokemon.maxhp * (2 ** typeMod) / 8); }, }, secondary: null, target: "foeSide", type: "Rock", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cool", }, steameruption: { @@ -18526,7 +18528,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Steam Eruption", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, defrost: 1}, + flags: { protect: 1, mirror: 1, defrost: 1 }, thawsTarget: true, secondary: { chance: 30, @@ -18545,7 +18547,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Steamroller", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -18562,7 +18564,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Steel Beam", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, mindBlownRecoil: true, onAfterMove(pokemon, target, move) { if (move.mindBlownRecoil && !move.multihit) { @@ -18585,7 +18587,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Steel Roller", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTry() { return !this.field.isTerrain(''); }, @@ -18607,7 +18609,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Steel Wing", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, self: { @@ -18628,7 +18630,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sticky Web", pp: 20, priority: 0, - flags: {reflectable: 1, metronome: 1}, + flags: { reflectable: 1, metronome: 1 }, sideCondition: 'stickyweb', condition: { onSideStart(side) { @@ -18637,13 +18639,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onSwitchIn(pokemon) { if (!pokemon.isGrounded() || pokemon.hasItem('heavydutyboots')) return; this.add('-activate', pokemon, 'move: Sticky Web'); - this.boost({spe: -1}, pokemon, pokemon.side.foe.active[0], this.dex.getActiveMove('stickyweb')); + this.boost({ spe: -1 }, pokemon, pokemon.side.foe.active[0], this.dex.getActiveMove('stickyweb')); }, }, secondary: null, target: "foeSide", type: "Bug", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Tough", }, stockpile: { @@ -18654,7 +18656,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stockpile", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onTry(source) { if (source.volatiles['stockpile'] && source.volatiles['stockpile'].layers >= 3) return false; }, @@ -18667,7 +18669,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { this.effectState.spd = 0; this.add('-start', target, 'stockpile' + this.effectState.layers); const [curDef, curSpD] = [target.boosts.def, target.boosts.spd]; - this.boost({def: 1, spd: 1}, target, target); + this.boost({ def: 1, spd: 1 }, target, target); if (curDef !== target.boosts.def) this.effectState.def--; if (curSpD !== target.boosts.spd) this.effectState.spd--; }, @@ -18677,7 +18679,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { this.add('-start', target, 'stockpile' + this.effectState.layers); const curDef = target.boosts.def; const curSpD = target.boosts.spd; - this.boost({def: 1, spd: 1}, target, target); + this.boost({ def: 1, spd: 1 }, target, target); if (curDef !== target.boosts.def) this.effectState.def--; if (curSpD !== target.boosts.spd) this.effectState.spd--; }, @@ -18697,7 +18699,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Tough", }, stokedsparksurfer: { @@ -18727,7 +18729,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stomp", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -18751,7 +18753,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stomping Tantrum", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Ground", @@ -18765,7 +18767,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stone Axe", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, onAfterHit(target, source, move) { if (!move.hasSheerForce && source.hp) { for (const side of source.side.foeSidesWithConditions()) { @@ -18792,7 +18794,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stone Edge", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondary: null, target: "normal", @@ -18805,19 +18807,19 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 20, basePowerCallback(pokemon, target, move) { const bp = move.basePower + 20 * pokemon.positiveBoosts(); - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", name: "Stored Power", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Psychic", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Clever", }, stormthrow: { @@ -18829,7 +18831,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Storm Throw", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, willCrit: true, secondary: null, target: "normal", @@ -18844,7 +18846,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Strange Steam", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 20, volatileStatus: 'confusion', @@ -18860,7 +18862,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Strength", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -18874,17 +18876,17 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Strength Sap", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, heal: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, heal: 1, metronome: 1 }, onHit(target, source) { if (target.boosts.atk === -6) return false; const atk = target.getStat('atk', false, true); - const success = this.boost({atk: -1}, target, source, null, false, true); + const success = this.boost({ atk: -1 }, target, source, null, false, true); return !!(this.heal(atk, source, target) || success); }, secondary: null, target: "normal", type: "Grass", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, stringshot: { @@ -18895,14 +18897,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "String Shot", pp: 40, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { spe: -2, }, secondary: null, target: "allAdjacentFoes", type: "Bug", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, struggle: { @@ -18936,7 +18938,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Struggle Bug", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -18955,7 +18957,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stuff Cheeks", pp: 10, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onDisableMove(pokemon) { if (!pokemon.getItem().isBerry) pokemon.disableMove('stuffcheeks'); }, @@ -18963,7 +18965,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { return source.getItem().isBerry; }, onHit(pokemon) { - if (!this.boost({def: 2})) return null; + if (!this.boost({ def: 2 })) return null; pokemon.eatItem(true); }, secondary: null, @@ -18978,12 +18980,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Stun Spore", pp: 30, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1, powder: 1 }, status: 'par', secondary: null, target: "normal", type: "Grass", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, submission: { @@ -18995,7 +18997,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Submission", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [1, 4], secondary: null, target: "normal", @@ -19010,7 +19012,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Substitute", pp: 10, priority: 0, - flags: {snatch: 1, nonsky: 1, metronome: 1}, + flags: { snatch: 1, nonsky: 1, metronome: 1 }, volatileStatus: 'substitute', onTryHit(source) { if (source.volatiles['substitute']) { @@ -19081,7 +19083,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, subzeroslammer: { @@ -19108,7 +19110,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sucker Punch", pp: 5, priority: 1, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTry(source, target) { const action = this.queue.willMove(target); const move = action?.choice === 'move' ? action.move : null; @@ -19129,12 +19131,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sunny Day", pp: 5, priority: 0, - flags: {metronome: 1}, + flags: { metronome: 1 }, weather: 'sunnyday', secondary: null, target: "all", type: "Fire", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Beautiful", }, sunsteelstrike: { @@ -19145,7 +19147,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sunsteel Strike", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, ignoreAbility: true, secondary: null, target: "normal", @@ -19160,7 +19162,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Supercell Slam", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, hasCrashDamage: true, onMoveFail(target, source, move) { this.damage(source.baseMaxhp / 2, source, source, this.dex.conditions.get('Supercell Slam')); @@ -19180,7 +19182,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Super Fang", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -19194,7 +19196,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Superpower", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, self: { boosts: { atk: -1, @@ -19214,12 +19216,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Supersonic", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'confusion', secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, supersonicskystrike: { @@ -19246,7 +19248,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Surf", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1 }, secondary: null, target: "allAdjacent", type: "Water", @@ -19260,14 +19262,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Surging Strikes", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1 }, willCrit: true, multihit: 3, secondary: null, target: "normal", type: "Water", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, }, swagger: { num: 207, @@ -19277,7 +19279,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Swagger", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, volatileStatus: 'confusion', boosts: { atk: 2, @@ -19285,7 +19287,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Cute", }, swallow: { @@ -19296,7 +19298,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Swallow", pp: 10, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onTry(source, target, move) { if (move.sourceEffect === 'snatch') return; return !!source.volatiles['stockpile']; @@ -19312,7 +19314,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Tough", }, sweetkiss: { @@ -19323,12 +19325,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sweet Kiss", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, volatileStatus: 'confusion', secondary: null, target: "normal", type: "Fairy", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Cute", }, sweetscent: { @@ -19339,14 +19341,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Sweet Scent", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { evasion: -2, }, secondary: null, target: "allAdjacentFoes", type: "Normal", - zMove: {boost: {accuracy: 1}}, + zMove: { boost: { accuracy: 1 } }, contestType: "Cute", }, swift: { @@ -19357,7 +19359,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Swift", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "allAdjacentFoes", type: "Normal", @@ -19371,7 +19373,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Switcheroo", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, allyanim: 1, noassist: 1, failcopycat: 1}, + flags: { protect: 1, mirror: 1, allyanim: 1, noassist: 1, failcopycat: 1 }, onTryImmunity(target) { return !target.hasAbility('stickyhold'); }, @@ -19391,7 +19393,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (myItem) source.item = myItem.id; return false; } - this.add('-activate', source, 'move: Trick', '[of] ' + target); + this.add('-activate', source, 'move: Trick', `[of] ${target}`); if (myItem) { target.setItem(myItem); this.add('-item', target, myItem, '[from] move: Switcheroo'); @@ -19408,7 +19410,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {boost: {spe: 2}}, + zMove: { boost: { spe: 2 } }, contestType: "Clever", }, swordsdance: { @@ -19419,14 +19421,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Swords Dance", pp: 20, priority: 0, - flags: {snatch: 1, dance: 1, metronome: 1}, + flags: { snatch: 1, dance: 1, metronome: 1 }, boosts: { atk: 2, }, secondary: null, target: "self", type: "Normal", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, synchronoise: { @@ -19438,7 +19440,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Synchronoise", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTryImmunity(target, source) { return target.hasType(source.getTypes()); }, @@ -19455,7 +19457,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Synthesis", pp: 5, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, onHit(pokemon) { let factor = 0.5; switch (pokemon.effectiveWeather()) { @@ -19481,7 +19483,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Grass", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Clever", }, syrupbomb: { @@ -19492,7 +19494,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Syrup Bomb", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, condition: { noCopy: true, duration: 4, @@ -19506,7 +19508,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onResidualOrder: 14, onResidual(pokemon) { - this.boost({spe: -1}, pokemon, this.effectState.source); + this.boost({ spe: -1 }, pokemon, this.effectState.source); }, onEnd(pokemon) { this.add('-end', pokemon, 'Syrup Bomb', '[silent]'); @@ -19527,13 +19529,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tachyon Cutter", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, slicing: 1 }, multihit: 2, secondary: null, target: "normal", type: "Steel", - zMove: {basePower: 180}, - maxMove: {basePower: 140}, + zMove: { basePower: 180 }, + maxMove: { basePower: 140 }, contestType: "Clever", }, tackle: { @@ -19544,7 +19546,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tackle", pp: 35, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -19558,14 +19560,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tail Glow", pp: 20, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { spa: 3, }, secondary: null, target: "self", type: "Bug", - zMove: {effect: 'clearnegativeboost'}, + zMove: { effect: 'clearnegativeboost' }, contestType: "Beautiful", }, tailslap: { @@ -19576,13 +19578,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tail Slap", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 140}, - maxMove: {basePower: 130}, + zMove: { basePower: 140 }, + maxMove: { basePower: 130 }, contestType: "Cute", }, tailwhip: { @@ -19593,14 +19595,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tail Whip", pp: 30, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, boosts: { def: -1, }, secondary: null, target: "allAdjacentFoes", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Cute", }, tailwind: { @@ -19611,7 +19613,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tailwind", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1, wind: 1}, + flags: { snatch: 1, metronome: 1, wind: 1 }, sideCondition: 'tailwind', condition: { duration: 4, @@ -19641,7 +19643,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Flying", - zMove: {effect: 'crit2'}, + zMove: { effect: 'crit2' }, contestType: "Cool", }, takedown: { @@ -19652,7 +19654,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Take Down", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [1, 4], secondary: null, target: "normal", @@ -19667,9 +19669,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Take Heart", pp: 15, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, onHit(pokemon) { - const success = !!this.boost({spa: 1, spd: 1}); + const success = !!this.boost({ spa: 1, spd: 1 }); return pokemon.cureStatus() || success; }, secondary: null, @@ -19684,7 +19686,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tar Shot", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, volatileStatus: 'tarshot', condition: { onStart(pokemon) { @@ -19714,7 +19716,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Taunt", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'taunt', condition: { duration: 3, @@ -19747,7 +19749,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Clever", }, tearfullook: { @@ -19758,7 +19760,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tearful Look", pp: 20, priority: 0, - flags: {reflectable: 1, mirror: 1, metronome: 1}, + flags: { reflectable: 1, mirror: 1, metronome: 1 }, boosts: { atk: -1, spa: -1, @@ -19766,7 +19768,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, teatime: { @@ -19777,7 +19779,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Teatime", pp: 10, priority: 0, - flags: {bypasssub: 1, metronome: 1}, + flags: { bypasssub: 1, metronome: 1 }, onHitField(target, source, move) { const targets: Pokemon[] = []; for (const pokemon of this.getAllActive()) { @@ -19810,7 +19812,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Techno Blast", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, onModifyType(move, pokemon) { if (pokemon.ignoringItem()) return; move.type = this.runEvent('Drive', pokemon, null, move, 'Normal'); @@ -19844,12 +19846,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Teeter Dance", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, dance: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, dance: 1, metronome: 1 }, volatileStatus: 'confusion', secondary: null, target: "allAdjacent", type: "Normal", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Cute", }, telekinesis: { @@ -19861,7 +19863,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Telekinesis", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, gravity: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, gravity: 1, allyanim: 1, metronome: 1 }, volatileStatus: 'telekinesis', onTry(source, target, move) { // Additional Gravity check for Z-move variant @@ -19875,7 +19877,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { duration: 3, onStart(target) { if (['Diglett', 'Dugtrio', 'Palossand', 'Sandygast'].includes(target.baseSpecies.baseSpecies) || - target.baseSpecies.name === 'Gengar-Mega') { + target.baseSpecies.name === 'Gengar-Mega') { this.add('-immune', target); return null; } @@ -19903,7 +19905,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spa: 1}}, + zMove: { boost: { spa: 1 } }, contestType: "Clever", }, teleport: { @@ -19914,7 +19916,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Teleport", pp: 20, priority: -6, - flags: {metronome: 1}, + flags: { metronome: 1 }, onTry(source) { return !!this.canSwitch(source.side); }, @@ -19922,7 +19924,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Psychic", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Cool", }, temperflare: { @@ -19940,7 +19942,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Temper Flare", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fire", @@ -19959,7 +19961,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tera Blast", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, mustpressure: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, mustpressure: 1 }, onPrepareHit(target, source, move) { if (source.terastallized) { this.attrLastMove('[anim] Tera Blast ' + source.teraType); @@ -19975,7 +19977,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { move.category = 'Physical'; } if (pokemon.terastallized === 'Stellar') { - move.self = {boosts: {atk: -1, spa: -1}}; + move.self = { boosts: { atk: -1, spa: -1 } }; } }, secondary: null, @@ -19990,7 +19992,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tera Starstorm", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, noassist: 1, failcopycat: 1, failmimic: 1, nosketch: 1}, + flags: { protect: 1, mirror: 1, noassist: 1, failcopycat: 1, failmimic: 1, nosketch: 1 }, onModifyType(move, pokemon) { if (pokemon.species.name === 'Terapagos-Stellar') { move.type = 'Stellar'; @@ -20016,7 +20018,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Terrain Pulse", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, pulse: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, pulse: 1 }, onModifyType(move, pokemon) { if (!pokemon.isGrounded()) return; switch (this.field.terrain) { @@ -20043,8 +20045,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, }, thief: { num: 168, @@ -20054,7 +20056,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thief", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, failmefirst: 1, noassist: 1, failcopycat: 1}, + flags: { contact: 1, protect: 1, mirror: 1, failmefirst: 1, noassist: 1, failcopycat: 1 }, onAfterHit(target, source, move) { if (source.item || source.volatiles['gem']) { return; @@ -20068,8 +20070,8 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { target.item = yourItem.id; // bypass setItem so we don't break choicelock or anything return; } - this.add('-enditem', target, yourItem, '[silent]', '[from] move: Thief', '[of] ' + source); - this.add('-item', source, yourItem, '[from] move: Thief', '[of] ' + target); + this.add('-enditem', target, yourItem, '[silent]', '[from] move: Thief', `[of] ${source}`); + this.add('-item', source, yourItem, '[from] move: Thief', `[of] ${target}`); }, secondary: null, target: "normal", @@ -20085,7 +20087,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thousand Arrows", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1 }, onEffectiveness(typeMod, target, type, move) { if (move.type !== 'Ground') return; if (!target) return; // avoid crashing when called from a chat plugin @@ -20095,11 +20097,11 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } }, volatileStatus: 'smackdown', - ignoreImmunity: {'Ground': true}, + ignoreImmunity: { 'Ground': true }, secondary: null, target: "allAdjacentFoes", type: "Ground", - zMove: {basePower: 180}, + zMove: { basePower: 180 }, contestType: "Beautiful", }, thousandwaves: { @@ -20111,7 +20113,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thousand Waves", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1 }, onHit(target, source, move) { if (source.isActive) target.addVolatile('trapped', source, move, 'trapper'); }, @@ -20128,7 +20130,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thrash", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, failinstruct: 1 }, self: { volatileStatus: 'lockedmove', }, @@ -20150,7 +20152,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Throat Chop", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, condition: { duration: 2, onStart(target) { @@ -20199,7 +20201,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunder", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onModifyMove(move, pokemon, target) { switch (target?.effectiveWeather()) { case 'raindance': @@ -20228,7 +20230,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunderbolt", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'par', @@ -20245,7 +20247,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunder Cage", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -20259,7 +20261,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunderclap", pp: 5, priority: 1, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onTry(source, target) { const action = this.queue.willMove(target); const move = action?.choice === 'move' ? action.move : null; @@ -20280,7 +20282,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunder Fang", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, bite: 1 }, secondaries: [ { chance: 10, @@ -20302,7 +20304,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunderous Kick", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: { chance: 100, boosts: { @@ -20320,7 +20322,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunder Punch", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1, metronome: 1 }, secondary: { chance: 10, status: 'par', @@ -20337,7 +20339,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunder Shock", pp: 30, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 10, status: 'par', @@ -20354,13 +20356,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Thunder Wave", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, status: 'par', ignoreImmunity: false, secondary: null, target: "normal", type: "Electric", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Cool", }, tickle: { @@ -20371,7 +20373,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tickle", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, boosts: { atk: -1, def: -1, @@ -20379,7 +20381,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, tidyup: { @@ -20407,7 +20409,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } } if (success) this.add('-activate', pokemon, 'move: Tidy Up'); - return !!this.boost({atk: 1, spe: 1}, pokemon, pokemon, null, false, true) || success; + return !!this.boost({ atk: 1, spe: 1 }, pokemon, pokemon, null, false, true) || success; }, secondary: null, target: "self", @@ -20421,7 +20423,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Topsy-Turvy", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onHit(target) { let success = false; let i: BoostID; @@ -20436,7 +20438,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Clever", }, torchsong: { @@ -20447,7 +20449,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Torch Song", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1 }, secondary: { chance: 100, self: { @@ -20468,7 +20470,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Torment", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, bypasssub: 1, metronome: 1 }, volatileStatus: 'torment', condition: { noCopy: true, @@ -20490,7 +20492,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Dark", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Tough", }, toxic: { @@ -20501,13 +20503,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Toxic", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, // No Guard-like effect for Poison-type users implemented in Scripts#tryMoveHit status: 'tox', secondary: null, target: "normal", type: "Poison", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, toxicspikes: { @@ -20518,7 +20520,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Toxic Spikes", pp: 20, priority: 0, - flags: {reflectable: 1, nonsky: 1, metronome: 1, mustpressure: 1}, + flags: { reflectable: 1, nonsky: 1, metronome: 1, mustpressure: 1 }, sideCondition: 'toxicspikes', condition: { // this is a side condition @@ -20534,10 +20536,10 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { onSwitchIn(pokemon) { if (!pokemon.isGrounded()) return; if (pokemon.hasType('Poison')) { - this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon); + this.add('-sideend', pokemon.side, 'move: Toxic Spikes', `[of] ${pokemon}`); pokemon.side.removeSideCondition('toxicspikes'); } else if (pokemon.hasType('Steel') || pokemon.hasItem('heavydutyboots')) { - return; + // do nothing } else if (this.effectState.layers >= 2) { pokemon.trySetStatus('tox', pokemon.side.foe.active[0]); } else { @@ -20548,7 +20550,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "foeSide", type: "Poison", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, toxicthread: { @@ -20559,7 +20561,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Toxic Thread", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, status: 'psn', boosts: { spe: -1, @@ -20567,7 +20569,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Poison", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Tough", }, trailblaze: { @@ -20578,7 +20580,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Trailblaze", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: { chance: 100, self: { @@ -20599,7 +20601,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Transform", pp: 10, priority: 0, - flags: {allyanim: 1, failencore: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1}, + flags: { allyanim: 1, failencore: 1, noassist: 1, failcopycat: 1, failmimic: 1, failinstruct: 1 }, onHit(target, pokemon) { if (!pokemon.transformInto(target)) { return false; @@ -20608,7 +20610,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {effect: 'heal'}, + zMove: { effect: 'heal' }, contestType: "Clever", }, triattack: { @@ -20619,7 +20621,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Tri Attack", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, onHit(target, source) { @@ -20645,7 +20647,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Trick", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, allyanim: 1, noassist: 1, failcopycat: 1}, + flags: { protect: 1, mirror: 1, allyanim: 1, noassist: 1, failcopycat: 1 }, onTryImmunity(target) { return !target.hasAbility('stickyhold'); }, @@ -20665,7 +20667,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (myItem) source.item = myItem.id; return false; } - this.add('-activate', source, 'move: Trick', '[of] ' + target); + this.add('-activate', source, 'move: Trick', `[of] ${target}`); if (myItem) { target.setItem(myItem); this.add('-item', target, myItem, '[from] move: Trick'); @@ -20682,7 +20684,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Psychic", - zMove: {boost: {spe: 2}}, + zMove: { boost: { spe: 2 } }, contestType: "Clever", }, trickortreat: { @@ -20694,7 +20696,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Trick-or-Treat", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onHit(target) { if (target.hasType('Ghost')) return false; if (!target.addType('Ghost')) return false; @@ -20711,7 +20713,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Ghost", - zMove: {boost: {atk: 1, def: 1, spa: 1, spd: 1, spe: 1}}, + zMove: { boost: { atk: 1, def: 1, spa: 1, spd: 1, spe: 1 } }, contestType: "Cute", }, trickroom: { @@ -20722,7 +20724,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Trick Room", pp: 5, priority: -7, - flags: {mirror: 1, metronome: 1}, + flags: { mirror: 1, metronome: 1 }, pseudoWeather: 'trickroom', condition: { duration: 5, @@ -20735,9 +20737,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onFieldStart(target, source) { if (source?.hasAbility('persistent')) { - this.add('-fieldstart', 'move: Trick Room', '[of] ' + source, '[persistent]'); + this.add('-fieldstart', 'move: Trick Room', `[of] ${source}`, '[persistent]'); } else { - this.add('-fieldstart', 'move: Trick Room', '[of] ' + source); + this.add('-fieldstart', 'move: Trick Room', `[of] ${source}`); } }, onFieldRestart(target, source) { @@ -20753,7 +20755,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Psychic", - zMove: {boost: {accuracy: 1}}, + zMove: { boost: { accuracy: 1 } }, contestType: "Clever", }, triplearrows: { @@ -20764,7 +20766,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Triple Arrows", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, critRatio: 2, secondaries: [ { @@ -20791,14 +20793,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Triple Axel", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 3, multiaccuracy: true, secondary: null, target: "normal", type: "Ice", - zMove: {basePower: 120}, - maxMove: {basePower: 140}, + zMove: { basePower: 120 }, + maxMove: { basePower: 140 }, }, tripledive: { num: 865, @@ -20808,7 +20810,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Triple Dive", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 3, secondary: null, target: "normal", @@ -20825,14 +20827,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Triple Kick", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, multihit: 3, multiaccuracy: true, secondary: null, target: "normal", type: "Fighting", - zMove: {basePower: 120}, - maxMove: {basePower: 80}, + zMove: { basePower: 120 }, + maxMove: { basePower: 80 }, contestType: "Cool", }, tropkick: { @@ -20843,7 +20845,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Trop Kick", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 100, boosts: { @@ -20884,7 +20886,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { } } - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", @@ -20893,12 +20895,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { pp: 5, noPPBoosts: true, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Cool", }, twinbeam: { @@ -20909,7 +20911,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Twin Beam", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, multihit: 2, secondary: null, target: "normal", @@ -20925,7 +20927,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Twineedle", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: 2, secondary: { chance: 20, @@ -20933,7 +20935,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, target: "normal", type: "Bug", - maxMove: {basePower: 100}, + maxMove: { basePower: 100 }, contestType: "Cool", }, twinkletackle: { @@ -20960,7 +20962,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Twister", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, secondary: { chance: 20, volatileStatus: 'flinch', @@ -20977,7 +20979,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "U-turn", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, selfSwitch: true, secondary: null, target: "normal", @@ -20992,7 +20994,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Upper Hand", pp: 15, priority: 3, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onTry(source, target) { const action = this.queue.willMove(target); const move = action?.choice === 'move' ? action.move : null; @@ -21015,7 +21017,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Uproar", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1}, + flags: { protect: 1, mirror: 1, sound: 1, bypasssub: 1, metronome: 1, nosleeptalk: 1, failinstruct: 1 }, self: { volatileStatus: 'uproar', }, @@ -21074,7 +21076,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Vacuum Wave", pp: 30, priority: 1, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fighting", @@ -21089,7 +21091,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "V-create", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, self: { boosts: { spe: -1, @@ -21100,7 +21102,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Fire", - zMove: {basePower: 220}, + zMove: { basePower: 220 }, contestType: "Cool", }, veeveevolley: { @@ -21109,7 +21111,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 0, basePowerCallback(pokemon) { const bp = Math.floor((pokemon.happiness * 10) / 25) || 1; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Physical", @@ -21117,7 +21119,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Veevee Volley", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: null, target: "normal", type: "Normal", @@ -21132,17 +21134,17 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Venom Drench", pp: 20, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, onHit(target, source, move) { if (target.status === 'psn' || target.status === 'tox') { - return !!this.boost({atk: -1, spa: -1, spe: -1}, target, source, move); + return !!this.boost({ atk: -1, spa: -1, spe: -1 }, target, source, move); } return false; }, secondary: null, target: "allAdjacentFoes", type: "Poison", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Clever", }, venoshock: { @@ -21153,7 +21155,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Venoshock", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, onBasePower(basePower, pokemon, target) { if (target.status === 'psn' || target.status === 'tox') { return this.chainModify(2); @@ -21172,7 +21174,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Victory Dance", pp: 10, priority: 0, - flags: {snatch: 1, dance: 1, metronome: 1}, + flags: { snatch: 1, dance: 1, metronome: 1 }, boosts: { atk: 1, def: 1, @@ -21190,7 +21192,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Vine Whip", pp: 25, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Grass", @@ -21204,7 +21206,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Vise Grip", pp: 30, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", @@ -21219,7 +21221,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Vital Throw", pp: 10, priority: -1, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Fighting", @@ -21233,7 +21235,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Volt Switch", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, selfSwitch: true, secondary: null, target: "normal", @@ -21248,7 +21250,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Volt Tackle", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [33, 100], secondary: { chance: 10, @@ -21274,7 +21276,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wake-Up Slap", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, onHit(target) { if (target.status === 'slp') target.cureStatus(); }, @@ -21291,7 +21293,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Waterfall", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, volatileStatus: 'flinch', @@ -21308,7 +21310,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Water Gun", pp: 25, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Water", @@ -21329,7 +21331,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Water Pledge", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, nonsky: 1, metronome: 1, pledgecombo: 1}, + flags: { protect: 1, mirror: 1, nonsky: 1, metronome: 1, pledgecombo: 1 }, onPrepareHit(target, source, move) { for (const action of this.queue) { if (action.choice !== 'move') continue; @@ -21357,7 +21359,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { if (move.sourceEffect === 'firepledge') { move.type = 'Water'; move.forceSTAB = true; - move.self = {sideCondition: 'waterpledge'}; + move.self = { sideCondition: 'waterpledge' }; } }, condition: { @@ -21394,7 +21396,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Water Pulse", pp: 20, priority: 0, - flags: {protect: 1, mirror: 1, distance: 1, metronome: 1, pulse: 1}, + flags: { protect: 1, mirror: 1, distance: 1, metronome: 1, pulse: 1 }, secondary: { chance: 20, volatileStatus: 'confusion', @@ -21418,7 +21420,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Water Shuriken", pp: 20, priority: 1, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, multihit: [2, 5], secondary: null, target: "normal", @@ -21434,12 +21436,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Water Sport", pp: 15, priority: 0, - flags: {nonsky: 1, metronome: 1}, + flags: { nonsky: 1, metronome: 1 }, pseudoWeather: 'watersport', condition: { duration: 5, onFieldStart(field, source) { - this.add('-fieldstart', 'move: Water Sport', '[of] ' + source); + this.add('-fieldstart', 'move: Water Sport', `[of] ${source}`); }, onBasePowerPriority: 1, onBasePower(basePower, attacker, defender, move) { @@ -21457,7 +21459,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Water", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Cute", }, waterspout: { @@ -21466,14 +21468,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { basePower: 150, basePowerCallback(pokemon, target, move) { const bp = move.basePower * pokemon.hp / pokemon.maxhp; - this.debug('BP: ' + bp); + this.debug(`BP: ${bp}`); return bp; }, category: "Special", name: "Water Spout", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "allAdjacentFoes", type: "Water", @@ -21487,7 +21489,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wave Crash", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [33, 100], secondary: null, target: "normal", @@ -21501,7 +21503,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Weather Ball", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, onModifyType(move, pokemon) { switch (pokemon.effectiveWeather()) { case 'sunnyday': @@ -21539,13 +21541,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { move.basePower *= 2; break; } - this.debug('BP: ' + move.basePower); + this.debug(`BP: ${move.basePower}`); }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 160}, - maxMove: {basePower: 130}, + zMove: { basePower: 160 }, + maxMove: { basePower: 130 }, contestType: "Beautiful", }, whirlpool: { @@ -21556,7 +21558,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Whirlpool", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -21571,12 +21573,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Whirlwind", pp: 20, priority: -6, - flags: {reflectable: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1, noassist: 1, failcopycat: 1, wind: 1}, + flags: { reflectable: 1, mirror: 1, bypasssub: 1, allyanim: 1, metronome: 1, noassist: 1, failcopycat: 1, wind: 1 }, forceSwitch: true, secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, wickedblow: { @@ -21587,7 +21589,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wicked Blow", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, punch: 1}, + flags: { contact: 1, protect: 1, mirror: 1, punch: 1 }, willCrit: true, secondary: null, target: "normal", @@ -21621,7 +21623,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wide Guard", pp: 10, priority: 3, - flags: {snatch: 1}, + flags: { snatch: 1 }, sideCondition: 'wideguard', onTry() { return !!this.queue.willAct(); @@ -21659,7 +21661,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "allySide", type: "Rock", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Tough", }, wildboltstorm: { @@ -21670,7 +21672,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wildbolt Storm", pp: 10, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, wind: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, wind: 1 }, onModifyMove(move, pokemon, target) { if (target && ['raindance', 'primordialsea'].includes(target.effectiveWeather())) { move.accuracy = true; @@ -21691,7 +21693,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wild Charge", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [1, 4], secondary: null, target: "normal", @@ -21706,12 +21708,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Will-O-Wisp", pp: 15, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, status: 'brn', secondary: null, target: "normal", type: "Fire", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Beautiful", }, wingattack: { @@ -21722,7 +21724,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wing Attack", pp: 35, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, distance: 1, metronome: 1 }, secondary: null, target: "any", type: "Flying", @@ -21736,7 +21738,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wish", pp: 10, priority: 0, - flags: {snatch: 1, heal: 1, metronome: 1}, + flags: { snatch: 1, heal: 1, metronome: 1 }, slotCondition: 'Wish', condition: { onStart(pokemon, source) { @@ -21763,7 +21765,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Cute", }, withdraw: { @@ -21774,14 +21776,14 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Withdraw", pp: 40, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { def: 1, }, secondary: null, target: "self", type: "Water", - zMove: {boost: {def: 1}}, + zMove: { boost: { def: 1 } }, contestType: "Cute", }, wonderroom: { @@ -21792,7 +21794,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wonder Room", pp: 10, priority: 0, - flags: {mirror: 1, metronome: 1}, + flags: { mirror: 1, metronome: 1 }, pseudoWeather: 'wonderroom', condition: { duration: 5, @@ -21813,9 +21815,9 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { }, onFieldStart(field, source) { if (source?.hasAbility('persistent')) { - this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source, '[persistent]'); + this.add('-fieldstart', 'move: Wonder Room', `[of] ${source}`, '[persistent]'); } else { - this.add('-fieldstart', 'move: Wonder Room', '[of] ' + source); + this.add('-fieldstart', 'move: Wonder Room', `[of] ${source}`); } }, onFieldRestart(target, source) { @@ -21831,7 +21833,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "all", type: "Psychic", - zMove: {boost: {spd: 1}}, + zMove: { boost: { spd: 1 } }, contestType: "Clever", }, woodhammer: { @@ -21842,7 +21844,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wood Hammer", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, recoil: [33, 100], secondary: null, target: "normal", @@ -21857,7 +21859,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Work Up", pp: 30, priority: 0, - flags: {snatch: 1, metronome: 1}, + flags: { snatch: 1, metronome: 1 }, boosts: { atk: 1, spa: 1, @@ -21865,7 +21867,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "self", type: "Normal", - zMove: {boost: {atk: 1}}, + zMove: { boost: { atk: 1 } }, contestType: "Tough", }, worryseed: { @@ -21876,7 +21878,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Worry Seed", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, allyanim: 1, metronome: 1 }, onTryImmunity(target) { // Truant and Insomnia have special treatment; they fail before // checking accuracy and will double Stomping Tantrum's BP @@ -21903,7 +21905,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Grass", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Clever", }, wrap: { @@ -21914,7 +21916,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wrap", pp: 20, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, volatileStatus: 'partiallytrapped', secondary: null, target: "normal", @@ -21929,7 +21931,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { const hp = target.hp; const maxHP = target.maxhp; const bp = Math.floor(Math.floor((120 * (100 * Math.floor(hp * 4096 / maxHP)) + 2048 - 1) / 4096) / 100) || 1; - this.debug('BP for ' + hp + '/' + maxHP + " HP: " + bp); + this.debug(`BP for ${hp}/${maxHP} HP: ${bp}`); return bp; }, category: "Special", @@ -21937,12 +21939,12 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Wring Out", pp: 5, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: null, target: "normal", type: "Normal", - zMove: {basePower: 190}, - maxMove: {basePower: 140}, + zMove: { basePower: 190 }, + maxMove: { basePower: 140 }, contestType: "Tough", }, xscissor: { @@ -21953,7 +21955,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "X-Scissor", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 }, secondary: null, target: "normal", type: "Bug", @@ -21967,7 +21969,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Yawn", pp: 10, priority: 0, - flags: {protect: 1, reflectable: 1, mirror: 1, metronome: 1}, + flags: { protect: 1, reflectable: 1, mirror: 1, metronome: 1 }, volatileStatus: 'yawn', onTryHit(target) { if (target.status || !target.runStatusImmunity('slp')) { @@ -21978,7 +21980,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { noCopy: true, // doesn't get copied by Baton Pass duration: 2, onStart(target, source) { - this.add('-start', target, 'move: Yawn', '[of] ' + source); + this.add('-start', target, 'move: Yawn', `[of] ${source}`); }, onResidualOrder: 23, onEnd(target) { @@ -21989,7 +21991,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { secondary: null, target: "normal", type: "Normal", - zMove: {boost: {spe: 1}}, + zMove: { boost: { spe: 1 } }, contestType: "Cute", }, zapcannon: { @@ -22000,7 +22002,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Zap Cannon", pp: 5, priority: 0, - flags: {protect: 1, mirror: 1, metronome: 1, bullet: 1}, + flags: { protect: 1, mirror: 1, metronome: 1, bullet: 1 }, secondary: { chance: 100, status: 'par', @@ -22017,7 +22019,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Zen Headbutt", pp: 15, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 20, volatileStatus: 'flinch', @@ -22034,7 +22036,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Zing Zap", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1, metronome: 1}, + flags: { contact: 1, protect: 1, mirror: 1, metronome: 1 }, secondary: { chance: 30, volatileStatus: 'flinch', @@ -22052,7 +22054,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Zippy Zap", pp: 10, priority: 2, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: { chance: 100, self: { @@ -22077,7 +22079,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Paleo Wave", pp: 15, priority: 0, - flags: {protect: 1, mirror: 1}, + flags: { protect: 1, mirror: 1 }, secondary: { chance: 20, boosts: { @@ -22097,7 +22099,7 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = { name: "Shadow Strike", pp: 10, priority: 0, - flags: {contact: 1, protect: 1, mirror: 1}, + flags: { contact: 1, protect: 1, mirror: 1 }, secondary: { chance: 50, boosts: { diff --git a/data/pokedex.ts b/data/pokedex.ts index 1e26d44a37..a079a2a918 100644 --- a/data/pokedex.ts +++ b/data/pokedex.ts @@ -3,9 +3,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 1, name: "Bulbasaur", types: ["Grass", "Poison"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 45, atk: 49, def: 49, spa: 65, spd: 65, spe: 45}, - abilities: {0: "Overgrow", H: "Chlorophyll"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 45, atk: 49, def: 49, spa: 65, spd: 65, spe: 45 }, + abilities: { 0: "Overgrow", H: "Chlorophyll" }, heightm: 0.7, weightkg: 6.9, color: "Green", @@ -16,9 +16,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 2, name: "Ivysaur", types: ["Grass", "Poison"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 62, def: 63, spa: 80, spd: 80, spe: 60}, - abilities: {0: "Overgrow", H: "Chlorophyll"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 62, def: 63, spa: 80, spd: 80, spe: 60 }, + abilities: { 0: "Overgrow", H: "Chlorophyll" }, heightm: 1, weightkg: 13, color: "Green", @@ -31,9 +31,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 3, name: "Venusaur", types: ["Grass", "Poison"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 82, def: 83, spa: 100, spd: 100, spe: 80}, - abilities: {0: "Overgrow", H: "Chlorophyll"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 82, def: 83, spa: 100, spd: 100, spe: 80 }, + abilities: { 0: "Overgrow", H: "Chlorophyll" }, heightm: 2, weightkg: 100, color: "Green", @@ -50,9 +50,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Venusaur", forme: "Mega", types: ["Grass", "Poison"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 100, def: 123, spa: 122, spd: 120, spe: 80}, - abilities: {0: "Thick Fat"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 100, def: 123, spa: 122, spd: 120, spe: 80 }, + abilities: { 0: "Thick Fat" }, heightm: 2.4, weightkg: 155.5, color: "Green", @@ -65,9 +65,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Venusaur", forme: "Gmax", types: ["Grass", "Poison"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 82, def: 83, spa: 100, spd: 100, spe: 80}, - abilities: {0: "Overgrow", H: "Chlorophyll"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 82, def: 83, spa: 100, spd: 100, spe: 80 }, + abilities: { 0: "Overgrow", H: "Chlorophyll" }, heightm: 24, weightkg: 0, color: "Green", @@ -78,9 +78,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 4, name: "Charmander", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 39, atk: 52, def: 43, spa: 60, spd: 50, spe: 65}, - abilities: {0: "Blaze", H: "Solar Power"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 39, atk: 52, def: 43, spa: 60, spd: 50, spe: 65 }, + abilities: { 0: "Blaze", H: "Solar Power" }, heightm: 0.6, weightkg: 8.5, color: "Red", @@ -91,9 +91,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 5, name: "Charmeleon", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 58, atk: 64, def: 58, spa: 80, spd: 65, spe: 80}, - abilities: {0: "Blaze", H: "Solar Power"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 58, atk: 64, def: 58, spa: 80, spd: 65, spe: 80 }, + abilities: { 0: "Blaze", H: "Solar Power" }, heightm: 1.1, weightkg: 19, color: "Red", @@ -106,9 +106,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 6, name: "Charizard", types: ["Fire", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 78, atk: 84, def: 78, spa: 109, spd: 85, spe: 100}, - abilities: {0: "Blaze", H: "Solar Power"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 78, atk: 84, def: 78, spa: 109, spd: 85, spe: 100 }, + abilities: { 0: "Blaze", H: "Solar Power" }, heightm: 1.7, weightkg: 90.5, color: "Red", @@ -125,9 +125,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Charizard", forme: "Mega-X", types: ["Fire", "Dragon"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 78, atk: 130, def: 111, spa: 130, spd: 85, spe: 100}, - abilities: {0: "Tough Claws"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 78, atk: 130, def: 111, spa: 130, spd: 85, spe: 100 }, + abilities: { 0: "Tough Claws" }, heightm: 1.7, weightkg: 110.5, color: "Black", @@ -140,9 +140,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Charizard", forme: "Mega-Y", types: ["Fire", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 78, atk: 104, def: 78, spa: 159, spd: 115, spe: 100}, - abilities: {0: "Drought"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 78, atk: 104, def: 78, spa: 159, spd: 115, spe: 100 }, + abilities: { 0: "Drought" }, heightm: 1.7, weightkg: 100.5, color: "Red", @@ -155,9 +155,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Charizard", forme: "Gmax", types: ["Fire", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 78, atk: 84, def: 78, spa: 109, spd: 85, spe: 100}, - abilities: {0: "Blaze", H: "Solar Power"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 78, atk: 84, def: 78, spa: 109, spd: 85, spe: 100 }, + abilities: { 0: "Blaze", H: "Solar Power" }, heightm: 28, weightkg: 0, color: "Red", @@ -168,9 +168,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 7, name: "Squirtle", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 44, atk: 48, def: 65, spa: 50, spd: 64, spe: 43}, - abilities: {0: "Torrent", H: "Rain Dish"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 44, atk: 48, def: 65, spa: 50, spd: 64, spe: 43 }, + abilities: { 0: "Torrent", H: "Rain Dish" }, heightm: 0.5, weightkg: 9, color: "Blue", @@ -181,9 +181,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 8, name: "Wartortle", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 59, atk: 63, def: 80, spa: 65, spd: 80, spe: 58}, - abilities: {0: "Torrent", H: "Rain Dish"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 59, atk: 63, def: 80, spa: 65, spd: 80, spe: 58 }, + abilities: { 0: "Torrent", H: "Rain Dish" }, heightm: 1, weightkg: 22.5, color: "Blue", @@ -196,9 +196,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 9, name: "Blastoise", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 79, atk: 83, def: 100, spa: 85, spd: 105, spe: 78}, - abilities: {0: "Torrent", H: "Rain Dish"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 79, atk: 83, def: 100, spa: 85, spd: 105, spe: 78 }, + abilities: { 0: "Torrent", H: "Rain Dish" }, heightm: 1.6, weightkg: 85.5, color: "Blue", @@ -215,9 +215,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Blastoise", forme: "Mega", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 79, atk: 103, def: 120, spa: 135, spd: 115, spe: 78}, - abilities: {0: "Mega Launcher"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 79, atk: 103, def: 120, spa: 135, spd: 115, spe: 78 }, + abilities: { 0: "Mega Launcher" }, heightm: 1.6, weightkg: 101.1, color: "Blue", @@ -230,9 +230,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Blastoise", forme: "Gmax", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 79, atk: 83, def: 100, spa: 85, spd: 105, spe: 78}, - abilities: {0: "Torrent", H: "Rain Dish"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 79, atk: 83, def: 100, spa: 85, spd: 105, spe: 78 }, + abilities: { 0: "Torrent", H: "Rain Dish" }, heightm: 25, weightkg: 0, color: "Blue", @@ -243,8 +243,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 10, name: "Caterpie", types: ["Bug"], - baseStats: {hp: 45, atk: 30, def: 35, spa: 20, spd: 20, spe: 45}, - abilities: {0: "Shield Dust", H: "Run Away"}, + baseStats: { hp: 45, atk: 30, def: 35, spa: 20, spd: 20, spe: 45 }, + abilities: { 0: "Shield Dust", H: "Run Away" }, heightm: 0.3, weightkg: 2.9, color: "Green", @@ -255,8 +255,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 11, name: "Metapod", types: ["Bug"], - baseStats: {hp: 50, atk: 20, def: 55, spa: 25, spd: 25, spe: 30}, - abilities: {0: "Shed Skin"}, + baseStats: { hp: 50, atk: 20, def: 55, spa: 25, spd: 25, spe: 30 }, + abilities: { 0: "Shed Skin" }, heightm: 0.7, weightkg: 9.9, color: "Green", @@ -269,8 +269,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 12, name: "Butterfree", types: ["Bug", "Flying"], - baseStats: {hp: 60, atk: 45, def: 50, spa: 90, spd: 80, spe: 70}, - abilities: {0: "Compound Eyes", H: "Tinted Lens"}, + baseStats: { hp: 60, atk: 45, def: 50, spa: 90, spd: 80, spe: 70 }, + abilities: { 0: "Compound Eyes", H: "Tinted Lens" }, heightm: 1.1, weightkg: 32, color: "White", @@ -285,8 +285,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Butterfree", forme: "Gmax", types: ["Bug", "Flying"], - baseStats: {hp: 60, atk: 45, def: 50, spa: 90, spd: 80, spe: 70}, - abilities: {0: "Compound Eyes", H: "Tinted Lens"}, + baseStats: { hp: 60, atk: 45, def: 50, spa: 90, spd: 80, spe: 70 }, + abilities: { 0: "Compound Eyes", H: "Tinted Lens" }, heightm: 17, weightkg: 0, color: "White", @@ -297,8 +297,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 13, name: "Weedle", types: ["Bug", "Poison"], - baseStats: {hp: 40, atk: 35, def: 30, spa: 20, spd: 20, spe: 50}, - abilities: {0: "Shield Dust", H: "Run Away"}, + baseStats: { hp: 40, atk: 35, def: 30, spa: 20, spd: 20, spe: 50 }, + abilities: { 0: "Shield Dust", H: "Run Away" }, heightm: 0.3, weightkg: 3.2, color: "Brown", @@ -309,8 +309,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 14, name: "Kakuna", types: ["Bug", "Poison"], - baseStats: {hp: 45, atk: 25, def: 50, spa: 25, spd: 25, spe: 35}, - abilities: {0: "Shed Skin"}, + baseStats: { hp: 45, atk: 25, def: 50, spa: 25, spd: 25, spe: 35 }, + abilities: { 0: "Shed Skin" }, heightm: 0.6, weightkg: 10, color: "Yellow", @@ -323,8 +323,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 15, name: "Beedrill", types: ["Bug", "Poison"], - baseStats: {hp: 65, atk: 90, def: 40, spa: 45, spd: 80, spe: 75}, - abilities: {0: "Swarm", H: "Sniper"}, + baseStats: { hp: 65, atk: 90, def: 40, spa: 45, spd: 80, spe: 75 }, + abilities: { 0: "Swarm", H: "Sniper" }, heightm: 1, weightkg: 29.5, color: "Yellow", @@ -340,8 +340,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Beedrill", forme: "Mega", types: ["Bug", "Poison"], - baseStats: {hp: 65, atk: 150, def: 40, spa: 15, spd: 80, spe: 145}, - abilities: {0: "Adaptability"}, + baseStats: { hp: 65, atk: 150, def: 40, spa: 15, spd: 80, spe: 145 }, + abilities: { 0: "Adaptability" }, heightm: 1.4, weightkg: 40.5, color: "Yellow", @@ -352,8 +352,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 16, name: "Pidgey", types: ["Normal", "Flying"], - baseStats: {hp: 40, atk: 45, def: 40, spa: 35, spd: 35, spe: 56}, - abilities: {0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks"}, + baseStats: { hp: 40, atk: 45, def: 40, spa: 35, spd: 35, spe: 56 }, + abilities: { 0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks" }, heightm: 0.3, weightkg: 1.8, color: "Brown", @@ -364,8 +364,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 17, name: "Pidgeotto", types: ["Normal", "Flying"], - baseStats: {hp: 63, atk: 60, def: 55, spa: 50, spd: 50, spe: 71}, - abilities: {0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks"}, + baseStats: { hp: 63, atk: 60, def: 55, spa: 50, spd: 50, spe: 71 }, + abilities: { 0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks" }, heightm: 1.1, weightkg: 30, color: "Brown", @@ -378,8 +378,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 18, name: "Pidgeot", types: ["Normal", "Flying"], - baseStats: {hp: 83, atk: 80, def: 75, spa: 70, spd: 70, spe: 101}, - abilities: {0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks"}, + baseStats: { hp: 83, atk: 80, def: 75, spa: 70, spd: 70, spe: 101 }, + abilities: { 0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks" }, heightm: 1.5, weightkg: 39.5, color: "Brown", @@ -395,8 +395,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pidgeot", forme: "Mega", types: ["Normal", "Flying"], - baseStats: {hp: 83, atk: 80, def: 80, spa: 135, spd: 80, spe: 121}, - abilities: {0: "No Guard"}, + baseStats: { hp: 83, atk: 80, def: 80, spa: 135, spd: 80, spe: 121 }, + abilities: { 0: "No Guard" }, heightm: 2.2, weightkg: 50.5, color: "Brown", @@ -407,8 +407,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 19, name: "Rattata", types: ["Normal"], - baseStats: {hp: 30, atk: 56, def: 35, spa: 25, spd: 35, spe: 72}, - abilities: {0: "Run Away", 1: "Guts", H: "Hustle"}, + baseStats: { hp: 30, atk: 56, def: 35, spa: 25, spd: 35, spe: 72 }, + abilities: { 0: "Run Away", 1: "Guts", H: "Hustle" }, heightm: 0.3, weightkg: 3.5, color: "Purple", @@ -423,8 +423,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Rattata", forme: "Alola", types: ["Dark", "Normal"], - baseStats: {hp: 30, atk: 56, def: 35, spa: 25, spd: 35, spe: 72}, - abilities: {0: "Gluttony", 1: "Hustle", H: "Thick Fat"}, + baseStats: { hp: 30, atk: 56, def: 35, spa: 25, spd: 35, spe: 72 }, + abilities: { 0: "Gluttony", 1: "Hustle", H: "Thick Fat" }, heightm: 0.3, weightkg: 3.8, color: "Black", @@ -435,8 +435,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 20, name: "Raticate", types: ["Normal"], - baseStats: {hp: 55, atk: 81, def: 60, spa: 50, spd: 70, spe: 97}, - abilities: {0: "Run Away", 1: "Guts", H: "Hustle"}, + baseStats: { hp: 55, atk: 81, def: 60, spa: 50, spd: 70, spe: 97 }, + abilities: { 0: "Run Away", 1: "Guts", H: "Hustle" }, heightm: 0.7, weightkg: 18.5, color: "Brown", @@ -452,8 +452,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Raticate", forme: "Alola", types: ["Dark", "Normal"], - baseStats: {hp: 75, atk: 71, def: 70, spa: 40, spd: 80, spe: 77}, - abilities: {0: "Gluttony", 1: "Hustle", H: "Thick Fat"}, + baseStats: { hp: 75, atk: 71, def: 70, spa: 40, spd: 80, spe: 77 }, + abilities: { 0: "Gluttony", 1: "Hustle", H: "Thick Fat" }, heightm: 0.7, weightkg: 25.5, color: "Black", @@ -468,8 +468,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Raticate", forme: "Alola-Totem", types: ["Dark", "Normal"], - baseStats: {hp: 75, atk: 71, def: 70, spa: 40, spd: 80, spe: 77}, - abilities: {0: "Thick Fat"}, + baseStats: { hp: 75, atk: 71, def: 70, spa: 40, spd: 80, spe: 77 }, + abilities: { 0: "Thick Fat" }, heightm: 1.4, weightkg: 105, color: "Black", @@ -479,8 +479,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 21, name: "Spearow", types: ["Normal", "Flying"], - baseStats: {hp: 40, atk: 60, def: 30, spa: 31, spd: 31, spe: 70}, - abilities: {0: "Keen Eye", H: "Sniper"}, + baseStats: { hp: 40, atk: 60, def: 30, spa: 31, spd: 31, spe: 70 }, + abilities: { 0: "Keen Eye", H: "Sniper" }, heightm: 0.3, weightkg: 2, color: "Brown", @@ -491,8 +491,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 22, name: "Fearow", types: ["Normal", "Flying"], - baseStats: {hp: 65, atk: 90, def: 65, spa: 61, spd: 61, spe: 100}, - abilities: {0: "Keen Eye", H: "Sniper"}, + baseStats: { hp: 65, atk: 90, def: 65, spa: 61, spd: 61, spe: 100 }, + abilities: { 0: "Keen Eye", H: "Sniper" }, heightm: 1.2, weightkg: 38, color: "Brown", @@ -504,8 +504,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 23, name: "Ekans", types: ["Poison"], - baseStats: {hp: 35, atk: 60, def: 44, spa: 40, spd: 54, spe: 55}, - abilities: {0: "Intimidate", 1: "Shed Skin", H: "Unnerve"}, + baseStats: { hp: 35, atk: 60, def: 44, spa: 40, spd: 54, spe: 55 }, + abilities: { 0: "Intimidate", 1: "Shed Skin", H: "Unnerve" }, heightm: 2, weightkg: 6.9, color: "Purple", @@ -516,8 +516,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 24, name: "Arbok", types: ["Poison"], - baseStats: {hp: 60, atk: 95, def: 69, spa: 65, spd: 79, spe: 80}, - abilities: {0: "Intimidate", 1: "Shed Skin", H: "Unnerve"}, + baseStats: { hp: 60, atk: 95, def: 69, spa: 65, spd: 79, spe: 80 }, + abilities: { 0: "Intimidate", 1: "Shed Skin", H: "Unnerve" }, heightm: 3.5, weightkg: 65, color: "Purple", @@ -529,8 +529,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 25, name: "Pikachu", types: ["Electric"], - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -555,8 +555,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Cosplay", types: ["Electric"], gender: "F", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -570,8 +570,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Rock-Star", types: ["Electric"], gender: "F", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -586,8 +586,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Belle", types: ["Electric"], gender: "F", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -602,8 +602,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Pop-Star", types: ["Electric"], gender: "F", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -618,8 +618,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "PhD", types: ["Electric"], gender: "F", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -634,8 +634,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Libre", types: ["Electric"], gender: "F", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -650,8 +650,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Original", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -665,8 +665,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Hoenn", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -680,8 +680,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Sinnoh", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -695,8 +695,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Unova", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -710,8 +710,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Kalos", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -725,8 +725,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Alola", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -740,8 +740,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Partner", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -754,8 +754,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pikachu", forme: "Starter", types: ["Electric"], - baseStats: {hp: 45, atk: 80, def: 50, spa: 75, spd: 60, spe: 120}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 45, atk: 80, def: 50, spa: 75, spd: 60, spe: 120 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -767,8 +767,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pikachu", forme: "Gmax", types: ["Electric"], - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 21, weightkg: 0, color: "Yellow", @@ -782,8 +782,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "World", types: ["Electric"], gender: "M", - baseStats: {hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.4, weightkg: 6, color: "Yellow", @@ -794,8 +794,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 26, name: "Raichu", types: ["Electric"], - baseStats: {hp: 60, atk: 90, def: 55, spa: 90, spd: 80, spe: 110}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 60, atk: 90, def: 55, spa: 90, spd: 80, spe: 110 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.8, weightkg: 30, color: "Yellow", @@ -812,8 +812,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Raichu", forme: "Alola", types: ["Electric", "Psychic"], - baseStats: {hp: 60, atk: 85, def: 50, spa: 95, spd: 85, spe: 110}, - abilities: {0: "Surge Surfer"}, + baseStats: { hp: 60, atk: 85, def: 50, spa: 95, spd: 85, spe: 110 }, + abilities: { 0: "Surge Surfer" }, heightm: 0.7, weightkg: 21, color: "Brown", @@ -827,8 +827,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 27, name: "Sandshrew", types: ["Ground"], - baseStats: {hp: 50, atk: 75, def: 85, spa: 20, spd: 30, spe: 40}, - abilities: {0: "Sand Veil", H: "Sand Rush"}, + baseStats: { hp: 50, atk: 75, def: 85, spa: 20, spd: 30, spe: 40 }, + abilities: { 0: "Sand Veil", H: "Sand Rush" }, heightm: 0.6, weightkg: 12, color: "Yellow", @@ -843,8 +843,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sandshrew", forme: "Alola", types: ["Ice", "Steel"], - baseStats: {hp: 50, atk: 75, def: 90, spa: 10, spd: 35, spe: 40}, - abilities: {0: "Snow Cloak", H: "Slush Rush"}, + baseStats: { hp: 50, atk: 75, def: 90, spa: 10, spd: 35, spe: 40 }, + abilities: { 0: "Snow Cloak", H: "Slush Rush" }, heightm: 0.7, weightkg: 40, color: "White", @@ -855,8 +855,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 28, name: "Sandslash", types: ["Ground"], - baseStats: {hp: 75, atk: 100, def: 110, spa: 45, spd: 55, spe: 65}, - abilities: {0: "Sand Veil", H: "Sand Rush"}, + baseStats: { hp: 75, atk: 100, def: 110, spa: 45, spd: 55, spe: 65 }, + abilities: { 0: "Sand Veil", H: "Sand Rush" }, heightm: 1, weightkg: 29.5, color: "Yellow", @@ -872,8 +872,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sandslash", forme: "Alola", types: ["Ice", "Steel"], - baseStats: {hp: 75, atk: 100, def: 120, spa: 25, spd: 65, spe: 65}, - abilities: {0: "Snow Cloak", H: "Slush Rush"}, + baseStats: { hp: 75, atk: 100, def: 120, spa: 25, spd: 65, spe: 65 }, + abilities: { 0: "Snow Cloak", H: "Slush Rush" }, heightm: 1.2, weightkg: 55, color: "Blue", @@ -887,8 +887,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Nidoran-F", types: ["Poison"], gender: "F", - baseStats: {hp: 55, atk: 47, def: 52, spa: 40, spd: 40, spe: 41}, - abilities: {0: "Poison Point", 1: "Rivalry", H: "Hustle"}, + baseStats: { hp: 55, atk: 47, def: 52, spa: 40, spd: 40, spe: 41 }, + abilities: { 0: "Poison Point", 1: "Rivalry", H: "Hustle" }, heightm: 0.4, weightkg: 7, color: "Blue", @@ -900,8 +900,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Nidorina", types: ["Poison"], gender: "F", - baseStats: {hp: 70, atk: 62, def: 67, spa: 55, spd: 55, spe: 56}, - abilities: {0: "Poison Point", 1: "Rivalry", H: "Hustle"}, + baseStats: { hp: 70, atk: 62, def: 67, spa: 55, spd: 55, spe: 56 }, + abilities: { 0: "Poison Point", 1: "Rivalry", H: "Hustle" }, heightm: 0.8, weightkg: 20, color: "Blue", @@ -915,8 +915,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Nidoqueen", types: ["Poison", "Ground"], gender: "F", - baseStats: {hp: 90, atk: 92, def: 87, spa: 75, spd: 85, spe: 76}, - abilities: {0: "Poison Point", 1: "Rivalry", H: "Sheer Force"}, + baseStats: { hp: 90, atk: 92, def: 87, spa: 75, spd: 85, spe: 76 }, + abilities: { 0: "Poison Point", 1: "Rivalry", H: "Sheer Force" }, heightm: 1.3, weightkg: 60, color: "Blue", @@ -930,8 +930,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Nidoran-M", types: ["Poison"], gender: "M", - baseStats: {hp: 46, atk: 57, def: 40, spa: 40, spd: 40, spe: 50}, - abilities: {0: "Poison Point", 1: "Rivalry", H: "Hustle"}, + baseStats: { hp: 46, atk: 57, def: 40, spa: 40, spd: 40, spe: 50 }, + abilities: { 0: "Poison Point", 1: "Rivalry", H: "Hustle" }, heightm: 0.5, weightkg: 9, color: "Purple", @@ -944,8 +944,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Nidorino", types: ["Poison"], gender: "M", - baseStats: {hp: 61, atk: 72, def: 57, spa: 55, spd: 55, spe: 65}, - abilities: {0: "Poison Point", 1: "Rivalry", H: "Hustle"}, + baseStats: { hp: 61, atk: 72, def: 57, spa: 55, spd: 55, spe: 65 }, + abilities: { 0: "Poison Point", 1: "Rivalry", H: "Hustle" }, heightm: 0.9, weightkg: 19.5, color: "Purple", @@ -959,8 +959,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Nidoking", types: ["Poison", "Ground"], gender: "M", - baseStats: {hp: 81, atk: 102, def: 77, spa: 85, spd: 75, spe: 85}, - abilities: {0: "Poison Point", 1: "Rivalry", H: "Sheer Force"}, + baseStats: { hp: 81, atk: 102, def: 77, spa: 85, spd: 75, spe: 85 }, + abilities: { 0: "Poison Point", 1: "Rivalry", H: "Sheer Force" }, heightm: 1.4, weightkg: 62, color: "Purple", @@ -973,9 +973,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 35, name: "Clefairy", types: ["Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 70, atk: 45, def: 48, spa: 60, spd: 65, spe: 35}, - abilities: {0: "Cute Charm", 1: "Magic Guard", H: "Friend Guard"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 70, atk: 45, def: 48, spa: 60, spd: 65, spe: 35 }, + abilities: { 0: "Cute Charm", 1: "Magic Guard", H: "Friend Guard" }, heightm: 0.6, weightkg: 7.5, color: "Pink", @@ -988,9 +988,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 36, name: "Clefable", types: ["Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 95, atk: 70, def: 73, spa: 95, spd: 90, spe: 60}, - abilities: {0: "Cute Charm", 1: "Magic Guard", H: "Unaware"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 95, atk: 70, def: 73, spa: 95, spd: 90, spe: 60 }, + abilities: { 0: "Cute Charm", 1: "Magic Guard", H: "Unaware" }, heightm: 1.3, weightkg: 40, color: "Pink", @@ -1003,9 +1003,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 37, name: "Vulpix", types: ["Fire"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 38, atk: 41, def: 40, spa: 50, spd: 65, spe: 65}, - abilities: {0: "Flash Fire", H: "Drought"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 38, atk: 41, def: 40, spa: 50, spd: 65, spe: 65 }, + abilities: { 0: "Flash Fire", H: "Drought" }, heightm: 0.6, weightkg: 9.9, color: "Brown", @@ -1020,9 +1020,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Vulpix", forme: "Alola", types: ["Ice"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 38, atk: 41, def: 40, spa: 50, spd: 65, spe: 65}, - abilities: {0: "Snow Cloak", H: "Snow Warning"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 38, atk: 41, def: 40, spa: 50, spd: 65, spe: 65 }, + abilities: { 0: "Snow Cloak", H: "Snow Warning" }, heightm: 0.6, weightkg: 9.9, color: "White", @@ -1033,9 +1033,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 38, name: "Ninetales", types: ["Fire"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 73, atk: 76, def: 75, spa: 81, spd: 100, spe: 100}, - abilities: {0: "Flash Fire", H: "Drought"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 73, atk: 76, def: 75, spa: 81, spd: 100, spe: 100 }, + abilities: { 0: "Flash Fire", H: "Drought" }, heightm: 1.1, weightkg: 19.9, color: "Yellow", @@ -1052,9 +1052,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Ninetales", forme: "Alola", types: ["Ice", "Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 73, atk: 67, def: 75, spa: 81, spd: 100, spe: 109}, - abilities: {0: "Snow Cloak", H: "Snow Warning"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 73, atk: 67, def: 75, spa: 81, spd: 100, spe: 109 }, + abilities: { 0: "Snow Cloak", H: "Snow Warning" }, heightm: 1.1, weightkg: 19.9, color: "Blue", @@ -1067,9 +1067,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 39, name: "Jigglypuff", types: ["Normal", "Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 115, atk: 45, def: 20, spa: 45, spd: 25, spe: 20}, - abilities: {0: "Cute Charm", 1: "Competitive", H: "Friend Guard"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 115, atk: 45, def: 20, spa: 45, spd: 25, spe: 20 }, + abilities: { 0: "Cute Charm", 1: "Competitive", H: "Friend Guard" }, heightm: 0.5, weightkg: 5.5, color: "Pink", @@ -1082,9 +1082,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 40, name: "Wigglytuff", types: ["Normal", "Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 140, atk: 70, def: 45, spa: 85, spd: 50, spe: 45}, - abilities: {0: "Cute Charm", 1: "Competitive", H: "Frisk"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 140, atk: 70, def: 45, spa: 85, spd: 50, spe: 45 }, + abilities: { 0: "Cute Charm", 1: "Competitive", H: "Frisk" }, heightm: 1, weightkg: 12, color: "Pink", @@ -1097,8 +1097,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 41, name: "Zubat", types: ["Poison", "Flying"], - baseStats: {hp: 40, atk: 45, def: 35, spa: 30, spd: 40, spe: 55}, - abilities: {0: "Inner Focus", H: "Infiltrator"}, + baseStats: { hp: 40, atk: 45, def: 35, spa: 30, spd: 40, spe: 55 }, + abilities: { 0: "Inner Focus", H: "Infiltrator" }, heightm: 0.8, weightkg: 7.5, color: "Purple", @@ -1109,8 +1109,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 42, name: "Golbat", types: ["Poison", "Flying"], - baseStats: {hp: 75, atk: 80, def: 70, spa: 65, spd: 75, spe: 90}, - abilities: {0: "Inner Focus", H: "Infiltrator"}, + baseStats: { hp: 75, atk: 80, def: 70, spa: 65, spd: 75, spe: 90 }, + abilities: { 0: "Inner Focus", H: "Infiltrator" }, heightm: 1.6, weightkg: 55, color: "Purple", @@ -1123,8 +1123,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 43, name: "Oddish", types: ["Grass", "Poison"], - baseStats: {hp: 45, atk: 50, def: 55, spa: 75, spd: 65, spe: 30}, - abilities: {0: "Chlorophyll", H: "Run Away"}, + baseStats: { hp: 45, atk: 50, def: 55, spa: 75, spd: 65, spe: 30 }, + abilities: { 0: "Chlorophyll", H: "Run Away" }, heightm: 0.5, weightkg: 5.4, color: "Blue", @@ -1135,8 +1135,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 44, name: "Gloom", types: ["Grass", "Poison"], - baseStats: {hp: 60, atk: 65, def: 70, spa: 85, spd: 75, spe: 40}, - abilities: {0: "Chlorophyll", H: "Stench"}, + baseStats: { hp: 60, atk: 65, def: 70, spa: 85, spd: 75, spe: 40 }, + abilities: { 0: "Chlorophyll", H: "Stench" }, heightm: 0.8, weightkg: 8.6, color: "Blue", @@ -1149,8 +1149,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 45, name: "Vileplume", types: ["Grass", "Poison"], - baseStats: {hp: 75, atk: 80, def: 85, spa: 110, spd: 90, spe: 50}, - abilities: {0: "Chlorophyll", H: "Effect Spore"}, + baseStats: { hp: 75, atk: 80, def: 85, spa: 110, spd: 90, spe: 50 }, + abilities: { 0: "Chlorophyll", H: "Effect Spore" }, heightm: 1.2, weightkg: 18.6, color: "Red", @@ -1163,8 +1163,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 46, name: "Paras", types: ["Bug", "Grass"], - baseStats: {hp: 35, atk: 70, def: 55, spa: 45, spd: 55, spe: 25}, - abilities: {0: "Effect Spore", 1: "Dry Skin", H: "Damp"}, + baseStats: { hp: 35, atk: 70, def: 55, spa: 45, spd: 55, spe: 25 }, + abilities: { 0: "Effect Spore", 1: "Dry Skin", H: "Damp" }, heightm: 0.3, weightkg: 5.4, color: "Red", @@ -1175,8 +1175,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 47, name: "Parasect", types: ["Bug", "Grass"], - baseStats: {hp: 60, atk: 95, def: 80, spa: 60, spd: 80, spe: 30}, - abilities: {0: "Effect Spore", 1: "Dry Skin", H: "Damp"}, + baseStats: { hp: 60, atk: 95, def: 80, spa: 60, spd: 80, spe: 30 }, + abilities: { 0: "Effect Spore", 1: "Dry Skin", H: "Damp" }, heightm: 1, weightkg: 29.5, color: "Red", @@ -1188,8 +1188,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 48, name: "Venonat", types: ["Bug", "Poison"], - baseStats: {hp: 60, atk: 55, def: 50, spa: 40, spd: 55, spe: 45}, - abilities: {0: "Compound Eyes", 1: "Tinted Lens", H: "Run Away"}, + baseStats: { hp: 60, atk: 55, def: 50, spa: 40, spd: 55, spe: 45 }, + abilities: { 0: "Compound Eyes", 1: "Tinted Lens", H: "Run Away" }, heightm: 1, weightkg: 30, color: "Purple", @@ -1200,8 +1200,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 49, name: "Venomoth", types: ["Bug", "Poison"], - baseStats: {hp: 70, atk: 65, def: 60, spa: 90, spd: 75, spe: 90}, - abilities: {0: "Shield Dust", 1: "Tinted Lens", H: "Wonder Skin"}, + baseStats: { hp: 70, atk: 65, def: 60, spa: 90, spd: 75, spe: 90 }, + abilities: { 0: "Shield Dust", 1: "Tinted Lens", H: "Wonder Skin" }, heightm: 1.5, weightkg: 12.5, color: "Purple", @@ -1213,8 +1213,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 50, name: "Diglett", types: ["Ground"], - baseStats: {hp: 10, atk: 55, def: 25, spa: 35, spd: 45, spe: 95}, - abilities: {0: "Sand Veil", 1: "Arena Trap", H: "Sand Force"}, + baseStats: { hp: 10, atk: 55, def: 25, spa: 35, spd: 45, spe: 95 }, + abilities: { 0: "Sand Veil", 1: "Arena Trap", H: "Sand Force" }, heightm: 0.2, weightkg: 0.8, color: "Brown", @@ -1229,8 +1229,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Diglett", forme: "Alola", types: ["Ground", "Steel"], - baseStats: {hp: 10, atk: 55, def: 30, spa: 35, spd: 45, spe: 90}, - abilities: {0: "Sand Veil", 1: "Tangling Hair", H: "Sand Force"}, + baseStats: { hp: 10, atk: 55, def: 30, spa: 35, spd: 45, spe: 90 }, + abilities: { 0: "Sand Veil", 1: "Tangling Hair", H: "Sand Force" }, heightm: 0.2, weightkg: 1, color: "Brown", @@ -1241,8 +1241,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 51, name: "Dugtrio", types: ["Ground"], - baseStats: {hp: 35, atk: 100, def: 50, spa: 50, spd: 70, spe: 120}, - abilities: {0: "Sand Veil", 1: "Arena Trap", H: "Sand Force"}, + baseStats: { hp: 35, atk: 100, def: 50, spa: 50, spd: 70, spe: 120 }, + abilities: { 0: "Sand Veil", 1: "Arena Trap", H: "Sand Force" }, heightm: 0.7, weightkg: 33.3, color: "Brown", @@ -1258,8 +1258,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Dugtrio", forme: "Alola", types: ["Ground", "Steel"], - baseStats: {hp: 35, atk: 100, def: 60, spa: 50, spd: 70, spe: 110}, - abilities: {0: "Sand Veil", 1: "Tangling Hair", H: "Sand Force"}, + baseStats: { hp: 35, atk: 100, def: 60, spa: 50, spd: 70, spe: 110 }, + abilities: { 0: "Sand Veil", 1: "Tangling Hair", H: "Sand Force" }, heightm: 0.7, weightkg: 66.6, color: "Brown", @@ -1271,8 +1271,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 52, name: "Meowth", types: ["Normal"], - baseStats: {hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 90}, - abilities: {0: "Pickup", 1: "Technician", H: "Unnerve"}, + baseStats: { hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 90 }, + abilities: { 0: "Pickup", 1: "Technician", H: "Unnerve" }, heightm: 0.4, weightkg: 4.2, color: "Yellow", @@ -1288,8 +1288,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Meowth", forme: "Alola", types: ["Dark"], - baseStats: {hp: 40, atk: 35, def: 35, spa: 50, spd: 40, spe: 90}, - abilities: {0: "Pickup", 1: "Technician", H: "Rattled"}, + baseStats: { hp: 40, atk: 35, def: 35, spa: 50, spd: 40, spe: 90 }, + abilities: { 0: "Pickup", 1: "Technician", H: "Rattled" }, heightm: 0.4, weightkg: 4.2, color: "Blue", @@ -1302,8 +1302,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Meowth", forme: "Galar", types: ["Steel"], - baseStats: {hp: 50, atk: 65, def: 55, spa: 40, spd: 40, spe: 40}, - abilities: {0: "Pickup", 1: "Tough Claws", H: "Unnerve"}, + baseStats: { hp: 50, atk: 65, def: 55, spa: 40, spd: 40, spe: 40 }, + abilities: { 0: "Pickup", 1: "Tough Claws", H: "Unnerve" }, heightm: 0.4, weightkg: 7.5, color: "Brown", @@ -1316,8 +1316,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Meowth", forme: "Gmax", types: ["Normal"], - baseStats: {hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 90}, - abilities: {0: "Pickup", 1: "Technician", H: "Unnerve"}, + baseStats: { hp: 40, atk: 45, def: 35, spa: 40, spd: 40, spe: 90 }, + abilities: { 0: "Pickup", 1: "Technician", H: "Unnerve" }, heightm: 33, weightkg: 0, color: "Yellow", @@ -1328,8 +1328,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 53, name: "Persian", types: ["Normal"], - baseStats: {hp: 65, atk: 70, def: 60, spa: 65, spd: 65, spe: 115}, - abilities: {0: "Limber", 1: "Technician", H: "Unnerve"}, + baseStats: { hp: 65, atk: 70, def: 60, spa: 65, spd: 65, spe: 115 }, + abilities: { 0: "Limber", 1: "Technician", H: "Unnerve" }, heightm: 1, weightkg: 32, color: "Yellow", @@ -1345,8 +1345,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Persian", forme: "Alola", types: ["Dark"], - baseStats: {hp: 65, atk: 60, def: 60, spa: 75, spd: 65, spe: 115}, - abilities: {0: "Fur Coat", 1: "Technician", H: "Rattled"}, + baseStats: { hp: 65, atk: 60, def: 60, spa: 75, spd: 65, spe: 115 }, + abilities: { 0: "Fur Coat", 1: "Technician", H: "Rattled" }, heightm: 1.1, weightkg: 33, color: "Blue", @@ -1358,8 +1358,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 54, name: "Psyduck", types: ["Water"], - baseStats: {hp: 50, atk: 52, def: 48, spa: 65, spd: 50, spe: 55}, - abilities: {0: "Damp", 1: "Cloud Nine", H: "Swift Swim"}, + baseStats: { hp: 50, atk: 52, def: 48, spa: 65, spd: 50, spe: 55 }, + abilities: { 0: "Damp", 1: "Cloud Nine", H: "Swift Swim" }, heightm: 0.8, weightkg: 19.6, color: "Yellow", @@ -1370,8 +1370,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 55, name: "Golduck", types: ["Water"], - baseStats: {hp: 80, atk: 82, def: 78, spa: 95, spd: 80, spe: 85}, - abilities: {0: "Damp", 1: "Cloud Nine", H: "Swift Swim"}, + baseStats: { hp: 80, atk: 82, def: 78, spa: 95, spd: 80, spe: 85 }, + abilities: { 0: "Damp", 1: "Cloud Nine", H: "Swift Swim" }, heightm: 1.7, weightkg: 76.6, color: "Blue", @@ -1383,8 +1383,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 56, name: "Mankey", types: ["Fighting"], - baseStats: {hp: 40, atk: 80, def: 35, spa: 35, spd: 45, spe: 70}, - abilities: {0: "Vital Spirit", 1: "Anger Point", H: "Defiant"}, + baseStats: { hp: 40, atk: 80, def: 35, spa: 35, spd: 45, spe: 70 }, + abilities: { 0: "Vital Spirit", 1: "Anger Point", H: "Defiant" }, heightm: 0.5, weightkg: 28, color: "Brown", @@ -1395,8 +1395,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 57, name: "Primeape", types: ["Fighting"], - baseStats: {hp: 65, atk: 105, def: 60, spa: 60, spd: 70, spe: 95}, - abilities: {0: "Vital Spirit", 1: "Anger Point", H: "Defiant"}, + baseStats: { hp: 65, atk: 105, def: 60, spa: 60, spd: 70, spe: 95 }, + abilities: { 0: "Vital Spirit", 1: "Anger Point", H: "Defiant" }, heightm: 1, weightkg: 32, color: "Brown", @@ -1409,9 +1409,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 58, name: "Growlithe", types: ["Fire"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 55, atk: 70, def: 45, spa: 70, spd: 50, spe: 60}, - abilities: {0: "Intimidate", 1: "Flash Fire", H: "Justified"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 55, atk: 70, def: 45, spa: 70, spd: 50, spe: 60 }, + abilities: { 0: "Intimidate", 1: "Flash Fire", H: "Justified" }, heightm: 0.7, weightkg: 19, color: "Brown", @@ -1426,9 +1426,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Growlithe", forme: "Hisui", types: ["Fire", "Rock"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 60, atk: 75, def: 45, spa: 65, spd: 50, spe: 55}, - abilities: {0: "Intimidate", 1: "Flash Fire", H: "Rock Head"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 60, atk: 75, def: 45, spa: 65, spd: 50, spe: 55 }, + abilities: { 0: "Intimidate", 1: "Flash Fire", H: "Rock Head" }, heightm: 0.8, weightkg: 22.7, color: "Brown", @@ -1439,9 +1439,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 59, name: "Arcanine", types: ["Fire"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 90, atk: 110, def: 80, spa: 100, spd: 80, spe: 95}, - abilities: {0: "Intimidate", 1: "Flash Fire", H: "Justified"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 90, atk: 110, def: 80, spa: 100, spd: 80, spe: 95 }, + abilities: { 0: "Intimidate", 1: "Flash Fire", H: "Justified" }, heightm: 1.9, weightkg: 155, color: "Brown", @@ -1458,9 +1458,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Arcanine", forme: "Hisui", types: ["Fire", "Rock"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 95, atk: 115, def: 80, spa: 95, spd: 80, spe: 90}, - abilities: {0: "Intimidate", 1: "Flash Fire", H: "Rock Head"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 95, atk: 115, def: 80, spa: 95, spd: 80, spe: 90 }, + abilities: { 0: "Intimidate", 1: "Flash Fire", H: "Rock Head" }, heightm: 2, weightkg: 168, color: "Brown", @@ -1473,8 +1473,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 60, name: "Poliwag", types: ["Water"], - baseStats: {hp: 40, atk: 50, def: 40, spa: 40, spd: 40, spe: 90}, - abilities: {0: "Water Absorb", 1: "Damp", H: "Swift Swim"}, + baseStats: { hp: 40, atk: 50, def: 40, spa: 40, spd: 40, spe: 90 }, + abilities: { 0: "Water Absorb", 1: "Damp", H: "Swift Swim" }, heightm: 0.6, weightkg: 12.4, color: "Blue", @@ -1485,8 +1485,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 61, name: "Poliwhirl", types: ["Water"], - baseStats: {hp: 65, atk: 65, def: 65, spa: 50, spd: 50, spe: 90}, - abilities: {0: "Water Absorb", 1: "Damp", H: "Swift Swim"}, + baseStats: { hp: 65, atk: 65, def: 65, spa: 50, spd: 50, spe: 90 }, + abilities: { 0: "Water Absorb", 1: "Damp", H: "Swift Swim" }, heightm: 1, weightkg: 20, color: "Blue", @@ -1499,8 +1499,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 62, name: "Poliwrath", types: ["Water", "Fighting"], - baseStats: {hp: 90, atk: 95, def: 95, spa: 70, spd: 90, spe: 70}, - abilities: {0: "Water Absorb", 1: "Damp", H: "Swift Swim"}, + baseStats: { hp: 90, atk: 95, def: 95, spa: 70, spd: 90, spe: 70 }, + abilities: { 0: "Water Absorb", 1: "Damp", H: "Swift Swim" }, heightm: 1.3, weightkg: 54, color: "Blue", @@ -1513,9 +1513,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 63, name: "Abra", types: ["Psychic"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 25, atk: 20, def: 15, spa: 105, spd: 55, spe: 90}, - abilities: {0: "Synchronize", 1: "Inner Focus", H: "Magic Guard"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 25, atk: 20, def: 15, spa: 105, spd: 55, spe: 90 }, + abilities: { 0: "Synchronize", 1: "Inner Focus", H: "Magic Guard" }, heightm: 0.9, weightkg: 19.5, color: "Brown", @@ -1526,9 +1526,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 64, name: "Kadabra", types: ["Psychic"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 40, atk: 35, def: 30, spa: 120, spd: 70, spe: 105}, - abilities: {0: "Synchronize", 1: "Inner Focus", H: "Magic Guard"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 40, atk: 35, def: 30, spa: 120, spd: 70, spe: 105 }, + abilities: { 0: "Synchronize", 1: "Inner Focus", H: "Magic Guard" }, heightm: 1.3, weightkg: 56.5, color: "Brown", @@ -1541,9 +1541,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 65, name: "Alakazam", types: ["Psychic"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 55, atk: 50, def: 45, spa: 135, spd: 95, spe: 120}, - abilities: {0: "Synchronize", 1: "Inner Focus", H: "Magic Guard"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 55, atk: 50, def: 45, spa: 135, spd: 95, spe: 120 }, + abilities: { 0: "Synchronize", 1: "Inner Focus", H: "Magic Guard" }, heightm: 1.5, weightkg: 48, color: "Brown", @@ -1559,9 +1559,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Alakazam", forme: "Mega", types: ["Psychic"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 55, atk: 50, def: 65, spa: 175, spd: 105, spe: 150}, - abilities: {0: "Trace"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 55, atk: 50, def: 65, spa: 175, spd: 105, spe: 150 }, + abilities: { 0: "Trace" }, heightm: 1.2, weightkg: 48, color: "Brown", @@ -1572,9 +1572,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 66, name: "Machop", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 70, atk: 80, def: 50, spa: 35, spd: 35, spe: 35}, - abilities: {0: "Guts", 1: "No Guard", H: "Steadfast"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 70, atk: 80, def: 50, spa: 35, spd: 35, spe: 35 }, + abilities: { 0: "Guts", 1: "No Guard", H: "Steadfast" }, heightm: 0.8, weightkg: 19.5, color: "Gray", @@ -1585,9 +1585,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 67, name: "Machoke", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 80, atk: 100, def: 70, spa: 50, spd: 60, spe: 45}, - abilities: {0: "Guts", 1: "No Guard", H: "Steadfast"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 80, atk: 100, def: 70, spa: 50, spd: 60, spe: 45 }, + abilities: { 0: "Guts", 1: "No Guard", H: "Steadfast" }, heightm: 1.5, weightkg: 70.5, color: "Gray", @@ -1600,9 +1600,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 68, name: "Machamp", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 90, atk: 130, def: 80, spa: 65, spd: 85, spe: 55}, - abilities: {0: "Guts", 1: "No Guard", H: "Steadfast"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 90, atk: 130, def: 80, spa: 65, spd: 85, spe: 55 }, + abilities: { 0: "Guts", 1: "No Guard", H: "Steadfast" }, heightm: 1.6, weightkg: 130, color: "Gray", @@ -1617,9 +1617,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Machamp", forme: "Gmax", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 90, atk: 130, def: 80, spa: 65, spd: 85, spe: 55}, - abilities: {0: "Guts", 1: "No Guard", H: "Steadfast"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 90, atk: 130, def: 80, spa: 65, spd: 85, spe: 55 }, + abilities: { 0: "Guts", 1: "No Guard", H: "Steadfast" }, heightm: 25, weightkg: 0, color: "Gray", @@ -1630,8 +1630,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 69, name: "Bellsprout", types: ["Grass", "Poison"], - baseStats: {hp: 50, atk: 75, def: 35, spa: 70, spd: 30, spe: 40}, - abilities: {0: "Chlorophyll", H: "Gluttony"}, + baseStats: { hp: 50, atk: 75, def: 35, spa: 70, spd: 30, spe: 40 }, + abilities: { 0: "Chlorophyll", H: "Gluttony" }, heightm: 0.7, weightkg: 4, color: "Green", @@ -1642,8 +1642,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 70, name: "Weepinbell", types: ["Grass", "Poison"], - baseStats: {hp: 65, atk: 90, def: 50, spa: 85, spd: 45, spe: 55}, - abilities: {0: "Chlorophyll", H: "Gluttony"}, + baseStats: { hp: 65, atk: 90, def: 50, spa: 85, spd: 45, spe: 55 }, + abilities: { 0: "Chlorophyll", H: "Gluttony" }, heightm: 1, weightkg: 6.4, color: "Green", @@ -1656,8 +1656,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 71, name: "Victreebel", types: ["Grass", "Poison"], - baseStats: {hp: 80, atk: 105, def: 65, spa: 100, spd: 70, spe: 70}, - abilities: {0: "Chlorophyll", H: "Gluttony"}, + baseStats: { hp: 80, atk: 105, def: 65, spa: 100, spd: 70, spe: 70 }, + abilities: { 0: "Chlorophyll", H: "Gluttony" }, heightm: 1.7, weightkg: 15.5, color: "Green", @@ -1670,8 +1670,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 72, name: "Tentacool", types: ["Water", "Poison"], - baseStats: {hp: 40, atk: 40, def: 35, spa: 50, spd: 100, spe: 70}, - abilities: {0: "Clear Body", 1: "Liquid Ooze", H: "Rain Dish"}, + baseStats: { hp: 40, atk: 40, def: 35, spa: 50, spd: 100, spe: 70 }, + abilities: { 0: "Clear Body", 1: "Liquid Ooze", H: "Rain Dish" }, heightm: 0.9, weightkg: 45.5, color: "Blue", @@ -1682,8 +1682,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 73, name: "Tentacruel", types: ["Water", "Poison"], - baseStats: {hp: 80, atk: 70, def: 65, spa: 80, spd: 120, spe: 100}, - abilities: {0: "Clear Body", 1: "Liquid Ooze", H: "Rain Dish"}, + baseStats: { hp: 80, atk: 70, def: 65, spa: 80, spd: 120, spe: 100 }, + abilities: { 0: "Clear Body", 1: "Liquid Ooze", H: "Rain Dish" }, heightm: 1.6, weightkg: 55, color: "Blue", @@ -1695,8 +1695,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 74, name: "Geodude", types: ["Rock", "Ground"], - baseStats: {hp: 40, atk: 80, def: 100, spa: 30, spd: 30, spe: 20}, - abilities: {0: "Rock Head", 1: "Sturdy", H: "Sand Veil"}, + baseStats: { hp: 40, atk: 80, def: 100, spa: 30, spd: 30, spe: 20 }, + abilities: { 0: "Rock Head", 1: "Sturdy", H: "Sand Veil" }, heightm: 0.4, weightkg: 20, color: "Brown", @@ -1711,8 +1711,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Geodude", forme: "Alola", types: ["Rock", "Electric"], - baseStats: {hp: 40, atk: 80, def: 100, spa: 30, spd: 30, spe: 20}, - abilities: {0: "Magnet Pull", 1: "Sturdy", H: "Galvanize"}, + baseStats: { hp: 40, atk: 80, def: 100, spa: 30, spd: 30, spe: 20 }, + abilities: { 0: "Magnet Pull", 1: "Sturdy", H: "Galvanize" }, heightm: 0.4, weightkg: 20.3, color: "Gray", @@ -1723,8 +1723,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 75, name: "Graveler", types: ["Rock", "Ground"], - baseStats: {hp: 55, atk: 95, def: 115, spa: 45, spd: 45, spe: 35}, - abilities: {0: "Rock Head", 1: "Sturdy", H: "Sand Veil"}, + baseStats: { hp: 55, atk: 95, def: 115, spa: 45, spd: 45, spe: 35 }, + abilities: { 0: "Rock Head", 1: "Sturdy", H: "Sand Veil" }, heightm: 1, weightkg: 105, color: "Brown", @@ -1741,8 +1741,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Graveler", forme: "Alola", types: ["Rock", "Electric"], - baseStats: {hp: 55, atk: 95, def: 115, spa: 45, spd: 45, spe: 35}, - abilities: {0: "Magnet Pull", 1: "Sturdy", H: "Galvanize"}, + baseStats: { hp: 55, atk: 95, def: 115, spa: 45, spd: 45, spe: 35 }, + abilities: { 0: "Magnet Pull", 1: "Sturdy", H: "Galvanize" }, heightm: 1, weightkg: 110, color: "Gray", @@ -1755,8 +1755,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 76, name: "Golem", types: ["Rock", "Ground"], - baseStats: {hp: 80, atk: 120, def: 130, spa: 55, spd: 65, spe: 45}, - abilities: {0: "Rock Head", 1: "Sturdy", H: "Sand Veil"}, + baseStats: { hp: 80, atk: 120, def: 130, spa: 55, spd: 65, spe: 45 }, + abilities: { 0: "Rock Head", 1: "Sturdy", H: "Sand Veil" }, heightm: 1.4, weightkg: 300, color: "Brown", @@ -1772,8 +1772,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Golem", forme: "Alola", types: ["Rock", "Electric"], - baseStats: {hp: 80, atk: 120, def: 130, spa: 55, spd: 65, spe: 45}, - abilities: {0: "Magnet Pull", 1: "Sturdy", H: "Galvanize"}, + baseStats: { hp: 80, atk: 120, def: 130, spa: 55, spd: 65, spe: 45 }, + abilities: { 0: "Magnet Pull", 1: "Sturdy", H: "Galvanize" }, heightm: 1.7, weightkg: 316, color: "Gray", @@ -1785,8 +1785,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 77, name: "Ponyta", types: ["Fire"], - baseStats: {hp: 50, atk: 85, def: 55, spa: 65, spd: 65, spe: 90}, - abilities: {0: "Run Away", 1: "Flash Fire", H: "Flame Body"}, + baseStats: { hp: 50, atk: 85, def: 55, spa: 65, spd: 65, spe: 90 }, + abilities: { 0: "Run Away", 1: "Flash Fire", H: "Flame Body" }, heightm: 1, weightkg: 30, color: "Yellow", @@ -1801,8 +1801,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Ponyta", forme: "Galar", types: ["Psychic"], - baseStats: {hp: 50, atk: 85, def: 55, spa: 65, spd: 65, spe: 90}, - abilities: {0: "Run Away", 1: "Pastel Veil", H: "Anticipation"}, + baseStats: { hp: 50, atk: 85, def: 55, spa: 65, spd: 65, spe: 90 }, + abilities: { 0: "Run Away", 1: "Pastel Veil", H: "Anticipation" }, heightm: 0.8, weightkg: 24, color: "White", @@ -1813,8 +1813,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 78, name: "Rapidash", types: ["Fire"], - baseStats: {hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105}, - abilities: {0: "Run Away", 1: "Flash Fire", H: "Flame Body"}, + baseStats: { hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105 }, + abilities: { 0: "Run Away", 1: "Flash Fire", H: "Flame Body" }, heightm: 1.7, weightkg: 95, color: "Yellow", @@ -1830,8 +1830,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Rapidash", forme: "Galar", types: ["Psychic", "Fairy"], - baseStats: {hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105}, - abilities: {0: "Run Away", 1: "Pastel Veil", H: "Anticipation"}, + baseStats: { hp: 65, atk: 100, def: 70, spa: 80, spd: 80, spe: 105 }, + abilities: { 0: "Run Away", 1: "Pastel Veil", H: "Anticipation" }, heightm: 1.7, weightkg: 80, color: "White", @@ -1843,8 +1843,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 79, name: "Slowpoke", types: ["Water", "Psychic"], - baseStats: {hp: 90, atk: 65, def: 65, spa: 40, spd: 40, spe: 15}, - abilities: {0: "Oblivious", 1: "Own Tempo", H: "Regenerator"}, + baseStats: { hp: 90, atk: 65, def: 65, spa: 40, spd: 40, spe: 15 }, + abilities: { 0: "Oblivious", 1: "Own Tempo", H: "Regenerator" }, heightm: 1.2, weightkg: 36, color: "Pink", @@ -1859,8 +1859,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Slowpoke", forme: "Galar", types: ["Psychic"], - baseStats: {hp: 90, atk: 65, def: 65, spa: 40, spd: 40, spe: 15}, - abilities: {0: "Gluttony", 1: "Own Tempo", H: "Regenerator"}, + baseStats: { hp: 90, atk: 65, def: 65, spa: 40, spd: 40, spe: 15 }, + abilities: { 0: "Gluttony", 1: "Own Tempo", H: "Regenerator" }, heightm: 1.2, weightkg: 36, color: "Pink", @@ -1871,8 +1871,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 80, name: "Slowbro", types: ["Water", "Psychic"], - baseStats: {hp: 95, atk: 75, def: 110, spa: 100, spd: 80, spe: 30}, - abilities: {0: "Oblivious", 1: "Own Tempo", H: "Regenerator"}, + baseStats: { hp: 95, atk: 75, def: 110, spa: 100, spd: 80, spe: 30 }, + abilities: { 0: "Oblivious", 1: "Own Tempo", H: "Regenerator" }, heightm: 1.6, weightkg: 78.5, color: "Pink", @@ -1888,8 +1888,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Slowbro", forme: "Mega", types: ["Water", "Psychic"], - baseStats: {hp: 95, atk: 75, def: 180, spa: 130, spd: 80, spe: 30}, - abilities: {0: "Shell Armor"}, + baseStats: { hp: 95, atk: 75, def: 180, spa: 130, spd: 80, spe: 30 }, + abilities: { 0: "Shell Armor" }, heightm: 2, weightkg: 120, color: "Pink", @@ -1902,8 +1902,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Slowbro", forme: "Galar", types: ["Poison", "Psychic"], - baseStats: {hp: 95, atk: 100, def: 95, spa: 100, spd: 70, spe: 30}, - abilities: {0: "Quick Draw", 1: "Own Tempo", H: "Regenerator"}, + baseStats: { hp: 95, atk: 100, def: 95, spa: 100, spd: 70, spe: 30 }, + abilities: { 0: "Quick Draw", 1: "Own Tempo", H: "Regenerator" }, heightm: 1.6, weightkg: 70.5, color: "Pink", @@ -1917,8 +1917,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Magnemite", types: ["Electric", "Steel"], gender: "N", - baseStats: {hp: 25, atk: 35, def: 70, spa: 95, spd: 55, spe: 45}, - abilities: {0: "Magnet Pull", 1: "Sturdy", H: "Analytic"}, + baseStats: { hp: 25, atk: 35, def: 70, spa: 95, spd: 55, spe: 45 }, + abilities: { 0: "Magnet Pull", 1: "Sturdy", H: "Analytic" }, heightm: 0.3, weightkg: 6, color: "Gray", @@ -1930,8 +1930,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Magneton", types: ["Electric", "Steel"], gender: "N", - baseStats: {hp: 50, atk: 60, def: 95, spa: 120, spd: 70, spe: 70}, - abilities: {0: "Magnet Pull", 1: "Sturdy", H: "Analytic"}, + baseStats: { hp: 50, atk: 60, def: 95, spa: 120, spd: 70, spe: 70 }, + abilities: { 0: "Magnet Pull", 1: "Sturdy", H: "Analytic" }, heightm: 1, weightkg: 60, color: "Gray", @@ -1944,8 +1944,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 83, name: "Farfetch\u2019d", types: ["Normal", "Flying"], - baseStats: {hp: 52, atk: 90, def: 55, spa: 58, spd: 62, spe: 60}, - abilities: {0: "Keen Eye", 1: "Inner Focus", H: "Defiant"}, + baseStats: { hp: 52, atk: 90, def: 55, spa: 58, spd: 62, spe: 60 }, + abilities: { 0: "Keen Eye", 1: "Inner Focus", H: "Defiant" }, heightm: 0.8, weightkg: 15, color: "Brown", @@ -1959,8 +1959,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Farfetch\u2019d", forme: "Galar", types: ["Fighting"], - baseStats: {hp: 52, atk: 95, def: 55, spa: 58, spd: 62, spe: 55}, - abilities: {0: "Steadfast", H: "Scrappy"}, + baseStats: { hp: 52, atk: 95, def: 55, spa: 58, spd: 62, spe: 55 }, + abilities: { 0: "Steadfast", H: "Scrappy" }, heightm: 0.8, weightkg: 42, color: "Brown", @@ -1971,8 +1971,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 84, name: "Doduo", types: ["Normal", "Flying"], - baseStats: {hp: 35, atk: 85, def: 45, spa: 35, spd: 35, spe: 75}, - abilities: {0: "Run Away", 1: "Early Bird", H: "Tangled Feet"}, + baseStats: { hp: 35, atk: 85, def: 45, spa: 35, spd: 35, spe: 75 }, + abilities: { 0: "Run Away", 1: "Early Bird", H: "Tangled Feet" }, heightm: 1.4, weightkg: 39.2, color: "Brown", @@ -1983,8 +1983,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 85, name: "Dodrio", types: ["Normal", "Flying"], - baseStats: {hp: 60, atk: 110, def: 70, spa: 60, spd: 60, spe: 110}, - abilities: {0: "Run Away", 1: "Early Bird", H: "Tangled Feet"}, + baseStats: { hp: 60, atk: 110, def: 70, spa: 60, spd: 60, spe: 110 }, + abilities: { 0: "Run Away", 1: "Early Bird", H: "Tangled Feet" }, heightm: 1.8, weightkg: 85.2, color: "Brown", @@ -1996,8 +1996,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 86, name: "Seel", types: ["Water"], - baseStats: {hp: 65, atk: 45, def: 55, spa: 45, spd: 70, spe: 45}, - abilities: {0: "Thick Fat", 1: "Hydration", H: "Ice Body"}, + baseStats: { hp: 65, atk: 45, def: 55, spa: 45, spd: 70, spe: 45 }, + abilities: { 0: "Thick Fat", 1: "Hydration", H: "Ice Body" }, heightm: 1.1, weightkg: 90, color: "White", @@ -2008,8 +2008,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 87, name: "Dewgong", types: ["Water", "Ice"], - baseStats: {hp: 90, atk: 70, def: 80, spa: 70, spd: 95, spe: 70}, - abilities: {0: "Thick Fat", 1: "Hydration", H: "Ice Body"}, + baseStats: { hp: 90, atk: 70, def: 80, spa: 70, spd: 95, spe: 70 }, + abilities: { 0: "Thick Fat", 1: "Hydration", H: "Ice Body" }, heightm: 1.7, weightkg: 120, color: "White", @@ -2021,8 +2021,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 88, name: "Grimer", types: ["Poison"], - baseStats: {hp: 80, atk: 80, def: 50, spa: 40, spd: 50, spe: 25}, - abilities: {0: "Stench", 1: "Sticky Hold", H: "Poison Touch"}, + baseStats: { hp: 80, atk: 80, def: 50, spa: 40, spd: 50, spe: 25 }, + abilities: { 0: "Stench", 1: "Sticky Hold", H: "Poison Touch" }, heightm: 0.9, weightkg: 30, color: "Purple", @@ -2037,8 +2037,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Grimer", forme: "Alola", types: ["Poison", "Dark"], - baseStats: {hp: 80, atk: 80, def: 50, spa: 40, spd: 50, spe: 25}, - abilities: {0: "Poison Touch", 1: "Gluttony", H: "Power of Alchemy"}, + baseStats: { hp: 80, atk: 80, def: 50, spa: 40, spd: 50, spe: 25 }, + abilities: { 0: "Poison Touch", 1: "Gluttony", H: "Power of Alchemy" }, heightm: 0.7, weightkg: 42, color: "Green", @@ -2049,8 +2049,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 89, name: "Muk", types: ["Poison"], - baseStats: {hp: 105, atk: 105, def: 75, spa: 65, spd: 100, spe: 50}, - abilities: {0: "Stench", 1: "Sticky Hold", H: "Poison Touch"}, + baseStats: { hp: 105, atk: 105, def: 75, spa: 65, spd: 100, spe: 50 }, + abilities: { 0: "Stench", 1: "Sticky Hold", H: "Poison Touch" }, heightm: 1.2, weightkg: 30, color: "Purple", @@ -2066,8 +2066,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Muk", forme: "Alola", types: ["Poison", "Dark"], - baseStats: {hp: 105, atk: 105, def: 75, spa: 65, spd: 100, spe: 50}, - abilities: {0: "Poison Touch", 1: "Gluttony", H: "Power of Alchemy"}, + baseStats: { hp: 105, atk: 105, def: 75, spa: 65, spd: 100, spe: 50 }, + abilities: { 0: "Poison Touch", 1: "Gluttony", H: "Power of Alchemy" }, heightm: 1, weightkg: 52, color: "Green", @@ -2079,8 +2079,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 90, name: "Shellder", types: ["Water"], - baseStats: {hp: 30, atk: 65, def: 100, spa: 45, spd: 25, spe: 40}, - abilities: {0: "Shell Armor", 1: "Skill Link", H: "Overcoat"}, + baseStats: { hp: 30, atk: 65, def: 100, spa: 45, spd: 25, spe: 40 }, + abilities: { 0: "Shell Armor", 1: "Skill Link", H: "Overcoat" }, heightm: 0.3, weightkg: 4, color: "Purple", @@ -2091,8 +2091,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 91, name: "Cloyster", types: ["Water", "Ice"], - baseStats: {hp: 50, atk: 95, def: 180, spa: 85, spd: 45, spe: 70}, - abilities: {0: "Shell Armor", 1: "Skill Link", H: "Overcoat"}, + baseStats: { hp: 50, atk: 95, def: 180, spa: 85, spd: 45, spe: 70 }, + abilities: { 0: "Shell Armor", 1: "Skill Link", H: "Overcoat" }, heightm: 1.5, weightkg: 132.5, color: "Purple", @@ -2105,8 +2105,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 92, name: "Gastly", types: ["Ghost", "Poison"], - baseStats: {hp: 30, atk: 35, def: 30, spa: 100, spd: 35, spe: 80}, - abilities: {0: "Levitate"}, + baseStats: { hp: 30, atk: 35, def: 30, spa: 100, spd: 35, spe: 80 }, + abilities: { 0: "Levitate" }, heightm: 1.3, weightkg: 0.1, color: "Purple", @@ -2117,8 +2117,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 93, name: "Haunter", types: ["Ghost", "Poison"], - baseStats: {hp: 45, atk: 50, def: 45, spa: 115, spd: 55, spe: 95}, - abilities: {0: "Levitate"}, + baseStats: { hp: 45, atk: 50, def: 45, spa: 115, spd: 55, spe: 95 }, + abilities: { 0: "Levitate" }, heightm: 1.6, weightkg: 0.1, color: "Purple", @@ -2131,8 +2131,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 94, name: "Gengar", types: ["Ghost", "Poison"], - baseStats: {hp: 60, atk: 65, def: 60, spa: 130, spd: 75, spe: 110}, - abilities: {0: "Cursed Body"}, + baseStats: { hp: 60, atk: 65, def: 60, spa: 130, spd: 75, spe: 110 }, + abilities: { 0: "Cursed Body" }, heightm: 1.5, weightkg: 40.5, color: "Purple", @@ -2149,8 +2149,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gengar", forme: "Mega", types: ["Ghost", "Poison"], - baseStats: {hp: 60, atk: 65, def: 80, spa: 170, spd: 95, spe: 130}, - abilities: {0: "Shadow Tag"}, + baseStats: { hp: 60, atk: 65, def: 80, spa: 170, spd: 95, spe: 130 }, + abilities: { 0: "Shadow Tag" }, heightm: 1.4, weightkg: 40.5, color: "Purple", @@ -2163,8 +2163,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gengar", forme: "Gmax", types: ["Ghost", "Poison"], - baseStats: {hp: 60, atk: 65, def: 60, spa: 130, spd: 75, spe: 110}, - abilities: {0: "Cursed Body"}, + baseStats: { hp: 60, atk: 65, def: 60, spa: 130, spd: 75, spe: 110 }, + abilities: { 0: "Cursed Body" }, heightm: 20, weightkg: 0, color: "Purple", @@ -2175,8 +2175,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 95, name: "Onix", types: ["Rock", "Ground"], - baseStats: {hp: 35, atk: 45, def: 160, spa: 30, spd: 45, spe: 70}, - abilities: {0: "Rock Head", 1: "Sturdy", H: "Weak Armor"}, + baseStats: { hp: 35, atk: 45, def: 160, spa: 30, spd: 45, spe: 70 }, + abilities: { 0: "Rock Head", 1: "Sturdy", H: "Weak Armor" }, heightm: 8.8, weightkg: 210, color: "Gray", @@ -2187,8 +2187,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 96, name: "Drowzee", types: ["Psychic"], - baseStats: {hp: 60, atk: 48, def: 45, spa: 43, spd: 90, spe: 42}, - abilities: {0: "Insomnia", 1: "Forewarn", H: "Inner Focus"}, + baseStats: { hp: 60, atk: 48, def: 45, spa: 43, spd: 90, spe: 42 }, + abilities: { 0: "Insomnia", 1: "Forewarn", H: "Inner Focus" }, heightm: 1, weightkg: 32.4, color: "Yellow", @@ -2199,8 +2199,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 97, name: "Hypno", types: ["Psychic"], - baseStats: {hp: 85, atk: 73, def: 70, spa: 73, spd: 115, spe: 67}, - abilities: {0: "Insomnia", 1: "Forewarn", H: "Inner Focus"}, + baseStats: { hp: 85, atk: 73, def: 70, spa: 73, spd: 115, spe: 67 }, + abilities: { 0: "Insomnia", 1: "Forewarn", H: "Inner Focus" }, heightm: 1.6, weightkg: 75.6, color: "Yellow", @@ -2212,8 +2212,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 98, name: "Krabby", types: ["Water"], - baseStats: {hp: 30, atk: 105, def: 90, spa: 25, spd: 25, spe: 50}, - abilities: {0: "Hyper Cutter", 1: "Shell Armor", H: "Sheer Force"}, + baseStats: { hp: 30, atk: 105, def: 90, spa: 25, spd: 25, spe: 50 }, + abilities: { 0: "Hyper Cutter", 1: "Shell Armor", H: "Sheer Force" }, heightm: 0.4, weightkg: 6.5, color: "Red", @@ -2224,8 +2224,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 99, name: "Kingler", types: ["Water"], - baseStats: {hp: 55, atk: 130, def: 115, spa: 50, spd: 50, spe: 75}, - abilities: {0: "Hyper Cutter", 1: "Shell Armor", H: "Sheer Force"}, + baseStats: { hp: 55, atk: 130, def: 115, spa: 50, spd: 50, spe: 75 }, + abilities: { 0: "Hyper Cutter", 1: "Shell Armor", H: "Sheer Force" }, heightm: 1.3, weightkg: 60, color: "Red", @@ -2240,8 +2240,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Kingler", forme: "Gmax", types: ["Water"], - baseStats: {hp: 55, atk: 130, def: 115, spa: 50, spd: 50, spe: 75}, - abilities: {0: "Hyper Cutter", 1: "Shell Armor", H: "Sheer Force"}, + baseStats: { hp: 55, atk: 130, def: 115, spa: 50, spd: 50, spe: 75 }, + abilities: { 0: "Hyper Cutter", 1: "Shell Armor", H: "Sheer Force" }, heightm: 19, weightkg: 0, color: "Red", @@ -2253,8 +2253,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Voltorb", types: ["Electric"], gender: "N", - baseStats: {hp: 40, atk: 30, def: 50, spa: 55, spd: 55, spe: 100}, - abilities: {0: "Soundproof", 1: "Static", H: "Aftermath"}, + baseStats: { hp: 40, atk: 30, def: 50, spa: 55, spd: 55, spe: 100 }, + abilities: { 0: "Soundproof", 1: "Static", H: "Aftermath" }, heightm: 0.5, weightkg: 10.4, color: "Red", @@ -2270,8 +2270,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Hisui", types: ["Electric", "Grass"], gender: "N", - baseStats: {hp: 40, atk: 30, def: 50, spa: 55, spd: 55, spe: 100}, - abilities: {0: "Soundproof", 1: "Static", H: "Aftermath"}, + baseStats: { hp: 40, atk: 30, def: 50, spa: 55, spd: 55, spe: 100 }, + abilities: { 0: "Soundproof", 1: "Static", H: "Aftermath" }, heightm: 0.5, weightkg: 13, color: "Red", @@ -2283,8 +2283,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Electrode", types: ["Electric"], gender: "N", - baseStats: {hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 150}, - abilities: {0: "Soundproof", 1: "Static", H: "Aftermath"}, + baseStats: { hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 150 }, + abilities: { 0: "Soundproof", 1: "Static", H: "Aftermath" }, heightm: 1.2, weightkg: 66.6, color: "Red", @@ -2301,8 +2301,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Hisui", types: ["Electric", "Grass"], gender: "N", - baseStats: {hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 150}, - abilities: {0: "Soundproof", 1: "Static", H: "Aftermath"}, + baseStats: { hp: 60, atk: 50, def: 70, spa: 80, spd: 80, spe: 150 }, + abilities: { 0: "Soundproof", 1: "Static", H: "Aftermath" }, heightm: 1.2, weightkg: 71, color: "Red", @@ -2315,8 +2315,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 102, name: "Exeggcute", types: ["Grass", "Psychic"], - baseStats: {hp: 60, atk: 40, def: 80, spa: 60, spd: 45, spe: 40}, - abilities: {0: "Chlorophyll", H: "Harvest"}, + baseStats: { hp: 60, atk: 40, def: 80, spa: 60, spd: 45, spe: 40 }, + abilities: { 0: "Chlorophyll", H: "Harvest" }, heightm: 0.4, weightkg: 2.5, color: "Pink", @@ -2327,8 +2327,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 103, name: "Exeggutor", types: ["Grass", "Psychic"], - baseStats: {hp: 95, atk: 95, def: 85, spa: 125, spd: 75, spe: 55}, - abilities: {0: "Chlorophyll", H: "Harvest"}, + baseStats: { hp: 95, atk: 95, def: 85, spa: 125, spd: 75, spe: 55 }, + abilities: { 0: "Chlorophyll", H: "Harvest" }, heightm: 2, weightkg: 120, color: "Yellow", @@ -2345,8 +2345,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Exeggutor", forme: "Alola", types: ["Grass", "Dragon"], - baseStats: {hp: 95, atk: 105, def: 85, spa: 125, spd: 75, spe: 45}, - abilities: {0: "Frisk", H: "Harvest"}, + baseStats: { hp: 95, atk: 105, def: 85, spa: 125, spd: 75, spe: 45 }, + abilities: { 0: "Frisk", H: "Harvest" }, heightm: 10.9, weightkg: 415.6, color: "Yellow", @@ -2360,8 +2360,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 104, name: "Cubone", types: ["Ground"], - baseStats: {hp: 50, atk: 50, def: 95, spa: 40, spd: 50, spe: 35}, - abilities: {0: "Rock Head", 1: "Lightning Rod", H: "Battle Armor"}, + baseStats: { hp: 50, atk: 50, def: 95, spa: 40, spd: 50, spe: 35 }, + abilities: { 0: "Rock Head", 1: "Lightning Rod", H: "Battle Armor" }, heightm: 0.4, weightkg: 6.5, color: "Brown", @@ -2372,8 +2372,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 105, name: "Marowak", types: ["Ground"], - baseStats: {hp: 60, atk: 80, def: 110, spa: 50, spd: 80, spe: 45}, - abilities: {0: "Rock Head", 1: "Lightning Rod", H: "Battle Armor"}, + baseStats: { hp: 60, atk: 80, def: 110, spa: 50, spd: 80, spe: 45 }, + abilities: { 0: "Rock Head", 1: "Lightning Rod", H: "Battle Armor" }, heightm: 1, weightkg: 45, color: "Brown", @@ -2389,8 +2389,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Marowak", forme: "Alola", types: ["Fire", "Ghost"], - baseStats: {hp: 60, atk: 80, def: 110, spa: 50, spd: 80, spe: 45}, - abilities: {0: "Cursed Body", 1: "Lightning Rod", H: "Rock Head"}, + baseStats: { hp: 60, atk: 80, def: 110, spa: 50, spd: 80, spe: 45 }, + abilities: { 0: "Cursed Body", 1: "Lightning Rod", H: "Rock Head" }, heightm: 1, weightkg: 34, color: "Purple", @@ -2406,8 +2406,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Marowak", forme: "Alola-Totem", types: ["Fire", "Ghost"], - baseStats: {hp: 60, atk: 80, def: 110, spa: 50, spd: 80, spe: 45}, - abilities: {0: "Rock Head"}, + baseStats: { hp: 60, atk: 80, def: 110, spa: 50, spd: 80, spe: 45 }, + abilities: { 0: "Rock Head" }, heightm: 1.7, weightkg: 98, color: "Purple", @@ -2418,8 +2418,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Hitmonlee", types: ["Fighting"], gender: "M", - baseStats: {hp: 50, atk: 120, def: 53, spa: 35, spd: 110, spe: 87}, - abilities: {0: "Limber", 1: "Reckless", H: "Unburden"}, + baseStats: { hp: 50, atk: 120, def: 53, spa: 35, spd: 110, spe: 87 }, + abilities: { 0: "Limber", 1: "Reckless", H: "Unburden" }, heightm: 1.5, weightkg: 49.8, color: "Brown", @@ -2433,8 +2433,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Hitmonchan", types: ["Fighting"], gender: "M", - baseStats: {hp: 50, atk: 105, def: 79, spa: 35, spd: 110, spe: 76}, - abilities: {0: "Keen Eye", 1: "Iron Fist", H: "Inner Focus"}, + baseStats: { hp: 50, atk: 105, def: 79, spa: 35, spd: 110, spe: 76 }, + abilities: { 0: "Keen Eye", 1: "Iron Fist", H: "Inner Focus" }, heightm: 1.4, weightkg: 50.2, color: "Brown", @@ -2447,8 +2447,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 108, name: "Lickitung", types: ["Normal"], - baseStats: {hp: 90, atk: 55, def: 75, spa: 60, spd: 75, spe: 30}, - abilities: {0: "Own Tempo", 1: "Oblivious", H: "Cloud Nine"}, + baseStats: { hp: 90, atk: 55, def: 75, spa: 60, spd: 75, spe: 30 }, + abilities: { 0: "Own Tempo", 1: "Oblivious", H: "Cloud Nine" }, heightm: 1.2, weightkg: 65.5, color: "Pink", @@ -2459,8 +2459,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 109, name: "Koffing", types: ["Poison"], - baseStats: {hp: 40, atk: 65, def: 95, spa: 60, spd: 45, spe: 35}, - abilities: {0: "Levitate", 1: "Neutralizing Gas", H: "Stench"}, + baseStats: { hp: 40, atk: 65, def: 95, spa: 60, spd: 45, spe: 35 }, + abilities: { 0: "Levitate", 1: "Neutralizing Gas", H: "Stench" }, heightm: 0.6, weightkg: 1, color: "Purple", @@ -2471,8 +2471,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 110, name: "Weezing", types: ["Poison"], - baseStats: {hp: 65, atk: 90, def: 120, spa: 85, spd: 70, spe: 60}, - abilities: {0: "Levitate", 1: "Neutralizing Gas", H: "Stench"}, + baseStats: { hp: 65, atk: 90, def: 120, spa: 85, spd: 70, spe: 60 }, + abilities: { 0: "Levitate", 1: "Neutralizing Gas", H: "Stench" }, heightm: 1.2, weightkg: 9.5, color: "Purple", @@ -2488,8 +2488,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Weezing", forme: "Galar", types: ["Poison", "Fairy"], - baseStats: {hp: 65, atk: 90, def: 120, spa: 85, spd: 70, spe: 60}, - abilities: {0: "Levitate", 1: "Neutralizing Gas", H: "Misty Surge"}, + baseStats: { hp: 65, atk: 90, def: 120, spa: 85, spd: 70, spe: 60 }, + abilities: { 0: "Levitate", 1: "Neutralizing Gas", H: "Misty Surge" }, heightm: 3, weightkg: 16, color: "Gray", @@ -2502,8 +2502,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 111, name: "Rhyhorn", types: ["Ground", "Rock"], - baseStats: {hp: 80, atk: 85, def: 95, spa: 30, spd: 30, spe: 25}, - abilities: {0: "Lightning Rod", 1: "Rock Head", H: "Reckless"}, + baseStats: { hp: 80, atk: 85, def: 95, spa: 30, spd: 30, spe: 25 }, + abilities: { 0: "Lightning Rod", 1: "Rock Head", H: "Reckless" }, heightm: 1, weightkg: 115, color: "Gray", @@ -2514,8 +2514,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 112, name: "Rhydon", types: ["Ground", "Rock"], - baseStats: {hp: 105, atk: 130, def: 120, spa: 45, spd: 45, spe: 40}, - abilities: {0: "Lightning Rod", 1: "Rock Head", H: "Reckless"}, + baseStats: { hp: 105, atk: 130, def: 120, spa: 45, spd: 45, spe: 40 }, + abilities: { 0: "Lightning Rod", 1: "Rock Head", H: "Reckless" }, heightm: 1.9, weightkg: 120, color: "Gray", @@ -2529,8 +2529,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Chansey", types: ["Normal"], gender: "F", - baseStats: {hp: 250, atk: 5, def: 5, spa: 35, spd: 105, spe: 50}, - abilities: {0: "Natural Cure", 1: "Serene Grace", H: "Healer"}, + baseStats: { hp: 250, atk: 5, def: 5, spa: 35, spd: 105, spe: 50 }, + abilities: { 0: "Natural Cure", 1: "Serene Grace", H: "Healer" }, heightm: 1.1, weightkg: 34.6, color: "Pink", @@ -2546,8 +2546,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 114, name: "Tangela", types: ["Grass"], - baseStats: {hp: 65, atk: 55, def: 115, spa: 100, spd: 40, spe: 60}, - abilities: {0: "Chlorophyll", 1: "Leaf Guard", H: "Regenerator"}, + baseStats: { hp: 65, atk: 55, def: 115, spa: 100, spd: 40, spe: 60 }, + abilities: { 0: "Chlorophyll", 1: "Leaf Guard", H: "Regenerator" }, heightm: 1, weightkg: 35, color: "Blue", @@ -2559,8 +2559,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Kangaskhan", types: ["Normal"], gender: "F", - baseStats: {hp: 105, atk: 95, def: 80, spa: 40, spd: 80, spe: 90}, - abilities: {0: "Early Bird", 1: "Scrappy", H: "Inner Focus"}, + baseStats: { hp: 105, atk: 95, def: 80, spa: 40, spd: 80, spe: 90 }, + abilities: { 0: "Early Bird", 1: "Scrappy", H: "Inner Focus" }, heightm: 2.2, weightkg: 80, color: "Brown", @@ -2575,8 +2575,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega", types: ["Normal"], gender: "F", - baseStats: {hp: 105, atk: 125, def: 100, spa: 60, spd: 100, spe: 100}, - abilities: {0: "Parental Bond"}, + baseStats: { hp: 105, atk: 125, def: 100, spa: 60, spd: 100, spe: 100 }, + abilities: { 0: "Parental Bond" }, heightm: 2.2, weightkg: 100, color: "Brown", @@ -2587,8 +2587,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 116, name: "Horsea", types: ["Water"], - baseStats: {hp: 30, atk: 40, def: 70, spa: 70, spd: 25, spe: 60}, - abilities: {0: "Swift Swim", 1: "Sniper", H: "Damp"}, + baseStats: { hp: 30, atk: 40, def: 70, spa: 70, spd: 25, spe: 60 }, + abilities: { 0: "Swift Swim", 1: "Sniper", H: "Damp" }, heightm: 0.4, weightkg: 8, color: "Blue", @@ -2599,8 +2599,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 117, name: "Seadra", types: ["Water"], - baseStats: {hp: 55, atk: 65, def: 95, spa: 95, spd: 45, spe: 85}, - abilities: {0: "Poison Point", 1: "Sniper", H: "Damp"}, + baseStats: { hp: 55, atk: 65, def: 95, spa: 95, spd: 45, spe: 85 }, + abilities: { 0: "Poison Point", 1: "Sniper", H: "Damp" }, heightm: 1.2, weightkg: 25, color: "Blue", @@ -2613,8 +2613,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 118, name: "Goldeen", types: ["Water"], - baseStats: {hp: 45, atk: 67, def: 60, spa: 35, spd: 50, spe: 63}, - abilities: {0: "Swift Swim", 1: "Water Veil", H: "Lightning Rod"}, + baseStats: { hp: 45, atk: 67, def: 60, spa: 35, spd: 50, spe: 63 }, + abilities: { 0: "Swift Swim", 1: "Water Veil", H: "Lightning Rod" }, heightm: 0.6, weightkg: 15, color: "Red", @@ -2625,8 +2625,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 119, name: "Seaking", types: ["Water"], - baseStats: {hp: 80, atk: 92, def: 65, spa: 65, spd: 80, spe: 68}, - abilities: {0: "Swift Swim", 1: "Water Veil", H: "Lightning Rod"}, + baseStats: { hp: 80, atk: 92, def: 65, spa: 65, spd: 80, spe: 68 }, + abilities: { 0: "Swift Swim", 1: "Water Veil", H: "Lightning Rod" }, heightm: 1.3, weightkg: 39, color: "Red", @@ -2639,8 +2639,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Staryu", types: ["Water"], gender: "N", - baseStats: {hp: 30, atk: 45, def: 55, spa: 70, spd: 55, spe: 85}, - abilities: {0: "Illuminate", 1: "Natural Cure", H: "Analytic"}, + baseStats: { hp: 30, atk: 45, def: 55, spa: 70, spd: 55, spe: 85 }, + abilities: { 0: "Illuminate", 1: "Natural Cure", H: "Analytic" }, heightm: 0.8, weightkg: 34.5, color: "Brown", @@ -2652,8 +2652,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Starmie", types: ["Water", "Psychic"], gender: "N", - baseStats: {hp: 60, atk: 75, def: 85, spa: 100, spd: 85, spe: 115}, - abilities: {0: "Illuminate", 1: "Natural Cure", H: "Analytic"}, + baseStats: { hp: 60, atk: 75, def: 85, spa: 100, spd: 85, spe: 115 }, + abilities: { 0: "Illuminate", 1: "Natural Cure", H: "Analytic" }, heightm: 1.1, weightkg: 80, color: "Purple", @@ -2666,8 +2666,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 122, name: "Mr. Mime", types: ["Psychic", "Fairy"], - baseStats: {hp: 40, atk: 45, def: 65, spa: 100, spd: 120, spe: 90}, - abilities: {0: "Soundproof", 1: "Filter", H: "Technician"}, + baseStats: { hp: 40, atk: 45, def: 65, spa: 100, spd: 120, spe: 90 }, + abilities: { 0: "Soundproof", 1: "Filter", H: "Technician" }, heightm: 1.3, weightkg: 54.5, color: "Pink", @@ -2685,8 +2685,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Mr. Mime", forme: "Galar", types: ["Ice", "Psychic"], - baseStats: {hp: 50, atk: 65, def: 65, spa: 90, spd: 90, spe: 100}, - abilities: {0: "Vital Spirit", 1: "Screen Cleaner", H: "Ice Body"}, + baseStats: { hp: 50, atk: 65, def: 65, spa: 90, spd: 90, spe: 100 }, + abilities: { 0: "Vital Spirit", 1: "Screen Cleaner", H: "Ice Body" }, heightm: 1.4, weightkg: 56.8, color: "White", @@ -2702,8 +2702,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 123, name: "Scyther", types: ["Bug", "Flying"], - baseStats: {hp: 70, atk: 110, def: 80, spa: 55, spd: 80, spe: 105}, - abilities: {0: "Swarm", 1: "Technician", H: "Steadfast"}, + baseStats: { hp: 70, atk: 110, def: 80, spa: 55, spd: 80, spe: 105 }, + abilities: { 0: "Swarm", 1: "Technician", H: "Steadfast" }, heightm: 1.5, weightkg: 56, color: "Green", @@ -2715,8 +2715,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Jynx", types: ["Ice", "Psychic"], gender: "F", - baseStats: {hp: 65, atk: 50, def: 35, spa: 115, spd: 95, spe: 95}, - abilities: {0: "Oblivious", 1: "Forewarn", H: "Dry Skin"}, + baseStats: { hp: 65, atk: 50, def: 35, spa: 115, spd: 95, spe: 95 }, + abilities: { 0: "Oblivious", 1: "Forewarn", H: "Dry Skin" }, heightm: 1.4, weightkg: 40.6, color: "Red", @@ -2728,9 +2728,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 125, name: "Electabuzz", types: ["Electric"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 65, atk: 83, def: 57, spa: 95, spd: 85, spe: 105}, - abilities: {0: "Static", H: "Vital Spirit"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 65, atk: 83, def: 57, spa: 95, spd: 85, spe: 105 }, + abilities: { 0: "Static", H: "Vital Spirit" }, heightm: 1.1, weightkg: 30, color: "Yellow", @@ -2743,9 +2743,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 126, name: "Magmar", types: ["Fire"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 65, atk: 95, def: 57, spa: 100, spd: 85, spe: 93}, - abilities: {0: "Flame Body", H: "Vital Spirit"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 65, atk: 95, def: 57, spa: 100, spd: 85, spe: 93 }, + abilities: { 0: "Flame Body", H: "Vital Spirit" }, heightm: 1.3, weightkg: 44.5, color: "Red", @@ -2758,8 +2758,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 127, name: "Pinsir", types: ["Bug"], - baseStats: {hp: 65, atk: 125, def: 100, spa: 55, spd: 70, spe: 85}, - abilities: {0: "Hyper Cutter", 1: "Mold Breaker", H: "Moxie"}, + baseStats: { hp: 65, atk: 125, def: 100, spa: 55, spd: 70, spe: 85 }, + abilities: { 0: "Hyper Cutter", 1: "Mold Breaker", H: "Moxie" }, heightm: 1.5, weightkg: 55, color: "Brown", @@ -2773,8 +2773,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pinsir", forme: "Mega", types: ["Bug", "Flying"], - baseStats: {hp: 65, atk: 155, def: 120, spa: 65, spd: 90, spe: 105}, - abilities: {0: "Aerilate"}, + baseStats: { hp: 65, atk: 155, def: 120, spa: 65, spd: 90, spe: 105 }, + abilities: { 0: "Aerilate" }, heightm: 1.7, weightkg: 59, color: "Brown", @@ -2786,8 +2786,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tauros", types: ["Normal"], gender: "M", - baseStats: {hp: 75, atk: 100, def: 95, spa: 40, spd: 70, spe: 110}, - abilities: {0: "Intimidate", 1: "Anger Point", H: "Sheer Force"}, + baseStats: { hp: 75, atk: 100, def: 95, spa: 40, spd: 70, spe: 110 }, + abilities: { 0: "Intimidate", 1: "Anger Point", H: "Sheer Force" }, heightm: 1.4, weightkg: 88.4, color: "Brown", @@ -2802,8 +2802,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Paldea-Combat", types: ["Fighting"], gender: "M", - baseStats: {hp: 75, atk: 110, def: 105, spa: 30, spd: 70, spe: 100}, - abilities: {0: "Intimidate", 1: "Anger Point", H: "Cud Chew"}, + baseStats: { hp: 75, atk: 110, def: 105, spa: 30, spd: 70, spe: 100 }, + abilities: { 0: "Intimidate", 1: "Anger Point", H: "Cud Chew" }, heightm: 1.4, weightkg: 115, color: "Black", @@ -2816,8 +2816,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Paldea-Blaze", types: ["Fighting", "Fire"], gender: "M", - baseStats: {hp: 75, atk: 110, def: 105, spa: 30, spd: 70, spe: 100}, - abilities: {0: "Intimidate", 1: "Anger Point", H: "Cud Chew"}, + baseStats: { hp: 75, atk: 110, def: 105, spa: 30, spd: 70, spe: 100 }, + abilities: { 0: "Intimidate", 1: "Anger Point", H: "Cud Chew" }, heightm: 1.4, weightkg: 85, color: "Black", @@ -2830,8 +2830,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Paldea-Aqua", types: ["Fighting", "Water"], gender: "M", - baseStats: {hp: 75, atk: 110, def: 105, spa: 30, spd: 70, spe: 100}, - abilities: {0: "Intimidate", 1: "Anger Point", H: "Cud Chew"}, + baseStats: { hp: 75, atk: 110, def: 105, spa: 30, spd: 70, spe: 100 }, + abilities: { 0: "Intimidate", 1: "Anger Point", H: "Cud Chew" }, heightm: 1.4, weightkg: 110, color: "Black", @@ -2841,8 +2841,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 129, name: "Magikarp", types: ["Water"], - baseStats: {hp: 20, atk: 10, def: 55, spa: 15, spd: 20, spe: 80}, - abilities: {0: "Swift Swim", H: "Rattled"}, + baseStats: { hp: 20, atk: 10, def: 55, spa: 15, spd: 20, spe: 80 }, + abilities: { 0: "Swift Swim", H: "Rattled" }, heightm: 0.9, weightkg: 10, color: "Red", @@ -2853,8 +2853,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 130, name: "Gyarados", types: ["Water", "Flying"], - baseStats: {hp: 95, atk: 125, def: 79, spa: 60, spd: 100, spe: 81}, - abilities: {0: "Intimidate", H: "Moxie"}, + baseStats: { hp: 95, atk: 125, def: 79, spa: 60, spd: 100, spe: 81 }, + abilities: { 0: "Intimidate", H: "Moxie" }, heightm: 6.5, weightkg: 235, color: "Blue", @@ -2870,8 +2870,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gyarados", forme: "Mega", types: ["Water", "Dark"], - baseStats: {hp: 95, atk: 155, def: 109, spa: 70, spd: 130, spe: 81}, - abilities: {0: "Mold Breaker"}, + baseStats: { hp: 95, atk: 155, def: 109, spa: 70, spd: 130, spe: 81 }, + abilities: { 0: "Mold Breaker" }, heightm: 6.5, weightkg: 305, color: "Blue", @@ -2882,8 +2882,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 131, name: "Lapras", types: ["Water", "Ice"], - baseStats: {hp: 130, atk: 85, def: 80, spa: 85, spd: 95, spe: 60}, - abilities: {0: "Water Absorb", 1: "Shell Armor", H: "Hydration"}, + baseStats: { hp: 130, atk: 85, def: 80, spa: 85, spd: 95, spe: 60 }, + abilities: { 0: "Water Absorb", 1: "Shell Armor", H: "Hydration" }, heightm: 2.5, weightkg: 220, color: "Blue", @@ -2896,8 +2896,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Lapras", forme: "Gmax", types: ["Water", "Ice"], - baseStats: {hp: 130, atk: 85, def: 80, spa: 85, spd: 95, spe: 60}, - abilities: {0: "Water Absorb", 1: "Shell Armor", H: "Hydration"}, + baseStats: { hp: 130, atk: 85, def: 80, spa: 85, spd: 95, spe: 60 }, + abilities: { 0: "Water Absorb", 1: "Shell Armor", H: "Hydration" }, heightm: 24, weightkg: 0, color: "Blue", @@ -2909,8 +2909,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Ditto", types: ["Normal"], gender: "N", - baseStats: {hp: 48, atk: 48, def: 48, spa: 48, spd: 48, spe: 48}, - abilities: {0: "Limber", H: "Imposter"}, + baseStats: { hp: 48, atk: 48, def: 48, spa: 48, spd: 48, spe: 48 }, + abilities: { 0: "Limber", H: "Imposter" }, heightm: 0.3, weightkg: 4, color: "Purple", @@ -2920,9 +2920,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 133, name: "Eevee", types: ["Normal"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 55, def: 50, spa: 45, spd: 65, spe: 55}, - abilities: {0: "Run Away", 1: "Adaptability", H: "Anticipation"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 55, def: 50, spa: 45, spd: 65, spe: 55 }, + abilities: { 0: "Run Away", 1: "Adaptability", H: "Anticipation" }, heightm: 0.3, weightkg: 6.5, color: "Brown", @@ -2938,9 +2938,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Eevee", forme: "Starter", types: ["Normal"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 75, def: 70, spa: 65, spd: 85, spe: 75}, - abilities: {0: "Run Away", 1: "Adaptability", H: "Anticipation"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 75, def: 70, spa: 65, spd: 85, spe: 75 }, + abilities: { 0: "Run Away", 1: "Adaptability", H: "Anticipation" }, heightm: 0.3, weightkg: 6.5, color: "Brown", @@ -2952,9 +2952,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Eevee", forme: "Gmax", types: ["Normal"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 55, def: 50, spa: 45, spd: 65, spe: 55}, - abilities: {0: "Run Away", 1: "Adaptability", H: "Anticipation"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 55, def: 50, spa: 45, spd: 65, spe: 55 }, + abilities: { 0: "Run Away", 1: "Adaptability", H: "Anticipation" }, heightm: 18, weightkg: 0, color: "Brown", @@ -2965,9 +2965,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 134, name: "Vaporeon", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 130, atk: 65, def: 60, spa: 110, spd: 95, spe: 65}, - abilities: {0: "Water Absorb", H: "Hydration"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 130, atk: 65, def: 60, spa: 110, spd: 95, spe: 65 }, + abilities: { 0: "Water Absorb", H: "Hydration" }, heightm: 1, weightkg: 29, color: "Blue", @@ -2980,9 +2980,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 135, name: "Jolteon", types: ["Electric"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 65, def: 60, spa: 110, spd: 95, spe: 130}, - abilities: {0: "Volt Absorb", H: "Quick Feet"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 65, def: 60, spa: 110, spd: 95, spe: 130 }, + abilities: { 0: "Volt Absorb", H: "Quick Feet" }, heightm: 0.8, weightkg: 24.5, color: "Yellow", @@ -2995,9 +2995,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 136, name: "Flareon", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 130, def: 60, spa: 95, spd: 110, spe: 65}, - abilities: {0: "Flash Fire", H: "Guts"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 130, def: 60, spa: 95, spd: 110, spe: 65 }, + abilities: { 0: "Flash Fire", H: "Guts" }, heightm: 0.9, weightkg: 25, color: "Red", @@ -3011,8 +3011,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Porygon", types: ["Normal"], gender: "N", - baseStats: {hp: 65, atk: 60, def: 70, spa: 85, spd: 75, spe: 40}, - abilities: {0: "Trace", 1: "Download", H: "Analytic"}, + baseStats: { hp: 65, atk: 60, def: 70, spa: 85, spd: 75, spe: 40 }, + abilities: { 0: "Trace", 1: "Download", H: "Analytic" }, heightm: 0.8, weightkg: 36.5, color: "Pink", @@ -3023,9 +3023,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 138, name: "Omanyte", types: ["Rock", "Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 35, atk: 40, def: 100, spa: 90, spd: 55, spe: 35}, - abilities: {0: "Swift Swim", 1: "Shell Armor", H: "Weak Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 35, atk: 40, def: 100, spa: 90, spd: 55, spe: 35 }, + abilities: { 0: "Swift Swim", 1: "Shell Armor", H: "Weak Armor" }, heightm: 0.4, weightkg: 7.5, color: "Blue", @@ -3036,9 +3036,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 139, name: "Omastar", types: ["Rock", "Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 60, def: 125, spa: 115, spd: 70, spe: 55}, - abilities: {0: "Swift Swim", 1: "Shell Armor", H: "Weak Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 60, def: 125, spa: 115, spd: 70, spe: 55 }, + abilities: { 0: "Swift Swim", 1: "Shell Armor", H: "Weak Armor" }, heightm: 1, weightkg: 35, color: "Blue", @@ -3050,9 +3050,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 140, name: "Kabuto", types: ["Rock", "Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 30, atk: 80, def: 90, spa: 55, spd: 45, spe: 55}, - abilities: {0: "Swift Swim", 1: "Battle Armor", H: "Weak Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 30, atk: 80, def: 90, spa: 55, spd: 45, spe: 55 }, + abilities: { 0: "Swift Swim", 1: "Battle Armor", H: "Weak Armor" }, heightm: 0.5, weightkg: 11.5, color: "Brown", @@ -3063,9 +3063,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 141, name: "Kabutops", types: ["Rock", "Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 115, def: 105, spa: 65, spd: 70, spe: 80}, - abilities: {0: "Swift Swim", 1: "Battle Armor", H: "Weak Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 115, def: 105, spa: 65, spd: 70, spe: 80 }, + abilities: { 0: "Swift Swim", 1: "Battle Armor", H: "Weak Armor" }, heightm: 1.3, weightkg: 40.5, color: "Brown", @@ -3077,9 +3077,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 142, name: "Aerodactyl", types: ["Rock", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 105, def: 65, spa: 60, spd: 75, spe: 130}, - abilities: {0: "Rock Head", 1: "Pressure", H: "Unnerve"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 105, def: 65, spa: 60, spd: 75, spe: 130 }, + abilities: { 0: "Rock Head", 1: "Pressure", H: "Unnerve" }, heightm: 1.8, weightkg: 59, color: "Purple", @@ -3093,9 +3093,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Aerodactyl", forme: "Mega", types: ["Rock", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 135, def: 85, spa: 70, spd: 95, spe: 150}, - abilities: {0: "Tough Claws"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 135, def: 85, spa: 70, spd: 95, spe: 150 }, + abilities: { 0: "Tough Claws" }, heightm: 2.1, weightkg: 79, color: "Purple", @@ -3106,9 +3106,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 143, name: "Snorlax", types: ["Normal"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 160, atk: 110, def: 65, spa: 65, spd: 110, spe: 30}, - abilities: {0: "Immunity", 1: "Thick Fat", H: "Gluttony"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 160, atk: 110, def: 65, spa: 65, spd: 110, spe: 30 }, + abilities: { 0: "Immunity", 1: "Thick Fat", H: "Gluttony" }, heightm: 2.1, weightkg: 460, color: "Black", @@ -3124,9 +3124,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Snorlax", forme: "Gmax", types: ["Normal"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 160, atk: 110, def: 65, spa: 65, spd: 110, spe: 30}, - abilities: {0: "Immunity", 1: "Thick Fat", H: "Gluttony"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 160, atk: 110, def: 65, spa: 65, spd: 110, spe: 30 }, + abilities: { 0: "Immunity", 1: "Thick Fat", H: "Gluttony" }, heightm: 35, weightkg: 0, color: "Black", @@ -3138,8 +3138,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Articuno", types: ["Ice", "Flying"], gender: "N", - baseStats: {hp: 90, atk: 85, def: 100, spa: 95, spd: 125, spe: 85}, - abilities: {0: "Pressure", H: "Snow Cloak"}, + baseStats: { hp: 90, atk: 85, def: 100, spa: 95, spd: 125, spe: 85 }, + abilities: { 0: "Pressure", H: "Snow Cloak" }, heightm: 1.7, weightkg: 55.4, color: "Blue", @@ -3155,8 +3155,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Galar", types: ["Psychic", "Flying"], gender: "N", - baseStats: {hp: 90, atk: 85, def: 85, spa: 125, spd: 100, spe: 95}, - abilities: {0: "Competitive"}, + baseStats: { hp: 90, atk: 85, def: 85, spa: 125, spd: 100, spe: 95 }, + abilities: { 0: "Competitive" }, heightm: 1.7, weightkg: 50.9, color: "Purple", @@ -3167,8 +3167,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Zapdos", types: ["Electric", "Flying"], gender: "N", - baseStats: {hp: 90, atk: 90, def: 85, spa: 125, spd: 90, spe: 100}, - abilities: {0: "Pressure", H: "Static"}, + baseStats: { hp: 90, atk: 90, def: 85, spa: 125, spd: 90, spe: 100 }, + abilities: { 0: "Pressure", H: "Static" }, heightm: 1.6, weightkg: 52.6, color: "Yellow", @@ -3184,8 +3184,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Galar", types: ["Fighting", "Flying"], gender: "N", - baseStats: {hp: 90, atk: 125, def: 90, spa: 85, spd: 90, spe: 100}, - abilities: {0: "Defiant"}, + baseStats: { hp: 90, atk: 125, def: 90, spa: 85, spd: 90, spe: 100 }, + abilities: { 0: "Defiant" }, heightm: 1.6, weightkg: 58.2, color: "Yellow", @@ -3196,8 +3196,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Moltres", types: ["Fire", "Flying"], gender: "N", - baseStats: {hp: 90, atk: 100, def: 90, spa: 125, spd: 85, spe: 90}, - abilities: {0: "Pressure", H: "Flame Body"}, + baseStats: { hp: 90, atk: 100, def: 90, spa: 125, spd: 85, spe: 90 }, + abilities: { 0: "Pressure", H: "Flame Body" }, heightm: 2, weightkg: 60, color: "Yellow", @@ -3213,8 +3213,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Galar", types: ["Dark", "Flying"], gender: "N", - baseStats: {hp: 90, atk: 85, def: 90, spa: 100, spd: 125, spe: 90}, - abilities: {0: "Berserk"}, + baseStats: { hp: 90, atk: 85, def: 90, spa: 100, spd: 125, spe: 90 }, + abilities: { 0: "Berserk" }, heightm: 2, weightkg: 66, color: "Red", @@ -3224,8 +3224,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 147, name: "Dratini", types: ["Dragon"], - baseStats: {hp: 41, atk: 64, def: 45, spa: 50, spd: 50, spe: 50}, - abilities: {0: "Shed Skin", H: "Marvel Scale"}, + baseStats: { hp: 41, atk: 64, def: 45, spa: 50, spd: 50, spe: 50 }, + abilities: { 0: "Shed Skin", H: "Marvel Scale" }, heightm: 1.8, weightkg: 3.3, color: "Blue", @@ -3236,8 +3236,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 148, name: "Dragonair", types: ["Dragon"], - baseStats: {hp: 61, atk: 84, def: 65, spa: 70, spd: 70, spe: 70}, - abilities: {0: "Shed Skin", H: "Marvel Scale"}, + baseStats: { hp: 61, atk: 84, def: 65, spa: 70, spd: 70, spe: 70 }, + abilities: { 0: "Shed Skin", H: "Marvel Scale" }, heightm: 4, weightkg: 16.5, color: "Blue", @@ -3250,8 +3250,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 149, name: "Dragonite", types: ["Dragon", "Flying"], - baseStats: {hp: 91, atk: 134, def: 95, spa: 100, spd: 100, spe: 80}, - abilities: {0: "Inner Focus", H: "Multiscale"}, + baseStats: { hp: 91, atk: 134, def: 95, spa: 100, spd: 100, spe: 80 }, + abilities: { 0: "Inner Focus", H: "Multiscale" }, heightm: 2.2, weightkg: 210, color: "Brown", @@ -3264,8 +3264,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Mewtwo", types: ["Psychic"], gender: "N", - baseStats: {hp: 106, atk: 110, def: 90, spa: 154, spd: 90, spe: 130}, - abilities: {0: "Pressure", H: "Unnerve"}, + baseStats: { hp: 106, atk: 110, def: 90, spa: 154, spd: 90, spe: 130 }, + abilities: { 0: "Pressure", H: "Unnerve" }, heightm: 2, weightkg: 122, color: "Purple", @@ -3281,8 +3281,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega-X", types: ["Psychic", "Fighting"], gender: "N", - baseStats: {hp: 106, atk: 190, def: 100, spa: 154, spd: 100, spe: 130}, - abilities: {0: "Steadfast"}, + baseStats: { hp: 106, atk: 190, def: 100, spa: 154, spd: 100, spe: 130 }, + abilities: { 0: "Steadfast" }, heightm: 2.3, weightkg: 127, color: "Purple", @@ -3296,8 +3296,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega-Y", types: ["Psychic"], gender: "N", - baseStats: {hp: 106, atk: 150, def: 70, spa: 194, spd: 120, spe: 140}, - abilities: {0: "Insomnia"}, + baseStats: { hp: 106, atk: 150, def: 70, spa: 194, spd: 120, spe: 140 }, + abilities: { 0: "Insomnia" }, heightm: 1.5, weightkg: 33, color: "Purple", @@ -3309,8 +3309,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Mew", types: ["Psychic"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Synchronize"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Synchronize" }, heightm: 0.4, weightkg: 4, color: "Pink", @@ -3321,9 +3321,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 152, name: "Chikorita", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 45, atk: 49, def: 65, spa: 49, spd: 65, spe: 45}, - abilities: {0: "Overgrow", H: "Leaf Guard"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 45, atk: 49, def: 65, spa: 49, spd: 65, spe: 45 }, + abilities: { 0: "Overgrow", H: "Leaf Guard" }, heightm: 0.9, weightkg: 6.4, color: "Green", @@ -3334,9 +3334,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 153, name: "Bayleef", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 62, def: 80, spa: 63, spd: 80, spe: 60}, - abilities: {0: "Overgrow", H: "Leaf Guard"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 62, def: 80, spa: 63, spd: 80, spe: 60 }, + abilities: { 0: "Overgrow", H: "Leaf Guard" }, heightm: 1.2, weightkg: 15.8, color: "Green", @@ -3349,9 +3349,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 154, name: "Meganium", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 82, def: 100, spa: 83, spd: 100, spe: 80}, - abilities: {0: "Overgrow", H: "Leaf Guard"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 82, def: 100, spa: 83, spd: 100, spe: 80 }, + abilities: { 0: "Overgrow", H: "Leaf Guard" }, heightm: 1.8, weightkg: 100.5, color: "Green", @@ -3363,9 +3363,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 155, name: "Cyndaquil", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 39, atk: 52, def: 43, spa: 60, spd: 50, spe: 65}, - abilities: {0: "Blaze", H: "Flash Fire"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 39, atk: 52, def: 43, spa: 60, spd: 50, spe: 65 }, + abilities: { 0: "Blaze", H: "Flash Fire" }, heightm: 0.5, weightkg: 7.9, color: "Yellow", @@ -3376,9 +3376,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 156, name: "Quilava", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 58, atk: 64, def: 58, spa: 80, spd: 65, spe: 80}, - abilities: {0: "Blaze", H: "Flash Fire"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 58, atk: 64, def: 58, spa: 80, spd: 65, spe: 80 }, + abilities: { 0: "Blaze", H: "Flash Fire" }, heightm: 0.9, weightkg: 19, color: "Yellow", @@ -3391,9 +3391,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 157, name: "Typhlosion", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 78, atk: 84, def: 78, spa: 109, spd: 85, spe: 100}, - abilities: {0: "Blaze", H: "Flash Fire"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 78, atk: 84, def: 78, spa: 109, spd: 85, spe: 100 }, + abilities: { 0: "Blaze", H: "Flash Fire" }, heightm: 1.7, weightkg: 79.5, color: "Yellow", @@ -3409,9 +3409,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Typhlosion", forme: "Hisui", types: ["Fire", "Ghost"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 73, atk: 84, def: 78, spa: 119, spd: 85, spe: 95}, - abilities: {0: "Blaze", H: "Frisk"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 73, atk: 84, def: 78, spa: 119, spd: 85, spe: 95 }, + abilities: { 0: "Blaze", H: "Frisk" }, heightm: 1.6, weightkg: 69.8, color: "Yellow", @@ -3423,9 +3423,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 158, name: "Totodile", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 65, def: 64, spa: 44, spd: 48, spe: 43}, - abilities: {0: "Torrent", H: "Sheer Force"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 65, def: 64, spa: 44, spd: 48, spe: 43 }, + abilities: { 0: "Torrent", H: "Sheer Force" }, heightm: 0.6, weightkg: 9.5, color: "Blue", @@ -3436,9 +3436,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 159, name: "Croconaw", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 80, def: 80, spa: 59, spd: 63, spe: 58}, - abilities: {0: "Torrent", H: "Sheer Force"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 80, def: 80, spa: 59, spd: 63, spe: 58 }, + abilities: { 0: "Torrent", H: "Sheer Force" }, heightm: 1.1, weightkg: 25, color: "Blue", @@ -3451,9 +3451,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 160, name: "Feraligatr", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 85, atk: 105, def: 100, spa: 79, spd: 83, spe: 78}, - abilities: {0: "Torrent", H: "Sheer Force"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 85, atk: 105, def: 100, spa: 79, spd: 83, spe: 78 }, + abilities: { 0: "Torrent", H: "Sheer Force" }, heightm: 2.3, weightkg: 88.8, color: "Blue", @@ -3465,8 +3465,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 161, name: "Sentret", types: ["Normal"], - baseStats: {hp: 35, atk: 46, def: 34, spa: 35, spd: 45, spe: 20}, - abilities: {0: "Run Away", 1: "Keen Eye", H: "Frisk"}, + baseStats: { hp: 35, atk: 46, def: 34, spa: 35, spd: 45, spe: 20 }, + abilities: { 0: "Run Away", 1: "Keen Eye", H: "Frisk" }, heightm: 0.8, weightkg: 6, color: "Brown", @@ -3477,8 +3477,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 162, name: "Furret", types: ["Normal"], - baseStats: {hp: 85, atk: 76, def: 64, spa: 45, spd: 55, spe: 90}, - abilities: {0: "Run Away", 1: "Keen Eye", H: "Frisk"}, + baseStats: { hp: 85, atk: 76, def: 64, spa: 45, spd: 55, spe: 90 }, + abilities: { 0: "Run Away", 1: "Keen Eye", H: "Frisk" }, heightm: 1.8, weightkg: 32.5, color: "Brown", @@ -3490,8 +3490,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 163, name: "Hoothoot", types: ["Normal", "Flying"], - baseStats: {hp: 60, atk: 30, def: 30, spa: 36, spd: 56, spe: 50}, - abilities: {0: "Insomnia", 1: "Keen Eye", H: "Tinted Lens"}, + baseStats: { hp: 60, atk: 30, def: 30, spa: 36, spd: 56, spe: 50 }, + abilities: { 0: "Insomnia", 1: "Keen Eye", H: "Tinted Lens" }, heightm: 0.7, weightkg: 21.2, color: "Brown", @@ -3502,8 +3502,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 164, name: "Noctowl", types: ["Normal", "Flying"], - baseStats: {hp: 100, atk: 50, def: 50, spa: 86, spd: 96, spe: 70}, - abilities: {0: "Insomnia", 1: "Keen Eye", H: "Tinted Lens"}, + baseStats: { hp: 100, atk: 50, def: 50, spa: 86, spd: 96, spe: 70 }, + abilities: { 0: "Insomnia", 1: "Keen Eye", H: "Tinted Lens" }, heightm: 1.6, weightkg: 40.8, color: "Brown", @@ -3515,8 +3515,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 165, name: "Ledyba", types: ["Bug", "Flying"], - baseStats: {hp: 40, atk: 20, def: 30, spa: 40, spd: 80, spe: 55}, - abilities: {0: "Swarm", 1: "Early Bird", H: "Rattled"}, + baseStats: { hp: 40, atk: 20, def: 30, spa: 40, spd: 80, spe: 55 }, + abilities: { 0: "Swarm", 1: "Early Bird", H: "Rattled" }, heightm: 1, weightkg: 10.8, color: "Red", @@ -3527,8 +3527,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 166, name: "Ledian", types: ["Bug", "Flying"], - baseStats: {hp: 55, atk: 35, def: 50, spa: 55, spd: 110, spe: 85}, - abilities: {0: "Swarm", 1: "Early Bird", H: "Iron Fist"}, + baseStats: { hp: 55, atk: 35, def: 50, spa: 55, spd: 110, spe: 85 }, + abilities: { 0: "Swarm", 1: "Early Bird", H: "Iron Fist" }, heightm: 1.4, weightkg: 35.6, color: "Red", @@ -3540,8 +3540,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 167, name: "Spinarak", types: ["Bug", "Poison"], - baseStats: {hp: 40, atk: 60, def: 40, spa: 40, spd: 40, spe: 30}, - abilities: {0: "Swarm", 1: "Insomnia", H: "Sniper"}, + baseStats: { hp: 40, atk: 60, def: 40, spa: 40, spd: 40, spe: 30 }, + abilities: { 0: "Swarm", 1: "Insomnia", H: "Sniper" }, heightm: 0.5, weightkg: 8.5, color: "Green", @@ -3552,8 +3552,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 168, name: "Ariados", types: ["Bug", "Poison"], - baseStats: {hp: 70, atk: 90, def: 70, spa: 60, spd: 70, spe: 40}, - abilities: {0: "Swarm", 1: "Insomnia", H: "Sniper"}, + baseStats: { hp: 70, atk: 90, def: 70, spa: 60, spd: 70, spe: 40 }, + abilities: { 0: "Swarm", 1: "Insomnia", H: "Sniper" }, heightm: 1.1, weightkg: 33.5, color: "Red", @@ -3565,8 +3565,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 169, name: "Crobat", types: ["Poison", "Flying"], - baseStats: {hp: 85, atk: 90, def: 80, spa: 70, spd: 80, spe: 130}, - abilities: {0: "Inner Focus", H: "Infiltrator"}, + baseStats: { hp: 85, atk: 90, def: 80, spa: 70, spd: 80, spe: 130 }, + abilities: { 0: "Inner Focus", H: "Infiltrator" }, heightm: 1.8, weightkg: 75, color: "Purple", @@ -3578,8 +3578,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 170, name: "Chinchou", types: ["Water", "Electric"], - baseStats: {hp: 75, atk: 38, def: 38, spa: 56, spd: 56, spe: 67}, - abilities: {0: "Volt Absorb", 1: "Illuminate", H: "Water Absorb"}, + baseStats: { hp: 75, atk: 38, def: 38, spa: 56, spd: 56, spe: 67 }, + abilities: { 0: "Volt Absorb", 1: "Illuminate", H: "Water Absorb" }, heightm: 0.5, weightkg: 12, color: "Blue", @@ -3590,8 +3590,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 171, name: "Lanturn", types: ["Water", "Electric"], - baseStats: {hp: 125, atk: 58, def: 58, spa: 76, spd: 76, spe: 67}, - abilities: {0: "Volt Absorb", 1: "Illuminate", H: "Water Absorb"}, + baseStats: { hp: 125, atk: 58, def: 58, spa: 76, spd: 76, spe: 67 }, + abilities: { 0: "Volt Absorb", 1: "Illuminate", H: "Water Absorb" }, heightm: 1.2, weightkg: 22.5, color: "Blue", @@ -3603,8 +3603,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 172, name: "Pichu", types: ["Electric"], - baseStats: {hp: 20, atk: 40, def: 15, spa: 35, spd: 35, spe: 60}, - abilities: {0: "Static", H: "Lightning Rod"}, + baseStats: { hp: 20, atk: 40, def: 15, spa: 35, spd: 35, spe: 60 }, + abilities: { 0: "Static", H: "Lightning Rod" }, heightm: 0.3, weightkg: 2, color: "Yellow", @@ -3620,8 +3620,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pichu", forme: "Spiky-eared", types: ["Electric"], - baseStats: {hp: 20, atk: 40, def: 15, spa: 35, spd: 35, spe: 60}, - abilities: {0: "Static"}, + baseStats: { hp: 20, atk: 40, def: 15, spa: 35, spd: 35, spe: 60 }, + abilities: { 0: "Static" }, heightm: 0.3, weightkg: 2, color: "Yellow", @@ -3632,9 +3632,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 173, name: "Cleffa", types: ["Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 50, atk: 25, def: 28, spa: 45, spd: 55, spe: 15}, - abilities: {0: "Cute Charm", 1: "Magic Guard", H: "Friend Guard"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 50, atk: 25, def: 28, spa: 45, spd: 55, spe: 15 }, + abilities: { 0: "Cute Charm", 1: "Magic Guard", H: "Friend Guard" }, heightm: 0.3, weightkg: 3, color: "Pink", @@ -3646,9 +3646,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 174, name: "Igglybuff", types: ["Normal", "Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 90, atk: 30, def: 15, spa: 40, spd: 20, spe: 15}, - abilities: {0: "Cute Charm", 1: "Competitive", H: "Friend Guard"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 90, atk: 30, def: 15, spa: 40, spd: 20, spe: 15 }, + abilities: { 0: "Cute Charm", 1: "Competitive", H: "Friend Guard" }, heightm: 0.3, weightkg: 1, color: "Pink", @@ -3660,9 +3660,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 175, name: "Togepi", types: ["Fairy"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 35, atk: 20, def: 65, spa: 40, spd: 65, spe: 20}, - abilities: {0: "Hustle", 1: "Serene Grace", H: "Super Luck"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 35, atk: 20, def: 65, spa: 40, spd: 65, spe: 20 }, + abilities: { 0: "Hustle", 1: "Serene Grace", H: "Super Luck" }, heightm: 0.3, weightkg: 1.5, color: "White", @@ -3674,9 +3674,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 176, name: "Togetic", types: ["Fairy", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 40, def: 85, spa: 80, spd: 105, spe: 40}, - abilities: {0: "Hustle", 1: "Serene Grace", H: "Super Luck"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 40, def: 85, spa: 80, spd: 105, spe: 40 }, + abilities: { 0: "Hustle", 1: "Serene Grace", H: "Super Luck" }, heightm: 0.6, weightkg: 3.2, color: "White", @@ -3689,8 +3689,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 177, name: "Natu", types: ["Psychic", "Flying"], - baseStats: {hp: 40, atk: 50, def: 45, spa: 70, spd: 45, spe: 70}, - abilities: {0: "Synchronize", 1: "Early Bird", H: "Magic Bounce"}, + baseStats: { hp: 40, atk: 50, def: 45, spa: 70, spd: 45, spe: 70 }, + abilities: { 0: "Synchronize", 1: "Early Bird", H: "Magic Bounce" }, heightm: 0.2, weightkg: 2, color: "Green", @@ -3701,8 +3701,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 178, name: "Xatu", types: ["Psychic", "Flying"], - baseStats: {hp: 65, atk: 75, def: 70, spa: 95, spd: 70, spe: 95}, - abilities: {0: "Synchronize", 1: "Early Bird", H: "Magic Bounce"}, + baseStats: { hp: 65, atk: 75, def: 70, spa: 95, spd: 70, spe: 95 }, + abilities: { 0: "Synchronize", 1: "Early Bird", H: "Magic Bounce" }, heightm: 1.5, weightkg: 15, color: "Green", @@ -3714,8 +3714,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 179, name: "Mareep", types: ["Electric"], - baseStats: {hp: 55, atk: 40, def: 40, spa: 65, spd: 45, spe: 35}, - abilities: {0: "Static", H: "Plus"}, + baseStats: { hp: 55, atk: 40, def: 40, spa: 65, spd: 45, spe: 35 }, + abilities: { 0: "Static", H: "Plus" }, heightm: 0.6, weightkg: 7.8, color: "White", @@ -3726,8 +3726,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 180, name: "Flaaffy", types: ["Electric"], - baseStats: {hp: 70, atk: 55, def: 55, spa: 80, spd: 60, spe: 45}, - abilities: {0: "Static", H: "Plus"}, + baseStats: { hp: 70, atk: 55, def: 55, spa: 80, spd: 60, spe: 45 }, + abilities: { 0: "Static", H: "Plus" }, heightm: 0.8, weightkg: 13.3, color: "Pink", @@ -3740,8 +3740,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 181, name: "Ampharos", types: ["Electric"], - baseStats: {hp: 90, atk: 75, def: 85, spa: 115, spd: 90, spe: 55}, - abilities: {0: "Static", H: "Plus"}, + baseStats: { hp: 90, atk: 75, def: 85, spa: 115, spd: 90, spe: 55 }, + abilities: { 0: "Static", H: "Plus" }, heightm: 1.4, weightkg: 61.5, color: "Yellow", @@ -3757,8 +3757,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Ampharos", forme: "Mega", types: ["Electric", "Dragon"], - baseStats: {hp: 90, atk: 95, def: 105, spa: 165, spd: 110, spe: 45}, - abilities: {0: "Mold Breaker"}, + baseStats: { hp: 90, atk: 95, def: 105, spa: 165, spd: 110, spe: 45 }, + abilities: { 0: "Mold Breaker" }, heightm: 1.4, weightkg: 61.5, color: "Yellow", @@ -3769,8 +3769,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 182, name: "Bellossom", types: ["Grass"], - baseStats: {hp: 75, atk: 80, def: 95, spa: 90, spd: 100, spe: 50}, - abilities: {0: "Chlorophyll", H: "Healer"}, + baseStats: { hp: 75, atk: 80, def: 95, spa: 90, spd: 100, spe: 50 }, + abilities: { 0: "Chlorophyll", H: "Healer" }, heightm: 0.4, weightkg: 5.8, color: "Green", @@ -3783,8 +3783,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 183, name: "Marill", types: ["Water", "Fairy"], - baseStats: {hp: 70, atk: 20, def: 50, spa: 20, spd: 50, spe: 40}, - abilities: {0: "Thick Fat", 1: "Huge Power", H: "Sap Sipper"}, + baseStats: { hp: 70, atk: 20, def: 50, spa: 20, spd: 50, spe: 40 }, + abilities: { 0: "Thick Fat", 1: "Huge Power", H: "Sap Sipper" }, heightm: 0.4, weightkg: 8.5, color: "Blue", @@ -3798,8 +3798,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 184, name: "Azumarill", types: ["Water", "Fairy"], - baseStats: {hp: 100, atk: 50, def: 80, spa: 60, spd: 80, spe: 50}, - abilities: {0: "Thick Fat", 1: "Huge Power", H: "Sap Sipper"}, + baseStats: { hp: 100, atk: 50, def: 80, spa: 60, spd: 80, spe: 50 }, + abilities: { 0: "Thick Fat", 1: "Huge Power", H: "Sap Sipper" }, heightm: 0.8, weightkg: 28.5, color: "Blue", @@ -3811,8 +3811,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 185, name: "Sudowoodo", types: ["Rock"], - baseStats: {hp: 70, atk: 100, def: 115, spa: 30, spd: 65, spe: 30}, - abilities: {0: "Sturdy", 1: "Rock Head", H: "Rattled"}, + baseStats: { hp: 70, atk: 100, def: 115, spa: 30, spd: 65, spe: 30 }, + abilities: { 0: "Sturdy", 1: "Rock Head", H: "Rattled" }, heightm: 1.2, weightkg: 38, color: "Brown", @@ -3826,8 +3826,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 186, name: "Politoed", types: ["Water"], - baseStats: {hp: 90, atk: 75, def: 75, spa: 90, spd: 100, spe: 70}, - abilities: {0: "Water Absorb", 1: "Damp", H: "Drizzle"}, + baseStats: { hp: 90, atk: 75, def: 75, spa: 90, spd: 100, spe: 70 }, + abilities: { 0: "Water Absorb", 1: "Damp", H: "Drizzle" }, heightm: 1.1, weightkg: 33.9, color: "Green", @@ -3840,8 +3840,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 187, name: "Hoppip", types: ["Grass", "Flying"], - baseStats: {hp: 35, atk: 35, def: 40, spa: 35, spd: 55, spe: 50}, - abilities: {0: "Chlorophyll", 1: "Leaf Guard", H: "Infiltrator"}, + baseStats: { hp: 35, atk: 35, def: 40, spa: 35, spd: 55, spe: 50 }, + abilities: { 0: "Chlorophyll", 1: "Leaf Guard", H: "Infiltrator" }, heightm: 0.4, weightkg: 0.5, color: "Pink", @@ -3852,8 +3852,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 188, name: "Skiploom", types: ["Grass", "Flying"], - baseStats: {hp: 55, atk: 45, def: 50, spa: 45, spd: 65, spe: 80}, - abilities: {0: "Chlorophyll", 1: "Leaf Guard", H: "Infiltrator"}, + baseStats: { hp: 55, atk: 45, def: 50, spa: 45, spd: 65, spe: 80 }, + abilities: { 0: "Chlorophyll", 1: "Leaf Guard", H: "Infiltrator" }, heightm: 0.6, weightkg: 1, color: "Green", @@ -3866,8 +3866,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 189, name: "Jumpluff", types: ["Grass", "Flying"], - baseStats: {hp: 75, atk: 55, def: 70, spa: 55, spd: 95, spe: 110}, - abilities: {0: "Chlorophyll", 1: "Leaf Guard", H: "Infiltrator"}, + baseStats: { hp: 75, atk: 55, def: 70, spa: 55, spd: 95, spe: 110 }, + abilities: { 0: "Chlorophyll", 1: "Leaf Guard", H: "Infiltrator" }, heightm: 0.8, weightkg: 3, color: "Blue", @@ -3879,8 +3879,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 190, name: "Aipom", types: ["Normal"], - baseStats: {hp: 55, atk: 70, def: 55, spa: 40, spd: 55, spe: 85}, - abilities: {0: "Run Away", 1: "Pickup", H: "Skill Link"}, + baseStats: { hp: 55, atk: 70, def: 55, spa: 40, spd: 55, spe: 85 }, + abilities: { 0: "Run Away", 1: "Pickup", H: "Skill Link" }, heightm: 0.8, weightkg: 11.5, color: "Purple", @@ -3891,8 +3891,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 191, name: "Sunkern", types: ["Grass"], - baseStats: {hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30}, - abilities: {0: "Chlorophyll", 1: "Solar Power", H: "Early Bird"}, + baseStats: { hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30 }, + abilities: { 0: "Chlorophyll", 1: "Solar Power", H: "Early Bird" }, heightm: 0.3, weightkg: 1.8, color: "Yellow", @@ -3903,8 +3903,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 192, name: "Sunflora", types: ["Grass"], - baseStats: {hp: 75, atk: 75, def: 55, spa: 105, spd: 85, spe: 30}, - abilities: {0: "Chlorophyll", 1: "Solar Power", H: "Early Bird"}, + baseStats: { hp: 75, atk: 75, def: 55, spa: 105, spd: 85, spe: 30 }, + abilities: { 0: "Chlorophyll", 1: "Solar Power", H: "Early Bird" }, heightm: 0.8, weightkg: 8.5, color: "Yellow", @@ -3917,8 +3917,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 193, name: "Yanma", types: ["Bug", "Flying"], - baseStats: {hp: 65, atk: 65, def: 45, spa: 75, spd: 45, spe: 95}, - abilities: {0: "Speed Boost", 1: "Compound Eyes", H: "Frisk"}, + baseStats: { hp: 65, atk: 65, def: 45, spa: 75, spd: 45, spe: 95 }, + abilities: { 0: "Speed Boost", 1: "Compound Eyes", H: "Frisk" }, heightm: 1.2, weightkg: 38, color: "Red", @@ -3929,8 +3929,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 194, name: "Wooper", types: ["Water", "Ground"], - baseStats: {hp: 55, atk: 45, def: 45, spa: 25, spd: 25, spe: 15}, - abilities: {0: "Damp", 1: "Water Absorb", H: "Unaware"}, + baseStats: { hp: 55, atk: 45, def: 45, spa: 25, spd: 25, spe: 15 }, + abilities: { 0: "Damp", 1: "Water Absorb", H: "Unaware" }, heightm: 0.4, weightkg: 8.5, color: "Blue", @@ -3945,8 +3945,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Wooper", forme: "Paldea", types: ["Poison", "Ground"], - baseStats: {hp: 55, atk: 45, def: 45, spa: 25, spd: 25, spe: 15}, - abilities: {0: "Poison Point", 1: "Water Absorb", H: "Unaware"}, + baseStats: { hp: 55, atk: 45, def: 45, spa: 25, spd: 25, spe: 15 }, + abilities: { 0: "Poison Point", 1: "Water Absorb", H: "Unaware" }, heightm: 0.4, weightkg: 11, color: "Brown", @@ -3957,8 +3957,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 195, name: "Quagsire", types: ["Water", "Ground"], - baseStats: {hp: 95, atk: 85, def: 85, spa: 65, spd: 65, spe: 35}, - abilities: {0: "Damp", 1: "Water Absorb", H: "Unaware"}, + baseStats: { hp: 95, atk: 85, def: 85, spa: 65, spd: 65, spe: 35 }, + abilities: { 0: "Damp", 1: "Water Absorb", H: "Unaware" }, heightm: 1.4, weightkg: 75, color: "Blue", @@ -3970,9 +3970,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 196, name: "Espeon", types: ["Psychic"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 65, def: 60, spa: 130, spd: 95, spe: 110}, - abilities: {0: "Synchronize", H: "Magic Bounce"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 65, def: 60, spa: 130, spd: 95, spe: 110 }, + abilities: { 0: "Synchronize", H: "Magic Bounce" }, heightm: 0.9, weightkg: 26.5, color: "Purple", @@ -3985,9 +3985,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 197, name: "Umbreon", types: ["Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 95, atk: 65, def: 110, spa: 60, spd: 130, spe: 65}, - abilities: {0: "Synchronize", H: "Inner Focus"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 95, atk: 65, def: 110, spa: 60, spd: 130, spe: 65 }, + abilities: { 0: "Synchronize", H: "Inner Focus" }, heightm: 1, weightkg: 27, color: "Black", @@ -4000,8 +4000,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 198, name: "Murkrow", types: ["Dark", "Flying"], - baseStats: {hp: 60, atk: 85, def: 42, spa: 85, spd: 42, spe: 91}, - abilities: {0: "Insomnia", 1: "Super Luck", H: "Prankster"}, + baseStats: { hp: 60, atk: 85, def: 42, spa: 85, spd: 42, spe: 91 }, + abilities: { 0: "Insomnia", 1: "Super Luck", H: "Prankster" }, heightm: 0.5, weightkg: 2.1, color: "Black", @@ -4012,8 +4012,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 199, name: "Slowking", types: ["Water", "Psychic"], - baseStats: {hp: 95, atk: 75, def: 80, spa: 100, spd: 110, spe: 30}, - abilities: {0: "Oblivious", 1: "Own Tempo", H: "Regenerator"}, + baseStats: { hp: 95, atk: 75, def: 80, spa: 100, spd: 110, spe: 30 }, + abilities: { 0: "Oblivious", 1: "Own Tempo", H: "Regenerator" }, heightm: 2, weightkg: 79.5, color: "Pink", @@ -4030,8 +4030,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Slowking", forme: "Galar", types: ["Poison", "Psychic"], - baseStats: {hp: 95, atk: 65, def: 80, spa: 110, spd: 110, spe: 30}, - abilities: {0: "Curious Medicine", 1: "Own Tempo", H: "Regenerator"}, + baseStats: { hp: 95, atk: 65, def: 80, spa: 110, spd: 110, spe: 30 }, + abilities: { 0: "Curious Medicine", 1: "Own Tempo", H: "Regenerator" }, heightm: 1.8, weightkg: 79.5, color: "Pink", @@ -4044,8 +4044,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 200, name: "Misdreavus", types: ["Ghost"], - baseStats: {hp: 60, atk: 60, def: 60, spa: 85, spd: 85, spe: 85}, - abilities: {0: "Levitate"}, + baseStats: { hp: 60, atk: 60, def: 60, spa: 85, spd: 85, spe: 85 }, + abilities: { 0: "Levitate" }, heightm: 0.7, weightkg: 1, color: "Gray", @@ -4058,8 +4058,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "A", types: ["Psychic"], gender: "N", - baseStats: {hp: 48, atk: 72, def: 48, spa: 72, spd: 48, spe: 48}, - abilities: {0: "Levitate"}, + baseStats: { hp: 48, atk: 72, def: 48, spa: 72, spd: 48, spe: 48 }, + abilities: { 0: "Levitate" }, heightm: 0.5, weightkg: 5, color: "Black", @@ -4071,8 +4071,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 202, name: "Wobbuffet", types: ["Psychic"], - baseStats: {hp: 190, atk: 33, def: 58, spa: 33, spd: 58, spe: 33}, - abilities: {0: "Shadow Tag", H: "Telepathy"}, + baseStats: { hp: 190, atk: 33, def: 58, spa: 33, spd: 58, spe: 33 }, + abilities: { 0: "Shadow Tag", H: "Telepathy" }, heightm: 1.3, weightkg: 28.5, color: "Blue", @@ -4085,8 +4085,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 203, name: "Girafarig", types: ["Normal", "Psychic"], - baseStats: {hp: 70, atk: 80, def: 65, spa: 90, spd: 65, spe: 85}, - abilities: {0: "Inner Focus", 1: "Early Bird", H: "Sap Sipper"}, + baseStats: { hp: 70, atk: 80, def: 65, spa: 90, spd: 65, spe: 85 }, + abilities: { 0: "Inner Focus", 1: "Early Bird", H: "Sap Sipper" }, heightm: 1.5, weightkg: 41.5, color: "Yellow", @@ -4097,8 +4097,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 204, name: "Pineco", types: ["Bug"], - baseStats: {hp: 50, atk: 65, def: 90, spa: 35, spd: 35, spe: 15}, - abilities: {0: "Sturdy", H: "Overcoat"}, + baseStats: { hp: 50, atk: 65, def: 90, spa: 35, spd: 35, spe: 15 }, + abilities: { 0: "Sturdy", H: "Overcoat" }, heightm: 0.6, weightkg: 7.2, color: "Gray", @@ -4109,8 +4109,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 205, name: "Forretress", types: ["Bug", "Steel"], - baseStats: {hp: 75, atk: 90, def: 140, spa: 60, spd: 60, spe: 40}, - abilities: {0: "Sturdy", H: "Overcoat"}, + baseStats: { hp: 75, atk: 90, def: 140, spa: 60, spd: 60, spe: 40 }, + abilities: { 0: "Sturdy", H: "Overcoat" }, heightm: 1.2, weightkg: 125.8, color: "Purple", @@ -4122,8 +4122,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 206, name: "Dunsparce", types: ["Normal"], - baseStats: {hp: 100, atk: 70, def: 70, spa: 65, spd: 65, spe: 45}, - abilities: {0: "Serene Grace", 1: "Run Away", H: "Rattled"}, + baseStats: { hp: 100, atk: 70, def: 70, spa: 65, spd: 65, spe: 45 }, + abilities: { 0: "Serene Grace", 1: "Run Away", H: "Rattled" }, heightm: 1.5, weightkg: 14, color: "Yellow", @@ -4134,8 +4134,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 207, name: "Gligar", types: ["Ground", "Flying"], - baseStats: {hp: 65, atk: 75, def: 105, spa: 35, spd: 65, spe: 85}, - abilities: {0: "Hyper Cutter", 1: "Sand Veil", H: "Immunity"}, + baseStats: { hp: 65, atk: 75, def: 105, spa: 35, spd: 65, spe: 85 }, + abilities: { 0: "Hyper Cutter", 1: "Sand Veil", H: "Immunity" }, heightm: 1.1, weightkg: 64.8, color: "Purple", @@ -4146,8 +4146,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 208, name: "Steelix", types: ["Steel", "Ground"], - baseStats: {hp: 75, atk: 85, def: 200, spa: 55, spd: 65, spe: 30}, - abilities: {0: "Rock Head", 1: "Sturdy", H: "Sheer Force"}, + baseStats: { hp: 75, atk: 85, def: 200, spa: 55, spd: 65, spe: 30 }, + abilities: { 0: "Rock Head", 1: "Sturdy", H: "Sheer Force" }, heightm: 9.2, weightkg: 400, color: "Gray", @@ -4164,8 +4164,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Steelix", forme: "Mega", types: ["Steel", "Ground"], - baseStats: {hp: 75, atk: 125, def: 230, spa: 55, spd: 95, spe: 30}, - abilities: {0: "Sand Force"}, + baseStats: { hp: 75, atk: 125, def: 230, spa: 55, spd: 95, spe: 30 }, + abilities: { 0: "Sand Force" }, heightm: 10.5, weightkg: 740, color: "Gray", @@ -4176,9 +4176,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 209, name: "Snubbull", types: ["Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 60, atk: 80, def: 50, spa: 40, spd: 40, spe: 30}, - abilities: {0: "Intimidate", 1: "Run Away", H: "Rattled"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 60, atk: 80, def: 50, spa: 40, spd: 40, spe: 30 }, + abilities: { 0: "Intimidate", 1: "Run Away", H: "Rattled" }, heightm: 0.6, weightkg: 7.8, color: "Pink", @@ -4189,9 +4189,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 210, name: "Granbull", types: ["Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 90, atk: 120, def: 75, spa: 60, spd: 60, spe: 45}, - abilities: {0: "Intimidate", 1: "Quick Feet", H: "Rattled"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 90, atk: 120, def: 75, spa: 60, spd: 60, spe: 45 }, + abilities: { 0: "Intimidate", 1: "Quick Feet", H: "Rattled" }, heightm: 1.4, weightkg: 48.7, color: "Purple", @@ -4203,8 +4203,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 211, name: "Qwilfish", types: ["Water", "Poison"], - baseStats: {hp: 65, atk: 95, def: 85, spa: 55, spd: 55, spe: 85}, - abilities: {0: "Poison Point", 1: "Swift Swim", H: "Intimidate"}, + baseStats: { hp: 65, atk: 95, def: 85, spa: 55, spd: 55, spe: 85 }, + abilities: { 0: "Poison Point", 1: "Swift Swim", H: "Intimidate" }, heightm: 0.5, weightkg: 3.9, color: "Gray", @@ -4218,8 +4218,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Qwilfish", forme: "Hisui", types: ["Dark", "Poison"], - baseStats: {hp: 65, atk: 95, def: 85, spa: 55, spd: 55, spe: 85}, - abilities: {0: "Poison Point", 1: "Swift Swim", H: "Intimidate"}, + baseStats: { hp: 65, atk: 95, def: 85, spa: 55, spd: 55, spe: 85 }, + abilities: { 0: "Poison Point", 1: "Swift Swim", H: "Intimidate" }, heightm: 0.5, weightkg: 3.9, color: "Black", @@ -4230,8 +4230,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 212, name: "Scizor", types: ["Bug", "Steel"], - baseStats: {hp: 70, atk: 130, def: 100, spa: 55, spd: 80, spe: 65}, - abilities: {0: "Swarm", 1: "Technician", H: "Light Metal"}, + baseStats: { hp: 70, atk: 130, def: 100, spa: 55, spd: 80, spe: 65 }, + abilities: { 0: "Swarm", 1: "Technician", H: "Light Metal" }, heightm: 1.8, weightkg: 118, color: "Red", @@ -4248,8 +4248,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Scizor", forme: "Mega", types: ["Bug", "Steel"], - baseStats: {hp: 70, atk: 150, def: 140, spa: 65, spd: 100, spe: 75}, - abilities: {0: "Technician"}, + baseStats: { hp: 70, atk: 150, def: 140, spa: 65, spd: 100, spe: 75 }, + abilities: { 0: "Technician" }, heightm: 2, weightkg: 125, color: "Red", @@ -4260,8 +4260,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 213, name: "Shuckle", types: ["Bug", "Rock"], - baseStats: {hp: 20, atk: 10, def: 230, spa: 10, spd: 230, spe: 5}, - abilities: {0: "Sturdy", 1: "Gluttony", H: "Contrary"}, + baseStats: { hp: 20, atk: 10, def: 230, spa: 10, spd: 230, spe: 5 }, + abilities: { 0: "Sturdy", 1: "Gluttony", H: "Contrary" }, heightm: 0.6, weightkg: 20.5, color: "Yellow", @@ -4271,8 +4271,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 214, name: "Heracross", types: ["Bug", "Fighting"], - baseStats: {hp: 80, atk: 125, def: 75, spa: 40, spd: 95, spe: 85}, - abilities: {0: "Swarm", 1: "Guts", H: "Moxie"}, + baseStats: { hp: 80, atk: 125, def: 75, spa: 40, spd: 95, spe: 85 }, + abilities: { 0: "Swarm", 1: "Guts", H: "Moxie" }, heightm: 1.5, weightkg: 54, color: "Blue", @@ -4286,8 +4286,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Heracross", forme: "Mega", types: ["Bug", "Fighting"], - baseStats: {hp: 80, atk: 185, def: 115, spa: 40, spd: 105, spe: 75}, - abilities: {0: "Skill Link"}, + baseStats: { hp: 80, atk: 185, def: 115, spa: 40, spd: 105, spe: 75 }, + abilities: { 0: "Skill Link" }, heightm: 1.7, weightkg: 62.5, color: "Blue", @@ -4298,8 +4298,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 215, name: "Sneasel", types: ["Dark", "Ice"], - baseStats: {hp: 55, atk: 95, def: 55, spa: 35, spd: 75, spe: 115}, - abilities: {0: "Inner Focus", 1: "Keen Eye", H: "Pickpocket"}, + baseStats: { hp: 55, atk: 95, def: 55, spa: 35, spd: 75, spe: 115 }, + abilities: { 0: "Inner Focus", 1: "Keen Eye", H: "Pickpocket" }, heightm: 0.9, weightkg: 28, color: "Black", @@ -4314,8 +4314,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sneasel", forme: "Hisui", types: ["Fighting", "Poison"], - baseStats: {hp: 55, atk: 95, def: 55, spa: 35, spd: 75, spe: 115}, - abilities: {0: "Inner Focus", 1: "Keen Eye", H: "Pickpocket"}, + baseStats: { hp: 55, atk: 95, def: 55, spa: 35, spd: 75, spe: 115 }, + abilities: { 0: "Inner Focus", 1: "Keen Eye", H: "Pickpocket" }, heightm: 0.9, weightkg: 27, color: "Gray", @@ -4326,8 +4326,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 216, name: "Teddiursa", types: ["Normal"], - baseStats: {hp: 60, atk: 80, def: 50, spa: 50, spd: 50, spe: 40}, - abilities: {0: "Pickup", 1: "Quick Feet", H: "Honey Gather"}, + baseStats: { hp: 60, atk: 80, def: 50, spa: 50, spd: 50, spe: 40 }, + abilities: { 0: "Pickup", 1: "Quick Feet", H: "Honey Gather" }, heightm: 0.6, weightkg: 8.8, color: "Brown", @@ -4338,8 +4338,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 217, name: "Ursaring", types: ["Normal"], - baseStats: {hp: 90, atk: 130, def: 75, spa: 75, spd: 75, spe: 55}, - abilities: {0: "Guts", 1: "Quick Feet", H: "Unnerve"}, + baseStats: { hp: 90, atk: 130, def: 75, spa: 75, spd: 75, spe: 55 }, + abilities: { 0: "Guts", 1: "Quick Feet", H: "Unnerve" }, heightm: 1.8, weightkg: 125.8, color: "Brown", @@ -4352,8 +4352,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 218, name: "Slugma", types: ["Fire"], - baseStats: {hp: 40, atk: 40, def: 40, spa: 70, spd: 40, spe: 20}, - abilities: {0: "Magma Armor", 1: "Flame Body", H: "Weak Armor"}, + baseStats: { hp: 40, atk: 40, def: 40, spa: 70, spd: 40, spe: 20 }, + abilities: { 0: "Magma Armor", 1: "Flame Body", H: "Weak Armor" }, heightm: 0.7, weightkg: 35, color: "Red", @@ -4364,8 +4364,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 219, name: "Magcargo", types: ["Fire", "Rock"], - baseStats: {hp: 60, atk: 50, def: 120, spa: 90, spd: 80, spe: 30}, - abilities: {0: "Magma Armor", 1: "Flame Body", H: "Weak Armor"}, + baseStats: { hp: 60, atk: 50, def: 120, spa: 90, spd: 80, spe: 30 }, + abilities: { 0: "Magma Armor", 1: "Flame Body", H: "Weak Armor" }, heightm: 0.8, weightkg: 55, color: "Red", @@ -4377,8 +4377,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 220, name: "Swinub", types: ["Ice", "Ground"], - baseStats: {hp: 50, atk: 50, def: 40, spa: 30, spd: 30, spe: 50}, - abilities: {0: "Oblivious", 1: "Snow Cloak", H: "Thick Fat"}, + baseStats: { hp: 50, atk: 50, def: 40, spa: 30, spd: 30, spe: 50 }, + abilities: { 0: "Oblivious", 1: "Snow Cloak", H: "Thick Fat" }, heightm: 0.4, weightkg: 6.5, color: "Brown", @@ -4389,8 +4389,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 221, name: "Piloswine", types: ["Ice", "Ground"], - baseStats: {hp: 100, atk: 100, def: 80, spa: 60, spd: 60, spe: 50}, - abilities: {0: "Oblivious", 1: "Snow Cloak", H: "Thick Fat"}, + baseStats: { hp: 100, atk: 100, def: 80, spa: 60, spd: 60, spe: 50 }, + abilities: { 0: "Oblivious", 1: "Snow Cloak", H: "Thick Fat" }, heightm: 1.1, weightkg: 55.8, color: "Brown", @@ -4403,9 +4403,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 222, name: "Corsola", types: ["Water", "Rock"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 65, atk: 55, def: 95, spa: 65, spd: 95, spe: 35}, - abilities: {0: "Hustle", 1: "Natural Cure", H: "Regenerator"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 65, atk: 55, def: 95, spa: 65, spd: 95, spe: 35 }, + abilities: { 0: "Hustle", 1: "Natural Cure", H: "Regenerator" }, heightm: 0.6, weightkg: 5, color: "Pink", @@ -4419,9 +4419,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Corsola", forme: "Galar", types: ["Ghost"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 60, atk: 55, def: 100, spa: 65, spd: 100, spe: 30}, - abilities: {0: "Weak Armor", H: "Cursed Body"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 60, atk: 55, def: 100, spa: 65, spd: 100, spe: 30 }, + abilities: { 0: "Weak Armor", H: "Cursed Body" }, heightm: 0.6, weightkg: 0.5, color: "White", @@ -4432,8 +4432,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 223, name: "Remoraid", types: ["Water"], - baseStats: {hp: 35, atk: 65, def: 35, spa: 65, spd: 35, spe: 65}, - abilities: {0: "Hustle", 1: "Sniper", H: "Moody"}, + baseStats: { hp: 35, atk: 65, def: 35, spa: 65, spd: 35, spe: 65 }, + abilities: { 0: "Hustle", 1: "Sniper", H: "Moody" }, heightm: 0.6, weightkg: 12, color: "Gray", @@ -4444,8 +4444,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 224, name: "Octillery", types: ["Water"], - baseStats: {hp: 75, atk: 105, def: 75, spa: 105, spd: 75, spe: 45}, - abilities: {0: "Suction Cups", 1: "Sniper", H: "Moody"}, + baseStats: { hp: 75, atk: 105, def: 75, spa: 105, spd: 75, spe: 45 }, + abilities: { 0: "Suction Cups", 1: "Sniper", H: "Moody" }, heightm: 0.9, weightkg: 28.5, color: "Red", @@ -4457,8 +4457,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 225, name: "Delibird", types: ["Ice", "Flying"], - baseStats: {hp: 45, atk: 55, def: 45, spa: 65, spd: 45, spe: 75}, - abilities: {0: "Vital Spirit", 1: "Hustle", H: "Insomnia"}, + baseStats: { hp: 45, atk: 55, def: 45, spa: 65, spd: 45, spe: 75 }, + abilities: { 0: "Vital Spirit", 1: "Hustle", H: "Insomnia" }, heightm: 0.9, weightkg: 16, color: "Red", @@ -4468,8 +4468,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 226, name: "Mantine", types: ["Water", "Flying"], - baseStats: {hp: 85, atk: 40, def: 70, spa: 80, spd: 140, spe: 70}, - abilities: {0: "Swift Swim", 1: "Water Absorb", H: "Water Veil"}, + baseStats: { hp: 85, atk: 40, def: 70, spa: 80, spd: 140, spe: 70 }, + abilities: { 0: "Swift Swim", 1: "Water Absorb", H: "Water Veil" }, heightm: 2.1, weightkg: 220, color: "Purple", @@ -4483,8 +4483,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 227, name: "Skarmory", types: ["Steel", "Flying"], - baseStats: {hp: 65, atk: 80, def: 140, spa: 40, spd: 70, spe: 70}, - abilities: {0: "Keen Eye", 1: "Sturdy", H: "Weak Armor"}, + baseStats: { hp: 65, atk: 80, def: 140, spa: 40, spd: 70, spe: 70 }, + abilities: { 0: "Keen Eye", 1: "Sturdy", H: "Weak Armor" }, heightm: 1.7, weightkg: 50.5, color: "Gray", @@ -4494,8 +4494,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 228, name: "Houndour", types: ["Dark", "Fire"], - baseStats: {hp: 45, atk: 60, def: 30, spa: 80, spd: 50, spe: 65}, - abilities: {0: "Early Bird", 1: "Flash Fire", H: "Unnerve"}, + baseStats: { hp: 45, atk: 60, def: 30, spa: 80, spd: 50, spe: 65 }, + abilities: { 0: "Early Bird", 1: "Flash Fire", H: "Unnerve" }, heightm: 0.6, weightkg: 10.8, color: "Black", @@ -4506,8 +4506,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 229, name: "Houndoom", types: ["Dark", "Fire"], - baseStats: {hp: 75, atk: 90, def: 50, spa: 110, spd: 80, spe: 95}, - abilities: {0: "Early Bird", 1: "Flash Fire", H: "Unnerve"}, + baseStats: { hp: 75, atk: 90, def: 50, spa: 110, spd: 80, spe: 95 }, + abilities: { 0: "Early Bird", 1: "Flash Fire", H: "Unnerve" }, heightm: 1.4, weightkg: 35, color: "Black", @@ -4523,8 +4523,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Houndoom", forme: "Mega", types: ["Dark", "Fire"], - baseStats: {hp: 75, atk: 90, def: 90, spa: 140, spd: 90, spe: 115}, - abilities: {0: "Solar Power"}, + baseStats: { hp: 75, atk: 90, def: 90, spa: 140, spd: 90, spe: 115 }, + abilities: { 0: "Solar Power" }, heightm: 1.9, weightkg: 49.5, color: "Black", @@ -4535,8 +4535,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 230, name: "Kingdra", types: ["Water", "Dragon"], - baseStats: {hp: 75, atk: 95, def: 95, spa: 95, spd: 95, spe: 85}, - abilities: {0: "Swift Swim", 1: "Sniper", H: "Damp"}, + baseStats: { hp: 75, atk: 95, def: 95, spa: 95, spd: 95, spe: 85 }, + abilities: { 0: "Swift Swim", 1: "Sniper", H: "Damp" }, heightm: 1.8, weightkg: 152, color: "Blue", @@ -4549,8 +4549,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 231, name: "Phanpy", types: ["Ground"], - baseStats: {hp: 90, atk: 60, def: 60, spa: 40, spd: 40, spe: 40}, - abilities: {0: "Pickup", H: "Sand Veil"}, + baseStats: { hp: 90, atk: 60, def: 60, spa: 40, spd: 40, spe: 40 }, + abilities: { 0: "Pickup", H: "Sand Veil" }, heightm: 0.5, weightkg: 33.5, color: "Blue", @@ -4561,8 +4561,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 232, name: "Donphan", types: ["Ground"], - baseStats: {hp: 90, atk: 120, def: 120, spa: 60, spd: 60, spe: 50}, - abilities: {0: "Sturdy", H: "Sand Veil"}, + baseStats: { hp: 90, atk: 120, def: 120, spa: 60, spd: 60, spe: 50 }, + abilities: { 0: "Sturdy", H: "Sand Veil" }, heightm: 1.1, weightkg: 120, color: "Gray", @@ -4575,8 +4575,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Porygon2", types: ["Normal"], gender: "N", - baseStats: {hp: 85, atk: 80, def: 90, spa: 105, spd: 95, spe: 60}, - abilities: {0: "Trace", 1: "Download", H: "Analytic"}, + baseStats: { hp: 85, atk: 80, def: 90, spa: 105, spd: 95, spe: 60 }, + abilities: { 0: "Trace", 1: "Download", H: "Analytic" }, heightm: 0.6, weightkg: 32.5, color: "Red", @@ -4590,8 +4590,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 234, name: "Stantler", types: ["Normal"], - baseStats: {hp: 73, atk: 95, def: 62, spa: 85, spd: 65, spe: 85}, - abilities: {0: "Intimidate", 1: "Frisk", H: "Sap Sipper"}, + baseStats: { hp: 73, atk: 95, def: 62, spa: 85, spd: 65, spe: 85 }, + abilities: { 0: "Intimidate", 1: "Frisk", H: "Sap Sipper" }, heightm: 1.4, weightkg: 71.2, color: "Brown", @@ -4602,8 +4602,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 235, name: "Smeargle", types: ["Normal"], - baseStats: {hp: 55, atk: 20, def: 35, spa: 20, spd: 45, spe: 75}, - abilities: {0: "Own Tempo", 1: "Technician", H: "Moody"}, + baseStats: { hp: 55, atk: 20, def: 35, spa: 20, spd: 45, spe: 75 }, + abilities: { 0: "Own Tempo", 1: "Technician", H: "Moody" }, heightm: 1.2, weightkg: 58, color: "White", @@ -4614,8 +4614,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tyrogue", types: ["Fighting"], gender: "M", - baseStats: {hp: 35, atk: 35, def: 35, spa: 35, spd: 35, spe: 35}, - abilities: {0: "Guts", 1: "Steadfast", H: "Vital Spirit"}, + baseStats: { hp: 35, atk: 35, def: 35, spa: 35, spd: 35, spe: 35 }, + abilities: { 0: "Guts", 1: "Steadfast", H: "Vital Spirit" }, heightm: 0.7, weightkg: 21, color: "Purple", @@ -4628,8 +4628,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Hitmontop", types: ["Fighting"], gender: "M", - baseStats: {hp: 50, atk: 95, def: 95, spa: 35, spd: 110, spe: 70}, - abilities: {0: "Intimidate", 1: "Technician", H: "Steadfast"}, + baseStats: { hp: 50, atk: 95, def: 95, spa: 35, spd: 110, spe: 70 }, + abilities: { 0: "Intimidate", 1: "Technician", H: "Steadfast" }, heightm: 1.4, weightkg: 48, color: "Brown", @@ -4643,8 +4643,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Smoochum", types: ["Ice", "Psychic"], gender: "F", - baseStats: {hp: 45, atk: 30, def: 15, spa: 85, spd: 65, spe: 65}, - abilities: {0: "Oblivious", 1: "Forewarn", H: "Hydration"}, + baseStats: { hp: 45, atk: 30, def: 15, spa: 85, spd: 65, spe: 65 }, + abilities: { 0: "Oblivious", 1: "Forewarn", H: "Hydration" }, heightm: 0.4, weightkg: 6, color: "Pink", @@ -4656,9 +4656,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 239, name: "Elekid", types: ["Electric"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 45, atk: 63, def: 37, spa: 65, spd: 55, spe: 95}, - abilities: {0: "Static", H: "Vital Spirit"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 45, atk: 63, def: 37, spa: 65, spd: 55, spe: 95 }, + abilities: { 0: "Static", H: "Vital Spirit" }, heightm: 0.6, weightkg: 23.5, color: "Yellow", @@ -4670,9 +4670,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 240, name: "Magby", types: ["Fire"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 45, atk: 75, def: 37, spa: 70, spd: 55, spe: 83}, - abilities: {0: "Flame Body", H: "Vital Spirit"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 45, atk: 75, def: 37, spa: 70, spd: 55, spe: 83 }, + abilities: { 0: "Flame Body", H: "Vital Spirit" }, heightm: 0.7, weightkg: 21.4, color: "Red", @@ -4685,8 +4685,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Miltank", types: ["Normal"], gender: "F", - baseStats: {hp: 95, atk: 80, def: 105, spa: 40, spd: 70, spe: 100}, - abilities: {0: "Thick Fat", 1: "Scrappy", H: "Sap Sipper"}, + baseStats: { hp: 95, atk: 80, def: 105, spa: 40, spd: 70, spe: 100 }, + abilities: { 0: "Thick Fat", 1: "Scrappy", H: "Sap Sipper" }, heightm: 1.2, weightkg: 75.5, color: "Pink", @@ -4697,8 +4697,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Blissey", types: ["Normal"], gender: "F", - baseStats: {hp: 255, atk: 10, def: 10, spa: 75, spd: 135, spe: 55}, - abilities: {0: "Natural Cure", 1: "Serene Grace", H: "Healer"}, + baseStats: { hp: 255, atk: 10, def: 10, spa: 75, spd: 135, spe: 55 }, + abilities: { 0: "Natural Cure", 1: "Serene Grace", H: "Healer" }, heightm: 1.5, weightkg: 46.8, color: "Pink", @@ -4711,8 +4711,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Raikou", types: ["Electric"], gender: "N", - baseStats: {hp: 90, atk: 85, def: 75, spa: 115, spd: 100, spe: 115}, - abilities: {0: "Pressure", H: "Inner Focus"}, + baseStats: { hp: 90, atk: 85, def: 75, spa: 115, spd: 100, spe: 115 }, + abilities: { 0: "Pressure", H: "Inner Focus" }, heightm: 1.9, weightkg: 178, color: "Yellow", @@ -4724,8 +4724,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Entei", types: ["Fire"], gender: "N", - baseStats: {hp: 115, atk: 115, def: 85, spa: 90, spd: 75, spe: 100}, - abilities: {0: "Pressure", H: "Inner Focus"}, + baseStats: { hp: 115, atk: 115, def: 85, spa: 90, spd: 75, spe: 100 }, + abilities: { 0: "Pressure", H: "Inner Focus" }, heightm: 2.1, weightkg: 198, color: "Brown", @@ -4737,8 +4737,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Suicune", types: ["Water"], gender: "N", - baseStats: {hp: 100, atk: 75, def: 115, spa: 90, spd: 115, spe: 85}, - abilities: {0: "Pressure", H: "Inner Focus"}, + baseStats: { hp: 100, atk: 75, def: 115, spa: 90, spd: 115, spe: 85 }, + abilities: { 0: "Pressure", H: "Inner Focus" }, heightm: 2, weightkg: 187, color: "Blue", @@ -4749,8 +4749,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 246, name: "Larvitar", types: ["Rock", "Ground"], - baseStats: {hp: 50, atk: 64, def: 50, spa: 45, spd: 50, spe: 41}, - abilities: {0: "Guts", H: "Sand Veil"}, + baseStats: { hp: 50, atk: 64, def: 50, spa: 45, spd: 50, spe: 41 }, + abilities: { 0: "Guts", H: "Sand Veil" }, heightm: 0.6, weightkg: 72, color: "Green", @@ -4761,8 +4761,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 247, name: "Pupitar", types: ["Rock", "Ground"], - baseStats: {hp: 70, atk: 84, def: 70, spa: 65, spd: 70, spe: 51}, - abilities: {0: "Shed Skin"}, + baseStats: { hp: 70, atk: 84, def: 70, spa: 65, spd: 70, spe: 51 }, + abilities: { 0: "Shed Skin" }, heightm: 1.2, weightkg: 152, color: "Gray", @@ -4775,8 +4775,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 248, name: "Tyranitar", types: ["Rock", "Dark"], - baseStats: {hp: 100, atk: 134, def: 110, spa: 95, spd: 100, spe: 61}, - abilities: {0: "Sand Stream", H: "Unnerve"}, + baseStats: { hp: 100, atk: 134, def: 110, spa: 95, spd: 100, spe: 61 }, + abilities: { 0: "Sand Stream", H: "Unnerve" }, heightm: 2, weightkg: 202, color: "Green", @@ -4792,8 +4792,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Tyranitar", forme: "Mega", types: ["Rock", "Dark"], - baseStats: {hp: 100, atk: 164, def: 150, spa: 95, spd: 120, spe: 71}, - abilities: {0: "Sand Stream"}, + baseStats: { hp: 100, atk: 164, def: 150, spa: 95, spd: 120, spe: 71 }, + abilities: { 0: "Sand Stream" }, heightm: 2.5, weightkg: 255, color: "Green", @@ -4805,8 +4805,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Lugia", types: ["Psychic", "Flying"], gender: "N", - baseStats: {hp: 106, atk: 90, def: 130, spa: 90, spd: 154, spe: 110}, - abilities: {0: "Pressure", H: "Multiscale"}, + baseStats: { hp: 106, atk: 90, def: 130, spa: 90, spd: 154, spe: 110 }, + abilities: { 0: "Pressure", H: "Multiscale" }, heightm: 5.2, weightkg: 216, color: "White", @@ -4818,8 +4818,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Ho-Oh", types: ["Fire", "Flying"], gender: "N", - baseStats: {hp: 106, atk: 130, def: 90, spa: 110, spd: 154, spe: 90}, - abilities: {0: "Pressure", H: "Regenerator"}, + baseStats: { hp: 106, atk: 130, def: 90, spa: 110, spd: 154, spe: 90 }, + abilities: { 0: "Pressure", H: "Regenerator" }, heightm: 3.8, weightkg: 199, color: "Red", @@ -4831,8 +4831,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Celebi", types: ["Psychic", "Grass"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Natural Cure"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Natural Cure" }, heightm: 0.6, weightkg: 5, color: "Green", @@ -4843,9 +4843,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 252, name: "Treecko", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 40, atk: 45, def: 35, spa: 65, spd: 55, spe: 70}, - abilities: {0: "Overgrow", H: "Unburden"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 40, atk: 45, def: 35, spa: 65, spd: 55, spe: 70 }, + abilities: { 0: "Overgrow", H: "Unburden" }, heightm: 0.5, weightkg: 5, color: "Green", @@ -4856,9 +4856,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 253, name: "Grovyle", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 65, def: 45, spa: 85, spd: 65, spe: 95}, - abilities: {0: "Overgrow", H: "Unburden"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 65, def: 45, spa: 85, spd: 65, spe: 95 }, + abilities: { 0: "Overgrow", H: "Unburden" }, heightm: 0.9, weightkg: 21.6, color: "Green", @@ -4871,9 +4871,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 254, name: "Sceptile", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 85, def: 65, spa: 105, spd: 85, spe: 120}, - abilities: {0: "Overgrow", H: "Unburden"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 85, def: 65, spa: 105, spd: 85, spe: 120 }, + abilities: { 0: "Overgrow", H: "Unburden" }, heightm: 1.7, weightkg: 52.2, color: "Green", @@ -4889,9 +4889,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sceptile", forme: "Mega", types: ["Grass", "Dragon"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 110, def: 75, spa: 145, spd: 85, spe: 145}, - abilities: {0: "Lightning Rod"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 110, def: 75, spa: 145, spd: 85, spe: 145 }, + abilities: { 0: "Lightning Rod" }, heightm: 1.9, weightkg: 55.2, color: "Green", @@ -4902,9 +4902,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 255, name: "Torchic", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 45, atk: 60, def: 40, spa: 70, spd: 50, spe: 45}, - abilities: {0: "Blaze", H: "Speed Boost"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 45, atk: 60, def: 40, spa: 70, spd: 50, spe: 45 }, + abilities: { 0: "Blaze", H: "Speed Boost" }, heightm: 0.4, weightkg: 2.5, color: "Red", @@ -4915,9 +4915,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 256, name: "Combusken", types: ["Fire", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 85, def: 60, spa: 85, spd: 60, spe: 55}, - abilities: {0: "Blaze", H: "Speed Boost"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 85, def: 60, spa: 85, spd: 60, spe: 55 }, + abilities: { 0: "Blaze", H: "Speed Boost" }, heightm: 0.9, weightkg: 19.5, color: "Red", @@ -4930,9 +4930,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 257, name: "Blaziken", types: ["Fire", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 120, def: 70, spa: 110, spd: 70, spe: 80}, - abilities: {0: "Blaze", H: "Speed Boost"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 120, def: 70, spa: 110, spd: 70, spe: 80 }, + abilities: { 0: "Blaze", H: "Speed Boost" }, heightm: 1.9, weightkg: 52, color: "Red", @@ -4948,9 +4948,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Blaziken", forme: "Mega", types: ["Fire", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 160, def: 80, spa: 130, spd: 80, spe: 100}, - abilities: {0: "Speed Boost"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 160, def: 80, spa: 130, spd: 80, spe: 100 }, + abilities: { 0: "Speed Boost" }, heightm: 1.9, weightkg: 52, color: "Red", @@ -4961,9 +4961,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 258, name: "Mudkip", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 70, def: 50, spa: 50, spd: 50, spe: 40}, - abilities: {0: "Torrent", H: "Damp"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 70, def: 50, spa: 50, spd: 50, spe: 40 }, + abilities: { 0: "Torrent", H: "Damp" }, heightm: 0.4, weightkg: 7.6, color: "Blue", @@ -4974,9 +4974,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 259, name: "Marshtomp", types: ["Water", "Ground"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 85, def: 70, spa: 60, spd: 70, spe: 50}, - abilities: {0: "Torrent", H: "Damp"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 85, def: 70, spa: 60, spd: 70, spe: 50 }, + abilities: { 0: "Torrent", H: "Damp" }, heightm: 0.7, weightkg: 28, color: "Blue", @@ -4989,9 +4989,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 260, name: "Swampert", types: ["Water", "Ground"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 110, def: 90, spa: 85, spd: 90, spe: 60}, - abilities: {0: "Torrent", H: "Damp"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 110, def: 90, spa: 85, spd: 90, spe: 60 }, + abilities: { 0: "Torrent", H: "Damp" }, heightm: 1.5, weightkg: 81.9, color: "Blue", @@ -5007,9 +5007,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Swampert", forme: "Mega", types: ["Water", "Ground"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 150, def: 110, spa: 95, spd: 110, spe: 70}, - abilities: {0: "Swift Swim"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 150, def: 110, spa: 95, spd: 110, spe: 70 }, + abilities: { 0: "Swift Swim" }, heightm: 1.9, weightkg: 102, color: "Blue", @@ -5020,8 +5020,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 261, name: "Poochyena", types: ["Dark"], - baseStats: {hp: 35, atk: 55, def: 35, spa: 30, spd: 30, spe: 35}, - abilities: {0: "Run Away", 1: "Quick Feet", H: "Rattled"}, + baseStats: { hp: 35, atk: 55, def: 35, spa: 30, spd: 30, spe: 35 }, + abilities: { 0: "Run Away", 1: "Quick Feet", H: "Rattled" }, heightm: 0.5, weightkg: 13.6, color: "Gray", @@ -5032,8 +5032,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 262, name: "Mightyena", types: ["Dark"], - baseStats: {hp: 70, atk: 90, def: 70, spa: 60, spd: 60, spe: 70}, - abilities: {0: "Intimidate", 1: "Quick Feet", H: "Moxie"}, + baseStats: { hp: 70, atk: 90, def: 70, spa: 60, spd: 60, spe: 70 }, + abilities: { 0: "Intimidate", 1: "Quick Feet", H: "Moxie" }, heightm: 1, weightkg: 37, color: "Gray", @@ -5045,8 +5045,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 263, name: "Zigzagoon", types: ["Normal"], - baseStats: {hp: 38, atk: 30, def: 41, spa: 30, spd: 41, spe: 60}, - abilities: {0: "Pickup", 1: "Gluttony", H: "Quick Feet"}, + baseStats: { hp: 38, atk: 30, def: 41, spa: 30, spd: 41, spe: 60 }, + abilities: { 0: "Pickup", 1: "Gluttony", H: "Quick Feet" }, heightm: 0.4, weightkg: 17.5, color: "Brown", @@ -5061,8 +5061,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Zigzagoon", forme: "Galar", types: ["Dark", "Normal"], - baseStats: {hp: 38, atk: 30, def: 41, spa: 30, spd: 41, spe: 60}, - abilities: {0: "Pickup", 1: "Gluttony", H: "Quick Feet"}, + baseStats: { hp: 38, atk: 30, def: 41, spa: 30, spd: 41, spe: 60 }, + abilities: { 0: "Pickup", 1: "Gluttony", H: "Quick Feet" }, heightm: 0.4, weightkg: 17.5, color: "White", @@ -5073,8 +5073,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 264, name: "Linoone", types: ["Normal"], - baseStats: {hp: 78, atk: 70, def: 61, spa: 50, spd: 61, spe: 100}, - abilities: {0: "Pickup", 1: "Gluttony", H: "Quick Feet"}, + baseStats: { hp: 78, atk: 70, def: 61, spa: 50, spd: 61, spe: 100 }, + abilities: { 0: "Pickup", 1: "Gluttony", H: "Quick Feet" }, heightm: 0.5, weightkg: 32.5, color: "White", @@ -5090,8 +5090,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Linoone", forme: "Galar", types: ["Dark", "Normal"], - baseStats: {hp: 78, atk: 70, def: 61, spa: 50, spd: 61, spe: 100}, - abilities: {0: "Pickup", 1: "Gluttony", H: "Quick Feet"}, + baseStats: { hp: 78, atk: 70, def: 61, spa: 50, spd: 61, spe: 100 }, + abilities: { 0: "Pickup", 1: "Gluttony", H: "Quick Feet" }, heightm: 0.5, weightkg: 32.5, color: "White", @@ -5104,8 +5104,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 265, name: "Wurmple", types: ["Bug"], - baseStats: {hp: 45, atk: 45, def: 35, spa: 20, spd: 30, spe: 20}, - abilities: {0: "Shield Dust", H: "Run Away"}, + baseStats: { hp: 45, atk: 45, def: 35, spa: 20, spd: 30, spe: 20 }, + abilities: { 0: "Shield Dust", H: "Run Away" }, heightm: 0.3, weightkg: 3.6, color: "Red", @@ -5116,8 +5116,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 266, name: "Silcoon", types: ["Bug"], - baseStats: {hp: 50, atk: 35, def: 55, spa: 25, spd: 25, spe: 15}, - abilities: {0: "Shed Skin"}, + baseStats: { hp: 50, atk: 35, def: 55, spa: 25, spd: 25, spe: 15 }, + abilities: { 0: "Shed Skin" }, heightm: 0.6, weightkg: 10, color: "White", @@ -5130,8 +5130,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 267, name: "Beautifly", types: ["Bug", "Flying"], - baseStats: {hp: 60, atk: 70, def: 50, spa: 100, spd: 50, spe: 65}, - abilities: {0: "Swarm", H: "Rivalry"}, + baseStats: { hp: 60, atk: 70, def: 50, spa: 100, spd: 50, spe: 65 }, + abilities: { 0: "Swarm", H: "Rivalry" }, heightm: 1, weightkg: 28.4, color: "Yellow", @@ -5143,8 +5143,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 268, name: "Cascoon", types: ["Bug"], - baseStats: {hp: 50, atk: 35, def: 55, spa: 25, spd: 25, spe: 15}, - abilities: {0: "Shed Skin"}, + baseStats: { hp: 50, atk: 35, def: 55, spa: 25, spd: 25, spe: 15 }, + abilities: { 0: "Shed Skin" }, heightm: 0.7, weightkg: 11.5, color: "Purple", @@ -5157,8 +5157,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 269, name: "Dustox", types: ["Bug", "Poison"], - baseStats: {hp: 60, atk: 50, def: 70, spa: 50, spd: 90, spe: 65}, - abilities: {0: "Shield Dust", H: "Compound Eyes"}, + baseStats: { hp: 60, atk: 50, def: 70, spa: 50, spd: 90, spe: 65 }, + abilities: { 0: "Shield Dust", H: "Compound Eyes" }, heightm: 1.2, weightkg: 31.6, color: "Green", @@ -5170,8 +5170,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 270, name: "Lotad", types: ["Water", "Grass"], - baseStats: {hp: 40, atk: 30, def: 30, spa: 40, spd: 50, spe: 30}, - abilities: {0: "Swift Swim", 1: "Rain Dish", H: "Own Tempo"}, + baseStats: { hp: 40, atk: 30, def: 30, spa: 40, spd: 50, spe: 30 }, + abilities: { 0: "Swift Swim", 1: "Rain Dish", H: "Own Tempo" }, heightm: 0.5, weightkg: 2.6, color: "Green", @@ -5182,8 +5182,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 271, name: "Lombre", types: ["Water", "Grass"], - baseStats: {hp: 60, atk: 50, def: 50, spa: 60, spd: 70, spe: 50}, - abilities: {0: "Swift Swim", 1: "Rain Dish", H: "Own Tempo"}, + baseStats: { hp: 60, atk: 50, def: 50, spa: 60, spd: 70, spe: 50 }, + abilities: { 0: "Swift Swim", 1: "Rain Dish", H: "Own Tempo" }, heightm: 1.2, weightkg: 32.5, color: "Green", @@ -5196,8 +5196,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 272, name: "Ludicolo", types: ["Water", "Grass"], - baseStats: {hp: 80, atk: 70, def: 70, spa: 90, spd: 100, spe: 70}, - abilities: {0: "Swift Swim", 1: "Rain Dish", H: "Own Tempo"}, + baseStats: { hp: 80, atk: 70, def: 70, spa: 90, spd: 100, spe: 70 }, + abilities: { 0: "Swift Swim", 1: "Rain Dish", H: "Own Tempo" }, heightm: 1.5, weightkg: 55, color: "Green", @@ -5210,8 +5210,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 273, name: "Seedot", types: ["Grass"], - baseStats: {hp: 40, atk: 40, def: 50, spa: 30, spd: 30, spe: 30}, - abilities: {0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket"}, + baseStats: { hp: 40, atk: 40, def: 50, spa: 30, spd: 30, spe: 30 }, + abilities: { 0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket" }, heightm: 0.5, weightkg: 4, color: "Brown", @@ -5222,8 +5222,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 274, name: "Nuzleaf", types: ["Grass", "Dark"], - baseStats: {hp: 70, atk: 70, def: 40, spa: 60, spd: 40, spe: 60}, - abilities: {0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket"}, + baseStats: { hp: 70, atk: 70, def: 40, spa: 60, spd: 40, spe: 60 }, + abilities: { 0: "Chlorophyll", 1: "Early Bird", H: "Pickpocket" }, heightm: 1, weightkg: 28, color: "Brown", @@ -5236,8 +5236,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 275, name: "Shiftry", types: ["Grass", "Dark"], - baseStats: {hp: 90, atk: 100, def: 60, spa: 90, spd: 60, spe: 80}, - abilities: {0: "Chlorophyll", 1: "Wind Rider", H: "Pickpocket"}, + baseStats: { hp: 90, atk: 100, def: 60, spa: 90, spd: 60, spe: 80 }, + abilities: { 0: "Chlorophyll", 1: "Wind Rider", H: "Pickpocket" }, heightm: 1.3, weightkg: 59.6, color: "Brown", @@ -5250,8 +5250,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 276, name: "Taillow", types: ["Normal", "Flying"], - baseStats: {hp: 40, atk: 55, def: 30, spa: 30, spd: 30, spe: 85}, - abilities: {0: "Guts", H: "Scrappy"}, + baseStats: { hp: 40, atk: 55, def: 30, spa: 30, spd: 30, spe: 85 }, + abilities: { 0: "Guts", H: "Scrappy" }, heightm: 0.3, weightkg: 2.3, color: "Blue", @@ -5262,8 +5262,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 277, name: "Swellow", types: ["Normal", "Flying"], - baseStats: {hp: 60, atk: 85, def: 60, spa: 75, spd: 50, spe: 125}, - abilities: {0: "Guts", H: "Scrappy"}, + baseStats: { hp: 60, atk: 85, def: 60, spa: 75, spd: 50, spe: 125 }, + abilities: { 0: "Guts", H: "Scrappy" }, heightm: 0.7, weightkg: 19.8, color: "Blue", @@ -5275,8 +5275,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 278, name: "Wingull", types: ["Water", "Flying"], - baseStats: {hp: 40, atk: 30, def: 30, spa: 55, spd: 30, spe: 85}, - abilities: {0: "Keen Eye", 1: "Hydration", H: "Rain Dish"}, + baseStats: { hp: 40, atk: 30, def: 30, spa: 55, spd: 30, spe: 85 }, + abilities: { 0: "Keen Eye", 1: "Hydration", H: "Rain Dish" }, heightm: 0.6, weightkg: 9.5, color: "White", @@ -5287,8 +5287,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 279, name: "Pelipper", types: ["Water", "Flying"], - baseStats: {hp: 60, atk: 50, def: 100, spa: 95, spd: 70, spe: 65}, - abilities: {0: "Keen Eye", 1: "Drizzle", H: "Rain Dish"}, + baseStats: { hp: 60, atk: 50, def: 100, spa: 95, spd: 70, spe: 65 }, + abilities: { 0: "Keen Eye", 1: "Drizzle", H: "Rain Dish" }, heightm: 1.2, weightkg: 28, color: "Yellow", @@ -5300,8 +5300,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 280, name: "Ralts", types: ["Psychic", "Fairy"], - baseStats: {hp: 28, atk: 25, def: 25, spa: 45, spd: 35, spe: 40}, - abilities: {0: "Synchronize", 1: "Trace", H: "Telepathy"}, + baseStats: { hp: 28, atk: 25, def: 25, spa: 45, spd: 35, spe: 40 }, + abilities: { 0: "Synchronize", 1: "Trace", H: "Telepathy" }, heightm: 0.4, weightkg: 6.6, color: "White", @@ -5312,8 +5312,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 281, name: "Kirlia", types: ["Psychic", "Fairy"], - baseStats: {hp: 38, atk: 35, def: 35, spa: 65, spd: 55, spe: 50}, - abilities: {0: "Synchronize", 1: "Trace", H: "Telepathy"}, + baseStats: { hp: 38, atk: 35, def: 35, spa: 65, spd: 55, spe: 50 }, + abilities: { 0: "Synchronize", 1: "Trace", H: "Telepathy" }, heightm: 0.8, weightkg: 20.2, color: "White", @@ -5326,8 +5326,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 282, name: "Gardevoir", types: ["Psychic", "Fairy"], - baseStats: {hp: 68, atk: 65, def: 65, spa: 125, spd: 115, spe: 80}, - abilities: {0: "Synchronize", 1: "Trace", H: "Telepathy"}, + baseStats: { hp: 68, atk: 65, def: 65, spa: 125, spd: 115, spe: 80 }, + abilities: { 0: "Synchronize", 1: "Trace", H: "Telepathy" }, heightm: 1.6, weightkg: 48.4, color: "White", @@ -5343,8 +5343,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gardevoir", forme: "Mega", types: ["Psychic", "Fairy"], - baseStats: {hp: 68, atk: 85, def: 65, spa: 165, spd: 135, spe: 100}, - abilities: {0: "Pixilate"}, + baseStats: { hp: 68, atk: 85, def: 65, spa: 165, spd: 135, spe: 100 }, + abilities: { 0: "Pixilate" }, heightm: 1.6, weightkg: 48.4, color: "White", @@ -5355,8 +5355,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 283, name: "Surskit", types: ["Bug", "Water"], - baseStats: {hp: 40, atk: 30, def: 32, spa: 50, spd: 52, spe: 65}, - abilities: {0: "Swift Swim", H: "Rain Dish"}, + baseStats: { hp: 40, atk: 30, def: 32, spa: 50, spd: 52, spe: 65 }, + abilities: { 0: "Swift Swim", H: "Rain Dish" }, heightm: 0.5, weightkg: 1.7, color: "Blue", @@ -5367,8 +5367,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 284, name: "Masquerain", types: ["Bug", "Flying"], - baseStats: {hp: 70, atk: 60, def: 62, spa: 100, spd: 82, spe: 80}, - abilities: {0: "Intimidate", H: "Unnerve"}, + baseStats: { hp: 70, atk: 60, def: 62, spa: 100, spd: 82, spe: 80 }, + abilities: { 0: "Intimidate", H: "Unnerve" }, heightm: 0.8, weightkg: 3.6, color: "Blue", @@ -5380,8 +5380,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 285, name: "Shroomish", types: ["Grass"], - baseStats: {hp: 60, atk: 40, def: 60, spa: 40, spd: 60, spe: 35}, - abilities: {0: "Effect Spore", 1: "Poison Heal", H: "Quick Feet"}, + baseStats: { hp: 60, atk: 40, def: 60, spa: 40, spd: 60, spe: 35 }, + abilities: { 0: "Effect Spore", 1: "Poison Heal", H: "Quick Feet" }, heightm: 0.4, weightkg: 4.5, color: "Brown", @@ -5392,8 +5392,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 286, name: "Breloom", types: ["Grass", "Fighting"], - baseStats: {hp: 60, atk: 130, def: 80, spa: 60, spd: 60, spe: 70}, - abilities: {0: "Effect Spore", 1: "Poison Heal", H: "Technician"}, + baseStats: { hp: 60, atk: 130, def: 80, spa: 60, spd: 60, spe: 70 }, + abilities: { 0: "Effect Spore", 1: "Poison Heal", H: "Technician" }, heightm: 1.2, weightkg: 39.2, color: "Green", @@ -5405,8 +5405,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 287, name: "Slakoth", types: ["Normal"], - baseStats: {hp: 60, atk: 60, def: 60, spa: 35, spd: 35, spe: 30}, - abilities: {0: "Truant"}, + baseStats: { hp: 60, atk: 60, def: 60, spa: 35, spd: 35, spe: 30 }, + abilities: { 0: "Truant" }, heightm: 0.8, weightkg: 24, color: "Brown", @@ -5417,8 +5417,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 288, name: "Vigoroth", types: ["Normal"], - baseStats: {hp: 80, atk: 80, def: 80, spa: 55, spd: 55, spe: 90}, - abilities: {0: "Vital Spirit"}, + baseStats: { hp: 80, atk: 80, def: 80, spa: 55, spd: 55, spe: 90 }, + abilities: { 0: "Vital Spirit" }, heightm: 1.4, weightkg: 46.5, color: "White", @@ -5431,8 +5431,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 289, name: "Slaking", types: ["Normal"], - baseStats: {hp: 150, atk: 160, def: 100, spa: 95, spd: 65, spe: 100}, - abilities: {0: "Truant"}, + baseStats: { hp: 150, atk: 160, def: 100, spa: 95, spd: 65, spe: 100 }, + abilities: { 0: "Truant" }, heightm: 2, weightkg: 130.5, color: "Brown", @@ -5444,8 +5444,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 290, name: "Nincada", types: ["Bug", "Ground"], - baseStats: {hp: 31, atk: 45, def: 90, spa: 30, spd: 30, spe: 40}, - abilities: {0: "Compound Eyes", H: "Run Away"}, + baseStats: { hp: 31, atk: 45, def: 90, spa: 30, spd: 30, spe: 40 }, + abilities: { 0: "Compound Eyes", H: "Run Away" }, heightm: 0.5, weightkg: 5.5, color: "Gray", @@ -5456,8 +5456,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 291, name: "Ninjask", types: ["Bug", "Flying"], - baseStats: {hp: 61, atk: 90, def: 45, spa: 50, spd: 50, spe: 160}, - abilities: {0: "Speed Boost", H: "Infiltrator"}, + baseStats: { hp: 61, atk: 90, def: 45, spa: 50, spd: 50, spe: 160 }, + abilities: { 0: "Speed Boost", H: "Infiltrator" }, heightm: 0.8, weightkg: 12, color: "Yellow", @@ -5470,9 +5470,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Shedinja", types: ["Bug", "Ghost"], gender: "N", - baseStats: {hp: 1, atk: 90, def: 45, spa: 30, spd: 30, spe: 40}, + baseStats: { hp: 1, atk: 90, def: 45, spa: 30, spd: 30, spe: 40 }, maxHP: 1, - abilities: {0: "Wonder Guard"}, + abilities: { 0: "Wonder Guard" }, heightm: 0.8, weightkg: 1.2, color: "Brown", @@ -5484,8 +5484,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 293, name: "Whismur", types: ["Normal"], - baseStats: {hp: 64, atk: 51, def: 23, spa: 51, spd: 23, spe: 28}, - abilities: {0: "Soundproof", H: "Rattled"}, + baseStats: { hp: 64, atk: 51, def: 23, spa: 51, spd: 23, spe: 28 }, + abilities: { 0: "Soundproof", H: "Rattled" }, heightm: 0.6, weightkg: 16.3, color: "Pink", @@ -5496,8 +5496,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 294, name: "Loudred", types: ["Normal"], - baseStats: {hp: 84, atk: 71, def: 43, spa: 71, spd: 43, spe: 48}, - abilities: {0: "Soundproof", H: "Scrappy"}, + baseStats: { hp: 84, atk: 71, def: 43, spa: 71, spd: 43, spe: 48 }, + abilities: { 0: "Soundproof", H: "Scrappy" }, heightm: 1, weightkg: 40.5, color: "Blue", @@ -5510,8 +5510,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 295, name: "Exploud", types: ["Normal"], - baseStats: {hp: 104, atk: 91, def: 63, spa: 91, spd: 73, spe: 68}, - abilities: {0: "Soundproof", H: "Scrappy"}, + baseStats: { hp: 104, atk: 91, def: 63, spa: 91, spd: 73, spe: 68 }, + abilities: { 0: "Soundproof", H: "Scrappy" }, heightm: 1.5, weightkg: 84, color: "Blue", @@ -5523,9 +5523,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 296, name: "Makuhita", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 72, atk: 60, def: 30, spa: 20, spd: 30, spe: 25}, - abilities: {0: "Thick Fat", 1: "Guts", H: "Sheer Force"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 72, atk: 60, def: 30, spa: 20, spd: 30, spe: 25 }, + abilities: { 0: "Thick Fat", 1: "Guts", H: "Sheer Force" }, heightm: 1, weightkg: 86.4, color: "Yellow", @@ -5536,9 +5536,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 297, name: "Hariyama", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 144, atk: 120, def: 60, spa: 40, spd: 60, spe: 50}, - abilities: {0: "Thick Fat", 1: "Guts", H: "Sheer Force"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 144, atk: 120, def: 60, spa: 40, spd: 60, spe: 50 }, + abilities: { 0: "Thick Fat", 1: "Guts", H: "Sheer Force" }, heightm: 2.3, weightkg: 253.8, color: "Brown", @@ -5550,9 +5550,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 298, name: "Azurill", types: ["Normal", "Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 50, atk: 20, def: 40, spa: 20, spd: 40, spe: 20}, - abilities: {0: "Thick Fat", 1: "Huge Power", H: "Sap Sipper"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 50, atk: 20, def: 40, spa: 20, spd: 40, spe: 20 }, + abilities: { 0: "Thick Fat", 1: "Huge Power", H: "Sap Sipper" }, heightm: 0.2, weightkg: 2, color: "Blue", @@ -5564,8 +5564,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 299, name: "Nosepass", types: ["Rock"], - baseStats: {hp: 30, atk: 45, def: 135, spa: 45, spd: 90, spe: 30}, - abilities: {0: "Sturdy", 1: "Magnet Pull", H: "Sand Force"}, + baseStats: { hp: 30, atk: 45, def: 135, spa: 45, spd: 90, spe: 30 }, + abilities: { 0: "Sturdy", 1: "Magnet Pull", H: "Sand Force" }, heightm: 1, weightkg: 97, color: "Gray", @@ -5576,9 +5576,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 300, name: "Skitty", types: ["Normal"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 50, atk: 45, def: 45, spa: 35, spd: 35, spe: 50}, - abilities: {0: "Cute Charm", 1: "Normalize", H: "Wonder Skin"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 50, atk: 45, def: 45, spa: 35, spd: 35, spe: 50 }, + abilities: { 0: "Cute Charm", 1: "Normalize", H: "Wonder Skin" }, heightm: 0.6, weightkg: 11, color: "Pink", @@ -5589,9 +5589,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 301, name: "Delcatty", types: ["Normal"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 70, atk: 65, def: 65, spa: 55, spd: 55, spe: 90}, - abilities: {0: "Cute Charm", 1: "Normalize", H: "Wonder Skin"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 70, atk: 65, def: 65, spa: 55, spd: 55, spe: 90 }, + abilities: { 0: "Cute Charm", 1: "Normalize", H: "Wonder Skin" }, heightm: 1.1, weightkg: 32.6, color: "Purple", @@ -5604,8 +5604,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 302, name: "Sableye", types: ["Dark", "Ghost"], - baseStats: {hp: 50, atk: 75, def: 75, spa: 65, spd: 65, spe: 50}, - abilities: {0: "Keen Eye", 1: "Stall", H: "Prankster"}, + baseStats: { hp: 50, atk: 75, def: 75, spa: 65, spd: 65, spe: 50 }, + abilities: { 0: "Keen Eye", 1: "Stall", H: "Prankster" }, heightm: 0.5, weightkg: 11, color: "Purple", @@ -5619,8 +5619,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sableye", forme: "Mega", types: ["Dark", "Ghost"], - baseStats: {hp: 50, atk: 85, def: 125, spa: 85, spd: 115, spe: 20}, - abilities: {0: "Magic Bounce"}, + baseStats: { hp: 50, atk: 85, def: 125, spa: 85, spd: 115, spe: 20 }, + abilities: { 0: "Magic Bounce" }, heightm: 0.5, weightkg: 161, color: "Purple", @@ -5631,8 +5631,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 303, name: "Mawile", types: ["Steel", "Fairy"], - baseStats: {hp: 50, atk: 85, def: 85, spa: 55, spd: 55, spe: 50}, - abilities: {0: "Hyper Cutter", 1: "Intimidate", H: "Sheer Force"}, + baseStats: { hp: 50, atk: 85, def: 85, spa: 55, spd: 55, spe: 50 }, + abilities: { 0: "Hyper Cutter", 1: "Intimidate", H: "Sheer Force" }, heightm: 0.6, weightkg: 11.5, color: "Black", @@ -5646,8 +5646,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Mawile", forme: "Mega", types: ["Steel", "Fairy"], - baseStats: {hp: 50, atk: 105, def: 125, spa: 55, spd: 95, spe: 50}, - abilities: {0: "Huge Power"}, + baseStats: { hp: 50, atk: 105, def: 125, spa: 55, spd: 95, spe: 50 }, + abilities: { 0: "Huge Power" }, heightm: 1, weightkg: 23.5, color: "Black", @@ -5658,8 +5658,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 304, name: "Aron", types: ["Steel", "Rock"], - baseStats: {hp: 50, atk: 70, def: 100, spa: 40, spd: 40, spe: 30}, - abilities: {0: "Sturdy", 1: "Rock Head", H: "Heavy Metal"}, + baseStats: { hp: 50, atk: 70, def: 100, spa: 40, spd: 40, spe: 30 }, + abilities: { 0: "Sturdy", 1: "Rock Head", H: "Heavy Metal" }, heightm: 0.4, weightkg: 60, color: "Gray", @@ -5670,8 +5670,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 305, name: "Lairon", types: ["Steel", "Rock"], - baseStats: {hp: 60, atk: 90, def: 140, spa: 50, spd: 50, spe: 40}, - abilities: {0: "Sturdy", 1: "Rock Head", H: "Heavy Metal"}, + baseStats: { hp: 60, atk: 90, def: 140, spa: 50, spd: 50, spe: 40 }, + abilities: { 0: "Sturdy", 1: "Rock Head", H: "Heavy Metal" }, heightm: 0.9, weightkg: 120, color: "Gray", @@ -5684,8 +5684,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 306, name: "Aggron", types: ["Steel", "Rock"], - baseStats: {hp: 70, atk: 110, def: 180, spa: 60, spd: 60, spe: 50}, - abilities: {0: "Sturdy", 1: "Rock Head", H: "Heavy Metal"}, + baseStats: { hp: 70, atk: 110, def: 180, spa: 60, spd: 60, spe: 50 }, + abilities: { 0: "Sturdy", 1: "Rock Head", H: "Heavy Metal" }, heightm: 2.1, weightkg: 360, color: "Gray", @@ -5701,8 +5701,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Aggron", forme: "Mega", types: ["Steel"], - baseStats: {hp: 70, atk: 140, def: 230, spa: 60, spd: 80, spe: 50}, - abilities: {0: "Filter"}, + baseStats: { hp: 70, atk: 140, def: 230, spa: 60, spd: 80, spe: 50 }, + abilities: { 0: "Filter" }, heightm: 2.2, weightkg: 395, color: "Gray", @@ -5713,8 +5713,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 307, name: "Meditite", types: ["Fighting", "Psychic"], - baseStats: {hp: 30, atk: 40, def: 55, spa: 40, spd: 55, spe: 60}, - abilities: {0: "Pure Power", H: "Telepathy"}, + baseStats: { hp: 30, atk: 40, def: 55, spa: 40, spd: 55, spe: 60 }, + abilities: { 0: "Pure Power", H: "Telepathy" }, heightm: 0.6, weightkg: 11.2, color: "Blue", @@ -5725,8 +5725,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 308, name: "Medicham", types: ["Fighting", "Psychic"], - baseStats: {hp: 60, atk: 60, def: 75, spa: 60, spd: 75, spe: 80}, - abilities: {0: "Pure Power", H: "Telepathy"}, + baseStats: { hp: 60, atk: 60, def: 75, spa: 60, spd: 75, spe: 80 }, + abilities: { 0: "Pure Power", H: "Telepathy" }, heightm: 1.3, weightkg: 31.5, color: "Red", @@ -5742,8 +5742,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Medicham", forme: "Mega", types: ["Fighting", "Psychic"], - baseStats: {hp: 60, atk: 100, def: 85, spa: 80, spd: 85, spe: 100}, - abilities: {0: "Pure Power"}, + baseStats: { hp: 60, atk: 100, def: 85, spa: 80, spd: 85, spe: 100 }, + abilities: { 0: "Pure Power" }, heightm: 1.3, weightkg: 31.5, color: "Red", @@ -5754,8 +5754,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 309, name: "Electrike", types: ["Electric"], - baseStats: {hp: 40, atk: 45, def: 40, spa: 65, spd: 40, spe: 65}, - abilities: {0: "Static", 1: "Lightning Rod", H: "Minus"}, + baseStats: { hp: 40, atk: 45, def: 40, spa: 65, spd: 40, spe: 65 }, + abilities: { 0: "Static", 1: "Lightning Rod", H: "Minus" }, heightm: 0.6, weightkg: 15.2, color: "Green", @@ -5766,8 +5766,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 310, name: "Manectric", types: ["Electric"], - baseStats: {hp: 70, atk: 75, def: 60, spa: 105, spd: 60, spe: 105}, - abilities: {0: "Static", 1: "Lightning Rod", H: "Minus"}, + baseStats: { hp: 70, atk: 75, def: 60, spa: 105, spd: 60, spe: 105 }, + abilities: { 0: "Static", 1: "Lightning Rod", H: "Minus" }, heightm: 1.5, weightkg: 40.2, color: "Yellow", @@ -5783,8 +5783,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Manectric", forme: "Mega", types: ["Electric"], - baseStats: {hp: 70, atk: 75, def: 80, spa: 135, spd: 80, spe: 135}, - abilities: {0: "Intimidate"}, + baseStats: { hp: 70, atk: 75, def: 80, spa: 135, spd: 80, spe: 135 }, + abilities: { 0: "Intimidate" }, heightm: 1.8, weightkg: 44, color: "Yellow", @@ -5795,8 +5795,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 311, name: "Plusle", types: ["Electric"], - baseStats: {hp: 60, atk: 50, def: 40, spa: 85, spd: 75, spe: 95}, - abilities: {0: "Plus", H: "Lightning Rod"}, + baseStats: { hp: 60, atk: 50, def: 40, spa: 85, spd: 75, spe: 95 }, + abilities: { 0: "Plus", H: "Lightning Rod" }, heightm: 0.4, weightkg: 4.2, color: "Yellow", @@ -5806,8 +5806,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 312, name: "Minun", types: ["Electric"], - baseStats: {hp: 60, atk: 40, def: 50, spa: 75, spd: 85, spe: 95}, - abilities: {0: "Minus", H: "Volt Absorb"}, + baseStats: { hp: 60, atk: 40, def: 50, spa: 75, spd: 85, spe: 95 }, + abilities: { 0: "Minus", H: "Volt Absorb" }, heightm: 0.4, weightkg: 4.2, color: "Yellow", @@ -5818,8 +5818,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Volbeat", types: ["Bug"], gender: "M", - baseStats: {hp: 65, atk: 73, def: 75, spa: 47, spd: 85, spe: 85}, - abilities: {0: "Illuminate", 1: "Swarm", H: "Prankster"}, + baseStats: { hp: 65, atk: 73, def: 75, spa: 47, spd: 85, spe: 85 }, + abilities: { 0: "Illuminate", 1: "Swarm", H: "Prankster" }, heightm: 0.7, weightkg: 17.7, color: "Gray", @@ -5831,8 +5831,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Illumise", types: ["Bug"], gender: "F", - baseStats: {hp: 65, atk: 47, def: 75, spa: 73, spd: 85, spe: 85}, - abilities: {0: "Oblivious", 1: "Tinted Lens", H: "Prankster"}, + baseStats: { hp: 65, atk: 47, def: 75, spa: 73, spd: 85, spe: 85 }, + abilities: { 0: "Oblivious", 1: "Tinted Lens", H: "Prankster" }, heightm: 0.6, weightkg: 17.7, color: "Purple", @@ -5842,8 +5842,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 315, name: "Roselia", types: ["Grass", "Poison"], - baseStats: {hp: 50, atk: 60, def: 45, spa: 100, spd: 80, spe: 65}, - abilities: {0: "Natural Cure", 1: "Poison Point", H: "Leaf Guard"}, + baseStats: { hp: 50, atk: 60, def: 45, spa: 100, spd: 80, spe: 65 }, + abilities: { 0: "Natural Cure", 1: "Poison Point", H: "Leaf Guard" }, heightm: 0.3, weightkg: 2, color: "Green", @@ -5858,8 +5858,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 316, name: "Gulpin", types: ["Poison"], - baseStats: {hp: 70, atk: 43, def: 53, spa: 43, spd: 53, spe: 40}, - abilities: {0: "Liquid Ooze", 1: "Sticky Hold", H: "Gluttony"}, + baseStats: { hp: 70, atk: 43, def: 53, spa: 43, spd: 53, spe: 40 }, + abilities: { 0: "Liquid Ooze", 1: "Sticky Hold", H: "Gluttony" }, heightm: 0.4, weightkg: 10.3, color: "Green", @@ -5870,8 +5870,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 317, name: "Swalot", types: ["Poison"], - baseStats: {hp: 100, atk: 73, def: 83, spa: 73, spd: 83, spe: 55}, - abilities: {0: "Liquid Ooze", 1: "Sticky Hold", H: "Gluttony"}, + baseStats: { hp: 100, atk: 73, def: 83, spa: 73, spd: 83, spe: 55 }, + abilities: { 0: "Liquid Ooze", 1: "Sticky Hold", H: "Gluttony" }, heightm: 1.7, weightkg: 80, color: "Purple", @@ -5883,8 +5883,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 318, name: "Carvanha", types: ["Water", "Dark"], - baseStats: {hp: 45, atk: 90, def: 20, spa: 65, spd: 20, spe: 65}, - abilities: {0: "Rough Skin", H: "Speed Boost"}, + baseStats: { hp: 45, atk: 90, def: 20, spa: 65, spd: 20, spe: 65 }, + abilities: { 0: "Rough Skin", H: "Speed Boost" }, heightm: 0.8, weightkg: 20.8, color: "Red", @@ -5895,8 +5895,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 319, name: "Sharpedo", types: ["Water", "Dark"], - baseStats: {hp: 70, atk: 120, def: 40, spa: 95, spd: 40, spe: 95}, - abilities: {0: "Rough Skin", H: "Speed Boost"}, + baseStats: { hp: 70, atk: 120, def: 40, spa: 95, spd: 40, spe: 95 }, + abilities: { 0: "Rough Skin", H: "Speed Boost" }, heightm: 1.8, weightkg: 88.8, color: "Blue", @@ -5912,8 +5912,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sharpedo", forme: "Mega", types: ["Water", "Dark"], - baseStats: {hp: 70, atk: 140, def: 70, spa: 110, spd: 65, spe: 105}, - abilities: {0: "Strong Jaw"}, + baseStats: { hp: 70, atk: 140, def: 70, spa: 110, spd: 65, spe: 105 }, + abilities: { 0: "Strong Jaw" }, heightm: 2.5, weightkg: 130.3, color: "Blue", @@ -5924,8 +5924,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 320, name: "Wailmer", types: ["Water"], - baseStats: {hp: 130, atk: 70, def: 35, spa: 70, spd: 35, spe: 60}, - abilities: {0: "Water Veil", 1: "Oblivious", H: "Pressure"}, + baseStats: { hp: 130, atk: 70, def: 35, spa: 70, spd: 35, spe: 60 }, + abilities: { 0: "Water Veil", 1: "Oblivious", H: "Pressure" }, heightm: 2, weightkg: 130, color: "Blue", @@ -5936,8 +5936,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 321, name: "Wailord", types: ["Water"], - baseStats: {hp: 170, atk: 90, def: 45, spa: 90, spd: 45, spe: 60}, - abilities: {0: "Water Veil", 1: "Oblivious", H: "Pressure"}, + baseStats: { hp: 170, atk: 90, def: 45, spa: 90, spd: 45, spe: 60 }, + abilities: { 0: "Water Veil", 1: "Oblivious", H: "Pressure" }, heightm: 14.5, weightkg: 398, color: "Blue", @@ -5949,8 +5949,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 322, name: "Numel", types: ["Fire", "Ground"], - baseStats: {hp: 60, atk: 60, def: 40, spa: 65, spd: 45, spe: 35}, - abilities: {0: "Oblivious", 1: "Simple", H: "Own Tempo"}, + baseStats: { hp: 60, atk: 60, def: 40, spa: 65, spd: 45, spe: 35 }, + abilities: { 0: "Oblivious", 1: "Simple", H: "Own Tempo" }, heightm: 0.7, weightkg: 24, color: "Yellow", @@ -5961,8 +5961,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 323, name: "Camerupt", types: ["Fire", "Ground"], - baseStats: {hp: 70, atk: 100, def: 70, spa: 105, spd: 75, spe: 40}, - abilities: {0: "Magma Armor", 1: "Solid Rock", H: "Anger Point"}, + baseStats: { hp: 70, atk: 100, def: 70, spa: 105, spd: 75, spe: 40 }, + abilities: { 0: "Magma Armor", 1: "Solid Rock", H: "Anger Point" }, heightm: 1.9, weightkg: 220, color: "Red", @@ -5978,8 +5978,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Camerupt", forme: "Mega", types: ["Fire", "Ground"], - baseStats: {hp: 70, atk: 120, def: 100, spa: 145, spd: 105, spe: 20}, - abilities: {0: "Sheer Force"}, + baseStats: { hp: 70, atk: 120, def: 100, spa: 145, spd: 105, spe: 20 }, + abilities: { 0: "Sheer Force" }, heightm: 2.5, weightkg: 320.5, color: "Red", @@ -5990,8 +5990,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 324, name: "Torkoal", types: ["Fire"], - baseStats: {hp: 70, atk: 85, def: 140, spa: 85, spd: 70, spe: 20}, - abilities: {0: "White Smoke", 1: "Drought", H: "Shell Armor"}, + baseStats: { hp: 70, atk: 85, def: 140, spa: 85, spd: 70, spe: 20 }, + abilities: { 0: "White Smoke", 1: "Drought", H: "Shell Armor" }, heightm: 0.5, weightkg: 80.4, color: "Brown", @@ -6001,8 +6001,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 325, name: "Spoink", types: ["Psychic"], - baseStats: {hp: 60, atk: 25, def: 35, spa: 70, spd: 80, spe: 60}, - abilities: {0: "Thick Fat", 1: "Own Tempo", H: "Gluttony"}, + baseStats: { hp: 60, atk: 25, def: 35, spa: 70, spd: 80, spe: 60 }, + abilities: { 0: "Thick Fat", 1: "Own Tempo", H: "Gluttony" }, heightm: 0.7, weightkg: 30.6, color: "Black", @@ -6013,8 +6013,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 326, name: "Grumpig", types: ["Psychic"], - baseStats: {hp: 80, atk: 45, def: 65, spa: 90, spd: 110, spe: 80}, - abilities: {0: "Thick Fat", 1: "Own Tempo", H: "Gluttony"}, + baseStats: { hp: 80, atk: 45, def: 65, spa: 90, spd: 110, spe: 80 }, + abilities: { 0: "Thick Fat", 1: "Own Tempo", H: "Gluttony" }, heightm: 0.9, weightkg: 71.5, color: "Purple", @@ -6026,8 +6026,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 327, name: "Spinda", types: ["Normal"], - baseStats: {hp: 60, atk: 60, def: 60, spa: 60, spd: 60, spe: 60}, - abilities: {0: "Own Tempo", 1: "Tangled Feet", H: "Contrary"}, + baseStats: { hp: 60, atk: 60, def: 60, spa: 60, spd: 60, spe: 60 }, + abilities: { 0: "Own Tempo", 1: "Tangled Feet", H: "Contrary" }, heightm: 1.1, weightkg: 5, color: "Brown", @@ -6037,8 +6037,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 328, name: "Trapinch", types: ["Ground"], - baseStats: {hp: 45, atk: 100, def: 45, spa: 45, spd: 45, spe: 10}, - abilities: {0: "Hyper Cutter", 1: "Arena Trap", H: "Sheer Force"}, + baseStats: { hp: 45, atk: 100, def: 45, spa: 45, spd: 45, spe: 10 }, + abilities: { 0: "Hyper Cutter", 1: "Arena Trap", H: "Sheer Force" }, heightm: 0.7, weightkg: 15, color: "Brown", @@ -6049,8 +6049,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 329, name: "Vibrava", types: ["Ground", "Dragon"], - baseStats: {hp: 50, atk: 70, def: 50, spa: 50, spd: 50, spe: 70}, - abilities: {0: "Levitate"}, + baseStats: { hp: 50, atk: 70, def: 50, spa: 50, spd: 50, spe: 70 }, + abilities: { 0: "Levitate" }, heightm: 1.1, weightkg: 15.3, color: "Green", @@ -6063,8 +6063,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 330, name: "Flygon", types: ["Ground", "Dragon"], - baseStats: {hp: 80, atk: 100, def: 80, spa: 80, spd: 80, spe: 100}, - abilities: {0: "Levitate"}, + baseStats: { hp: 80, atk: 100, def: 80, spa: 80, spd: 80, spe: 100 }, + abilities: { 0: "Levitate" }, heightm: 2, weightkg: 82, color: "Green", @@ -6076,8 +6076,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 331, name: "Cacnea", types: ["Grass"], - baseStats: {hp: 50, atk: 85, def: 40, spa: 85, spd: 40, spe: 35}, - abilities: {0: "Sand Veil", H: "Water Absorb"}, + baseStats: { hp: 50, atk: 85, def: 40, spa: 85, spd: 40, spe: 35 }, + abilities: { 0: "Sand Veil", H: "Water Absorb" }, heightm: 0.4, weightkg: 51.3, color: "Green", @@ -6088,8 +6088,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 332, name: "Cacturne", types: ["Grass", "Dark"], - baseStats: {hp: 70, atk: 115, def: 60, spa: 115, spd: 60, spe: 55}, - abilities: {0: "Sand Veil", H: "Water Absorb"}, + baseStats: { hp: 70, atk: 115, def: 60, spa: 115, spd: 60, spe: 55 }, + abilities: { 0: "Sand Veil", H: "Water Absorb" }, heightm: 1.3, weightkg: 77.4, color: "Green", @@ -6101,8 +6101,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 333, name: "Swablu", types: ["Normal", "Flying"], - baseStats: {hp: 45, atk: 40, def: 60, spa: 40, spd: 75, spe: 50}, - abilities: {0: "Natural Cure", H: "Cloud Nine"}, + baseStats: { hp: 45, atk: 40, def: 60, spa: 40, spd: 75, spe: 50 }, + abilities: { 0: "Natural Cure", H: "Cloud Nine" }, heightm: 0.4, weightkg: 1.2, color: "Blue", @@ -6113,8 +6113,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 334, name: "Altaria", types: ["Dragon", "Flying"], - baseStats: {hp: 75, atk: 70, def: 90, spa: 70, spd: 105, spe: 80}, - abilities: {0: "Natural Cure", H: "Cloud Nine"}, + baseStats: { hp: 75, atk: 70, def: 90, spa: 70, spd: 105, spe: 80 }, + abilities: { 0: "Natural Cure", H: "Cloud Nine" }, heightm: 1.1, weightkg: 20.6, color: "Blue", @@ -6130,8 +6130,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Altaria", forme: "Mega", types: ["Dragon", "Fairy"], - baseStats: {hp: 75, atk: 110, def: 110, spa: 110, spd: 105, spe: 80}, - abilities: {0: "Pixilate"}, + baseStats: { hp: 75, atk: 110, def: 110, spa: 110, spd: 105, spe: 80 }, + abilities: { 0: "Pixilate" }, heightm: 1.5, weightkg: 20.6, color: "Blue", @@ -6142,8 +6142,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 335, name: "Zangoose", types: ["Normal"], - baseStats: {hp: 73, atk: 115, def: 60, spa: 60, spd: 60, spe: 90}, - abilities: {0: "Immunity", H: "Toxic Boost"}, + baseStats: { hp: 73, atk: 115, def: 60, spa: 60, spd: 60, spe: 90 }, + abilities: { 0: "Immunity", H: "Toxic Boost" }, heightm: 1.3, weightkg: 40.3, color: "White", @@ -6153,8 +6153,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 336, name: "Seviper", types: ["Poison"], - baseStats: {hp: 73, atk: 100, def: 60, spa: 100, spd: 60, spe: 65}, - abilities: {0: "Shed Skin", H: "Infiltrator"}, + baseStats: { hp: 73, atk: 100, def: 60, spa: 100, spd: 60, spe: 65 }, + abilities: { 0: "Shed Skin", H: "Infiltrator" }, heightm: 2.7, weightkg: 52.5, color: "Black", @@ -6165,8 +6165,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Lunatone", types: ["Rock", "Psychic"], gender: "N", - baseStats: {hp: 90, atk: 55, def: 65, spa: 95, spd: 85, spe: 70}, - abilities: {0: "Levitate"}, + baseStats: { hp: 90, atk: 55, def: 65, spa: 95, spd: 85, spe: 70 }, + abilities: { 0: "Levitate" }, heightm: 1, weightkg: 168, color: "Yellow", @@ -6177,8 +6177,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Solrock", types: ["Rock", "Psychic"], gender: "N", - baseStats: {hp: 90, atk: 95, def: 85, spa: 55, spd: 65, spe: 70}, - abilities: {0: "Levitate"}, + baseStats: { hp: 90, atk: 95, def: 85, spa: 55, spd: 65, spe: 70 }, + abilities: { 0: "Levitate" }, heightm: 1.2, weightkg: 154, color: "Red", @@ -6188,8 +6188,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 339, name: "Barboach", types: ["Water", "Ground"], - baseStats: {hp: 50, atk: 48, def: 43, spa: 46, spd: 41, spe: 60}, - abilities: {0: "Oblivious", 1: "Anticipation", H: "Hydration"}, + baseStats: { hp: 50, atk: 48, def: 43, spa: 46, spd: 41, spe: 60 }, + abilities: { 0: "Oblivious", 1: "Anticipation", H: "Hydration" }, heightm: 0.4, weightkg: 1.9, color: "Gray", @@ -6200,8 +6200,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 340, name: "Whiscash", types: ["Water", "Ground"], - baseStats: {hp: 110, atk: 78, def: 73, spa: 76, spd: 71, spe: 60}, - abilities: {0: "Oblivious", 1: "Anticipation", H: "Hydration"}, + baseStats: { hp: 110, atk: 78, def: 73, spa: 76, spd: 71, spe: 60 }, + abilities: { 0: "Oblivious", 1: "Anticipation", H: "Hydration" }, heightm: 0.9, weightkg: 23.6, color: "Blue", @@ -6213,8 +6213,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 341, name: "Corphish", types: ["Water"], - baseStats: {hp: 43, atk: 80, def: 65, spa: 50, spd: 35, spe: 35}, - abilities: {0: "Hyper Cutter", 1: "Shell Armor", H: "Adaptability"}, + baseStats: { hp: 43, atk: 80, def: 65, spa: 50, spd: 35, spe: 35 }, + abilities: { 0: "Hyper Cutter", 1: "Shell Armor", H: "Adaptability" }, heightm: 0.6, weightkg: 11.5, color: "Red", @@ -6225,8 +6225,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 342, name: "Crawdaunt", types: ["Water", "Dark"], - baseStats: {hp: 63, atk: 120, def: 85, spa: 90, spd: 55, spe: 55}, - abilities: {0: "Hyper Cutter", 1: "Shell Armor", H: "Adaptability"}, + baseStats: { hp: 63, atk: 120, def: 85, spa: 90, spd: 55, spe: 55 }, + abilities: { 0: "Hyper Cutter", 1: "Shell Armor", H: "Adaptability" }, heightm: 1.1, weightkg: 32.8, color: "Red", @@ -6239,8 +6239,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Baltoy", types: ["Ground", "Psychic"], gender: "N", - baseStats: {hp: 40, atk: 40, def: 55, spa: 40, spd: 70, spe: 55}, - abilities: {0: "Levitate"}, + baseStats: { hp: 40, atk: 40, def: 55, spa: 40, spd: 70, spe: 55 }, + abilities: { 0: "Levitate" }, heightm: 0.5, weightkg: 21.5, color: "Brown", @@ -6252,8 +6252,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Claydol", types: ["Ground", "Psychic"], gender: "N", - baseStats: {hp: 60, atk: 70, def: 105, spa: 70, spd: 120, spe: 75}, - abilities: {0: "Levitate"}, + baseStats: { hp: 60, atk: 70, def: 105, spa: 70, spd: 120, spe: 75 }, + abilities: { 0: "Levitate" }, heightm: 1.5, weightkg: 108, color: "Black", @@ -6265,9 +6265,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 345, name: "Lileep", types: ["Rock", "Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 66, atk: 41, def: 77, spa: 61, spd: 87, spe: 23}, - abilities: {0: "Suction Cups", H: "Storm Drain"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 66, atk: 41, def: 77, spa: 61, spd: 87, spe: 23 }, + abilities: { 0: "Suction Cups", H: "Storm Drain" }, heightm: 1, weightkg: 23.8, color: "Purple", @@ -6278,9 +6278,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 346, name: "Cradily", types: ["Rock", "Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 86, atk: 81, def: 97, spa: 81, spd: 107, spe: 43}, - abilities: {0: "Suction Cups", H: "Storm Drain"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 86, atk: 81, def: 97, spa: 81, spd: 107, spe: 43 }, + abilities: { 0: "Suction Cups", H: "Storm Drain" }, heightm: 1.5, weightkg: 60.4, color: "Green", @@ -6292,9 +6292,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 347, name: "Anorith", types: ["Rock", "Bug"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 45, atk: 95, def: 50, spa: 40, spd: 50, spe: 75}, - abilities: {0: "Battle Armor", H: "Swift Swim"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 45, atk: 95, def: 50, spa: 40, spd: 50, spe: 75 }, + abilities: { 0: "Battle Armor", H: "Swift Swim" }, heightm: 0.7, weightkg: 12.5, color: "Gray", @@ -6305,9 +6305,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 348, name: "Armaldo", types: ["Rock", "Bug"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 125, def: 100, spa: 70, spd: 80, spe: 45}, - abilities: {0: "Battle Armor", H: "Swift Swim"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 125, def: 100, spa: 70, spd: 80, spe: 45 }, + abilities: { 0: "Battle Armor", H: "Swift Swim" }, heightm: 1.5, weightkg: 68.2, color: "Gray", @@ -6319,8 +6319,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 349, name: "Feebas", types: ["Water"], - baseStats: {hp: 20, atk: 15, def: 20, spa: 10, spd: 55, spe: 80}, - abilities: {0: "Swift Swim", 1: "Oblivious", H: "Adaptability"}, + baseStats: { hp: 20, atk: 15, def: 20, spa: 10, spd: 55, spe: 80 }, + abilities: { 0: "Swift Swim", 1: "Oblivious", H: "Adaptability" }, heightm: 0.6, weightkg: 7.4, color: "Brown", @@ -6331,8 +6331,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 350, name: "Milotic", types: ["Water"], - baseStats: {hp: 95, atk: 60, def: 79, spa: 100, spd: 125, spe: 81}, - abilities: {0: "Marvel Scale", 1: "Competitive", H: "Cute Charm"}, + baseStats: { hp: 95, atk: 60, def: 79, spa: 100, spd: 125, spe: 81 }, + abilities: { 0: "Marvel Scale", 1: "Competitive", H: "Cute Charm" }, heightm: 6.2, weightkg: 162, color: "Pink", @@ -6345,8 +6345,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 351, name: "Castform", types: ["Normal"], - baseStats: {hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70}, - abilities: {0: "Forecast"}, + baseStats: { hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70 }, + abilities: { 0: "Forecast" }, heightm: 0.3, weightkg: 0.8, color: "Gray", @@ -6360,8 +6360,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Castform", forme: "Sunny", types: ["Fire"], - baseStats: {hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70}, - abilities: {0: "Forecast"}, + baseStats: { hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70 }, + abilities: { 0: "Forecast" }, heightm: 0.3, weightkg: 0.8, color: "Red", @@ -6375,8 +6375,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Castform", forme: "Rainy", types: ["Water"], - baseStats: {hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70}, - abilities: {0: "Forecast"}, + baseStats: { hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70 }, + abilities: { 0: "Forecast" }, heightm: 0.3, weightkg: 0.8, color: "Blue", @@ -6390,8 +6390,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Castform", forme: "Snowy", types: ["Ice"], - baseStats: {hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70}, - abilities: {0: "Forecast"}, + baseStats: { hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70 }, + abilities: { 0: "Forecast" }, heightm: 0.3, weightkg: 0.8, color: "White", @@ -6403,8 +6403,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 352, name: "Kecleon", types: ["Normal"], - baseStats: {hp: 60, atk: 90, def: 70, spa: 60, spd: 120, spe: 40}, - abilities: {0: "Color Change", H: "Protean"}, + baseStats: { hp: 60, atk: 90, def: 70, spa: 60, spd: 120, spe: 40 }, + abilities: { 0: "Color Change", H: "Protean" }, heightm: 1, weightkg: 22, color: "Green", @@ -6414,8 +6414,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 353, name: "Shuppet", types: ["Ghost"], - baseStats: {hp: 44, atk: 75, def: 35, spa: 63, spd: 33, spe: 45}, - abilities: {0: "Insomnia", 1: "Frisk", H: "Cursed Body"}, + baseStats: { hp: 44, atk: 75, def: 35, spa: 63, spd: 33, spe: 45 }, + abilities: { 0: "Insomnia", 1: "Frisk", H: "Cursed Body" }, heightm: 0.6, weightkg: 2.3, color: "Black", @@ -6426,8 +6426,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 354, name: "Banette", types: ["Ghost"], - baseStats: {hp: 64, atk: 115, def: 65, spa: 83, spd: 63, spe: 65}, - abilities: {0: "Insomnia", 1: "Frisk", H: "Cursed Body"}, + baseStats: { hp: 64, atk: 115, def: 65, spa: 83, spd: 63, spe: 65 }, + abilities: { 0: "Insomnia", 1: "Frisk", H: "Cursed Body" }, heightm: 1.1, weightkg: 12.5, color: "Black", @@ -6443,8 +6443,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Banette", forme: "Mega", types: ["Ghost"], - baseStats: {hp: 64, atk: 165, def: 75, spa: 93, spd: 83, spe: 75}, - abilities: {0: "Prankster"}, + baseStats: { hp: 64, atk: 165, def: 75, spa: 93, spd: 83, spe: 75 }, + abilities: { 0: "Prankster" }, heightm: 1.2, weightkg: 13, color: "Black", @@ -6455,8 +6455,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 355, name: "Duskull", types: ["Ghost"], - baseStats: {hp: 20, atk: 40, def: 90, spa: 30, spd: 90, spe: 25}, - abilities: {0: "Levitate", H: "Frisk"}, + baseStats: { hp: 20, atk: 40, def: 90, spa: 30, spd: 90, spe: 25 }, + abilities: { 0: "Levitate", H: "Frisk" }, heightm: 0.8, weightkg: 15, color: "Black", @@ -6467,8 +6467,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 356, name: "Dusclops", types: ["Ghost"], - baseStats: {hp: 40, atk: 70, def: 130, spa: 60, spd: 130, spe: 25}, - abilities: {0: "Pressure", H: "Frisk"}, + baseStats: { hp: 40, atk: 70, def: 130, spa: 60, spd: 130, spe: 25 }, + abilities: { 0: "Pressure", H: "Frisk" }, heightm: 1.6, weightkg: 30.6, color: "Black", @@ -6481,8 +6481,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 357, name: "Tropius", types: ["Grass", "Flying"], - baseStats: {hp: 99, atk: 68, def: 83, spa: 72, spd: 87, spe: 51}, - abilities: {0: "Chlorophyll", 1: "Solar Power", H: "Harvest"}, + baseStats: { hp: 99, atk: 68, def: 83, spa: 72, spd: 87, spe: 51 }, + abilities: { 0: "Chlorophyll", 1: "Solar Power", H: "Harvest" }, heightm: 2, weightkg: 100, color: "Green", @@ -6492,8 +6492,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 358, name: "Chimecho", types: ["Psychic"], - baseStats: {hp: 75, atk: 50, def: 80, spa: 95, spd: 90, spe: 65}, - abilities: {0: "Levitate"}, + baseStats: { hp: 75, atk: 50, def: 80, spa: 95, spd: 90, spe: 65 }, + abilities: { 0: "Levitate" }, heightm: 0.6, weightkg: 1, color: "Blue", @@ -6507,8 +6507,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 359, name: "Absol", types: ["Dark"], - baseStats: {hp: 65, atk: 130, def: 60, spa: 75, spd: 60, spe: 75}, - abilities: {0: "Pressure", 1: "Super Luck", H: "Justified"}, + baseStats: { hp: 65, atk: 130, def: 60, spa: 75, spd: 60, spe: 75 }, + abilities: { 0: "Pressure", 1: "Super Luck", H: "Justified" }, heightm: 1.2, weightkg: 47, color: "White", @@ -6522,8 +6522,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Absol", forme: "Mega", types: ["Dark"], - baseStats: {hp: 65, atk: 150, def: 60, spa: 115, spd: 60, spe: 115}, - abilities: {0: "Magic Bounce"}, + baseStats: { hp: 65, atk: 150, def: 60, spa: 115, spd: 60, spe: 115 }, + abilities: { 0: "Magic Bounce" }, heightm: 1.2, weightkg: 49, color: "White", @@ -6534,8 +6534,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 360, name: "Wynaut", types: ["Psychic"], - baseStats: {hp: 95, atk: 23, def: 48, spa: 23, spd: 48, spe: 23}, - abilities: {0: "Shadow Tag", H: "Telepathy"}, + baseStats: { hp: 95, atk: 23, def: 48, spa: 23, spd: 48, spe: 23 }, + abilities: { 0: "Shadow Tag", H: "Telepathy" }, heightm: 0.6, weightkg: 14, color: "Blue", @@ -6547,8 +6547,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 361, name: "Snorunt", types: ["Ice"], - baseStats: {hp: 50, atk: 50, def: 50, spa: 50, spd: 50, spe: 50}, - abilities: {0: "Inner Focus", 1: "Ice Body", H: "Moody"}, + baseStats: { hp: 50, atk: 50, def: 50, spa: 50, spd: 50, spe: 50 }, + abilities: { 0: "Inner Focus", 1: "Ice Body", H: "Moody" }, heightm: 0.7, weightkg: 16.8, color: "Gray", @@ -6559,8 +6559,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 362, name: "Glalie", types: ["Ice"], - baseStats: {hp: 80, atk: 80, def: 80, spa: 80, spd: 80, spe: 80}, - abilities: {0: "Inner Focus", 1: "Ice Body", H: "Moody"}, + baseStats: { hp: 80, atk: 80, def: 80, spa: 80, spd: 80, spe: 80 }, + abilities: { 0: "Inner Focus", 1: "Ice Body", H: "Moody" }, heightm: 1.5, weightkg: 256.5, color: "Gray", @@ -6576,8 +6576,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Glalie", forme: "Mega", types: ["Ice"], - baseStats: {hp: 80, atk: 120, def: 80, spa: 120, spd: 80, spe: 100}, - abilities: {0: "Refrigerate"}, + baseStats: { hp: 80, atk: 120, def: 80, spa: 120, spd: 80, spe: 100 }, + abilities: { 0: "Refrigerate" }, heightm: 2.1, weightkg: 350.2, color: "Gray", @@ -6588,8 +6588,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 363, name: "Spheal", types: ["Ice", "Water"], - baseStats: {hp: 70, atk: 40, def: 50, spa: 55, spd: 50, spe: 25}, - abilities: {0: "Thick Fat", 1: "Ice Body", H: "Oblivious"}, + baseStats: { hp: 70, atk: 40, def: 50, spa: 55, spd: 50, spe: 25 }, + abilities: { 0: "Thick Fat", 1: "Ice Body", H: "Oblivious" }, heightm: 0.8, weightkg: 39.5, color: "Blue", @@ -6600,8 +6600,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 364, name: "Sealeo", types: ["Ice", "Water"], - baseStats: {hp: 90, atk: 60, def: 70, spa: 75, spd: 70, spe: 45}, - abilities: {0: "Thick Fat", 1: "Ice Body", H: "Oblivious"}, + baseStats: { hp: 90, atk: 60, def: 70, spa: 75, spd: 70, spe: 45 }, + abilities: { 0: "Thick Fat", 1: "Ice Body", H: "Oblivious" }, heightm: 1.1, weightkg: 87.6, color: "Blue", @@ -6614,8 +6614,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 365, name: "Walrein", types: ["Ice", "Water"], - baseStats: {hp: 110, atk: 80, def: 90, spa: 95, spd: 90, spe: 65}, - abilities: {0: "Thick Fat", 1: "Ice Body", H: "Oblivious"}, + baseStats: { hp: 110, atk: 80, def: 90, spa: 95, spd: 90, spe: 65 }, + abilities: { 0: "Thick Fat", 1: "Ice Body", H: "Oblivious" }, heightm: 1.4, weightkg: 150.6, color: "Blue", @@ -6627,8 +6627,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 366, name: "Clamperl", types: ["Water"], - baseStats: {hp: 35, atk: 64, def: 85, spa: 74, spd: 55, spe: 32}, - abilities: {0: "Shell Armor", H: "Rattled"}, + baseStats: { hp: 35, atk: 64, def: 85, spa: 74, spd: 55, spe: 32 }, + abilities: { 0: "Shell Armor", H: "Rattled" }, heightm: 0.4, weightkg: 52.5, color: "Blue", @@ -6639,8 +6639,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 367, name: "Huntail", types: ["Water"], - baseStats: {hp: 55, atk: 104, def: 105, spa: 94, spd: 75, spe: 52}, - abilities: {0: "Swift Swim", H: "Water Veil"}, + baseStats: { hp: 55, atk: 104, def: 105, spa: 94, spd: 75, spe: 52 }, + abilities: { 0: "Swift Swim", H: "Water Veil" }, heightm: 1.7, weightkg: 27, color: "Blue", @@ -6653,8 +6653,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 368, name: "Gorebyss", types: ["Water"], - baseStats: {hp: 55, atk: 84, def: 105, spa: 114, spd: 75, spe: 52}, - abilities: {0: "Swift Swim", H: "Hydration"}, + baseStats: { hp: 55, atk: 84, def: 105, spa: 114, spd: 75, spe: 52 }, + abilities: { 0: "Swift Swim", H: "Hydration" }, heightm: 1.8, weightkg: 22.6, color: "Pink", @@ -6667,9 +6667,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 369, name: "Relicanth", types: ["Water", "Rock"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 90, def: 130, spa: 45, spd: 65, spe: 55}, - abilities: {0: "Swift Swim", 1: "Rock Head", H: "Sturdy"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 90, def: 130, spa: 45, spd: 65, spe: 55 }, + abilities: { 0: "Swift Swim", 1: "Rock Head", H: "Sturdy" }, heightm: 1, weightkg: 23.4, color: "Gray", @@ -6679,9 +6679,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 370, name: "Luvdisc", types: ["Water"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 43, atk: 30, def: 55, spa: 40, spd: 65, spe: 97}, - abilities: {0: "Swift Swim", H: "Hydration"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 43, atk: 30, def: 55, spa: 40, spd: 65, spe: 97 }, + abilities: { 0: "Swift Swim", H: "Hydration" }, heightm: 0.6, weightkg: 8.7, color: "Pink", @@ -6691,8 +6691,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 371, name: "Bagon", types: ["Dragon"], - baseStats: {hp: 45, atk: 75, def: 60, spa: 40, spd: 30, spe: 50}, - abilities: {0: "Rock Head", H: "Sheer Force"}, + baseStats: { hp: 45, atk: 75, def: 60, spa: 40, spd: 30, spe: 50 }, + abilities: { 0: "Rock Head", H: "Sheer Force" }, heightm: 0.6, weightkg: 42.1, color: "Blue", @@ -6703,8 +6703,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 372, name: "Shelgon", types: ["Dragon"], - baseStats: {hp: 65, atk: 95, def: 100, spa: 60, spd: 50, spe: 50}, - abilities: {0: "Rock Head", H: "Overcoat"}, + baseStats: { hp: 65, atk: 95, def: 100, spa: 60, spd: 50, spe: 50 }, + abilities: { 0: "Rock Head", H: "Overcoat" }, heightm: 1.1, weightkg: 110.5, color: "White", @@ -6717,8 +6717,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 373, name: "Salamence", types: ["Dragon", "Flying"], - baseStats: {hp: 95, atk: 135, def: 80, spa: 110, spd: 80, spe: 100}, - abilities: {0: "Intimidate", H: "Moxie"}, + baseStats: { hp: 95, atk: 135, def: 80, spa: 110, spd: 80, spe: 100 }, + abilities: { 0: "Intimidate", H: "Moxie" }, heightm: 1.5, weightkg: 102.6, color: "Blue", @@ -6734,8 +6734,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Salamence", forme: "Mega", types: ["Dragon", "Flying"], - baseStats: {hp: 95, atk: 145, def: 130, spa: 120, spd: 90, spe: 120}, - abilities: {0: "Aerilate"}, + baseStats: { hp: 95, atk: 145, def: 130, spa: 120, spd: 90, spe: 120 }, + abilities: { 0: "Aerilate" }, heightm: 1.8, weightkg: 112.6, color: "Blue", @@ -6747,8 +6747,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Beldum", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 40, atk: 55, def: 80, spa: 35, spd: 60, spe: 30}, - abilities: {0: "Clear Body", H: "Light Metal"}, + baseStats: { hp: 40, atk: 55, def: 80, spa: 35, spd: 60, spe: 30 }, + abilities: { 0: "Clear Body", H: "Light Metal" }, heightm: 0.6, weightkg: 95.2, color: "Blue", @@ -6760,8 +6760,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Metang", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 60, atk: 75, def: 100, spa: 55, spd: 80, spe: 50}, - abilities: {0: "Clear Body", H: "Light Metal"}, + baseStats: { hp: 60, atk: 75, def: 100, spa: 55, spd: 80, spe: 50 }, + abilities: { 0: "Clear Body", H: "Light Metal" }, heightm: 1.2, weightkg: 202.5, color: "Blue", @@ -6775,8 +6775,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Metagross", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 80, atk: 135, def: 130, spa: 95, spd: 90, spe: 70}, - abilities: {0: "Clear Body", H: "Light Metal"}, + baseStats: { hp: 80, atk: 135, def: 130, spa: 95, spd: 90, spe: 70 }, + abilities: { 0: "Clear Body", H: "Light Metal" }, heightm: 1.6, weightkg: 550, color: "Blue", @@ -6793,8 +6793,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 80, atk: 145, def: 150, spa: 105, spd: 110, spe: 110}, - abilities: {0: "Tough Claws"}, + baseStats: { hp: 80, atk: 145, def: 150, spa: 105, spd: 110, spe: 110 }, + abilities: { 0: "Tough Claws" }, heightm: 2.5, weightkg: 942.9, color: "Blue", @@ -6806,8 +6806,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Regirock", types: ["Rock"], gender: "N", - baseStats: {hp: 80, atk: 100, def: 200, spa: 50, spd: 100, spe: 50}, - abilities: {0: "Clear Body", H: "Sturdy"}, + baseStats: { hp: 80, atk: 100, def: 200, spa: 50, spd: 100, spe: 50 }, + abilities: { 0: "Clear Body", H: "Sturdy" }, heightm: 1.7, weightkg: 230, color: "Brown", @@ -6819,8 +6819,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Regice", types: ["Ice"], gender: "N", - baseStats: {hp: 80, atk: 50, def: 100, spa: 100, spd: 200, spe: 50}, - abilities: {0: "Clear Body", H: "Ice Body"}, + baseStats: { hp: 80, atk: 50, def: 100, spa: 100, spd: 200, spe: 50 }, + abilities: { 0: "Clear Body", H: "Ice Body" }, heightm: 1.8, weightkg: 175, color: "Blue", @@ -6832,8 +6832,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Registeel", types: ["Steel"], gender: "N", - baseStats: {hp: 80, atk: 75, def: 150, spa: 75, spd: 150, spe: 50}, - abilities: {0: "Clear Body", H: "Light Metal"}, + baseStats: { hp: 80, atk: 75, def: 150, spa: 75, spd: 150, spe: 50 }, + abilities: { 0: "Clear Body", H: "Light Metal" }, heightm: 1.9, weightkg: 205, color: "Gray", @@ -6845,8 +6845,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Latias", types: ["Dragon", "Psychic"], gender: "F", - baseStats: {hp: 80, atk: 80, def: 90, spa: 110, spd: 130, spe: 110}, - abilities: {0: "Levitate"}, + baseStats: { hp: 80, atk: 80, def: 90, spa: 110, spd: 130, spe: 110 }, + abilities: { 0: "Levitate" }, heightm: 1.4, weightkg: 40, color: "Red", @@ -6862,8 +6862,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega", types: ["Dragon", "Psychic"], gender: "F", - baseStats: {hp: 80, atk: 100, def: 120, spa: 140, spd: 150, spe: 110}, - abilities: {0: "Levitate"}, + baseStats: { hp: 80, atk: 100, def: 120, spa: 140, spd: 150, spe: 110 }, + abilities: { 0: "Levitate" }, heightm: 1.8, weightkg: 52, color: "Purple", @@ -6875,8 +6875,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Latios", types: ["Dragon", "Psychic"], gender: "M", - baseStats: {hp: 80, atk: 90, def: 80, spa: 130, spd: 110, spe: 110}, - abilities: {0: "Levitate"}, + baseStats: { hp: 80, atk: 90, def: 80, spa: 130, spd: 110, spe: 110 }, + abilities: { 0: "Levitate" }, heightm: 2, weightkg: 60, color: "Blue", @@ -6892,8 +6892,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega", types: ["Dragon", "Psychic"], gender: "M", - baseStats: {hp: 80, atk: 130, def: 100, spa: 160, spd: 120, spe: 110}, - abilities: {0: "Levitate"}, + baseStats: { hp: 80, atk: 130, def: 100, spa: 160, spd: 120, spe: 110 }, + abilities: { 0: "Levitate" }, heightm: 2.3, weightkg: 70, color: "Purple", @@ -6905,8 +6905,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Kyogre", types: ["Water"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 90, spa: 150, spd: 140, spe: 90}, - abilities: {0: "Drizzle"}, + baseStats: { hp: 100, atk: 100, def: 90, spa: 150, spd: 140, spe: 90 }, + abilities: { 0: "Drizzle" }, heightm: 4.5, weightkg: 352, color: "Blue", @@ -6922,8 +6922,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Primal", types: ["Water"], gender: "N", - baseStats: {hp: 100, atk: 150, def: 90, spa: 180, spd: 160, spe: 90}, - abilities: {0: "Primordial Sea"}, + baseStats: { hp: 100, atk: 150, def: 90, spa: 180, spd: 160, spe: 90 }, + abilities: { 0: "Primordial Sea" }, heightm: 9.8, weightkg: 430, color: "Blue", @@ -6935,8 +6935,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Groudon", types: ["Ground"], gender: "N", - baseStats: {hp: 100, atk: 150, def: 140, spa: 100, spd: 90, spe: 90}, - abilities: {0: "Drought"}, + baseStats: { hp: 100, atk: 150, def: 140, spa: 100, spd: 90, spe: 90 }, + abilities: { 0: "Drought" }, heightm: 3.5, weightkg: 950, color: "Red", @@ -6952,8 +6952,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Primal", types: ["Ground", "Fire"], gender: "N", - baseStats: {hp: 100, atk: 180, def: 160, spa: 150, spd: 90, spe: 90}, - abilities: {0: "Desolate Land"}, + baseStats: { hp: 100, atk: 180, def: 160, spa: 150, spd: 90, spe: 90 }, + abilities: { 0: "Desolate Land" }, heightm: 5, weightkg: 999.7, color: "Red", @@ -6965,8 +6965,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Rayquaza", types: ["Dragon", "Flying"], gender: "N", - baseStats: {hp: 105, atk: 150, def: 90, spa: 150, spd: 90, spe: 95}, - abilities: {0: "Air Lock"}, + baseStats: { hp: 105, atk: 150, def: 90, spa: 150, spd: 90, spe: 95 }, + abilities: { 0: "Air Lock" }, heightm: 7, weightkg: 206.5, color: "Green", @@ -6982,8 +6982,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega", types: ["Dragon", "Flying"], gender: "N", - baseStats: {hp: 105, atk: 180, def: 100, spa: 180, spd: 100, spe: 115}, - abilities: {0: "Delta Stream"}, + baseStats: { hp: 105, atk: 180, def: 100, spa: 180, spd: 100, spe: 115 }, + abilities: { 0: "Delta Stream" }, heightm: 10.8, weightkg: 392, color: "Green", @@ -6995,8 +6995,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Jirachi", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Serene Grace"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Serene Grace" }, heightm: 0.3, weightkg: 1.1, color: "Yellow", @@ -7009,8 +7009,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Normal", types: ["Psychic"], gender: "N", - baseStats: {hp: 50, atk: 150, def: 50, spa: 150, spd: 50, spe: 150}, - abilities: {0: "Pressure"}, + baseStats: { hp: 50, atk: 150, def: 50, spa: 150, spd: 50, spe: 150 }, + abilities: { 0: "Pressure" }, heightm: 1.7, weightkg: 60.8, color: "Red", @@ -7026,8 +7026,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Attack", types: ["Psychic"], gender: "N", - baseStats: {hp: 50, atk: 180, def: 20, spa: 180, spd: 20, spe: 150}, - abilities: {0: "Pressure"}, + baseStats: { hp: 50, atk: 180, def: 20, spa: 180, spd: 20, spe: 150 }, + abilities: { 0: "Pressure" }, heightm: 1.7, weightkg: 60.8, color: "Red", @@ -7041,8 +7041,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Defense", types: ["Psychic"], gender: "N", - baseStats: {hp: 50, atk: 70, def: 160, spa: 70, spd: 160, spe: 90}, - abilities: {0: "Pressure"}, + baseStats: { hp: 50, atk: 70, def: 160, spa: 70, spd: 160, spe: 90 }, + abilities: { 0: "Pressure" }, heightm: 1.7, weightkg: 60.8, color: "Red", @@ -7056,8 +7056,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Speed", types: ["Psychic"], gender: "N", - baseStats: {hp: 50, atk: 95, def: 90, spa: 95, spd: 90, spe: 180}, - abilities: {0: "Pressure"}, + baseStats: { hp: 50, atk: 95, def: 90, spa: 95, spd: 90, spe: 180 }, + abilities: { 0: "Pressure" }, heightm: 1.7, weightkg: 60.8, color: "Red", @@ -7068,9 +7068,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 387, name: "Turtwig", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 68, def: 64, spa: 45, spd: 55, spe: 31}, - abilities: {0: "Overgrow", H: "Shell Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 68, def: 64, spa: 45, spd: 55, spe: 31 }, + abilities: { 0: "Overgrow", H: "Shell Armor" }, heightm: 0.4, weightkg: 10.2, color: "Green", @@ -7081,9 +7081,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 388, name: "Grotle", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 89, def: 85, spa: 55, spd: 65, spe: 36}, - abilities: {0: "Overgrow", H: "Shell Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 89, def: 85, spa: 55, spd: 65, spe: 36 }, + abilities: { 0: "Overgrow", H: "Shell Armor" }, heightm: 1.1, weightkg: 97, color: "Green", @@ -7096,9 +7096,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 389, name: "Torterra", types: ["Grass", "Ground"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 95, atk: 109, def: 105, spa: 75, spd: 85, spe: 56}, - abilities: {0: "Overgrow", H: "Shell Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 95, atk: 109, def: 105, spa: 75, spd: 85, spe: 56 }, + abilities: { 0: "Overgrow", H: "Shell Armor" }, heightm: 2.2, weightkg: 310, color: "Green", @@ -7110,9 +7110,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 390, name: "Chimchar", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 44, atk: 58, def: 44, spa: 58, spd: 44, spe: 61}, - abilities: {0: "Blaze", H: "Iron Fist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 44, atk: 58, def: 44, spa: 58, spd: 44, spe: 61 }, + abilities: { 0: "Blaze", H: "Iron Fist" }, heightm: 0.5, weightkg: 6.2, color: "Brown", @@ -7123,9 +7123,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 391, name: "Monferno", types: ["Fire", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 64, atk: 78, def: 52, spa: 78, spd: 52, spe: 81}, - abilities: {0: "Blaze", H: "Iron Fist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 64, atk: 78, def: 52, spa: 78, spd: 52, spe: 81 }, + abilities: { 0: "Blaze", H: "Iron Fist" }, heightm: 0.9, weightkg: 22, color: "Brown", @@ -7138,9 +7138,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 392, name: "Infernape", types: ["Fire", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 76, atk: 104, def: 71, spa: 104, spd: 71, spe: 108}, - abilities: {0: "Blaze", H: "Iron Fist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 76, atk: 104, def: 71, spa: 104, spd: 71, spe: 108 }, + abilities: { 0: "Blaze", H: "Iron Fist" }, heightm: 1.2, weightkg: 55, color: "Brown", @@ -7152,9 +7152,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 393, name: "Piplup", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 53, atk: 51, def: 53, spa: 61, spd: 56, spe: 40}, - abilities: {0: "Torrent", H: "Competitive"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 53, atk: 51, def: 53, spa: 61, spd: 56, spe: 40 }, + abilities: { 0: "Torrent", H: "Competitive" }, heightm: 0.4, weightkg: 5.2, color: "Blue", @@ -7165,9 +7165,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 394, name: "Prinplup", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 64, atk: 66, def: 68, spa: 81, spd: 76, spe: 50}, - abilities: {0: "Torrent", H: "Competitive"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 64, atk: 66, def: 68, spa: 81, spd: 76, spe: 50 }, + abilities: { 0: "Torrent", H: "Competitive" }, heightm: 0.8, weightkg: 23, color: "Blue", @@ -7180,9 +7180,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 395, name: "Empoleon", types: ["Water", "Steel"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 84, atk: 86, def: 88, spa: 111, spd: 101, spe: 60}, - abilities: {0: "Torrent", H: "Competitive"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 84, atk: 86, def: 88, spa: 111, spd: 101, spe: 60 }, + abilities: { 0: "Torrent", H: "Competitive" }, heightm: 1.7, weightkg: 84.5, color: "Blue", @@ -7194,8 +7194,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 396, name: "Starly", types: ["Normal", "Flying"], - baseStats: {hp: 40, atk: 55, def: 30, spa: 30, spd: 30, spe: 60}, - abilities: {0: "Keen Eye", H: "Reckless"}, + baseStats: { hp: 40, atk: 55, def: 30, spa: 30, spd: 30, spe: 60 }, + abilities: { 0: "Keen Eye", H: "Reckless" }, heightm: 0.3, weightkg: 2, color: "Brown", @@ -7206,8 +7206,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 397, name: "Staravia", types: ["Normal", "Flying"], - baseStats: {hp: 55, atk: 75, def: 50, spa: 40, spd: 40, spe: 80}, - abilities: {0: "Intimidate", H: "Reckless"}, + baseStats: { hp: 55, atk: 75, def: 50, spa: 40, spd: 40, spe: 80 }, + abilities: { 0: "Intimidate", H: "Reckless" }, heightm: 0.6, weightkg: 15.5, color: "Brown", @@ -7220,8 +7220,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 398, name: "Staraptor", types: ["Normal", "Flying"], - baseStats: {hp: 85, atk: 120, def: 70, spa: 50, spd: 60, spe: 100}, - abilities: {0: "Intimidate", H: "Reckless"}, + baseStats: { hp: 85, atk: 120, def: 70, spa: 50, spd: 60, spe: 100 }, + abilities: { 0: "Intimidate", H: "Reckless" }, heightm: 1.2, weightkg: 24.9, color: "Brown", @@ -7233,8 +7233,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 399, name: "Bidoof", types: ["Normal"], - baseStats: {hp: 59, atk: 45, def: 40, spa: 35, spd: 40, spe: 31}, - abilities: {0: "Simple", 1: "Unaware", H: "Moody"}, + baseStats: { hp: 59, atk: 45, def: 40, spa: 35, spd: 40, spe: 31 }, + abilities: { 0: "Simple", 1: "Unaware", H: "Moody" }, heightm: 0.5, weightkg: 20, color: "Brown", @@ -7245,8 +7245,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 400, name: "Bibarel", types: ["Normal", "Water"], - baseStats: {hp: 79, atk: 85, def: 60, spa: 55, spd: 60, spe: 71}, - abilities: {0: "Simple", 1: "Unaware", H: "Moody"}, + baseStats: { hp: 79, atk: 85, def: 60, spa: 55, spd: 60, spe: 71 }, + abilities: { 0: "Simple", 1: "Unaware", H: "Moody" }, heightm: 1, weightkg: 31.5, color: "Brown", @@ -7258,8 +7258,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 401, name: "Kricketot", types: ["Bug"], - baseStats: {hp: 37, atk: 25, def: 41, spa: 25, spd: 41, spe: 25}, - abilities: {0: "Shed Skin", H: "Run Away"}, + baseStats: { hp: 37, atk: 25, def: 41, spa: 25, spd: 41, spe: 25 }, + abilities: { 0: "Shed Skin", H: "Run Away" }, heightm: 0.3, weightkg: 2.2, color: "Red", @@ -7270,8 +7270,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 402, name: "Kricketune", types: ["Bug"], - baseStats: {hp: 77, atk: 85, def: 51, spa: 55, spd: 51, spe: 65}, - abilities: {0: "Swarm", H: "Technician"}, + baseStats: { hp: 77, atk: 85, def: 51, spa: 55, spd: 51, spe: 65 }, + abilities: { 0: "Swarm", H: "Technician" }, heightm: 1, weightkg: 25.5, color: "Red", @@ -7283,8 +7283,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 403, name: "Shinx", types: ["Electric"], - baseStats: {hp: 45, atk: 65, def: 34, spa: 40, spd: 34, spe: 45}, - abilities: {0: "Rivalry", 1: "Intimidate", H: "Guts"}, + baseStats: { hp: 45, atk: 65, def: 34, spa: 40, spd: 34, spe: 45 }, + abilities: { 0: "Rivalry", 1: "Intimidate", H: "Guts" }, heightm: 0.5, weightkg: 9.5, color: "Blue", @@ -7295,8 +7295,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 404, name: "Luxio", types: ["Electric"], - baseStats: {hp: 60, atk: 85, def: 49, spa: 60, spd: 49, spe: 60}, - abilities: {0: "Rivalry", 1: "Intimidate", H: "Guts"}, + baseStats: { hp: 60, atk: 85, def: 49, spa: 60, spd: 49, spe: 60 }, + abilities: { 0: "Rivalry", 1: "Intimidate", H: "Guts" }, heightm: 0.9, weightkg: 30.5, color: "Blue", @@ -7309,8 +7309,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 405, name: "Luxray", types: ["Electric"], - baseStats: {hp: 80, atk: 120, def: 79, spa: 95, spd: 79, spe: 70}, - abilities: {0: "Rivalry", 1: "Intimidate", H: "Guts"}, + baseStats: { hp: 80, atk: 120, def: 79, spa: 95, spd: 79, spe: 70 }, + abilities: { 0: "Rivalry", 1: "Intimidate", H: "Guts" }, heightm: 1.4, weightkg: 42, color: "Blue", @@ -7322,8 +7322,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 406, name: "Budew", types: ["Grass", "Poison"], - baseStats: {hp: 40, atk: 30, def: 35, spa: 50, spd: 70, spe: 55}, - abilities: {0: "Natural Cure", 1: "Poison Point", H: "Leaf Guard"}, + baseStats: { hp: 40, atk: 30, def: 35, spa: 50, spd: 70, spe: 55 }, + abilities: { 0: "Natural Cure", 1: "Poison Point", H: "Leaf Guard" }, heightm: 0.2, weightkg: 1.2, color: "Green", @@ -7335,8 +7335,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 407, name: "Roserade", types: ["Grass", "Poison"], - baseStats: {hp: 60, atk: 70, def: 65, spa: 125, spd: 105, spe: 90}, - abilities: {0: "Natural Cure", 1: "Poison Point", H: "Technician"}, + baseStats: { hp: 60, atk: 70, def: 65, spa: 125, spd: 105, spe: 90 }, + abilities: { 0: "Natural Cure", 1: "Poison Point", H: "Technician" }, heightm: 0.9, weightkg: 14.5, color: "Green", @@ -7349,9 +7349,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 408, name: "Cranidos", types: ["Rock"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 67, atk: 125, def: 40, spa: 30, spd: 30, spe: 58}, - abilities: {0: "Mold Breaker", H: "Sheer Force"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 67, atk: 125, def: 40, spa: 30, spd: 30, spe: 58 }, + abilities: { 0: "Mold Breaker", H: "Sheer Force" }, heightm: 0.9, weightkg: 31.5, color: "Blue", @@ -7362,9 +7362,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 409, name: "Rampardos", types: ["Rock"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 97, atk: 165, def: 60, spa: 65, spd: 50, spe: 58}, - abilities: {0: "Mold Breaker", H: "Sheer Force"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 97, atk: 165, def: 60, spa: 65, spd: 50, spe: 58 }, + abilities: { 0: "Mold Breaker", H: "Sheer Force" }, heightm: 1.6, weightkg: 102.5, color: "Blue", @@ -7376,9 +7376,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 410, name: "Shieldon", types: ["Rock", "Steel"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 30, atk: 42, def: 118, spa: 42, spd: 88, spe: 30}, - abilities: {0: "Sturdy", H: "Soundproof"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 30, atk: 42, def: 118, spa: 42, spd: 88, spe: 30 }, + abilities: { 0: "Sturdy", H: "Soundproof" }, heightm: 0.5, weightkg: 57, color: "Gray", @@ -7389,9 +7389,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 411, name: "Bastiodon", types: ["Rock", "Steel"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 52, def: 168, spa: 47, spd: 138, spe: 30}, - abilities: {0: "Sturdy", H: "Soundproof"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 52, def: 168, spa: 47, spd: 138, spe: 30 }, + abilities: { 0: "Sturdy", H: "Soundproof" }, heightm: 1.3, weightkg: 149.5, color: "Gray", @@ -7404,8 +7404,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Burmy", baseForme: "Plant", types: ["Bug"], - baseStats: {hp: 40, atk: 29, def: 45, spa: 29, spd: 45, spe: 36}, - abilities: {0: "Shed Skin", H: "Overcoat"}, + baseStats: { hp: 40, atk: 29, def: 45, spa: 29, spd: 45, spe: 36 }, + abilities: { 0: "Shed Skin", H: "Overcoat" }, heightm: 0.2, weightkg: 3.4, color: "Green", @@ -7420,8 +7420,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Plant", types: ["Bug", "Grass"], gender: "F", - baseStats: {hp: 60, atk: 59, def: 85, spa: 79, spd: 105, spe: 36}, - abilities: {0: "Anticipation", H: "Overcoat"}, + baseStats: { hp: 60, atk: 59, def: 85, spa: 79, spd: 105, spe: 36 }, + abilities: { 0: "Anticipation", H: "Overcoat" }, heightm: 0.5, weightkg: 6.5, color: "Green", @@ -7438,8 +7438,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Sandy", types: ["Bug", "Ground"], gender: "F", - baseStats: {hp: 60, atk: 79, def: 105, spa: 59, spd: 85, spe: 36}, - abilities: {0: "Anticipation", H: "Overcoat"}, + baseStats: { hp: 60, atk: 79, def: 105, spa: 59, spd: 85, spe: 36 }, + abilities: { 0: "Anticipation", H: "Overcoat" }, heightm: 0.5, weightkg: 6.5, color: "Brown", @@ -7454,8 +7454,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Trash", types: ["Bug", "Steel"], gender: "F", - baseStats: {hp: 60, atk: 69, def: 95, spa: 69, spd: 95, spe: 36}, - abilities: {0: "Anticipation", H: "Overcoat"}, + baseStats: { hp: 60, atk: 69, def: 95, spa: 69, spd: 95, spe: 36 }, + abilities: { 0: "Anticipation", H: "Overcoat" }, heightm: 0.5, weightkg: 6.5, color: "Red", @@ -7468,8 +7468,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Mothim", types: ["Bug", "Flying"], gender: "M", - baseStats: {hp: 70, atk: 94, def: 50, spa: 94, spd: 50, spe: 66}, - abilities: {0: "Swarm", H: "Tinted Lens"}, + baseStats: { hp: 70, atk: 94, def: 50, spa: 94, spd: 50, spe: 66 }, + abilities: { 0: "Swarm", H: "Tinted Lens" }, heightm: 0.9, weightkg: 23.3, color: "Yellow", @@ -7481,9 +7481,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 415, name: "Combee", types: ["Bug", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 30, atk: 30, def: 42, spa: 30, spd: 42, spe: 70}, - abilities: {0: "Honey Gather", H: "Hustle"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 30, atk: 30, def: 42, spa: 30, spd: 42, spe: 70 }, + abilities: { 0: "Honey Gather", H: "Hustle" }, heightm: 0.3, weightkg: 5.5, color: "Yellow", @@ -7495,8 +7495,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Vespiquen", types: ["Bug", "Flying"], gender: "F", - baseStats: {hp: 70, atk: 80, def: 102, spa: 80, spd: 102, spe: 40}, - abilities: {0: "Pressure", H: "Unnerve"}, + baseStats: { hp: 70, atk: 80, def: 102, spa: 80, spd: 102, spe: 40 }, + abilities: { 0: "Pressure", H: "Unnerve" }, heightm: 1.2, weightkg: 38.5, color: "Yellow", @@ -7508,8 +7508,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 417, name: "Pachirisu", types: ["Electric"], - baseStats: {hp: 60, atk: 45, def: 70, spa: 45, spd: 90, spe: 95}, - abilities: {0: "Run Away", 1: "Pickup", H: "Volt Absorb"}, + baseStats: { hp: 60, atk: 45, def: 70, spa: 45, spd: 90, spe: 95 }, + abilities: { 0: "Run Away", 1: "Pickup", H: "Volt Absorb" }, heightm: 0.4, weightkg: 3.9, color: "White", @@ -7519,8 +7519,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 418, name: "Buizel", types: ["Water"], - baseStats: {hp: 55, atk: 65, def: 35, spa: 60, spd: 30, spe: 85}, - abilities: {0: "Swift Swim", H: "Water Veil"}, + baseStats: { hp: 55, atk: 65, def: 35, spa: 60, spd: 30, spe: 85 }, + abilities: { 0: "Swift Swim", H: "Water Veil" }, heightm: 0.7, weightkg: 29.5, color: "Brown", @@ -7531,8 +7531,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 419, name: "Floatzel", types: ["Water"], - baseStats: {hp: 85, atk: 105, def: 55, spa: 85, spd: 50, spe: 115}, - abilities: {0: "Swift Swim", H: "Water Veil"}, + baseStats: { hp: 85, atk: 105, def: 55, spa: 85, spd: 50, spe: 115 }, + abilities: { 0: "Swift Swim", H: "Water Veil" }, heightm: 1.1, weightkg: 33.5, color: "Brown", @@ -7544,8 +7544,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 420, name: "Cherubi", types: ["Grass"], - baseStats: {hp: 45, atk: 35, def: 45, spa: 62, spd: 53, spe: 35}, - abilities: {0: "Chlorophyll"}, + baseStats: { hp: 45, atk: 35, def: 45, spa: 62, spd: 53, spe: 35 }, + abilities: { 0: "Chlorophyll" }, heightm: 0.4, weightkg: 3.3, color: "Pink", @@ -7557,8 +7557,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Cherrim", baseForme: "Overcast", types: ["Grass"], - baseStats: {hp: 70, atk: 60, def: 70, spa: 87, spd: 78, spe: 85}, - abilities: {0: "Flower Gift"}, + baseStats: { hp: 70, atk: 60, def: 70, spa: 87, spd: 78, spe: 85 }, + abilities: { 0: "Flower Gift" }, heightm: 0.5, weightkg: 9.3, color: "Purple", @@ -7574,8 +7574,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Cherrim", forme: "Sunshine", types: ["Grass"], - baseStats: {hp: 70, atk: 60, def: 70, spa: 87, spd: 78, spe: 85}, - abilities: {0: "Flower Gift"}, + baseStats: { hp: 70, atk: 60, def: 70, spa: 87, spd: 78, spe: 85 }, + abilities: { 0: "Flower Gift" }, heightm: 0.5, weightkg: 9.3, color: "Pink", @@ -7588,8 +7588,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Shellos", baseForme: "West", types: ["Water"], - baseStats: {hp: 76, atk: 48, def: 48, spa: 57, spd: 62, spe: 34}, - abilities: {0: "Sticky Hold", 1: "Storm Drain", H: "Sand Force"}, + baseStats: { hp: 76, atk: 48, def: 48, spa: 57, spd: 62, spe: 34 }, + abilities: { 0: "Sticky Hold", 1: "Storm Drain", H: "Sand Force" }, heightm: 0.3, weightkg: 6.3, color: "Purple", @@ -7603,8 +7603,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Gastrodon", baseForme: "West", types: ["Water", "Ground"], - baseStats: {hp: 111, atk: 83, def: 68, spa: 92, spd: 82, spe: 39}, - abilities: {0: "Sticky Hold", 1: "Storm Drain", H: "Sand Force"}, + baseStats: { hp: 111, atk: 83, def: 68, spa: 92, spd: 82, spe: 39 }, + abilities: { 0: "Sticky Hold", 1: "Storm Drain", H: "Sand Force" }, heightm: 0.9, weightkg: 29.9, color: "Purple", @@ -7618,8 +7618,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 424, name: "Ambipom", types: ["Normal"], - baseStats: {hp: 75, atk: 100, def: 66, spa: 60, spd: 66, spe: 115}, - abilities: {0: "Technician", 1: "Pickup", H: "Skill Link"}, + baseStats: { hp: 75, atk: 100, def: 66, spa: 60, spd: 66, spe: 115 }, + abilities: { 0: "Technician", 1: "Pickup", H: "Skill Link" }, heightm: 1.2, weightkg: 20.3, color: "Purple", @@ -7632,8 +7632,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 425, name: "Drifloon", types: ["Ghost", "Flying"], - baseStats: {hp: 90, atk: 50, def: 34, spa: 60, spd: 44, spe: 70}, - abilities: {0: "Aftermath", 1: "Unburden", H: "Flare Boost"}, + baseStats: { hp: 90, atk: 50, def: 34, spa: 60, spd: 44, spe: 70 }, + abilities: { 0: "Aftermath", 1: "Unburden", H: "Flare Boost" }, heightm: 0.4, weightkg: 1.2, color: "Purple", @@ -7644,8 +7644,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 426, name: "Drifblim", types: ["Ghost", "Flying"], - baseStats: {hp: 150, atk: 80, def: 44, spa: 90, spd: 54, spe: 80}, - abilities: {0: "Aftermath", 1: "Unburden", H: "Flare Boost"}, + baseStats: { hp: 150, atk: 80, def: 44, spa: 90, spd: 54, spe: 80 }, + abilities: { 0: "Aftermath", 1: "Unburden", H: "Flare Boost" }, heightm: 1.2, weightkg: 15, color: "Purple", @@ -7657,8 +7657,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 427, name: "Buneary", types: ["Normal"], - baseStats: {hp: 55, atk: 66, def: 44, spa: 44, spd: 56, spe: 85}, - abilities: {0: "Run Away", 1: "Klutz", H: "Limber"}, + baseStats: { hp: 55, atk: 66, def: 44, spa: 44, spd: 56, spe: 85 }, + abilities: { 0: "Run Away", 1: "Klutz", H: "Limber" }, heightm: 0.4, weightkg: 5.5, color: "Brown", @@ -7669,8 +7669,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 428, name: "Lopunny", types: ["Normal"], - baseStats: {hp: 65, atk: 76, def: 84, spa: 54, spd: 96, spe: 105}, - abilities: {0: "Cute Charm", 1: "Klutz", H: "Limber"}, + baseStats: { hp: 65, atk: 76, def: 84, spa: 54, spd: 96, spe: 105 }, + abilities: { 0: "Cute Charm", 1: "Klutz", H: "Limber" }, heightm: 1.2, weightkg: 33.3, color: "Brown", @@ -7686,8 +7686,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Lopunny", forme: "Mega", types: ["Normal", "Fighting"], - baseStats: {hp: 65, atk: 136, def: 94, spa: 54, spd: 96, spe: 135}, - abilities: {0: "Scrappy"}, + baseStats: { hp: 65, atk: 136, def: 94, spa: 54, spd: 96, spe: 135 }, + abilities: { 0: "Scrappy" }, heightm: 1.3, weightkg: 28.3, color: "Brown", @@ -7698,8 +7698,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 429, name: "Mismagius", types: ["Ghost"], - baseStats: {hp: 60, atk: 60, def: 60, spa: 105, spd: 105, spe: 105}, - abilities: {0: "Levitate"}, + baseStats: { hp: 60, atk: 60, def: 60, spa: 105, spd: 105, spe: 105 }, + abilities: { 0: "Levitate" }, heightm: 0.9, weightkg: 4.4, color: "Purple", @@ -7712,8 +7712,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 430, name: "Honchkrow", types: ["Dark", "Flying"], - baseStats: {hp: 100, atk: 125, def: 52, spa: 105, spd: 52, spe: 71}, - abilities: {0: "Insomnia", 1: "Super Luck", H: "Moxie"}, + baseStats: { hp: 100, atk: 125, def: 52, spa: 105, spd: 52, spe: 71 }, + abilities: { 0: "Insomnia", 1: "Super Luck", H: "Moxie" }, heightm: 0.9, weightkg: 27.3, color: "Black", @@ -7726,9 +7726,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 431, name: "Glameow", types: ["Normal"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 49, atk: 55, def: 42, spa: 42, spd: 37, spe: 85}, - abilities: {0: "Limber", 1: "Own Tempo", H: "Keen Eye"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 49, atk: 55, def: 42, spa: 42, spd: 37, spe: 85 }, + abilities: { 0: "Limber", 1: "Own Tempo", H: "Keen Eye" }, heightm: 0.5, weightkg: 3.9, color: "Gray", @@ -7739,9 +7739,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 432, name: "Purugly", types: ["Normal"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 71, atk: 82, def: 64, spa: 64, spd: 59, spe: 112}, - abilities: {0: "Thick Fat", 1: "Own Tempo", H: "Defiant"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 71, atk: 82, def: 64, spa: 64, spd: 59, spe: 112 }, + abilities: { 0: "Thick Fat", 1: "Own Tempo", H: "Defiant" }, heightm: 1, weightkg: 43.8, color: "Gray", @@ -7753,8 +7753,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 433, name: "Chingling", types: ["Psychic"], - baseStats: {hp: 45, atk: 30, def: 50, spa: 65, spd: 50, spe: 45}, - abilities: {0: "Levitate"}, + baseStats: { hp: 45, atk: 30, def: 50, spa: 65, spd: 50, spe: 45 }, + abilities: { 0: "Levitate" }, heightm: 0.2, weightkg: 0.6, color: "Yellow", @@ -7766,8 +7766,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 434, name: "Stunky", types: ["Poison", "Dark"], - baseStats: {hp: 63, atk: 63, def: 47, spa: 41, spd: 41, spe: 74}, - abilities: {0: "Stench", 1: "Aftermath", H: "Keen Eye"}, + baseStats: { hp: 63, atk: 63, def: 47, spa: 41, spd: 41, spe: 74 }, + abilities: { 0: "Stench", 1: "Aftermath", H: "Keen Eye" }, heightm: 0.4, weightkg: 19.2, color: "Purple", @@ -7778,8 +7778,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 435, name: "Skuntank", types: ["Poison", "Dark"], - baseStats: {hp: 103, atk: 93, def: 67, spa: 71, spd: 61, spe: 84}, - abilities: {0: "Stench", 1: "Aftermath", H: "Keen Eye"}, + baseStats: { hp: 103, atk: 93, def: 67, spa: 71, spd: 61, spe: 84 }, + abilities: { 0: "Stench", 1: "Aftermath", H: "Keen Eye" }, heightm: 1, weightkg: 38, color: "Purple", @@ -7792,8 +7792,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Bronzor", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 57, atk: 24, def: 86, spa: 24, spd: 86, spe: 23}, - abilities: {0: "Levitate", 1: "Heatproof", H: "Heavy Metal"}, + baseStats: { hp: 57, atk: 24, def: 86, spa: 24, spd: 86, spe: 23 }, + abilities: { 0: "Levitate", 1: "Heatproof", H: "Heavy Metal" }, heightm: 0.5, weightkg: 60.5, color: "Green", @@ -7805,8 +7805,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Bronzong", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 67, atk: 89, def: 116, spa: 79, spd: 116, spe: 33}, - abilities: {0: "Levitate", 1: "Heatproof", H: "Heavy Metal"}, + baseStats: { hp: 67, atk: 89, def: 116, spa: 79, spd: 116, spe: 33 }, + abilities: { 0: "Levitate", 1: "Heatproof", H: "Heavy Metal" }, heightm: 1.3, weightkg: 187, color: "Green", @@ -7818,8 +7818,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 438, name: "Bonsly", types: ["Rock"], - baseStats: {hp: 50, atk: 80, def: 95, spa: 10, spd: 45, spe: 10}, - abilities: {0: "Sturdy", 1: "Rock Head", H: "Rattled"}, + baseStats: { hp: 50, atk: 80, def: 95, spa: 10, spd: 45, spe: 10 }, + abilities: { 0: "Sturdy", 1: "Rock Head", H: "Rattled" }, heightm: 0.5, weightkg: 15, color: "Brown", @@ -7831,8 +7831,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 439, name: "Mime Jr.", types: ["Psychic", "Fairy"], - baseStats: {hp: 20, atk: 25, def: 45, spa: 70, spd: 90, spe: 60}, - abilities: {0: "Soundproof", 1: "Filter", H: "Technician"}, + baseStats: { hp: 20, atk: 25, def: 45, spa: 70, spd: 90, spe: 60 }, + abilities: { 0: "Soundproof", 1: "Filter", H: "Technician" }, heightm: 0.6, weightkg: 13, color: "Pink", @@ -7845,8 +7845,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Happiny", types: ["Normal"], gender: "F", - baseStats: {hp: 100, atk: 5, def: 5, spa: 15, spd: 65, spe: 30}, - abilities: {0: "Natural Cure", 1: "Serene Grace", H: "Friend Guard"}, + baseStats: { hp: 100, atk: 5, def: 5, spa: 15, spd: 65, spe: 30 }, + abilities: { 0: "Natural Cure", 1: "Serene Grace", H: "Friend Guard" }, heightm: 0.6, weightkg: 24.4, color: "Pink", @@ -7858,8 +7858,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 441, name: "Chatot", types: ["Normal", "Flying"], - baseStats: {hp: 76, atk: 65, def: 45, spa: 92, spd: 42, spe: 91}, - abilities: {0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks"}, + baseStats: { hp: 76, atk: 65, def: 45, spa: 92, spd: 42, spe: 91 }, + abilities: { 0: "Keen Eye", 1: "Tangled Feet", H: "Big Pecks" }, heightm: 0.5, weightkg: 1.9, color: "Black", @@ -7869,8 +7869,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 442, name: "Spiritomb", types: ["Ghost", "Dark"], - baseStats: {hp: 50, atk: 92, def: 108, spa: 92, spd: 108, spe: 35}, - abilities: {0: "Pressure", H: "Infiltrator"}, + baseStats: { hp: 50, atk: 92, def: 108, spa: 92, spd: 108, spe: 35 }, + abilities: { 0: "Pressure", H: "Infiltrator" }, heightm: 1, weightkg: 108, color: "Purple", @@ -7880,8 +7880,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 443, name: "Gible", types: ["Dragon", "Ground"], - baseStats: {hp: 58, atk: 70, def: 45, spa: 40, spd: 45, spe: 42}, - abilities: {0: "Sand Veil", H: "Rough Skin"}, + baseStats: { hp: 58, atk: 70, def: 45, spa: 40, spd: 45, spe: 42 }, + abilities: { 0: "Sand Veil", H: "Rough Skin" }, heightm: 0.7, weightkg: 20.5, color: "Blue", @@ -7892,8 +7892,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 444, name: "Gabite", types: ["Dragon", "Ground"], - baseStats: {hp: 68, atk: 90, def: 65, spa: 50, spd: 55, spe: 82}, - abilities: {0: "Sand Veil", H: "Rough Skin"}, + baseStats: { hp: 68, atk: 90, def: 65, spa: 50, spd: 55, spe: 82 }, + abilities: { 0: "Sand Veil", H: "Rough Skin" }, heightm: 1.4, weightkg: 56, color: "Blue", @@ -7906,8 +7906,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 445, name: "Garchomp", types: ["Dragon", "Ground"], - baseStats: {hp: 108, atk: 130, def: 95, spa: 80, spd: 85, spe: 102}, - abilities: {0: "Sand Veil", H: "Rough Skin"}, + baseStats: { hp: 108, atk: 130, def: 95, spa: 80, spd: 85, spe: 102 }, + abilities: { 0: "Sand Veil", H: "Rough Skin" }, heightm: 1.9, weightkg: 95, color: "Blue", @@ -7923,8 +7923,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Garchomp", forme: "Mega", types: ["Dragon", "Ground"], - baseStats: {hp: 108, atk: 170, def: 115, spa: 120, spd: 95, spe: 92}, - abilities: {0: "Sand Force"}, + baseStats: { hp: 108, atk: 170, def: 115, spa: 120, spd: 95, spe: 92 }, + abilities: { 0: "Sand Force" }, heightm: 1.9, weightkg: 95, color: "Blue", @@ -7935,9 +7935,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 446, name: "Munchlax", types: ["Normal"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 135, atk: 85, def: 40, spa: 40, spd: 85, spe: 5}, - abilities: {0: "Pickup", 1: "Thick Fat", H: "Gluttony"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 135, atk: 85, def: 40, spa: 40, spd: 85, spe: 5 }, + abilities: { 0: "Pickup", 1: "Thick Fat", H: "Gluttony" }, heightm: 0.6, weightkg: 105, color: "Black", @@ -7949,9 +7949,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 447, name: "Riolu", types: ["Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 40, atk: 70, def: 40, spa: 35, spd: 40, spe: 60}, - abilities: {0: "Steadfast", 1: "Inner Focus", H: "Prankster"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 40, atk: 70, def: 40, spa: 35, spd: 40, spe: 60 }, + abilities: { 0: "Steadfast", 1: "Inner Focus", H: "Prankster" }, heightm: 0.7, weightkg: 20.2, color: "Blue", @@ -7963,9 +7963,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 448, name: "Lucario", types: ["Fighting", "Steel"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 110, def: 70, spa: 115, spd: 70, spe: 90}, - abilities: {0: "Steadfast", 1: "Inner Focus", H: "Justified"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 110, def: 70, spa: 115, spd: 70, spe: 90 }, + abilities: { 0: "Steadfast", 1: "Inner Focus", H: "Justified" }, heightm: 1.2, weightkg: 54, color: "Blue", @@ -7982,9 +7982,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Lucario", forme: "Mega", types: ["Fighting", "Steel"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 145, def: 88, spa: 140, spd: 70, spe: 112}, - abilities: {0: "Adaptability"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 145, def: 88, spa: 140, spd: 70, spe: 112 }, + abilities: { 0: "Adaptability" }, heightm: 1.3, weightkg: 57.5, color: "Blue", @@ -7995,8 +7995,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 449, name: "Hippopotas", types: ["Ground"], - baseStats: {hp: 68, atk: 72, def: 78, spa: 38, spd: 42, spe: 32}, - abilities: {0: "Sand Stream", H: "Sand Force"}, + baseStats: { hp: 68, atk: 72, def: 78, spa: 38, spd: 42, spe: 32 }, + abilities: { 0: "Sand Stream", H: "Sand Force" }, heightm: 0.8, weightkg: 49.5, color: "Brown", @@ -8007,8 +8007,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 450, name: "Hippowdon", types: ["Ground"], - baseStats: {hp: 108, atk: 112, def: 118, spa: 68, spd: 72, spe: 47}, - abilities: {0: "Sand Stream", H: "Sand Force"}, + baseStats: { hp: 108, atk: 112, def: 118, spa: 68, spd: 72, spe: 47 }, + abilities: { 0: "Sand Stream", H: "Sand Force" }, heightm: 2, weightkg: 300, color: "Brown", @@ -8020,8 +8020,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 451, name: "Skorupi", types: ["Poison", "Bug"], - baseStats: {hp: 40, atk: 50, def: 90, spa: 30, spd: 55, spe: 65}, - abilities: {0: "Battle Armor", 1: "Sniper", H: "Keen Eye"}, + baseStats: { hp: 40, atk: 50, def: 90, spa: 30, spd: 55, spe: 65 }, + abilities: { 0: "Battle Armor", 1: "Sniper", H: "Keen Eye" }, heightm: 0.8, weightkg: 12, color: "Purple", @@ -8032,8 +8032,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 452, name: "Drapion", types: ["Poison", "Dark"], - baseStats: {hp: 70, atk: 90, def: 110, spa: 60, spd: 75, spe: 95}, - abilities: {0: "Battle Armor", 1: "Sniper", H: "Keen Eye"}, + baseStats: { hp: 70, atk: 90, def: 110, spa: 60, spd: 75, spe: 95 }, + abilities: { 0: "Battle Armor", 1: "Sniper", H: "Keen Eye" }, heightm: 1.3, weightkg: 61.5, color: "Purple", @@ -8045,8 +8045,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 453, name: "Croagunk", types: ["Poison", "Fighting"], - baseStats: {hp: 48, atk: 61, def: 40, spa: 61, spd: 40, spe: 50}, - abilities: {0: "Anticipation", 1: "Dry Skin", H: "Poison Touch"}, + baseStats: { hp: 48, atk: 61, def: 40, spa: 61, spd: 40, spe: 50 }, + abilities: { 0: "Anticipation", 1: "Dry Skin", H: "Poison Touch" }, heightm: 0.7, weightkg: 23, color: "Blue", @@ -8057,8 +8057,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 454, name: "Toxicroak", types: ["Poison", "Fighting"], - baseStats: {hp: 83, atk: 106, def: 65, spa: 86, spd: 65, spe: 85}, - abilities: {0: "Anticipation", 1: "Dry Skin", H: "Poison Touch"}, + baseStats: { hp: 83, atk: 106, def: 65, spa: 86, spd: 65, spe: 85 }, + abilities: { 0: "Anticipation", 1: "Dry Skin", H: "Poison Touch" }, heightm: 1.3, weightkg: 44.4, color: "Blue", @@ -8070,8 +8070,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 455, name: "Carnivine", types: ["Grass"], - baseStats: {hp: 74, atk: 100, def: 72, spa: 90, spd: 72, spe: 46}, - abilities: {0: "Levitate"}, + baseStats: { hp: 74, atk: 100, def: 72, spa: 90, spd: 72, spe: 46 }, + abilities: { 0: "Levitate" }, heightm: 1.4, weightkg: 27, color: "Green", @@ -8081,8 +8081,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 456, name: "Finneon", types: ["Water"], - baseStats: {hp: 49, atk: 49, def: 56, spa: 49, spd: 61, spe: 66}, - abilities: {0: "Swift Swim", 1: "Storm Drain", H: "Water Veil"}, + baseStats: { hp: 49, atk: 49, def: 56, spa: 49, spd: 61, spe: 66 }, + abilities: { 0: "Swift Swim", 1: "Storm Drain", H: "Water Veil" }, heightm: 0.4, weightkg: 7, color: "Blue", @@ -8093,8 +8093,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 457, name: "Lumineon", types: ["Water"], - baseStats: {hp: 69, atk: 69, def: 76, spa: 69, spd: 86, spe: 91}, - abilities: {0: "Swift Swim", 1: "Storm Drain", H: "Water Veil"}, + baseStats: { hp: 69, atk: 69, def: 76, spa: 69, spd: 86, spe: 91 }, + abilities: { 0: "Swift Swim", 1: "Storm Drain", H: "Water Veil" }, heightm: 1.2, weightkg: 24, color: "Blue", @@ -8106,8 +8106,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 458, name: "Mantyke", types: ["Water", "Flying"], - baseStats: {hp: 45, atk: 20, def: 50, spa: 60, spd: 120, spe: 50}, - abilities: {0: "Swift Swim", 1: "Water Absorb", H: "Water Veil"}, + baseStats: { hp: 45, atk: 20, def: 50, spa: 60, spd: 120, spe: 50 }, + abilities: { 0: "Swift Swim", 1: "Water Absorb", H: "Water Veil" }, heightm: 1, weightkg: 65, color: "Blue", @@ -8119,8 +8119,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 459, name: "Snover", types: ["Grass", "Ice"], - baseStats: {hp: 60, atk: 62, def: 50, spa: 62, spd: 60, spe: 40}, - abilities: {0: "Snow Warning", H: "Soundproof"}, + baseStats: { hp: 60, atk: 62, def: 50, spa: 62, spd: 60, spe: 40 }, + abilities: { 0: "Snow Warning", H: "Soundproof" }, heightm: 1, weightkg: 50.5, color: "White", @@ -8131,8 +8131,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 460, name: "Abomasnow", types: ["Grass", "Ice"], - baseStats: {hp: 90, atk: 92, def: 75, spa: 92, spd: 85, spe: 60}, - abilities: {0: "Snow Warning", H: "Soundproof"}, + baseStats: { hp: 90, atk: 92, def: 75, spa: 92, spd: 85, spe: 60 }, + abilities: { 0: "Snow Warning", H: "Soundproof" }, heightm: 2.2, weightkg: 135.5, color: "White", @@ -8148,8 +8148,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Abomasnow", forme: "Mega", types: ["Grass", "Ice"], - baseStats: {hp: 90, atk: 132, def: 105, spa: 132, spd: 105, spe: 30}, - abilities: {0: "Snow Warning"}, + baseStats: { hp: 90, atk: 132, def: 105, spa: 132, spd: 105, spe: 30 }, + abilities: { 0: "Snow Warning" }, heightm: 2.7, weightkg: 185, color: "White", @@ -8160,8 +8160,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 461, name: "Weavile", types: ["Dark", "Ice"], - baseStats: {hp: 70, atk: 120, def: 65, spa: 45, spd: 85, spe: 125}, - abilities: {0: "Pressure", H: "Pickpocket"}, + baseStats: { hp: 70, atk: 120, def: 65, spa: 45, spd: 85, spe: 125 }, + abilities: { 0: "Pressure", H: "Pickpocket" }, heightm: 1.1, weightkg: 34, color: "Black", @@ -8176,8 +8176,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Magnezone", types: ["Electric", "Steel"], gender: "N", - baseStats: {hp: 70, atk: 70, def: 115, spa: 130, spd: 90, spe: 60}, - abilities: {0: "Magnet Pull", 1: "Sturdy", H: "Analytic"}, + baseStats: { hp: 70, atk: 70, def: 115, spa: 130, spd: 90, spe: 60 }, + abilities: { 0: "Magnet Pull", 1: "Sturdy", H: "Analytic" }, heightm: 1.2, weightkg: 180, color: "Gray", @@ -8190,8 +8190,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 463, name: "Lickilicky", types: ["Normal"], - baseStats: {hp: 110, atk: 85, def: 95, spa: 80, spd: 95, spe: 50}, - abilities: {0: "Own Tempo", 1: "Oblivious", H: "Cloud Nine"}, + baseStats: { hp: 110, atk: 85, def: 95, spa: 80, spd: 95, spe: 50 }, + abilities: { 0: "Own Tempo", 1: "Oblivious", H: "Cloud Nine" }, heightm: 1.7, weightkg: 140, color: "Pink", @@ -8204,8 +8204,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 464, name: "Rhyperior", types: ["Ground", "Rock"], - baseStats: {hp: 115, atk: 140, def: 130, spa: 55, spd: 55, spe: 40}, - abilities: {0: "Lightning Rod", 1: "Solid Rock", H: "Reckless"}, + baseStats: { hp: 115, atk: 140, def: 130, spa: 55, spd: 55, spe: 40 }, + abilities: { 0: "Lightning Rod", 1: "Solid Rock", H: "Reckless" }, heightm: 2.4, weightkg: 282.8, color: "Gray", @@ -8218,8 +8218,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 465, name: "Tangrowth", types: ["Grass"], - baseStats: {hp: 100, atk: 100, def: 125, spa: 110, spd: 50, spe: 50}, - abilities: {0: "Chlorophyll", 1: "Leaf Guard", H: "Regenerator"}, + baseStats: { hp: 100, atk: 100, def: 125, spa: 110, spd: 50, spe: 50 }, + abilities: { 0: "Chlorophyll", 1: "Leaf Guard", H: "Regenerator" }, heightm: 2, weightkg: 128.6, color: "Blue", @@ -8232,9 +8232,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 466, name: "Electivire", types: ["Electric"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 75, atk: 123, def: 67, spa: 95, spd: 85, spe: 95}, - abilities: {0: "Motor Drive", H: "Vital Spirit"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 75, atk: 123, def: 67, spa: 95, spd: 85, spe: 95 }, + abilities: { 0: "Motor Drive", H: "Vital Spirit" }, heightm: 1.8, weightkg: 138.6, color: "Yellow", @@ -8247,9 +8247,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 467, name: "Magmortar", types: ["Fire"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 75, atk: 95, def: 67, spa: 125, spd: 95, spe: 83}, - abilities: {0: "Flame Body", H: "Vital Spirit"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 75, atk: 95, def: 67, spa: 125, spd: 95, spe: 83 }, + abilities: { 0: "Flame Body", H: "Vital Spirit" }, heightm: 1.6, weightkg: 68, color: "Red", @@ -8262,9 +8262,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 468, name: "Togekiss", types: ["Fairy", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 85, atk: 50, def: 95, spa: 120, spd: 115, spe: 80}, - abilities: {0: "Hustle", 1: "Serene Grace", H: "Super Luck"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 85, atk: 50, def: 95, spa: 120, spd: 115, spe: 80 }, + abilities: { 0: "Hustle", 1: "Serene Grace", H: "Super Luck" }, heightm: 1.5, weightkg: 38, color: "White", @@ -8277,8 +8277,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 469, name: "Yanmega", types: ["Bug", "Flying"], - baseStats: {hp: 86, atk: 76, def: 86, spa: 116, spd: 56, spe: 95}, - abilities: {0: "Speed Boost", 1: "Tinted Lens", H: "Frisk"}, + baseStats: { hp: 86, atk: 76, def: 86, spa: 116, spd: 56, spe: 95 }, + abilities: { 0: "Speed Boost", 1: "Tinted Lens", H: "Frisk" }, heightm: 1.9, weightkg: 51.5, color: "Green", @@ -8291,9 +8291,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 470, name: "Leafeon", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 110, def: 130, spa: 60, spd: 65, spe: 95}, - abilities: {0: "Leaf Guard", H: "Chlorophyll"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 110, def: 130, spa: 60, spd: 65, spe: 95 }, + abilities: { 0: "Leaf Guard", H: "Chlorophyll" }, heightm: 1, weightkg: 25.5, color: "Green", @@ -8306,9 +8306,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 471, name: "Glaceon", types: ["Ice"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 60, def: 110, spa: 130, spd: 95, spe: 65}, - abilities: {0: "Snow Cloak", H: "Ice Body"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 60, def: 110, spa: 130, spd: 95, spe: 65 }, + abilities: { 0: "Snow Cloak", H: "Ice Body" }, heightm: 0.8, weightkg: 25.9, color: "Blue", @@ -8321,8 +8321,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 472, name: "Gliscor", types: ["Ground", "Flying"], - baseStats: {hp: 75, atk: 95, def: 125, spa: 45, spd: 75, spe: 95}, - abilities: {0: "Hyper Cutter", 1: "Sand Veil", H: "Poison Heal"}, + baseStats: { hp: 75, atk: 95, def: 125, spa: 45, spd: 75, spe: 95 }, + abilities: { 0: "Hyper Cutter", 1: "Sand Veil", H: "Poison Heal" }, heightm: 2, weightkg: 42.5, color: "Purple", @@ -8336,8 +8336,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 473, name: "Mamoswine", types: ["Ice", "Ground"], - baseStats: {hp: 110, atk: 130, def: 80, spa: 70, spd: 60, spe: 80}, - abilities: {0: "Oblivious", 1: "Snow Cloak", H: "Thick Fat"}, + baseStats: { hp: 110, atk: 130, def: 80, spa: 70, spd: 60, spe: 80 }, + abilities: { 0: "Oblivious", 1: "Snow Cloak", H: "Thick Fat" }, heightm: 2.5, weightkg: 291, color: "Brown", @@ -8351,8 +8351,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Porygon-Z", types: ["Normal"], gender: "N", - baseStats: {hp: 85, atk: 80, def: 70, spa: 135, spd: 75, spe: 90}, - abilities: {0: "Adaptability", 1: "Download", H: "Analytic"}, + baseStats: { hp: 85, atk: 80, def: 70, spa: 135, spd: 75, spe: 90 }, + abilities: { 0: "Adaptability", 1: "Download", H: "Analytic" }, heightm: 0.9, weightkg: 34, color: "Red", @@ -8366,8 +8366,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Gallade", types: ["Psychic", "Fighting"], gender: "M", - baseStats: {hp: 68, atk: 125, def: 65, spa: 65, spd: 115, spe: 80}, - abilities: {0: "Steadfast", 1: "Sharpness", H: "Justified"}, + baseStats: { hp: 68, atk: 125, def: 65, spa: 65, spd: 115, spe: 80 }, + abilities: { 0: "Steadfast", 1: "Sharpness", H: "Justified" }, heightm: 1.6, weightkg: 52, color: "White", @@ -8385,8 +8385,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega", types: ["Psychic", "Fighting"], gender: "M", - baseStats: {hp: 68, atk: 165, def: 95, spa: 65, spd: 115, spe: 110}, - abilities: {0: "Inner Focus"}, + baseStats: { hp: 68, atk: 165, def: 95, spa: 65, spd: 115, spe: 110 }, + abilities: { 0: "Inner Focus" }, heightm: 1.6, weightkg: 56.4, color: "White", @@ -8397,8 +8397,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 476, name: "Probopass", types: ["Rock", "Steel"], - baseStats: {hp: 60, atk: 55, def: 145, spa: 75, spd: 150, spe: 40}, - abilities: {0: "Sturdy", 1: "Magnet Pull", H: "Sand Force"}, + baseStats: { hp: 60, atk: 55, def: 145, spa: 75, spd: 150, spe: 40 }, + abilities: { 0: "Sturdy", 1: "Magnet Pull", H: "Sand Force" }, heightm: 1.4, weightkg: 340, color: "Gray", @@ -8411,8 +8411,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 477, name: "Dusknoir", types: ["Ghost"], - baseStats: {hp: 45, atk: 100, def: 135, spa: 65, spd: 135, spe: 45}, - abilities: {0: "Pressure", H: "Frisk"}, + baseStats: { hp: 45, atk: 100, def: 135, spa: 65, spd: 135, spe: 45 }, + abilities: { 0: "Pressure", H: "Frisk" }, heightm: 2.2, weightkg: 106.6, color: "Black", @@ -8426,8 +8426,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Froslass", types: ["Ice", "Ghost"], gender: "F", - baseStats: {hp: 70, atk: 80, def: 70, spa: 80, spd: 70, spe: 110}, - abilities: {0: "Snow Cloak", H: "Cursed Body"}, + baseStats: { hp: 70, atk: 80, def: 70, spa: 80, spd: 70, spe: 110 }, + abilities: { 0: "Snow Cloak", H: "Cursed Body" }, heightm: 1.3, weightkg: 26.6, color: "White", @@ -8441,8 +8441,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Rotom", types: ["Electric", "Ghost"], gender: "N", - baseStats: {hp: 50, atk: 50, def: 77, spa: 95, spd: 77, spe: 91}, - abilities: {0: "Levitate"}, + baseStats: { hp: 50, atk: 50, def: 77, spa: 95, spd: 77, spe: 91 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Red", @@ -8457,8 +8457,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Heat", types: ["Electric", "Fire"], gender: "N", - baseStats: {hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86}, - abilities: {0: "Levitate"}, + baseStats: { hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Red", @@ -8472,8 +8472,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Wash", types: ["Electric", "Water"], gender: "N", - baseStats: {hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86}, - abilities: {0: "Levitate"}, + baseStats: { hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Red", @@ -8487,8 +8487,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Frost", types: ["Electric", "Ice"], gender: "N", - baseStats: {hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86}, - abilities: {0: "Levitate"}, + baseStats: { hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Red", @@ -8502,8 +8502,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Fan", types: ["Electric", "Flying"], gender: "N", - baseStats: {hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86}, - abilities: {0: "Levitate"}, + baseStats: { hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Red", @@ -8517,8 +8517,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mow", types: ["Electric", "Grass"], gender: "N", - baseStats: {hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86}, - abilities: {0: "Levitate"}, + baseStats: { hp: 50, atk: 65, def: 107, spa: 105, spd: 107, spe: 86 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Red", @@ -8530,8 +8530,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Uxie", types: ["Psychic"], gender: "N", - baseStats: {hp: 75, atk: 75, def: 130, spa: 75, spd: 130, spe: 95}, - abilities: {0: "Levitate"}, + baseStats: { hp: 75, atk: 75, def: 130, spa: 75, spd: 130, spe: 95 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Yellow", @@ -8543,8 +8543,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Mesprit", types: ["Psychic"], gender: "N", - baseStats: {hp: 80, atk: 105, def: 105, spa: 105, spd: 105, spe: 80}, - abilities: {0: "Levitate"}, + baseStats: { hp: 80, atk: 105, def: 105, spa: 105, spd: 105, spe: 80 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Pink", @@ -8556,8 +8556,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Azelf", types: ["Psychic"], gender: "N", - baseStats: {hp: 75, atk: 125, def: 70, spa: 125, spd: 70, spe: 115}, - abilities: {0: "Levitate"}, + baseStats: { hp: 75, atk: 125, def: 70, spa: 125, spd: 70, spe: 115 }, + abilities: { 0: "Levitate" }, heightm: 0.3, weightkg: 0.3, color: "Blue", @@ -8569,8 +8569,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Dialga", types: ["Steel", "Dragon"], gender: "N", - baseStats: {hp: 100, atk: 120, def: 120, spa: 150, spd: 100, spe: 90}, - abilities: {0: "Pressure", H: "Telepathy"}, + baseStats: { hp: 100, atk: 120, def: 120, spa: 150, spd: 100, spe: 90 }, + abilities: { 0: "Pressure", H: "Telepathy" }, heightm: 5.4, weightkg: 683, tags: ["Restricted Legendary"], @@ -8586,8 +8586,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Origin", types: ["Steel", "Dragon"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 120, spa: 150, spd: 120, spe: 90}, - abilities: {0: "Pressure", H: "Telepathy"}, + baseStats: { hp: 100, atk: 100, def: 120, spa: 150, spd: 120, spe: 90 }, + abilities: { 0: "Pressure", H: "Telepathy" }, heightm: 7, weightkg: 850, color: "Blue", @@ -8601,8 +8601,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Palkia", types: ["Water", "Dragon"], gender: "N", - baseStats: {hp: 90, atk: 120, def: 100, spa: 150, spd: 120, spe: 100}, - abilities: {0: "Pressure", H: "Telepathy"}, + baseStats: { hp: 90, atk: 120, def: 100, spa: 150, spd: 120, spe: 100 }, + abilities: { 0: "Pressure", H: "Telepathy" }, heightm: 4.2, weightkg: 336, color: "Purple", @@ -8618,8 +8618,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Origin", types: ["Water", "Dragon"], gender: "N", - baseStats: {hp: 90, atk: 100, def: 100, spa: 150, spd: 120, spe: 120}, - abilities: {0: "Pressure", H: "Telepathy"}, + baseStats: { hp: 90, atk: 100, def: 100, spa: 150, spd: 120, spe: 120 }, + abilities: { 0: "Pressure", H: "Telepathy" }, heightm: 6.3, weightkg: 660, color: "Purple", @@ -8632,8 +8632,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 485, name: "Heatran", types: ["Fire", "Steel"], - baseStats: {hp: 91, atk: 90, def: 106, spa: 130, spd: 106, spe: 77}, - abilities: {0: "Flash Fire", H: "Flame Body"}, + baseStats: { hp: 91, atk: 90, def: 106, spa: 130, spd: 106, spe: 77 }, + abilities: { 0: "Flash Fire", H: "Flame Body" }, heightm: 1.7, weightkg: 430, color: "Brown", @@ -8645,8 +8645,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Regigigas", types: ["Normal"], gender: "N", - baseStats: {hp: 110, atk: 160, def: 110, spa: 80, spd: 110, spe: 100}, - abilities: {0: "Slow Start"}, + baseStats: { hp: 110, atk: 160, def: 110, spa: 80, spd: 110, spe: 100 }, + abilities: { 0: "Slow Start" }, heightm: 3.7, weightkg: 420, color: "White", @@ -8659,8 +8659,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Altered", types: ["Ghost", "Dragon"], gender: "N", - baseStats: {hp: 150, atk: 100, def: 120, spa: 100, spd: 120, spe: 90}, - abilities: {0: "Pressure", H: "Telepathy"}, + baseStats: { hp: 150, atk: 100, def: 120, spa: 100, spd: 120, spe: 90 }, + abilities: { 0: "Pressure", H: "Telepathy" }, heightm: 4.5, weightkg: 750, color: "Black", @@ -8676,8 +8676,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Origin", types: ["Ghost", "Dragon"], gender: "N", - baseStats: {hp: 150, atk: 120, def: 100, spa: 120, spd: 100, spe: 90}, - abilities: {0: "Levitate"}, + baseStats: { hp: 150, atk: 120, def: 100, spa: 120, spd: 100, spe: 90 }, + abilities: { 0: "Levitate" }, heightm: 6.9, weightkg: 650, color: "Black", @@ -8690,8 +8690,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Cresselia", types: ["Psychic"], gender: "F", - baseStats: {hp: 120, atk: 70, def: 110, spa: 75, spd: 120, spe: 85}, - abilities: {0: "Levitate"}, + baseStats: { hp: 120, atk: 70, def: 110, spa: 75, spd: 120, spe: 85 }, + abilities: { 0: "Levitate" }, heightm: 1.5, weightkg: 85.6, color: "Yellow", @@ -8703,8 +8703,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Phione", types: ["Water"], gender: "N", - baseStats: {hp: 80, atk: 80, def: 80, spa: 80, spd: 80, spe: 80}, - abilities: {0: "Hydration"}, + baseStats: { hp: 80, atk: 80, def: 80, spa: 80, spd: 80, spe: 80 }, + abilities: { 0: "Hydration" }, heightm: 0.4, weightkg: 3.1, color: "Blue", @@ -8716,8 +8716,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Manaphy", types: ["Water"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Hydration"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Hydration" }, heightm: 0.3, weightkg: 1.4, color: "Blue", @@ -8729,8 +8729,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Darkrai", types: ["Dark"], gender: "N", - baseStats: {hp: 70, atk: 90, def: 90, spa: 135, spd: 90, spe: 125}, - abilities: {0: "Bad Dreams"}, + baseStats: { hp: 70, atk: 90, def: 90, spa: 135, spd: 90, spe: 125 }, + abilities: { 0: "Bad Dreams" }, heightm: 1.5, weightkg: 50.5, color: "Black", @@ -8743,8 +8743,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Land", types: ["Grass"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Natural Cure"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Natural Cure" }, heightm: 0.2, weightkg: 2.1, color: "Green", @@ -8760,8 +8760,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Sky", types: ["Grass", "Flying"], gender: "N", - baseStats: {hp: 100, atk: 103, def: 75, spa: 120, spd: 75, spe: 127}, - abilities: {0: "Serene Grace"}, + baseStats: { hp: 100, atk: 103, def: 75, spa: 120, spd: 75, spe: 127 }, + abilities: { 0: "Serene Grace" }, heightm: 0.4, weightkg: 5.2, color: "Green", @@ -8774,8 +8774,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Normal", types: ["Normal"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8794,8 +8794,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Bug", types: ["Bug"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8810,8 +8810,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Dark", types: ["Dark"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8826,8 +8826,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Dragon", types: ["Dragon"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8842,8 +8842,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Electric", types: ["Electric"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8858,8 +8858,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Fairy", types: ["Fairy"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8875,8 +8875,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Fighting", types: ["Fighting"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8891,8 +8891,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Fire", types: ["Fire"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8907,8 +8907,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Flying", types: ["Flying"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8923,8 +8923,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ghost", types: ["Ghost"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8939,8 +8939,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Grass", types: ["Grass"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8955,8 +8955,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ground", types: ["Ground"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8971,8 +8971,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ice", types: ["Ice"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -8987,8 +8987,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Poison", types: ["Poison"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -9003,8 +9003,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Psychic", types: ["Psychic"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -9019,8 +9019,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Rock", types: ["Rock"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -9035,8 +9035,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Steel", types: ["Steel"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -9051,8 +9051,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Water", types: ["Water"], gender: "N", - baseStats: {hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120}, - abilities: {0: "Multitype"}, + baseStats: { hp: 120, atk: 120, def: 120, spa: 120, spd: 120, spe: 120 }, + abilities: { 0: "Multitype" }, heightm: 3.2, weightkg: 320, color: "White", @@ -9065,8 +9065,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Victini", types: ["Psychic", "Fire"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Victory Star"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Victory Star" }, heightm: 0.4, weightkg: 4, color: "Yellow", @@ -9077,9 +9077,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 495, name: "Snivy", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 45, atk: 45, def: 55, spa: 45, spd: 55, spe: 63}, - abilities: {0: "Overgrow", H: "Contrary"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 45, atk: 45, def: 55, spa: 45, spd: 55, spe: 63 }, + abilities: { 0: "Overgrow", H: "Contrary" }, heightm: 0.6, weightkg: 8.1, color: "Green", @@ -9090,9 +9090,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 496, name: "Servine", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 60, def: 75, spa: 60, spd: 75, spe: 83}, - abilities: {0: "Overgrow", H: "Contrary"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 60, def: 75, spa: 60, spd: 75, spe: 83 }, + abilities: { 0: "Overgrow", H: "Contrary" }, heightm: 0.8, weightkg: 16, color: "Green", @@ -9105,9 +9105,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 497, name: "Serperior", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 75, def: 95, spa: 75, spd: 95, spe: 113}, - abilities: {0: "Overgrow", H: "Contrary"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 75, def: 95, spa: 75, spd: 95, spe: 113 }, + abilities: { 0: "Overgrow", H: "Contrary" }, heightm: 3.3, weightkg: 63, color: "Green", @@ -9119,9 +9119,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 498, name: "Tepig", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 63, def: 45, spa: 45, spd: 45, spe: 45}, - abilities: {0: "Blaze", H: "Thick Fat"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 63, def: 45, spa: 45, spd: 45, spe: 45 }, + abilities: { 0: "Blaze", H: "Thick Fat" }, heightm: 0.5, weightkg: 9.9, color: "Red", @@ -9132,9 +9132,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 499, name: "Pignite", types: ["Fire", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 90, atk: 93, def: 55, spa: 70, spd: 55, spe: 55}, - abilities: {0: "Blaze", H: "Thick Fat"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 90, atk: 93, def: 55, spa: 70, spd: 55, spe: 55 }, + abilities: { 0: "Blaze", H: "Thick Fat" }, heightm: 1, weightkg: 55.5, color: "Red", @@ -9147,9 +9147,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 500, name: "Emboar", types: ["Fire", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 110, atk: 123, def: 65, spa: 100, spd: 65, spe: 65}, - abilities: {0: "Blaze", H: "Reckless"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 110, atk: 123, def: 65, spa: 100, spd: 65, spe: 65 }, + abilities: { 0: "Blaze", H: "Reckless" }, heightm: 1.6, weightkg: 150, color: "Red", @@ -9161,9 +9161,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 501, name: "Oshawott", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 55, def: 45, spa: 63, spd: 45, spe: 45}, - abilities: {0: "Torrent", H: "Shell Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 55, def: 45, spa: 63, spd: 45, spe: 45 }, + abilities: { 0: "Torrent", H: "Shell Armor" }, heightm: 0.5, weightkg: 5.9, color: "Blue", @@ -9174,9 +9174,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 502, name: "Dewott", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 75, def: 60, spa: 83, spd: 60, spe: 60}, - abilities: {0: "Torrent", H: "Shell Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 75, def: 60, spa: 83, spd: 60, spe: 60 }, + abilities: { 0: "Torrent", H: "Shell Armor" }, heightm: 0.8, weightkg: 24.5, color: "Blue", @@ -9189,9 +9189,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 503, name: "Samurott", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 95, atk: 100, def: 85, spa: 108, spd: 70, spe: 70}, - abilities: {0: "Torrent", H: "Shell Armor"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 95, atk: 100, def: 85, spa: 108, spd: 70, spe: 70 }, + abilities: { 0: "Torrent", H: "Shell Armor" }, heightm: 1.5, weightkg: 94.6, color: "Blue", @@ -9207,9 +9207,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Samurott", forme: "Hisui", types: ["Water", "Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 90, atk: 108, def: 80, spa: 100, spd: 65, spe: 85}, - abilities: {0: "Torrent", H: "Sharpness"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 90, atk: 108, def: 80, spa: 100, spd: 65, spe: 85 }, + abilities: { 0: "Torrent", H: "Sharpness" }, heightm: 1.5, weightkg: 58.2, color: "Blue", @@ -9221,8 +9221,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 504, name: "Patrat", types: ["Normal"], - baseStats: {hp: 45, atk: 55, def: 39, spa: 35, spd: 39, spe: 42}, - abilities: {0: "Run Away", 1: "Keen Eye", H: "Analytic"}, + baseStats: { hp: 45, atk: 55, def: 39, spa: 35, spd: 39, spe: 42 }, + abilities: { 0: "Run Away", 1: "Keen Eye", H: "Analytic" }, heightm: 0.5, weightkg: 11.6, color: "Brown", @@ -9233,8 +9233,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 505, name: "Watchog", types: ["Normal"], - baseStats: {hp: 60, atk: 85, def: 69, spa: 60, spd: 69, spe: 77}, - abilities: {0: "Illuminate", 1: "Keen Eye", H: "Analytic"}, + baseStats: { hp: 60, atk: 85, def: 69, spa: 60, spd: 69, spe: 77 }, + abilities: { 0: "Illuminate", 1: "Keen Eye", H: "Analytic" }, heightm: 1.1, weightkg: 27, color: "Brown", @@ -9246,8 +9246,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 506, name: "Lillipup", types: ["Normal"], - baseStats: {hp: 45, atk: 60, def: 45, spa: 25, spd: 45, spe: 55}, - abilities: {0: "Vital Spirit", 1: "Pickup", H: "Run Away"}, + baseStats: { hp: 45, atk: 60, def: 45, spa: 25, spd: 45, spe: 55 }, + abilities: { 0: "Vital Spirit", 1: "Pickup", H: "Run Away" }, heightm: 0.4, weightkg: 4.1, color: "Brown", @@ -9258,8 +9258,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 507, name: "Herdier", types: ["Normal"], - baseStats: {hp: 65, atk: 80, def: 65, spa: 35, spd: 65, spe: 60}, - abilities: {0: "Intimidate", 1: "Sand Rush", H: "Scrappy"}, + baseStats: { hp: 65, atk: 80, def: 65, spa: 35, spd: 65, spe: 60 }, + abilities: { 0: "Intimidate", 1: "Sand Rush", H: "Scrappy" }, heightm: 0.9, weightkg: 14.7, color: "Gray", @@ -9272,8 +9272,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 508, name: "Stoutland", types: ["Normal"], - baseStats: {hp: 85, atk: 110, def: 90, spa: 45, spd: 90, spe: 80}, - abilities: {0: "Intimidate", 1: "Sand Rush", H: "Scrappy"}, + baseStats: { hp: 85, atk: 110, def: 90, spa: 45, spd: 90, spe: 80 }, + abilities: { 0: "Intimidate", 1: "Sand Rush", H: "Scrappy" }, heightm: 1.2, weightkg: 61, color: "Gray", @@ -9285,8 +9285,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 509, name: "Purrloin", types: ["Dark"], - baseStats: {hp: 41, atk: 50, def: 37, spa: 50, spd: 37, spe: 66}, - abilities: {0: "Limber", 1: "Unburden", H: "Prankster"}, + baseStats: { hp: 41, atk: 50, def: 37, spa: 50, spd: 37, spe: 66 }, + abilities: { 0: "Limber", 1: "Unburden", H: "Prankster" }, heightm: 0.4, weightkg: 10.1, color: "Purple", @@ -9297,8 +9297,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 510, name: "Liepard", types: ["Dark"], - baseStats: {hp: 64, atk: 88, def: 50, spa: 88, spd: 50, spe: 106}, - abilities: {0: "Limber", 1: "Unburden", H: "Prankster"}, + baseStats: { hp: 64, atk: 88, def: 50, spa: 88, spd: 50, spe: 106 }, + abilities: { 0: "Limber", 1: "Unburden", H: "Prankster" }, heightm: 1.1, weightkg: 37.5, color: "Purple", @@ -9310,9 +9310,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 511, name: "Pansage", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 53, def: 48, spa: 53, spd: 48, spe: 64}, - abilities: {0: "Gluttony", H: "Overgrow"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 53, def: 48, spa: 53, spd: 48, spe: 64 }, + abilities: { 0: "Gluttony", H: "Overgrow" }, heightm: 0.6, weightkg: 10.5, color: "Green", @@ -9323,9 +9323,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 512, name: "Simisage", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 98, def: 63, spa: 98, spd: 63, spe: 101}, - abilities: {0: "Gluttony", H: "Overgrow"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 98, def: 63, spa: 98, spd: 63, spe: 101 }, + abilities: { 0: "Gluttony", H: "Overgrow" }, heightm: 1.1, weightkg: 30.5, color: "Green", @@ -9338,9 +9338,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 513, name: "Pansear", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 53, def: 48, spa: 53, spd: 48, spe: 64}, - abilities: {0: "Gluttony", H: "Blaze"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 53, def: 48, spa: 53, spd: 48, spe: 64 }, + abilities: { 0: "Gluttony", H: "Blaze" }, heightm: 0.6, weightkg: 11, color: "Red", @@ -9351,9 +9351,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 514, name: "Simisear", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 98, def: 63, spa: 98, spd: 63, spe: 101}, - abilities: {0: "Gluttony", H: "Blaze"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 98, def: 63, spa: 98, spd: 63, spe: 101 }, + abilities: { 0: "Gluttony", H: "Blaze" }, heightm: 1, weightkg: 28, color: "Red", @@ -9366,9 +9366,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 515, name: "Panpour", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 53, def: 48, spa: 53, spd: 48, spe: 64}, - abilities: {0: "Gluttony", H: "Torrent"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 53, def: 48, spa: 53, spd: 48, spe: 64 }, + abilities: { 0: "Gluttony", H: "Torrent" }, heightm: 0.6, weightkg: 13.5, color: "Blue", @@ -9379,9 +9379,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 516, name: "Simipour", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 98, def: 63, spa: 98, spd: 63, spe: 101}, - abilities: {0: "Gluttony", H: "Torrent"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 98, def: 63, spa: 98, spd: 63, spe: 101 }, + abilities: { 0: "Gluttony", H: "Torrent" }, heightm: 1, weightkg: 29, color: "Blue", @@ -9394,8 +9394,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 517, name: "Munna", types: ["Psychic"], - baseStats: {hp: 76, atk: 25, def: 45, spa: 67, spd: 55, spe: 24}, - abilities: {0: "Forewarn", 1: "Synchronize", H: "Telepathy"}, + baseStats: { hp: 76, atk: 25, def: 45, spa: 67, spd: 55, spe: 24 }, + abilities: { 0: "Forewarn", 1: "Synchronize", H: "Telepathy" }, heightm: 0.6, weightkg: 23.3, color: "Pink", @@ -9406,8 +9406,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 518, name: "Musharna", types: ["Psychic"], - baseStats: {hp: 116, atk: 55, def: 85, spa: 107, spd: 95, spe: 29}, - abilities: {0: "Forewarn", 1: "Synchronize", H: "Telepathy"}, + baseStats: { hp: 116, atk: 55, def: 85, spa: 107, spd: 95, spe: 29 }, + abilities: { 0: "Forewarn", 1: "Synchronize", H: "Telepathy" }, heightm: 1.1, weightkg: 60.5, color: "Pink", @@ -9420,8 +9420,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 519, name: "Pidove", types: ["Normal", "Flying"], - baseStats: {hp: 50, atk: 55, def: 50, spa: 36, spd: 30, spe: 43}, - abilities: {0: "Big Pecks", 1: "Super Luck", H: "Rivalry"}, + baseStats: { hp: 50, atk: 55, def: 50, spa: 36, spd: 30, spe: 43 }, + abilities: { 0: "Big Pecks", 1: "Super Luck", H: "Rivalry" }, heightm: 0.3, weightkg: 2.1, color: "Gray", @@ -9432,8 +9432,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 520, name: "Tranquill", types: ["Normal", "Flying"], - baseStats: {hp: 62, atk: 77, def: 62, spa: 50, spd: 42, spe: 65}, - abilities: {0: "Big Pecks", 1: "Super Luck", H: "Rivalry"}, + baseStats: { hp: 62, atk: 77, def: 62, spa: 50, spd: 42, spe: 65 }, + abilities: { 0: "Big Pecks", 1: "Super Luck", H: "Rivalry" }, heightm: 0.6, weightkg: 15, color: "Gray", @@ -9446,8 +9446,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 521, name: "Unfezant", types: ["Normal", "Flying"], - baseStats: {hp: 80, atk: 115, def: 80, spa: 65, spd: 55, spe: 93}, - abilities: {0: "Big Pecks", 1: "Super Luck", H: "Rivalry"}, + baseStats: { hp: 80, atk: 115, def: 80, spa: 65, spd: 55, spe: 93 }, + abilities: { 0: "Big Pecks", 1: "Super Luck", H: "Rivalry" }, heightm: 1.2, weightkg: 29, color: "Gray", @@ -9459,8 +9459,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 522, name: "Blitzle", types: ["Electric"], - baseStats: {hp: 45, atk: 60, def: 32, spa: 50, spd: 32, spe: 76}, - abilities: {0: "Lightning Rod", 1: "Motor Drive", H: "Sap Sipper"}, + baseStats: { hp: 45, atk: 60, def: 32, spa: 50, spd: 32, spe: 76 }, + abilities: { 0: "Lightning Rod", 1: "Motor Drive", H: "Sap Sipper" }, heightm: 0.8, weightkg: 29.8, color: "Black", @@ -9471,8 +9471,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 523, name: "Zebstrika", types: ["Electric"], - baseStats: {hp: 75, atk: 100, def: 63, spa: 80, spd: 63, spe: 116}, - abilities: {0: "Lightning Rod", 1: "Motor Drive", H: "Sap Sipper"}, + baseStats: { hp: 75, atk: 100, def: 63, spa: 80, spd: 63, spe: 116 }, + abilities: { 0: "Lightning Rod", 1: "Motor Drive", H: "Sap Sipper" }, heightm: 1.6, weightkg: 79.5, color: "Black", @@ -9484,8 +9484,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 524, name: "Roggenrola", types: ["Rock"], - baseStats: {hp: 55, atk: 75, def: 85, spa: 25, spd: 25, spe: 15}, - abilities: {0: "Sturdy", 1: "Weak Armor", H: "Sand Force"}, + baseStats: { hp: 55, atk: 75, def: 85, spa: 25, spd: 25, spe: 15 }, + abilities: { 0: "Sturdy", 1: "Weak Armor", H: "Sand Force" }, heightm: 0.4, weightkg: 18, color: "Blue", @@ -9496,8 +9496,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 525, name: "Boldore", types: ["Rock"], - baseStats: {hp: 70, atk: 105, def: 105, spa: 50, spd: 40, spe: 20}, - abilities: {0: "Sturdy", 1: "Weak Armor", H: "Sand Force"}, + baseStats: { hp: 70, atk: 105, def: 105, spa: 50, spd: 40, spe: 20 }, + abilities: { 0: "Sturdy", 1: "Weak Armor", H: "Sand Force" }, heightm: 0.9, weightkg: 102, color: "Blue", @@ -9510,8 +9510,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 526, name: "Gigalith", types: ["Rock"], - baseStats: {hp: 85, atk: 135, def: 130, spa: 60, spd: 80, spe: 25}, - abilities: {0: "Sturdy", 1: "Sand Stream", H: "Sand Force"}, + baseStats: { hp: 85, atk: 135, def: 130, spa: 60, spd: 80, spe: 25 }, + abilities: { 0: "Sturdy", 1: "Sand Stream", H: "Sand Force" }, heightm: 1.7, weightkg: 260, color: "Blue", @@ -9523,8 +9523,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 527, name: "Woobat", types: ["Psychic", "Flying"], - baseStats: {hp: 65, atk: 45, def: 43, spa: 55, spd: 43, spe: 72}, - abilities: {0: "Unaware", 1: "Klutz", H: "Simple"}, + baseStats: { hp: 65, atk: 45, def: 43, spa: 55, spd: 43, spe: 72 }, + abilities: { 0: "Unaware", 1: "Klutz", H: "Simple" }, heightm: 0.4, weightkg: 2.1, color: "Blue", @@ -9535,8 +9535,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 528, name: "Swoobat", types: ["Psychic", "Flying"], - baseStats: {hp: 67, atk: 57, def: 55, spa: 77, spd: 55, spe: 114}, - abilities: {0: "Unaware", 1: "Klutz", H: "Simple"}, + baseStats: { hp: 67, atk: 57, def: 55, spa: 77, spd: 55, spe: 114 }, + abilities: { 0: "Unaware", 1: "Klutz", H: "Simple" }, heightm: 0.9, weightkg: 10.5, color: "Blue", @@ -9548,8 +9548,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 529, name: "Drilbur", types: ["Ground"], - baseStats: {hp: 60, atk: 85, def: 40, spa: 30, spd: 45, spe: 68}, - abilities: {0: "Sand Rush", 1: "Sand Force", H: "Mold Breaker"}, + baseStats: { hp: 60, atk: 85, def: 40, spa: 30, spd: 45, spe: 68 }, + abilities: { 0: "Sand Rush", 1: "Sand Force", H: "Mold Breaker" }, heightm: 0.3, weightkg: 8.5, color: "Gray", @@ -9560,8 +9560,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 530, name: "Excadrill", types: ["Ground", "Steel"], - baseStats: {hp: 110, atk: 135, def: 60, spa: 50, spd: 65, spe: 88}, - abilities: {0: "Sand Rush", 1: "Sand Force", H: "Mold Breaker"}, + baseStats: { hp: 110, atk: 135, def: 60, spa: 50, spd: 65, spe: 88 }, + abilities: { 0: "Sand Rush", 1: "Sand Force", H: "Mold Breaker" }, heightm: 0.7, weightkg: 40.4, color: "Gray", @@ -9573,8 +9573,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 531, name: "Audino", types: ["Normal"], - baseStats: {hp: 103, atk: 60, def: 86, spa: 60, spd: 86, spe: 50}, - abilities: {0: "Healer", 1: "Regenerator", H: "Klutz"}, + baseStats: { hp: 103, atk: 60, def: 86, spa: 60, spd: 86, spe: 50 }, + abilities: { 0: "Healer", 1: "Regenerator", H: "Klutz" }, heightm: 1.1, weightkg: 31, color: "Pink", @@ -9588,8 +9588,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Audino", forme: "Mega", types: ["Normal", "Fairy"], - baseStats: {hp: 103, atk: 60, def: 126, spa: 80, spd: 126, spe: 50}, - abilities: {0: "Healer"}, + baseStats: { hp: 103, atk: 60, def: 126, spa: 80, spd: 126, spe: 50 }, + abilities: { 0: "Healer" }, heightm: 1.5, weightkg: 32, color: "White", @@ -9600,9 +9600,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 532, name: "Timburr", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 75, atk: 80, def: 55, spa: 25, spd: 35, spe: 35}, - abilities: {0: "Guts", 1: "Sheer Force", H: "Iron Fist"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 75, atk: 80, def: 55, spa: 25, spd: 35, spe: 35 }, + abilities: { 0: "Guts", 1: "Sheer Force", H: "Iron Fist" }, heightm: 0.6, weightkg: 12.5, color: "Gray", @@ -9613,9 +9613,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 533, name: "Gurdurr", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 85, atk: 105, def: 85, spa: 40, spd: 50, spe: 40}, - abilities: {0: "Guts", 1: "Sheer Force", H: "Iron Fist"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 85, atk: 105, def: 85, spa: 40, spd: 50, spe: 40 }, + abilities: { 0: "Guts", 1: "Sheer Force", H: "Iron Fist" }, heightm: 1.2, weightkg: 40, color: "Gray", @@ -9628,9 +9628,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 534, name: "Conkeldurr", types: ["Fighting"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 105, atk: 140, def: 95, spa: 55, spd: 65, spe: 45}, - abilities: {0: "Guts", 1: "Sheer Force", H: "Iron Fist"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 105, atk: 140, def: 95, spa: 55, spd: 65, spe: 45 }, + abilities: { 0: "Guts", 1: "Sheer Force", H: "Iron Fist" }, heightm: 1.4, weightkg: 87, color: "Brown", @@ -9642,8 +9642,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 535, name: "Tympole", types: ["Water"], - baseStats: {hp: 50, atk: 50, def: 40, spa: 50, spd: 40, spe: 64}, - abilities: {0: "Swift Swim", 1: "Hydration", H: "Water Absorb"}, + baseStats: { hp: 50, atk: 50, def: 40, spa: 50, spd: 40, spe: 64 }, + abilities: { 0: "Swift Swim", 1: "Hydration", H: "Water Absorb" }, heightm: 0.5, weightkg: 4.5, color: "Blue", @@ -9654,8 +9654,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 536, name: "Palpitoad", types: ["Water", "Ground"], - baseStats: {hp: 75, atk: 65, def: 55, spa: 65, spd: 55, spe: 69}, - abilities: {0: "Swift Swim", 1: "Hydration", H: "Water Absorb"}, + baseStats: { hp: 75, atk: 65, def: 55, spa: 65, spd: 55, spe: 69 }, + abilities: { 0: "Swift Swim", 1: "Hydration", H: "Water Absorb" }, heightm: 0.8, weightkg: 17, color: "Blue", @@ -9668,8 +9668,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 537, name: "Seismitoad", types: ["Water", "Ground"], - baseStats: {hp: 105, atk: 95, def: 75, spa: 85, spd: 75, spe: 74}, - abilities: {0: "Swift Swim", 1: "Poison Touch", H: "Water Absorb"}, + baseStats: { hp: 105, atk: 95, def: 75, spa: 85, spd: 75, spe: 74 }, + abilities: { 0: "Swift Swim", 1: "Poison Touch", H: "Water Absorb" }, heightm: 1.5, weightkg: 62, color: "Blue", @@ -9682,8 +9682,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Throh", types: ["Fighting"], gender: "M", - baseStats: {hp: 120, atk: 100, def: 85, spa: 30, spd: 85, spe: 45}, - abilities: {0: "Guts", 1: "Inner Focus", H: "Mold Breaker"}, + baseStats: { hp: 120, atk: 100, def: 85, spa: 30, spd: 85, spe: 45 }, + abilities: { 0: "Guts", 1: "Inner Focus", H: "Mold Breaker" }, heightm: 1.3, weightkg: 55.5, color: "Red", @@ -9694,8 +9694,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Sawk", types: ["Fighting"], gender: "M", - baseStats: {hp: 75, atk: 125, def: 75, spa: 30, spd: 75, spe: 85}, - abilities: {0: "Sturdy", 1: "Inner Focus", H: "Mold Breaker"}, + baseStats: { hp: 75, atk: 125, def: 75, spa: 30, spd: 75, spe: 85 }, + abilities: { 0: "Sturdy", 1: "Inner Focus", H: "Mold Breaker" }, heightm: 1.4, weightkg: 51, color: "Blue", @@ -9705,8 +9705,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 540, name: "Sewaddle", types: ["Bug", "Grass"], - baseStats: {hp: 45, atk: 53, def: 70, spa: 40, spd: 60, spe: 42}, - abilities: {0: "Swarm", 1: "Chlorophyll", H: "Overcoat"}, + baseStats: { hp: 45, atk: 53, def: 70, spa: 40, spd: 60, spe: 42 }, + abilities: { 0: "Swarm", 1: "Chlorophyll", H: "Overcoat" }, heightm: 0.3, weightkg: 2.5, color: "Yellow", @@ -9717,8 +9717,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 541, name: "Swadloon", types: ["Bug", "Grass"], - baseStats: {hp: 55, atk: 63, def: 90, spa: 50, spd: 80, spe: 42}, - abilities: {0: "Leaf Guard", 1: "Chlorophyll", H: "Overcoat"}, + baseStats: { hp: 55, atk: 63, def: 90, spa: 50, spd: 80, spe: 42 }, + abilities: { 0: "Leaf Guard", 1: "Chlorophyll", H: "Overcoat" }, heightm: 0.5, weightkg: 7.3, color: "Green", @@ -9731,8 +9731,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 542, name: "Leavanny", types: ["Bug", "Grass"], - baseStats: {hp: 75, atk: 103, def: 80, spa: 70, spd: 80, spe: 92}, - abilities: {0: "Swarm", 1: "Chlorophyll", H: "Overcoat"}, + baseStats: { hp: 75, atk: 103, def: 80, spa: 70, spd: 80, spe: 92 }, + abilities: { 0: "Swarm", 1: "Chlorophyll", H: "Overcoat" }, heightm: 1.2, weightkg: 20.5, color: "Yellow", @@ -9744,8 +9744,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 543, name: "Venipede", types: ["Bug", "Poison"], - baseStats: {hp: 30, atk: 45, def: 59, spa: 30, spd: 39, spe: 57}, - abilities: {0: "Poison Point", 1: "Swarm", H: "Speed Boost"}, + baseStats: { hp: 30, atk: 45, def: 59, spa: 30, spd: 39, spe: 57 }, + abilities: { 0: "Poison Point", 1: "Swarm", H: "Speed Boost" }, heightm: 0.4, weightkg: 5.3, color: "Red", @@ -9756,8 +9756,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 544, name: "Whirlipede", types: ["Bug", "Poison"], - baseStats: {hp: 40, atk: 55, def: 99, spa: 40, spd: 79, spe: 47}, - abilities: {0: "Poison Point", 1: "Swarm", H: "Speed Boost"}, + baseStats: { hp: 40, atk: 55, def: 99, spa: 40, spd: 79, spe: 47 }, + abilities: { 0: "Poison Point", 1: "Swarm", H: "Speed Boost" }, heightm: 1.2, weightkg: 58.5, color: "Gray", @@ -9770,8 +9770,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 545, name: "Scolipede", types: ["Bug", "Poison"], - baseStats: {hp: 60, atk: 100, def: 89, spa: 55, spd: 69, spe: 112}, - abilities: {0: "Poison Point", 1: "Swarm", H: "Speed Boost"}, + baseStats: { hp: 60, atk: 100, def: 89, spa: 55, spd: 69, spe: 112 }, + abilities: { 0: "Poison Point", 1: "Swarm", H: "Speed Boost" }, heightm: 2.5, weightkg: 200.5, color: "Red", @@ -9783,8 +9783,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 546, name: "Cottonee", types: ["Grass", "Fairy"], - baseStats: {hp: 40, atk: 27, def: 60, spa: 37, spd: 50, spe: 66}, - abilities: {0: "Prankster", 1: "Infiltrator", H: "Chlorophyll"}, + baseStats: { hp: 40, atk: 27, def: 60, spa: 37, spd: 50, spe: 66 }, + abilities: { 0: "Prankster", 1: "Infiltrator", H: "Chlorophyll" }, heightm: 0.3, weightkg: 0.6, color: "Green", @@ -9795,8 +9795,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 547, name: "Whimsicott", types: ["Grass", "Fairy"], - baseStats: {hp: 60, atk: 67, def: 85, spa: 77, spd: 75, spe: 116}, - abilities: {0: "Prankster", 1: "Infiltrator", H: "Chlorophyll"}, + baseStats: { hp: 60, atk: 67, def: 85, spa: 77, spd: 75, spe: 116 }, + abilities: { 0: "Prankster", 1: "Infiltrator", H: "Chlorophyll" }, heightm: 0.7, weightkg: 6.6, color: "Green", @@ -9810,8 +9810,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Petilil", types: ["Grass"], gender: "F", - baseStats: {hp: 45, atk: 35, def: 50, spa: 70, spd: 50, spe: 30}, - abilities: {0: "Chlorophyll", 1: "Own Tempo", H: "Leaf Guard"}, + baseStats: { hp: 45, atk: 35, def: 50, spa: 70, spd: 50, spe: 30 }, + abilities: { 0: "Chlorophyll", 1: "Own Tempo", H: "Leaf Guard" }, heightm: 0.5, weightkg: 6.6, color: "Green", @@ -9823,8 +9823,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Lilligant", types: ["Grass"], gender: "F", - baseStats: {hp: 70, atk: 60, def: 75, spa: 110, spd: 75, spe: 90}, - abilities: {0: "Chlorophyll", 1: "Own Tempo", H: "Leaf Guard"}, + baseStats: { hp: 70, atk: 60, def: 75, spa: 110, spd: 75, spe: 90 }, + abilities: { 0: "Chlorophyll", 1: "Own Tempo", H: "Leaf Guard" }, heightm: 1.1, weightkg: 16.3, color: "Green", @@ -9842,8 +9842,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Hisui", types: ["Grass", "Fighting"], gender: "F", - baseStats: {hp: 70, atk: 105, def: 75, spa: 50, spd: 75, spe: 105}, - abilities: {0: "Chlorophyll", 1: "Hustle", H: "Leaf Guard"}, + baseStats: { hp: 70, atk: 105, def: 75, spa: 50, spd: 75, spe: 105 }, + abilities: { 0: "Chlorophyll", 1: "Hustle", H: "Leaf Guard" }, heightm: 1.2, weightkg: 19.2, color: "Green", @@ -9857,8 +9857,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Basculin", baseForme: "Red-Striped", types: ["Water"], - baseStats: {hp: 70, atk: 92, def: 65, spa: 80, spd: 55, spe: 98}, - abilities: {0: "Reckless", 1: "Adaptability", H: "Mold Breaker"}, + baseStats: { hp: 70, atk: 92, def: 65, spa: 80, spd: 55, spe: 98 }, + abilities: { 0: "Reckless", 1: "Adaptability", H: "Mold Breaker" }, heightm: 1, weightkg: 18, color: "Green", @@ -9872,8 +9872,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Basculin", forme: "Blue-Striped", types: ["Water"], - baseStats: {hp: 70, atk: 92, def: 65, spa: 80, spd: 55, spe: 98}, - abilities: {0: "Rock Head", 1: "Adaptability", H: "Mold Breaker"}, + baseStats: { hp: 70, atk: 92, def: 65, spa: 80, spd: 55, spe: 98 }, + abilities: { 0: "Rock Head", 1: "Adaptability", H: "Mold Breaker" }, heightm: 1, weightkg: 18, color: "Green", @@ -9885,8 +9885,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Basculin", forme: "White-Striped", types: ["Water"], - baseStats: {hp: 70, atk: 92, def: 65, spa: 80, spd: 55, spe: 98}, - abilities: {0: "Rattled", 1: "Adaptability", H: "Mold Breaker"}, + baseStats: { hp: 70, atk: 92, def: 65, spa: 80, spd: 55, spe: 98 }, + abilities: { 0: "Rattled", 1: "Adaptability", H: "Mold Breaker" }, heightm: 1, weightkg: 18, color: "Green", @@ -9898,8 +9898,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 551, name: "Sandile", types: ["Ground", "Dark"], - baseStats: {hp: 50, atk: 72, def: 35, spa: 35, spd: 35, spe: 65}, - abilities: {0: "Intimidate", 1: "Moxie", H: "Anger Point"}, + baseStats: { hp: 50, atk: 72, def: 35, spa: 35, spd: 35, spe: 65 }, + abilities: { 0: "Intimidate", 1: "Moxie", H: "Anger Point" }, heightm: 0.7, weightkg: 15.2, color: "Brown", @@ -9910,8 +9910,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 552, name: "Krokorok", types: ["Ground", "Dark"], - baseStats: {hp: 60, atk: 82, def: 45, spa: 45, spd: 45, spe: 74}, - abilities: {0: "Intimidate", 1: "Moxie", H: "Anger Point"}, + baseStats: { hp: 60, atk: 82, def: 45, spa: 45, spd: 45, spe: 74 }, + abilities: { 0: "Intimidate", 1: "Moxie", H: "Anger Point" }, heightm: 1, weightkg: 33.4, color: "Brown", @@ -9924,8 +9924,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 553, name: "Krookodile", types: ["Ground", "Dark"], - baseStats: {hp: 95, atk: 117, def: 80, spa: 65, spd: 70, spe: 92}, - abilities: {0: "Intimidate", 1: "Moxie", H: "Anger Point"}, + baseStats: { hp: 95, atk: 117, def: 80, spa: 65, spd: 70, spe: 92 }, + abilities: { 0: "Intimidate", 1: "Moxie", H: "Anger Point" }, heightm: 1.5, weightkg: 96.3, color: "Red", @@ -9937,8 +9937,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 554, name: "Darumaka", types: ["Fire"], - baseStats: {hp: 70, atk: 90, def: 45, spa: 15, spd: 45, spe: 50}, - abilities: {0: "Hustle", H: "Inner Focus"}, + baseStats: { hp: 70, atk: 90, def: 45, spa: 15, spd: 45, spe: 50 }, + abilities: { 0: "Hustle", H: "Inner Focus" }, heightm: 0.6, weightkg: 37.5, color: "Red", @@ -9953,8 +9953,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Darumaka", forme: "Galar", types: ["Ice"], - baseStats: {hp: 70, atk: 90, def: 45, spa: 15, spd: 45, spe: 50}, - abilities: {0: "Hustle", H: "Inner Focus"}, + baseStats: { hp: 70, atk: 90, def: 45, spa: 15, spd: 45, spe: 50 }, + abilities: { 0: "Hustle", H: "Inner Focus" }, heightm: 0.7, weightkg: 40, color: "White", @@ -9966,8 +9966,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Darmanitan", baseForme: "Standard", types: ["Fire"], - baseStats: {hp: 105, atk: 140, def: 55, spa: 30, spd: 55, spe: 95}, - abilities: {0: "Sheer Force", H: "Zen Mode"}, + baseStats: { hp: 105, atk: 140, def: 55, spa: 30, spd: 55, spe: 95 }, + abilities: { 0: "Sheer Force", H: "Zen Mode" }, heightm: 1.3, weightkg: 92.9, color: "Red", @@ -9983,8 +9983,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Darmanitan", forme: "Zen", types: ["Fire", "Psychic"], - baseStats: {hp: 105, atk: 30, def: 105, spa: 140, spd: 105, spe: 55}, - abilities: {0: "Zen Mode"}, + baseStats: { hp: 105, atk: 30, def: 105, spa: 140, spd: 105, spe: 55 }, + abilities: { 0: "Zen Mode" }, heightm: 1.3, weightkg: 92.9, color: "Blue", @@ -9998,8 +9998,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Darmanitan", forme: "Galar", types: ["Ice"], - baseStats: {hp: 105, atk: 140, def: 55, spa: 30, spd: 55, spe: 95}, - abilities: {0: "Gorilla Tactics", H: "Zen Mode"}, + baseStats: { hp: 105, atk: 140, def: 55, spa: 30, spd: 55, spe: 95 }, + abilities: { 0: "Gorilla Tactics", H: "Zen Mode" }, heightm: 1.7, weightkg: 120, color: "White", @@ -10014,8 +10014,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Darmanitan", forme: "Galar-Zen", types: ["Ice", "Fire"], - baseStats: {hp: 105, atk: 160, def: 55, spa: 30, spd: 55, spe: 135}, - abilities: {0: "Zen Mode"}, + baseStats: { hp: 105, atk: 160, def: 55, spa: 30, spd: 55, spe: 135 }, + abilities: { 0: "Zen Mode" }, heightm: 1.7, weightkg: 120, color: "White", @@ -10027,8 +10027,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 556, name: "Maractus", types: ["Grass"], - baseStats: {hp: 75, atk: 86, def: 67, spa: 106, spd: 67, spe: 60}, - abilities: {0: "Water Absorb", 1: "Chlorophyll", H: "Storm Drain"}, + baseStats: { hp: 75, atk: 86, def: 67, spa: 106, spd: 67, spe: 60 }, + abilities: { 0: "Water Absorb", 1: "Chlorophyll", H: "Storm Drain" }, heightm: 1, weightkg: 28, color: "Green", @@ -10038,8 +10038,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 557, name: "Dwebble", types: ["Bug", "Rock"], - baseStats: {hp: 50, atk: 65, def: 85, spa: 35, spd: 35, spe: 55}, - abilities: {0: "Sturdy", 1: "Shell Armor", H: "Weak Armor"}, + baseStats: { hp: 50, atk: 65, def: 85, spa: 35, spd: 35, spe: 55 }, + abilities: { 0: "Sturdy", 1: "Shell Armor", H: "Weak Armor" }, heightm: 0.3, weightkg: 14.5, color: "Red", @@ -10050,8 +10050,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 558, name: "Crustle", types: ["Bug", "Rock"], - baseStats: {hp: 70, atk: 105, def: 125, spa: 65, spd: 75, spe: 45}, - abilities: {0: "Sturdy", 1: "Shell Armor", H: "Weak Armor"}, + baseStats: { hp: 70, atk: 105, def: 125, spa: 65, spd: 75, spe: 45 }, + abilities: { 0: "Sturdy", 1: "Shell Armor", H: "Weak Armor" }, heightm: 1.4, weightkg: 200, color: "Red", @@ -10063,8 +10063,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 559, name: "Scraggy", types: ["Dark", "Fighting"], - baseStats: {hp: 50, atk: 75, def: 70, spa: 35, spd: 70, spe: 48}, - abilities: {0: "Shed Skin", 1: "Moxie", H: "Intimidate"}, + baseStats: { hp: 50, atk: 75, def: 70, spa: 35, spd: 70, spe: 48 }, + abilities: { 0: "Shed Skin", 1: "Moxie", H: "Intimidate" }, heightm: 0.6, weightkg: 11.8, color: "Yellow", @@ -10075,8 +10075,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 560, name: "Scrafty", types: ["Dark", "Fighting"], - baseStats: {hp: 65, atk: 90, def: 115, spa: 45, spd: 115, spe: 58}, - abilities: {0: "Shed Skin", 1: "Moxie", H: "Intimidate"}, + baseStats: { hp: 65, atk: 90, def: 115, spa: 45, spd: 115, spe: 58 }, + abilities: { 0: "Shed Skin", 1: "Moxie", H: "Intimidate" }, heightm: 1.1, weightkg: 30, color: "Red", @@ -10088,8 +10088,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 561, name: "Sigilyph", types: ["Psychic", "Flying"], - baseStats: {hp: 72, atk: 58, def: 80, spa: 103, spd: 80, spe: 97}, - abilities: {0: "Wonder Skin", 1: "Magic Guard", H: "Tinted Lens"}, + baseStats: { hp: 72, atk: 58, def: 80, spa: 103, spd: 80, spe: 97 }, + abilities: { 0: "Wonder Skin", 1: "Magic Guard", H: "Tinted Lens" }, heightm: 1.4, weightkg: 14, color: "Black", @@ -10099,8 +10099,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 562, name: "Yamask", types: ["Ghost"], - baseStats: {hp: 38, atk: 30, def: 85, spa: 55, spd: 65, spe: 30}, - abilities: {0: "Mummy"}, + baseStats: { hp: 38, atk: 30, def: 85, spa: 55, spd: 65, spe: 30 }, + abilities: { 0: "Mummy" }, heightm: 0.5, weightkg: 1.5, color: "Black", @@ -10115,8 +10115,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Yamask", forme: "Galar", types: ["Ground", "Ghost"], - baseStats: {hp: 38, atk: 55, def: 85, spa: 30, spd: 65, spe: 30}, - abilities: {0: "Wandering Spirit"}, + baseStats: { hp: 38, atk: 55, def: 85, spa: 30, spd: 65, spe: 30 }, + abilities: { 0: "Wandering Spirit" }, heightm: 0.5, weightkg: 1.5, color: "Black", @@ -10127,8 +10127,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 563, name: "Cofagrigus", types: ["Ghost"], - baseStats: {hp: 58, atk: 50, def: 145, spa: 95, spd: 105, spe: 30}, - abilities: {0: "Mummy"}, + baseStats: { hp: 58, atk: 50, def: 145, spa: 95, spd: 105, spe: 30 }, + abilities: { 0: "Mummy" }, heightm: 1.7, weightkg: 76.5, color: "Yellow", @@ -10140,9 +10140,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 564, name: "Tirtouga", types: ["Water", "Rock"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 54, atk: 78, def: 103, spa: 53, spd: 45, spe: 22}, - abilities: {0: "Solid Rock", 1: "Sturdy", H: "Swift Swim"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 54, atk: 78, def: 103, spa: 53, spd: 45, spe: 22 }, + abilities: { 0: "Solid Rock", 1: "Sturdy", H: "Swift Swim" }, heightm: 0.7, weightkg: 16.5, color: "Blue", @@ -10153,9 +10153,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 565, name: "Carracosta", types: ["Water", "Rock"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 74, atk: 108, def: 133, spa: 83, spd: 65, spe: 32}, - abilities: {0: "Solid Rock", 1: "Sturdy", H: "Swift Swim"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 74, atk: 108, def: 133, spa: 83, spd: 65, spe: 32 }, + abilities: { 0: "Solid Rock", 1: "Sturdy", H: "Swift Swim" }, heightm: 1.2, weightkg: 81, color: "Blue", @@ -10167,9 +10167,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 566, name: "Archen", types: ["Rock", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 112, def: 45, spa: 74, spd: 45, spe: 70}, - abilities: {0: "Defeatist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 112, def: 45, spa: 74, spd: 45, spe: 70 }, + abilities: { 0: "Defeatist" }, heightm: 0.5, weightkg: 9.5, color: "Yellow", @@ -10180,9 +10180,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 567, name: "Archeops", types: ["Rock", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 140, def: 65, spa: 112, spd: 65, spe: 110}, - abilities: {0: "Defeatist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 140, def: 65, spa: 112, spd: 65, spe: 110 }, + abilities: { 0: "Defeatist" }, heightm: 1.4, weightkg: 32, color: "Yellow", @@ -10194,8 +10194,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 568, name: "Trubbish", types: ["Poison"], - baseStats: {hp: 50, atk: 50, def: 62, spa: 40, spd: 62, spe: 65}, - abilities: {0: "Stench", 1: "Sticky Hold", H: "Aftermath"}, + baseStats: { hp: 50, atk: 50, def: 62, spa: 40, spd: 62, spe: 65 }, + abilities: { 0: "Stench", 1: "Sticky Hold", H: "Aftermath" }, heightm: 0.6, weightkg: 31, color: "Green", @@ -10206,8 +10206,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 569, name: "Garbodor", types: ["Poison"], - baseStats: {hp: 80, atk: 95, def: 82, spa: 60, spd: 82, spe: 75}, - abilities: {0: "Stench", 1: "Weak Armor", H: "Aftermath"}, + baseStats: { hp: 80, atk: 95, def: 82, spa: 60, spd: 82, spe: 75 }, + abilities: { 0: "Stench", 1: "Weak Armor", H: "Aftermath" }, heightm: 1.9, weightkg: 107.3, color: "Green", @@ -10222,8 +10222,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Garbodor", forme: "Gmax", types: ["Poison"], - baseStats: {hp: 80, atk: 95, def: 82, spa: 60, spd: 82, spe: 75}, - abilities: {0: "Stench", 1: "Weak Armor", H: "Aftermath"}, + baseStats: { hp: 80, atk: 95, def: 82, spa: 60, spd: 82, spe: 75 }, + abilities: { 0: "Stench", 1: "Weak Armor", H: "Aftermath" }, heightm: 21, weightkg: 0, color: "Green", @@ -10234,9 +10234,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 570, name: "Zorua", types: ["Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 40, atk: 65, def: 40, spa: 80, spd: 40, spe: 65}, - abilities: {0: "Illusion"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 40, atk: 65, def: 40, spa: 80, spd: 40, spe: 65 }, + abilities: { 0: "Illusion" }, heightm: 0.7, weightkg: 12.5, color: "Gray", @@ -10251,9 +10251,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Zorua", forme: "Hisui", types: ["Normal", "Ghost"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 35, atk: 60, def: 40, spa: 85, spd: 40, spe: 70}, - abilities: {0: "Illusion"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 35, atk: 60, def: 40, spa: 85, spd: 40, spe: 70 }, + abilities: { 0: "Illusion" }, heightm: 0.7, weightkg: 12.5, color: "Gray", @@ -10264,9 +10264,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 571, name: "Zoroark", types: ["Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 105, def: 60, spa: 120, spd: 60, spe: 105}, - abilities: {0: "Illusion"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 105, def: 60, spa: 120, spd: 60, spe: 105 }, + abilities: { 0: "Illusion" }, heightm: 1.6, weightkg: 81.1, color: "Gray", @@ -10282,9 +10282,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Zoroark", forme: "Hisui", types: ["Normal", "Ghost"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 100, def: 60, spa: 125, spd: 60, spe: 110}, - abilities: {0: "Illusion"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 100, def: 60, spa: 125, spd: 60, spe: 110 }, + abilities: { 0: "Illusion" }, heightm: 1.6, weightkg: 73, color: "Gray", @@ -10296,9 +10296,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 572, name: "Minccino", types: ["Normal"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 55, atk: 50, def: 40, spa: 40, spd: 40, spe: 75}, - abilities: {0: "Cute Charm", 1: "Technician", H: "Skill Link"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 55, atk: 50, def: 40, spa: 40, spd: 40, spe: 75 }, + abilities: { 0: "Cute Charm", 1: "Technician", H: "Skill Link" }, heightm: 0.4, weightkg: 5.8, color: "Gray", @@ -10309,9 +10309,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 573, name: "Cinccino", types: ["Normal"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 75, atk: 95, def: 60, spa: 65, spd: 60, spe: 115}, - abilities: {0: "Cute Charm", 1: "Technician", H: "Skill Link"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 75, atk: 95, def: 60, spa: 65, spd: 60, spe: 115 }, + abilities: { 0: "Cute Charm", 1: "Technician", H: "Skill Link" }, heightm: 0.5, weightkg: 7.5, color: "Gray", @@ -10324,9 +10324,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 574, name: "Gothita", types: ["Psychic"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 45, atk: 30, def: 50, spa: 55, spd: 65, spe: 45}, - abilities: {0: "Frisk", 1: "Competitive", H: "Shadow Tag"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 45, atk: 30, def: 50, spa: 55, spd: 65, spe: 45 }, + abilities: { 0: "Frisk", 1: "Competitive", H: "Shadow Tag" }, heightm: 0.4, weightkg: 5.8, color: "Purple", @@ -10337,9 +10337,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 575, name: "Gothorita", types: ["Psychic"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 60, atk: 45, def: 70, spa: 75, spd: 85, spe: 55}, - abilities: {0: "Frisk", 1: "Competitive", H: "Shadow Tag"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 60, atk: 45, def: 70, spa: 75, spd: 85, spe: 55 }, + abilities: { 0: "Frisk", 1: "Competitive", H: "Shadow Tag" }, heightm: 0.7, weightkg: 18, color: "Purple", @@ -10352,9 +10352,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 576, name: "Gothitelle", types: ["Psychic"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 70, atk: 55, def: 95, spa: 95, spd: 110, spe: 65}, - abilities: {0: "Frisk", 1: "Competitive", H: "Shadow Tag"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 70, atk: 55, def: 95, spa: 95, spd: 110, spe: 65 }, + abilities: { 0: "Frisk", 1: "Competitive", H: "Shadow Tag" }, heightm: 1.5, weightkg: 44, color: "Purple", @@ -10366,8 +10366,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 577, name: "Solosis", types: ["Psychic"], - baseStats: {hp: 45, atk: 30, def: 40, spa: 105, spd: 50, spe: 20}, - abilities: {0: "Overcoat", 1: "Magic Guard", H: "Regenerator"}, + baseStats: { hp: 45, atk: 30, def: 40, spa: 105, spd: 50, spe: 20 }, + abilities: { 0: "Overcoat", 1: "Magic Guard", H: "Regenerator" }, heightm: 0.3, weightkg: 1, color: "Green", @@ -10378,8 +10378,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 578, name: "Duosion", types: ["Psychic"], - baseStats: {hp: 65, atk: 40, def: 50, spa: 125, spd: 60, spe: 30}, - abilities: {0: "Overcoat", 1: "Magic Guard", H: "Regenerator"}, + baseStats: { hp: 65, atk: 40, def: 50, spa: 125, spd: 60, spe: 30 }, + abilities: { 0: "Overcoat", 1: "Magic Guard", H: "Regenerator" }, heightm: 0.6, weightkg: 8, color: "Green", @@ -10392,8 +10392,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 579, name: "Reuniclus", types: ["Psychic"], - baseStats: {hp: 110, atk: 65, def: 75, spa: 125, spd: 85, spe: 30}, - abilities: {0: "Overcoat", 1: "Magic Guard", H: "Regenerator"}, + baseStats: { hp: 110, atk: 65, def: 75, spa: 125, spd: 85, spe: 30 }, + abilities: { 0: "Overcoat", 1: "Magic Guard", H: "Regenerator" }, heightm: 1, weightkg: 20.1, color: "Green", @@ -10405,8 +10405,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 580, name: "Ducklett", types: ["Water", "Flying"], - baseStats: {hp: 62, atk: 44, def: 50, spa: 44, spd: 50, spe: 55}, - abilities: {0: "Keen Eye", 1: "Big Pecks", H: "Hydration"}, + baseStats: { hp: 62, atk: 44, def: 50, spa: 44, spd: 50, spe: 55 }, + abilities: { 0: "Keen Eye", 1: "Big Pecks", H: "Hydration" }, heightm: 0.5, weightkg: 5.5, color: "Blue", @@ -10417,8 +10417,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 581, name: "Swanna", types: ["Water", "Flying"], - baseStats: {hp: 75, atk: 87, def: 63, spa: 87, spd: 63, spe: 98}, - abilities: {0: "Keen Eye", 1: "Big Pecks", H: "Hydration"}, + baseStats: { hp: 75, atk: 87, def: 63, spa: 87, spd: 63, spe: 98 }, + abilities: { 0: "Keen Eye", 1: "Big Pecks", H: "Hydration" }, heightm: 1.3, weightkg: 24.2, color: "White", @@ -10430,8 +10430,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 582, name: "Vanillite", types: ["Ice"], - baseStats: {hp: 36, atk: 50, def: 50, spa: 65, spd: 60, spe: 44}, - abilities: {0: "Ice Body", 1: "Snow Cloak", H: "Weak Armor"}, + baseStats: { hp: 36, atk: 50, def: 50, spa: 65, spd: 60, spe: 44 }, + abilities: { 0: "Ice Body", 1: "Snow Cloak", H: "Weak Armor" }, heightm: 0.4, weightkg: 5.7, color: "White", @@ -10442,8 +10442,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 583, name: "Vanillish", types: ["Ice"], - baseStats: {hp: 51, atk: 65, def: 65, spa: 80, spd: 75, spe: 59}, - abilities: {0: "Ice Body", 1: "Snow Cloak", H: "Weak Armor"}, + baseStats: { hp: 51, atk: 65, def: 65, spa: 80, spd: 75, spe: 59 }, + abilities: { 0: "Ice Body", 1: "Snow Cloak", H: "Weak Armor" }, heightm: 1.1, weightkg: 41, color: "White", @@ -10456,8 +10456,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 584, name: "Vanilluxe", types: ["Ice"], - baseStats: {hp: 71, atk: 95, def: 85, spa: 110, spd: 95, spe: 79}, - abilities: {0: "Ice Body", 1: "Snow Warning", H: "Weak Armor"}, + baseStats: { hp: 71, atk: 95, def: 85, spa: 110, spd: 95, spe: 79 }, + abilities: { 0: "Ice Body", 1: "Snow Warning", H: "Weak Armor" }, heightm: 1.3, weightkg: 57.5, color: "White", @@ -10470,8 +10470,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Deerling", baseForme: "Spring", types: ["Normal", "Grass"], - baseStats: {hp: 60, atk: 60, def: 50, spa: 40, spd: 50, spe: 75}, - abilities: {0: "Chlorophyll", 1: "Sap Sipper", H: "Serene Grace"}, + baseStats: { hp: 60, atk: 60, def: 50, spa: 40, spd: 50, spe: 75 }, + abilities: { 0: "Chlorophyll", 1: "Sap Sipper", H: "Serene Grace" }, heightm: 0.6, weightkg: 19.5, color: "Pink", @@ -10485,8 +10485,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Sawsbuck", baseForme: "Spring", types: ["Normal", "Grass"], - baseStats: {hp: 80, atk: 100, def: 70, spa: 60, spd: 70, spe: 95}, - abilities: {0: "Chlorophyll", 1: "Sap Sipper", H: "Serene Grace"}, + baseStats: { hp: 80, atk: 100, def: 70, spa: 60, spd: 70, spe: 95 }, + abilities: { 0: "Chlorophyll", 1: "Sap Sipper", H: "Serene Grace" }, heightm: 1.9, weightkg: 92.5, color: "Brown", @@ -10500,8 +10500,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 587, name: "Emolga", types: ["Electric", "Flying"], - baseStats: {hp: 55, atk: 75, def: 60, spa: 75, spd: 60, spe: 103}, - abilities: {0: "Static", H: "Motor Drive"}, + baseStats: { hp: 55, atk: 75, def: 60, spa: 75, spd: 60, spe: 103 }, + abilities: { 0: "Static", H: "Motor Drive" }, heightm: 0.4, weightkg: 5, color: "White", @@ -10511,8 +10511,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 588, name: "Karrablast", types: ["Bug"], - baseStats: {hp: 50, atk: 75, def: 45, spa: 40, spd: 45, spe: 60}, - abilities: {0: "Swarm", 1: "Shed Skin", H: "No Guard"}, + baseStats: { hp: 50, atk: 75, def: 45, spa: 40, spd: 45, spe: 60 }, + abilities: { 0: "Swarm", 1: "Shed Skin", H: "No Guard" }, heightm: 0.5, weightkg: 5.9, color: "Blue", @@ -10523,8 +10523,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 589, name: "Escavalier", types: ["Bug", "Steel"], - baseStats: {hp: 70, atk: 135, def: 105, spa: 60, spd: 105, spe: 20}, - abilities: {0: "Swarm", 1: "Shell Armor", H: "Overcoat"}, + baseStats: { hp: 70, atk: 135, def: 105, spa: 60, spd: 105, spe: 20 }, + abilities: { 0: "Swarm", 1: "Shell Armor", H: "Overcoat" }, heightm: 1, weightkg: 33, color: "Gray", @@ -10537,8 +10537,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 590, name: "Foongus", types: ["Grass", "Poison"], - baseStats: {hp: 69, atk: 55, def: 45, spa: 55, spd: 55, spe: 15}, - abilities: {0: "Effect Spore", H: "Regenerator"}, + baseStats: { hp: 69, atk: 55, def: 45, spa: 55, spd: 55, spe: 15 }, + abilities: { 0: "Effect Spore", H: "Regenerator" }, heightm: 0.2, weightkg: 1, color: "White", @@ -10549,8 +10549,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 591, name: "Amoonguss", types: ["Grass", "Poison"], - baseStats: {hp: 114, atk: 85, def: 70, spa: 85, spd: 80, spe: 30}, - abilities: {0: "Effect Spore", H: "Regenerator"}, + baseStats: { hp: 114, atk: 85, def: 70, spa: 85, spd: 80, spe: 30 }, + abilities: { 0: "Effect Spore", H: "Regenerator" }, heightm: 0.6, weightkg: 10.5, color: "White", @@ -10562,8 +10562,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 592, name: "Frillish", types: ["Water", "Ghost"], - baseStats: {hp: 55, atk: 40, def: 50, spa: 65, spd: 85, spe: 40}, - abilities: {0: "Water Absorb", 1: "Cursed Body", H: "Damp"}, + baseStats: { hp: 55, atk: 40, def: 50, spa: 65, spd: 85, spe: 40 }, + abilities: { 0: "Water Absorb", 1: "Cursed Body", H: "Damp" }, heightm: 1.2, weightkg: 33, color: "White", @@ -10574,8 +10574,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 593, name: "Jellicent", types: ["Water", "Ghost"], - baseStats: {hp: 100, atk: 60, def: 70, spa: 85, spd: 105, spe: 60}, - abilities: {0: "Water Absorb", 1: "Cursed Body", H: "Damp"}, + baseStats: { hp: 100, atk: 60, def: 70, spa: 85, spd: 105, spe: 60 }, + abilities: { 0: "Water Absorb", 1: "Cursed Body", H: "Damp" }, heightm: 2.2, weightkg: 135, color: "White", @@ -10587,8 +10587,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 594, name: "Alomomola", types: ["Water"], - baseStats: {hp: 165, atk: 75, def: 80, spa: 40, spd: 45, spe: 65}, - abilities: {0: "Healer", 1: "Hydration", H: "Regenerator"}, + baseStats: { hp: 165, atk: 75, def: 80, spa: 40, spd: 45, spe: 65 }, + abilities: { 0: "Healer", 1: "Hydration", H: "Regenerator" }, heightm: 1.2, weightkg: 31.6, color: "Pink", @@ -10598,8 +10598,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 595, name: "Joltik", types: ["Bug", "Electric"], - baseStats: {hp: 50, atk: 47, def: 50, spa: 57, spd: 50, spe: 65}, - abilities: {0: "Compound Eyes", 1: "Unnerve", H: "Swarm"}, + baseStats: { hp: 50, atk: 47, def: 50, spa: 57, spd: 50, spe: 65 }, + abilities: { 0: "Compound Eyes", 1: "Unnerve", H: "Swarm" }, heightm: 0.1, weightkg: 0.6, color: "Yellow", @@ -10610,8 +10610,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 596, name: "Galvantula", types: ["Bug", "Electric"], - baseStats: {hp: 70, atk: 77, def: 60, spa: 97, spd: 60, spe: 108}, - abilities: {0: "Compound Eyes", 1: "Unnerve", H: "Swarm"}, + baseStats: { hp: 70, atk: 77, def: 60, spa: 97, spd: 60, spe: 108 }, + abilities: { 0: "Compound Eyes", 1: "Unnerve", H: "Swarm" }, heightm: 0.8, weightkg: 14.3, color: "Yellow", @@ -10623,8 +10623,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 597, name: "Ferroseed", types: ["Grass", "Steel"], - baseStats: {hp: 44, atk: 50, def: 91, spa: 24, spd: 86, spe: 10}, - abilities: {0: "Iron Barbs"}, + baseStats: { hp: 44, atk: 50, def: 91, spa: 24, spd: 86, spe: 10 }, + abilities: { 0: "Iron Barbs" }, heightm: 0.6, weightkg: 18.8, color: "Gray", @@ -10635,8 +10635,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 598, name: "Ferrothorn", types: ["Grass", "Steel"], - baseStats: {hp: 74, atk: 94, def: 131, spa: 54, spd: 116, spe: 20}, - abilities: {0: "Iron Barbs", H: "Anticipation"}, + baseStats: { hp: 74, atk: 94, def: 131, spa: 54, spd: 116, spe: 20 }, + abilities: { 0: "Iron Barbs", H: "Anticipation" }, heightm: 1, weightkg: 110, color: "Gray", @@ -10649,8 +10649,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Klink", types: ["Steel"], gender: "N", - baseStats: {hp: 40, atk: 55, def: 70, spa: 45, spd: 60, spe: 30}, - abilities: {0: "Plus", 1: "Minus", H: "Clear Body"}, + baseStats: { hp: 40, atk: 55, def: 70, spa: 45, spd: 60, spe: 30 }, + abilities: { 0: "Plus", 1: "Minus", H: "Clear Body" }, heightm: 0.3, weightkg: 21, color: "Gray", @@ -10662,8 +10662,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Klang", types: ["Steel"], gender: "N", - baseStats: {hp: 60, atk: 80, def: 95, spa: 70, spd: 85, spe: 50}, - abilities: {0: "Plus", 1: "Minus", H: "Clear Body"}, + baseStats: { hp: 60, atk: 80, def: 95, spa: 70, spd: 85, spe: 50 }, + abilities: { 0: "Plus", 1: "Minus", H: "Clear Body" }, heightm: 0.6, weightkg: 51, color: "Gray", @@ -10677,8 +10677,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Klinklang", types: ["Steel"], gender: "N", - baseStats: {hp: 60, atk: 100, def: 115, spa: 70, spd: 85, spe: 90}, - abilities: {0: "Plus", 1: "Minus", H: "Clear Body"}, + baseStats: { hp: 60, atk: 100, def: 115, spa: 70, spd: 85, spe: 90 }, + abilities: { 0: "Plus", 1: "Minus", H: "Clear Body" }, heightm: 0.6, weightkg: 81, color: "Gray", @@ -10690,8 +10690,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 602, name: "Tynamo", types: ["Electric"], - baseStats: {hp: 35, atk: 55, def: 40, spa: 45, spd: 40, spe: 60}, - abilities: {0: "Levitate"}, + baseStats: { hp: 35, atk: 55, def: 40, spa: 45, spd: 40, spe: 60 }, + abilities: { 0: "Levitate" }, heightm: 0.2, weightkg: 0.3, color: "White", @@ -10702,8 +10702,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 603, name: "Eelektrik", types: ["Electric"], - baseStats: {hp: 65, atk: 85, def: 70, spa: 75, spd: 70, spe: 40}, - abilities: {0: "Levitate"}, + baseStats: { hp: 65, atk: 85, def: 70, spa: 75, spd: 70, spe: 40 }, + abilities: { 0: "Levitate" }, heightm: 1.2, weightkg: 22, color: "Blue", @@ -10716,8 +10716,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 604, name: "Eelektross", types: ["Electric"], - baseStats: {hp: 85, atk: 115, def: 80, spa: 105, spd: 80, spe: 50}, - abilities: {0: "Levitate"}, + baseStats: { hp: 85, atk: 115, def: 80, spa: 105, spd: 80, spe: 50 }, + abilities: { 0: "Levitate" }, heightm: 2.1, weightkg: 80.5, color: "Blue", @@ -10730,8 +10730,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 605, name: "Elgyem", types: ["Psychic"], - baseStats: {hp: 55, atk: 55, def: 55, spa: 85, spd: 55, spe: 30}, - abilities: {0: "Telepathy", 1: "Synchronize", H: "Analytic"}, + baseStats: { hp: 55, atk: 55, def: 55, spa: 85, spd: 55, spe: 30 }, + abilities: { 0: "Telepathy", 1: "Synchronize", H: "Analytic" }, heightm: 0.5, weightkg: 9, color: "Blue", @@ -10742,8 +10742,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 606, name: "Beheeyem", types: ["Psychic"], - baseStats: {hp: 75, atk: 75, def: 75, spa: 125, spd: 95, spe: 40}, - abilities: {0: "Telepathy", 1: "Synchronize", H: "Analytic"}, + baseStats: { hp: 75, atk: 75, def: 75, spa: 125, spd: 95, spe: 40 }, + abilities: { 0: "Telepathy", 1: "Synchronize", H: "Analytic" }, heightm: 1, weightkg: 34.5, color: "Brown", @@ -10755,8 +10755,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 607, name: "Litwick", types: ["Ghost", "Fire"], - baseStats: {hp: 50, atk: 30, def: 55, spa: 65, spd: 55, spe: 20}, - abilities: {0: "Flash Fire", 1: "Flame Body", H: "Infiltrator"}, + baseStats: { hp: 50, atk: 30, def: 55, spa: 65, spd: 55, spe: 20 }, + abilities: { 0: "Flash Fire", 1: "Flame Body", H: "Infiltrator" }, heightm: 0.3, weightkg: 3.1, color: "White", @@ -10767,8 +10767,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 608, name: "Lampent", types: ["Ghost", "Fire"], - baseStats: {hp: 60, atk: 40, def: 60, spa: 95, spd: 60, spe: 55}, - abilities: {0: "Flash Fire", 1: "Flame Body", H: "Infiltrator"}, + baseStats: { hp: 60, atk: 40, def: 60, spa: 95, spd: 60, spe: 55 }, + abilities: { 0: "Flash Fire", 1: "Flame Body", H: "Infiltrator" }, heightm: 0.6, weightkg: 13, color: "Black", @@ -10781,8 +10781,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 609, name: "Chandelure", types: ["Ghost", "Fire"], - baseStats: {hp: 60, atk: 55, def: 90, spa: 145, spd: 90, spe: 80}, - abilities: {0: "Flash Fire", 1: "Flame Body", H: "Infiltrator"}, + baseStats: { hp: 60, atk: 55, def: 90, spa: 145, spd: 90, spe: 80 }, + abilities: { 0: "Flash Fire", 1: "Flame Body", H: "Infiltrator" }, heightm: 1, weightkg: 34.3, color: "Black", @@ -10795,8 +10795,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 610, name: "Axew", types: ["Dragon"], - baseStats: {hp: 46, atk: 87, def: 60, spa: 30, spd: 40, spe: 57}, - abilities: {0: "Rivalry", 1: "Mold Breaker", H: "Unnerve"}, + baseStats: { hp: 46, atk: 87, def: 60, spa: 30, spd: 40, spe: 57 }, + abilities: { 0: "Rivalry", 1: "Mold Breaker", H: "Unnerve" }, heightm: 0.6, weightkg: 18, color: "Green", @@ -10807,8 +10807,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 611, name: "Fraxure", types: ["Dragon"], - baseStats: {hp: 66, atk: 117, def: 70, spa: 40, spd: 50, spe: 67}, - abilities: {0: "Rivalry", 1: "Mold Breaker", H: "Unnerve"}, + baseStats: { hp: 66, atk: 117, def: 70, spa: 40, spd: 50, spe: 67 }, + abilities: { 0: "Rivalry", 1: "Mold Breaker", H: "Unnerve" }, heightm: 1, weightkg: 36, color: "Green", @@ -10821,8 +10821,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 612, name: "Haxorus", types: ["Dragon"], - baseStats: {hp: 76, atk: 147, def: 90, spa: 60, spd: 70, spe: 97}, - abilities: {0: "Rivalry", 1: "Mold Breaker", H: "Unnerve"}, + baseStats: { hp: 76, atk: 147, def: 90, spa: 60, spd: 70, spe: 97 }, + abilities: { 0: "Rivalry", 1: "Mold Breaker", H: "Unnerve" }, heightm: 1.8, weightkg: 105.5, color: "Yellow", @@ -10834,8 +10834,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 613, name: "Cubchoo", types: ["Ice"], - baseStats: {hp: 55, atk: 70, def: 40, spa: 60, spd: 40, spe: 40}, - abilities: {0: "Snow Cloak", 1: "Slush Rush", H: "Rattled"}, + baseStats: { hp: 55, atk: 70, def: 40, spa: 60, spd: 40, spe: 40 }, + abilities: { 0: "Snow Cloak", 1: "Slush Rush", H: "Rattled" }, heightm: 0.5, weightkg: 8.5, color: "White", @@ -10846,8 +10846,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 614, name: "Beartic", types: ["Ice"], - baseStats: {hp: 95, atk: 130, def: 80, spa: 70, spd: 80, spe: 50}, - abilities: {0: "Snow Cloak", 1: "Slush Rush", H: "Swift Swim"}, + baseStats: { hp: 95, atk: 130, def: 80, spa: 70, spd: 80, spe: 50 }, + abilities: { 0: "Snow Cloak", 1: "Slush Rush", H: "Swift Swim" }, heightm: 2.6, weightkg: 260, color: "White", @@ -10860,8 +10860,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Cryogonal", types: ["Ice"], gender: "N", - baseStats: {hp: 80, atk: 50, def: 50, spa: 95, spd: 135, spe: 105}, - abilities: {0: "Levitate"}, + baseStats: { hp: 80, atk: 50, def: 50, spa: 95, spd: 135, spe: 105 }, + abilities: { 0: "Levitate" }, heightm: 1.1, weightkg: 148, color: "Blue", @@ -10871,8 +10871,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 616, name: "Shelmet", types: ["Bug"], - baseStats: {hp: 50, atk: 40, def: 85, spa: 40, spd: 65, spe: 25}, - abilities: {0: "Hydration", 1: "Shell Armor", H: "Overcoat"}, + baseStats: { hp: 50, atk: 40, def: 85, spa: 40, spd: 65, spe: 25 }, + abilities: { 0: "Hydration", 1: "Shell Armor", H: "Overcoat" }, heightm: 0.4, weightkg: 7.7, color: "Red", @@ -10883,8 +10883,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 617, name: "Accelgor", types: ["Bug"], - baseStats: {hp: 80, atk: 70, def: 40, spa: 100, spd: 60, spe: 145}, - abilities: {0: "Hydration", 1: "Sticky Hold", H: "Unburden"}, + baseStats: { hp: 80, atk: 70, def: 40, spa: 100, spd: 60, spe: 145 }, + abilities: { 0: "Hydration", 1: "Sticky Hold", H: "Unburden" }, heightm: 0.8, weightkg: 25.3, color: "Red", @@ -10897,8 +10897,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 618, name: "Stunfisk", types: ["Ground", "Electric"], - baseStats: {hp: 109, atk: 66, def: 84, spa: 81, spd: 99, spe: 32}, - abilities: {0: "Static", 1: "Limber", H: "Sand Veil"}, + baseStats: { hp: 109, atk: 66, def: 84, spa: 81, spd: 99, spe: 32 }, + abilities: { 0: "Static", 1: "Limber", H: "Sand Veil" }, heightm: 0.7, weightkg: 11, color: "Brown", @@ -10912,8 +10912,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Stunfisk", forme: "Galar", types: ["Ground", "Steel"], - baseStats: {hp: 109, atk: 81, def: 99, spa: 66, spd: 84, spe: 32}, - abilities: {0: "Mimicry"}, + baseStats: { hp: 109, atk: 81, def: 99, spa: 66, spd: 84, spe: 32 }, + abilities: { 0: "Mimicry" }, heightm: 0.7, weightkg: 20.5, color: "Green", @@ -10923,8 +10923,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 619, name: "Mienfoo", types: ["Fighting"], - baseStats: {hp: 45, atk: 85, def: 50, spa: 55, spd: 50, spe: 65}, - abilities: {0: "Inner Focus", 1: "Regenerator", H: "Reckless"}, + baseStats: { hp: 45, atk: 85, def: 50, spa: 55, spd: 50, spe: 65 }, + abilities: { 0: "Inner Focus", 1: "Regenerator", H: "Reckless" }, heightm: 0.9, weightkg: 20, color: "Yellow", @@ -10935,8 +10935,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 620, name: "Mienshao", types: ["Fighting"], - baseStats: {hp: 65, atk: 125, def: 60, spa: 95, spd: 60, spe: 105}, - abilities: {0: "Inner Focus", 1: "Regenerator", H: "Reckless"}, + baseStats: { hp: 65, atk: 125, def: 60, spa: 95, spd: 60, spe: 105 }, + abilities: { 0: "Inner Focus", 1: "Regenerator", H: "Reckless" }, heightm: 1.4, weightkg: 35.5, color: "Purple", @@ -10948,8 +10948,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 621, name: "Druddigon", types: ["Dragon"], - baseStats: {hp: 77, atk: 120, def: 90, spa: 60, spd: 90, spe: 48}, - abilities: {0: "Rough Skin", 1: "Sheer Force", H: "Mold Breaker"}, + baseStats: { hp: 77, atk: 120, def: 90, spa: 60, spd: 90, spe: 48 }, + abilities: { 0: "Rough Skin", 1: "Sheer Force", H: "Mold Breaker" }, heightm: 1.6, weightkg: 139, color: "Red", @@ -10960,8 +10960,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Golett", types: ["Ground", "Ghost"], gender: "N", - baseStats: {hp: 59, atk: 74, def: 50, spa: 35, spd: 50, spe: 35}, - abilities: {0: "Iron Fist", 1: "Klutz", H: "No Guard"}, + baseStats: { hp: 59, atk: 74, def: 50, spa: 35, spd: 50, spe: 35 }, + abilities: { 0: "Iron Fist", 1: "Klutz", H: "No Guard" }, heightm: 1, weightkg: 92, color: "Green", @@ -10973,8 +10973,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Golurk", types: ["Ground", "Ghost"], gender: "N", - baseStats: {hp: 89, atk: 124, def: 80, spa: 55, spd: 80, spe: 55}, - abilities: {0: "Iron Fist", 1: "Klutz", H: "No Guard"}, + baseStats: { hp: 89, atk: 124, def: 80, spa: 55, spd: 80, spe: 55 }, + abilities: { 0: "Iron Fist", 1: "Klutz", H: "No Guard" }, heightm: 2.8, weightkg: 330, color: "Green", @@ -10986,8 +10986,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 624, name: "Pawniard", types: ["Dark", "Steel"], - baseStats: {hp: 45, atk: 85, def: 70, spa: 40, spd: 40, spe: 60}, - abilities: {0: "Defiant", 1: "Inner Focus", H: "Pressure"}, + baseStats: { hp: 45, atk: 85, def: 70, spa: 40, spd: 40, spe: 60 }, + abilities: { 0: "Defiant", 1: "Inner Focus", H: "Pressure" }, heightm: 0.5, weightkg: 10.2, color: "Red", @@ -10998,8 +10998,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 625, name: "Bisharp", types: ["Dark", "Steel"], - baseStats: {hp: 65, atk: 125, def: 100, spa: 60, spd: 70, spe: 70}, - abilities: {0: "Defiant", 1: "Inner Focus", H: "Pressure"}, + baseStats: { hp: 65, atk: 125, def: 100, spa: 60, spd: 70, spe: 70 }, + abilities: { 0: "Defiant", 1: "Inner Focus", H: "Pressure" }, heightm: 1.6, weightkg: 70, color: "Red", @@ -11012,8 +11012,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 626, name: "Bouffalant", types: ["Normal"], - baseStats: {hp: 95, atk: 110, def: 95, spa: 40, spd: 95, spe: 55}, - abilities: {0: "Reckless", 1: "Sap Sipper", H: "Soundproof"}, + baseStats: { hp: 95, atk: 110, def: 95, spa: 40, spd: 95, spe: 55 }, + abilities: { 0: "Reckless", 1: "Sap Sipper", H: "Soundproof" }, heightm: 1.6, weightkg: 94.6, color: "Brown", @@ -11024,8 +11024,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Rufflet", types: ["Normal", "Flying"], gender: "M", - baseStats: {hp: 70, atk: 83, def: 50, spa: 37, spd: 50, spe: 60}, - abilities: {0: "Keen Eye", 1: "Sheer Force", H: "Hustle"}, + baseStats: { hp: 70, atk: 83, def: 50, spa: 37, spd: 50, spe: 60 }, + abilities: { 0: "Keen Eye", 1: "Sheer Force", H: "Hustle" }, heightm: 0.5, weightkg: 10.5, color: "White", @@ -11037,8 +11037,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Braviary", types: ["Normal", "Flying"], gender: "M", - baseStats: {hp: 100, atk: 123, def: 75, spa: 57, spd: 75, spe: 80}, - abilities: {0: "Keen Eye", 1: "Sheer Force", H: "Defiant"}, + baseStats: { hp: 100, atk: 123, def: 75, spa: 57, spd: 75, spe: 80 }, + abilities: { 0: "Keen Eye", 1: "Sheer Force", H: "Defiant" }, heightm: 1.5, weightkg: 41, color: "Red", @@ -11055,8 +11055,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Hisui", types: ["Psychic", "Flying"], gender: "M", - baseStats: {hp: 110, atk: 83, def: 70, spa: 112, spd: 70, spe: 65}, - abilities: {0: "Keen Eye", 1: "Sheer Force", H: "Tinted Lens"}, + baseStats: { hp: 110, atk: 83, def: 70, spa: 112, spd: 70, spe: 65 }, + abilities: { 0: "Keen Eye", 1: "Sheer Force", H: "Tinted Lens" }, heightm: 1.7, weightkg: 43.4, color: "White", @@ -11069,8 +11069,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Vullaby", types: ["Dark", "Flying"], gender: "F", - baseStats: {hp: 70, atk: 55, def: 75, spa: 45, spd: 65, spe: 60}, - abilities: {0: "Big Pecks", 1: "Overcoat", H: "Weak Armor"}, + baseStats: { hp: 70, atk: 55, def: 75, spa: 45, spd: 65, spe: 60 }, + abilities: { 0: "Big Pecks", 1: "Overcoat", H: "Weak Armor" }, heightm: 0.5, weightkg: 9, color: "Brown", @@ -11082,8 +11082,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Mandibuzz", types: ["Dark", "Flying"], gender: "F", - baseStats: {hp: 110, atk: 65, def: 105, spa: 55, spd: 95, spe: 80}, - abilities: {0: "Big Pecks", 1: "Overcoat", H: "Weak Armor"}, + baseStats: { hp: 110, atk: 65, def: 105, spa: 55, spd: 95, spe: 80 }, + abilities: { 0: "Big Pecks", 1: "Overcoat", H: "Weak Armor" }, heightm: 1.2, weightkg: 39.5, color: "Brown", @@ -11095,8 +11095,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 631, name: "Heatmor", types: ["Fire"], - baseStats: {hp: 85, atk: 97, def: 66, spa: 105, spd: 66, spe: 65}, - abilities: {0: "Gluttony", 1: "Flash Fire", H: "White Smoke"}, + baseStats: { hp: 85, atk: 97, def: 66, spa: 105, spd: 66, spe: 65 }, + abilities: { 0: "Gluttony", 1: "Flash Fire", H: "White Smoke" }, heightm: 1.4, weightkg: 58, color: "Red", @@ -11106,8 +11106,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 632, name: "Durant", types: ["Bug", "Steel"], - baseStats: {hp: 58, atk: 109, def: 112, spa: 48, spd: 48, spe: 109}, - abilities: {0: "Swarm", 1: "Hustle", H: "Truant"}, + baseStats: { hp: 58, atk: 109, def: 112, spa: 48, spd: 48, spe: 109 }, + abilities: { 0: "Swarm", 1: "Hustle", H: "Truant" }, heightm: 0.3, weightkg: 33, color: "Gray", @@ -11117,8 +11117,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 633, name: "Deino", types: ["Dark", "Dragon"], - baseStats: {hp: 52, atk: 65, def: 50, spa: 45, spd: 50, spe: 38}, - abilities: {0: "Hustle"}, + baseStats: { hp: 52, atk: 65, def: 50, spa: 45, spd: 50, spe: 38 }, + abilities: { 0: "Hustle" }, heightm: 0.8, weightkg: 17.3, color: "Blue", @@ -11129,8 +11129,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 634, name: "Zweilous", types: ["Dark", "Dragon"], - baseStats: {hp: 72, atk: 85, def: 70, spa: 65, spd: 70, spe: 58}, - abilities: {0: "Hustle"}, + baseStats: { hp: 72, atk: 85, def: 70, spa: 65, spd: 70, spe: 58 }, + abilities: { 0: "Hustle" }, heightm: 1.4, weightkg: 50, color: "Blue", @@ -11143,8 +11143,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 635, name: "Hydreigon", types: ["Dark", "Dragon"], - baseStats: {hp: 92, atk: 105, def: 90, spa: 125, spd: 90, spe: 98}, - abilities: {0: "Levitate"}, + baseStats: { hp: 92, atk: 105, def: 90, spa: 125, spd: 90, spe: 98 }, + abilities: { 0: "Levitate" }, heightm: 1.8, weightkg: 160, color: "Blue", @@ -11156,8 +11156,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 636, name: "Larvesta", types: ["Bug", "Fire"], - baseStats: {hp: 55, atk: 85, def: 55, spa: 50, spd: 55, spe: 60}, - abilities: {0: "Flame Body", H: "Swarm"}, + baseStats: { hp: 55, atk: 85, def: 55, spa: 50, spd: 55, spe: 60 }, + abilities: { 0: "Flame Body", H: "Swarm" }, heightm: 1.1, weightkg: 28.8, color: "White", @@ -11168,8 +11168,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 637, name: "Volcarona", types: ["Bug", "Fire"], - baseStats: {hp: 85, atk: 60, def: 65, spa: 135, spd: 105, spe: 100}, - abilities: {0: "Flame Body", H: "Swarm"}, + baseStats: { hp: 85, atk: 60, def: 65, spa: 135, spd: 105, spe: 100 }, + abilities: { 0: "Flame Body", H: "Swarm" }, heightm: 1.6, weightkg: 46, color: "White", @@ -11182,8 +11182,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Cobalion", types: ["Steel", "Fighting"], gender: "N", - baseStats: {hp: 91, atk: 90, def: 129, spa: 90, spd: 72, spe: 108}, - abilities: {0: "Justified"}, + baseStats: { hp: 91, atk: 90, def: 129, spa: 90, spd: 72, spe: 108 }, + abilities: { 0: "Justified" }, heightm: 2.1, weightkg: 250, color: "Blue", @@ -11195,8 +11195,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Terrakion", types: ["Rock", "Fighting"], gender: "N", - baseStats: {hp: 91, atk: 129, def: 90, spa: 72, spd: 90, spe: 108}, - abilities: {0: "Justified"}, + baseStats: { hp: 91, atk: 129, def: 90, spa: 72, spd: 90, spe: 108 }, + abilities: { 0: "Justified" }, heightm: 1.9, weightkg: 260, color: "Gray", @@ -11208,8 +11208,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Virizion", types: ["Grass", "Fighting"], gender: "N", - baseStats: {hp: 91, atk: 90, def: 72, spa: 90, spd: 129, spe: 108}, - abilities: {0: "Justified"}, + baseStats: { hp: 91, atk: 90, def: 72, spa: 90, spd: 129, spe: 108 }, + abilities: { 0: "Justified" }, heightm: 2, weightkg: 200, color: "Green", @@ -11222,8 +11222,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Incarnate", types: ["Flying"], gender: "M", - baseStats: {hp: 79, atk: 115, def: 70, spa: 125, spd: 80, spe: 111}, - abilities: {0: "Prankster", H: "Defiant"}, + baseStats: { hp: 79, atk: 115, def: 70, spa: 125, spd: 80, spe: 111 }, + abilities: { 0: "Prankster", H: "Defiant" }, heightm: 1.5, weightkg: 63, color: "Green", @@ -11239,8 +11239,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Therian", types: ["Flying"], gender: "M", - baseStats: {hp: 79, atk: 100, def: 80, spa: 110, spd: 90, spe: 121}, - abilities: {0: "Regenerator"}, + baseStats: { hp: 79, atk: 100, def: 80, spa: 110, spd: 90, spe: 121 }, + abilities: { 0: "Regenerator" }, heightm: 1.4, weightkg: 63, color: "Green", @@ -11253,8 +11253,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Incarnate", types: ["Electric", "Flying"], gender: "M", - baseStats: {hp: 79, atk: 115, def: 70, spa: 125, spd: 80, spe: 111}, - abilities: {0: "Prankster", H: "Defiant"}, + baseStats: { hp: 79, atk: 115, def: 70, spa: 125, spd: 80, spe: 111 }, + abilities: { 0: "Prankster", H: "Defiant" }, heightm: 1.5, weightkg: 61, color: "Blue", @@ -11270,8 +11270,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Therian", types: ["Electric", "Flying"], gender: "M", - baseStats: {hp: 79, atk: 105, def: 70, spa: 145, spd: 80, spe: 101}, - abilities: {0: "Volt Absorb"}, + baseStats: { hp: 79, atk: 105, def: 70, spa: 145, spd: 80, spe: 101 }, + abilities: { 0: "Volt Absorb" }, heightm: 3, weightkg: 61, color: "Blue", @@ -11283,8 +11283,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Reshiram", types: ["Dragon", "Fire"], gender: "N", - baseStats: {hp: 100, atk: 120, def: 100, spa: 150, spd: 120, spe: 90}, - abilities: {0: "Turboblaze"}, + baseStats: { hp: 100, atk: 120, def: 100, spa: 150, spd: 120, spe: 90 }, + abilities: { 0: "Turboblaze" }, heightm: 3.2, weightkg: 330, color: "White", @@ -11296,8 +11296,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Zekrom", types: ["Dragon", "Electric"], gender: "N", - baseStats: {hp: 100, atk: 150, def: 120, spa: 120, spd: 100, spe: 90}, - abilities: {0: "Teravolt"}, + baseStats: { hp: 100, atk: 150, def: 120, spa: 120, spd: 100, spe: 90 }, + abilities: { 0: "Teravolt" }, heightm: 2.9, weightkg: 345, color: "Black", @@ -11310,8 +11310,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Incarnate", types: ["Ground", "Flying"], gender: "M", - baseStats: {hp: 89, atk: 125, def: 90, spa: 115, spd: 80, spe: 101}, - abilities: {0: "Sand Force", H: "Sheer Force"}, + baseStats: { hp: 89, atk: 125, def: 90, spa: 115, spd: 80, spe: 101 }, + abilities: { 0: "Sand Force", H: "Sheer Force" }, heightm: 1.5, weightkg: 68, color: "Brown", @@ -11327,8 +11327,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Therian", types: ["Ground", "Flying"], gender: "M", - baseStats: {hp: 89, atk: 145, def: 90, spa: 105, spd: 80, spe: 91}, - abilities: {0: "Intimidate"}, + baseStats: { hp: 89, atk: 145, def: 90, spa: 105, spd: 80, spe: 91 }, + abilities: { 0: "Intimidate" }, heightm: 1.3, weightkg: 68, color: "Brown", @@ -11340,8 +11340,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Kyurem", types: ["Dragon", "Ice"], gender: "N", - baseStats: {hp: 125, atk: 130, def: 90, spa: 130, spd: 90, spe: 95}, - abilities: {0: "Pressure"}, + baseStats: { hp: 125, atk: 130, def: 90, spa: 130, spd: 90, spe: 95 }, + abilities: { 0: "Pressure" }, heightm: 3, weightkg: 325, color: "Gray", @@ -11357,8 +11357,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Black", types: ["Dragon", "Ice"], gender: "N", - baseStats: {hp: 125, atk: 170, def: 100, spa: 120, spd: 90, spe: 95}, - abilities: {0: "Teravolt"}, + baseStats: { hp: 125, atk: 170, def: 100, spa: 120, spd: 90, spe: 95 }, + abilities: { 0: "Teravolt" }, heightm: 3.3, weightkg: 325, color: "Gray", @@ -11372,8 +11372,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "White", types: ["Dragon", "Ice"], gender: "N", - baseStats: {hp: 125, atk: 120, def: 90, spa: 170, spd: 100, spe: 95}, - abilities: {0: "Turboblaze"}, + baseStats: { hp: 125, atk: 120, def: 90, spa: 170, spd: 100, spe: 95 }, + abilities: { 0: "Turboblaze" }, heightm: 3.6, weightkg: 325, color: "Gray", @@ -11386,8 +11386,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Ordinary", types: ["Water", "Fighting"], gender: "N", - baseStats: {hp: 91, atk: 72, def: 90, spa: 129, spd: 90, spe: 108}, - abilities: {0: "Justified"}, + baseStats: { hp: 91, atk: 72, def: 90, spa: 129, spd: 90, spe: 108 }, + abilities: { 0: "Justified" }, heightm: 1.4, weightkg: 48.5, color: "Yellow", @@ -11403,8 +11403,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Resolute", types: ["Water", "Fighting"], gender: "N", - baseStats: {hp: 91, atk: 72, def: 90, spa: 129, spd: 90, spe: 108}, - abilities: {0: "Justified"}, + baseStats: { hp: 91, atk: 72, def: 90, spa: 129, spd: 90, spe: 108 }, + abilities: { 0: "Justified" }, heightm: 1.4, weightkg: 48.5, color: "Yellow", @@ -11418,8 +11418,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Aria", types: ["Normal", "Psychic"], gender: "N", - baseStats: {hp: 100, atk: 77, def: 77, spa: 128, spd: 128, spe: 90}, - abilities: {0: "Serene Grace"}, + baseStats: { hp: 100, atk: 77, def: 77, spa: 128, spd: 128, spe: 90 }, + abilities: { 0: "Serene Grace" }, heightm: 0.6, weightkg: 6.5, color: "White", @@ -11435,8 +11435,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Pirouette", types: ["Normal", "Fighting"], gender: "N", - baseStats: {hp: 100, atk: 128, def: 90, spa: 77, spd: 77, spe: 128}, - abilities: {0: "Serene Grace"}, + baseStats: { hp: 100, atk: 128, def: 90, spa: 77, spd: 77, spe: 128 }, + abilities: { 0: "Serene Grace" }, heightm: 0.6, weightkg: 6.5, color: "White", @@ -11449,8 +11449,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Genesect", types: ["Bug", "Steel"], gender: "N", - baseStats: {hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99}, - abilities: {0: "Download"}, + baseStats: { hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99 }, + abilities: { 0: "Download" }, heightm: 1.5, weightkg: 82.5, color: "Purple", @@ -11466,8 +11466,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Douse", types: ["Bug", "Steel"], gender: "N", - baseStats: {hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99}, - abilities: {0: "Download"}, + baseStats: { hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99 }, + abilities: { 0: "Download" }, heightm: 1.5, weightkg: 82.5, color: "Purple", @@ -11482,8 +11482,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Shock", types: ["Bug", "Steel"], gender: "N", - baseStats: {hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99}, - abilities: {0: "Download"}, + baseStats: { hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99 }, + abilities: { 0: "Download" }, heightm: 1.5, weightkg: 82.5, color: "Purple", @@ -11498,8 +11498,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Burn", types: ["Bug", "Steel"], gender: "N", - baseStats: {hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99}, - abilities: {0: "Download"}, + baseStats: { hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99 }, + abilities: { 0: "Download" }, heightm: 1.5, weightkg: 82.5, color: "Purple", @@ -11514,8 +11514,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Chill", types: ["Bug", "Steel"], gender: "N", - baseStats: {hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99}, - abilities: {0: "Download"}, + baseStats: { hp: 71, atk: 120, def: 95, spa: 120, spd: 95, spe: 99 }, + abilities: { 0: "Download" }, heightm: 1.5, weightkg: 82.5, color: "Purple", @@ -11527,9 +11527,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 650, name: "Chespin", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 56, atk: 61, def: 65, spa: 48, spd: 45, spe: 38}, - abilities: {0: "Overgrow", H: "Bulletproof"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 56, atk: 61, def: 65, spa: 48, spd: 45, spe: 38 }, + abilities: { 0: "Overgrow", H: "Bulletproof" }, heightm: 0.4, weightkg: 9, color: "Green", @@ -11540,9 +11540,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 651, name: "Quilladin", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 61, atk: 78, def: 95, spa: 56, spd: 58, spe: 57}, - abilities: {0: "Overgrow", H: "Bulletproof"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 61, atk: 78, def: 95, spa: 56, spd: 58, spe: 57 }, + abilities: { 0: "Overgrow", H: "Bulletproof" }, heightm: 0.7, weightkg: 29, color: "Green", @@ -11555,9 +11555,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 652, name: "Chesnaught", types: ["Grass", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 88, atk: 107, def: 122, spa: 74, spd: 75, spe: 64}, - abilities: {0: "Overgrow", H: "Bulletproof"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 88, atk: 107, def: 122, spa: 74, spd: 75, spe: 64 }, + abilities: { 0: "Overgrow", H: "Bulletproof" }, heightm: 1.6, weightkg: 90, color: "Green", @@ -11569,9 +11569,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 653, name: "Fennekin", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 40, atk: 45, def: 40, spa: 62, spd: 60, spe: 60}, - abilities: {0: "Blaze", H: "Magician"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 40, atk: 45, def: 40, spa: 62, spd: 60, spe: 60 }, + abilities: { 0: "Blaze", H: "Magician" }, heightm: 0.4, weightkg: 9.4, color: "Red", @@ -11582,9 +11582,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 654, name: "Braixen", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 59, atk: 59, def: 58, spa: 90, spd: 70, spe: 73}, - abilities: {0: "Blaze", H: "Magician"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 59, atk: 59, def: 58, spa: 90, spd: 70, spe: 73 }, + abilities: { 0: "Blaze", H: "Magician" }, heightm: 1, weightkg: 14.5, color: "Red", @@ -11597,9 +11597,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 655, name: "Delphox", types: ["Fire", "Psychic"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 75, atk: 69, def: 72, spa: 114, spd: 100, spe: 104}, - abilities: {0: "Blaze", H: "Magician"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 75, atk: 69, def: 72, spa: 114, spd: 100, spe: 104 }, + abilities: { 0: "Blaze", H: "Magician" }, heightm: 1.5, weightkg: 39, color: "Red", @@ -11611,9 +11611,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 656, name: "Froakie", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 41, atk: 56, def: 40, spa: 62, spd: 44, spe: 71}, - abilities: {0: "Torrent", H: "Protean"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 41, atk: 56, def: 40, spa: 62, spd: 44, spe: 71 }, + abilities: { 0: "Torrent", H: "Protean" }, heightm: 0.3, weightkg: 7, color: "Blue", @@ -11624,9 +11624,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 657, name: "Frogadier", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 54, atk: 63, def: 52, spa: 83, spd: 56, spe: 97}, - abilities: {0: "Torrent", H: "Protean"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 54, atk: 63, def: 52, spa: 83, spd: 56, spe: 97 }, + abilities: { 0: "Torrent", H: "Protean" }, heightm: 0.6, weightkg: 10.9, color: "Blue", @@ -11639,9 +11639,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 658, name: "Greninja", types: ["Water", "Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 72, atk: 95, def: 67, spa: 103, spd: 71, spe: 122}, - abilities: {0: "Torrent", H: "Protean", S: "Battle Bond"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 72, atk: 95, def: 67, spa: 103, spd: 71, spe: 122 }, + abilities: { 0: "Torrent", H: "Protean", S: "Battle Bond" }, heightm: 1.5, weightkg: 40, color: "Blue", @@ -11658,8 +11658,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Bond", types: ["Water", "Dark"], gender: "M", - baseStats: {hp: 72, atk: 95, def: 67, spa: 103, spd: 71, spe: 122}, - abilities: {0: "Battle Bond"}, + baseStats: { hp: 72, atk: 95, def: 67, spa: 103, spd: 71, spe: 122 }, + abilities: { 0: "Battle Bond" }, heightm: 1.5, weightkg: 40, color: "Blue", @@ -11673,8 +11673,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ash", types: ["Water", "Dark"], gender: "M", - baseStats: {hp: 72, atk: 145, def: 67, spa: 153, spd: 71, spe: 132}, - abilities: {0: "Battle Bond"}, + baseStats: { hp: 72, atk: 145, def: 67, spa: 153, spd: 71, spe: 132 }, + abilities: { 0: "Battle Bond" }, heightm: 1.5, weightkg: 40, color: "Blue", @@ -11687,8 +11687,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 659, name: "Bunnelby", types: ["Normal"], - baseStats: {hp: 38, atk: 36, def: 38, spa: 32, spd: 36, spe: 57}, - abilities: {0: "Pickup", 1: "Cheek Pouch", H: "Huge Power"}, + baseStats: { hp: 38, atk: 36, def: 38, spa: 32, spd: 36, spe: 57 }, + abilities: { 0: "Pickup", 1: "Cheek Pouch", H: "Huge Power" }, heightm: 0.4, weightkg: 5, color: "Brown", @@ -11699,8 +11699,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 660, name: "Diggersby", types: ["Normal", "Ground"], - baseStats: {hp: 85, atk: 56, def: 77, spa: 50, spd: 77, spe: 78}, - abilities: {0: "Pickup", 1: "Cheek Pouch", H: "Huge Power"}, + baseStats: { hp: 85, atk: 56, def: 77, spa: 50, spd: 77, spe: 78 }, + abilities: { 0: "Pickup", 1: "Cheek Pouch", H: "Huge Power" }, heightm: 1, weightkg: 42.4, color: "Brown", @@ -11712,8 +11712,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 661, name: "Fletchling", types: ["Normal", "Flying"], - baseStats: {hp: 45, atk: 50, def: 43, spa: 40, spd: 38, spe: 62}, - abilities: {0: "Big Pecks", H: "Gale Wings"}, + baseStats: { hp: 45, atk: 50, def: 43, spa: 40, spd: 38, spe: 62 }, + abilities: { 0: "Big Pecks", H: "Gale Wings" }, heightm: 0.3, weightkg: 1.7, color: "Red", @@ -11724,8 +11724,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 662, name: "Fletchinder", types: ["Fire", "Flying"], - baseStats: {hp: 62, atk: 73, def: 55, spa: 56, spd: 52, spe: 84}, - abilities: {0: "Flame Body", H: "Gale Wings"}, + baseStats: { hp: 62, atk: 73, def: 55, spa: 56, spd: 52, spe: 84 }, + abilities: { 0: "Flame Body", H: "Gale Wings" }, heightm: 0.7, weightkg: 16, color: "Red", @@ -11738,8 +11738,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 663, name: "Talonflame", types: ["Fire", "Flying"], - baseStats: {hp: 78, atk: 81, def: 71, spa: 74, spd: 69, spe: 126}, - abilities: {0: "Flame Body", H: "Gale Wings"}, + baseStats: { hp: 78, atk: 81, def: 71, spa: 74, spd: 69, spe: 126 }, + abilities: { 0: "Flame Body", H: "Gale Wings" }, heightm: 1.2, weightkg: 24.5, color: "Red", @@ -11751,8 +11751,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 664, name: "Scatterbug", types: ["Bug"], - baseStats: {hp: 38, atk: 35, def: 40, spa: 27, spd: 25, spe: 35}, - abilities: {0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard"}, + baseStats: { hp: 38, atk: 35, def: 40, spa: 27, spd: 25, spe: 35 }, + abilities: { 0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard" }, heightm: 0.3, weightkg: 2.5, color: "Black", @@ -11764,8 +11764,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 665, name: "Spewpa", types: ["Bug"], - baseStats: {hp: 45, atk: 22, def: 60, spa: 27, spd: 30, spe: 29}, - abilities: {0: "Shed Skin", H: "Friend Guard"}, + baseStats: { hp: 45, atk: 22, def: 60, spa: 27, spd: 30, spe: 29 }, + abilities: { 0: "Shed Skin", H: "Friend Guard" }, heightm: 0.3, weightkg: 8.4, color: "Black", @@ -11780,8 +11780,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Vivillon", baseForme: "Meadow", // TODO: actual base forme is Icy Snow, not Meadow types: ["Bug", "Flying"], - baseStats: {hp: 80, atk: 52, def: 50, spa: 90, spd: 50, spe: 89}, - abilities: {0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard"}, + baseStats: { hp: 80, atk: 52, def: 50, spa: 90, spd: 50, spe: 89 }, + abilities: { 0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard" }, heightm: 1.2, weightkg: 17, color: "White", @@ -11819,8 +11819,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Vivillon", forme: "Fancy", types: ["Bug", "Flying"], - baseStats: {hp: 80, atk: 52, def: 50, spa: 90, spd: 50, spe: 89}, - abilities: {0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard"}, + baseStats: { hp: 80, atk: 52, def: 50, spa: 90, spd: 50, spe: 89 }, + abilities: { 0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard" }, heightm: 1.2, weightkg: 17, color: "Black", @@ -11834,8 +11834,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Vivillon", forme: "Pokeball", types: ["Bug", "Flying"], - baseStats: {hp: 80, atk: 52, def: 50, spa: 90, spd: 50, spe: 89}, - abilities: {0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard"}, + baseStats: { hp: 80, atk: 52, def: 50, spa: 90, spd: 50, spe: 89 }, + abilities: { 0: "Shield Dust", 1: "Compound Eyes", H: "Friend Guard" }, heightm: 1.2, weightkg: 17, color: "Black", @@ -11845,9 +11845,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 667, name: "Litleo", types: ["Fire", "Normal"], - genderRatio: {M: 0.125, F: 0.875}, - baseStats: {hp: 62, atk: 50, def: 58, spa: 73, spd: 54, spe: 72}, - abilities: {0: "Rivalry", 1: "Unnerve", H: "Moxie"}, + genderRatio: { M: 0.125, F: 0.875 }, + baseStats: { hp: 62, atk: 50, def: 58, spa: 73, spd: 54, spe: 72 }, + abilities: { 0: "Rivalry", 1: "Unnerve", H: "Moxie" }, heightm: 0.6, weightkg: 13.5, color: "Brown", @@ -11858,9 +11858,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 668, name: "Pyroar", types: ["Fire", "Normal"], - genderRatio: {M: 0.125, F: 0.875}, - baseStats: {hp: 86, atk: 68, def: 72, spa: 109, spd: 66, spe: 106}, - abilities: {0: "Rivalry", 1: "Unnerve", H: "Moxie"}, + genderRatio: { M: 0.125, F: 0.875 }, + baseStats: { hp: 86, atk: 68, def: 72, spa: 109, spd: 66, spe: 106 }, + abilities: { 0: "Rivalry", 1: "Unnerve", H: "Moxie" }, heightm: 1.5, weightkg: 81.5, color: "Brown", @@ -11874,8 +11874,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Red", types: ["Fairy"], gender: "F", - baseStats: {hp: 44, atk: 38, def: 39, spa: 61, spd: 79, spe: 42}, - abilities: {0: "Flower Veil", H: "Symbiosis"}, + baseStats: { hp: 44, atk: 38, def: 39, spa: 61, spd: 79, spe: 42 }, + abilities: { 0: "Flower Veil", H: "Symbiosis" }, heightm: 0.1, weightkg: 0.1, color: "White", @@ -11890,8 +11890,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Red", types: ["Fairy"], gender: "F", - baseStats: {hp: 54, atk: 45, def: 47, spa: 75, spd: 98, spe: 52}, - abilities: {0: "Flower Veil", H: "Symbiosis"}, + baseStats: { hp: 54, atk: 45, def: 47, spa: 75, spd: 98, spe: 52 }, + abilities: { 0: "Flower Veil", H: "Symbiosis" }, heightm: 0.2, weightkg: 0.9, color: "White", @@ -11910,8 +11910,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Eternal", types: ["Fairy"], gender: "F", - baseStats: {hp: 74, atk: 65, def: 67, spa: 125, spd: 128, spe: 92}, - abilities: {0: "Flower Veil"}, + baseStats: { hp: 74, atk: 65, def: 67, spa: 125, spd: 128, spe: 92 }, + abilities: { 0: "Flower Veil" }, heightm: 0.2, weightkg: 0.9, color: "White", @@ -11923,8 +11923,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Red", types: ["Fairy"], gender: "F", - baseStats: {hp: 78, atk: 65, def: 68, spa: 112, spd: 154, spe: 75}, - abilities: {0: "Flower Veil", H: "Symbiosis"}, + baseStats: { hp: 78, atk: 65, def: 68, spa: 112, spd: 154, spe: 75 }, + abilities: { 0: "Flower Veil", H: "Symbiosis" }, heightm: 1.1, weightkg: 10, color: "White", @@ -11939,8 +11939,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 672, name: "Skiddo", types: ["Grass"], - baseStats: {hp: 66, atk: 65, def: 48, spa: 62, spd: 57, spe: 52}, - abilities: {0: "Sap Sipper", H: "Grass Pelt"}, + baseStats: { hp: 66, atk: 65, def: 48, spa: 62, spd: 57, spe: 52 }, + abilities: { 0: "Sap Sipper", H: "Grass Pelt" }, heightm: 0.9, weightkg: 31, color: "Brown", @@ -11951,8 +11951,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 673, name: "Gogoat", types: ["Grass"], - baseStats: {hp: 123, atk: 100, def: 62, spa: 97, spd: 81, spe: 68}, - abilities: {0: "Sap Sipper", H: "Grass Pelt"}, + baseStats: { hp: 123, atk: 100, def: 62, spa: 97, spd: 81, spe: 68 }, + abilities: { 0: "Sap Sipper", H: "Grass Pelt" }, heightm: 1.7, weightkg: 91, color: "Brown", @@ -11964,8 +11964,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 674, name: "Pancham", types: ["Fighting"], - baseStats: {hp: 67, atk: 82, def: 62, spa: 46, spd: 48, spe: 43}, - abilities: {0: "Iron Fist", 1: "Mold Breaker", H: "Scrappy"}, + baseStats: { hp: 67, atk: 82, def: 62, spa: 46, spd: 48, spe: 43 }, + abilities: { 0: "Iron Fist", 1: "Mold Breaker", H: "Scrappy" }, heightm: 0.6, weightkg: 8, color: "White", @@ -11976,8 +11976,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 675, name: "Pangoro", types: ["Fighting", "Dark"], - baseStats: {hp: 95, atk: 124, def: 78, spa: 69, spd: 71, spe: 58}, - abilities: {0: "Iron Fist", 1: "Mold Breaker", H: "Scrappy"}, + baseStats: { hp: 95, atk: 124, def: 78, spa: 69, spd: 71, spe: 58 }, + abilities: { 0: "Iron Fist", 1: "Mold Breaker", H: "Scrappy" }, heightm: 2.1, weightkg: 136, color: "White", @@ -11991,8 +11991,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Furfrou", baseForme: "Natural", types: ["Normal"], - baseStats: {hp: 75, atk: 80, def: 60, spa: 65, spd: 90, spe: 102}, - abilities: {0: "Fur Coat"}, + baseStats: { hp: 75, atk: 80, def: 60, spa: 65, spd: 90, spe: 102 }, + abilities: { 0: "Fur Coat" }, heightm: 1.2, weightkg: 28, color: "White", @@ -12015,8 +12015,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 677, name: "Espurr", types: ["Psychic"], - baseStats: {hp: 62, atk: 48, def: 54, spa: 63, spd: 60, spe: 68}, - abilities: {0: "Keen Eye", 1: "Infiltrator", H: "Own Tempo"}, + baseStats: { hp: 62, atk: 48, def: 54, spa: 63, spd: 60, spe: 68 }, + abilities: { 0: "Keen Eye", 1: "Infiltrator", H: "Own Tempo" }, heightm: 0.3, weightkg: 3.5, color: "Gray", @@ -12029,8 +12029,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "M", types: ["Psychic"], gender: "M", - baseStats: {hp: 74, atk: 48, def: 76, spa: 83, spd: 81, spe: 104}, - abilities: {0: "Keen Eye", 1: "Infiltrator", H: "Prankster"}, + baseStats: { hp: 74, atk: 48, def: 76, spa: 83, spd: 81, spe: 104 }, + abilities: { 0: "Keen Eye", 1: "Infiltrator", H: "Prankster" }, heightm: 0.6, weightkg: 8.5, color: "Blue", @@ -12047,8 +12047,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "F", types: ["Psychic"], gender: "F", - baseStats: {hp: 74, atk: 48, def: 76, spa: 83, spd: 81, spe: 104}, - abilities: {0: "Keen Eye", 1: "Infiltrator", H: "Competitive"}, + baseStats: { hp: 74, atk: 48, def: 76, spa: 83, spd: 81, spe: 104 }, + abilities: { 0: "Keen Eye", 1: "Infiltrator", H: "Competitive" }, heightm: 0.6, weightkg: 8.5, color: "White", @@ -12060,8 +12060,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 679, name: "Honedge", types: ["Steel", "Ghost"], - baseStats: {hp: 45, atk: 80, def: 100, spa: 35, spd: 37, spe: 28}, - abilities: {0: "No Guard"}, + baseStats: { hp: 45, atk: 80, def: 100, spa: 35, spd: 37, spe: 28 }, + abilities: { 0: "No Guard" }, heightm: 0.8, weightkg: 2, color: "Brown", @@ -12072,8 +12072,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 680, name: "Doublade", types: ["Steel", "Ghost"], - baseStats: {hp: 59, atk: 110, def: 150, spa: 45, spd: 49, spe: 35}, - abilities: {0: "No Guard"}, + baseStats: { hp: 59, atk: 110, def: 150, spa: 45, spd: 49, spe: 35 }, + abilities: { 0: "No Guard" }, heightm: 0.8, weightkg: 4.5, color: "Brown", @@ -12087,8 +12087,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Aegislash", baseForme: "Shield", types: ["Steel", "Ghost"], - baseStats: {hp: 60, atk: 50, def: 140, spa: 50, spd: 140, spe: 60}, - abilities: {0: "Stance Change"}, + baseStats: { hp: 60, atk: 50, def: 140, spa: 50, spd: 140, spe: 60 }, + abilities: { 0: "Stance Change" }, heightm: 1.7, weightkg: 53, color: "Brown", @@ -12105,8 +12105,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Aegislash", forme: "Blade", types: ["Steel", "Ghost"], - baseStats: {hp: 60, atk: 140, def: 50, spa: 140, spd: 50, spe: 60}, - abilities: {0: "Stance Change"}, + baseStats: { hp: 60, atk: 140, def: 50, spa: 140, spd: 50, spe: 60 }, + abilities: { 0: "Stance Change" }, heightm: 1.7, weightkg: 53, color: "Brown", @@ -12118,8 +12118,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 682, name: "Spritzee", types: ["Fairy"], - baseStats: {hp: 78, atk: 52, def: 60, spa: 63, spd: 65, spe: 23}, - abilities: {0: "Healer", H: "Aroma Veil"}, + baseStats: { hp: 78, atk: 52, def: 60, spa: 63, spd: 65, spe: 23 }, + abilities: { 0: "Healer", H: "Aroma Veil" }, heightm: 0.2, weightkg: 0.5, color: "Pink", @@ -12130,8 +12130,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 683, name: "Aromatisse", types: ["Fairy"], - baseStats: {hp: 101, atk: 72, def: 72, spa: 99, spd: 89, spe: 29}, - abilities: {0: "Healer", H: "Aroma Veil"}, + baseStats: { hp: 101, atk: 72, def: 72, spa: 99, spd: 89, spe: 29 }, + abilities: { 0: "Healer", H: "Aroma Veil" }, heightm: 0.8, weightkg: 15.5, color: "Pink", @@ -12144,8 +12144,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 684, name: "Swirlix", types: ["Fairy"], - baseStats: {hp: 62, atk: 48, def: 66, spa: 59, spd: 57, spe: 49}, - abilities: {0: "Sweet Veil", H: "Unburden"}, + baseStats: { hp: 62, atk: 48, def: 66, spa: 59, spd: 57, spe: 49 }, + abilities: { 0: "Sweet Veil", H: "Unburden" }, heightm: 0.4, weightkg: 3.5, color: "White", @@ -12156,8 +12156,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 685, name: "Slurpuff", types: ["Fairy"], - baseStats: {hp: 82, atk: 80, def: 86, spa: 85, spd: 75, spe: 72}, - abilities: {0: "Sweet Veil", H: "Unburden"}, + baseStats: { hp: 82, atk: 80, def: 86, spa: 85, spd: 75, spe: 72 }, + abilities: { 0: "Sweet Veil", H: "Unburden" }, heightm: 0.8, weightkg: 5, color: "White", @@ -12170,8 +12170,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 686, name: "Inkay", types: ["Dark", "Psychic"], - baseStats: {hp: 53, atk: 54, def: 53, spa: 37, spd: 46, spe: 45}, - abilities: {0: "Contrary", 1: "Suction Cups", H: "Infiltrator"}, + baseStats: { hp: 53, atk: 54, def: 53, spa: 37, spd: 46, spe: 45 }, + abilities: { 0: "Contrary", 1: "Suction Cups", H: "Infiltrator" }, heightm: 0.4, weightkg: 3.5, color: "Blue", @@ -12182,8 +12182,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 687, name: "Malamar", types: ["Dark", "Psychic"], - baseStats: {hp: 86, atk: 92, def: 88, spa: 68, spd: 75, spe: 73}, - abilities: {0: "Contrary", 1: "Suction Cups", H: "Infiltrator"}, + baseStats: { hp: 86, atk: 92, def: 88, spa: 68, spd: 75, spe: 73 }, + abilities: { 0: "Contrary", 1: "Suction Cups", H: "Infiltrator" }, heightm: 1.5, weightkg: 47, color: "Blue", @@ -12196,8 +12196,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 688, name: "Binacle", types: ["Rock", "Water"], - baseStats: {hp: 42, atk: 52, def: 67, spa: 39, spd: 56, spe: 50}, - abilities: {0: "Tough Claws", 1: "Sniper", H: "Pickpocket"}, + baseStats: { hp: 42, atk: 52, def: 67, spa: 39, spd: 56, spe: 50 }, + abilities: { 0: "Tough Claws", 1: "Sniper", H: "Pickpocket" }, heightm: 0.5, weightkg: 31, color: "Brown", @@ -12208,8 +12208,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 689, name: "Barbaracle", types: ["Rock", "Water"], - baseStats: {hp: 72, atk: 105, def: 115, spa: 54, spd: 86, spe: 68}, - abilities: {0: "Tough Claws", 1: "Sniper", H: "Pickpocket"}, + baseStats: { hp: 72, atk: 105, def: 115, spa: 54, spd: 86, spe: 68 }, + abilities: { 0: "Tough Claws", 1: "Sniper", H: "Pickpocket" }, heightm: 1.3, weightkg: 96, color: "Brown", @@ -12221,8 +12221,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 690, name: "Skrelp", types: ["Poison", "Water"], - baseStats: {hp: 50, atk: 60, def: 60, spa: 60, spd: 60, spe: 30}, - abilities: {0: "Poison Point", 1: "Poison Touch", H: "Adaptability"}, + baseStats: { hp: 50, atk: 60, def: 60, spa: 60, spd: 60, spe: 30 }, + abilities: { 0: "Poison Point", 1: "Poison Touch", H: "Adaptability" }, heightm: 0.5, weightkg: 7.3, color: "Brown", @@ -12233,8 +12233,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 691, name: "Dragalge", types: ["Poison", "Dragon"], - baseStats: {hp: 65, atk: 75, def: 90, spa: 97, spd: 123, spe: 44}, - abilities: {0: "Poison Point", 1: "Poison Touch", H: "Adaptability"}, + baseStats: { hp: 65, atk: 75, def: 90, spa: 97, spd: 123, spe: 44 }, + abilities: { 0: "Poison Point", 1: "Poison Touch", H: "Adaptability" }, heightm: 1.8, weightkg: 81.5, color: "Brown", @@ -12246,8 +12246,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 692, name: "Clauncher", types: ["Water"], - baseStats: {hp: 50, atk: 53, def: 62, spa: 58, spd: 63, spe: 44}, - abilities: {0: "Mega Launcher"}, + baseStats: { hp: 50, atk: 53, def: 62, spa: 58, spd: 63, spe: 44 }, + abilities: { 0: "Mega Launcher" }, heightm: 0.5, weightkg: 8.3, color: "Blue", @@ -12258,8 +12258,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 693, name: "Clawitzer", types: ["Water"], - baseStats: {hp: 71, atk: 73, def: 88, spa: 120, spd: 89, spe: 59}, - abilities: {0: "Mega Launcher"}, + baseStats: { hp: 71, atk: 73, def: 88, spa: 120, spd: 89, spe: 59 }, + abilities: { 0: "Mega Launcher" }, heightm: 1.3, weightkg: 35.3, color: "Blue", @@ -12271,8 +12271,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 694, name: "Helioptile", types: ["Electric", "Normal"], - baseStats: {hp: 44, atk: 38, def: 33, spa: 61, spd: 43, spe: 70}, - abilities: {0: "Dry Skin", 1: "Sand Veil", H: "Solar Power"}, + baseStats: { hp: 44, atk: 38, def: 33, spa: 61, spd: 43, spe: 70 }, + abilities: { 0: "Dry Skin", 1: "Sand Veil", H: "Solar Power" }, heightm: 0.5, weightkg: 6, color: "Yellow", @@ -12283,8 +12283,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 695, name: "Heliolisk", types: ["Electric", "Normal"], - baseStats: {hp: 62, atk: 55, def: 52, spa: 109, spd: 94, spe: 109}, - abilities: {0: "Dry Skin", 1: "Sand Veil", H: "Solar Power"}, + baseStats: { hp: 62, atk: 55, def: 52, spa: 109, spd: 94, spe: 109 }, + abilities: { 0: "Dry Skin", 1: "Sand Veil", H: "Solar Power" }, heightm: 1, weightkg: 21, color: "Yellow", @@ -12297,9 +12297,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 696, name: "Tyrunt", types: ["Rock", "Dragon"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 58, atk: 89, def: 77, spa: 45, spd: 45, spe: 48}, - abilities: {0: "Strong Jaw", H: "Sturdy"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 58, atk: 89, def: 77, spa: 45, spd: 45, spe: 48 }, + abilities: { 0: "Strong Jaw", H: "Sturdy" }, heightm: 0.8, weightkg: 26, color: "Brown", @@ -12310,9 +12310,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 697, name: "Tyrantrum", types: ["Rock", "Dragon"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 82, atk: 121, def: 119, spa: 69, spd: 59, spe: 71}, - abilities: {0: "Strong Jaw", H: "Rock Head"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 82, atk: 121, def: 119, spa: 69, spd: 59, spe: 71 }, + abilities: { 0: "Strong Jaw", H: "Rock Head" }, heightm: 2.5, weightkg: 270, color: "Red", @@ -12325,9 +12325,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 698, name: "Amaura", types: ["Rock", "Ice"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 77, atk: 59, def: 50, spa: 67, spd: 63, spe: 46}, - abilities: {0: "Refrigerate", H: "Snow Warning"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 77, atk: 59, def: 50, spa: 67, spd: 63, spe: 46 }, + abilities: { 0: "Refrigerate", H: "Snow Warning" }, heightm: 1.3, weightkg: 25.2, color: "Blue", @@ -12338,9 +12338,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 699, name: "Aurorus", types: ["Rock", "Ice"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 123, atk: 77, def: 72, spa: 99, spd: 92, spe: 58}, - abilities: {0: "Refrigerate", H: "Snow Warning"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 123, atk: 77, def: 72, spa: 99, spd: 92, spe: 58 }, + abilities: { 0: "Refrigerate", H: "Snow Warning" }, heightm: 2.7, weightkg: 225, color: "Blue", @@ -12353,9 +12353,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 700, name: "Sylveon", types: ["Fairy"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 95, atk: 65, def: 65, spa: 110, spd: 130, spe: 60}, - abilities: {0: "Cute Charm", H: "Pixilate"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 95, atk: 65, def: 65, spa: 110, spd: 130, spe: 60 }, + abilities: { 0: "Cute Charm", H: "Pixilate" }, heightm: 1, weightkg: 23.5, color: "Pink", @@ -12368,8 +12368,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 701, name: "Hawlucha", types: ["Fighting", "Flying"], - baseStats: {hp: 78, atk: 92, def: 75, spa: 74, spd: 63, spe: 118}, - abilities: {0: "Limber", 1: "Unburden", H: "Mold Breaker"}, + baseStats: { hp: 78, atk: 92, def: 75, spa: 74, spd: 63, spe: 118 }, + abilities: { 0: "Limber", 1: "Unburden", H: "Mold Breaker" }, heightm: 0.8, weightkg: 21.5, color: "Green", @@ -12379,8 +12379,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 702, name: "Dedenne", types: ["Electric", "Fairy"], - baseStats: {hp: 67, atk: 58, def: 57, spa: 81, spd: 67, spe: 101}, - abilities: {0: "Cheek Pouch", 1: "Pickup", H: "Plus"}, + baseStats: { hp: 67, atk: 58, def: 57, spa: 81, spd: 67, spe: 101 }, + abilities: { 0: "Cheek Pouch", 1: "Pickup", H: "Plus" }, heightm: 0.2, weightkg: 2.2, color: "Yellow", @@ -12391,8 +12391,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Carbink", types: ["Rock", "Fairy"], gender: "N", - baseStats: {hp: 50, atk: 50, def: 150, spa: 50, spd: 150, spe: 50}, - abilities: {0: "Clear Body", H: "Sturdy"}, + baseStats: { hp: 50, atk: 50, def: 150, spa: 50, spd: 150, spe: 50 }, + abilities: { 0: "Clear Body", H: "Sturdy" }, heightm: 0.3, weightkg: 5.7, color: "Gray", @@ -12402,8 +12402,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 704, name: "Goomy", types: ["Dragon"], - baseStats: {hp: 45, atk: 50, def: 35, spa: 55, spd: 75, spe: 40}, - abilities: {0: "Sap Sipper", 1: "Hydration", H: "Gooey"}, + baseStats: { hp: 45, atk: 50, def: 35, spa: 55, spd: 75, spe: 40 }, + abilities: { 0: "Sap Sipper", 1: "Hydration", H: "Gooey" }, heightm: 0.3, weightkg: 2.8, color: "Purple", @@ -12414,8 +12414,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 705, name: "Sliggoo", types: ["Dragon"], - baseStats: {hp: 68, atk: 75, def: 53, spa: 83, spd: 113, spe: 60}, - abilities: {0: "Sap Sipper", 1: "Hydration", H: "Gooey"}, + baseStats: { hp: 68, atk: 75, def: 53, spa: 83, spd: 113, spe: 60 }, + abilities: { 0: "Sap Sipper", 1: "Hydration", H: "Gooey" }, heightm: 0.8, weightkg: 17.5, color: "Purple", @@ -12432,8 +12432,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sliggoo", forme: "Hisui", types: ["Steel", "Dragon"], - baseStats: {hp: 58, atk: 75, def: 83, spa: 83, spd: 113, spe: 40}, - abilities: {0: "Sap Sipper", 1: "Shell Armor", H: "Gooey"}, + baseStats: { hp: 58, atk: 75, def: 83, spa: 83, spd: 113, spe: 40 }, + abilities: { 0: "Sap Sipper", 1: "Shell Armor", H: "Gooey" }, heightm: 0.7, weightkg: 68.5, color: "Purple", @@ -12446,8 +12446,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 706, name: "Goodra", types: ["Dragon"], - baseStats: {hp: 90, atk: 100, def: 70, spa: 110, spd: 150, spe: 80}, - abilities: {0: "Sap Sipper", 1: "Hydration", H: "Gooey"}, + baseStats: { hp: 90, atk: 100, def: 70, spa: 110, spd: 150, spe: 80 }, + abilities: { 0: "Sap Sipper", 1: "Hydration", H: "Gooey" }, heightm: 2, weightkg: 150.5, color: "Purple", @@ -12464,8 +12464,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Goodra", forme: "Hisui", types: ["Steel", "Dragon"], - baseStats: {hp: 80, atk: 100, def: 100, spa: 110, spd: 150, spe: 60}, - abilities: {0: "Sap Sipper", 1: "Shell Armor", H: "Gooey"}, + baseStats: { hp: 80, atk: 100, def: 100, spa: 110, spd: 150, spe: 60 }, + abilities: { 0: "Sap Sipper", 1: "Shell Armor", H: "Gooey" }, heightm: 1.7, weightkg: 334.1, color: "Purple", @@ -12478,8 +12478,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 707, name: "Klefki", types: ["Steel", "Fairy"], - baseStats: {hp: 57, atk: 80, def: 91, spa: 80, spd: 87, spe: 75}, - abilities: {0: "Prankster", H: "Magician"}, + baseStats: { hp: 57, atk: 80, def: 91, spa: 80, spd: 87, spe: 75 }, + abilities: { 0: "Prankster", H: "Magician" }, heightm: 0.2, weightkg: 3, color: "Gray", @@ -12489,8 +12489,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 708, name: "Phantump", types: ["Ghost", "Grass"], - baseStats: {hp: 43, atk: 70, def: 48, spa: 50, spd: 60, spe: 38}, - abilities: {0: "Natural Cure", 1: "Frisk", H: "Harvest"}, + baseStats: { hp: 43, atk: 70, def: 48, spa: 50, spd: 60, spe: 38 }, + abilities: { 0: "Natural Cure", 1: "Frisk", H: "Harvest" }, heightm: 0.4, weightkg: 7, color: "Brown", @@ -12501,8 +12501,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 709, name: "Trevenant", types: ["Ghost", "Grass"], - baseStats: {hp: 85, atk: 110, def: 76, spa: 65, spd: 82, spe: 56}, - abilities: {0: "Natural Cure", 1: "Frisk", H: "Harvest"}, + baseStats: { hp: 85, atk: 110, def: 76, spa: 65, spd: 82, spe: 56 }, + abilities: { 0: "Natural Cure", 1: "Frisk", H: "Harvest" }, heightm: 1.5, weightkg: 71, color: "Brown", @@ -12515,8 +12515,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pumpkaboo", baseForme: "Average", types: ["Ghost", "Grass"], - baseStats: {hp: 49, atk: 66, def: 70, spa: 44, spd: 55, spe: 51}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 49, atk: 66, def: 70, spa: 44, spd: 55, spe: 51 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 0.4, weightkg: 5, color: "Brown", @@ -12531,8 +12531,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pumpkaboo", forme: "Small", types: ["Ghost", "Grass"], - baseStats: {hp: 44, atk: 66, def: 70, spa: 44, spd: 55, spe: 56}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 44, atk: 66, def: 70, spa: 44, spd: 55, spe: 56 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 0.3, weightkg: 3.5, color: "Brown", @@ -12545,8 +12545,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pumpkaboo", forme: "Large", types: ["Ghost", "Grass"], - baseStats: {hp: 54, atk: 66, def: 70, spa: 44, spd: 55, spe: 46}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 54, atk: 66, def: 70, spa: 44, spd: 55, spe: 46 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 0.5, weightkg: 7.5, color: "Brown", @@ -12559,8 +12559,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Pumpkaboo", forme: "Super", types: ["Ghost", "Grass"], - baseStats: {hp: 59, atk: 66, def: 70, spa: 44, spd: 55, spe: 41}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 59, atk: 66, def: 70, spa: 44, spd: 55, spe: 41 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 0.8, weightkg: 15, color: "Brown", @@ -12572,8 +12572,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Gourgeist", baseForme: "Average", types: ["Ghost", "Grass"], - baseStats: {hp: 65, atk: 90, def: 122, spa: 58, spd: 75, spe: 84}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 65, atk: 90, def: 122, spa: 58, spd: 75, spe: 84 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 0.9, weightkg: 12.5, color: "Brown", @@ -12589,8 +12589,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gourgeist", forme: "Small", types: ["Ghost", "Grass"], - baseStats: {hp: 55, atk: 85, def: 122, spa: 58, spd: 75, spe: 99}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 55, atk: 85, def: 122, spa: 58, spd: 75, spe: 99 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 0.7, weightkg: 9.5, color: "Brown", @@ -12604,8 +12604,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gourgeist", forme: "Large", types: ["Ghost", "Grass"], - baseStats: {hp: 75, atk: 95, def: 122, spa: 58, spd: 75, spe: 69}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 75, atk: 95, def: 122, spa: 58, spd: 75, spe: 69 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 1.1, weightkg: 14, color: "Brown", @@ -12619,8 +12619,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gourgeist", forme: "Super", types: ["Ghost", "Grass"], - baseStats: {hp: 85, atk: 100, def: 122, spa: 58, spd: 75, spe: 54}, - abilities: {0: "Pickup", 1: "Frisk", H: "Insomnia"}, + baseStats: { hp: 85, atk: 100, def: 122, spa: 58, spd: 75, spe: 54 }, + abilities: { 0: "Pickup", 1: "Frisk", H: "Insomnia" }, heightm: 1.7, weightkg: 39, color: "Brown", @@ -12632,8 +12632,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 712, name: "Bergmite", types: ["Ice"], - baseStats: {hp: 55, atk: 69, def: 85, spa: 32, spd: 35, spe: 28}, - abilities: {0: "Own Tempo", 1: "Ice Body", H: "Sturdy"}, + baseStats: { hp: 55, atk: 69, def: 85, spa: 32, spd: 35, spe: 28 }, + abilities: { 0: "Own Tempo", 1: "Ice Body", H: "Sturdy" }, heightm: 1, weightkg: 99.5, color: "Blue", @@ -12644,8 +12644,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 713, name: "Avalugg", types: ["Ice"], - baseStats: {hp: 95, atk: 117, def: 184, spa: 44, spd: 46, spe: 28}, - abilities: {0: "Own Tempo", 1: "Ice Body", H: "Sturdy"}, + baseStats: { hp: 95, atk: 117, def: 184, spa: 44, spd: 46, spe: 28 }, + abilities: { 0: "Own Tempo", 1: "Ice Body", H: "Sturdy" }, heightm: 2, weightkg: 505, color: "Blue", @@ -12661,8 +12661,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Avalugg", forme: "Hisui", types: ["Ice", "Rock"], - baseStats: {hp: 95, atk: 127, def: 184, spa: 34, spd: 36, spe: 38}, - abilities: {0: "Strong Jaw", 1: "Ice Body", H: "Sturdy"}, + baseStats: { hp: 95, atk: 127, def: 184, spa: 34, spd: 36, spe: 38 }, + abilities: { 0: "Strong Jaw", 1: "Ice Body", H: "Sturdy" }, heightm: 1.4, weightkg: 262.4, color: "Blue", @@ -12674,8 +12674,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 714, name: "Noibat", types: ["Flying", "Dragon"], - baseStats: {hp: 40, atk: 30, def: 35, spa: 45, spd: 40, spe: 55}, - abilities: {0: "Frisk", 1: "Infiltrator", H: "Telepathy"}, + baseStats: { hp: 40, atk: 30, def: 35, spa: 45, spd: 40, spe: 55 }, + abilities: { 0: "Frisk", 1: "Infiltrator", H: "Telepathy" }, heightm: 0.5, weightkg: 8, color: "Purple", @@ -12686,8 +12686,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 715, name: "Noivern", types: ["Flying", "Dragon"], - baseStats: {hp: 85, atk: 70, def: 80, spa: 97, spd: 80, spe: 123}, - abilities: {0: "Frisk", 1: "Infiltrator", H: "Telepathy"}, + baseStats: { hp: 85, atk: 70, def: 80, spa: 97, spd: 80, spe: 123 }, + abilities: { 0: "Frisk", 1: "Infiltrator", H: "Telepathy" }, heightm: 1.5, weightkg: 85, color: "Purple", @@ -12701,8 +12701,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Active", // Neutral is technically the base, but it can't be used in battle types: ["Fairy"], gender: "N", - baseStats: {hp: 126, atk: 131, def: 95, spa: 131, spd: 98, spe: 99}, - abilities: {0: "Fairy Aura"}, + baseStats: { hp: 126, atk: 131, def: 95, spa: 131, spd: 98, spe: 99 }, + abilities: { 0: "Fairy Aura" }, heightm: 3, weightkg: 215, color: "Blue", @@ -12718,8 +12718,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Neutral", types: ["Fairy"], gender: "N", - baseStats: {hp: 126, atk: 131, def: 95, spa: 131, spd: 98, spe: 99}, - abilities: {0: "Fairy Aura"}, + baseStats: { hp: 126, atk: 131, def: 95, spa: 131, spd: 98, spe: 99 }, + abilities: { 0: "Fairy Aura" }, heightm: 3, weightkg: 215, color: "Blue", @@ -12730,8 +12730,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Yveltal", types: ["Dark", "Flying"], gender: "N", - baseStats: {hp: 126, atk: 131, def: 95, spa: 131, spd: 98, spe: 99}, - abilities: {0: "Dark Aura"}, + baseStats: { hp: 126, atk: 131, def: 95, spa: 131, spd: 98, spe: 99 }, + abilities: { 0: "Dark Aura" }, heightm: 5.8, weightkg: 203, color: "Red", @@ -12744,15 +12744,15 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "50%", types: ["Dragon", "Ground"], gender: "N", - baseStats: {hp: 108, atk: 100, def: 121, spa: 81, spd: 95, spe: 95}, - abilities: {0: "Aura Break", S: "Power Construct"}, + baseStats: { hp: 108, atk: 100, def: 121, spa: 81, spd: 95, spe: 95 }, + abilities: { 0: "Aura Break", S: "Power Construct" }, heightm: 5, weightkg: 305, color: "Green", tags: ["Restricted Legendary"], eggGroups: ["Undiscovered"], otherFormes: ["Zygarde-10%", "Zygarde-Complete"], - // forme 2 = 10% with Power Constructor ,forme 3 = 50% with Power Construct + // forme 2 = 10% with Power Constructor ,forme 3 = 50% with Power Construct formeOrder: ["Zygarde", "Zygarde-10%", "Zygarde-10%", "Zygarde", "Zygarde-Complete"], }, zygarde10: { @@ -12762,8 +12762,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "10%", types: ["Dragon", "Ground"], gender: "N", - baseStats: {hp: 54, atk: 100, def: 71, spa: 61, spd: 85, spe: 115}, - abilities: {0: "Aura Break", S: "Power Construct"}, + baseStats: { hp: 54, atk: 100, def: 71, spa: 61, spd: 85, spe: 115 }, + abilities: { 0: "Aura Break", S: "Power Construct" }, heightm: 1.2, weightkg: 33.5, color: "Black", @@ -12778,8 +12778,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Complete", types: ["Dragon", "Ground"], gender: "N", - baseStats: {hp: 216, atk: 100, def: 121, spa: 91, spd: 95, spe: 85}, - abilities: {0: "Power Construct"}, + baseStats: { hp: 216, atk: 100, def: 121, spa: 91, spd: 95, spe: 85 }, + abilities: { 0: "Power Construct" }, heightm: 4.5, weightkg: 610, color: "Black", @@ -12793,8 +12793,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Diancie", types: ["Rock", "Fairy"], gender: "N", - baseStats: {hp: 50, atk: 100, def: 150, spa: 100, spd: 150, spe: 50}, - abilities: {0: "Clear Body"}, + baseStats: { hp: 50, atk: 100, def: 150, spa: 100, spd: 150, spe: 50 }, + abilities: { 0: "Clear Body" }, heightm: 0.7, weightkg: 8.8, color: "Pink", @@ -12810,8 +12810,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Mega", types: ["Rock", "Fairy"], gender: "N", - baseStats: {hp: 50, atk: 160, def: 110, spa: 160, spd: 110, spe: 110}, - abilities: {0: "Magic Bounce"}, + baseStats: { hp: 50, atk: 160, def: 110, spa: 160, spd: 110, spe: 110 }, + abilities: { 0: "Magic Bounce" }, heightm: 1.1, weightkg: 27.8, color: "Pink", @@ -12824,8 +12824,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Confined", types: ["Psychic", "Ghost"], gender: "N", - baseStats: {hp: 80, atk: 110, def: 60, spa: 150, spd: 130, spe: 70}, - abilities: {0: "Magician"}, + baseStats: { hp: 80, atk: 110, def: 60, spa: 150, spd: 130, spe: 70 }, + abilities: { 0: "Magician" }, heightm: 0.5, weightkg: 9, color: "Purple", @@ -12841,8 +12841,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Unbound", types: ["Psychic", "Dark"], gender: "N", - baseStats: {hp: 80, atk: 160, def: 60, spa: 170, spd: 130, spe: 80}, - abilities: {0: "Magician"}, + baseStats: { hp: 80, atk: 160, def: 60, spa: 170, spd: 130, spe: 80 }, + abilities: { 0: "Magician" }, heightm: 6.5, weightkg: 490, color: "Purple", @@ -12854,8 +12854,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Volcanion", types: ["Fire", "Water"], gender: "N", - baseStats: {hp: 80, atk: 110, def: 120, spa: 130, spd: 90, spe: 70}, - abilities: {0: "Water Absorb"}, + baseStats: { hp: 80, atk: 110, def: 120, spa: 130, spd: 90, spe: 70 }, + abilities: { 0: "Water Absorb" }, heightm: 1.7, weightkg: 195, color: "Brown", @@ -12866,9 +12866,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 722, name: "Rowlet", types: ["Grass", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 68, atk: 55, def: 55, spa: 50, spd: 50, spe: 42}, - abilities: {0: "Overgrow", H: "Long Reach"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 68, atk: 55, def: 55, spa: 50, spd: 50, spe: 42 }, + abilities: { 0: "Overgrow", H: "Long Reach" }, heightm: 0.3, weightkg: 1.5, color: "Brown", @@ -12879,9 +12879,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 723, name: "Dartrix", types: ["Grass", "Flying"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 78, atk: 75, def: 75, spa: 70, spd: 70, spe: 52}, - abilities: {0: "Overgrow", H: "Long Reach"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 78, atk: 75, def: 75, spa: 70, spd: 70, spe: 52 }, + abilities: { 0: "Overgrow", H: "Long Reach" }, heightm: 0.7, weightkg: 16, color: "Brown", @@ -12894,9 +12894,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 724, name: "Decidueye", types: ["Grass", "Ghost"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 78, atk: 107, def: 75, spa: 100, spd: 100, spe: 70}, - abilities: {0: "Overgrow", H: "Long Reach"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 78, atk: 107, def: 75, spa: 100, spd: 100, spe: 70 }, + abilities: { 0: "Overgrow", H: "Long Reach" }, heightm: 1.6, weightkg: 36.6, color: "Brown", @@ -12912,9 +12912,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Decidueye", forme: "Hisui", types: ["Grass", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 88, atk: 112, def: 80, spa: 95, spd: 95, spe: 60}, - abilities: {0: "Overgrow", H: "Scrappy"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 88, atk: 112, def: 80, spa: 95, spd: 95, spe: 60 }, + abilities: { 0: "Overgrow", H: "Scrappy" }, heightm: 1.6, weightkg: 37, color: "Brown", @@ -12926,9 +12926,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 725, name: "Litten", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 45, atk: 65, def: 40, spa: 60, spd: 40, spe: 70}, - abilities: {0: "Blaze", H: "Intimidate"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 45, atk: 65, def: 40, spa: 60, spd: 40, spe: 70 }, + abilities: { 0: "Blaze", H: "Intimidate" }, heightm: 0.4, weightkg: 4.3, color: "Red", @@ -12939,9 +12939,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 726, name: "Torracat", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 85, def: 50, spa: 80, spd: 50, spe: 90}, - abilities: {0: "Blaze", H: "Intimidate"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 85, def: 50, spa: 80, spd: 50, spe: 90 }, + abilities: { 0: "Blaze", H: "Intimidate" }, heightm: 0.7, weightkg: 25, color: "Red", @@ -12954,9 +12954,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 727, name: "Incineroar", types: ["Fire", "Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 95, atk: 115, def: 90, spa: 80, spd: 90, spe: 60}, - abilities: {0: "Blaze", H: "Intimidate"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 95, atk: 115, def: 90, spa: 80, spd: 90, spe: 60 }, + abilities: { 0: "Blaze", H: "Intimidate" }, heightm: 1.8, weightkg: 83, color: "Red", @@ -12968,9 +12968,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 728, name: "Popplio", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 54, def: 54, spa: 66, spd: 56, spe: 40}, - abilities: {0: "Torrent", H: "Liquid Voice"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 54, def: 54, spa: 66, spd: 56, spe: 40 }, + abilities: { 0: "Torrent", H: "Liquid Voice" }, heightm: 0.4, weightkg: 7.5, color: "Blue", @@ -12981,9 +12981,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 729, name: "Brionne", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 69, def: 69, spa: 91, spd: 81, spe: 50}, - abilities: {0: "Torrent", H: "Liquid Voice"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 69, def: 69, spa: 91, spd: 81, spe: 50 }, + abilities: { 0: "Torrent", H: "Liquid Voice" }, heightm: 0.6, weightkg: 17.5, color: "Blue", @@ -12996,9 +12996,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 730, name: "Primarina", types: ["Water", "Fairy"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 74, def: 74, spa: 126, spd: 116, spe: 60}, - abilities: {0: "Torrent", H: "Liquid Voice"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 74, def: 74, spa: 126, spd: 116, spe: 60 }, + abilities: { 0: "Torrent", H: "Liquid Voice" }, heightm: 1.8, weightkg: 44, color: "Blue", @@ -13010,8 +13010,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 731, name: "Pikipek", types: ["Normal", "Flying"], - baseStats: {hp: 35, atk: 75, def: 30, spa: 30, spd: 30, spe: 65}, - abilities: {0: "Keen Eye", 1: "Skill Link", H: "Pickup"}, + baseStats: { hp: 35, atk: 75, def: 30, spa: 30, spd: 30, spe: 65 }, + abilities: { 0: "Keen Eye", 1: "Skill Link", H: "Pickup" }, heightm: 0.3, weightkg: 1.2, color: "Black", @@ -13022,8 +13022,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 732, name: "Trumbeak", types: ["Normal", "Flying"], - baseStats: {hp: 55, atk: 85, def: 50, spa: 40, spd: 50, spe: 75}, - abilities: {0: "Keen Eye", 1: "Skill Link", H: "Pickup"}, + baseStats: { hp: 55, atk: 85, def: 50, spa: 40, spd: 50, spe: 75 }, + abilities: { 0: "Keen Eye", 1: "Skill Link", H: "Pickup" }, heightm: 0.6, weightkg: 14.8, color: "Black", @@ -13036,8 +13036,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 733, name: "Toucannon", types: ["Normal", "Flying"], - baseStats: {hp: 80, atk: 120, def: 75, spa: 75, spd: 75, spe: 60}, - abilities: {0: "Keen Eye", 1: "Skill Link", H: "Sheer Force"}, + baseStats: { hp: 80, atk: 120, def: 75, spa: 75, spd: 75, spe: 60 }, + abilities: { 0: "Keen Eye", 1: "Skill Link", H: "Sheer Force" }, heightm: 1.1, weightkg: 26, color: "Black", @@ -13049,8 +13049,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 734, name: "Yungoos", types: ["Normal"], - baseStats: {hp: 48, atk: 70, def: 30, spa: 30, spd: 30, spe: 45}, - abilities: {0: "Stakeout", 1: "Strong Jaw", H: "Adaptability"}, + baseStats: { hp: 48, atk: 70, def: 30, spa: 30, spd: 30, spe: 45 }, + abilities: { 0: "Stakeout", 1: "Strong Jaw", H: "Adaptability" }, heightm: 0.4, weightkg: 6, color: "Brown", @@ -13061,8 +13061,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 735, name: "Gumshoos", types: ["Normal"], - baseStats: {hp: 88, atk: 110, def: 60, spa: 55, spd: 60, spe: 45}, - abilities: {0: "Stakeout", 1: "Strong Jaw", H: "Adaptability"}, + baseStats: { hp: 88, atk: 110, def: 60, spa: 55, spd: 60, spe: 45 }, + abilities: { 0: "Stakeout", 1: "Strong Jaw", H: "Adaptability" }, heightm: 0.7, weightkg: 14.2, color: "Brown", @@ -13079,8 +13079,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Gumshoos", forme: "Totem", types: ["Normal"], - baseStats: {hp: 88, atk: 110, def: 60, spa: 55, spd: 60, spe: 45}, - abilities: {0: "Adaptability"}, + baseStats: { hp: 88, atk: 110, def: 60, spa: 55, spd: 60, spe: 45 }, + abilities: { 0: "Adaptability" }, heightm: 1.4, weightkg: 60, color: "Brown", @@ -13090,8 +13090,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 736, name: "Grubbin", types: ["Bug"], - baseStats: {hp: 47, atk: 62, def: 45, spa: 55, spd: 45, spe: 46}, - abilities: {0: "Swarm"}, + baseStats: { hp: 47, atk: 62, def: 45, spa: 55, spd: 45, spe: 46 }, + abilities: { 0: "Swarm" }, heightm: 0.4, weightkg: 4.4, color: "Gray", @@ -13102,8 +13102,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 737, name: "Charjabug", types: ["Bug", "Electric"], - baseStats: {hp: 57, atk: 82, def: 95, spa: 55, spd: 75, spe: 36}, - abilities: {0: "Battery"}, + baseStats: { hp: 57, atk: 82, def: 95, spa: 55, spd: 75, spe: 36 }, + abilities: { 0: "Battery" }, heightm: 0.5, weightkg: 10.5, color: "Green", @@ -13116,8 +13116,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 738, name: "Vikavolt", types: ["Bug", "Electric"], - baseStats: {hp: 77, atk: 70, def: 90, spa: 145, spd: 75, spe: 43}, - abilities: {0: "Levitate"}, + baseStats: { hp: 77, atk: 70, def: 90, spa: 145, spd: 75, spe: 43 }, + abilities: { 0: "Levitate" }, heightm: 1.5, weightkg: 45, color: "Blue", @@ -13134,8 +13134,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Vikavolt", forme: "Totem", types: ["Bug", "Electric"], - baseStats: {hp: 77, atk: 70, def: 90, spa: 145, spd: 75, spe: 43}, - abilities: {0: "Levitate"}, + baseStats: { hp: 77, atk: 70, def: 90, spa: 145, spd: 75, spe: 43 }, + abilities: { 0: "Levitate" }, heightm: 2.6, weightkg: 147.5, color: "Blue", @@ -13145,8 +13145,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 739, name: "Crabrawler", types: ["Fighting"], - baseStats: {hp: 47, atk: 82, def: 57, spa: 42, spd: 47, spe: 63}, - abilities: {0: "Hyper Cutter", 1: "Iron Fist", H: "Anger Point"}, + baseStats: { hp: 47, atk: 82, def: 57, spa: 42, spd: 47, spe: 63 }, + abilities: { 0: "Hyper Cutter", 1: "Iron Fist", H: "Anger Point" }, heightm: 0.6, weightkg: 7, color: "Purple", @@ -13157,8 +13157,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 740, name: "Crabominable", types: ["Fighting", "Ice"], - baseStats: {hp: 97, atk: 132, def: 77, spa: 62, spd: 67, spe: 43}, - abilities: {0: "Hyper Cutter", 1: "Iron Fist", H: "Anger Point"}, + baseStats: { hp: 97, atk: 132, def: 77, spa: 62, spd: 67, spe: 43 }, + abilities: { 0: "Hyper Cutter", 1: "Iron Fist", H: "Anger Point" }, heightm: 1.7, weightkg: 180, color: "White", @@ -13172,9 +13172,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Oricorio", baseForme: "Baile", types: ["Fire", "Flying"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93}, - abilities: {0: "Dancer"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93 }, + abilities: { 0: "Dancer" }, heightm: 0.6, weightkg: 3.4, color: "Red", @@ -13188,9 +13188,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Oricorio", forme: "Pom-Pom", types: ["Electric", "Flying"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93}, - abilities: {0: "Dancer"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93 }, + abilities: { 0: "Dancer" }, heightm: 0.6, weightkg: 3.4, color: "Yellow", @@ -13203,9 +13203,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Oricorio", forme: "Pa'u", types: ["Psychic", "Flying"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93}, - abilities: {0: "Dancer"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93 }, + abilities: { 0: "Dancer" }, heightm: 0.6, weightkg: 3.4, color: "Pink", @@ -13218,9 +13218,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Oricorio", forme: "Sensu", types: ["Ghost", "Flying"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93}, - abilities: {0: "Dancer"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 75, atk: 70, def: 70, spa: 98, spd: 70, spe: 93 }, + abilities: { 0: "Dancer" }, heightm: 0.6, weightkg: 3.4, color: "Purple", @@ -13231,8 +13231,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 742, name: "Cutiefly", types: ["Bug", "Fairy"], - baseStats: {hp: 40, atk: 45, def: 40, spa: 55, spd: 40, spe: 84}, - abilities: {0: "Honey Gather", 1: "Shield Dust", H: "Sweet Veil"}, + baseStats: { hp: 40, atk: 45, def: 40, spa: 55, spd: 40, spe: 84 }, + abilities: { 0: "Honey Gather", 1: "Shield Dust", H: "Sweet Veil" }, heightm: 0.1, weightkg: 0.2, color: "Yellow", @@ -13243,8 +13243,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 743, name: "Ribombee", types: ["Bug", "Fairy"], - baseStats: {hp: 60, atk: 55, def: 60, spa: 95, spd: 70, spe: 124}, - abilities: {0: "Honey Gather", 1: "Shield Dust", H: "Sweet Veil"}, + baseStats: { hp: 60, atk: 55, def: 60, spa: 95, spd: 70, spe: 124 }, + abilities: { 0: "Honey Gather", 1: "Shield Dust", H: "Sweet Veil" }, heightm: 0.2, weightkg: 0.5, color: "Yellow", @@ -13260,8 +13260,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Ribombee", forme: "Totem", types: ["Bug", "Fairy"], - baseStats: {hp: 60, atk: 55, def: 60, spa: 95, spd: 70, spe: 124}, - abilities: {0: "Sweet Veil"}, + baseStats: { hp: 60, atk: 55, def: 60, spa: 95, spd: 70, spe: 124 }, + abilities: { 0: "Sweet Veil" }, heightm: 0.4, weightkg: 2, color: "Yellow", @@ -13272,8 +13272,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Rockruff", baseForme: "Midday", types: ["Rock"], - baseStats: {hp: 45, atk: 65, def: 40, spa: 30, spd: 40, spe: 60}, - abilities: {0: "Keen Eye", 1: "Vital Spirit", H: "Steadfast", S: "Own Tempo"}, + baseStats: { hp: 45, atk: 65, def: 40, spa: 30, spd: 40, spe: 60 }, + abilities: { 0: "Keen Eye", 1: "Vital Spirit", H: "Steadfast", S: "Own Tempo" }, heightm: 0.5, weightkg: 9.2, color: "Brown", @@ -13288,8 +13288,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Rockruff", forme: "Dusk", types: ["Rock"], - baseStats: {hp: 45, atk: 65, def: 40, spa: 30, spd: 40, spe: 60}, - abilities: {0: "Own Tempo"}, + baseStats: { hp: 45, atk: 65, def: 40, spa: 30, spd: 40, spe: 60 }, + abilities: { 0: "Own Tempo" }, heightm: 0.5, weightkg: 9.2, color: "Brown", @@ -13301,8 +13301,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Lycanroc", baseForme: "Midday", types: ["Rock"], - baseStats: {hp: 75, atk: 115, def: 65, spa: 55, spd: 65, spe: 112}, - abilities: {0: "Keen Eye", 1: "Sand Rush", H: "Steadfast"}, + baseStats: { hp: 75, atk: 115, def: 65, spa: 55, spd: 65, spe: 112 }, + abilities: { 0: "Keen Eye", 1: "Sand Rush", H: "Steadfast" }, heightm: 0.8, weightkg: 25, color: "Brown", @@ -13319,8 +13319,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Lycanroc", forme: "Midnight", types: ["Rock"], - baseStats: {hp: 85, atk: 115, def: 75, spa: 55, spd: 75, spe: 82}, - abilities: {0: "Keen Eye", 1: "Vital Spirit", H: "No Guard"}, + baseStats: { hp: 85, atk: 115, def: 75, spa: 55, spd: 75, spe: 82 }, + abilities: { 0: "Keen Eye", 1: "Vital Spirit", H: "No Guard" }, heightm: 1.1, weightkg: 25, color: "Red", @@ -13335,8 +13335,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Lycanroc", forme: "Dusk", types: ["Rock"], - baseStats: {hp: 75, atk: 117, def: 65, spa: 55, spd: 65, spe: 110}, - abilities: {0: "Tough Claws"}, + baseStats: { hp: 75, atk: 117, def: 65, spa: 55, spd: 65, spe: 110 }, + abilities: { 0: "Tough Claws" }, heightm: 0.8, weightkg: 25, color: "Brown", @@ -13350,8 +13350,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Wishiwashi", baseForme: "Solo", types: ["Water"], - baseStats: {hp: 45, atk: 20, def: 20, spa: 25, spd: 25, spe: 40}, - abilities: {0: "Schooling"}, + baseStats: { hp: 45, atk: 20, def: 20, spa: 25, spd: 25, spe: 40 }, + abilities: { 0: "Schooling" }, heightm: 0.2, weightkg: 0.3, color: "Blue", @@ -13365,8 +13365,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Wishiwashi", forme: "School", types: ["Water"], - baseStats: {hp: 45, atk: 140, def: 130, spa: 140, spd: 135, spe: 30}, - abilities: {0: "Schooling"}, + baseStats: { hp: 45, atk: 140, def: 130, spa: 140, spd: 135, spe: 30 }, + abilities: { 0: "Schooling" }, heightm: 8.2, weightkg: 78.6, color: "Blue", @@ -13378,8 +13378,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 747, name: "Mareanie", types: ["Poison", "Water"], - baseStats: {hp: 50, atk: 53, def: 62, spa: 43, spd: 52, spe: 45}, - abilities: {0: "Merciless", 1: "Limber", H: "Regenerator"}, + baseStats: { hp: 50, atk: 53, def: 62, spa: 43, spd: 52, spe: 45 }, + abilities: { 0: "Merciless", 1: "Limber", H: "Regenerator" }, heightm: 0.4, weightkg: 8, color: "Blue", @@ -13390,8 +13390,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 748, name: "Toxapex", types: ["Poison", "Water"], - baseStats: {hp: 50, atk: 63, def: 152, spa: 53, spd: 142, spe: 35}, - abilities: {0: "Merciless", 1: "Limber", H: "Regenerator"}, + baseStats: { hp: 50, atk: 63, def: 152, spa: 53, spd: 142, spe: 35 }, + abilities: { 0: "Merciless", 1: "Limber", H: "Regenerator" }, heightm: 0.7, weightkg: 14.5, color: "Blue", @@ -13403,8 +13403,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 749, name: "Mudbray", types: ["Ground"], - baseStats: {hp: 70, atk: 100, def: 70, spa: 45, spd: 55, spe: 45}, - abilities: {0: "Own Tempo", 1: "Stamina", H: "Inner Focus"}, + baseStats: { hp: 70, atk: 100, def: 70, spa: 45, spd: 55, spe: 45 }, + abilities: { 0: "Own Tempo", 1: "Stamina", H: "Inner Focus" }, heightm: 1, weightkg: 110, color: "Brown", @@ -13415,8 +13415,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 750, name: "Mudsdale", types: ["Ground"], - baseStats: {hp: 100, atk: 125, def: 100, spa: 55, spd: 85, spe: 35}, - abilities: {0: "Own Tempo", 1: "Stamina", H: "Inner Focus"}, + baseStats: { hp: 100, atk: 125, def: 100, spa: 55, spd: 85, spe: 35 }, + abilities: { 0: "Own Tempo", 1: "Stamina", H: "Inner Focus" }, heightm: 2.5, weightkg: 920, color: "Brown", @@ -13428,8 +13428,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 751, name: "Dewpider", types: ["Water", "Bug"], - baseStats: {hp: 38, atk: 40, def: 52, spa: 40, spd: 72, spe: 27}, - abilities: {0: "Water Bubble", H: "Water Absorb"}, + baseStats: { hp: 38, atk: 40, def: 52, spa: 40, spd: 72, spe: 27 }, + abilities: { 0: "Water Bubble", H: "Water Absorb" }, heightm: 0.3, weightkg: 4, color: "Green", @@ -13440,8 +13440,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 752, name: "Araquanid", types: ["Water", "Bug"], - baseStats: {hp: 68, atk: 70, def: 92, spa: 50, spd: 132, spe: 42}, - abilities: {0: "Water Bubble", H: "Water Absorb"}, + baseStats: { hp: 68, atk: 70, def: 92, spa: 50, spd: 132, spe: 42 }, + abilities: { 0: "Water Bubble", H: "Water Absorb" }, heightm: 1.8, weightkg: 82, color: "Green", @@ -13457,8 +13457,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Araquanid", forme: "Totem", types: ["Water", "Bug"], - baseStats: {hp: 68, atk: 70, def: 92, spa: 50, spd: 132, spe: 42}, - abilities: {0: "Water Bubble"}, + baseStats: { hp: 68, atk: 70, def: 92, spa: 50, spd: 132, spe: 42 }, + abilities: { 0: "Water Bubble" }, heightm: 3.1, weightkg: 217.5, color: "Green", @@ -13468,8 +13468,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 753, name: "Fomantis", types: ["Grass"], - baseStats: {hp: 40, atk: 55, def: 35, spa: 50, spd: 35, spe: 35}, - abilities: {0: "Leaf Guard", H: "Contrary"}, + baseStats: { hp: 40, atk: 55, def: 35, spa: 50, spd: 35, spe: 35 }, + abilities: { 0: "Leaf Guard", H: "Contrary" }, heightm: 0.3, weightkg: 1.5, color: "Pink", @@ -13480,8 +13480,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 754, name: "Lurantis", types: ["Grass"], - baseStats: {hp: 70, atk: 105, def: 90, spa: 80, spd: 90, spe: 45}, - abilities: {0: "Leaf Guard", H: "Contrary"}, + baseStats: { hp: 70, atk: 105, def: 90, spa: 80, spd: 90, spe: 45 }, + abilities: { 0: "Leaf Guard", H: "Contrary" }, heightm: 0.9, weightkg: 18.5, color: "Pink", @@ -13498,8 +13498,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Lurantis", forme: "Totem", types: ["Grass"], - baseStats: {hp: 70, atk: 105, def: 90, spa: 80, spd: 90, spe: 45}, - abilities: {0: "Leaf Guard"}, + baseStats: { hp: 70, atk: 105, def: 90, spa: 80, spd: 90, spe: 45 }, + abilities: { 0: "Leaf Guard" }, heightm: 1.5, weightkg: 58, color: "Pink", @@ -13509,8 +13509,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 755, name: "Morelull", types: ["Grass", "Fairy"], - baseStats: {hp: 40, atk: 35, def: 55, spa: 65, spd: 75, spe: 15}, - abilities: {0: "Illuminate", 1: "Effect Spore", H: "Rain Dish"}, + baseStats: { hp: 40, atk: 35, def: 55, spa: 65, spd: 75, spe: 15 }, + abilities: { 0: "Illuminate", 1: "Effect Spore", H: "Rain Dish" }, heightm: 0.2, weightkg: 1.5, color: "Purple", @@ -13521,8 +13521,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 756, name: "Shiinotic", types: ["Grass", "Fairy"], - baseStats: {hp: 60, atk: 45, def: 80, spa: 90, spd: 100, spe: 30}, - abilities: {0: "Illuminate", 1: "Effect Spore", H: "Rain Dish"}, + baseStats: { hp: 60, atk: 45, def: 80, spa: 90, spd: 100, spe: 30 }, + abilities: { 0: "Illuminate", 1: "Effect Spore", H: "Rain Dish" }, heightm: 1, weightkg: 11.5, color: "Purple", @@ -13534,9 +13534,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 757, name: "Salandit", types: ["Poison", "Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 48, atk: 44, def: 40, spa: 71, spd: 40, spe: 77}, - abilities: {0: "Corrosion", H: "Oblivious"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 48, atk: 44, def: 40, spa: 71, spd: 40, spe: 77 }, + abilities: { 0: "Corrosion", H: "Oblivious" }, heightm: 0.6, weightkg: 4.8, color: "Black", @@ -13548,8 +13548,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Salazzle", types: ["Poison", "Fire"], gender: "F", - baseStats: {hp: 68, atk: 64, def: 60, spa: 111, spd: 60, spe: 117}, - abilities: {0: "Corrosion", H: "Oblivious"}, + baseStats: { hp: 68, atk: 64, def: 60, spa: 111, spd: 60, spe: 117 }, + abilities: { 0: "Corrosion", H: "Oblivious" }, heightm: 1.2, weightkg: 22.2, color: "Black", @@ -13566,8 +13566,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Totem", types: ["Poison", "Fire"], gender: "F", - baseStats: {hp: 68, atk: 64, def: 60, spa: 111, spd: 60, spe: 117}, - abilities: {0: "Corrosion"}, + baseStats: { hp: 68, atk: 64, def: 60, spa: 111, spd: 60, spe: 117 }, + abilities: { 0: "Corrosion" }, heightm: 2.1, weightkg: 81, color: "Black", @@ -13577,8 +13577,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 759, name: "Stufful", types: ["Normal", "Fighting"], - baseStats: {hp: 70, atk: 75, def: 50, spa: 45, spd: 50, spe: 50}, - abilities: {0: "Fluffy", 1: "Klutz", H: "Cute Charm"}, + baseStats: { hp: 70, atk: 75, def: 50, spa: 45, spd: 50, spe: 50 }, + abilities: { 0: "Fluffy", 1: "Klutz", H: "Cute Charm" }, heightm: 0.5, weightkg: 6.8, color: "Pink", @@ -13589,8 +13589,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 760, name: "Bewear", types: ["Normal", "Fighting"], - baseStats: {hp: 120, atk: 125, def: 80, spa: 55, spd: 60, spe: 60}, - abilities: {0: "Fluffy", 1: "Klutz", H: "Unnerve"}, + baseStats: { hp: 120, atk: 125, def: 80, spa: 55, spd: 60, spe: 60 }, + abilities: { 0: "Fluffy", 1: "Klutz", H: "Unnerve" }, heightm: 2.1, weightkg: 135, color: "Pink", @@ -13603,8 +13603,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Bounsweet", types: ["Grass"], gender: "F", - baseStats: {hp: 42, atk: 30, def: 38, spa: 30, spd: 38, spe: 32}, - abilities: {0: "Leaf Guard", 1: "Oblivious", H: "Sweet Veil"}, + baseStats: { hp: 42, atk: 30, def: 38, spa: 30, spd: 38, spe: 32 }, + abilities: { 0: "Leaf Guard", 1: "Oblivious", H: "Sweet Veil" }, heightm: 0.3, weightkg: 3.2, color: "Purple", @@ -13616,8 +13616,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Steenee", types: ["Grass"], gender: "F", - baseStats: {hp: 52, atk: 40, def: 48, spa: 40, spd: 48, spe: 62}, - abilities: {0: "Leaf Guard", 1: "Oblivious", H: "Sweet Veil"}, + baseStats: { hp: 52, atk: 40, def: 48, spa: 40, spd: 48, spe: 62 }, + abilities: { 0: "Leaf Guard", 1: "Oblivious", H: "Sweet Veil" }, heightm: 0.7, weightkg: 8.2, color: "Purple", @@ -13631,8 +13631,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tsareena", types: ["Grass"], gender: "F", - baseStats: {hp: 72, atk: 120, def: 98, spa: 50, spd: 98, spe: 72}, - abilities: {0: "Leaf Guard", 1: "Queenly Majesty", H: "Sweet Veil"}, + baseStats: { hp: 72, atk: 120, def: 98, spa: 50, spd: 98, spe: 72 }, + abilities: { 0: "Leaf Guard", 1: "Queenly Majesty", H: "Sweet Veil" }, heightm: 1.2, weightkg: 21.4, color: "Purple", @@ -13645,9 +13645,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 764, name: "Comfey", types: ["Fairy"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 51, atk: 52, def: 90, spa: 82, spd: 110, spe: 100}, - abilities: {0: "Flower Veil", 1: "Triage", H: "Natural Cure"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 51, atk: 52, def: 90, spa: 82, spd: 110, spe: 100 }, + abilities: { 0: "Flower Veil", 1: "Triage", H: "Natural Cure" }, heightm: 0.1, weightkg: 0.3, color: "Green", @@ -13657,8 +13657,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 765, name: "Oranguru", types: ["Normal", "Psychic"], - baseStats: {hp: 90, atk: 60, def: 80, spa: 90, spd: 110, spe: 60}, - abilities: {0: "Inner Focus", 1: "Telepathy", H: "Symbiosis"}, + baseStats: { hp: 90, atk: 60, def: 80, spa: 90, spd: 110, spe: 60 }, + abilities: { 0: "Inner Focus", 1: "Telepathy", H: "Symbiosis" }, heightm: 1.5, weightkg: 76, color: "White", @@ -13668,8 +13668,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 766, name: "Passimian", types: ["Fighting"], - baseStats: {hp: 100, atk: 120, def: 90, spa: 40, spd: 60, spe: 80}, - abilities: {0: "Receiver", H: "Defiant"}, + baseStats: { hp: 100, atk: 120, def: 90, spa: 40, spd: 60, spe: 80 }, + abilities: { 0: "Receiver", H: "Defiant" }, heightm: 2, weightkg: 82.8, color: "White", @@ -13679,8 +13679,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 767, name: "Wimpod", types: ["Bug", "Water"], - baseStats: {hp: 25, atk: 35, def: 40, spa: 20, spd: 30, spe: 80}, - abilities: {0: "Wimp Out"}, + baseStats: { hp: 25, atk: 35, def: 40, spa: 20, spd: 30, spe: 80 }, + abilities: { 0: "Wimp Out" }, heightm: 0.5, weightkg: 12, color: "Gray", @@ -13691,8 +13691,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 768, name: "Golisopod", types: ["Bug", "Water"], - baseStats: {hp: 75, atk: 125, def: 140, spa: 60, spd: 90, spe: 40}, - abilities: {0: "Emergency Exit"}, + baseStats: { hp: 75, atk: 125, def: 140, spa: 60, spd: 90, spe: 40 }, + abilities: { 0: "Emergency Exit" }, heightm: 2, weightkg: 108, color: "Gray", @@ -13704,8 +13704,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 769, name: "Sandygast", types: ["Ghost", "Ground"], - baseStats: {hp: 55, atk: 55, def: 80, spa: 70, spd: 45, spe: 15}, - abilities: {0: "Water Compaction", H: "Sand Veil"}, + baseStats: { hp: 55, atk: 55, def: 80, spa: 70, spd: 45, spe: 15 }, + abilities: { 0: "Water Compaction", H: "Sand Veil" }, heightm: 0.5, weightkg: 70, color: "Brown", @@ -13716,8 +13716,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 770, name: "Palossand", types: ["Ghost", "Ground"], - baseStats: {hp: 85, atk: 75, def: 110, spa: 100, spd: 75, spe: 35}, - abilities: {0: "Water Compaction", H: "Sand Veil"}, + baseStats: { hp: 85, atk: 75, def: 110, spa: 100, spd: 75, spe: 35 }, + abilities: { 0: "Water Compaction", H: "Sand Veil" }, heightm: 1.3, weightkg: 250, color: "Brown", @@ -13729,8 +13729,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 771, name: "Pyukumuku", types: ["Water"], - baseStats: {hp: 55, atk: 60, def: 130, spa: 30, spd: 130, spe: 5}, - abilities: {0: "Innards Out", H: "Unaware"}, + baseStats: { hp: 55, atk: 60, def: 130, spa: 30, spd: 130, spe: 5 }, + abilities: { 0: "Innards Out", H: "Unaware" }, heightm: 0.3, weightkg: 1.2, color: "Black", @@ -13741,8 +13741,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Type: Null", types: ["Normal"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 59}, - abilities: {0: "Battle Armor"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 59 }, + abilities: { 0: "Battle Armor" }, heightm: 1.9, weightkg: 120.5, color: "Gray", @@ -13755,8 +13755,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Silvally", types: ["Normal"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13777,8 +13777,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Bug", types: ["Bug"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13793,8 +13793,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Dark", types: ["Dark"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13809,8 +13809,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Dragon", types: ["Dragon"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13825,8 +13825,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Electric", types: ["Electric"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13841,8 +13841,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Fairy", types: ["Fairy"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13857,8 +13857,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Fighting", types: ["Fighting"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13873,8 +13873,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Fire", types: ["Fire"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13889,8 +13889,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Flying", types: ["Flying"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13905,8 +13905,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ghost", types: ["Ghost"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13921,8 +13921,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Grass", types: ["Grass"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13937,8 +13937,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ground", types: ["Ground"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13953,8 +13953,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ice", types: ["Ice"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13969,8 +13969,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Poison", types: ["Poison"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -13985,8 +13985,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Psychic", types: ["Psychic"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -14001,8 +14001,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Rock", types: ["Rock"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -14017,8 +14017,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Steel", types: ["Steel"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -14033,8 +14033,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Water", types: ["Water"], gender: "N", - baseStats: {hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95}, - abilities: {0: "RKS System"}, + baseStats: { hp: 95, atk: 95, def: 95, spa: 95, spd: 95, spe: 95 }, + abilities: { 0: "RKS System" }, heightm: 2.3, weightkg: 100.5, color: "Gray", @@ -14048,8 +14048,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Red", types: ["Rock", "Flying"], gender: "N", - baseStats: {hp: 60, atk: 100, def: 60, spa: 100, spd: 60, spe: 120}, - abilities: {0: "Shields Down"}, + baseStats: { hp: 60, atk: 100, def: 60, spa: 100, spd: 60, spe: 120 }, + abilities: { 0: "Shields Down" }, heightm: 0.3, weightkg: 0.3, color: "Red", @@ -14057,7 +14057,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { otherFormes: ["Minior-Meteor"], cosmeticFormes: ["Minior-Orange", "Minior-Yellow", "Minior-Green", "Minior-Blue", "Minior-Indigo", "Minior-Violet"], formeOrder: [ - // All of the colored Minior Meteor formes (unsupported by PS) are numbers 0-6 + // All of the colored Minior Meteor formes (unsupported by PS) are numbers 0-6 "Minior-Meteor", "Minior-Meteor", "Minior-Meteor", "Minior-Meteor", "Minior-Meteor", "Minior-Meteor", "Minior-Meteor", "Minior", "Minior-Orange", "Minior-Yellow", "Minior-Green", "Minior-Blue", "Minior-Indigo", "Minior-Violet", ], @@ -14069,8 +14069,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Meteor", types: ["Rock", "Flying"], gender: "N", - baseStats: {hp: 60, atk: 60, def: 100, spa: 60, spd: 100, spe: 60}, - abilities: {0: "Shields Down"}, + baseStats: { hp: 60, atk: 60, def: 100, spa: 60, spd: 100, spe: 60 }, + abilities: { 0: "Shields Down" }, heightm: 0.3, weightkg: 40, color: "Brown", @@ -14082,8 +14082,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 775, name: "Komala", types: ["Normal"], - baseStats: {hp: 65, atk: 115, def: 65, spa: 75, spd: 95, spe: 65}, - abilities: {0: "Comatose"}, + baseStats: { hp: 65, atk: 115, def: 65, spa: 75, spd: 95, spe: 65 }, + abilities: { 0: "Comatose" }, heightm: 0.4, weightkg: 19.9, color: "Blue", @@ -14093,8 +14093,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 776, name: "Turtonator", types: ["Fire", "Dragon"], - baseStats: {hp: 60, atk: 78, def: 135, spa: 91, spd: 85, spe: 36}, - abilities: {0: "Shell Armor"}, + baseStats: { hp: 60, atk: 78, def: 135, spa: 91, spd: 85, spe: 36 }, + abilities: { 0: "Shell Armor" }, heightm: 2, weightkg: 212, color: "Red", @@ -14104,8 +14104,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 777, name: "Togedemaru", types: ["Electric", "Steel"], - baseStats: {hp: 65, atk: 98, def: 63, spa: 40, spd: 73, spe: 96}, - abilities: {0: "Iron Barbs", 1: "Lightning Rod", H: "Sturdy"}, + baseStats: { hp: 65, atk: 98, def: 63, spa: 40, spd: 73, spe: 96 }, + abilities: { 0: "Iron Barbs", 1: "Lightning Rod", H: "Sturdy" }, heightm: 0.3, weightkg: 3.3, color: "Gray", @@ -14119,8 +14119,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Togedemaru", forme: "Totem", types: ["Electric", "Steel"], - baseStats: {hp: 65, atk: 98, def: 63, spa: 40, spd: 73, spe: 96}, - abilities: {0: "Sturdy"}, + baseStats: { hp: 65, atk: 98, def: 63, spa: 40, spd: 73, spe: 96 }, + abilities: { 0: "Sturdy" }, heightm: 0.6, weightkg: 13, color: "Gray", @@ -14131,8 +14131,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Mimikyu", baseForme: "Disguised", types: ["Ghost", "Fairy"], - baseStats: {hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96}, - abilities: {0: "Disguise"}, + baseStats: { hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96 }, + abilities: { 0: "Disguise" }, heightm: 0.2, weightkg: 0.7, color: "Yellow", @@ -14146,8 +14146,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Mimikyu", forme: "Busted", types: ["Ghost", "Fairy"], - baseStats: {hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96}, - abilities: {0: "Disguise"}, + baseStats: { hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96 }, + abilities: { 0: "Disguise" }, heightm: 0.2, weightkg: 0.7, color: "Yellow", @@ -14161,8 +14161,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Mimikyu", forme: "Totem", types: ["Ghost", "Fairy"], - baseStats: {hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96}, - abilities: {0: "Disguise"}, + baseStats: { hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96 }, + abilities: { 0: "Disguise" }, heightm: 0.4, weightkg: 2.8, color: "Yellow", @@ -14174,8 +14174,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Mimikyu", forme: "Busted-Totem", types: ["Ghost", "Fairy"], - baseStats: {hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96}, - abilities: {0: "Disguise"}, + baseStats: { hp: 55, atk: 90, def: 80, spa: 50, spd: 105, spe: 96 }, + abilities: { 0: "Disguise" }, heightm: 0.4, weightkg: 2.8, color: "Yellow", @@ -14187,8 +14187,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 779, name: "Bruxish", types: ["Water", "Psychic"], - baseStats: {hp: 68, atk: 105, def: 70, spa: 70, spd: 70, spe: 92}, - abilities: {0: "Dazzling", 1: "Strong Jaw", H: "Wonder Skin"}, + baseStats: { hp: 68, atk: 105, def: 70, spa: 70, spd: 70, spe: 92 }, + abilities: { 0: "Dazzling", 1: "Strong Jaw", H: "Wonder Skin" }, heightm: 0.9, weightkg: 19, color: "Pink", @@ -14198,8 +14198,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 780, name: "Drampa", types: ["Normal", "Dragon"], - baseStats: {hp: 78, atk: 60, def: 85, spa: 135, spd: 91, spe: 36}, - abilities: {0: "Berserk", 1: "Sap Sipper", H: "Cloud Nine"}, + baseStats: { hp: 78, atk: 60, def: 85, spa: 135, spd: 91, spe: 36 }, + abilities: { 0: "Berserk", 1: "Sap Sipper", H: "Cloud Nine" }, heightm: 3, weightkg: 185, color: "White", @@ -14210,8 +14210,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Dhelmise", types: ["Ghost", "Grass"], gender: "N", - baseStats: {hp: 70, atk: 131, def: 100, spa: 86, spd: 90, spe: 40}, - abilities: {0: "Steelworker"}, + baseStats: { hp: 70, atk: 131, def: 100, spa: 86, spd: 90, spe: 40 }, + abilities: { 0: "Steelworker" }, heightm: 3.9, weightkg: 210, color: "Green", @@ -14221,8 +14221,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 782, name: "Jangmo-o", types: ["Dragon"], - baseStats: {hp: 45, atk: 55, def: 65, spa: 45, spd: 45, spe: 45}, - abilities: {0: "Bulletproof", 1: "Soundproof", H: "Overcoat"}, + baseStats: { hp: 45, atk: 55, def: 65, spa: 45, spd: 45, spe: 45 }, + abilities: { 0: "Bulletproof", 1: "Soundproof", H: "Overcoat" }, heightm: 0.6, weightkg: 29.7, color: "Gray", @@ -14233,8 +14233,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 783, name: "Hakamo-o", types: ["Dragon", "Fighting"], - baseStats: {hp: 55, atk: 75, def: 90, spa: 65, spd: 70, spe: 65}, - abilities: {0: "Bulletproof", 1: "Soundproof", H: "Overcoat"}, + baseStats: { hp: 55, atk: 75, def: 90, spa: 65, spd: 70, spe: 65 }, + abilities: { 0: "Bulletproof", 1: "Soundproof", H: "Overcoat" }, heightm: 1.2, weightkg: 47, color: "Gray", @@ -14247,8 +14247,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 784, name: "Kommo-o", types: ["Dragon", "Fighting"], - baseStats: {hp: 75, atk: 110, def: 125, spa: 100, spd: 105, spe: 85}, - abilities: {0: "Bulletproof", 1: "Soundproof", H: "Overcoat"}, + baseStats: { hp: 75, atk: 110, def: 125, spa: 100, spd: 105, spe: 85 }, + abilities: { 0: "Bulletproof", 1: "Soundproof", H: "Overcoat" }, heightm: 1.6, weightkg: 78.2, color: "Gray", @@ -14264,8 +14264,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Kommo-o", forme: "Totem", types: ["Dragon", "Fighting"], - baseStats: {hp: 75, atk: 110, def: 125, spa: 100, spd: 105, spe: 85}, - abilities: {0: "Overcoat"}, + baseStats: { hp: 75, atk: 110, def: 125, spa: 100, spd: 105, spe: 85 }, + abilities: { 0: "Overcoat" }, heightm: 2.4, weightkg: 207.5, color: "Gray", @@ -14276,8 +14276,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tapu Koko", types: ["Electric", "Fairy"], gender: "N", - baseStats: {hp: 70, atk: 115, def: 85, spa: 95, spd: 75, spe: 130}, - abilities: {0: "Electric Surge", H: "Telepathy"}, + baseStats: { hp: 70, atk: 115, def: 85, spa: 95, spd: 75, spe: 130 }, + abilities: { 0: "Electric Surge", H: "Telepathy" }, heightm: 1.8, weightkg: 20.5, color: "Yellow", @@ -14289,8 +14289,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tapu Lele", types: ["Psychic", "Fairy"], gender: "N", - baseStats: {hp: 70, atk: 85, def: 75, spa: 130, spd: 115, spe: 95}, - abilities: {0: "Psychic Surge", H: "Telepathy"}, + baseStats: { hp: 70, atk: 85, def: 75, spa: 130, spd: 115, spe: 95 }, + abilities: { 0: "Psychic Surge", H: "Telepathy" }, heightm: 1.2, weightkg: 18.6, color: "Pink", @@ -14302,8 +14302,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tapu Bulu", types: ["Grass", "Fairy"], gender: "N", - baseStats: {hp: 70, atk: 130, def: 115, spa: 85, spd: 95, spe: 75}, - abilities: {0: "Grassy Surge", H: "Telepathy"}, + baseStats: { hp: 70, atk: 130, def: 115, spa: 85, spd: 95, spe: 75 }, + abilities: { 0: "Grassy Surge", H: "Telepathy" }, heightm: 1.9, weightkg: 45.5, color: "Red", @@ -14315,8 +14315,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tapu Fini", types: ["Water", "Fairy"], gender: "N", - baseStats: {hp: 70, atk: 75, def: 115, spa: 95, spd: 130, spe: 85}, - abilities: {0: "Misty Surge", H: "Telepathy"}, + baseStats: { hp: 70, atk: 75, def: 115, spa: 95, spd: 130, spe: 85 }, + abilities: { 0: "Misty Surge", H: "Telepathy" }, heightm: 1.3, weightkg: 21.2, color: "Purple", @@ -14328,8 +14328,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Cosmog", types: ["Psychic"], gender: "N", - baseStats: {hp: 43, atk: 29, def: 31, spa: 29, spd: 31, spe: 37}, - abilities: {0: "Unaware"}, + baseStats: { hp: 43, atk: 29, def: 31, spa: 29, spd: 31, spe: 37 }, + abilities: { 0: "Unaware" }, heightm: 0.2, weightkg: 0.1, color: "Blue", @@ -14342,8 +14342,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Cosmoem", types: ["Psychic"], gender: "N", - baseStats: {hp: 43, atk: 29, def: 131, spa: 29, spd: 131, spe: 37}, - abilities: {0: "Sturdy"}, + baseStats: { hp: 43, atk: 29, def: 131, spa: 29, spd: 131, spe: 37 }, + abilities: { 0: "Sturdy" }, heightm: 0.1, weightkg: 999.9, color: "Blue", @@ -14358,8 +14358,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Solgaleo", types: ["Psychic", "Steel"], gender: "N", - baseStats: {hp: 137, atk: 137, def: 107, spa: 113, spd: 89, spe: 97}, - abilities: {0: "Full Metal Body"}, + baseStats: { hp: 137, atk: 137, def: 107, spa: 113, spd: 89, spe: 97 }, + abilities: { 0: "Full Metal Body" }, heightm: 3.4, weightkg: 230, color: "White", @@ -14373,8 +14373,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Lunala", types: ["Psychic", "Ghost"], gender: "N", - baseStats: {hp: 137, atk: 113, def: 89, spa: 137, spd: 107, spe: 97}, - abilities: {0: "Shadow Shield"}, + baseStats: { hp: 137, atk: 113, def: 89, spa: 137, spd: 107, spe: 97 }, + abilities: { 0: "Shadow Shield" }, heightm: 4, weightkg: 120, color: "Purple", @@ -14388,8 +14388,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Nihilego", types: ["Rock", "Poison"], gender: "N", - baseStats: {hp: 109, atk: 53, def: 47, spa: 127, spd: 131, spe: 103}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 109, atk: 53, def: 47, spa: 127, spd: 131, spe: 103 }, + abilities: { 0: "Beast Boost" }, heightm: 1.2, weightkg: 55.5, color: "White", @@ -14401,8 +14401,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Buzzwole", types: ["Bug", "Fighting"], gender: "N", - baseStats: {hp: 107, atk: 139, def: 139, spa: 53, spd: 53, spe: 79}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 107, atk: 139, def: 139, spa: 53, spd: 53, spe: 79 }, + abilities: { 0: "Beast Boost" }, heightm: 2.4, weightkg: 333.6, color: "Red", @@ -14414,8 +14414,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pheromosa", types: ["Bug", "Fighting"], gender: "N", - baseStats: {hp: 71, atk: 137, def: 37, spa: 137, spd: 37, spe: 151}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 71, atk: 137, def: 37, spa: 137, spd: 37, spe: 151 }, + abilities: { 0: "Beast Boost" }, heightm: 1.8, weightkg: 25, color: "White", @@ -14427,8 +14427,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Xurkitree", types: ["Electric"], gender: "N", - baseStats: {hp: 83, atk: 89, def: 71, spa: 173, spd: 71, spe: 83}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 83, atk: 89, def: 71, spa: 173, spd: 71, spe: 83 }, + abilities: { 0: "Beast Boost" }, heightm: 3.8, weightkg: 100, color: "Black", @@ -14440,8 +14440,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Celesteela", types: ["Steel", "Flying"], gender: "N", - baseStats: {hp: 97, atk: 101, def: 103, spa: 107, spd: 101, spe: 61}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 97, atk: 101, def: 103, spa: 107, spd: 101, spe: 61 }, + abilities: { 0: "Beast Boost" }, heightm: 9.2, weightkg: 999.9, color: "Green", @@ -14453,8 +14453,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Kartana", types: ["Grass", "Steel"], gender: "N", - baseStats: {hp: 59, atk: 181, def: 131, spa: 59, spd: 31, spe: 109}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 59, atk: 181, def: 131, spa: 59, spd: 31, spe: 109 }, + abilities: { 0: "Beast Boost" }, heightm: 0.3, weightkg: 0.1, color: "White", @@ -14466,8 +14466,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Guzzlord", types: ["Dark", "Dragon"], gender: "N", - baseStats: {hp: 223, atk: 101, def: 53, spa: 97, spd: 53, spe: 43}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 223, atk: 101, def: 53, spa: 97, spd: 53, spe: 43 }, + abilities: { 0: "Beast Boost" }, heightm: 5.5, weightkg: 888, color: "Black", @@ -14479,8 +14479,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Necrozma", types: ["Psychic"], gender: "N", - baseStats: {hp: 97, atk: 107, def: 101, spa: 127, spd: 89, spe: 79}, - abilities: {0: "Prism Armor"}, + baseStats: { hp: 97, atk: 107, def: 101, spa: 127, spd: 89, spe: 79 }, + abilities: { 0: "Prism Armor" }, heightm: 2.4, weightkg: 230, color: "Black", @@ -14496,8 +14496,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Dusk-Mane", types: ["Psychic", "Steel"], gender: "N", - baseStats: {hp: 97, atk: 157, def: 127, spa: 113, spd: 109, spe: 77}, - abilities: {0: "Prism Armor"}, + baseStats: { hp: 97, atk: 157, def: 127, spa: 113, spd: 109, spe: 77 }, + abilities: { 0: "Prism Armor" }, heightm: 3.8, weightkg: 460, color: "Yellow", @@ -14511,8 +14511,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Dawn-Wings", types: ["Psychic", "Ghost"], gender: "N", - baseStats: {hp: 97, atk: 113, def: 109, spa: 157, spd: 127, spe: 77}, - abilities: {0: "Prism Armor"}, + baseStats: { hp: 97, atk: 113, def: 109, spa: 157, spd: 127, spe: 77 }, + abilities: { 0: "Prism Armor" }, heightm: 4.2, weightkg: 350, color: "Blue", @@ -14526,8 +14526,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ultra", types: ["Psychic", "Dragon"], gender: "N", - baseStats: {hp: 97, atk: 167, def: 97, spa: 167, spd: 97, spe: 129}, - abilities: {0: "Neuroforce"}, + baseStats: { hp: 97, atk: 167, def: 97, spa: 167, spd: 97, spe: 129 }, + abilities: { 0: "Neuroforce" }, heightm: 7.5, weightkg: 230, color: "Yellow", @@ -14540,8 +14540,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Magearna", types: ["Steel", "Fairy"], gender: "N", - baseStats: {hp: 80, atk: 95, def: 115, spa: 130, spd: 115, spe: 65}, - abilities: {0: "Soul-Heart"}, + baseStats: { hp: 80, atk: 95, def: 115, spa: 130, spd: 115, spe: 65 }, + abilities: { 0: "Soul-Heart" }, heightm: 1, weightkg: 80.5, color: "Gray", @@ -14557,8 +14557,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Original", types: ["Steel", "Fairy"], gender: "N", - baseStats: {hp: 80, atk: 95, def: 115, spa: 130, spd: 115, spe: 65}, - abilities: {0: "Soul-Heart"}, + baseStats: { hp: 80, atk: 95, def: 115, spa: 130, spd: 115, spe: 65 }, + abilities: { 0: "Soul-Heart" }, heightm: 1, weightkg: 80.5, color: "Red", @@ -14569,8 +14569,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Marshadow", types: ["Fighting", "Ghost"], gender: "N", - baseStats: {hp: 90, atk: 125, def: 80, spa: 90, spd: 90, spe: 125}, - abilities: {0: "Technician"}, + baseStats: { hp: 90, atk: 125, def: 80, spa: 90, spd: 90, spe: 125 }, + abilities: { 0: "Technician" }, heightm: 0.7, weightkg: 22.2, color: "Gray", @@ -14582,8 +14582,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Poipole", types: ["Poison"], gender: "N", - baseStats: {hp: 67, atk: 73, def: 67, spa: 73, spd: 67, spe: 73}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 67, atk: 73, def: 67, spa: 73, spd: 67, spe: 73 }, + abilities: { 0: "Beast Boost" }, heightm: 0.6, weightkg: 1.8, color: "Purple", @@ -14596,8 +14596,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Naganadel", types: ["Poison", "Dragon"], gender: "N", - baseStats: {hp: 73, atk: 73, def: 73, spa: 127, spd: 73, spe: 121}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 73, atk: 73, def: 73, spa: 127, spd: 73, spe: 121 }, + abilities: { 0: "Beast Boost" }, heightm: 3.6, weightkg: 150, color: "Purple", @@ -14612,8 +14612,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Stakataka", types: ["Rock", "Steel"], gender: "N", - baseStats: {hp: 61, atk: 131, def: 211, spa: 53, spd: 101, spe: 13}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 61, atk: 131, def: 211, spa: 53, spd: 101, spe: 13 }, + abilities: { 0: "Beast Boost" }, heightm: 5.5, weightkg: 820, color: "Gray", @@ -14625,8 +14625,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Blacephalon", types: ["Fire", "Ghost"], gender: "N", - baseStats: {hp: 53, atk: 127, def: 53, spa: 151, spd: 79, spe: 107}, - abilities: {0: "Beast Boost"}, + baseStats: { hp: 53, atk: 127, def: 53, spa: 151, spd: 79, spe: 107 }, + abilities: { 0: "Beast Boost" }, heightm: 1.8, weightkg: 13, color: "White", @@ -14638,8 +14638,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Zeraora", types: ["Electric"], gender: "N", - baseStats: {hp: 88, atk: 112, def: 75, spa: 102, spd: 80, spe: 143}, - abilities: {0: "Volt Absorb"}, + baseStats: { hp: 88, atk: 112, def: 75, spa: 102, spd: 80, spe: 143 }, + abilities: { 0: "Volt Absorb" }, heightm: 1.5, weightkg: 44.5, color: "Yellow", @@ -14651,8 +14651,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Meltan", types: ["Steel"], gender: "N", - baseStats: {hp: 46, atk: 65, def: 65, spa: 55, spd: 35, spe: 34}, - abilities: {0: "Magnet Pull"}, + baseStats: { hp: 46, atk: 65, def: 65, spa: 55, spd: 35, spe: 34 }, + abilities: { 0: "Magnet Pull" }, heightm: 0.2, weightkg: 8, color: "Gray", @@ -14664,8 +14664,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Melmetal", types: ["Steel"], gender: "N", - baseStats: {hp: 135, atk: 143, def: 143, spa: 80, spd: 65, spe: 34}, - abilities: {0: "Iron Fist"}, + baseStats: { hp: 135, atk: 143, def: 143, spa: 80, spd: 65, spe: 34 }, + abilities: { 0: "Iron Fist" }, heightm: 2.5, weightkg: 800, color: "Gray", @@ -14680,8 +14680,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Gmax", types: ["Steel"], gender: "N", - baseStats: {hp: 135, atk: 143, def: 143, spa: 80, spd: 65, spe: 34}, - abilities: {0: "Iron Fist"}, + baseStats: { hp: 135, atk: 143, def: 143, spa: 80, spd: 65, spe: 34 }, + abilities: { 0: "Iron Fist" }, heightm: 25, weightkg: 0, color: "Gray", @@ -14692,9 +14692,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 810, name: "Grookey", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 65, def: 50, spa: 40, spd: 40, spe: 65}, - abilities: {0: "Overgrow", H: "Grassy Surge"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 65, def: 50, spa: 40, spd: 40, spe: 65 }, + abilities: { 0: "Overgrow", H: "Grassy Surge" }, heightm: 0.3, weightkg: 5, color: "Green", @@ -14705,9 +14705,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 811, name: "Thwackey", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 85, def: 70, spa: 55, spd: 60, spe: 80}, - abilities: {0: "Overgrow", H: "Grassy Surge"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 85, def: 70, spa: 55, spd: 60, spe: 80 }, + abilities: { 0: "Overgrow", H: "Grassy Surge" }, heightm: 0.7, weightkg: 14, color: "Green", @@ -14720,9 +14720,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 812, name: "Rillaboom", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 125, def: 90, spa: 60, spd: 70, spe: 85}, - abilities: {0: "Overgrow", H: "Grassy Surge"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 125, def: 90, spa: 60, spd: 70, spe: 85 }, + abilities: { 0: "Overgrow", H: "Grassy Surge" }, heightm: 2.1, weightkg: 90, color: "Green", @@ -14737,9 +14737,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Rillaboom", forme: "Gmax", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 125, def: 90, spa: 60, spd: 70, spe: 85}, - abilities: {0: "Overgrow", H: "Grassy Surge"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 125, def: 90, spa: 60, spd: 70, spe: 85 }, + abilities: { 0: "Overgrow", H: "Grassy Surge" }, heightm: 28, weightkg: 0, color: "Green", @@ -14750,9 +14750,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 813, name: "Scorbunny", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 71, def: 40, spa: 40, spd: 40, spe: 69}, - abilities: {0: "Blaze", H: "Libero"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 71, def: 40, spa: 40, spd: 40, spe: 69 }, + abilities: { 0: "Blaze", H: "Libero" }, heightm: 0.3, weightkg: 4.5, color: "White", @@ -14763,9 +14763,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 814, name: "Raboot", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 86, def: 60, spa: 55, spd: 60, spe: 94}, - abilities: {0: "Blaze", H: "Libero"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 86, def: 60, spa: 55, spd: 60, spe: 94 }, + abilities: { 0: "Blaze", H: "Libero" }, heightm: 0.6, weightkg: 9, color: "Gray", @@ -14778,9 +14778,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 815, name: "Cinderace", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 116, def: 75, spa: 65, spd: 75, spe: 119}, - abilities: {0: "Blaze", H: "Libero"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 116, def: 75, spa: 65, spd: 75, spe: 119 }, + abilities: { 0: "Blaze", H: "Libero" }, heightm: 1.4, weightkg: 33, color: "White", @@ -14795,9 +14795,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Cinderace", forme: "Gmax", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 80, atk: 116, def: 75, spa: 65, spd: 75, spe: 119}, - abilities: {0: "Blaze", H: "Libero"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 80, atk: 116, def: 75, spa: 65, spd: 75, spe: 119 }, + abilities: { 0: "Blaze", H: "Libero" }, heightm: 27, weightkg: 0, color: "White", @@ -14808,9 +14808,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 816, name: "Sobble", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 50, atk: 40, def: 40, spa: 70, spd: 40, spe: 70}, - abilities: {0: "Torrent", H: "Sniper"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 50, atk: 40, def: 40, spa: 70, spd: 40, spe: 70 }, + abilities: { 0: "Torrent", H: "Sniper" }, heightm: 0.3, weightkg: 4, color: "Blue", @@ -14821,9 +14821,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 817, name: "Drizzile", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 65, atk: 60, def: 55, spa: 95, spd: 55, spe: 90}, - abilities: {0: "Torrent", H: "Sniper"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 65, atk: 60, def: 55, spa: 95, spd: 55, spe: 90 }, + abilities: { 0: "Torrent", H: "Sniper" }, heightm: 0.7, weightkg: 11.5, color: "Blue", @@ -14836,9 +14836,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 818, name: "Inteleon", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 85, def: 65, spa: 125, spd: 65, spe: 120}, - abilities: {0: "Torrent", H: "Sniper"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 85, def: 65, spa: 125, spd: 65, spe: 120 }, + abilities: { 0: "Torrent", H: "Sniper" }, heightm: 1.9, weightkg: 45.2, color: "Blue", @@ -14853,9 +14853,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Inteleon", forme: "Gmax", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 85, def: 65, spa: 125, spd: 65, spe: 120}, - abilities: {0: "Torrent", H: "Sniper"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 85, def: 65, spa: 125, spd: 65, spe: 120 }, + abilities: { 0: "Torrent", H: "Sniper" }, heightm: 40, weightkg: 0, color: "Blue", @@ -14866,8 +14866,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 819, name: "Skwovet", types: ["Normal"], - baseStats: {hp: 70, atk: 55, def: 55, spa: 35, spd: 35, spe: 25}, - abilities: {0: "Cheek Pouch", H: "Gluttony"}, + baseStats: { hp: 70, atk: 55, def: 55, spa: 35, spd: 35, spe: 25 }, + abilities: { 0: "Cheek Pouch", H: "Gluttony" }, heightm: 0.3, weightkg: 2.5, color: "Brown", @@ -14878,8 +14878,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 820, name: "Greedent", types: ["Normal"], - baseStats: {hp: 120, atk: 95, def: 95, spa: 55, spd: 75, spe: 20}, - abilities: {0: "Cheek Pouch", H: "Gluttony"}, + baseStats: { hp: 120, atk: 95, def: 95, spa: 55, spd: 75, spe: 20 }, + abilities: { 0: "Cheek Pouch", H: "Gluttony" }, heightm: 0.6, weightkg: 6, color: "Brown", @@ -14891,8 +14891,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 821, name: "Rookidee", types: ["Flying"], - baseStats: {hp: 38, atk: 47, def: 35, spa: 33, spd: 35, spe: 57}, - abilities: {0: "Keen Eye", 1: "Unnerve", H: "Big Pecks"}, + baseStats: { hp: 38, atk: 47, def: 35, spa: 33, spd: 35, spe: 57 }, + abilities: { 0: "Keen Eye", 1: "Unnerve", H: "Big Pecks" }, heightm: 0.2, weightkg: 1.8, color: "Blue", @@ -14903,8 +14903,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 822, name: "Corvisquire", types: ["Flying"], - baseStats: {hp: 68, atk: 67, def: 55, spa: 43, spd: 55, spe: 77}, - abilities: {0: "Keen Eye", 1: "Unnerve", H: "Big Pecks"}, + baseStats: { hp: 68, atk: 67, def: 55, spa: 43, spd: 55, spe: 77 }, + abilities: { 0: "Keen Eye", 1: "Unnerve", H: "Big Pecks" }, heightm: 0.8, weightkg: 16, color: "Blue", @@ -14917,8 +14917,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 823, name: "Corviknight", types: ["Flying", "Steel"], - baseStats: {hp: 98, atk: 87, def: 105, spa: 53, spd: 85, spe: 67}, - abilities: {0: "Pressure", 1: "Unnerve", H: "Mirror Armor"}, + baseStats: { hp: 98, atk: 87, def: 105, spa: 53, spd: 85, spe: 67 }, + abilities: { 0: "Pressure", 1: "Unnerve", H: "Mirror Armor" }, heightm: 2.2, weightkg: 75, color: "Purple", @@ -14933,8 +14933,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Corviknight", forme: "Gmax", types: ["Flying", "Steel"], - baseStats: {hp: 98, atk: 87, def: 105, spa: 53, spd: 85, spe: 67}, - abilities: {0: "Pressure", 1: "Unnerve", H: "Mirror Armor"}, + baseStats: { hp: 98, atk: 87, def: 105, spa: 53, spd: 85, spe: 67 }, + abilities: { 0: "Pressure", 1: "Unnerve", H: "Mirror Armor" }, heightm: 14, weightkg: 0, color: "Purple", @@ -14945,8 +14945,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 824, name: "Blipbug", types: ["Bug"], - baseStats: {hp: 25, atk: 20, def: 20, spa: 25, spd: 45, spe: 45}, - abilities: {0: "Swarm", 1: "Compound Eyes", H: "Telepathy"}, + baseStats: { hp: 25, atk: 20, def: 20, spa: 25, spd: 45, spe: 45 }, + abilities: { 0: "Swarm", 1: "Compound Eyes", H: "Telepathy" }, heightm: 0.4, weightkg: 8, color: "Blue", @@ -14957,8 +14957,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 825, name: "Dottler", types: ["Bug", "Psychic"], - baseStats: {hp: 50, atk: 35, def: 80, spa: 50, spd: 90, spe: 30}, - abilities: {0: "Swarm", 1: "Compound Eyes", H: "Telepathy"}, + baseStats: { hp: 50, atk: 35, def: 80, spa: 50, spd: 90, spe: 30 }, + abilities: { 0: "Swarm", 1: "Compound Eyes", H: "Telepathy" }, heightm: 0.4, weightkg: 19.5, color: "Yellow", @@ -14971,8 +14971,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 826, name: "Orbeetle", types: ["Bug", "Psychic"], - baseStats: {hp: 60, atk: 45, def: 110, spa: 80, spd: 120, spe: 90}, - abilities: {0: "Swarm", 1: "Frisk", H: "Telepathy"}, + baseStats: { hp: 60, atk: 45, def: 110, spa: 80, spd: 120, spe: 90 }, + abilities: { 0: "Swarm", 1: "Frisk", H: "Telepathy" }, heightm: 0.4, weightkg: 40.8, color: "Red", @@ -14987,8 +14987,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Orbeetle", forme: "Gmax", types: ["Bug", "Psychic"], - baseStats: {hp: 60, atk: 45, def: 110, spa: 80, spd: 120, spe: 90}, - abilities: {0: "Swarm", 1: "Frisk", H: "Telepathy"}, + baseStats: { hp: 60, atk: 45, def: 110, spa: 80, spd: 120, spe: 90 }, + abilities: { 0: "Swarm", 1: "Frisk", H: "Telepathy" }, heightm: 14, weightkg: 0, color: "Red", @@ -14999,8 +14999,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 827, name: "Nickit", types: ["Dark"], - baseStats: {hp: 40, atk: 28, def: 28, spa: 47, spd: 52, spe: 50}, - abilities: {0: "Run Away", 1: "Unburden", H: "Stakeout"}, + baseStats: { hp: 40, atk: 28, def: 28, spa: 47, spd: 52, spe: 50 }, + abilities: { 0: "Run Away", 1: "Unburden", H: "Stakeout" }, heightm: 0.6, weightkg: 8.9, color: "Brown", @@ -15011,8 +15011,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 828, name: "Thievul", types: ["Dark"], - baseStats: {hp: 70, atk: 58, def: 58, spa: 87, spd: 92, spe: 90}, - abilities: {0: "Run Away", 1: "Unburden", H: "Stakeout"}, + baseStats: { hp: 70, atk: 58, def: 58, spa: 87, spd: 92, spe: 90 }, + abilities: { 0: "Run Away", 1: "Unburden", H: "Stakeout" }, heightm: 1.2, weightkg: 19.9, color: "Brown", @@ -15024,8 +15024,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 829, name: "Gossifleur", types: ["Grass"], - baseStats: {hp: 40, atk: 40, def: 60, spa: 40, spd: 60, spe: 10}, - abilities: {0: "Cotton Down", 1: "Regenerator", H: "Effect Spore"}, + baseStats: { hp: 40, atk: 40, def: 60, spa: 40, spd: 60, spe: 10 }, + abilities: { 0: "Cotton Down", 1: "Regenerator", H: "Effect Spore" }, heightm: 0.4, weightkg: 2.2, color: "Green", @@ -15036,8 +15036,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 830, name: "Eldegoss", types: ["Grass"], - baseStats: {hp: 60, atk: 50, def: 90, spa: 80, spd: 120, spe: 60}, - abilities: {0: "Cotton Down", 1: "Regenerator", H: "Effect Spore"}, + baseStats: { hp: 60, atk: 50, def: 90, spa: 80, spd: 120, spe: 60 }, + abilities: { 0: "Cotton Down", 1: "Regenerator", H: "Effect Spore" }, heightm: 0.5, weightkg: 2.5, color: "Green", @@ -15049,8 +15049,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 831, name: "Wooloo", types: ["Normal"], - baseStats: {hp: 42, atk: 40, def: 55, spa: 40, spd: 45, spe: 48}, - abilities: {0: "Fluffy", 1: "Run Away", H: "Bulletproof"}, + baseStats: { hp: 42, atk: 40, def: 55, spa: 40, spd: 45, spe: 48 }, + abilities: { 0: "Fluffy", 1: "Run Away", H: "Bulletproof" }, heightm: 0.6, weightkg: 6, color: "White", @@ -15061,8 +15061,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 832, name: "Dubwool", types: ["Normal"], - baseStats: {hp: 72, atk: 80, def: 100, spa: 60, spd: 90, spe: 88}, - abilities: {0: "Fluffy", 1: "Steadfast", H: "Bulletproof"}, + baseStats: { hp: 72, atk: 80, def: 100, spa: 60, spd: 90, spe: 88 }, + abilities: { 0: "Fluffy", 1: "Steadfast", H: "Bulletproof" }, heightm: 1.3, weightkg: 43, color: "White", @@ -15074,8 +15074,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 833, name: "Chewtle", types: ["Water"], - baseStats: {hp: 50, atk: 64, def: 50, spa: 38, spd: 38, spe: 44}, - abilities: {0: "Strong Jaw", 1: "Shell Armor", H: "Swift Swim"}, + baseStats: { hp: 50, atk: 64, def: 50, spa: 38, spd: 38, spe: 44 }, + abilities: { 0: "Strong Jaw", 1: "Shell Armor", H: "Swift Swim" }, heightm: 0.3, weightkg: 8.5, color: "Green", @@ -15086,8 +15086,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 834, name: "Drednaw", types: ["Water", "Rock"], - baseStats: {hp: 90, atk: 115, def: 90, spa: 48, spd: 68, spe: 74}, - abilities: {0: "Strong Jaw", 1: "Shell Armor", H: "Swift Swim"}, + baseStats: { hp: 90, atk: 115, def: 90, spa: 48, spd: 68, spe: 74 }, + abilities: { 0: "Strong Jaw", 1: "Shell Armor", H: "Swift Swim" }, heightm: 1, weightkg: 115.5, color: "Green", @@ -15102,8 +15102,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Drednaw", forme: "Gmax", types: ["Water", "Rock"], - baseStats: {hp: 90, atk: 115, def: 90, spa: 48, spd: 68, spe: 74}, - abilities: {0: "Strong Jaw", 1: "Shell Armor", H: "Swift Swim"}, + baseStats: { hp: 90, atk: 115, def: 90, spa: 48, spd: 68, spe: 74 }, + abilities: { 0: "Strong Jaw", 1: "Shell Armor", H: "Swift Swim" }, heightm: 24, weightkg: 0, color: "Green", @@ -15114,8 +15114,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 835, name: "Yamper", types: ["Electric"], - baseStats: {hp: 59, atk: 45, def: 50, spa: 40, spd: 50, spe: 26}, - abilities: {0: "Ball Fetch", H: "Rattled"}, + baseStats: { hp: 59, atk: 45, def: 50, spa: 40, spd: 50, spe: 26 }, + abilities: { 0: "Ball Fetch", H: "Rattled" }, heightm: 0.3, weightkg: 13.5, color: "Yellow", @@ -15126,8 +15126,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 836, name: "Boltund", types: ["Electric"], - baseStats: {hp: 69, atk: 90, def: 60, spa: 90, spd: 60, spe: 121}, - abilities: {0: "Strong Jaw", H: "Competitive"}, + baseStats: { hp: 69, atk: 90, def: 60, spa: 90, spd: 60, spe: 121 }, + abilities: { 0: "Strong Jaw", H: "Competitive" }, heightm: 1, weightkg: 34, color: "Yellow", @@ -15139,8 +15139,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 837, name: "Rolycoly", types: ["Rock"], - baseStats: {hp: 30, atk: 40, def: 50, spa: 40, spd: 50, spe: 30}, - abilities: {0: "Steam Engine", 1: "Heatproof", H: "Flash Fire"}, + baseStats: { hp: 30, atk: 40, def: 50, spa: 40, spd: 50, spe: 30 }, + abilities: { 0: "Steam Engine", 1: "Heatproof", H: "Flash Fire" }, heightm: 0.3, weightkg: 12, color: "Black", @@ -15151,8 +15151,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 838, name: "Carkol", types: ["Rock", "Fire"], - baseStats: {hp: 80, atk: 60, def: 90, spa: 60, spd: 70, spe: 50}, - abilities: {0: "Steam Engine", 1: "Flame Body", H: "Flash Fire"}, + baseStats: { hp: 80, atk: 60, def: 90, spa: 60, spd: 70, spe: 50 }, + abilities: { 0: "Steam Engine", 1: "Flame Body", H: "Flash Fire" }, heightm: 1.1, weightkg: 78, color: "Black", @@ -15165,8 +15165,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 839, name: "Coalossal", types: ["Rock", "Fire"], - baseStats: {hp: 110, atk: 80, def: 120, spa: 80, spd: 90, spe: 30}, - abilities: {0: "Steam Engine", 1: "Flame Body", H: "Flash Fire"}, + baseStats: { hp: 110, atk: 80, def: 120, spa: 80, spd: 90, spe: 30 }, + abilities: { 0: "Steam Engine", 1: "Flame Body", H: "Flash Fire" }, heightm: 2.8, weightkg: 310.5, color: "Black", @@ -15181,8 +15181,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Coalossal", forme: "Gmax", types: ["Rock", "Fire"], - baseStats: {hp: 110, atk: 80, def: 120, spa: 80, spd: 90, spe: 30}, - abilities: {0: "Steam Engine", 1: "Flame Body", H: "Flash Fire"}, + baseStats: { hp: 110, atk: 80, def: 120, spa: 80, spd: 90, spe: 30 }, + abilities: { 0: "Steam Engine", 1: "Flame Body", H: "Flash Fire" }, heightm: 42, weightkg: 0, color: "Black", @@ -15193,8 +15193,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 840, name: "Applin", types: ["Grass", "Dragon"], - baseStats: {hp: 40, atk: 40, def: 80, spa: 40, spd: 40, spe: 20}, - abilities: {0: "Ripen", 1: "Gluttony", H: "Bulletproof"}, + baseStats: { hp: 40, atk: 40, def: 80, spa: 40, spd: 40, spe: 20 }, + abilities: { 0: "Ripen", 1: "Gluttony", H: "Bulletproof" }, heightm: 0.2, weightkg: 0.5, color: "Green", @@ -15205,8 +15205,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 841, name: "Flapple", types: ["Grass", "Dragon"], - baseStats: {hp: 70, atk: 110, def: 80, spa: 95, spd: 60, spe: 70}, - abilities: {0: "Ripen", 1: "Gluttony", H: "Hustle"}, + baseStats: { hp: 70, atk: 110, def: 80, spa: 95, spd: 60, spe: 70 }, + abilities: { 0: "Ripen", 1: "Gluttony", H: "Hustle" }, heightm: 0.3, weightkg: 1, color: "Green", @@ -15222,8 +15222,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Flapple", forme: "Gmax", types: ["Grass", "Dragon"], - baseStats: {hp: 70, atk: 110, def: 80, spa: 95, spd: 60, spe: 70}, - abilities: {0: "Ripen", 1: "Gluttony", H: "Hustle"}, + baseStats: { hp: 70, atk: 110, def: 80, spa: 95, spd: 60, spe: 70 }, + abilities: { 0: "Ripen", 1: "Gluttony", H: "Hustle" }, heightm: 24, weightkg: 0, color: "Green", @@ -15234,8 +15234,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 842, name: "Appletun", types: ["Grass", "Dragon"], - baseStats: {hp: 110, atk: 85, def: 80, spa: 100, spd: 80, spe: 30}, - abilities: {0: "Ripen", 1: "Gluttony", H: "Thick Fat"}, + baseStats: { hp: 110, atk: 85, def: 80, spa: 100, spd: 80, spe: 30 }, + abilities: { 0: "Ripen", 1: "Gluttony", H: "Thick Fat" }, heightm: 0.4, weightkg: 13, color: "Green", @@ -15251,8 +15251,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Appletun", forme: "Gmax", types: ["Grass", "Dragon"], - baseStats: {hp: 110, atk: 85, def: 80, spa: 100, spd: 80, spe: 30}, - abilities: {0: "Ripen", 1: "Gluttony", H: "Thick Fat"}, + baseStats: { hp: 110, atk: 85, def: 80, spa: 100, spd: 80, spe: 30 }, + abilities: { 0: "Ripen", 1: "Gluttony", H: "Thick Fat" }, heightm: 24, weightkg: 0, color: "Green", @@ -15263,8 +15263,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 843, name: "Silicobra", types: ["Ground"], - baseStats: {hp: 52, atk: 57, def: 75, spa: 35, spd: 50, spe: 46}, - abilities: {0: "Sand Spit", 1: "Shed Skin", H: "Sand Veil"}, + baseStats: { hp: 52, atk: 57, def: 75, spa: 35, spd: 50, spe: 46 }, + abilities: { 0: "Sand Spit", 1: "Shed Skin", H: "Sand Veil" }, heightm: 2.2, weightkg: 7.6, color: "Green", @@ -15275,8 +15275,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 844, name: "Sandaconda", types: ["Ground"], - baseStats: {hp: 72, atk: 107, def: 125, spa: 65, spd: 70, spe: 71}, - abilities: {0: "Sand Spit", 1: "Shed Skin", H: "Sand Veil"}, + baseStats: { hp: 72, atk: 107, def: 125, spa: 65, spd: 70, spe: 71 }, + abilities: { 0: "Sand Spit", 1: "Shed Skin", H: "Sand Veil" }, heightm: 3.8, weightkg: 65.5, color: "Green", @@ -15291,8 +15291,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Sandaconda", forme: "Gmax", types: ["Ground"], - baseStats: {hp: 72, atk: 107, def: 125, spa: 65, spd: 70, spe: 71}, - abilities: {0: "Sand Spit", 1: "Shed Skin", H: "Sand Veil"}, + baseStats: { hp: 72, atk: 107, def: 125, spa: 65, spd: 70, spe: 71 }, + abilities: { 0: "Sand Spit", 1: "Shed Skin", H: "Sand Veil" }, heightm: 22, weightkg: 0, color: "Green", @@ -15303,8 +15303,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 845, name: "Cramorant", types: ["Flying", "Water"], - baseStats: {hp: 70, atk: 85, def: 55, spa: 85, spd: 95, spe: 85}, - abilities: {0: "Gulp Missile"}, + baseStats: { hp: 70, atk: 85, def: 55, spa: 85, spd: 95, spe: 85 }, + abilities: { 0: "Gulp Missile" }, heightm: 0.8, weightkg: 18, color: "Blue", @@ -15318,8 +15318,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Cramorant", forme: "Gulping", types: ["Flying", "Water"], - baseStats: {hp: 70, atk: 85, def: 55, spa: 85, spd: 95, spe: 85}, - abilities: {0: "Gulp Missile"}, + baseStats: { hp: 70, atk: 85, def: 55, spa: 85, spd: 95, spe: 85 }, + abilities: { 0: "Gulp Missile" }, heightm: 0.8, weightkg: 18, color: "Blue", @@ -15333,8 +15333,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Cramorant", forme: "Gorging", types: ["Flying", "Water"], - baseStats: {hp: 70, atk: 85, def: 55, spa: 85, spd: 95, spe: 85}, - abilities: {0: "Gulp Missile"}, + baseStats: { hp: 70, atk: 85, def: 55, spa: 85, spd: 95, spe: 85 }, + abilities: { 0: "Gulp Missile" }, heightm: 0.8, weightkg: 18, color: "Blue", @@ -15346,8 +15346,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 846, name: "Arrokuda", types: ["Water"], - baseStats: {hp: 41, atk: 63, def: 40, spa: 40, spd: 30, spe: 66}, - abilities: {0: "Swift Swim", H: "Propeller Tail"}, + baseStats: { hp: 41, atk: 63, def: 40, spa: 40, spd: 30, spe: 66 }, + abilities: { 0: "Swift Swim", H: "Propeller Tail" }, heightm: 0.5, weightkg: 1, color: "Brown", @@ -15358,8 +15358,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 847, name: "Barraskewda", types: ["Water"], - baseStats: {hp: 61, atk: 123, def: 60, spa: 60, spd: 50, spe: 136}, - abilities: {0: "Swift Swim", H: "Propeller Tail"}, + baseStats: { hp: 61, atk: 123, def: 60, spa: 60, spd: 50, spe: 136 }, + abilities: { 0: "Swift Swim", H: "Propeller Tail" }, heightm: 1.3, weightkg: 30, color: "Brown", @@ -15371,8 +15371,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 848, name: "Toxel", types: ["Electric", "Poison"], - baseStats: {hp: 40, atk: 38, def: 35, spa: 54, spd: 35, spe: 40}, - abilities: {0: "Rattled", 1: "Static", H: "Klutz"}, + baseStats: { hp: 40, atk: 38, def: 35, spa: 54, spd: 35, spe: 40 }, + abilities: { 0: "Rattled", 1: "Static", H: "Klutz" }, heightm: 0.4, weightkg: 11, color: "Purple", @@ -15385,8 +15385,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Toxtricity", baseForme: "Amped", types: ["Electric", "Poison"], - baseStats: {hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75}, - abilities: {0: "Punk Rock", 1: "Plus", H: "Technician"}, + baseStats: { hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75 }, + abilities: { 0: "Punk Rock", 1: "Plus", H: "Technician" }, heightm: 1.6, weightkg: 40, color: "Purple", @@ -15403,8 +15403,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Toxtricity", forme: "Low-Key", types: ["Electric", "Poison"], - baseStats: {hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75}, - abilities: {0: "Punk Rock", 1: "Minus", H: "Technician"}, + baseStats: { hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75 }, + abilities: { 0: "Punk Rock", 1: "Minus", H: "Technician" }, heightm: 1.6, weightkg: 40, color: "Purple", @@ -15419,8 +15419,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Toxtricity", forme: "Gmax", types: ["Electric", "Poison"], - baseStats: {hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75}, - abilities: {0: "Punk Rock", 1: "Plus", H: "Technician"}, + baseStats: { hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75 }, + abilities: { 0: "Punk Rock", 1: "Plus", H: "Technician" }, heightm: 24, weightkg: 0, color: "Purple", @@ -15433,8 +15433,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Toxtricity", forme: "Low-Key-Gmax", types: ["Electric", "Poison"], - baseStats: {hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75}, - abilities: {0: "Punk Rock", 1: "Minus", H: "Technician"}, + baseStats: { hp: 75, atk: 98, def: 70, spa: 114, spd: 70, spe: 75 }, + abilities: { 0: "Punk Rock", 1: "Minus", H: "Technician" }, heightm: 24, weightkg: 0, color: "Purple", @@ -15446,8 +15446,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 850, name: "Sizzlipede", types: ["Fire", "Bug"], - baseStats: {hp: 50, atk: 65, def: 45, spa: 50, spd: 50, spe: 45}, - abilities: {0: "Flash Fire", 1: "White Smoke", H: "Flame Body"}, + baseStats: { hp: 50, atk: 65, def: 45, spa: 50, spd: 50, spe: 45 }, + abilities: { 0: "Flash Fire", 1: "White Smoke", H: "Flame Body" }, heightm: 0.7, weightkg: 1, color: "Red", @@ -15458,8 +15458,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 851, name: "Centiskorch", types: ["Fire", "Bug"], - baseStats: {hp: 100, atk: 115, def: 65, spa: 90, spd: 90, spe: 65}, - abilities: {0: "Flash Fire", 1: "White Smoke", H: "Flame Body"}, + baseStats: { hp: 100, atk: 115, def: 65, spa: 90, spd: 90, spe: 65 }, + abilities: { 0: "Flash Fire", 1: "White Smoke", H: "Flame Body" }, heightm: 3, weightkg: 120, color: "Red", @@ -15474,8 +15474,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Centiskorch", forme: "Gmax", types: ["Fire", "Bug"], - baseStats: {hp: 100, atk: 115, def: 65, spa: 90, spd: 90, spe: 65}, - abilities: {0: "Flash Fire", 1: "White Smoke", H: "Flame Body"}, + baseStats: { hp: 100, atk: 115, def: 65, spa: 90, spd: 90, spe: 65 }, + abilities: { 0: "Flash Fire", 1: "White Smoke", H: "Flame Body" }, heightm: 75, weightkg: 0, color: "Red", @@ -15486,8 +15486,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 852, name: "Clobbopus", types: ["Fighting"], - baseStats: {hp: 50, atk: 68, def: 60, spa: 50, spd: 50, spe: 32}, - abilities: {0: "Limber", H: "Technician"}, + baseStats: { hp: 50, atk: 68, def: 60, spa: 50, spd: 50, spe: 32 }, + abilities: { 0: "Limber", H: "Technician" }, heightm: 0.6, weightkg: 4, color: "Brown", @@ -15498,8 +15498,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 853, name: "Grapploct", types: ["Fighting"], - baseStats: {hp: 80, atk: 118, def: 90, spa: 70, spd: 80, spe: 42}, - abilities: {0: "Limber", H: "Technician"}, + baseStats: { hp: 80, atk: 118, def: 90, spa: 70, spd: 80, spe: 42 }, + abilities: { 0: "Limber", H: "Technician" }, heightm: 1.6, weightkg: 39, color: "Blue", @@ -15514,8 +15514,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Phony", types: ["Ghost"], gender: "N", - baseStats: {hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50}, - abilities: {0: "Weak Armor", H: "Cursed Body"}, + baseStats: { hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50 }, + abilities: { 0: "Weak Armor", H: "Cursed Body" }, heightm: 0.1, weightkg: 0.2, color: "Purple", @@ -15531,8 +15531,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Antique", types: ["Ghost"], gender: "N", - baseStats: {hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50}, - abilities: {0: "Weak Armor", H: "Cursed Body"}, + baseStats: { hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50 }, + abilities: { 0: "Weak Armor", H: "Cursed Body" }, heightm: 0.1, weightkg: 0.2, color: "Purple", @@ -15545,8 +15545,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Phony", types: ["Ghost"], gender: "N", - baseStats: {hp: 60, atk: 65, def: 65, spa: 134, spd: 114, spe: 70}, - abilities: {0: "Weak Armor", H: "Cursed Body"}, + baseStats: { hp: 60, atk: 65, def: 65, spa: 134, spd: 114, spe: 70 }, + abilities: { 0: "Weak Armor", H: "Cursed Body" }, heightm: 0.2, weightkg: 0.4, color: "Purple", @@ -15564,8 +15564,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Antique", types: ["Ghost"], gender: "N", - baseStats: {hp: 60, atk: 65, def: 65, spa: 134, spd: 114, spe: 70}, - abilities: {0: "Weak Armor", H: "Cursed Body"}, + baseStats: { hp: 60, atk: 65, def: 65, spa: 134, spd: 114, spe: 70 }, + abilities: { 0: "Weak Armor", H: "Cursed Body" }, heightm: 0.2, weightkg: 0.4, color: "Purple", @@ -15579,8 +15579,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Hatenna", types: ["Psychic"], gender: "F", - baseStats: {hp: 42, atk: 30, def: 45, spa: 56, spd: 53, spe: 39}, - abilities: {0: "Healer", 1: "Anticipation", H: "Magic Bounce"}, + baseStats: { hp: 42, atk: 30, def: 45, spa: 56, spd: 53, spe: 39 }, + abilities: { 0: "Healer", 1: "Anticipation", H: "Magic Bounce" }, heightm: 0.4, weightkg: 3.4, color: "Pink", @@ -15592,8 +15592,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Hattrem", types: ["Psychic"], gender: "F", - baseStats: {hp: 57, atk: 40, def: 65, spa: 86, spd: 73, spe: 49}, - abilities: {0: "Healer", 1: "Anticipation", H: "Magic Bounce"}, + baseStats: { hp: 57, atk: 40, def: 65, spa: 86, spd: 73, spe: 49 }, + abilities: { 0: "Healer", 1: "Anticipation", H: "Magic Bounce" }, heightm: 0.6, weightkg: 4.8, color: "Pink", @@ -15607,8 +15607,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Hatterene", types: ["Psychic", "Fairy"], gender: "F", - baseStats: {hp: 57, atk: 90, def: 95, spa: 136, spd: 103, spe: 29}, - abilities: {0: "Healer", 1: "Anticipation", H: "Magic Bounce"}, + baseStats: { hp: 57, atk: 90, def: 95, spa: 136, spd: 103, spe: 29 }, + abilities: { 0: "Healer", 1: "Anticipation", H: "Magic Bounce" }, heightm: 2.1, weightkg: 5.1, color: "Pink", @@ -15624,8 +15624,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Gmax", types: ["Psychic", "Fairy"], gender: "F", - baseStats: {hp: 57, atk: 90, def: 95, spa: 136, spd: 103, spe: 29}, - abilities: {0: "Healer", 1: "Anticipation", H: "Magic Bounce"}, + baseStats: { hp: 57, atk: 90, def: 95, spa: 136, spd: 103, spe: 29 }, + abilities: { 0: "Healer", 1: "Anticipation", H: "Magic Bounce" }, heightm: 26, weightkg: 0, color: "Pink", @@ -15637,8 +15637,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Impidimp", types: ["Dark", "Fairy"], gender: "M", - baseStats: {hp: 45, atk: 45, def: 30, spa: 55, spd: 40, spe: 50}, - abilities: {0: "Prankster", 1: "Frisk", H: "Pickpocket"}, + baseStats: { hp: 45, atk: 45, def: 30, spa: 55, spd: 40, spe: 50 }, + abilities: { 0: "Prankster", 1: "Frisk", H: "Pickpocket" }, heightm: 0.4, weightkg: 5.5, color: "Pink", @@ -15650,8 +15650,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Morgrem", types: ["Dark", "Fairy"], gender: "M", - baseStats: {hp: 65, atk: 60, def: 45, spa: 75, spd: 55, spe: 70}, - abilities: {0: "Prankster", 1: "Frisk", H: "Pickpocket"}, + baseStats: { hp: 65, atk: 60, def: 45, spa: 75, spd: 55, spe: 70 }, + abilities: { 0: "Prankster", 1: "Frisk", H: "Pickpocket" }, heightm: 0.8, weightkg: 12.5, color: "Pink", @@ -15665,8 +15665,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Grimmsnarl", types: ["Dark", "Fairy"], gender: "M", - baseStats: {hp: 95, atk: 120, def: 65, spa: 95, spd: 75, spe: 60}, - abilities: {0: "Prankster", 1: "Frisk", H: "Pickpocket"}, + baseStats: { hp: 95, atk: 120, def: 65, spa: 95, spd: 75, spe: 60 }, + abilities: { 0: "Prankster", 1: "Frisk", H: "Pickpocket" }, heightm: 1.5, weightkg: 61, color: "Purple", @@ -15682,8 +15682,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Gmax", types: ["Dark", "Fairy"], gender: "M", - baseStats: {hp: 95, atk: 120, def: 65, spa: 95, spd: 75, spe: 60}, - abilities: {0: "Prankster", 1: "Frisk", H: "Pickpocket"}, + baseStats: { hp: 95, atk: 120, def: 65, spa: 95, spd: 75, spe: 60 }, + abilities: { 0: "Prankster", 1: "Frisk", H: "Pickpocket" }, heightm: 32, weightkg: 0, color: "Purple", @@ -15694,8 +15694,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 862, name: "Obstagoon", types: ["Dark", "Normal"], - baseStats: {hp: 93, atk: 90, def: 101, spa: 60, spd: 81, spe: 95}, - abilities: {0: "Reckless", 1: "Guts", H: "Defiant"}, + baseStats: { hp: 93, atk: 90, def: 101, spa: 60, spd: 81, spe: 95 }, + abilities: { 0: "Reckless", 1: "Guts", H: "Defiant" }, heightm: 1.6, weightkg: 46, color: "Gray", @@ -15708,8 +15708,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 863, name: "Perrserker", types: ["Steel"], - baseStats: {hp: 70, atk: 110, def: 100, spa: 50, spd: 60, spe: 50}, - abilities: {0: "Battle Armor", 1: "Tough Claws", H: "Steely Spirit"}, + baseStats: { hp: 70, atk: 110, def: 100, spa: 50, spd: 60, spe: 50 }, + abilities: { 0: "Battle Armor", 1: "Tough Claws", H: "Steely Spirit" }, heightm: 0.8, weightkg: 28, color: "Brown", @@ -15721,9 +15721,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 864, name: "Cursola", types: ["Ghost"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 60, atk: 95, def: 50, spa: 145, spd: 130, spe: 30}, - abilities: {0: "Weak Armor", H: "Perish Body"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 60, atk: 95, def: 50, spa: 145, spd: 130, spe: 30 }, + abilities: { 0: "Weak Armor", H: "Perish Body" }, heightm: 1, weightkg: 0.4, color: "White", @@ -15735,8 +15735,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 865, name: "Sirfetch\u2019d", types: ["Fighting"], - baseStats: {hp: 62, atk: 135, def: 95, spa: 68, spd: 82, spe: 65}, - abilities: {0: "Steadfast", H: "Scrappy"}, + baseStats: { hp: 62, atk: 135, def: 95, spa: 68, spd: 82, spe: 65 }, + abilities: { 0: "Steadfast", H: "Scrappy" }, heightm: 0.8, weightkg: 117, color: "White", @@ -15749,8 +15749,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 866, name: "Mr. Rime", types: ["Ice", "Psychic"], - baseStats: {hp: 80, atk: 85, def: 75, spa: 110, spd: 100, spe: 70}, - abilities: {0: "Tangled Feet", 1: "Screen Cleaner", H: "Ice Body"}, + baseStats: { hp: 80, atk: 85, def: 75, spa: 110, spd: 100, spe: 70 }, + abilities: { 0: "Tangled Feet", 1: "Screen Cleaner", H: "Ice Body" }, heightm: 1.5, weightkg: 58.2, color: "Purple", @@ -15762,8 +15762,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 867, name: "Runerigus", types: ["Ground", "Ghost"], - baseStats: {hp: 58, atk: 95, def: 145, spa: 50, spd: 105, spe: 30}, - abilities: {0: "Wandering Spirit"}, + baseStats: { hp: 58, atk: 95, def: 145, spa: 50, spd: 105, spe: 30 }, + abilities: { 0: "Wandering Spirit" }, heightm: 1.6, weightkg: 66.6, color: "Gray", @@ -15777,8 +15777,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Milcery", types: ["Fairy"], gender: "F", - baseStats: {hp: 45, atk: 40, def: 40, spa: 50, spd: 61, spe: 34}, - abilities: {0: "Sweet Veil", H: "Aroma Veil"}, + baseStats: { hp: 45, atk: 40, def: 40, spa: 50, spd: 61, spe: 34 }, + abilities: { 0: "Sweet Veil", H: "Aroma Veil" }, heightm: 0.2, weightkg: 0.3, color: "White", @@ -15791,8 +15791,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Vanilla Cream", types: ["Fairy"], gender: "F", - baseStats: {hp: 65, atk: 60, def: 75, spa: 110, spd: 121, spe: 64}, - abilities: {0: "Sweet Veil", H: "Aroma Veil"}, + baseStats: { hp: 65, atk: 60, def: 75, spa: 110, spd: 121, spe: 64 }, + abilities: { 0: "Sweet Veil", H: "Aroma Veil" }, heightm: 0.3, weightkg: 0.5, color: "White", @@ -15811,8 +15811,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Gmax", types: ["Fairy"], gender: "F", - baseStats: {hp: 65, atk: 60, def: 75, spa: 110, spd: 121, spe: 64}, - abilities: {0: "Sweet Veil", H: "Aroma Veil"}, + baseStats: { hp: 65, atk: 60, def: 75, spa: 110, spd: 121, spe: 64 }, + abilities: { 0: "Sweet Veil", H: "Aroma Veil" }, heightm: 30, weightkg: 0, color: "Yellow", @@ -15824,8 +15824,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Falinks", types: ["Fighting"], gender: "N", - baseStats: {hp: 65, atk: 100, def: 100, spa: 70, spd: 60, spe: 75}, - abilities: {0: "Battle Armor", H: "Defiant"}, + baseStats: { hp: 65, atk: 100, def: 100, spa: 70, spd: 60, spe: 75 }, + abilities: { 0: "Battle Armor", H: "Defiant" }, heightm: 3, weightkg: 62, color: "Yellow", @@ -15835,8 +15835,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 871, name: "Pincurchin", types: ["Electric"], - baseStats: {hp: 48, atk: 101, def: 95, spa: 91, spd: 85, spe: 15}, - abilities: {0: "Lightning Rod", H: "Electric Surge"}, + baseStats: { hp: 48, atk: 101, def: 95, spa: 91, spd: 85, spe: 15 }, + abilities: { 0: "Lightning Rod", H: "Electric Surge" }, heightm: 0.3, weightkg: 1, color: "Purple", @@ -15846,8 +15846,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 872, name: "Snom", types: ["Ice", "Bug"], - baseStats: {hp: 30, atk: 25, def: 35, spa: 45, spd: 30, spe: 20}, - abilities: {0: "Shield Dust", H: "Ice Scales"}, + baseStats: { hp: 30, atk: 25, def: 35, spa: 45, spd: 30, spe: 20 }, + abilities: { 0: "Shield Dust", H: "Ice Scales" }, heightm: 0.3, weightkg: 3.8, color: "White", @@ -15858,8 +15858,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 873, name: "Frosmoth", types: ["Ice", "Bug"], - baseStats: {hp: 70, atk: 65, def: 60, spa: 125, spd: 90, spe: 65}, - abilities: {0: "Shield Dust", H: "Ice Scales"}, + baseStats: { hp: 70, atk: 65, def: 60, spa: 125, spd: 90, spe: 65 }, + abilities: { 0: "Shield Dust", H: "Ice Scales" }, heightm: 1.3, weightkg: 42, color: "White", @@ -15872,8 +15872,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 874, name: "Stonjourner", types: ["Rock"], - baseStats: {hp: 100, atk: 125, def: 135, spa: 20, spd: 20, spe: 70}, - abilities: {0: "Power Spot"}, + baseStats: { hp: 100, atk: 125, def: 135, spa: 20, spd: 20, spe: 70 }, + abilities: { 0: "Power Spot" }, heightm: 2.5, weightkg: 520, color: "Gray", @@ -15883,8 +15883,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 875, name: "Eiscue", types: ["Ice"], - baseStats: {hp: 75, atk: 80, def: 110, spa: 65, spd: 90, spe: 50}, - abilities: {0: "Ice Face"}, + baseStats: { hp: 75, atk: 80, def: 110, spa: 65, spd: 90, spe: 50 }, + abilities: { 0: "Ice Face" }, heightm: 1.4, weightkg: 89, color: "Blue", @@ -15898,8 +15898,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Eiscue", forme: "Noice", types: ["Ice"], - baseStats: {hp: 75, atk: 80, def: 70, spa: 65, spd: 50, spe: 130}, - abilities: {0: "Ice Face"}, + baseStats: { hp: 75, atk: 80, def: 70, spa: 65, spd: 50, spe: 130 }, + abilities: { 0: "Ice Face" }, heightm: 1.4, weightkg: 89, color: "Blue", @@ -15913,8 +15913,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "M", types: ["Psychic", "Normal"], gender: "M", - baseStats: {hp: 60, atk: 65, def: 55, spa: 105, spd: 95, spe: 95}, - abilities: {0: "Inner Focus", 1: "Synchronize", H: "Psychic Surge"}, + baseStats: { hp: 60, atk: 65, def: 55, spa: 105, spd: 95, spe: 95 }, + abilities: { 0: "Inner Focus", 1: "Synchronize", H: "Psychic Surge" }, heightm: 0.9, weightkg: 28, color: "Purple", @@ -15930,8 +15930,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "F", types: ["Psychic", "Normal"], gender: "F", - baseStats: {hp: 70, atk: 55, def: 65, spa: 95, spd: 105, spe: 85}, - abilities: {0: "Own Tempo", 1: "Synchronize", H: "Psychic Surge"}, + baseStats: { hp: 70, atk: 55, def: 65, spa: 95, spd: 105, spe: 85 }, + abilities: { 0: "Own Tempo", 1: "Synchronize", H: "Psychic Surge" }, heightm: 0.9, weightkg: 28, color: "Purple", @@ -15941,8 +15941,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 877, name: "Morpeko", types: ["Electric", "Dark"], - baseStats: {hp: 58, atk: 95, def: 58, spa: 70, spd: 58, spe: 97}, - abilities: {0: "Hunger Switch"}, + baseStats: { hp: 58, atk: 95, def: 58, spa: 70, spd: 58, spe: 97 }, + abilities: { 0: "Hunger Switch" }, heightm: 0.3, weightkg: 3, color: "Yellow", @@ -15956,8 +15956,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Morpeko", forme: "Hangry", types: ["Electric", "Dark"], - baseStats: {hp: 58, atk: 95, def: 58, spa: 70, spd: 58, spe: 97}, - abilities: {0: "Hunger Switch"}, + baseStats: { hp: 58, atk: 95, def: 58, spa: 70, spd: 58, spe: 97 }, + abilities: { 0: "Hunger Switch" }, heightm: 0.3, weightkg: 3, color: "Purple", @@ -15969,8 +15969,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 878, name: "Cufant", types: ["Steel"], - baseStats: {hp: 72, atk: 80, def: 49, spa: 40, spd: 49, spe: 40}, - abilities: {0: "Sheer Force", H: "Heavy Metal"}, + baseStats: { hp: 72, atk: 80, def: 49, spa: 40, spd: 49, spe: 40 }, + abilities: { 0: "Sheer Force", H: "Heavy Metal" }, heightm: 1.2, weightkg: 100, color: "Yellow", @@ -15981,8 +15981,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 879, name: "Copperajah", types: ["Steel"], - baseStats: {hp: 122, atk: 130, def: 69, spa: 80, spd: 69, spe: 30}, - abilities: {0: "Sheer Force", H: "Heavy Metal"}, + baseStats: { hp: 122, atk: 130, def: 69, spa: 80, spd: 69, spe: 30 }, + abilities: { 0: "Sheer Force", H: "Heavy Metal" }, heightm: 3, weightkg: 650, color: "Green", @@ -15997,8 +15997,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Copperajah", forme: "Gmax", types: ["Steel"], - baseStats: {hp: 122, atk: 130, def: 69, spa: 80, spd: 69, spe: 30}, - abilities: {0: "Sheer Force", H: "Heavy Metal"}, + baseStats: { hp: 122, atk: 130, def: 69, spa: 80, spd: 69, spe: 30 }, + abilities: { 0: "Sheer Force", H: "Heavy Metal" }, heightm: 23, weightkg: 0, color: "Green", @@ -16010,8 +16010,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Dracozolt", types: ["Electric", "Dragon"], gender: "N", - baseStats: {hp: 90, atk: 100, def: 90, spa: 80, spd: 70, spe: 75}, - abilities: {0: "Volt Absorb", 1: "Hustle", H: "Sand Rush"}, + baseStats: { hp: 90, atk: 100, def: 90, spa: 80, spd: 70, spe: 75 }, + abilities: { 0: "Volt Absorb", 1: "Hustle", H: "Sand Rush" }, heightm: 1.8, weightkg: 190, color: "Green", @@ -16022,8 +16022,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Arctozolt", types: ["Electric", "Ice"], gender: "N", - baseStats: {hp: 90, atk: 100, def: 90, spa: 90, spd: 80, spe: 55}, - abilities: {0: "Volt Absorb", 1: "Static", H: "Slush Rush"}, + baseStats: { hp: 90, atk: 100, def: 90, spa: 90, spd: 80, spe: 55 }, + abilities: { 0: "Volt Absorb", 1: "Static", H: "Slush Rush" }, heightm: 2.3, weightkg: 150, color: "Blue", @@ -16034,8 +16034,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Dracovish", types: ["Water", "Dragon"], gender: "N", - baseStats: {hp: 90, atk: 90, def: 100, spa: 70, spd: 80, spe: 75}, - abilities: {0: "Water Absorb", 1: "Strong Jaw", H: "Sand Rush"}, + baseStats: { hp: 90, atk: 90, def: 100, spa: 70, spd: 80, spe: 75 }, + abilities: { 0: "Water Absorb", 1: "Strong Jaw", H: "Sand Rush" }, heightm: 2.3, weightkg: 215, color: "Green", @@ -16046,8 +16046,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Arctovish", types: ["Water", "Ice"], gender: "N", - baseStats: {hp: 90, atk: 90, def: 100, spa: 80, spd: 90, spe: 55}, - abilities: {0: "Water Absorb", 1: "Ice Body", H: "Slush Rush"}, + baseStats: { hp: 90, atk: 90, def: 100, spa: 80, spd: 90, spe: 55 }, + abilities: { 0: "Water Absorb", 1: "Ice Body", H: "Slush Rush" }, heightm: 2, weightkg: 175, color: "Blue", @@ -16057,8 +16057,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 884, name: "Duraludon", types: ["Steel", "Dragon"], - baseStats: {hp: 70, atk: 95, def: 115, spa: 120, spd: 50, spe: 85}, - abilities: {0: "Light Metal", 1: "Heavy Metal", H: "Stalwart"}, + baseStats: { hp: 70, atk: 95, def: 115, spa: 120, spd: 50, spe: 85 }, + abilities: { 0: "Light Metal", 1: "Heavy Metal", H: "Stalwart" }, heightm: 1.8, weightkg: 40, color: "White", @@ -16072,8 +16072,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Duraludon", forme: "Gmax", types: ["Steel", "Dragon"], - baseStats: {hp: 70, atk: 95, def: 115, spa: 120, spd: 50, spe: 85}, - abilities: {0: "Light Metal", 1: "Heavy Metal", H: "Stalwart"}, + baseStats: { hp: 70, atk: 95, def: 115, spa: 120, spd: 50, spe: 85 }, + abilities: { 0: "Light Metal", 1: "Heavy Metal", H: "Stalwart" }, heightm: 43, weightkg: 0, color: "White", @@ -16084,8 +16084,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 885, name: "Dreepy", types: ["Dragon", "Ghost"], - baseStats: {hp: 28, atk: 60, def: 30, spa: 40, spd: 30, spe: 82}, - abilities: {0: "Clear Body", 1: "Infiltrator", H: "Cursed Body"}, + baseStats: { hp: 28, atk: 60, def: 30, spa: 40, spd: 30, spe: 82 }, + abilities: { 0: "Clear Body", 1: "Infiltrator", H: "Cursed Body" }, heightm: 0.5, weightkg: 2, color: "Green", @@ -16096,8 +16096,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 886, name: "Drakloak", types: ["Dragon", "Ghost"], - baseStats: {hp: 68, atk: 80, def: 50, spa: 60, spd: 50, spe: 102}, - abilities: {0: "Clear Body", 1: "Infiltrator", H: "Cursed Body"}, + baseStats: { hp: 68, atk: 80, def: 50, spa: 60, spd: 50, spe: 102 }, + abilities: { 0: "Clear Body", 1: "Infiltrator", H: "Cursed Body" }, heightm: 1.4, weightkg: 11, color: "Green", @@ -16110,8 +16110,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 887, name: "Dragapult", types: ["Dragon", "Ghost"], - baseStats: {hp: 88, atk: 120, def: 75, spa: 100, spd: 75, spe: 142}, - abilities: {0: "Clear Body", 1: "Infiltrator", H: "Cursed Body"}, + baseStats: { hp: 88, atk: 120, def: 75, spa: 100, spd: 75, spe: 142 }, + abilities: { 0: "Clear Body", 1: "Infiltrator", H: "Cursed Body" }, heightm: 3, weightkg: 50, color: "Green", @@ -16125,8 +16125,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Hero", types: ["Fairy"], gender: "N", - baseStats: {hp: 92, atk: 120, def: 115, spa: 80, spd: 115, spe: 138}, - abilities: {0: "Intrepid Sword"}, + baseStats: { hp: 92, atk: 120, def: 115, spa: 80, spd: 115, spe: 138 }, + abilities: { 0: "Intrepid Sword" }, heightm: 2.8, weightkg: 110, color: "Blue", @@ -16143,8 +16143,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Crowned", types: ["Fairy", "Steel"], gender: "N", - baseStats: {hp: 92, atk: 150, def: 115, spa: 80, spd: 115, spe: 148}, - abilities: {0: "Intrepid Sword"}, + baseStats: { hp: 92, atk: 150, def: 115, spa: 80, spd: 115, spe: 148 }, + abilities: { 0: "Intrepid Sword" }, heightm: 2.8, weightkg: 355, color: "Blue", @@ -16159,8 +16159,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Hero", types: ["Fighting"], gender: "N", - baseStats: {hp: 92, atk: 120, def: 115, spa: 80, spd: 115, spe: 138}, - abilities: {0: "Dauntless Shield"}, + baseStats: { hp: 92, atk: 120, def: 115, spa: 80, spd: 115, spe: 138 }, + abilities: { 0: "Dauntless Shield" }, heightm: 2.9, weightkg: 210, color: "Red", @@ -16177,8 +16177,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Crowned", types: ["Fighting", "Steel"], gender: "N", - baseStats: {hp: 92, atk: 120, def: 140, spa: 80, spd: 140, spe: 128}, - abilities: {0: "Dauntless Shield"}, + baseStats: { hp: 92, atk: 120, def: 140, spa: 80, spd: 140, spe: 128 }, + abilities: { 0: "Dauntless Shield" }, heightm: 2.9, weightkg: 785, color: "Red", @@ -16192,8 +16192,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Eternatus", types: ["Poison", "Dragon"], gender: "N", - baseStats: {hp: 140, atk: 85, def: 95, spa: 145, spd: 95, spe: 130}, - abilities: {0: "Pressure"}, + baseStats: { hp: 140, atk: 85, def: 95, spa: 145, spd: 95, spe: 130 }, + abilities: { 0: "Pressure" }, heightm: 20, weightkg: 950, color: "Purple", @@ -16210,8 +16210,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Eternamax", types: ["Poison", "Dragon"], gender: "N", - baseStats: {hp: 255, atk: 115, def: 250, spa: 125, spd: 250, spe: 130}, - abilities: {0: "Pressure"}, + baseStats: { hp: 255, atk: 115, def: 250, spa: 125, spd: 250, spe: 130 }, + abilities: { 0: "Pressure" }, heightm: 100, weightkg: 0, color: "Purple", @@ -16222,9 +16222,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 891, name: "Kubfu", types: ["Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 60, atk: 90, def: 60, spa: 53, spd: 50, spe: 72}, - abilities: {0: "Inner Focus"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 60, atk: 90, def: 60, spa: 53, spd: 50, spe: 72 }, + abilities: { 0: "Inner Focus" }, heightm: 0.6, weightkg: 12, color: "Gray", @@ -16237,9 +16237,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Urshifu", baseForme: "Single-Strike", types: ["Fighting", "Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97}, - abilities: {0: "Unseen Fist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97 }, + abilities: { 0: "Unseen Fist" }, heightm: 1.9, weightkg: 105, color: "Gray", @@ -16258,9 +16258,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Urshifu", forme: "Rapid-Strike", types: ["Fighting", "Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97}, - abilities: {0: "Unseen Fist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97 }, + abilities: { 0: "Unseen Fist" }, heightm: 1.9, weightkg: 105, color: "Gray", @@ -16276,9 +16276,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Urshifu", forme: "Gmax", types: ["Fighting", "Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97}, - abilities: {0: "Unseen Fist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97 }, + abilities: { 0: "Unseen Fist" }, heightm: 29, weightkg: 0, color: "Gray", @@ -16291,9 +16291,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Urshifu", forme: "Rapid-Strike-Gmax", types: ["Fighting", "Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97}, - abilities: {0: "Unseen Fist"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 100, atk: 130, def: 100, spa: 63, spd: 60, spe: 97 }, + abilities: { 0: "Unseen Fist" }, heightm: 26, weightkg: 0, color: "Gray", @@ -16306,8 +16306,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Zarude", types: ["Dark", "Grass"], gender: "N", - baseStats: {hp: 105, atk: 120, def: 105, spa: 70, spd: 95, spe: 105}, - abilities: {0: "Leaf Guard"}, + baseStats: { hp: 105, atk: 120, def: 105, spa: 70, spd: 95, spe: 105 }, + abilities: { 0: "Leaf Guard" }, heightm: 1.8, weightkg: 70, color: "Black", @@ -16323,8 +16323,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Dada", types: ["Dark", "Grass"], gender: "N", - baseStats: {hp: 105, atk: 120, def: 105, spa: 70, spd: 95, spe: 105}, - abilities: {0: "Leaf Guard"}, + baseStats: { hp: 105, atk: 120, def: 105, spa: 70, spd: 95, spe: 105 }, + abilities: { 0: "Leaf Guard" }, heightm: 1.8, weightkg: 70, color: "Black", @@ -16335,8 +16335,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Regieleki", types: ["Electric"], gender: "N", - baseStats: {hp: 80, atk: 100, def: 50, spa: 100, spd: 50, spe: 200}, - abilities: {0: "Transistor"}, + baseStats: { hp: 80, atk: 100, def: 50, spa: 100, spd: 50, spe: 200 }, + abilities: { 0: "Transistor" }, heightm: 1.2, weightkg: 145, color: "Yellow", @@ -16348,8 +16348,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Regidrago", types: ["Dragon"], gender: "N", - baseStats: {hp: 200, atk: 100, def: 50, spa: 100, spd: 50, spe: 80}, - abilities: {0: "Dragon's Maw"}, + baseStats: { hp: 200, atk: 100, def: 50, spa: 100, spd: 50, spe: 80 }, + abilities: { 0: "Dragon's Maw" }, heightm: 2.1, weightkg: 200, color: "Green", @@ -16361,8 +16361,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Glastrier", types: ["Ice"], gender: "N", - baseStats: {hp: 100, atk: 145, def: 130, spa: 65, spd: 110, spe: 30}, - abilities: {0: "Chilling Neigh"}, + baseStats: { hp: 100, atk: 145, def: 130, spa: 65, spd: 110, spe: 30 }, + abilities: { 0: "Chilling Neigh" }, heightm: 2.2, weightkg: 800, color: "White", @@ -16374,8 +16374,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Spectrier", types: ["Ghost"], gender: "N", - baseStats: {hp: 100, atk: 65, def: 60, spa: 145, spd: 80, spe: 130}, - abilities: {0: "Grim Neigh"}, + baseStats: { hp: 100, atk: 65, def: 60, spa: 145, spd: 80, spe: 130 }, + abilities: { 0: "Grim Neigh" }, heightm: 2, weightkg: 44.5, color: "Black", @@ -16387,8 +16387,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Calyrex", types: ["Psychic", "Grass"], gender: "N", - baseStats: {hp: 100, atk: 80, def: 80, spa: 80, spd: 80, spe: 80}, - abilities: {0: "Unnerve"}, + baseStats: { hp: 100, atk: 80, def: 80, spa: 80, spd: 80, spe: 80 }, + abilities: { 0: "Unnerve" }, heightm: 1.1, weightkg: 7.7, color: "Green", @@ -16404,8 +16404,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Ice", types: ["Psychic", "Ice"], gender: "N", - baseStats: {hp: 100, atk: 165, def: 150, spa: 85, spd: 130, spe: 50}, - abilities: {0: "As One (Glastrier)"}, + baseStats: { hp: 100, atk: 165, def: 150, spa: 85, spd: 130, spe: 50 }, + abilities: { 0: "As One (Glastrier)" }, heightm: 2.4, weightkg: 809.1, color: "White", @@ -16419,8 +16419,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Shadow", types: ["Psychic", "Ghost"], gender: "N", - baseStats: {hp: 100, atk: 85, def: 80, spa: 165, spd: 100, spe: 150}, - abilities: {0: "As One (Spectrier)"}, + baseStats: { hp: 100, atk: 85, def: 80, spa: 165, spd: 100, spe: 150 }, + abilities: { 0: "As One (Spectrier)" }, heightm: 2.4, weightkg: 53.6, color: "Black", @@ -16431,8 +16431,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 899, name: "Wyrdeer", types: ["Normal", "Psychic"], - baseStats: {hp: 103, atk: 105, def: 72, spa: 105, spd: 75, spe: 65}, - abilities: {0: "Intimidate", 1: "Frisk", H: "Sap Sipper"}, + baseStats: { hp: 103, atk: 105, def: 72, spa: 105, spd: 75, spe: 65 }, + abilities: { 0: "Intimidate", 1: "Frisk", H: "Sap Sipper" }, heightm: 1.8, weightkg: 95.1, color: "Gray", @@ -16445,8 +16445,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 900, name: "Kleavor", types: ["Bug", "Rock"], - baseStats: {hp: 70, atk: 135, def: 95, spa: 45, spd: 70, spe: 85}, - abilities: {0: "Swarm", 1: "Sheer Force", H: "Sharpness"}, + baseStats: { hp: 70, atk: 135, def: 95, spa: 45, spd: 70, spe: 85 }, + abilities: { 0: "Swarm", 1: "Sheer Force", H: "Sharpness" }, heightm: 1.8, weightkg: 89, color: "Brown", @@ -16459,8 +16459,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 901, name: "Ursaluna", types: ["Ground", "Normal"], - baseStats: {hp: 130, atk: 140, def: 105, spa: 45, spd: 80, spe: 50}, - abilities: {0: "Guts", 1: "Bulletproof", H: "Unnerve"}, + baseStats: { hp: 130, atk: 140, def: 105, spa: 45, spd: 80, spe: 50 }, + abilities: { 0: "Guts", 1: "Bulletproof", H: "Unnerve" }, heightm: 2.4, weightkg: 290, color: "Brown", @@ -16478,8 +16478,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Bloodmoon", types: ["Ground", "Normal"], gender: "M", - baseStats: {hp: 113, atk: 70, def: 120, spa: 135, spd: 65, spe: 52}, - abilities: {0: "Mind's Eye"}, + baseStats: { hp: 113, atk: 70, def: 120, spa: 135, spd: 65, spe: 52 }, + abilities: { 0: "Mind's Eye" }, heightm: 2.7, weightkg: 333, color: "Brown", @@ -16492,8 +16492,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "M", types: ["Water", "Ghost"], gender: "M", - baseStats: {hp: 120, atk: 112, def: 65, spa: 80, spd: 75, spe: 78}, - abilities: {0: "Swift Swim", 1: "Adaptability", H: "Mold Breaker"}, + baseStats: { hp: 120, atk: 112, def: 65, spa: 80, spd: 75, spe: 78 }, + abilities: { 0: "Swift Swim", 1: "Adaptability", H: "Mold Breaker" }, heightm: 3, weightkg: 110, color: "Green", @@ -16511,8 +16511,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "F", types: ["Water", "Ghost"], gender: "F", - baseStats: {hp: 120, atk: 92, def: 65, spa: 100, spd: 75, spe: 78}, - abilities: {0: "Swift Swim", 1: "Adaptability", H: "Mold Breaker"}, + baseStats: { hp: 120, atk: 92, def: 65, spa: 100, spd: 75, spe: 78 }, + abilities: { 0: "Swift Swim", 1: "Adaptability", H: "Mold Breaker" }, heightm: 3, weightkg: 110, color: "Green", @@ -16525,8 +16525,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 903, name: "Sneasler", types: ["Fighting", "Poison"], - baseStats: {hp: 80, atk: 130, def: 60, spa: 40, spd: 80, spe: 120}, - abilities: {0: "Pressure", 1: "Unburden", H: "Poison Touch"}, + baseStats: { hp: 80, atk: 130, def: 60, spa: 40, spd: 80, spe: 120 }, + abilities: { 0: "Pressure", 1: "Unburden", H: "Poison Touch" }, heightm: 1.3, weightkg: 43, color: "Blue", @@ -16540,8 +16540,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 904, name: "Overqwil", types: ["Dark", "Poison"], - baseStats: {hp: 85, atk: 115, def: 95, spa: 65, spd: 65, spe: 85}, - abilities: {0: "Poison Point", 1: "Swift Swim", H: "Intimidate"}, + baseStats: { hp: 85, atk: 115, def: 95, spa: 65, spd: 65, spe: 85 }, + abilities: { 0: "Poison Point", 1: "Swift Swim", H: "Intimidate" }, heightm: 2.5, weightkg: 60.5, color: "Black", @@ -16556,8 +16556,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Incarnate", types: ["Fairy", "Flying"], gender: "F", - baseStats: {hp: 74, atk: 115, def: 70, spa: 135, spd: 80, spe: 106}, - abilities: {0: "Cute Charm", H: "Contrary"}, + baseStats: { hp: 74, atk: 115, def: 70, spa: 135, spd: 80, spe: 106 }, + abilities: { 0: "Cute Charm", H: "Contrary" }, heightm: 1.6, weightkg: 48, color: "Pink", @@ -16573,8 +16573,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Therian", types: ["Fairy", "Flying"], gender: "F", - baseStats: {hp: 74, atk: 115, def: 110, spa: 135, spd: 100, spe: 46}, - abilities: {0: "Overcoat"}, + baseStats: { hp: 74, atk: 115, def: 110, spa: 135, spd: 100, spe: 46 }, + abilities: { 0: "Overcoat" }, heightm: 1.6, weightkg: 48, color: "Pink", @@ -16585,9 +16585,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 906, name: "Sprigatito", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 40, atk: 61, def: 54, spa: 45, spd: 45, spe: 65}, - abilities: {0: "Overgrow", H: "Protean"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 40, atk: 61, def: 54, spa: 45, spd: 45, spe: 65 }, + abilities: { 0: "Overgrow", H: "Protean" }, heightm: 0.4, weightkg: 4.1, color: "Green", @@ -16598,9 +16598,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 907, name: "Floragato", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 61, atk: 80, def: 63, spa: 60, spd: 63, spe: 83}, - abilities: {0: "Overgrow", H: "Protean"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 61, atk: 80, def: 63, spa: 60, spd: 63, spe: 83 }, + abilities: { 0: "Overgrow", H: "Protean" }, heightm: 0.9, weightkg: 12.2, color: "Green", @@ -16613,9 +16613,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 908, name: "Meowscarada", types: ["Grass", "Dark"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 76, atk: 110, def: 70, spa: 81, spd: 70, spe: 123}, - abilities: {0: "Overgrow", H: "Protean"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 76, atk: 110, def: 70, spa: 81, spd: 70, spe: 123 }, + abilities: { 0: "Overgrow", H: "Protean" }, heightm: 1.5, weightkg: 31.2, color: "Green", @@ -16627,9 +16627,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 909, name: "Fuecoco", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 67, atk: 45, def: 59, spa: 63, spd: 40, spe: 36}, - abilities: {0: "Blaze", H: "Unaware"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 67, atk: 45, def: 59, spa: 63, spd: 40, spe: 36 }, + abilities: { 0: "Blaze", H: "Unaware" }, heightm: 0.4, weightkg: 9.8, color: "Red", @@ -16640,9 +16640,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 910, name: "Crocalor", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 81, atk: 55, def: 78, spa: 90, spd: 58, spe: 49}, - abilities: {0: "Blaze", H: "Unaware"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 81, atk: 55, def: 78, spa: 90, spd: 58, spe: 49 }, + abilities: { 0: "Blaze", H: "Unaware" }, heightm: 1, weightkg: 30.7, color: "Red", @@ -16655,9 +16655,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 911, name: "Skeledirge", types: ["Fire", "Ghost"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 104, atk: 75, def: 100, spa: 110, spd: 75, spe: 66}, - abilities: {0: "Blaze", H: "Unaware"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 104, atk: 75, def: 100, spa: 110, spd: 75, spe: 66 }, + abilities: { 0: "Blaze", H: "Unaware" }, heightm: 1.6, weightkg: 326.5, color: "Red", @@ -16669,9 +16669,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 912, name: "Quaxly", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 55, atk: 65, def: 45, spa: 50, spd: 45, spe: 50}, - abilities: {0: "Torrent", H: "Moxie"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 55, atk: 65, def: 45, spa: 50, spd: 45, spe: 50 }, + abilities: { 0: "Torrent", H: "Moxie" }, heightm: 0.5, weightkg: 6.1, color: "Blue", @@ -16682,9 +16682,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 913, name: "Quaxwell", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 70, atk: 85, def: 65, spa: 65, spd: 60, spe: 65}, - abilities: {0: "Torrent", H: "Moxie"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 70, atk: 85, def: 65, spa: 65, spd: 60, spe: 65 }, + abilities: { 0: "Torrent", H: "Moxie" }, heightm: 1.2, weightkg: 21.5, color: "Blue", @@ -16697,9 +16697,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 914, name: "Quaquaval", types: ["Water", "Fighting"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 85, atk: 120, def: 80, spa: 85, spd: 75, spe: 85}, - abilities: {0: "Torrent", H: "Moxie"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 85, atk: 120, def: 80, spa: 85, spd: 75, spe: 85 }, + abilities: { 0: "Torrent", H: "Moxie" }, heightm: 1.8, weightkg: 61.9, color: "Blue", @@ -16711,8 +16711,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 915, name: "Lechonk", types: ["Normal"], - baseStats: {hp: 54, atk: 45, def: 40, spa: 35, spd: 45, spe: 35}, - abilities: {0: "Aroma Veil", 1: "Gluttony", H: "Thick Fat"}, + baseStats: { hp: 54, atk: 45, def: 40, spa: 35, spd: 45, spe: 35 }, + abilities: { 0: "Aroma Veil", 1: "Gluttony", H: "Thick Fat" }, heightm: 0.5, weightkg: 10.2, color: "Gray", @@ -16725,8 +16725,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "M", types: ["Normal"], gender: "M", - baseStats: {hp: 110, atk: 100, def: 75, spa: 59, spd: 80, spe: 65}, - abilities: {0: "Lingering Aroma", 1: "Gluttony", H: "Thick Fat"}, + baseStats: { hp: 110, atk: 100, def: 75, spa: 59, spd: 80, spe: 65 }, + abilities: { 0: "Lingering Aroma", 1: "Gluttony", H: "Thick Fat" }, heightm: 1, weightkg: 120, color: "Gray", @@ -16743,8 +16743,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "F", types: ["Normal"], gender: "F", - baseStats: {hp: 115, atk: 90, def: 70, spa: 59, spd: 90, spe: 65}, - abilities: {0: "Aroma Veil", 1: "Gluttony", H: "Thick Fat"}, + baseStats: { hp: 115, atk: 90, def: 70, spa: 59, spd: 90, spe: 65 }, + abilities: { 0: "Aroma Veil", 1: "Gluttony", H: "Thick Fat" }, heightm: 1, weightkg: 120, color: "Brown", @@ -16756,8 +16756,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 917, name: "Tarountula", types: ["Bug"], - baseStats: {hp: 35, atk: 41, def: 45, spa: 29, spd: 40, spe: 20}, - abilities: {0: "Insomnia", H: "Stakeout"}, + baseStats: { hp: 35, atk: 41, def: 45, spa: 29, spd: 40, spe: 20 }, + abilities: { 0: "Insomnia", H: "Stakeout" }, heightm: 0.3, weightkg: 4, color: "White", @@ -16768,8 +16768,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 918, name: "Spidops", types: ["Bug"], - baseStats: {hp: 60, atk: 79, def: 92, spa: 52, spd: 86, spe: 35}, - abilities: {0: "Insomnia", H: "Stakeout"}, + baseStats: { hp: 60, atk: 79, def: 92, spa: 52, spd: 86, spe: 35 }, + abilities: { 0: "Insomnia", H: "Stakeout" }, heightm: 1, weightkg: 16.5, color: "Green", @@ -16781,8 +16781,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 919, name: "Nymble", types: ["Bug"], - baseStats: {hp: 33, atk: 46, def: 40, spa: 21, spd: 25, spe: 45}, - abilities: {0: "Swarm", H: "Tinted Lens"}, + baseStats: { hp: 33, atk: 46, def: 40, spa: 21, spd: 25, spe: 45 }, + abilities: { 0: "Swarm", H: "Tinted Lens" }, heightm: 0.2, weightkg: 1, color: "Gray", @@ -16793,8 +16793,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 920, name: "Lokix", types: ["Bug", "Dark"], - baseStats: {hp: 71, atk: 102, def: 78, spa: 52, spd: 55, spe: 92}, - abilities: {0: "Swarm", H: "Tinted Lens"}, + baseStats: { hp: 71, atk: 102, def: 78, spa: 52, spd: 55, spe: 92 }, + abilities: { 0: "Swarm", H: "Tinted Lens" }, heightm: 1, weightkg: 17.5, color: "Gray", @@ -16806,8 +16806,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 921, name: "Pawmi", types: ["Electric"], - baseStats: {hp: 45, atk: 50, def: 20, spa: 40, spd: 25, spe: 60}, - abilities: {0: "Static", 1: "Natural Cure", H: "Iron Fist"}, + baseStats: { hp: 45, atk: 50, def: 20, spa: 40, spd: 25, spe: 60 }, + abilities: { 0: "Static", 1: "Natural Cure", H: "Iron Fist" }, heightm: 0.3, weightkg: 2.5, color: "Yellow", @@ -16818,8 +16818,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 922, name: "Pawmo", types: ["Electric", "Fighting"], - baseStats: {hp: 60, atk: 75, def: 40, spa: 50, spd: 40, spe: 85}, - abilities: {0: "Volt Absorb", 1: "Natural Cure", H: "Iron Fist"}, + baseStats: { hp: 60, atk: 75, def: 40, spa: 50, spd: 40, spe: 85 }, + abilities: { 0: "Volt Absorb", 1: "Natural Cure", H: "Iron Fist" }, heightm: 0.4, weightkg: 6.5, color: "Yellow", @@ -16832,8 +16832,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 923, name: "Pawmot", types: ["Electric", "Fighting"], - baseStats: {hp: 70, atk: 115, def: 70, spa: 70, spd: 60, spe: 105}, - abilities: {0: "Volt Absorb", 1: "Natural Cure", H: "Iron Fist"}, + baseStats: { hp: 70, atk: 115, def: 70, spa: 70, spd: 60, spe: 105 }, + abilities: { 0: "Volt Absorb", 1: "Natural Cure", H: "Iron Fist" }, heightm: 0.9, weightkg: 41, color: "Yellow", @@ -16847,8 +16847,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tandemaus", types: ["Normal"], gender: "N", - baseStats: {hp: 50, atk: 50, def: 45, spa: 40, spd: 45, spe: 75}, - abilities: {0: "Run Away", 1: "Pickup", H: "Own Tempo"}, + baseStats: { hp: 50, atk: 50, def: 45, spa: 40, spd: 45, spe: 75 }, + abilities: { 0: "Run Away", 1: "Pickup", H: "Own Tempo" }, heightm: 0.3, weightkg: 1.8, color: "White", @@ -16861,8 +16861,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Three", types: ["Normal"], gender: "N", - baseStats: {hp: 74, atk: 75, def: 70, spa: 65, spd: 75, spe: 111}, - abilities: {0: "Friend Guard", 1: "Cheek Pouch", H: "Technician"}, + baseStats: { hp: 74, atk: 75, def: 70, spa: 65, spd: 75, spe: 111 }, + abilities: { 0: "Friend Guard", 1: "Cheek Pouch", H: "Technician" }, heightm: 0.3, weightkg: 2.3, color: "White", @@ -16879,8 +16879,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Four", types: ["Normal"], gender: "N", - baseStats: {hp: 74, atk: 75, def: 70, spa: 65, spd: 75, spe: 111}, - abilities: {0: "Friend Guard", 1: "Cheek Pouch", H: "Technician"}, + baseStats: { hp: 74, atk: 75, def: 70, spa: 65, spd: 75, spe: 111 }, + abilities: { 0: "Friend Guard", 1: "Cheek Pouch", H: "Technician" }, heightm: 0.3, weightkg: 2.8, color: "White", @@ -16892,8 +16892,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 926, name: "Fidough", types: ["Fairy"], - baseStats: {hp: 37, atk: 55, def: 70, spa: 30, spd: 55, spe: 65}, - abilities: {0: "Own Tempo", H: "Klutz"}, + baseStats: { hp: 37, atk: 55, def: 70, spa: 30, spd: 55, spe: 65 }, + abilities: { 0: "Own Tempo", H: "Klutz" }, heightm: 0.3, weightkg: 10.9, color: "Yellow", @@ -16904,8 +16904,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 927, name: "Dachsbun", types: ["Fairy"], - baseStats: {hp: 57, atk: 80, def: 115, spa: 50, spd: 80, spe: 95}, - abilities: {0: "Well-Baked Body", H: "Aroma Veil"}, + baseStats: { hp: 57, atk: 80, def: 115, spa: 50, spd: 80, spe: 95 }, + abilities: { 0: "Well-Baked Body", H: "Aroma Veil" }, heightm: 0.5, weightkg: 14.9, color: "Brown", @@ -16917,8 +16917,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 928, name: "Smoliv", types: ["Grass", "Normal"], - baseStats: {hp: 41, atk: 35, def: 45, spa: 58, spd: 51, spe: 30}, - abilities: {0: "Early Bird", H: "Harvest"}, + baseStats: { hp: 41, atk: 35, def: 45, spa: 58, spd: 51, spe: 30 }, + abilities: { 0: "Early Bird", H: "Harvest" }, heightm: 0.3, weightkg: 6.5, color: "Green", @@ -16929,8 +16929,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 929, name: "Dolliv", types: ["Grass", "Normal"], - baseStats: {hp: 52, atk: 53, def: 60, spa: 78, spd: 78, spe: 33}, - abilities: {0: "Early Bird", H: "Harvest"}, + baseStats: { hp: 52, atk: 53, def: 60, spa: 78, spd: 78, spe: 33 }, + abilities: { 0: "Early Bird", H: "Harvest" }, heightm: 0.6, weightkg: 11.9, color: "Green", @@ -16943,8 +16943,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 930, name: "Arboliva", types: ["Grass", "Normal"], - baseStats: {hp: 78, atk: 69, def: 90, spa: 125, spd: 109, spe: 39}, - abilities: {0: "Seed Sower", H: "Harvest"}, + baseStats: { hp: 78, atk: 69, def: 90, spa: 125, spd: 109, spe: 39 }, + abilities: { 0: "Seed Sower", H: "Harvest" }, heightm: 1.4, weightkg: 48.2, color: "Green", @@ -16957,8 +16957,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Squawkabilly", baseForme: "Green", types: ["Normal", "Flying"], - baseStats: {hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92}, - abilities: {0: "Intimidate", 1: "Hustle", H: "Guts"}, + baseStats: { hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92 }, + abilities: { 0: "Intimidate", 1: "Hustle", H: "Guts" }, heightm: 0.6, weightkg: 2.4, color: "Green", @@ -16972,8 +16972,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Squawkabilly", forme: "Blue", types: ["Normal", "Flying"], - baseStats: {hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92}, - abilities: {0: "Intimidate", 1: "Hustle", H: "Guts"}, + baseStats: { hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92 }, + abilities: { 0: "Intimidate", 1: "Hustle", H: "Guts" }, heightm: 0.6, weightkg: 2.4, color: "Blue", @@ -16985,8 +16985,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Squawkabilly", forme: "Yellow", types: ["Normal", "Flying"], - baseStats: {hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92}, - abilities: {0: "Intimidate", 1: "Hustle", H: "Sheer Force"}, + baseStats: { hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92 }, + abilities: { 0: "Intimidate", 1: "Hustle", H: "Sheer Force" }, heightm: 0.6, weightkg: 2.4, color: "Yellow", @@ -16998,8 +16998,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Squawkabilly", forme: "White", types: ["Normal", "Flying"], - baseStats: {hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92}, - abilities: {0: "Intimidate", 1: "Hustle", H: "Sheer Force"}, + baseStats: { hp: 82, atk: 96, def: 51, spa: 45, spd: 51, spe: 92 }, + abilities: { 0: "Intimidate", 1: "Hustle", H: "Sheer Force" }, heightm: 0.6, weightkg: 2.4, color: "White", @@ -17009,8 +17009,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 932, name: "Nacli", types: ["Rock"], - baseStats: {hp: 55, atk: 55, def: 75, spa: 35, spd: 35, spe: 25}, - abilities: {0: "Purifying Salt", 1: "Sturdy", H: "Clear Body"}, + baseStats: { hp: 55, atk: 55, def: 75, spa: 35, spd: 35, spe: 25 }, + abilities: { 0: "Purifying Salt", 1: "Sturdy", H: "Clear Body" }, heightm: 0.4, weightkg: 16, color: "Brown", @@ -17021,8 +17021,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 933, name: "Naclstack", types: ["Rock"], - baseStats: {hp: 60, atk: 60, def: 100, spa: 35, spd: 65, spe: 35}, - abilities: {0: "Purifying Salt", 1: "Sturdy", H: "Clear Body"}, + baseStats: { hp: 60, atk: 60, def: 100, spa: 35, spd: 65, spe: 35 }, + abilities: { 0: "Purifying Salt", 1: "Sturdy", H: "Clear Body" }, heightm: 0.6, weightkg: 105, color: "Brown", @@ -17035,8 +17035,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 934, name: "Garganacl", types: ["Rock"], - baseStats: {hp: 100, atk: 100, def: 130, spa: 45, spd: 90, spe: 35}, - abilities: {0: "Purifying Salt", 1: "Sturdy", H: "Clear Body"}, + baseStats: { hp: 100, atk: 100, def: 130, spa: 45, spd: 90, spe: 35 }, + abilities: { 0: "Purifying Salt", 1: "Sturdy", H: "Clear Body" }, heightm: 2.3, weightkg: 240, color: "Brown", @@ -17048,8 +17048,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 935, name: "Charcadet", types: ["Fire"], - baseStats: {hp: 40, atk: 50, def: 40, spa: 50, spd: 40, spe: 35}, - abilities: {0: "Flash Fire", H: "Flame Body"}, + baseStats: { hp: 40, atk: 50, def: 40, spa: 50, spd: 40, spe: 35 }, + abilities: { 0: "Flash Fire", H: "Flame Body" }, heightm: 0.6, weightkg: 10.5, color: "Red", @@ -17060,8 +17060,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 936, name: "Armarouge", types: ["Fire", "Psychic"], - baseStats: {hp: 85, atk: 60, def: 100, spa: 125, spd: 80, spe: 75}, - abilities: {0: "Flash Fire", H: "Weak Armor"}, + baseStats: { hp: 85, atk: 60, def: 100, spa: 125, spd: 80, spe: 75 }, + abilities: { 0: "Flash Fire", H: "Weak Armor" }, heightm: 1.5, weightkg: 85, color: "Red", @@ -17074,8 +17074,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 937, name: "Ceruledge", types: ["Fire", "Ghost"], - baseStats: {hp: 75, atk: 125, def: 80, spa: 60, spd: 100, spe: 85}, - abilities: {0: "Flash Fire", H: "Weak Armor"}, + baseStats: { hp: 75, atk: 125, def: 80, spa: 60, spd: 100, spe: 85 }, + abilities: { 0: "Flash Fire", H: "Weak Armor" }, heightm: 1.6, weightkg: 62, color: "Purple", @@ -17088,8 +17088,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 938, name: "Tadbulb", types: ["Electric"], - baseStats: {hp: 61, atk: 31, def: 41, spa: 59, spd: 35, spe: 45}, - abilities: {0: "Own Tempo", 1: "Static", H: "Damp"}, + baseStats: { hp: 61, atk: 31, def: 41, spa: 59, spd: 35, spe: 45 }, + abilities: { 0: "Own Tempo", 1: "Static", H: "Damp" }, heightm: 0.3, weightkg: 0.4, color: "Yellow", @@ -17100,8 +17100,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 939, name: "Bellibolt", types: ["Electric"], - baseStats: {hp: 109, atk: 64, def: 91, spa: 103, spd: 83, spe: 45}, - abilities: {0: "Electromorphosis", 1: "Static", H: "Damp"}, + baseStats: { hp: 109, atk: 64, def: 91, spa: 103, spd: 83, spe: 45 }, + abilities: { 0: "Electromorphosis", 1: "Static", H: "Damp" }, heightm: 1.2, weightkg: 113, color: "Green", @@ -17114,8 +17114,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 940, name: "Wattrel", types: ["Electric", "Flying"], - baseStats: {hp: 40, atk: 40, def: 35, spa: 55, spd: 40, spe: 70}, - abilities: {0: "Wind Power", 1: "Volt Absorb", H: "Competitive"}, + baseStats: { hp: 40, atk: 40, def: 35, spa: 55, spd: 40, spe: 70 }, + abilities: { 0: "Wind Power", 1: "Volt Absorb", H: "Competitive" }, heightm: 0.4, weightkg: 3.6, color: "Black", @@ -17126,8 +17126,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 941, name: "Kilowattrel", types: ["Electric", "Flying"], - baseStats: {hp: 70, atk: 70, def: 60, spa: 105, spd: 60, spe: 125}, - abilities: {0: "Wind Power", 1: "Volt Absorb", H: "Competitive"}, + baseStats: { hp: 70, atk: 70, def: 60, spa: 105, spd: 60, spe: 125 }, + abilities: { 0: "Wind Power", 1: "Volt Absorb", H: "Competitive" }, heightm: 1.4, weightkg: 38.6, color: "Yellow", @@ -17139,8 +17139,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 942, name: "Maschiff", types: ["Dark"], - baseStats: {hp: 60, atk: 78, def: 60, spa: 40, spd: 51, spe: 51}, - abilities: {0: "Intimidate", 1: "Run Away", H: "Stakeout"}, + baseStats: { hp: 60, atk: 78, def: 60, spa: 40, spd: 51, spe: 51 }, + abilities: { 0: "Intimidate", 1: "Run Away", H: "Stakeout" }, heightm: 0.5, weightkg: 16, color: "Brown", @@ -17151,8 +17151,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 943, name: "Mabosstiff", types: ["Dark"], - baseStats: {hp: 80, atk: 120, def: 90, spa: 60, spd: 70, spe: 85}, - abilities: {0: "Intimidate", 1: "Guard Dog", H: "Stakeout"}, + baseStats: { hp: 80, atk: 120, def: 90, spa: 60, spd: 70, spe: 85 }, + abilities: { 0: "Intimidate", 1: "Guard Dog", H: "Stakeout" }, heightm: 1.1, weightkg: 61, color: "Gray", @@ -17164,8 +17164,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 944, name: "Shroodle", types: ["Poison", "Normal"], - baseStats: {hp: 40, atk: 65, def: 35, spa: 40, spd: 35, spe: 75}, - abilities: {0: "Unburden", 1: "Pickpocket", H: "Prankster"}, + baseStats: { hp: 40, atk: 65, def: 35, spa: 40, spd: 35, spe: 75 }, + abilities: { 0: "Unburden", 1: "Pickpocket", H: "Prankster" }, heightm: 0.2, weightkg: 0.7, color: "Gray", @@ -17176,8 +17176,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 945, name: "Grafaiai", types: ["Poison", "Normal"], - baseStats: {hp: 63, atk: 95, def: 65, spa: 80, spd: 72, spe: 110}, - abilities: {0: "Unburden", 1: "Poison Touch", H: "Prankster"}, + baseStats: { hp: 63, atk: 95, def: 65, spa: 80, spd: 72, spe: 110 }, + abilities: { 0: "Unburden", 1: "Poison Touch", H: "Prankster" }, heightm: 0.7, weightkg: 27.2, color: "Gray", @@ -17189,8 +17189,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 946, name: "Bramblin", types: ["Grass", "Ghost"], - baseStats: {hp: 40, atk: 65, def: 30, spa: 45, spd: 35, spe: 60}, - abilities: {0: "Wind Rider", H: "Infiltrator"}, + baseStats: { hp: 40, atk: 65, def: 30, spa: 45, spd: 35, spe: 60 }, + abilities: { 0: "Wind Rider", H: "Infiltrator" }, heightm: 0.6, weightkg: 0.6, color: "Brown", @@ -17201,8 +17201,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 947, name: "Brambleghast", types: ["Grass", "Ghost"], - baseStats: {hp: 55, atk: 115, def: 70, spa: 80, spd: 70, spe: 90}, - abilities: {0: "Wind Rider", H: "Infiltrator"}, + baseStats: { hp: 55, atk: 115, def: 70, spa: 80, spd: 70, spe: 90 }, + abilities: { 0: "Wind Rider", H: "Infiltrator" }, heightm: 1.2, weightkg: 6, color: "Brown", @@ -17215,8 +17215,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 948, name: "Toedscool", types: ["Ground", "Grass"], - baseStats: {hp: 40, atk: 40, def: 35, spa: 50, spd: 100, spe: 70}, - abilities: {0: "Mycelium Might"}, + baseStats: { hp: 40, atk: 40, def: 35, spa: 50, spd: 100, spe: 70 }, + abilities: { 0: "Mycelium Might" }, heightm: 0.9, weightkg: 33, color: "Yellow", @@ -17227,8 +17227,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 949, name: "Toedscruel", types: ["Ground", "Grass"], - baseStats: {hp: 80, atk: 70, def: 65, spa: 80, spd: 120, spe: 100}, - abilities: {0: "Mycelium Might"}, + baseStats: { hp: 80, atk: 70, def: 65, spa: 80, spd: 120, spe: 100 }, + abilities: { 0: "Mycelium Might" }, heightm: 1.9, weightkg: 58, color: "Black", @@ -17240,8 +17240,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 950, name: "Klawf", types: ["Rock"], - baseStats: {hp: 70, atk: 100, def: 115, spa: 35, spd: 55, spe: 75}, - abilities: {0: "Anger Shell", 1: "Shell Armor", H: "Regenerator"}, + baseStats: { hp: 70, atk: 100, def: 115, spa: 35, spd: 55, spe: 75 }, + abilities: { 0: "Anger Shell", 1: "Shell Armor", H: "Regenerator" }, heightm: 1.3, weightkg: 79, color: "Red", @@ -17251,8 +17251,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 951, name: "Capsakid", types: ["Grass"], - baseStats: {hp: 50, atk: 62, def: 40, spa: 62, spd: 40, spe: 50}, - abilities: {0: "Chlorophyll", 1: "Insomnia", H: "Klutz"}, + baseStats: { hp: 50, atk: 62, def: 40, spa: 62, spd: 40, spe: 50 }, + abilities: { 0: "Chlorophyll", 1: "Insomnia", H: "Klutz" }, heightm: 0.3, weightkg: 3, color: "Green", @@ -17263,8 +17263,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 952, name: "Scovillain", types: ["Grass", "Fire"], - baseStats: {hp: 65, atk: 108, def: 65, spa: 108, spd: 65, spe: 75}, - abilities: {0: "Chlorophyll", 1: "Insomnia", H: "Moody"}, + baseStats: { hp: 65, atk: 108, def: 65, spa: 108, spd: 65, spe: 75 }, + abilities: { 0: "Chlorophyll", 1: "Insomnia", H: "Moody" }, heightm: 0.9, weightkg: 15, color: "Green", @@ -17277,8 +17277,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 953, name: "Rellor", types: ["Bug"], - baseStats: {hp: 41, atk: 50, def: 60, spa: 31, spd: 58, spe: 30}, - abilities: {0: "Compound Eyes", H: "Shed Skin"}, + baseStats: { hp: 41, atk: 50, def: 60, spa: 31, spd: 58, spe: 30 }, + abilities: { 0: "Compound Eyes", H: "Shed Skin" }, heightm: 0.2, weightkg: 1, color: "Brown", @@ -17289,8 +17289,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 954, name: "Rabsca", types: ["Bug", "Psychic"], - baseStats: {hp: 75, atk: 50, def: 85, spa: 115, spd: 100, spe: 45}, - abilities: {0: "Synchronize", H: "Telepathy"}, + baseStats: { hp: 75, atk: 50, def: 85, spa: 115, spd: 100, spe: 45 }, + abilities: { 0: "Synchronize", H: "Telepathy" }, heightm: 0.3, weightkg: 3.5, color: "Green", @@ -17303,8 +17303,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 955, name: "Flittle", types: ["Psychic"], - baseStats: {hp: 30, atk: 35, def: 30, spa: 55, spd: 30, spe: 75}, - abilities: {0: "Anticipation", 1: "Frisk", H: "Speed Boost"}, + baseStats: { hp: 30, atk: 35, def: 30, spa: 55, spd: 30, spe: 75 }, + abilities: { 0: "Anticipation", 1: "Frisk", H: "Speed Boost" }, heightm: 0.2, weightkg: 1.5, color: "Yellow", @@ -17315,8 +17315,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 956, name: "Espathra", types: ["Psychic"], - baseStats: {hp: 95, atk: 60, def: 60, spa: 101, spd: 60, spe: 105}, - abilities: {0: "Opportunist", 1: "Frisk", H: "Speed Boost"}, + baseStats: { hp: 95, atk: 60, def: 60, spa: 101, spd: 60, spe: 105 }, + abilities: { 0: "Opportunist", 1: "Frisk", H: "Speed Boost" }, heightm: 1.9, weightkg: 90, color: "Yellow", @@ -17329,8 +17329,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tinkatink", types: ["Fairy", "Steel"], gender: "F", - baseStats: {hp: 50, atk: 45, def: 45, spa: 35, spd: 64, spe: 58}, - abilities: {0: "Mold Breaker", 1: "Own Tempo", H: "Pickpocket"}, + baseStats: { hp: 50, atk: 45, def: 45, spa: 35, spd: 64, spe: 58 }, + abilities: { 0: "Mold Breaker", 1: "Own Tempo", H: "Pickpocket" }, heightm: 0.4, weightkg: 8.9, color: "Pink", @@ -17342,8 +17342,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tinkatuff", types: ["Fairy", "Steel"], gender: "F", - baseStats: {hp: 65, atk: 55, def: 55, spa: 45, spd: 82, spe: 78}, - abilities: {0: "Mold Breaker", 1: "Own Tempo", H: "Pickpocket"}, + baseStats: { hp: 65, atk: 55, def: 55, spa: 45, spd: 82, spe: 78 }, + abilities: { 0: "Mold Breaker", 1: "Own Tempo", H: "Pickpocket" }, heightm: 0.7, weightkg: 59.1, color: "Pink", @@ -17357,8 +17357,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tinkaton", types: ["Fairy", "Steel"], gender: "F", - baseStats: {hp: 85, atk: 75, def: 77, spa: 70, spd: 105, spe: 94}, - abilities: {0: "Mold Breaker", 1: "Own Tempo", H: "Pickpocket"}, + baseStats: { hp: 85, atk: 75, def: 77, spa: 70, spd: 105, spe: 94 }, + abilities: { 0: "Mold Breaker", 1: "Own Tempo", H: "Pickpocket" }, heightm: 0.7, weightkg: 112.8, color: "Pink", @@ -17370,8 +17370,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 960, name: "Wiglett", types: ["Water"], - baseStats: {hp: 10, atk: 55, def: 25, spa: 35, spd: 25, spe: 95}, - abilities: {0: "Gooey", 1: "Rattled", H: "Sand Veil"}, + baseStats: { hp: 10, atk: 55, def: 25, spa: 35, spd: 25, spe: 95 }, + abilities: { 0: "Gooey", 1: "Rattled", H: "Sand Veil" }, heightm: 1.2, weightkg: 1.8, color: "White", @@ -17382,8 +17382,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 961, name: "Wugtrio", types: ["Water"], - baseStats: {hp: 35, atk: 100, def: 50, spa: 50, spd: 70, spe: 120}, - abilities: {0: "Gooey", 1: "Rattled", H: "Sand Veil"}, + baseStats: { hp: 35, atk: 100, def: 50, spa: 50, spd: 70, spe: 120 }, + abilities: { 0: "Gooey", 1: "Rattled", H: "Sand Veil" }, heightm: 1.2, weightkg: 5.4, color: "Red", @@ -17395,8 +17395,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 962, name: "Bombirdier", types: ["Flying", "Dark"], - baseStats: {hp: 70, atk: 103, def: 85, spa: 60, spd: 85, spe: 82}, - abilities: {0: "Big Pecks", 1: "Keen Eye", H: "Rocky Payload"}, + baseStats: { hp: 70, atk: 103, def: 85, spa: 60, spd: 85, spe: 82 }, + abilities: { 0: "Big Pecks", 1: "Keen Eye", H: "Rocky Payload" }, heightm: 1.5, weightkg: 42.9, color: "White", @@ -17406,8 +17406,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 963, name: "Finizen", types: ["Water"], - baseStats: {hp: 70, atk: 45, def: 40, spa: 45, spd: 40, spe: 75}, - abilities: {0: "Water Veil"}, + baseStats: { hp: 70, atk: 45, def: 40, spa: 45, spd: 40, spe: 75 }, + abilities: { 0: "Water Veil" }, heightm: 1.3, weightkg: 60.2, color: "Blue", @@ -17419,8 +17419,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Palafin", baseForme: "Zero", types: ["Water"], - baseStats: {hp: 100, atk: 70, def: 72, spa: 53, spd: 62, spe: 100}, - abilities: {0: "Zero to Hero"}, + baseStats: { hp: 100, atk: 70, def: 72, spa: 53, spd: 62, spe: 100 }, + abilities: { 0: "Zero to Hero" }, heightm: 1.3, weightkg: 60.2, color: "Blue", @@ -17436,8 +17436,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Palafin", forme: "Hero", types: ["Water"], - baseStats: {hp: 100, atk: 160, def: 97, spa: 106, spd: 87, spe: 100}, - abilities: {0: "Zero to Hero"}, + baseStats: { hp: 100, atk: 160, def: 97, spa: 106, spd: 87, spe: 100 }, + abilities: { 0: "Zero to Hero" }, heightm: 1.8, weightkg: 97.4, color: "Blue", @@ -17449,8 +17449,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 965, name: "Varoom", types: ["Steel", "Poison"], - baseStats: {hp: 45, atk: 70, def: 63, spa: 30, spd: 45, spe: 47}, - abilities: {0: "Overcoat", H: "Slow Start"}, + baseStats: { hp: 45, atk: 70, def: 63, spa: 30, spd: 45, spe: 47 }, + abilities: { 0: "Overcoat", H: "Slow Start" }, heightm: 1, weightkg: 35, color: "Gray", @@ -17461,8 +17461,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 966, name: "Revavroom", types: ["Steel", "Poison"], - baseStats: {hp: 80, atk: 119, def: 90, spa: 54, spd: 67, spe: 90}, - abilities: {0: "Overcoat", H: "Filter"}, + baseStats: { hp: 80, atk: 119, def: 90, spa: 54, spd: 67, spe: 90 }, + abilities: { 0: "Overcoat", H: "Filter" }, heightm: 1.8, weightkg: 120, color: "Gray", @@ -17474,8 +17474,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 967, name: "Cyclizar", types: ["Dragon", "Normal"], - baseStats: {hp: 70, atk: 95, def: 65, spa: 85, spd: 65, spe: 121}, - abilities: {0: "Shed Skin", H: "Regenerator"}, + baseStats: { hp: 70, atk: 95, def: 65, spa: 85, spd: 65, spe: 121 }, + abilities: { 0: "Shed Skin", H: "Regenerator" }, heightm: 1.6, weightkg: 63, color: "Green", @@ -17485,8 +17485,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 968, name: "Orthworm", types: ["Steel"], - baseStats: {hp: 70, atk: 85, def: 145, spa: 60, spd: 55, spe: 65}, - abilities: {0: "Earth Eater", H: "Sand Veil"}, + baseStats: { hp: 70, atk: 85, def: 145, spa: 60, spd: 55, spe: 65 }, + abilities: { 0: "Earth Eater", H: "Sand Veil" }, heightm: 2.5, weightkg: 310, color: "Pink", @@ -17496,8 +17496,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 969, name: "Glimmet", types: ["Rock", "Poison"], - baseStats: {hp: 48, atk: 35, def: 42, spa: 105, spd: 60, spe: 60}, - abilities: {0: "Toxic Debris", H: "Corrosion"}, + baseStats: { hp: 48, atk: 35, def: 42, spa: 105, spd: 60, spe: 60 }, + abilities: { 0: "Toxic Debris", H: "Corrosion" }, heightm: 0.7, weightkg: 8, color: "Blue", @@ -17508,8 +17508,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 970, name: "Glimmora", types: ["Rock", "Poison"], - baseStats: {hp: 83, atk: 55, def: 90, spa: 130, spd: 81, spe: 86}, - abilities: {0: "Toxic Debris", H: "Corrosion"}, + baseStats: { hp: 83, atk: 55, def: 90, spa: 130, spd: 81, spe: 86 }, + abilities: { 0: "Toxic Debris", H: "Corrosion" }, heightm: 1.5, weightkg: 45, color: "Blue", @@ -17521,8 +17521,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 971, name: "Greavard", types: ["Ghost"], - baseStats: {hp: 50, atk: 61, def: 60, spa: 30, spd: 55, spe: 34}, - abilities: {0: "Pickup", H: "Fluffy"}, + baseStats: { hp: 50, atk: 61, def: 60, spa: 30, spd: 55, spe: 34 }, + abilities: { 0: "Pickup", H: "Fluffy" }, heightm: 0.6, weightkg: 35, color: "White", @@ -17533,8 +17533,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 972, name: "Houndstone", types: ["Ghost"], - baseStats: {hp: 72, atk: 101, def: 100, spa: 50, spd: 97, spe: 68}, - abilities: {0: "Sand Rush", H: "Fluffy"}, + baseStats: { hp: 72, atk: 101, def: 100, spa: 50, spd: 97, spe: 68 }, + abilities: { 0: "Sand Rush", H: "Fluffy" }, heightm: 2, weightkg: 15, color: "White", @@ -17547,8 +17547,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 973, name: "Flamigo", types: ["Flying", "Fighting"], - baseStats: {hp: 82, atk: 115, def: 74, spa: 75, spd: 64, spe: 90}, - abilities: {0: "Scrappy", 1: "Tangled Feet", H: "Costar"}, + baseStats: { hp: 82, atk: 115, def: 74, spa: 75, spd: 64, spe: 90 }, + abilities: { 0: "Scrappy", 1: "Tangled Feet", H: "Costar" }, heightm: 1.6, weightkg: 37, color: "Pink", @@ -17558,8 +17558,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 974, name: "Cetoddle", types: ["Ice"], - baseStats: {hp: 108, atk: 68, def: 45, spa: 30, spd: 40, spe: 43}, - abilities: {0: "Thick Fat", 1: "Snow Cloak", H: "Sheer Force"}, + baseStats: { hp: 108, atk: 68, def: 45, spa: 30, spd: 40, spe: 43 }, + abilities: { 0: "Thick Fat", 1: "Snow Cloak", H: "Sheer Force" }, heightm: 1.2, weightkg: 45, color: "White", @@ -17570,8 +17570,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 975, name: "Cetitan", types: ["Ice"], - baseStats: {hp: 170, atk: 113, def: 65, spa: 45, spd: 55, spe: 73}, - abilities: {0: "Thick Fat", 1: "Slush Rush", H: "Sheer Force"}, + baseStats: { hp: 170, atk: 113, def: 65, spa: 45, spd: 55, spe: 73 }, + abilities: { 0: "Thick Fat", 1: "Slush Rush", H: "Sheer Force" }, heightm: 4.5, weightkg: 700, color: "White", @@ -17584,8 +17584,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 976, name: "Veluza", types: ["Water", "Psychic"], - baseStats: {hp: 90, atk: 102, def: 73, spa: 78, spd: 65, spe: 70}, - abilities: {0: "Mold Breaker", H: "Sharpness"}, + baseStats: { hp: 90, atk: 102, def: 73, spa: 78, spd: 65, spe: 70 }, + abilities: { 0: "Mold Breaker", H: "Sharpness" }, heightm: 2.5, weightkg: 90, color: "Gray", @@ -17595,8 +17595,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 977, name: "Dondozo", types: ["Water"], - baseStats: {hp: 150, atk: 100, def: 115, spa: 65, spd: 65, spe: 35}, - abilities: {0: "Unaware", 1: "Oblivious", H: "Water Veil"}, + baseStats: { hp: 150, atk: 100, def: 115, spa: 65, spd: 65, spe: 35 }, + abilities: { 0: "Unaware", 1: "Oblivious", H: "Water Veil" }, heightm: 12, weightkg: 220, color: "Blue", @@ -17607,8 +17607,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tatsugiri", baseForme: "Curly", types: ["Dragon", "Water"], - baseStats: {hp: 68, atk: 50, def: 60, spa: 120, spd: 95, spe: 82}, - abilities: {0: "Commander", H: "Storm Drain"}, + baseStats: { hp: 68, atk: 50, def: 60, spa: 120, spd: 95, spe: 82 }, + abilities: { 0: "Commander", H: "Storm Drain" }, heightm: 0.3, weightkg: 8, color: "Red", @@ -17620,8 +17620,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 979, name: "Annihilape", types: ["Fighting", "Ghost"], - baseStats: {hp: 110, atk: 115, def: 80, spa: 50, spd: 90, spe: 90}, - abilities: {0: "Vital Spirit", 1: "Inner Focus", H: "Defiant"}, + baseStats: { hp: 110, atk: 115, def: 80, spa: 50, spd: 90, spe: 90 }, + abilities: { 0: "Vital Spirit", 1: "Inner Focus", H: "Defiant" }, heightm: 1.2, weightkg: 56, color: "Gray", @@ -17634,8 +17634,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 980, name: "Clodsire", types: ["Poison", "Ground"], - baseStats: {hp: 130, atk: 75, def: 60, spa: 45, spd: 100, spe: 20}, - abilities: {0: "Poison Point", 1: "Water Absorb", H: "Unaware"}, + baseStats: { hp: 130, atk: 75, def: 60, spa: 45, spd: 100, spe: 20 }, + abilities: { 0: "Poison Point", 1: "Water Absorb", H: "Unaware" }, heightm: 1.8, weightkg: 223, color: "Brown", @@ -17647,8 +17647,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 981, name: "Farigiraf", types: ["Normal", "Psychic"], - baseStats: {hp: 120, atk: 90, def: 70, spa: 110, spd: 70, spe: 60}, - abilities: {0: "Cud Chew", 1: "Armor Tail", H: "Sap Sipper"}, + baseStats: { hp: 120, atk: 90, def: 70, spa: 110, spd: 70, spe: 60 }, + abilities: { 0: "Cud Chew", 1: "Armor Tail", H: "Sap Sipper" }, heightm: 3.2, weightkg: 160, color: "Brown", @@ -17662,8 +17662,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Dudunsparce", baseForme: "Two-Segment", types: ["Normal"], - baseStats: {hp: 125, atk: 100, def: 80, spa: 85, spd: 75, spe: 55}, - abilities: {0: "Serene Grace", 1: "Run Away", H: "Rattled"}, + baseStats: { hp: 125, atk: 100, def: 80, spa: 85, spd: 75, spe: 55 }, + abilities: { 0: "Serene Grace", 1: "Run Away", H: "Rattled" }, heightm: 3.6, weightkg: 39.2, color: "Yellow", @@ -17680,8 +17680,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Dudunsparce", forme: "Three-Segment", types: ["Normal"], - baseStats: {hp: 125, atk: 100, def: 80, spa: 85, spd: 75, spe: 55}, - abilities: {0: "Serene Grace", 1: "Run Away", H: "Rattled"}, + baseStats: { hp: 125, atk: 100, def: 80, spa: 85, spd: 75, spe: 55 }, + abilities: { 0: "Serene Grace", 1: "Run Away", H: "Rattled" }, heightm: 4.5, weightkg: 47.4, color: "Yellow", @@ -17694,8 +17694,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 983, name: "Kingambit", types: ["Dark", "Steel"], - baseStats: {hp: 100, atk: 135, def: 120, spa: 60, spd: 85, spe: 50}, - abilities: {0: "Defiant", 1: "Supreme Overlord", H: "Pressure"}, + baseStats: { hp: 100, atk: 135, def: 120, spa: 60, spd: 85, spe: 50 }, + abilities: { 0: "Defiant", 1: "Supreme Overlord", H: "Pressure" }, heightm: 2, weightkg: 120, color: "Black", @@ -17709,8 +17709,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Great Tusk", types: ["Ground", "Fighting"], gender: "N", - baseStats: {hp: 115, atk: 131, def: 131, spa: 53, spd: 53, spe: 87}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 115, atk: 131, def: 131, spa: 53, spd: 53, spe: 87 }, + abilities: { 0: "Protosynthesis" }, heightm: 2.2, weightkg: 320, color: "Purple", @@ -17722,8 +17722,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Scream Tail", types: ["Fairy", "Psychic"], gender: "N", - baseStats: {hp: 115, atk: 65, def: 99, spa: 65, spd: 115, spe: 111}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 115, atk: 65, def: 99, spa: 65, spd: 115, spe: 111 }, + abilities: { 0: "Protosynthesis" }, heightm: 1.2, weightkg: 8, color: "Pink", @@ -17735,8 +17735,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Brute Bonnet", types: ["Grass", "Dark"], gender: "N", - baseStats: {hp: 111, atk: 127, def: 99, spa: 79, spd: 99, spe: 55}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 111, atk: 127, def: 99, spa: 79, spd: 99, spe: 55 }, + abilities: { 0: "Protosynthesis" }, heightm: 1.2, weightkg: 21, color: "White", @@ -17748,8 +17748,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Flutter Mane", types: ["Ghost", "Fairy"], gender: "N", - baseStats: {hp: 55, atk: 55, def: 55, spa: 135, spd: 135, spe: 135}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 55, atk: 55, def: 55, spa: 135, spd: 135, spe: 135 }, + abilities: { 0: "Protosynthesis" }, heightm: 1.4, weightkg: 4, color: "Gray", @@ -17761,8 +17761,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Slither Wing", types: ["Bug", "Fighting"], gender: "N", - baseStats: {hp: 85, atk: 135, def: 79, spa: 85, spd: 105, spe: 81}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 85, atk: 135, def: 79, spa: 85, spd: 105, spe: 81 }, + abilities: { 0: "Protosynthesis" }, heightm: 3.2, weightkg: 92, color: "White", @@ -17774,8 +17774,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Sandy Shocks", types: ["Electric", "Ground"], gender: "N", - baseStats: {hp: 85, atk: 81, def: 97, spa: 121, spd: 85, spe: 101}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 85, atk: 81, def: 97, spa: 121, spd: 85, spe: 101 }, + abilities: { 0: "Protosynthesis" }, heightm: 2.3, weightkg: 60, color: "Gray", @@ -17787,8 +17787,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Treads", types: ["Ground", "Steel"], gender: "N", - baseStats: {hp: 90, atk: 112, def: 120, spa: 72, spd: 70, spe: 106}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 90, atk: 112, def: 120, spa: 72, spd: 70, spe: 106 }, + abilities: { 0: "Quark Drive" }, heightm: 0.9, weightkg: 240, color: "Gray", @@ -17800,8 +17800,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Bundle", types: ["Ice", "Water"], gender: "N", - baseStats: {hp: 56, atk: 80, def: 114, spa: 124, spd: 60, spe: 136}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 56, atk: 80, def: 114, spa: 124, spd: 60, spe: 136 }, + abilities: { 0: "Quark Drive" }, heightm: 0.6, weightkg: 11, color: "Red", @@ -17813,8 +17813,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Hands", types: ["Fighting", "Electric"], gender: "N", - baseStats: {hp: 154, atk: 140, def: 108, spa: 50, spd: 68, spe: 50}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 154, atk: 140, def: 108, spa: 50, spd: 68, spe: 50 }, + abilities: { 0: "Quark Drive" }, heightm: 1.8, weightkg: 380.7, color: "Gray", @@ -17826,8 +17826,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Jugulis", types: ["Dark", "Flying"], gender: "N", - baseStats: {hp: 94, atk: 80, def: 86, spa: 122, spd: 80, spe: 108}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 94, atk: 80, def: 86, spa: 122, spd: 80, spe: 108 }, + abilities: { 0: "Quark Drive" }, heightm: 1.3, weightkg: 111, color: "Blue", @@ -17839,8 +17839,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Moth", types: ["Fire", "Poison"], gender: "N", - baseStats: {hp: 80, atk: 70, def: 60, spa: 140, spd: 110, spe: 110}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 80, atk: 70, def: 60, spa: 140, spd: 110, spe: 110 }, + abilities: { 0: "Quark Drive" }, heightm: 1.2, weightkg: 36, color: "White", @@ -17852,8 +17852,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Thorns", types: ["Rock", "Electric"], gender: "N", - baseStats: {hp: 100, atk: 134, def: 110, spa: 70, spd: 84, spe: 72}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 100, atk: 134, def: 110, spa: 70, spd: 84, spe: 72 }, + abilities: { 0: "Quark Drive" }, heightm: 1.6, weightkg: 303, color: "Green", @@ -17864,8 +17864,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 996, name: "Frigibax", types: ["Dragon", "Ice"], - baseStats: {hp: 65, atk: 75, def: 45, spa: 35, spd: 45, spe: 55}, - abilities: {0: "Thermal Exchange", H: "Ice Body"}, + baseStats: { hp: 65, atk: 75, def: 45, spa: 35, spd: 45, spe: 55 }, + abilities: { 0: "Thermal Exchange", H: "Ice Body" }, heightm: 0.5, weightkg: 17, color: "Gray", @@ -17876,8 +17876,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 997, name: "Arctibax", types: ["Dragon", "Ice"], - baseStats: {hp: 90, atk: 95, def: 66, spa: 45, spd: 65, spe: 62}, - abilities: {0: "Thermal Exchange", H: "Ice Body"}, + baseStats: { hp: 90, atk: 95, def: 66, spa: 45, spd: 65, spe: 62 }, + abilities: { 0: "Thermal Exchange", H: "Ice Body" }, heightm: 0.8, weightkg: 30, color: "Blue", @@ -17890,8 +17890,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 998, name: "Baxcalibur", types: ["Dragon", "Ice"], - baseStats: {hp: 115, atk: 145, def: 92, spa: 75, spd: 86, spe: 87}, - abilities: {0: "Thermal Exchange", H: "Ice Body"}, + baseStats: { hp: 115, atk: 145, def: 92, spa: 75, spd: 86, spe: 87 }, + abilities: { 0: "Thermal Exchange", H: "Ice Body" }, heightm: 2.1, weightkg: 210, color: "Blue", @@ -17905,8 +17905,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Chest", types: ["Ghost"], gender: "N", - baseStats: {hp: 45, atk: 30, def: 70, spa: 75, spd: 70, spe: 10}, - abilities: {0: "Rattled"}, + baseStats: { hp: 45, atk: 30, def: 70, spa: 75, spd: 70, spe: 10 }, + abilities: { 0: "Rattled" }, heightm: 0.3, weightkg: 5, color: "Red", @@ -17922,8 +17922,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Roaming", types: ["Ghost"], gender: "N", - baseStats: {hp: 45, atk: 30, def: 25, spa: 75, spd: 45, spe: 80}, - abilities: {0: "Run Away"}, + baseStats: { hp: 45, atk: 30, def: 25, spa: 75, spd: 45, spe: 80 }, + abilities: { 0: "Run Away" }, heightm: 0.1, weightkg: 0.1, color: "Gray", @@ -17935,8 +17935,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Gholdengo", types: ["Steel", "Ghost"], gender: "N", - baseStats: {hp: 87, atk: 60, def: 95, spa: 133, spd: 91, spe: 84}, - abilities: {0: "Good as Gold"}, + baseStats: { hp: 87, atk: 60, def: 95, spa: 133, spd: 91, spe: 84 }, + abilities: { 0: "Good as Gold" }, heightm: 1.2, weightkg: 30, color: "Yellow", @@ -17950,8 +17950,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Wo-Chien", types: ["Dark", "Grass"], gender: "N", - baseStats: {hp: 85, atk: 85, def: 100, spa: 95, spd: 135, spe: 70}, - abilities: {0: "Tablets of Ruin"}, + baseStats: { hp: 85, atk: 85, def: 100, spa: 95, spd: 135, spe: 70 }, + abilities: { 0: "Tablets of Ruin" }, heightm: 1.5, weightkg: 74.2, color: "Brown", @@ -17963,8 +17963,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Chien-Pao", types: ["Dark", "Ice"], gender: "N", - baseStats: {hp: 80, atk: 120, def: 80, spa: 90, spd: 65, spe: 135}, - abilities: {0: "Sword of Ruin"}, + baseStats: { hp: 80, atk: 120, def: 80, spa: 90, spd: 65, spe: 135 }, + abilities: { 0: "Sword of Ruin" }, heightm: 1.9, weightkg: 152.2, color: "White", @@ -17976,8 +17976,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Ting-Lu", types: ["Dark", "Ground"], gender: "N", - baseStats: {hp: 155, atk: 110, def: 125, spa: 55, spd: 80, spe: 45}, - abilities: {0: "Vessel of Ruin"}, + baseStats: { hp: 155, atk: 110, def: 125, spa: 55, spd: 80, spe: 45 }, + abilities: { 0: "Vessel of Ruin" }, heightm: 2.7, weightkg: 699.7, color: "Brown", @@ -17989,8 +17989,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Chi-Yu", types: ["Dark", "Fire"], gender: "N", - baseStats: {hp: 55, atk: 80, def: 80, spa: 135, spd: 120, spe: 100}, - abilities: {0: "Beads of Ruin"}, + baseStats: { hp: 55, atk: 80, def: 80, spa: 135, spd: 120, spe: 100 }, + abilities: { 0: "Beads of Ruin" }, heightm: 0.4, weightkg: 4.9, color: "Red", @@ -18002,8 +18002,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Roaring Moon", types: ["Dragon", "Dark"], gender: "N", - baseStats: {hp: 105, atk: 139, def: 71, spa: 55, spd: 101, spe: 119}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 105, atk: 139, def: 71, spa: 55, spd: 101, spe: 119 }, + abilities: { 0: "Protosynthesis" }, heightm: 2, weightkg: 380, color: "Blue", @@ -18015,8 +18015,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Valiant", types: ["Fairy", "Fighting"], gender: "N", - baseStats: {hp: 74, atk: 130, def: 90, spa: 120, spd: 60, spe: 116}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 74, atk: 130, def: 90, spa: 120, spd: 60, spe: 116 }, + abilities: { 0: "Quark Drive" }, heightm: 1.4, weightkg: 35, color: "White", @@ -18028,8 +18028,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Koraidon", types: ["Fighting", "Dragon"], gender: "N", - baseStats: {hp: 100, atk: 135, def: 115, spa: 85, spd: 100, spe: 135}, - abilities: {0: "Orichalcum Pulse"}, + baseStats: { hp: 100, atk: 135, def: 115, spa: 85, spd: 100, spe: 135 }, + abilities: { 0: "Orichalcum Pulse" }, heightm: 2.5, weightkg: 303, color: "Red", @@ -18041,8 +18041,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Miraidon", types: ["Electric", "Dragon"], gender: "N", - baseStats: {hp: 100, atk: 85, def: 100, spa: 135, spd: 115, spe: 135}, - abilities: {0: "Hadron Engine"}, + baseStats: { hp: 100, atk: 85, def: 100, spa: 135, spd: 115, spe: 135 }, + abilities: { 0: "Hadron Engine" }, heightm: 3.5, weightkg: 240, color: "Purple", @@ -18054,8 +18054,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Walking Wake", types: ["Water", "Dragon"], gender: "N", - baseStats: {hp: 99, atk: 83, def: 91, spa: 125, spd: 83, spe: 109}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 99, atk: 83, def: 91, spa: 125, spd: 83, spe: 109 }, + abilities: { 0: "Protosynthesis" }, heightm: 3.5, weightkg: 280, color: "Blue", @@ -18067,8 +18067,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Leaves", types: ["Grass", "Psychic"], gender: "N", - baseStats: {hp: 90, atk: 130, def: 88, spa: 70, spd: 108, spe: 104}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 90, atk: 130, def: 88, spa: 70, spd: 108, spe: 104 }, + abilities: { 0: "Quark Drive" }, heightm: 1.5, weightkg: 125, color: "Green", @@ -18079,8 +18079,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 1011, name: "Dipplin", types: ["Grass", "Dragon"], - baseStats: {hp: 80, atk: 80, def: 110, spa: 95, spd: 80, spe: 40}, - abilities: {0: "Supersweet Syrup", 1: "Gluttony", H: "Sticky Hold"}, + baseStats: { hp: 80, atk: 80, def: 110, spa: 95, spd: 80, spe: 40 }, + abilities: { 0: "Supersweet Syrup", 1: "Gluttony", H: "Sticky Hold" }, heightm: 0.4, weightkg: 4.4, color: "Green", @@ -18096,8 +18096,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Counterfeit", types: ["Grass", "Ghost"], gender: "N", - baseStats: {hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50}, - abilities: {0: "Hospitality", H: "Heatproof"}, + baseStats: { hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50 }, + abilities: { 0: "Hospitality", H: "Heatproof" }, heightm: 0.1, weightkg: 1.1, color: "Green", @@ -18113,8 +18113,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Artisan", types: ["Grass", "Ghost"], gender: "N", - baseStats: {hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50}, - abilities: {0: "Hospitality", H: "Heatproof"}, + baseStats: { hp: 40, atk: 45, def: 45, spa: 74, spd: 54, spe: 50 }, + abilities: { 0: "Hospitality", H: "Heatproof" }, heightm: 0.1, weightkg: 1.1, color: "Green", @@ -18127,8 +18127,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Unremarkable", types: ["Grass", "Ghost"], gender: "N", - baseStats: {hp: 71, atk: 60, def: 106, spa: 121, spd: 80, spe: 70}, - abilities: {0: "Hospitality", H: "Heatproof"}, + baseStats: { hp: 71, atk: 60, def: 106, spa: 121, spd: 80, spe: 70 }, + abilities: { 0: "Hospitality", H: "Heatproof" }, heightm: 0.2, weightkg: 2.2, color: "Green", @@ -18146,8 +18146,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Masterpiece", types: ["Grass", "Ghost"], gender: "N", - baseStats: {hp: 71, atk: 60, def: 106, spa: 121, spd: 80, spe: 70}, - abilities: {0: "Hospitality", H: "Heatproof"}, + baseStats: { hp: 71, atk: 60, def: 106, spa: 121, spd: 80, spe: 70 }, + abilities: { 0: "Hospitality", H: "Heatproof" }, heightm: 0.2, weightkg: 2.2, color: "Green", @@ -18161,8 +18161,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Okidogi", types: ["Poison", "Fighting"], gender: "M", - baseStats: {hp: 88, atk: 128, def: 115, spa: 58, spd: 86, spe: 80}, - abilities: {0: "Toxic Chain", H: "Guard Dog"}, + baseStats: { hp: 88, atk: 128, def: 115, spa: 58, spd: 86, spe: 80 }, + abilities: { 0: "Toxic Chain", H: "Guard Dog" }, heightm: 1.8, weightkg: 92, color: "Black", @@ -18174,8 +18174,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Munkidori", types: ["Poison", "Psychic"], gender: "M", - baseStats: {hp: 88, atk: 75, def: 66, spa: 130, spd: 90, spe: 106}, - abilities: {0: "Toxic Chain", H: "Frisk"}, + baseStats: { hp: 88, atk: 75, def: 66, spa: 130, spd: 90, spe: 106 }, + abilities: { 0: "Toxic Chain", H: "Frisk" }, heightm: 1, weightkg: 12.2, color: "Black", @@ -18187,8 +18187,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Fezandipiti", types: ["Poison", "Fairy"], gender: "M", - baseStats: {hp: 88, atk: 91, def: 82, spa: 70, spd: 125, spe: 99}, - abilities: {0: "Toxic Chain", H: "Technician"}, + baseStats: { hp: 88, atk: 91, def: 82, spa: 70, spd: 125, spe: 99 }, + abilities: { 0: "Toxic Chain", H: "Technician" }, heightm: 1.4, weightkg: 30.1, color: "Black", @@ -18201,8 +18201,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Teal", types: ["Grass"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Defiant"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Defiant" }, heightm: 1.2, weightkg: 39.8, color: "Green", @@ -18219,8 +18219,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Wellspring", types: ["Grass", "Water"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Water Absorb"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Water Absorb" }, heightm: 1.2, weightkg: 39.8, color: "Blue", @@ -18236,8 +18236,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Hearthflame", types: ["Grass", "Fire"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Mold Breaker"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Mold Breaker" }, heightm: 1.2, weightkg: 39.8, color: "Red", @@ -18253,8 +18253,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Cornerstone", types: ["Grass", "Rock"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Sturdy"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Sturdy" }, heightm: 1.2, weightkg: 39.8, color: "Gray", @@ -18270,8 +18270,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Teal-Tera", types: ["Grass"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Embody Aspect (Teal)"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Embody Aspect (Teal)" }, heightm: 1.2, weightkg: 39.8, color: "Green", @@ -18286,8 +18286,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Wellspring-Tera", types: ["Grass", "Water"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Embody Aspect (Wellspring)"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Embody Aspect (Wellspring)" }, heightm: 1.2, weightkg: 39.8, color: "Blue", @@ -18303,8 +18303,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Hearthflame-Tera", types: ["Grass", "Fire"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Embody Aspect (Hearthflame)"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Embody Aspect (Hearthflame)" }, heightm: 1.2, weightkg: 39.8, color: "Red", @@ -18320,8 +18320,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Cornerstone-Tera", types: ["Grass", "Rock"], gender: "F", - baseStats: {hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110}, - abilities: {0: "Embody Aspect (Cornerstone)"}, + baseStats: { hp: 80, atk: 120, def: 84, spa: 60, spd: 96, spe: 110 }, + abilities: { 0: "Embody Aspect (Cornerstone)" }, heightm: 1.2, weightkg: 39.8, color: "Gray", @@ -18334,8 +18334,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 1018, name: "Archaludon", types: ["Steel", "Dragon"], - baseStats: {hp: 90, atk: 105, def: 130, spa: 125, spd: 65, spe: 85}, - abilities: {0: "Stamina", 1: "Sturdy", H: "Stalwart"}, + baseStats: { hp: 90, atk: 105, def: 130, spa: 125, spd: 65, spe: 85 }, + abilities: { 0: "Stamina", 1: "Sturdy", H: "Stalwart" }, heightm: 2, weightkg: 60, color: "White", @@ -18348,8 +18348,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 1019, name: "Hydrapple", types: ["Grass", "Dragon"], - baseStats: {hp: 106, atk: 80, def: 110, spa: 120, spd: 80, spe: 44}, - abilities: {0: "Supersweet Syrup", 1: "Regenerator", H: "Sticky Hold"}, + baseStats: { hp: 106, atk: 80, def: 110, spa: 120, spd: 80, spe: 44 }, + abilities: { 0: "Supersweet Syrup", 1: "Regenerator", H: "Sticky Hold" }, heightm: 1.8, weightkg: 93, color: "Green", @@ -18363,8 +18363,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Gouging Fire", types: ["Fire", "Dragon"], gender: "N", - baseStats: {hp: 105, atk: 115, def: 121, spa: 65, spd: 93, spe: 91}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 105, atk: 115, def: 121, spa: 65, spd: 93, spe: 91 }, + abilities: { 0: "Protosynthesis" }, heightm: 3.5, weightkg: 590, color: "Brown", @@ -18375,8 +18375,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Raging Bolt", types: ["Electric", "Dragon"], gender: "N", - baseStats: {hp: 125, atk: 73, def: 91, spa: 137, spd: 89, spe: 75}, - abilities: {0: "Protosynthesis"}, + baseStats: { hp: 125, atk: 73, def: 91, spa: 137, spd: 89, spe: 75 }, + abilities: { 0: "Protosynthesis" }, heightm: 5.2, weightkg: 480, color: "Yellow", @@ -18387,8 +18387,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Boulder", types: ["Rock", "Psychic"], gender: "N", - baseStats: {hp: 90, atk: 120, def: 80, spa: 68, spd: 108, spe: 124}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 90, atk: 120, def: 80, spa: 68, spd: 108, spe: 124 }, + abilities: { 0: "Quark Drive" }, heightm: 1.5, weightkg: 162.5, color: "Gray", @@ -18399,8 +18399,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Iron Crown", types: ["Steel", "Psychic"], gender: "N", - baseStats: {hp: 90, atk: 72, def: 100, spa: 122, spd: 108, spe: 98}, - abilities: {0: "Quark Drive"}, + baseStats: { hp: 90, atk: 72, def: 100, spa: 122, spd: 108, spe: 98 }, + abilities: { 0: "Quark Drive" }, heightm: 1.6, weightkg: 156, color: "Blue", @@ -18410,8 +18410,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 1024, name: "Terapagos", types: ["Normal"], - baseStats: {hp: 90, atk: 65, def: 85, spa: 65, spd: 85, spe: 60}, - abilities: {0: "Tera Shift"}, + baseStats: { hp: 90, atk: 65, def: 85, spa: 65, spd: 85, spe: 60 }, + abilities: { 0: "Tera Shift" }, heightm: 0.2, weightkg: 6.5, color: "Blue", @@ -18427,8 +18427,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Terapagos", forme: "Terastal", types: ["Normal"], - baseStats: {hp: 95, atk: 95, def: 110, spa: 105, spd: 110, spe: 85}, - abilities: {0: "Tera Shell"}, + baseStats: { hp: 95, atk: 95, def: 110, spa: 105, spd: 110, spe: 85 }, + abilities: { 0: "Tera Shell" }, heightm: 0.3, weightkg: 16, color: "Blue", @@ -18442,8 +18442,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Terapagos", forme: "Stellar", types: ["Normal"], - baseStats: {hp: 160, atk: 105, def: 110, spa: 130, spd: 110, spe: 85}, - abilities: {0: "Teraform Zero"}, + baseStats: { hp: 160, atk: 105, def: 110, spa: 130, spd: 110, spe: 85 }, + abilities: { 0: "Teraform Zero" }, heightm: 1.7, weightkg: 77, color: "Blue", @@ -18456,8 +18456,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pecharunt", types: ["Poison", "Ghost"], gender: "N", - baseStats: {hp: 88, atk: 88, def: 160, spa: 88, spd: 88, spe: 88}, - abilities: {0: "Poison Puppeteer"}, + baseStats: { hp: 88, atk: 88, def: 160, spa: 88, spd: 88, spe: 88 }, + abilities: { 0: "Poison Puppeteer" }, heightm: 0.3, weightkg: 0.3, color: "Purple", @@ -18468,8 +18468,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: 0, name: "MissingNo.", types: ["Bird", "Normal"], - baseStats: {hp: 33, atk: 136, def: 0, spa: 6, spd: 6, spe: 29}, - abilities: {0: ""}, + baseStats: { hp: 33, atk: 136, def: 0, spa: 6, spd: 6, spe: 29 }, + abilities: { 0: "" }, heightm: 3, weightkg: 1590.8, color: "Gray", @@ -18479,8 +18479,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -1, name: "Syclar", types: ["Ice", "Bug"], - baseStats: {hp: 40, atk: 76, def: 45, spa: 74, spd: 39, spe: 91}, - abilities: {0: "Compound Eyes", 1: "Snow Cloak", H: "Ice Body"}, + baseStats: { hp: 40, atk: 76, def: 45, spa: 74, spd: 39, spe: 91 }, + abilities: { 0: "Compound Eyes", 1: "Snow Cloak", H: "Ice Body" }, heightm: 0.2, weightkg: 4, color: "Blue", @@ -18492,8 +18492,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -2, name: "Syclant", types: ["Ice", "Bug"], - baseStats: {hp: 70, atk: 116, def: 70, spa: 114, spd: 64, spe: 121}, - abilities: {0: "Compound Eyes", 1: "Mountaineer", H: "Ice Body"}, + baseStats: { hp: 70, atk: 116, def: 70, spa: 114, spd: 64, spe: 121 }, + abilities: { 0: "Compound Eyes", 1: "Mountaineer", H: "Ice Body" }, heightm: 1.7, weightkg: 52, color: "Blue", @@ -18506,8 +18506,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -3, name: "Revenankh", types: ["Ghost", "Fighting"], - baseStats: {hp: 90, atk: 105, def: 90, spa: 65, spd: 110, spe: 65}, - abilities: {0: "Air Lock", 1: "Triage", H: "Shed Skin"}, + baseStats: { hp: 90, atk: 105, def: 90, spa: 65, spd: 110, spe: 65 }, + abilities: { 0: "Air Lock", 1: "Triage", H: "Shed Skin" }, heightm: 1.8, weightkg: 44, color: "White", @@ -18518,8 +18518,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -4, name: "Embirch", types: ["Fire", "Grass"], - baseStats: {hp: 60, atk: 40, def: 55, spa: 65, spd: 40, spe: 60}, - abilities: {0: "Reckless", 1: "Leaf Guard", H: "Chlorophyll"}, + baseStats: { hp: 60, atk: 40, def: 55, spa: 65, spd: 40, spe: 60 }, + abilities: { 0: "Reckless", 1: "Leaf Guard", H: "Chlorophyll" }, heightm: 0.6, weightkg: 15, color: "Brown", @@ -18531,8 +18531,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -5, name: "Flarelm", types: ["Fire", "Grass"], - baseStats: {hp: 90, atk: 50, def: 95, spa: 75, spd: 70, spe: 40}, - abilities: {0: "Rock Head", 1: "Battle Armor", H: "White Smoke"}, + baseStats: { hp: 90, atk: 50, def: 95, spa: 75, spd: 70, spe: 40 }, + abilities: { 0: "Rock Head", 1: "Battle Armor", H: "White Smoke" }, heightm: 1.4, weightkg: 73, color: "Brown", @@ -18546,8 +18546,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -6, name: "Pyroak", types: ["Fire", "Grass"], - baseStats: {hp: 120, atk: 70, def: 105, spa: 70, spd: 65, spe: 60}, - abilities: {0: "Rock Head", 1: "Battle Armor", H: "Contrary"}, + baseStats: { hp: 120, atk: 70, def: 105, spa: 70, spd: 65, spe: 60 }, + abilities: { 0: "Rock Head", 1: "Battle Armor", H: "Contrary" }, heightm: 2.1, weightkg: 168, color: "Brown", @@ -18560,8 +18560,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -7, name: "Breezi", types: ["Poison", "Flying"], - baseStats: {hp: 50, atk: 46, def: 69, spa: 60, spd: 50, spe: 75}, - abilities: {0: "Unburden", 1: "Own Tempo", H: "Frisk"}, + baseStats: { hp: 50, atk: 46, def: 69, spa: 60, spd: 50, spe: 75 }, + abilities: { 0: "Unburden", 1: "Own Tempo", H: "Frisk" }, heightm: 0.4, weightkg: 0.6, color: "Purple", @@ -18573,8 +18573,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -8, name: "Fidgit", types: ["Poison", "Ground"], - baseStats: {hp: 95, atk: 76, def: 109, spa: 90, spd: 80, spe: 105}, - abilities: {0: "Persistent", 1: "Vital Spirit", H: "Frisk"}, + baseStats: { hp: 95, atk: 76, def: 109, spa: 90, spd: 80, spe: 105 }, + abilities: { 0: "Persistent", 1: "Vital Spirit", H: "Frisk" }, heightm: 0.9, weightkg: 53, color: "Purple", @@ -18588,8 +18588,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Rebble", types: ["Rock"], gender: "N", - baseStats: {hp: 45, atk: 25, def: 65, spa: 75, spd: 55, spe: 80}, - abilities: {0: "Levitate", 1: "Solid Rock", H: "Sniper"}, + baseStats: { hp: 45, atk: 25, def: 65, spa: 75, spd: 55, spe: 80 }, + abilities: { 0: "Levitate", 1: "Solid Rock", H: "Sniper" }, heightm: 0.3, weightkg: 7, color: "Gray", @@ -18602,8 +18602,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Tactite", types: ["Rock"], gender: "N", - baseStats: {hp: 70, atk: 40, def: 65, spa: 100, spd: 65, spe: 95}, - abilities: {0: "Levitate", 1: "Technician", H: "Sniper"}, + baseStats: { hp: 70, atk: 40, def: 65, spa: 100, spd: 65, spe: 95 }, + abilities: { 0: "Levitate", 1: "Technician", H: "Sniper" }, heightm: 0.6, weightkg: 16, color: "Gray", @@ -18618,8 +18618,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Stratagem", types: ["Rock"], gender: "N", - baseStats: {hp: 90, atk: 60, def: 65, spa: 120, spd: 70, spe: 130}, - abilities: {0: "Levitate", 1: "Technician", H: "Sniper"}, + baseStats: { hp: 90, atk: 60, def: 65, spa: 120, spd: 70, spe: 130 }, + abilities: { 0: "Levitate", 1: "Technician", H: "Sniper" }, heightm: 0.9, weightkg: 45, color: "Gray", @@ -18632,8 +18632,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -12, name: "Privatyke", types: ["Water", "Fighting"], - baseStats: {hp: 65, atk: 75, def: 65, spa: 40, spd: 60, spe: 45}, - abilities: {0: "Unaware", H: "Technician"}, + baseStats: { hp: 65, atk: 75, def: 65, spa: 40, spd: 60, spe: 45 }, + abilities: { 0: "Unaware", H: "Technician" }, heightm: 1, weightkg: 35, color: "Green", @@ -18645,8 +18645,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -13, name: "Arghonaut", types: ["Water", "Fighting"], - baseStats: {hp: 105, atk: 110, def: 95, spa: 70, spd: 100, spe: 75}, - abilities: {0: "Unaware", H: "Technician"}, + baseStats: { hp: 105, atk: 110, def: 95, spa: 70, spd: 100, spe: 75 }, + abilities: { 0: "Unaware", H: "Technician" }, heightm: 1.7, weightkg: 151, color: "Green", @@ -18659,8 +18659,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -14, name: "Kitsunoh", types: ["Ghost", "Steel"], - baseStats: {hp: 80, atk: 117, def: 85, spa: 55, spd: 80, spe: 128}, - abilities: {0: "Frisk", 1: "Limber", H: "Trace"}, + baseStats: { hp: 80, atk: 117, def: 85, spa: 55, spd: 80, spe: 128 }, + abilities: { 0: "Frisk", 1: "Limber", H: "Trace" }, heightm: 1.1, weightkg: 51, color: "Gray", @@ -18674,8 +18674,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -15, name: "Cyclohm", types: ["Electric", "Dragon"], - baseStats: {hp: 108, atk: 60, def: 118, spa: 112, spd: 70, spe: 80}, - abilities: {0: "Shield Dust", 1: "Static", H: "Damp"}, + baseStats: { hp: 108, atk: 60, def: 118, spa: 112, spd: 70, spe: 80 }, + abilities: { 0: "Shield Dust", 1: "Static", H: "Damp" }, heightm: 1.6, weightkg: 59, color: "Yellow", @@ -18688,8 +18688,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -16, name: "Colossoil", types: ["Ground", "Dark"], - baseStats: {hp: 133, atk: 122, def: 72, spa: 71, spd: 72, spe: 95}, - abilities: {0: "Rebound", 1: "Guts", H: "Unnerve"}, + baseStats: { hp: 133, atk: 122, def: 72, spa: 71, spd: 72, spe: 95 }, + abilities: { 0: "Rebound", 1: "Guts", H: "Unnerve" }, heightm: 2.6, weightkg: 683.6, color: "Brown", @@ -18702,8 +18702,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -17, name: "Krilowatt", types: ["Electric", "Water"], - baseStats: {hp: 151, atk: 84, def: 73, spa: 83, spd: 74, spe: 105}, - abilities: {0: "Trace", 1: "Magic Guard", H: "Minus"}, + baseStats: { hp: 151, atk: 84, def: 73, spa: 83, spd: 74, spe: 105 }, + abilities: { 0: "Trace", 1: "Magic Guard", H: "Minus" }, heightm: 0.7, weightkg: 10.6, color: "Red", @@ -18716,8 +18716,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -18, name: "Voodoll", types: ["Normal", "Dark"], - baseStats: {hp: 55, atk: 40, def: 55, spa: 75, spd: 50, spe: 70}, - abilities: {0: "Volt Absorb", 1: "Lightning Rod", H: "Cursed Body"}, + baseStats: { hp: 55, atk: 40, def: 55, spa: 75, spd: 50, spe: 70 }, + abilities: { 0: "Volt Absorb", 1: "Lightning Rod", H: "Cursed Body" }, heightm: 1, weightkg: 25, color: "Brown", @@ -18729,8 +18729,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -19, name: "Voodoom", types: ["Fighting", "Dark"], - baseStats: {hp: 90, atk: 85, def: 80, spa: 130, spd: 80, spe: 110}, - abilities: {0: "Volt Absorb", 1: "Lightning Rod", H: "Cursed Body"}, + baseStats: { hp: 90, atk: 85, def: 80, spa: 130, spd: 80, spe: 110 }, + abilities: { 0: "Volt Absorb", 1: "Lightning Rod", H: "Cursed Body" }, heightm: 2, weightkg: 75.5, color: "Brown", @@ -18743,8 +18743,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -20, name: "Scratchet", types: ["Normal", "Fighting"], - baseStats: {hp: 55, atk: 85, def: 80, spa: 20, spd: 70, spe: 40}, - abilities: {0: "Scrappy", 1: "Prankster", H: "Vital Spirit"}, + baseStats: { hp: 55, atk: 85, def: 80, spa: 20, spd: 70, spe: 40 }, + abilities: { 0: "Scrappy", 1: "Prankster", H: "Vital Spirit" }, heightm: 0.5, weightkg: 20, color: "Brown", @@ -18756,8 +18756,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -21, name: "Tomohawk", types: ["Flying", "Fighting"], - baseStats: {hp: 105, atk: 60, def: 90, spa: 115, spd: 80, spe: 85}, - abilities: {0: "Intimidate", 1: "Prankster", H: "Justified"}, + baseStats: { hp: 105, atk: 60, def: 90, spa: 115, spd: 80, spe: 85 }, + abilities: { 0: "Intimidate", 1: "Prankster", H: "Justified" }, heightm: 1.27, weightkg: 37.2, color: "Red", @@ -18771,8 +18771,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Necturine", types: ["Grass", "Ghost"], gender: "F", - baseStats: {hp: 49, atk: 55, def: 60, spa: 50, spd: 75, spe: 51}, - abilities: {0: "Anticipation", H: "Telepathy"}, + baseStats: { hp: 49, atk: 55, def: 60, spa: 50, spd: 75, spe: 51 }, + abilities: { 0: "Anticipation", H: "Telepathy" }, heightm: 0.3, weightkg: 1.8, color: "White", @@ -18785,8 +18785,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Necturna", types: ["Grass", "Ghost"], gender: "F", - baseStats: {hp: 64, atk: 120, def: 100, spa: 85, spd: 120, spe: 58}, - abilities: {0: "Forewarn", H: "Telepathy"}, + baseStats: { hp: 64, atk: 120, def: 100, spa: 85, spd: 120, spe: 58 }, + abilities: { 0: "Forewarn", H: "Telepathy" }, heightm: 1.65, weightkg: 49.6, color: "Black", @@ -18799,8 +18799,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -24, name: "Mollux", types: ["Fire", "Poison"], - baseStats: {hp: 95, atk: 45, def: 83, spa: 131, spd: 105, spe: 76}, - abilities: {0: "Dry Skin", H: "Illuminate"}, + baseStats: { hp: 95, atk: 45, def: 83, spa: 131, spd: 105, spe: 76 }, + abilities: { 0: "Dry Skin", H: "Illuminate" }, heightm: 1.2, weightkg: 41, color: "Pink", @@ -18811,8 +18811,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -25, name: "Cupra", types: ["Bug", "Psychic"], - baseStats: {hp: 50, atk: 60, def: 49, spa: 67, spd: 30, spe: 44}, - abilities: {0: "Shield Dust", 1: "Keen Eye", H: "Magic Guard"}, + baseStats: { hp: 50, atk: 60, def: 49, spa: 67, spd: 30, spe: 44 }, + abilities: { 0: "Shield Dust", 1: "Keen Eye", H: "Magic Guard" }, heightm: 0.5, weightkg: 4.8, color: "Brown", @@ -18824,8 +18824,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -26, name: "Argalis", types: ["Bug", "Psychic"], - baseStats: {hp: 60, atk: 90, def: 89, spa: 87, spd: 40, spe: 54}, - abilities: {0: "Shed Skin", 1: "Compound Eyes", H: "Overcoat"}, + baseStats: { hp: 60, atk: 90, def: 89, spa: 87, spd: 40, spe: 54 }, + abilities: { 0: "Shed Skin", 1: "Compound Eyes", H: "Overcoat" }, heightm: 1.3, weightkg: 341.4, color: "Gray", @@ -18839,8 +18839,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -27, name: "Aurumoth", types: ["Bug", "Psychic"], - baseStats: {hp: 110, atk: 120, def: 99, spa: 117, spd: 60, spe: 94}, - abilities: {0: "Weak Armor", 1: "No Guard", H: "Light Metal"}, + baseStats: { hp: 110, atk: 120, def: 99, spa: 117, spd: 60, spe: 94 }, + abilities: { 0: "Weak Armor", 1: "No Guard", H: "Light Metal" }, heightm: 2.1, weightkg: 193, color: "Purple", @@ -18853,8 +18853,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -28, name: "Brattler", types: ["Dark", "Grass"], - baseStats: {hp: 80, atk: 70, def: 40, spa: 20, spd: 90, spe: 30}, - abilities: {0: "Harvest", 1: "Infiltrator", H: "Rattled"}, + baseStats: { hp: 80, atk: 70, def: 40, spa: 20, spd: 90, spe: 30 }, + abilities: { 0: "Harvest", 1: "Infiltrator", H: "Rattled" }, heightm: 1.8, weightkg: 11.5, color: "Brown", @@ -18866,8 +18866,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -29, name: "Malaconda", types: ["Dark", "Grass"], - baseStats: {hp: 115, atk: 100, def: 60, spa: 40, spd: 130, spe: 55}, - abilities: {0: "Harvest", 1: "Infiltrator", H: "Drought"}, + baseStats: { hp: 115, atk: 100, def: 60, spa: 40, spd: 130, spe: 55 }, + abilities: { 0: "Harvest", 1: "Infiltrator", H: "Drought" }, heightm: 5.5, weightkg: 108.8, color: "Brown", @@ -18880,8 +18880,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -30, name: "Cawdet", types: ["Steel", "Flying"], - baseStats: {hp: 35, atk: 72, def: 85, spa: 40, spd: 55, spe: 88}, - abilities: {0: "Keen Eye", 1: "Volt Absorb", H: "Big Pecks"}, + baseStats: { hp: 35, atk: 72, def: 85, spa: 40, spd: 55, spe: 88 }, + abilities: { 0: "Keen Eye", 1: "Volt Absorb", H: "Big Pecks" }, heightm: 0.76, weightkg: 25, color: "Gray", @@ -18893,8 +18893,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -31, name: "Cawmodore", types: ["Steel", "Flying"], - baseStats: {hp: 50, atk: 92, def: 130, spa: 65, spd: 75, spe: 118}, - abilities: {0: "Intimidate", 1: "Volt Absorb", H: "Big Pecks"}, + baseStats: { hp: 50, atk: 92, def: 130, spa: 65, spd: 75, spe: 118 }, + abilities: { 0: "Intimidate", 1: "Volt Absorb", H: "Big Pecks" }, heightm: 1.7, weightkg: 37, color: "Black", @@ -18907,8 +18907,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -32, name: "Volkritter", types: ["Water", "Fire"], - baseStats: {hp: 60, atk: 30, def: 50, spa: 80, spd: 60, spe: 70}, - abilities: {0: "Anticipation", 1: "Infiltrator", H: "Unnerve"}, + baseStats: { hp: 60, atk: 30, def: 50, spa: 80, spd: 60, spe: 70 }, + abilities: { 0: "Anticipation", 1: "Infiltrator", H: "Unnerve" }, heightm: 0.3, weightkg: 15, color: "Red", @@ -18920,8 +18920,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -33, name: "Volkraken", types: ["Water", "Fire"], - baseStats: {hp: 100, atk: 45, def: 80, spa: 135, spd: 100, spe: 95}, - abilities: {0: "Analytic", 1: "Infiltrator", H: "Pressure"}, + baseStats: { hp: 100, atk: 45, def: 80, spa: 135, spd: 100, spe: 95 }, + abilities: { 0: "Analytic", 1: "Infiltrator", H: "Pressure" }, heightm: 1.3, weightkg: 44.5, color: "Red", @@ -18934,8 +18934,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -34, name: "Snugglow", types: ["Electric", "Poison"], - baseStats: {hp: 40, atk: 37, def: 79, spa: 91, spd: 68, spe: 70}, - abilities: {0: "Storm Drain", 1: "Vital Spirit", H: "Telepathy"}, + baseStats: { hp: 40, atk: 37, def: 79, spa: 91, spd: 68, spe: 70 }, + abilities: { 0: "Storm Drain", 1: "Vital Spirit", H: "Telepathy" }, heightm: 1.2, weightkg: 6, color: "Purple", @@ -18947,8 +18947,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -35, name: "Plasmanta", types: ["Electric", "Poison"], - baseStats: {hp: 60, atk: 57, def: 119, spa: 131, spd: 98, spe: 100}, - abilities: {0: "Storm Drain", 1: "Vital Spirit", H: "Telepathy"}, + baseStats: { hp: 60, atk: 57, def: 119, spa: 131, spd: 98, spe: 100 }, + abilities: { 0: "Storm Drain", 1: "Vital Spirit", H: "Telepathy" }, heightm: 7, weightkg: 460, color: "Purple", @@ -18961,8 +18961,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -36, name: "Floatoy", types: ["Water"], - baseStats: {hp: 48, atk: 70, def: 40, spa: 70, spd: 30, spe: 77}, - abilities: {0: "Water Veil", 1: "Heatproof", H: "Swift Swim"}, + baseStats: { hp: 48, atk: 70, def: 40, spa: 70, spd: 30, spe: 77 }, + abilities: { 0: "Water Veil", 1: "Heatproof", H: "Swift Swim" }, heightm: 0.8, weightkg: 1.9, color: "White", @@ -18974,8 +18974,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -37, name: "Caimanoe", types: ["Water", "Steel"], - baseStats: {hp: 73, atk: 85, def: 65, spa: 80, spd: 40, spe: 87}, - abilities: {0: "Water Veil", 1: "Heatproof", H: "Light Metal"}, + baseStats: { hp: 73, atk: 85, def: 65, spa: 80, spd: 40, spe: 87 }, + abilities: { 0: "Water Veil", 1: "Heatproof", H: "Light Metal" }, heightm: 1.4, weightkg: 72.5, color: "Gray", @@ -18989,8 +18989,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -38, name: "Naviathan", types: ["Water", "Steel"], - baseStats: {hp: 103, atk: 110, def: 90, spa: 95, spd: 65, spe: 97}, - abilities: {0: "Guts", 1: "Heatproof", H: "Light Metal"}, + baseStats: { hp: 103, atk: 110, def: 90, spa: 95, spd: 65, spe: 97 }, + abilities: { 0: "Guts", 1: "Heatproof", H: "Light Metal" }, heightm: 3, weightkg: 510, color: "Gray", @@ -19003,9 +19003,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -39, name: "Crucibelle", types: ["Rock", "Poison"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 106, atk: 105, def: 65, spa: 75, spd: 85, spe: 104}, - abilities: {0: "Regenerator", 1: "Mold Breaker", H: "Liquid Ooze"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 106, atk: 105, def: 65, spa: 75, spd: 85, spe: 104 }, + abilities: { 0: "Regenerator", 1: "Mold Breaker", H: "Liquid Ooze" }, heightm: 1.3, weightkg: 23.6, color: "Purple", @@ -19020,9 +19020,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseSpecies: "Crucibelle", forme: "Mega", types: ["Rock", "Poison"], - genderRatio: {M: 0.25, F: 0.75}, - baseStats: {hp: 106, atk: 135, def: 75, spa: 91, spd: 125, spe: 108}, - abilities: {0: "Magic Guard"}, + genderRatio: { M: 0.25, F: 0.75 }, + baseStats: { hp: 106, atk: 135, def: 75, spa: 91, spd: 125, spe: 108 }, + abilities: { 0: "Magic Guard" }, heightm: 1.4, weightkg: 22.5, color: "Purple", @@ -19034,8 +19034,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -40, name: "Pluffle", types: ["Fairy"], - baseStats: {hp: 74, atk: 38, def: 51, spa: 65, spd: 78, spe: 49}, - abilities: {0: "Natural Cure", 1: "Aroma Veil", H: "Friend Guard"}, + baseStats: { hp: 74, atk: 38, def: 51, spa: 65, spd: 78, spe: 49 }, + abilities: { 0: "Natural Cure", 1: "Aroma Veil", H: "Friend Guard" }, heightm: 0.8, weightkg: 1.8, color: "Pink", @@ -19047,8 +19047,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -41, name: "Kerfluffle", types: ["Fairy", "Fighting"], - baseStats: {hp: 84, atk: 78, def: 86, spa: 115, spd: 88, spe: 119}, - abilities: {0: "Natural Cure", 1: "Aroma Veil", H: "Friend Guard"}, + baseStats: { hp: 84, atk: 78, def: 86, spa: 115, spd: 88, spe: 119 }, + abilities: { 0: "Natural Cure", 1: "Aroma Veil", H: "Friend Guard" }, heightm: 2.1, weightkg: 24.2, color: "Pink", @@ -19062,8 +19062,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -42, name: "Pajantom", types: ["Dragon", "Ghost"], - baseStats: {hp: 84, atk: 133, def: 71, spa: 51, spd: 111, spe: 101}, - abilities: {0: "Comatose"}, + baseStats: { hp: 84, atk: 133, def: 71, spa: 51, spd: 111, spe: 101 }, + abilities: { 0: "Comatose" }, heightm: 1.1, weightkg: 3.1, color: "Purple", @@ -19074,8 +19074,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -43, name: "Mumbao", types: ["Grass", "Fairy"], - baseStats: {hp: 55, atk: 30, def: 64, spa: 87, spd: 73, spe: 66}, - abilities: {0: "Trace", 1: "Overcoat", H: "Solar Power"}, + baseStats: { hp: 55, atk: 30, def: 64, spa: 87, spd: 73, spe: 66 }, + abilities: { 0: "Trace", 1: "Overcoat", H: "Solar Power" }, heightm: 1, weightkg: 83, color: "Brown", @@ -19087,8 +19087,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -44, name: "Jumbao", types: ["Grass", "Fairy"], - baseStats: {hp: 92, atk: 63, def: 97, spa: 124, spd: 104, spe: 96}, - abilities: {0: "Trace", 1: "Overcoat", H: "Drought"}, + baseStats: { hp: 92, atk: 63, def: 97, spa: 124, spd: 104, spe: 96 }, + abilities: { 0: "Trace", 1: "Overcoat", H: "Drought" }, heightm: 2.4, weightkg: 200, color: "Brown", @@ -19102,9 +19102,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -45, name: "Fawnifer", types: ["Grass"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 49, atk: 61, def: 42, spa: 52, spd: 40, spe: 76}, - abilities: {0: "Overgrow", H: "Lightning Rod"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 49, atk: 61, def: 42, spa: 52, spd: 40, spe: 76 }, + abilities: { 0: "Overgrow", H: "Lightning Rod" }, heightm: 0.7, weightkg: 6.9, color: "Green", @@ -19116,9 +19116,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -46, name: "Electrelk", types: ["Grass", "Electric"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 59, atk: 81, def: 67, spa: 57, spd: 55, spe: 101}, - abilities: {0: "Overgrow", H: "Galvanize"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 59, atk: 81, def: 67, spa: 57, spd: 55, spe: 101 }, + abilities: { 0: "Overgrow", H: "Galvanize" }, heightm: 1.4, weightkg: 41.5, color: "Green", @@ -19132,9 +19132,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -47, name: "Caribolt", types: ["Grass", "Electric"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 84, atk: 106, def: 82, spa: 77, spd: 80, spe: 106}, - abilities: {0: "Overgrow", H: "Galvanize"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 84, atk: 106, def: 82, spa: 77, spd: 80, spe: 106 }, + abilities: { 0: "Overgrow", H: "Galvanize" }, heightm: 2.5, weightkg: 140, color: "Green", @@ -19147,9 +19147,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -48, name: "Smogecko", types: ["Fire"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 48, atk: 66, def: 43, spa: 58, spd: 48, spe: 56}, - abilities: {0: "Blaze", H: "Technician"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 48, atk: 66, def: 43, spa: 58, spd: 48, spe: 56 }, + abilities: { 0: "Blaze", H: "Technician" }, heightm: 0.5, weightkg: 8.5, color: "Red", @@ -19161,9 +19161,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -49, name: "Smoguana", types: ["Fire", "Ground"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 68, atk: 86, def: 53, spa: 68, spd: 68, spe: 76}, - abilities: {0: "Blaze", H: "Technician"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 68, atk: 86, def: 53, spa: 68, spd: 68, spe: 76 }, + abilities: { 0: "Blaze", H: "Technician" }, heightm: 1.5, weightkg: 22.2, color: "Red", @@ -19177,9 +19177,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -50, name: "Smokomodo", types: ["Fire", "Ground"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 88, atk: 116, def: 67, spa: 88, spd: 78, spe: 97}, - abilities: {0: "Blaze", H: "Technician"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 88, atk: 116, def: 67, spa: 88, spd: 78, spe: 97 }, + abilities: { 0: "Blaze", H: "Technician" }, heightm: 2.2, weightkg: 205, color: "Red", @@ -19192,9 +19192,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -51, name: "Swirlpool", types: ["Water"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 61, atk: 49, def: 70, spa: 50, spd: 62, spe: 28}, - abilities: {0: "Torrent", H: "Poison Heal"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 61, atk: 49, def: 70, spa: 50, spd: 62, spe: 28 }, + abilities: { 0: "Torrent", H: "Poison Heal" }, heightm: 0.5, weightkg: 7, color: "Blue", @@ -19206,9 +19206,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -52, name: "Coribalis", types: ["Water", "Bug"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 76, atk: 69, def: 90, spa: 65, spd: 77, spe: 43}, - abilities: {0: "Torrent", H: "Poison Heal"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 76, atk: 69, def: 90, spa: 65, spd: 77, spe: 43 }, + abilities: { 0: "Torrent", H: "Poison Heal" }, heightm: 1.4, weightkg: 24.5, color: "Blue", @@ -19222,9 +19222,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -53, name: "Snaelstrom", types: ["Water", "Bug"], - genderRatio: {M: 0.875, F: 0.125}, - baseStats: {hp: 91, atk: 94, def: 110, spa: 80, spd: 97, spe: 63}, - abilities: {0: "Torrent", H: "Poison Heal"}, + genderRatio: { M: 0.875, F: 0.125 }, + baseStats: { hp: 91, atk: 94, def: 110, spa: 80, spd: 97, spe: 63 }, + abilities: { 0: "Torrent", H: "Poison Heal" }, heightm: 2, weightkg: 120, color: "Blue", @@ -19238,8 +19238,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Justyke", types: ["Steel", "Ground"], gender: "N", - baseStats: {hp: 72, atk: 70, def: 56, spa: 83, spd: 68, spe: 30}, - abilities: {0: "Levitate", 1: "Bulletproof", H: "Justified"}, + baseStats: { hp: 72, atk: 70, def: 56, spa: 83, spd: 68, spe: 30 }, + abilities: { 0: "Levitate", 1: "Bulletproof", H: "Justified" }, heightm: 0.4, weightkg: 36.5, color: "Brown", @@ -19252,8 +19252,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Equilibra", types: ["Steel", "Ground"], gender: "N", - baseStats: {hp: 102, atk: 50, def: 96, spa: 133, spd: 118, spe: 60}, - abilities: {0: "Levitate", 1: "Bulletproof", H: "Justified"}, + baseStats: { hp: 102, atk: 50, def: 96, spa: 133, spd: 118, spe: 60 }, + abilities: { 0: "Levitate", 1: "Bulletproof", H: "Justified" }, heightm: 0.8, weightkg: 51.3, color: "Brown", @@ -19266,8 +19266,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -56, name: "Solotl", types: ["Fire", "Dragon"], - baseStats: {hp: 68, atk: 48, def: 34, spa: 72, spd: 24, spe: 84}, - abilities: {0: "Regenerator", 1: "Vital Spirit", H: "Magician"}, + baseStats: { hp: 68, atk: 48, def: 34, spa: 72, spd: 24, spe: 84 }, + abilities: { 0: "Regenerator", 1: "Vital Spirit", H: "Magician" }, heightm: 0.6, weightkg: 11.8, color: "Red", @@ -19279,8 +19279,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -57, name: "Astrolotl", types: ["Fire", "Dragon"], - baseStats: {hp: 108, atk: 108, def: 74, spa: 92, spd: 64, spe: 114}, - abilities: {0: "Regenerator", 1: "Vital Spirit", H: "Magician"}, + baseStats: { hp: 108, atk: 108, def: 74, spa: 92, spd: 64, spe: 114 }, + abilities: { 0: "Regenerator", 1: "Vital Spirit", H: "Magician" }, heightm: 1.9, weightkg: 50, color: "Red", @@ -19293,8 +19293,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -58, name: "Miasmite", types: ["Bug", "Dragon"], - baseStats: {hp: 40, atk: 85, def: 60, spa: 52, spd: 52, spe: 44}, - abilities: {0: "Neutralizing Gas", 1: "Hyper Cutter", H: "Compound Eyes"}, + baseStats: { hp: 40, atk: 85, def: 60, spa: 52, spd: 52, spe: 44 }, + abilities: { 0: "Neutralizing Gas", 1: "Hyper Cutter", H: "Compound Eyes" }, heightm: 0.6, weightkg: 10.1, color: "Green", @@ -19306,8 +19306,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -59, name: "Miasmaw", types: ["Bug", "Dragon"], - baseStats: {hp: 85, atk: 135, def: 60, spa: 88, spd: 105, spe: 99}, - abilities: {0: "Neutralizing Gas", 1: "Hyper Cutter", H: "Compound Eyes"}, + baseStats: { hp: 85, atk: 135, def: 60, spa: 88, spd: 105, spe: 99 }, + abilities: { 0: "Neutralizing Gas", 1: "Hyper Cutter", H: "Compound Eyes" }, heightm: 1.2, weightkg: 57, color: "Green", @@ -19321,8 +19321,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Chromera", types: ["Dark", "Normal"], gender: "N", - baseStats: {hp: 85, atk: 85, def: 115, spa: 115, spd: 100, spe: 100}, - abilities: {0: "Color Change"}, + baseStats: { hp: 85, atk: 85, def: 115, spa: 115, spd: 100, spe: 100 }, + abilities: { 0: "Color Change" }, heightm: 2.5, weightkg: 215, color: "Purple", @@ -19333,8 +19333,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -61, name: "Nohface", types: ["Ghost"], - baseStats: {hp: 50, atk: 73, def: 50, spa: 30, spd: 50, spe: 80}, - abilities: {0: "Frisk", 1: "Limber", H: "Unnerve"}, + baseStats: { hp: 50, atk: 73, def: 50, spa: 30, spd: 50, spe: 80 }, + abilities: { 0: "Frisk", 1: "Limber", H: "Unnerve" }, heightm: 0.5, weightkg: 5.9, color: "Blue", @@ -19346,8 +19346,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -62, name: "Monohm", types: ["Electric"], - baseStats: {hp: 53, atk: 40, def: 58, spa: 67, spd: 55, spe: 55}, - abilities: {0: "Shield Dust", 1: "Static", H: "Damp"}, + baseStats: { hp: 53, atk: 40, def: 58, spa: 67, spd: 55, spe: 55 }, + abilities: { 0: "Shield Dust", 1: "Static", H: "Damp" }, heightm: 0.6, weightkg: 4.1, color: "Yellow", @@ -19359,8 +19359,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -63, name: "Duohm", types: ["Electric", "Dragon"], - baseStats: {hp: 88, atk: 40, def: 103, spa: 77, spd: 60, spe: 60}, - abilities: {0: "Shield Dust", 1: "Static", H: "Damp"}, + baseStats: { hp: 88, atk: 40, def: 103, spa: 77, spd: 60, spe: 60 }, + abilities: { 0: "Shield Dust", 1: "Static", H: "Damp" }, heightm: 1.1, weightkg: 19.2, color: "Yellow", @@ -19374,8 +19374,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -64, name: "Dorsoil", types: ["Ground"], - baseStats: {hp: 103, atk: 72, def: 52, spa: 61, spd: 52, spe: 65}, - abilities: {0: "Oblivious", 1: "Guts", H: "Unnerve"}, + baseStats: { hp: 103, atk: 72, def: 52, spa: 61, spd: 52, spe: 65 }, + abilities: { 0: "Oblivious", 1: "Guts", H: "Unnerve" }, heightm: 1.3, weightkg: 145, color: "White", @@ -19387,8 +19387,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -65, name: "Protowatt", types: ["Electric", "Water"], - baseStats: {hp: 51, atk: 44, def: 33, spa: 43, spd: 34, spe: 65}, - abilities: {0: "Trace", 1: "Magic Guard", H: "Minus"}, + baseStats: { hp: 51, atk: 44, def: 33, spa: 43, spd: 34, spe: 65 }, + abilities: { 0: "Trace", 1: "Magic Guard", H: "Minus" }, heightm: 0.1, weightkg: 0.1, color: "Red", @@ -19402,8 +19402,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { baseForme: "Prologue", types: ["Poison", "Flying"], gender: "N", - baseStats: {hp: 85, atk: 50, def: 113, spa: 118, spd: 90, spe: 64}, - abilities: {0: "Stamina", H: "Power of Alchemy"}, + baseStats: { hp: 85, atk: 50, def: 113, spa: 118, spd: 90, spe: 64 }, + abilities: { 0: "Stamina", H: "Power of Alchemy" }, heightm: 0.8, weightkg: 11.5, color: "Purple", @@ -19419,8 +19419,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "Epilogue", types: ["Poison", "Flying"], gender: "N", - baseStats: {hp: 85, atk: 102, def: 85, spa: 62, spd: 85, spe: 101}, - abilities: {0: "Tinted Lens"}, + baseStats: { hp: 85, atk: 102, def: 85, spa: 62, spd: 85, spe: 101 }, + abilities: { 0: "Tinted Lens" }, heightm: 0.8, weightkg: 12.4, color: "Purple", @@ -19433,8 +19433,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -67, name: "Saharascal", types: ["Ground"], - baseStats: {hp: 50, atk: 80, def: 65, spa: 45, spd: 90, spe: 70}, - abilities: {0: "Water Absorb", 1: "Pickpocket", H: "Sand Spit"}, + baseStats: { hp: 50, atk: 80, def: 65, spa: 45, spd: 90, spe: 70 }, + abilities: { 0: "Water Absorb", 1: "Pickpocket", H: "Sand Spit" }, heightm: 1.2, weightkg: 48, color: "Brown", @@ -19446,8 +19446,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -68, name: "Saharaja", types: ["Ground"], - baseStats: {hp: 70, atk: 112, def: 105, spa: 65, spd: 123, spe: 78}, - abilities: {0: "Water Absorb", 1: "Serene Grace", H: "Sand Spit"}, + baseStats: { hp: 70, atk: 112, def: 105, spa: 65, spd: 123, spe: 78 }, + abilities: { 0: "Water Absorb", 1: "Serene Grace", H: "Sand Spit" }, heightm: 2.3, weightkg: 303.9, color: "White", @@ -19461,9 +19461,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -69, name: "Ababo", types: ["Fairy"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 42, atk: 35, def: 27, spa: 35, spd: 35, spe: 38}, - abilities: {0: "Pixilate", 1: "Rattled", H: "Own Tempo"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 42, atk: 35, def: 27, spa: 35, spd: 35, spe: 38 }, + abilities: { 0: "Pixilate", 1: "Rattled", H: "Own Tempo" }, heightm: 0.5, weightkg: 3.5, color: "White", @@ -19476,9 +19476,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -70, name: "Scattervein", types: ["Fairy"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 75, atk: 74, def: 87, spa: 62, spd: 89, spe: 63}, - abilities: {0: "Pixilate", 1: "Intimidate", H: "Own Tempo"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 75, atk: 74, def: 87, spa: 62, spd: 89, spe: 63 }, + abilities: { 0: "Pixilate", 1: "Intimidate", H: "Own Tempo" }, heightm: 1.5, weightkg: 25, color: "Pink", @@ -19493,9 +19493,9 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -71, name: "Hemogoblin", types: ["Fairy", "Fire"], - genderRatio: {M: 0.75, F: 0.25}, - baseStats: {hp: 90, atk: 96, def: 87, spa: 96, spd: 89, spe: 55}, - abilities: {0: "Pixilate", 1: "Intimidate", H: "Own Tempo"}, + genderRatio: { M: 0.75, F: 0.25 }, + baseStats: { hp: 90, atk: 96, def: 87, spa: 96, spd: 89, spe: 55 }, + abilities: { 0: "Pixilate", 1: "Intimidate", H: "Own Tempo" }, heightm: 1.4, weightkg: 85, color: "Pink", @@ -19509,8 +19509,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -72, name: "Cresceidon", types: ["Water", "Fairy"], - baseStats: {hp: 80, atk: 32, def: 111, spa: 88, spd: 99, spe: 124}, - abilities: {0: "Multiscale", 1: "Rough Skin", H: "Water Veil"}, + baseStats: { hp: 80, atk: 32, def: 111, spa: 88, spd: 99, spe: 124 }, + abilities: { 0: "Multiscale", 1: "Rough Skin", H: "Water Veil" }, heightm: 10, weightkg: 999.9, color: "Blue", @@ -19521,8 +19521,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -73, name: "Chuggon", types: ["Dragon", "Poison"], - baseStats: {hp: 30, atk: 23, def: 77, spa: 55, spd: 65, spe: 30}, - abilities: {0: "Shell Armor", 1: "White Smoke", H: "Slow Start"}, + baseStats: { hp: 30, atk: 23, def: 77, spa: 55, spd: 65, spe: 30 }, + abilities: { 0: "Shell Armor", 1: "White Smoke", H: "Slow Start" }, heightm: 1, weightkg: 50, color: "Black", @@ -19534,8 +19534,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -74, name: "Draggalong", types: ["Dragon", "Poison"], - baseStats: {hp: 40, atk: 33, def: 92, spa: 95, spd: 80, spe: 85}, - abilities: {0: "Armor Tail", 1: "White Smoke", H: "Slow Start"}, + baseStats: { hp: 40, atk: 33, def: 92, spa: 95, spd: 80, spe: 85 }, + abilities: { 0: "Armor Tail", 1: "White Smoke", H: "Slow Start" }, heightm: 2.5, weightkg: 110, color: "Black", @@ -19549,8 +19549,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -75, name: "Chuggalong", types: ["Dragon", "Poison"], - baseStats: {hp: 45, atk: 43, def: 117, spa: 120, spd: 110, spe: 108}, - abilities: {0: "Armor Tail", 1: "White Smoke", H: "Slow Start"}, + baseStats: { hp: 45, atk: 43, def: 117, spa: 120, spd: 110, spe: 108 }, + abilities: { 0: "Armor Tail", 1: "White Smoke", H: "Slow Start" }, heightm: 6.2, weightkg: 201.6, color: "Black", @@ -19563,8 +19563,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -77, name: "Shox", types: ["Electric", "Normal"], - baseStats: {hp: 136, atk: 55, def: 87, spa: 108, spd: 108, spe: 56}, - abilities: {0: "Electromorphosis", 1: "Sticky Hold", H: "Cud Chew"}, + baseStats: { hp: 136, atk: 55, def: 87, spa: 108, spd: 108, spe: 56 }, + abilities: { 0: "Electromorphosis", 1: "Sticky Hold", H: "Cud Chew" }, heightm: 3, weightkg: 99.9, color: "Brown", @@ -19576,8 +19576,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -5000, name: "Pokestar Smeargle", types: ["Normal"], - baseStats: {hp: 55, atk: 20, def: 35, spa: 20, spd: 45, spe: 75}, - abilities: {0: "Own Tempo", 1: "Technician", H: "Moody"}, + baseStats: { hp: 55, atk: 20, def: 35, spa: 20, spd: 45, spe: 75 }, + abilities: { 0: "Own Tempo", 1: "Technician", H: "Moody" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19589,8 +19589,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar UFO", types: ["Flying", "Electric"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Levitate"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Levitate" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19606,8 +19606,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "2", types: ["Psychic", "Electric"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Levitate"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Levitate" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19619,8 +19619,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar Brycen-Man", types: ["Dark", "Psychic"], gender: "M", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Levitate"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Levitate" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19633,8 +19633,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar MT", types: ["Steel"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Analytic"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Analytic" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19647,8 +19647,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar MT2", types: ["Steel", "Electric"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Flash Fire"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Flash Fire" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19661,8 +19661,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar Transport", types: ["Steel"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Motor Drive"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Motor Drive" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19675,8 +19675,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar Giant", types: ["Normal"], gender: "F", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Huge Power"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Huge Power" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19688,8 +19688,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -5007, name: "Pokestar Humanoid", types: ["Normal"], - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Insomnia"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Insomnia" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19701,8 +19701,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -5008, name: "Pokestar Monster", types: ["Dark"], - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Pressure"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Pressure" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19714,8 +19714,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -5009, name: "Pokestar F-00", types: ["Steel", "Normal"], - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Volt Absorb"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Volt Absorb" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19727,8 +19727,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -5010, name: "Pokestar F-002", types: ["Steel", "Normal"], - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Reckless"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Reckless" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19740,8 +19740,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { num: -5011, name: "Pokestar Spirit", types: ["Dark", "Ghost"], - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Wonder Guard"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Wonder Guard" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19754,8 +19754,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar Black Door", types: ["Grass"], gender: "F", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Early Bird"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Early Bird" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19768,8 +19768,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar White Door", types: ["Fire"], gender: "M", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Blaze"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Blaze" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19782,8 +19782,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { name: "Pokestar Black Belt", types: ["Fighting"], gender: "M", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Huge Power"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Huge Power" }, heightm: 1.5, weightkg: 61, color: "White", @@ -19798,8 +19798,8 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { forme: "PropU2", types: ["Psychic", "Electric"], gender: "N", - baseStats: {hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100}, - abilities: {0: "Levitate"}, + baseStats: { hp: 100, atk: 100, def: 100, spa: 100, spd: 100, spe: 100 }, + abilities: { 0: "Levitate" }, heightm: 1.5, weightkg: 61, color: "White", diff --git a/data/pokemongo.ts b/data/pokemongo.ts index 75f36cdb90..7181e01a27 100644 --- a/data/pokemongo.ts +++ b/data/pokemongo.ts @@ -27,187 +27,187 @@ * is handled as as its own encounter */ export const PokemonGoData: import('../sim/dex-species').PokemonGoDataTable = { - bulbasaur: {encounters: ['wild']}, - ivysaur: {encounters: ['wild']}, - venusaur: {encounters: ['wild']}, - charmander: {encounters: ['wild']}, - charmeleon: {encounters: ['wild']}, - charizard: {encounters: ['wild']}, - squirtle: {encounters: ['wild']}, - wartortle: {encounters: ['wild']}, - blastoise: {encounters: ['wild']}, - caterpie: {encounters: ['wild']}, - metapod: {encounters: ['wild']}, - butterfree: {encounters: ['wild']}, - weedle: {encounters: ['wild']}, - kakuna: {encounters: ['wild']}, - beedrill: {encounters: ['wild']}, - pidgey: {encounters: ['wild']}, - pidgeotto: {encounters: ['wild']}, - pidgeot: {encounters: ['wild']}, - rattata: {encounters: ['wild']}, - rattataalola: {encounters: ['wild']}, - raticate: {encounters: ['wild']}, - raticatealola: {encounters: ['wild']}, - spearow: {encounters: ['wild']}, - fearow: {encounters: ['wild']}, - ekans: {encounters: ['wild']}, - arbok: {encounters: ['wild']}, - pikachu: {encounters: ['wild']}, - raichu: {encounters: ['wild']}, - raichualola: {encounters: ['wild']}, - sandshrew: {encounters: ['wild']}, - sandshrewalola: {encounters: ['wild']}, - sandslash: {encounters: ['wild']}, - sandslashalola: {encounters: ['wild']}, - nidoranf: {encounters: ['wild']}, - nidorina: {encounters: ['wild']}, - nidoqueen: {encounters: ['wild']}, - nidoranm: {encounters: ['wild']}, - nidorino: {encounters: ['wild']}, - nidoking: {encounters: ['wild']}, - clefairy: {encounters: ['wild']}, - clefable: {encounters: ['wild']}, - vulpix: {encounters: ['wild']}, - vulpixalola: {encounters: ['wild']}, - ninetales: {encounters: ['wild']}, - ninetalesalola: {encounters: ['wild']}, - jigglypuff: {encounters: ['wild']}, - wigglytuff: {encounters: ['wild']}, - zubat: {encounters: ['wild']}, - golbat: {encounters: ['wild']}, - oddish: {encounters: ['wild']}, - gloom: {encounters: ['wild']}, - vileplume: {encounters: ['wild']}, - paras: {encounters: ['wild']}, - parasect: {encounters: ['wild']}, - venonat: {encounters: ['wild']}, - venomoth: {encounters: ['wild']}, - diglett: {encounters: ['wild']}, - diglettalola: {encounters: ['wild']}, - dugtrio: {encounters: ['wild']}, - dugtrioalola: {encounters: ['wild']}, - meowth: {encounters: ['wild']}, - meowthalola: {encounters: ['wild']}, - meowthgalar: {encounters: ['wild']}, - persian: {encounters: ['wild']}, - persianalola: {encounters: ['wild']}, - psyduck: {encounters: ['wild']}, - golduck: {encounters: ['wild']}, - mankey: {encounters: ['wild']}, - primeape: {encounters: ['wild']}, - growlithe: {encounters: ['wild']}, - growlithehisui: {encounters: ['wild']}, - arcanine: {encounters: ['wild']}, - arcaninehisui: {encounters: ['wild']}, - poliwag: {encounters: ['wild']}, - poliwhirl: {encounters: ['wild']}, - poliwrath: {encounters: ['wild']}, - abra: {encounters: ['wild']}, - kadabra: {encounters: ['wild']}, - alakazam: {encounters: ['wild']}, - machop: {encounters: ['wild']}, - machoke: {encounters: ['wild']}, - machamp: {encounters: ['wild']}, - bellsprout: {encounters: ['wild']}, - weepinbell: {encounters: ['wild']}, - victreebel: {encounters: ['wild']}, - tentacool: {encounters: ['wild']}, - tentacruel: {encounters: ['wild']}, - geodude: {encounters: ['wild']}, - geodudealola: {encounters: ['wild']}, - graveler: {encounters: ['wild']}, - graveleralola: {encounters: ['wild']}, - golem: {encounters: ['wild']}, - golemalola: {encounters: ['wild']}, - ponyta: {encounters: ['wild']}, - ponytagalar: {encounters: ['wild']}, - rapidash: {encounters: ['wild']}, - rapidashgalar: {encounters: ['wild']}, - slowpoke: {encounters: ['wild']}, - slowpokegalar: {encounters: ['wild']}, - slowbro: {encounters: ['wild']}, - slowbrogalar: {encounters: ['wild']}, - magnemite: {encounters: ['wild']}, - magneton: {encounters: ['wild']}, - farfetchd: {encounters: ['wild']}, - farfetchdgalar: {encounters: ['wild']}, - doduo: {encounters: ['wild']}, - dodrio: {encounters: ['wild']}, - seel: {encounters: ['wild']}, - dewgong: {encounters: ['wild']}, - grimer: {encounters: ['wild']}, - grimeralola: {encounters: ['wild']}, - muk: {encounters: ['wild']}, - mukalola: {encounters: ['wild']}, - shellder: {encounters: ['wild']}, - cloyster: {encounters: ['wild']}, - gastly: {encounters: ['wild']}, - haunter: {encounters: ['wild']}, - gengar: {encounters: ['wild']}, - onix: {encounters: ['wild']}, - drowzee: {encounters: ['wild']}, - hypno: {encounters: ['wild']}, - krabby: {encounters: ['wild']}, - kingler: {encounters: ['wild']}, - voltorb: {encounters: ['wild']}, - voltorbhisui: {encounters: ['wild']}, - electrode: {encounters: ['wild']}, - electrodehisui: {encounters: ['wild']}, - exeggcute: {encounters: ['wild']}, - exeggutor: {encounters: ['wild']}, - exeggutoralola: {encounters: ['wild']}, - cubone: {encounters: ['wild']}, - marowak: {encounters: ['wild']}, - marowakalola: {encounters: ['wild']}, - hitmonlee: {encounters: ['wild']}, - hitmonchan: {encounters: ['wild']}, - lickitung: {encounters: ['wild']}, - koffing: {encounters: ['wild']}, - weezing: {encounters: ['wild']}, - weezinggalar: {encounters: ['wild']}, - rhyhorn: {encounters: ['wild']}, - rhydon: {encounters: ['wild']}, - chansey: {encounters: ['wild']}, - tangela: {encounters: ['wild']}, - kangaskhan: {encounters: ['wild']}, - horsea: {encounters: ['wild']}, - seadra: {encounters: ['wild']}, - goldeen: {encounters: ['wild']}, - seaking: {encounters: ['wild']}, - staryu: {encounters: ['wild']}, - starmie: {encounters: ['wild']}, - mrmime: {encounters: ['wild']}, - mrmimegalar: {encounters: ['wild']}, - scyther: {encounters: ['wild']}, - jynx: {encounters: ['wild']}, - electabuzz: {encounters: ['wild']}, - magmar: {encounters: ['wild']}, - pinsir: {encounters: ['wild']}, - tauros: {encounters: ['wild']}, - magikarp: {encounters: ['wild']}, - gyarados: {encounters: ['wild']}, - ditto: {encounters: ['wild']}, - eevee: {encounters: ['wild']}, - vaporeon: {encounters: ['wild']}, - jolteon: {encounters: ['wild']}, - flareon: {encounters: ['wild']}, - porygon: {encounters: ['wild']}, - omanyte: {encounters: ['wild']}, - omastar: {encounters: ['wild']}, - kabuto: {encounters: ['wild']}, - kabutops: {encounters: ['wild']}, - aerodactyl: {encounters: ['wild']}, - snorlax: {encounters: ['wild']}, - articuno: {encounters: ['wild']}, - articunogalar: {encounters: ['wild']}, - zapdos: {encounters: ['wild']}, - zapdosgalar: {encounters: ['wild']}, - moltres: {encounters: ['wild']}, - moltresgalar: {encounters: ['wild']}, - dratini: {encounters: ['wild']}, - dragonair: {encounters: ['wild']}, - dragonite: {encounters: ['wild']}, + bulbasaur: { encounters: ['wild'] }, + ivysaur: { encounters: ['wild'] }, + venusaur: { encounters: ['wild'] }, + charmander: { encounters: ['wild'] }, + charmeleon: { encounters: ['wild'] }, + charizard: { encounters: ['wild'] }, + squirtle: { encounters: ['wild'] }, + wartortle: { encounters: ['wild'] }, + blastoise: { encounters: ['wild'] }, + caterpie: { encounters: ['wild'] }, + metapod: { encounters: ['wild'] }, + butterfree: { encounters: ['wild'] }, + weedle: { encounters: ['wild'] }, + kakuna: { encounters: ['wild'] }, + beedrill: { encounters: ['wild'] }, + pidgey: { encounters: ['wild'] }, + pidgeotto: { encounters: ['wild'] }, + pidgeot: { encounters: ['wild'] }, + rattata: { encounters: ['wild'] }, + rattataalola: { encounters: ['wild'] }, + raticate: { encounters: ['wild'] }, + raticatealola: { encounters: ['wild'] }, + spearow: { encounters: ['wild'] }, + fearow: { encounters: ['wild'] }, + ekans: { encounters: ['wild'] }, + arbok: { encounters: ['wild'] }, + pikachu: { encounters: ['wild'] }, + raichu: { encounters: ['wild'] }, + raichualola: { encounters: ['wild'] }, + sandshrew: { encounters: ['wild'] }, + sandshrewalola: { encounters: ['wild'] }, + sandslash: { encounters: ['wild'] }, + sandslashalola: { encounters: ['wild'] }, + nidoranf: { encounters: ['wild'] }, + nidorina: { encounters: ['wild'] }, + nidoqueen: { encounters: ['wild'] }, + nidoranm: { encounters: ['wild'] }, + nidorino: { encounters: ['wild'] }, + nidoking: { encounters: ['wild'] }, + clefairy: { encounters: ['wild'] }, + clefable: { encounters: ['wild'] }, + vulpix: { encounters: ['wild'] }, + vulpixalola: { encounters: ['wild'] }, + ninetales: { encounters: ['wild'] }, + ninetalesalola: { encounters: ['wild'] }, + jigglypuff: { encounters: ['wild'] }, + wigglytuff: { encounters: ['wild'] }, + zubat: { encounters: ['wild'] }, + golbat: { encounters: ['wild'] }, + oddish: { encounters: ['wild'] }, + gloom: { encounters: ['wild'] }, + vileplume: { encounters: ['wild'] }, + paras: { encounters: ['wild'] }, + parasect: { encounters: ['wild'] }, + venonat: { encounters: ['wild'] }, + venomoth: { encounters: ['wild'] }, + diglett: { encounters: ['wild'] }, + diglettalola: { encounters: ['wild'] }, + dugtrio: { encounters: ['wild'] }, + dugtrioalola: { encounters: ['wild'] }, + meowth: { encounters: ['wild'] }, + meowthalola: { encounters: ['wild'] }, + meowthgalar: { encounters: ['wild'] }, + persian: { encounters: ['wild'] }, + persianalola: { encounters: ['wild'] }, + psyduck: { encounters: ['wild'] }, + golduck: { encounters: ['wild'] }, + mankey: { encounters: ['wild'] }, + primeape: { encounters: ['wild'] }, + growlithe: { encounters: ['wild'] }, + growlithehisui: { encounters: ['wild'] }, + arcanine: { encounters: ['wild'] }, + arcaninehisui: { encounters: ['wild'] }, + poliwag: { encounters: ['wild'] }, + poliwhirl: { encounters: ['wild'] }, + poliwrath: { encounters: ['wild'] }, + abra: { encounters: ['wild'] }, + kadabra: { encounters: ['wild'] }, + alakazam: { encounters: ['wild'] }, + machop: { encounters: ['wild'] }, + machoke: { encounters: ['wild'] }, + machamp: { encounters: ['wild'] }, + bellsprout: { encounters: ['wild'] }, + weepinbell: { encounters: ['wild'] }, + victreebel: { encounters: ['wild'] }, + tentacool: { encounters: ['wild'] }, + tentacruel: { encounters: ['wild'] }, + geodude: { encounters: ['wild'] }, + geodudealola: { encounters: ['wild'] }, + graveler: { encounters: ['wild'] }, + graveleralola: { encounters: ['wild'] }, + golem: { encounters: ['wild'] }, + golemalola: { encounters: ['wild'] }, + ponyta: { encounters: ['wild'] }, + ponytagalar: { encounters: ['wild'] }, + rapidash: { encounters: ['wild'] }, + rapidashgalar: { encounters: ['wild'] }, + slowpoke: { encounters: ['wild'] }, + slowpokegalar: { encounters: ['wild'] }, + slowbro: { encounters: ['wild'] }, + slowbrogalar: { encounters: ['wild'] }, + magnemite: { encounters: ['wild'] }, + magneton: { encounters: ['wild'] }, + farfetchd: { encounters: ['wild'] }, + farfetchdgalar: { encounters: ['wild'] }, + doduo: { encounters: ['wild'] }, + dodrio: { encounters: ['wild'] }, + seel: { encounters: ['wild'] }, + dewgong: { encounters: ['wild'] }, + grimer: { encounters: ['wild'] }, + grimeralola: { encounters: ['wild'] }, + muk: { encounters: ['wild'] }, + mukalola: { encounters: ['wild'] }, + shellder: { encounters: ['wild'] }, + cloyster: { encounters: ['wild'] }, + gastly: { encounters: ['wild'] }, + haunter: { encounters: ['wild'] }, + gengar: { encounters: ['wild'] }, + onix: { encounters: ['wild'] }, + drowzee: { encounters: ['wild'] }, + hypno: { encounters: ['wild'] }, + krabby: { encounters: ['wild'] }, + kingler: { encounters: ['wild'] }, + voltorb: { encounters: ['wild'] }, + voltorbhisui: { encounters: ['wild'] }, + electrode: { encounters: ['wild'] }, + electrodehisui: { encounters: ['wild'] }, + exeggcute: { encounters: ['wild'] }, + exeggutor: { encounters: ['wild'] }, + exeggutoralola: { encounters: ['wild'] }, + cubone: { encounters: ['wild'] }, + marowak: { encounters: ['wild'] }, + marowakalola: { encounters: ['wild'] }, + hitmonlee: { encounters: ['wild'] }, + hitmonchan: { encounters: ['wild'] }, + lickitung: { encounters: ['wild'] }, + koffing: { encounters: ['wild'] }, + weezing: { encounters: ['wild'] }, + weezinggalar: { encounters: ['wild'] }, + rhyhorn: { encounters: ['wild'] }, + rhydon: { encounters: ['wild'] }, + chansey: { encounters: ['wild'] }, + tangela: { encounters: ['wild'] }, + kangaskhan: { encounters: ['wild'] }, + horsea: { encounters: ['wild'] }, + seadra: { encounters: ['wild'] }, + goldeen: { encounters: ['wild'] }, + seaking: { encounters: ['wild'] }, + staryu: { encounters: ['wild'] }, + starmie: { encounters: ['wild'] }, + mrmime: { encounters: ['wild'] }, + mrmimegalar: { encounters: ['wild'] }, + scyther: { encounters: ['wild'] }, + jynx: { encounters: ['wild'] }, + electabuzz: { encounters: ['wild'] }, + magmar: { encounters: ['wild'] }, + pinsir: { encounters: ['wild'] }, + tauros: { encounters: ['wild'] }, + magikarp: { encounters: ['wild'] }, + gyarados: { encounters: ['wild'] }, + ditto: { encounters: ['wild'] }, + eevee: { encounters: ['wild'] }, + vaporeon: { encounters: ['wild'] }, + jolteon: { encounters: ['wild'] }, + flareon: { encounters: ['wild'] }, + porygon: { encounters: ['wild'] }, + omanyte: { encounters: ['wild'] }, + omastar: { encounters: ['wild'] }, + kabuto: { encounters: ['wild'] }, + kabutops: { encounters: ['wild'] }, + aerodactyl: { encounters: ['wild'] }, + snorlax: { encounters: ['wild'] }, + articuno: { encounters: ['wild'] }, + articunogalar: { encounters: ['wild'] }, + zapdos: { encounters: ['wild'] }, + zapdosgalar: { encounters: ['wild'] }, + moltres: { encounters: ['wild'] }, + moltresgalar: { encounters: ['wild'] }, + dratini: { encounters: ['wild'] }, + dragonair: { encounters: ['wild'] }, + dragonite: { encounters: ['wild'] }, mewtwo: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'], LGPERestrictiveMoves: { @@ -233,844 +233,844 @@ export const PokemonGoData: import('../sim/dex-species').PokemonGoDataTable = { mimic: 1, }, }, - chikorita: {encounters: ['wild']}, - bayleef: {encounters: ['wild']}, - meganium: {encounters: ['wild']}, - cyndaquil: {encounters: ['wild']}, - quilava: {encounters: ['wild']}, - typhlosion: {encounters: ['wild']}, - typhlosionhisui: {encounters: ['raid']}, - totodile: {encounters: ['wild']}, - croconaw: {encounters: ['wild']}, - feraligatr: {encounters: ['wild']}, - sentret: {encounters: ['wild']}, - furret: {encounters: ['wild']}, - hoothoot: {encounters: ['wild']}, - noctowl: {encounters: ['wild']}, - ledyba: {encounters: ['wild']}, - ledian: {encounters: ['wild']}, - spinarak: {encounters: ['wild']}, - ariados: {encounters: ['wild']}, - crobat: {encounters: ['wild']}, - chinchou: {encounters: ['wild']}, - lanturn: {encounters: ['wild']}, - pichu: {encounters: ['egg']}, - cleffa: {encounters: ['egg']}, - igglybuff: {encounters: ['egg']}, - togepi: {encounters: ['egg']}, - togetic: {encounters: ['wild']}, - natu: {encounters: ['wild']}, - xatu: {encounters: ['wild']}, - mareep: {encounters: ['wild']}, - flaaffy: {encounters: ['wild']}, - ampharos: {encounters: ['wild']}, - bellossom: {encounters: ['wild']}, - marill: {encounters: ['wild']}, - azumarill: {encounters: ['wild']}, - sudowoodo: {encounters: ['wild']}, - politoed: {encounters: ['wild']}, - hoppip: {encounters: ['wild']}, - skiploom: {encounters: ['wild']}, - jumpluff: {encounters: ['wild']}, - aipom: {encounters: ['wild']}, - sunkern: {encounters: ['wild']}, - sunflora: {encounters: ['wild']}, - yanma: {encounters: ['wild']}, - wooper: {encounters: ['wild']}, - wooperpaldea: {encounters: ['wild']}, - quagsire: {encounters: ['wild']}, - espeon: {encounters: ['wild']}, - umbreon: {encounters: ['wild']}, - murkrow: {encounters: ['wild']}, - slowking: {encounters: ['wild']}, - slowkinggalar: {encounters: ['wild']}, - misdreavus: {encounters: ['wild']}, - unown: {encounters: ['wild']}, - unownb: {encounters: ['wild']}, - unownc: {encounters: ['wild']}, - unownd: {encounters: ['wild']}, - unowne: {encounters: ['wild']}, - unownf: {encounters: ['wild']}, - unowng: {encounters: ['wild']}, - unownh: {encounters: ['wild']}, - unowni: {encounters: ['wild']}, - unownj: {encounters: ['wild']}, - unownk: {encounters: ['wild', 'noshiny']}, - unownl: {encounters: ['wild']}, - unownm: {encounters: ['wild']}, - unownn: {encounters: ['wild']}, - unowno: {encounters: ['wild']}, - unownp: {encounters: ['wild']}, - unownq: {encounters: ['wild', 'noshiny']}, - unownr: {encounters: ['wild']}, - unowns: {encounters: ['wild']}, - unownt: {encounters: ['wild']}, - unownu: {encounters: ['wild']}, - unownv: {encounters: ['wild']}, - unownw: {encounters: ['wild', 'noshiny']}, - unownx: {encounters: ['wild']}, - unowny: {encounters: ['wild']}, - unownz: {encounters: ['wild', 'noshiny']}, - unownexclamation: {encounters: ['wild']}, - unownquestion: {encounters: ['wild']}, - wobbuffet: {encounters: ['wild']}, - girafarig: {encounters: ['wild']}, - pineco: {encounters: ['wild']}, - forretress: {encounters: ['wild']}, - dunsparce: {encounters: ['wild']}, - gligar: {encounters: ['wild']}, - steelix: {encounters: ['wild']}, - snubbull: {encounters: ['wild']}, - granbull: {encounters: ['wild']}, - qwilfish: {encounters: ['wild']}, - qwilfishhisui: {encounters: ['wild']}, - scizor: {encounters: ['wild']}, - shuckle: {encounters: ['wild']}, - heracross: {encounters: ['wild']}, - sneasel: {encounters: ['wild']}, - sneaselhisui: {encounters: ['wild']}, - teddiursa: {encounters: ['wild']}, - ursaring: {encounters: ['wild']}, - slugma: {encounters: ['wild']}, - magcargo: {encounters: ['wild']}, - swinub: {encounters: ['wild']}, - piloswine: {encounters: ['wild']}, - corsola: {encounters: ['wild']}, - corsolagalar: {encounters: ['egg']}, - remoraid: {encounters: ['wild']}, - octillery: {encounters: ['wild']}, - delibird: {encounters: ['wild']}, - mantine: {encounters: ['wild']}, - skarmory: {encounters: ['wild']}, - houndour: {encounters: ['wild']}, - houndoom: {encounters: ['wild']}, - kingdra: {encounters: ['wild']}, - phanpy: {encounters: ['wild']}, - donphan: {encounters: ['wild']}, - porygon2: {encounters: ['wild']}, - stantler: {encounters: ['wild']}, - smeargle: {encounters: ['wild']}, - tyrogue: {encounters: ['egg']}, - hitmontop: {encounters: ['wild']}, - smoochum: {encounters: ['egg', 'research']}, - elekid: {encounters: ['egg', 'research']}, - magby: {encounters: ['egg']}, - miltank: {encounters: ['wild']}, - blissey: {encounters: ['wild']}, - raikou: {encounters: ['wild']}, - entei: {encounters: ['wild']}, - suicune: {encounters: ['wild']}, - larvitar: {encounters: ['wild']}, - pupitar: {encounters: ['wild']}, - tyranitar: {encounters: ['wild']}, - lugia: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - hooh: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - celebi: {encounters: ['research', 'notrade']}, - treecko: {encounters: ['wild']}, - grovyle: {encounters: ['wild']}, - sceptile: {encounters: ['wild']}, - torchic: {encounters: ['wild']}, - combusken: {encounters: ['wild']}, - blaziken: {encounters: ['wild']}, - mudkip: {encounters: ['wild']}, - marshtomp: {encounters: ['wild']}, - swampert: {encounters: ['wild']}, - poochyena: {encounters: ['wild']}, - mightyena: {encounters: ['wild']}, - zigzagoon: {encounters: ['wild']}, - zigzagoongalar: {encounters: ['wild']}, - linoone: {encounters: ['wild']}, - linoonegalar: {encounters: ['wild']}, - wurmple: {encounters: ['wild']}, - silcoon: {encounters: ['wild']}, - beautifly: {encounters: ['wild']}, - cascoon: {encounters: ['wild']}, - dustox: {encounters: ['wild']}, - lotad: {encounters: ['wild']}, - lombre: {encounters: ['wild']}, - ludicolo: {encounters: ['wild']}, - seedot: {encounters: ['wild']}, - nuzleaf: {encounters: ['wild']}, - shiftry: {encounters: ['wild']}, - taillow: {encounters: ['wild']}, - swellow: {encounters: ['wild']}, - wingull: {encounters: ['wild']}, - pelipper: {encounters: ['wild']}, - ralts: {encounters: ['wild']}, - kirlia: {encounters: ['wild']}, - gardevoir: {encounters: ['wild']}, - surskit: {encounters: ['wild']}, - masquerain: {encounters: ['wild']}, - shroomish: {encounters: ['wild']}, - breloom: {encounters: ['wild']}, - slakoth: {encounters: ['wild']}, - vigoroth: {encounters: ['wild']}, - slaking: {encounters: ['wild']}, - nincada: {encounters: ['wild']}, - ninjask: {encounters: ['wild']}, - shedinja: {encounters: ['research']}, - whismur: {encounters: ['wild']}, - loudred: {encounters: ['wild']}, - exploud: {encounters: ['wild']}, - makuhita: {encounters: ['wild']}, - hariyama: {encounters: ['wild']}, - azurill: {encounters: ['egg']}, - nosepass: {encounters: ['wild']}, - skitty: {encounters: ['wild']}, - delcatty: {encounters: ['wild']}, - sableye: {encounters: ['wild']}, - mawile: {encounters: ['wild']}, - aron: {encounters: ['wild']}, - lairon: {encounters: ['wild']}, - aggron: {encounters: ['wild']}, - meditite: {encounters: ['wild']}, - medicham: {encounters: ['wild']}, - electrike: {encounters: ['wild']}, - manectric: {encounters: ['wild']}, - plusle: {encounters: ['wild']}, - minun: {encounters: ['wild']}, - volbeat: {encounters: ['wild']}, - illumise: {encounters: ['wild']}, - roselia: {encounters: ['wild']}, - gulpin: {encounters: ['wild']}, - swalot: {encounters: ['wild']}, - carvanha: {encounters: ['wild']}, - sharpedo: {encounters: ['wild']}, - wailmer: {encounters: ['wild']}, - wailord: {encounters: ['wild']}, - numel: {encounters: ['wild']}, - camerupt: {encounters: ['wild']}, - torkoal: {encounters: ['wild']}, - spoink: {encounters: ['wild']}, - grumpig: {encounters: ['wild']}, - trapinch: {encounters: ['wild']}, - vibrava: {encounters: ['wild']}, - flygon: {encounters: ['wild']}, - cacnea: {encounters: ['wild']}, - cacturne: {encounters: ['wild']}, - swablu: {encounters: ['wild']}, - altaria: {encounters: ['wild']}, - zangoose: {encounters: ['wild']}, - seviper: {encounters: ['wild']}, - lunatone: {encounters: ['wild']}, - solrock: {encounters: ['wild']}, - barboach: {encounters: ['wild']}, - whiscash: {encounters: ['wild']}, - corphish: {encounters: ['wild']}, - crawdaunt: {encounters: ['wild']}, - baltoy: {encounters: ['wild']}, - claydol: {encounters: ['wild']}, - lileep: {encounters: ['wild']}, - cradily: {encounters: ['wild']}, - anorith: {encounters: ['wild']}, - armaldo: {encounters: ['wild']}, - feebas: {encounters: ['wild']}, - milotic: {encounters: ['wild']}, - castform: {encounters: ['wild']}, - kecleon: {encounters: ['wild']}, - shuppet: {encounters: ['wild']}, - banette: {encounters: ['wild']}, - duskull: {encounters: ['wild']}, - dusclops: {encounters: ['wild']}, - tropius: {encounters: ['wild']}, - chimecho: {encounters: ['wild']}, - absol: {encounters: ['wild']}, - wynaut: {encounters: ['egg']}, - snorunt: {encounters: ['wild']}, - glalie: {encounters: ['wild']}, - spheal: {encounters: ['wild']}, - sealeo: {encounters: ['wild']}, - walrein: {encounters: ['wild']}, - clamperl: {encounters: ['wild']}, - gorebyss: {encounters: ['wild']}, - huntail: {encounters: ['wild']}, - relicanth: {encounters: ['wild']}, - luvdisc: {encounters: ['wild']}, - bagon: {encounters: ['wild']}, - shelgon: {encounters: ['wild']}, - salamence: {encounters: ['wild']}, - beldum: {encounters: ['wild']}, - metang: {encounters: ['wild']}, - metagross: {encounters: ['wild']}, - regirock: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - regice: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - registeel: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - latias: {encounters: ['wild']}, - latios: {encounters: ['wild']}, - kyogre: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - groudon: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - rayquaza: {encounters: ['raid', 'research', 'specialtrade']}, - jirachi: {encounters: ['research', 'notrade']}, - deoxys: {encounters: ['raid', 'specialtrade']}, - turtwig: {encounters: ['wild']}, - grotle: {encounters: ['wild']}, - torterra: {encounters: ['wild']}, - chimchar: {encounters: ['wild']}, - monferno: {encounters: ['wild']}, - infernape: {encounters: ['wild']}, - piplup: {encounters: ['wild']}, - prinplup: {encounters: ['wild']}, - empoleon: {encounters: ['wild']}, - starly: {encounters: ['wild']}, - staravia: {encounters: ['wild']}, - staraptor: {encounters: ['wild']}, - bidoof: {encounters: ['wild']}, - bibarel: {encounters: ['wild']}, - kricketot: {encounters: ['wild']}, - kricketune: {encounters: ['wild']}, - shinx: {encounters: ['wild']}, - luxio: {encounters: ['wild']}, - luxray: {encounters: ['wild']}, - budew: {encounters: ['egg']}, - roserade: {encounters: ['wild']}, - cranidos: {encounters: ['wild']}, - rampardos: {encounters: ['wild']}, - shieldon: {encounters: ['wild']}, - bastiodon: {encounters: ['wild']}, - burmy: {encounters: ['wild']}, - wormadam: {encounters: ['wild']}, - wormadamsandy: {encounters: ['wild']}, - wormadamtrash: {encounters: ['wild']}, - mothim: {encounters: ['wild']}, - combee: {encounters: ['wild']}, - vespiquen: {encounters: ['wild']}, - pachirisu: {encounters: ['wild']}, - buizel: {encounters: ['wild']}, - floatzel: {encounters: ['wild']}, - cherubi: {encounters: ['wild']}, - shellos: {encounters: ['wild']}, - shelloseast: {encounters: ['wild']}, - gastrodon: {encounters: ['wild']}, - gastrodoneast: {encounters: ['wild']}, - ambipom: {encounters: ['wild']}, - drifloon: {encounters: ['wild']}, - drifblim: {encounters: ['wild']}, - buneary: {encounters: ['wild']}, - lopunny: {encounters: ['wild']}, - mismagius: {encounters: ['wild']}, - honchkrow: {encounters: ['wild']}, - glameow: {encounters: ['wild']}, - purugly: {encounters: ['wild']}, - chingling: {encounters: ['egg']}, - stunky: {encounters: ['wild']}, - skuntank: {encounters: ['wild']}, - bronzor: {encounters: ['wild']}, - bronzong: {encounters: ['wild']}, - bonsly: {encounters: ['egg']}, - mimejr: {encounters: ['egg']}, - happiny: {encounters: ['egg']}, - chatot: {encounters: ['wild']}, - spiritomb: {encounters: ['research']}, - gible: {encounters: ['wild']}, - gabite: {encounters: ['wild']}, - garchomp: {encounters: ['wild']}, - munchlax: {encounters: ['egg']}, - riolu: {encounters: ['egg']}, - lucario: {encounters: ['wild']}, - hippopotas: {encounters: ['wild']}, - hippowdon: {encounters: ['wild']}, - skorupi: {encounters: ['wild']}, - drapion: {encounters: ['wild']}, - croagunk: {encounters: ['wild']}, - toxicroak: {encounters: ['wild']}, - carnivine: {encounters: ['wild']}, - finneon: {encounters: ['wild']}, - lumineon: {encounters: ['wild']}, - mantyke: {encounters: ['egg']}, - snover: {encounters: ['wild']}, - abomasnow: {encounters: ['wild']}, - weavile: {encounters: ['wild']}, - magnezone: {encounters: ['wild']}, - lickilicky: {encounters: ['wild']}, - rhyperior: {encounters: ['wild']}, - tangrowth: {encounters: ['wild']}, - electivire: {encounters: ['wild']}, - magmortar: {encounters: ['wild']}, - togekiss: {encounters: ['wild']}, - yanmega: {encounters: ['wild']}, - leafeon: {encounters: ['wild']}, - glaceon: {encounters: ['wild']}, - gliscor: {encounters: ['wild']}, - mamoswine: {encounters: ['wild']}, - porygonz: {encounters: ['wild']}, - gallade: {encounters: ['wild']}, - probopass: {encounters: ['wild']}, - dusknoir: {encounters: ['wild']}, - froslass: {encounters: ['wild']}, - rotom: {encounters: ['wild']}, - uxie: {encounters: ['wild']}, - mesprit: {encounters: ['wild']}, - azelf: {encounters: ['wild']}, - dialga: {encounters: ['raid', 'specialtrade']}, - palkia: {encounters: ['giovanni', 'raid', 'specialtrade']}, - heatran: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - regigigas: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - giratina: {encounters: ['raid', 'specialtrade']}, - cresselia: {encounters: ['giovanni', 'raid', 'research', 'specialtrade']}, - darkrai: {encounters: ['raid', 'research', 'notrade']}, - shaymin: {encounters: ['research', 'notrade']}, - victini: {encounters: ['research', 'noshiny', 'notrade']}, - snivy: {encounters: ['wild']}, - servine: {encounters: ['wild']}, - serperior: {encounters: ['wild']}, - tepig: {encounters: ['wild']}, - pignite: {encounters: ['wild']}, - emboar: {encounters: ['wild']}, - oshawott: {encounters: ['wild']}, - dewott: {encounters: ['wild']}, - samurott: {encounters: ['wild']}, - samurotthisui: {encounters: ['raid']}, - patrat: {encounters: ['wild']}, - watchog: {encounters: ['wild']}, - lillipup: {encounters: ['wild']}, - herdier: {encounters: ['wild']}, - stoutland: {encounters: ['wild']}, - purrloin: {encounters: ['wild']}, - liepard: {encounters: ['wild']}, - pansage: {encounters: ['wild']}, - simisage: {encounters: ['wild']}, - pansear: {encounters: ['wild']}, - simisear: {encounters: ['wild']}, - panpour: {encounters: ['wild']}, - simipour: {encounters: ['wild']}, - munna: {encounters: ['wild']}, - musharna: {encounters: ['wild']}, - pidove: {encounters: ['wild']}, - tranquill: {encounters: ['wild']}, - unfezant: {encounters: ['wild']}, - blitzle: {encounters: ['wild']}, - zebstrika: {encounters: ['wild']}, - roggenrola: {encounters: ['wild']}, - boldore: {encounters: ['wild']}, - gigalith: {encounters: ['wild']}, - woobat: {encounters: ['wild']}, - swoobat: {encounters: ['wild']}, - drilbur: {encounters: ['wild']}, - excadrill: {encounters: ['wild']}, - audino: {encounters: ['wild']}, - timburr: {encounters: ['wild']}, - gurdurr: {encounters: ['wild']}, - conkeldurr: {encounters: ['wild']}, - tympole: {encounters: ['wild']}, - palpitoad: {encounters: ['wild']}, - seismitoad: {encounters: ['wild']}, - throh: {encounters: ['wild']}, - sawk: {encounters: ['wild']}, - sewaddle: {encounters: ['wild']}, - swadloon: {encounters: ['wild']}, - leavanny: {encounters: ['wild']}, - venipede: {encounters: ['wild']}, - whirlipede: {encounters: ['wild']}, - scolipede: {encounters: ['wild']}, - cottonee: {encounters: ['wild']}, - whimsicott: {encounters: ['wild']}, - petilil: {encounters: ['wild']}, - lilligant: {encounters: ['wild']}, - basculin: {encounters: ['wild', 'noshiny']}, // Shiny available 2025-02-21 - basculinbluestriped: {encounters: ['wild', 'noshiny']}, // Shiny available 2025-02-21 - basculinwhitestriped: {encounters: ['wild']}, - sandile: {encounters: ['12kmegg', 'raid', 'research']}, - krokorok: {encounters: ['12kmegg', 'raid', 'research']}, - krookodile: {encounters: ['12kmegg', 'raid', 'research']}, - darumaka: {encounters: ['wild']}, - darumakagalar: {encounters: ['wild']}, - darmanitan: {encounters: ['wild']}, - darmanitangalar: {encounters: ['wild']}, - maractus: {encounters: ['wild', 'noshiny']}, // Shiny available 2025-02-21 - dwebble: {encounters: ['wild']}, - crustle: {encounters: ['wild']}, - scraggy: {encounters: ['wild']}, - scrafty: {encounters: ['wild']}, - sigilyph: {encounters: ['wild']}, - yamask: {encounters: ['wild']}, - yamaskgalar: {encounters: ['egg', 'raid', 'research']}, - cofagrigus: {encounters: ['wild']}, - tirtouga: {encounters: ['wild']}, - carracosta: {encounters: ['wild']}, - archen: {encounters: ['wild']}, - archeops: {encounters: ['wild']}, - trubbish: {encounters: ['wild']}, - garbodor: {encounters: ['wild']}, - zorua: {encounters: ['wild']}, - zoroark: {encounters: ['wild']}, - minccino: {encounters: ['wild']}, - cinccino: {encounters: ['wild']}, - gothita: {encounters: ['wild']}, - gothorita: {encounters: ['wild']}, - gothitelle: {encounters: ['wild']}, - solosis: {encounters: ['wild']}, - duosion: {encounters: ['wild']}, - reuniclus: {encounters: ['wild']}, - ducklett: {encounters: ['wild']}, - swanna: {encounters: ['wild']}, - vanillite: {encounters: ['wild']}, - vanillish: {encounters: ['wild']}, - vanilluxe: {encounters: ['wild']}, - deerling: {encounters: ['wild', 'noshiny']}, // Shiny available 2025-02-21 - deerlingsummer: {encounters: ['wild', 'noshiny']}, - deerlingautumn: {encounters: ['wild', 'noshiny']}, - deerlingwinter: {encounters: ['wild', 'noshiny']}, - sawsbuck: {encounters: ['wild', 'noshiny']}, - sawsbucksummer: {encounters: ['wild', 'noshiny']}, - sawsbuckautumn: {encounters: ['wild', 'noshiny']}, - sawsbuckwinter: {encounters: ['wild', 'noshiny']}, - emolga: {encounters: ['wild']}, - karrablast: {encounters: ['wild']}, - escavalier: {encounters: ['wild']}, - foongus: {encounters: ['wild']}, - amoonguss: {encounters: ['wild']}, - frillish: {encounters: ['wild']}, - jellicent: {encounters: ['wild']}, - alomomola: {encounters: ['wild']}, - joltik: {encounters: ['wild']}, - galvantula: {encounters: ['wild']}, - ferroseed: {encounters: ['wild']}, - ferrothorn: {encounters: ['wild']}, - klink: {encounters: ['wild']}, - klang: {encounters: ['wild']}, - klinklang: {encounters: ['wild']}, - tynamo: {encounters: ['wild']}, - eelektrik: {encounters: ['wild']}, - eelektross: {encounters: ['wild']}, - elgyem: {encounters: ['wild']}, - beheeyem: {encounters: ['wild']}, - litwick: {encounters: ['wild']}, - lampent: {encounters: ['wild']}, - chandelure: {encounters: ['wild']}, - axew: {encounters: ['wild']}, - fraxure: {encounters: ['wild']}, - haxorus: {encounters: ['wild']}, - cubchoo: {encounters: ['wild']}, - beartic: {encounters: ['wild']}, - cryogonal: {encounters: ['wild']}, - shelmet: {encounters: ['wild']}, - accelgor: {encounters: ['wild']}, - stunfisk: {encounters: ['wild']}, - stunfiskgalar: {encounters: ['wild']}, - mienfoo: {encounters: ['wild']}, - mienshao: {encounters: ['wild']}, - druddigon: {encounters: ['wild']}, - golett: {encounters: ['wild']}, - golurk: {encounters: ['wild']}, - pawniard: {encounters: ['wild']}, - bisharp: {encounters: ['wild']}, - bouffalant: {encounters: ['wild']}, - rufflet: {encounters: ['wild']}, - braviary: {encounters: ['wild']}, - braviaryhisui: {encounters: ['wild']}, - vullaby: {encounters: ['wild']}, - mandibuzz: {encounters: ['wild']}, - heatmor: {encounters: ['wild']}, - durant: {encounters: ['wild']}, - deino: {encounters: ['wild']}, - zweilous: {encounters: ['wild']}, - hydreigon: {encounters: ['wild']}, - larvesta: {encounters: ['egg']}, - volcarona: {encounters: ['egg']}, - cobalion: {encounters: ['raid', 'specialtrade']}, // research available 2025-02-24 - terrakion: {encounters: ['raid', 'specialtrade']}, // research available 2025-02-24 - virizion: {encounters: ['raid', 'specialtrade']}, // research available 2025-02-24 - tornadus: {encounters: ['raid', 'research', 'specialtrade']}, // research available 2025-02-21 - thundurus: {encounters: ['raid', 'research', 'specialtrade']}, // research available 2025-02-21 - reshiram: {encounters: ['raid', 'specialtrade']}, - zekrom: {encounters: ['raid', 'specialtrade']}, - landorus: {encounters: ['raid', 'research', 'specialtrade']}, // research available 2025-02-21 - kyurem: {encounters: ['raid', 'specialtrade']}, + chikorita: { encounters: ['wild'] }, + bayleef: { encounters: ['wild'] }, + meganium: { encounters: ['wild'] }, + cyndaquil: { encounters: ['wild'] }, + quilava: { encounters: ['wild'] }, + typhlosion: { encounters: ['wild'] }, + typhlosionhisui: { encounters: ['raid'] }, + totodile: { encounters: ['wild'] }, + croconaw: { encounters: ['wild'] }, + feraligatr: { encounters: ['wild'] }, + sentret: { encounters: ['wild'] }, + furret: { encounters: ['wild'] }, + hoothoot: { encounters: ['wild'] }, + noctowl: { encounters: ['wild'] }, + ledyba: { encounters: ['wild'] }, + ledian: { encounters: ['wild'] }, + spinarak: { encounters: ['wild'] }, + ariados: { encounters: ['wild'] }, + crobat: { encounters: ['wild'] }, + chinchou: { encounters: ['wild'] }, + lanturn: { encounters: ['wild'] }, + pichu: { encounters: ['egg'] }, + cleffa: { encounters: ['egg'] }, + igglybuff: { encounters: ['egg'] }, + togepi: { encounters: ['egg'] }, + togetic: { encounters: ['wild'] }, + natu: { encounters: ['wild'] }, + xatu: { encounters: ['wild'] }, + mareep: { encounters: ['wild'] }, + flaaffy: { encounters: ['wild'] }, + ampharos: { encounters: ['wild'] }, + bellossom: { encounters: ['wild'] }, + marill: { encounters: ['wild'] }, + azumarill: { encounters: ['wild'] }, + sudowoodo: { encounters: ['wild'] }, + politoed: { encounters: ['wild'] }, + hoppip: { encounters: ['wild'] }, + skiploom: { encounters: ['wild'] }, + jumpluff: { encounters: ['wild'] }, + aipom: { encounters: ['wild'] }, + sunkern: { encounters: ['wild'] }, + sunflora: { encounters: ['wild'] }, + yanma: { encounters: ['wild'] }, + wooper: { encounters: ['wild'] }, + wooperpaldea: { encounters: ['wild'] }, + quagsire: { encounters: ['wild'] }, + espeon: { encounters: ['wild'] }, + umbreon: { encounters: ['wild'] }, + murkrow: { encounters: ['wild'] }, + slowking: { encounters: ['wild'] }, + slowkinggalar: { encounters: ['wild'] }, + misdreavus: { encounters: ['wild'] }, + unown: { encounters: ['wild'] }, + unownb: { encounters: ['wild'] }, + unownc: { encounters: ['wild'] }, + unownd: { encounters: ['wild'] }, + unowne: { encounters: ['wild'] }, + unownf: { encounters: ['wild'] }, + unowng: { encounters: ['wild'] }, + unownh: { encounters: ['wild'] }, + unowni: { encounters: ['wild'] }, + unownj: { encounters: ['wild'] }, + unownk: { encounters: ['wild', 'noshiny'] }, + unownl: { encounters: ['wild'] }, + unownm: { encounters: ['wild'] }, + unownn: { encounters: ['wild'] }, + unowno: { encounters: ['wild'] }, + unownp: { encounters: ['wild'] }, + unownq: { encounters: ['wild', 'noshiny'] }, + unownr: { encounters: ['wild'] }, + unowns: { encounters: ['wild'] }, + unownt: { encounters: ['wild'] }, + unownu: { encounters: ['wild'] }, + unownv: { encounters: ['wild'] }, + unownw: { encounters: ['wild', 'noshiny'] }, + unownx: { encounters: ['wild'] }, + unowny: { encounters: ['wild'] }, + unownz: { encounters: ['wild', 'noshiny'] }, + unownexclamation: { encounters: ['wild'] }, + unownquestion: { encounters: ['wild'] }, + wobbuffet: { encounters: ['wild'] }, + girafarig: { encounters: ['wild'] }, + pineco: { encounters: ['wild'] }, + forretress: { encounters: ['wild'] }, + dunsparce: { encounters: ['wild'] }, + gligar: { encounters: ['wild'] }, + steelix: { encounters: ['wild'] }, + snubbull: { encounters: ['wild'] }, + granbull: { encounters: ['wild'] }, + qwilfish: { encounters: ['wild'] }, + qwilfishhisui: { encounters: ['wild'] }, + scizor: { encounters: ['wild'] }, + shuckle: { encounters: ['wild'] }, + heracross: { encounters: ['wild'] }, + sneasel: { encounters: ['wild'] }, + sneaselhisui: { encounters: ['wild'] }, + teddiursa: { encounters: ['wild'] }, + ursaring: { encounters: ['wild'] }, + slugma: { encounters: ['wild'] }, + magcargo: { encounters: ['wild'] }, + swinub: { encounters: ['wild'] }, + piloswine: { encounters: ['wild'] }, + corsola: { encounters: ['wild'] }, + corsolagalar: { encounters: ['egg'] }, + remoraid: { encounters: ['wild'] }, + octillery: { encounters: ['wild'] }, + delibird: { encounters: ['wild'] }, + mantine: { encounters: ['wild'] }, + skarmory: { encounters: ['wild'] }, + houndour: { encounters: ['wild'] }, + houndoom: { encounters: ['wild'] }, + kingdra: { encounters: ['wild'] }, + phanpy: { encounters: ['wild'] }, + donphan: { encounters: ['wild'] }, + porygon2: { encounters: ['wild'] }, + stantler: { encounters: ['wild'] }, + smeargle: { encounters: ['wild'] }, + tyrogue: { encounters: ['egg'] }, + hitmontop: { encounters: ['wild'] }, + smoochum: { encounters: ['egg', 'research'] }, + elekid: { encounters: ['egg', 'research'] }, + magby: { encounters: ['egg'] }, + miltank: { encounters: ['wild'] }, + blissey: { encounters: ['wild'] }, + raikou: { encounters: ['wild'] }, + entei: { encounters: ['wild'] }, + suicune: { encounters: ['wild'] }, + larvitar: { encounters: ['wild'] }, + pupitar: { encounters: ['wild'] }, + tyranitar: { encounters: ['wild'] }, + lugia: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + hooh: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + celebi: { encounters: ['research', 'notrade'] }, + treecko: { encounters: ['wild'] }, + grovyle: { encounters: ['wild'] }, + sceptile: { encounters: ['wild'] }, + torchic: { encounters: ['wild'] }, + combusken: { encounters: ['wild'] }, + blaziken: { encounters: ['wild'] }, + mudkip: { encounters: ['wild'] }, + marshtomp: { encounters: ['wild'] }, + swampert: { encounters: ['wild'] }, + poochyena: { encounters: ['wild'] }, + mightyena: { encounters: ['wild'] }, + zigzagoon: { encounters: ['wild'] }, + zigzagoongalar: { encounters: ['wild'] }, + linoone: { encounters: ['wild'] }, + linoonegalar: { encounters: ['wild'] }, + wurmple: { encounters: ['wild'] }, + silcoon: { encounters: ['wild'] }, + beautifly: { encounters: ['wild'] }, + cascoon: { encounters: ['wild'] }, + dustox: { encounters: ['wild'] }, + lotad: { encounters: ['wild'] }, + lombre: { encounters: ['wild'] }, + ludicolo: { encounters: ['wild'] }, + seedot: { encounters: ['wild'] }, + nuzleaf: { encounters: ['wild'] }, + shiftry: { encounters: ['wild'] }, + taillow: { encounters: ['wild'] }, + swellow: { encounters: ['wild'] }, + wingull: { encounters: ['wild'] }, + pelipper: { encounters: ['wild'] }, + ralts: { encounters: ['wild'] }, + kirlia: { encounters: ['wild'] }, + gardevoir: { encounters: ['wild'] }, + surskit: { encounters: ['wild'] }, + masquerain: { encounters: ['wild'] }, + shroomish: { encounters: ['wild'] }, + breloom: { encounters: ['wild'] }, + slakoth: { encounters: ['wild'] }, + vigoroth: { encounters: ['wild'] }, + slaking: { encounters: ['wild'] }, + nincada: { encounters: ['wild'] }, + ninjask: { encounters: ['wild'] }, + shedinja: { encounters: ['research'] }, + whismur: { encounters: ['wild'] }, + loudred: { encounters: ['wild'] }, + exploud: { encounters: ['wild'] }, + makuhita: { encounters: ['wild'] }, + hariyama: { encounters: ['wild'] }, + azurill: { encounters: ['egg'] }, + nosepass: { encounters: ['wild'] }, + skitty: { encounters: ['wild'] }, + delcatty: { encounters: ['wild'] }, + sableye: { encounters: ['wild'] }, + mawile: { encounters: ['wild'] }, + aron: { encounters: ['wild'] }, + lairon: { encounters: ['wild'] }, + aggron: { encounters: ['wild'] }, + meditite: { encounters: ['wild'] }, + medicham: { encounters: ['wild'] }, + electrike: { encounters: ['wild'] }, + manectric: { encounters: ['wild'] }, + plusle: { encounters: ['wild'] }, + minun: { encounters: ['wild'] }, + volbeat: { encounters: ['wild'] }, + illumise: { encounters: ['wild'] }, + roselia: { encounters: ['wild'] }, + gulpin: { encounters: ['wild'] }, + swalot: { encounters: ['wild'] }, + carvanha: { encounters: ['wild'] }, + sharpedo: { encounters: ['wild'] }, + wailmer: { encounters: ['wild'] }, + wailord: { encounters: ['wild'] }, + numel: { encounters: ['wild'] }, + camerupt: { encounters: ['wild'] }, + torkoal: { encounters: ['wild'] }, + spoink: { encounters: ['wild'] }, + grumpig: { encounters: ['wild'] }, + trapinch: { encounters: ['wild'] }, + vibrava: { encounters: ['wild'] }, + flygon: { encounters: ['wild'] }, + cacnea: { encounters: ['wild'] }, + cacturne: { encounters: ['wild'] }, + swablu: { encounters: ['wild'] }, + altaria: { encounters: ['wild'] }, + zangoose: { encounters: ['wild'] }, + seviper: { encounters: ['wild'] }, + lunatone: { encounters: ['wild'] }, + solrock: { encounters: ['wild'] }, + barboach: { encounters: ['wild'] }, + whiscash: { encounters: ['wild'] }, + corphish: { encounters: ['wild'] }, + crawdaunt: { encounters: ['wild'] }, + baltoy: { encounters: ['wild'] }, + claydol: { encounters: ['wild'] }, + lileep: { encounters: ['wild'] }, + cradily: { encounters: ['wild'] }, + anorith: { encounters: ['wild'] }, + armaldo: { encounters: ['wild'] }, + feebas: { encounters: ['wild'] }, + milotic: { encounters: ['wild'] }, + castform: { encounters: ['wild'] }, + kecleon: { encounters: ['wild'] }, + shuppet: { encounters: ['wild'] }, + banette: { encounters: ['wild'] }, + duskull: { encounters: ['wild'] }, + dusclops: { encounters: ['wild'] }, + tropius: { encounters: ['wild'] }, + chimecho: { encounters: ['wild'] }, + absol: { encounters: ['wild'] }, + wynaut: { encounters: ['egg'] }, + snorunt: { encounters: ['wild'] }, + glalie: { encounters: ['wild'] }, + spheal: { encounters: ['wild'] }, + sealeo: { encounters: ['wild'] }, + walrein: { encounters: ['wild'] }, + clamperl: { encounters: ['wild'] }, + gorebyss: { encounters: ['wild'] }, + huntail: { encounters: ['wild'] }, + relicanth: { encounters: ['wild'] }, + luvdisc: { encounters: ['wild'] }, + bagon: { encounters: ['wild'] }, + shelgon: { encounters: ['wild'] }, + salamence: { encounters: ['wild'] }, + beldum: { encounters: ['wild'] }, + metang: { encounters: ['wild'] }, + metagross: { encounters: ['wild'] }, + regirock: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + regice: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + registeel: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + latias: { encounters: ['wild'] }, + latios: { encounters: ['wild'] }, + kyogre: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + groudon: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + rayquaza: { encounters: ['raid', 'research', 'specialtrade'] }, + jirachi: { encounters: ['research', 'notrade'] }, + deoxys: { encounters: ['raid', 'specialtrade'] }, + turtwig: { encounters: ['wild'] }, + grotle: { encounters: ['wild'] }, + torterra: { encounters: ['wild'] }, + chimchar: { encounters: ['wild'] }, + monferno: { encounters: ['wild'] }, + infernape: { encounters: ['wild'] }, + piplup: { encounters: ['wild'] }, + prinplup: { encounters: ['wild'] }, + empoleon: { encounters: ['wild'] }, + starly: { encounters: ['wild'] }, + staravia: { encounters: ['wild'] }, + staraptor: { encounters: ['wild'] }, + bidoof: { encounters: ['wild'] }, + bibarel: { encounters: ['wild'] }, + kricketot: { encounters: ['wild'] }, + kricketune: { encounters: ['wild'] }, + shinx: { encounters: ['wild'] }, + luxio: { encounters: ['wild'] }, + luxray: { encounters: ['wild'] }, + budew: { encounters: ['egg'] }, + roserade: { encounters: ['wild'] }, + cranidos: { encounters: ['wild'] }, + rampardos: { encounters: ['wild'] }, + shieldon: { encounters: ['wild'] }, + bastiodon: { encounters: ['wild'] }, + burmy: { encounters: ['wild'] }, + wormadam: { encounters: ['wild'] }, + wormadamsandy: { encounters: ['wild'] }, + wormadamtrash: { encounters: ['wild'] }, + mothim: { encounters: ['wild'] }, + combee: { encounters: ['wild'] }, + vespiquen: { encounters: ['wild'] }, + pachirisu: { encounters: ['wild'] }, + buizel: { encounters: ['wild'] }, + floatzel: { encounters: ['wild'] }, + cherubi: { encounters: ['wild'] }, + shellos: { encounters: ['wild'] }, + shelloseast: { encounters: ['wild'] }, + gastrodon: { encounters: ['wild'] }, + gastrodoneast: { encounters: ['wild'] }, + ambipom: { encounters: ['wild'] }, + drifloon: { encounters: ['wild'] }, + drifblim: { encounters: ['wild'] }, + buneary: { encounters: ['wild'] }, + lopunny: { encounters: ['wild'] }, + mismagius: { encounters: ['wild'] }, + honchkrow: { encounters: ['wild'] }, + glameow: { encounters: ['wild'] }, + purugly: { encounters: ['wild'] }, + chingling: { encounters: ['egg'] }, + stunky: { encounters: ['wild'] }, + skuntank: { encounters: ['wild'] }, + bronzor: { encounters: ['wild'] }, + bronzong: { encounters: ['wild'] }, + bonsly: { encounters: ['egg'] }, + mimejr: { encounters: ['egg'] }, + happiny: { encounters: ['egg'] }, + chatot: { encounters: ['wild'] }, + spiritomb: { encounters: ['research'] }, + gible: { encounters: ['wild'] }, + gabite: { encounters: ['wild'] }, + garchomp: { encounters: ['wild'] }, + munchlax: { encounters: ['egg'] }, + riolu: { encounters: ['egg'] }, + lucario: { encounters: ['wild'] }, + hippopotas: { encounters: ['wild'] }, + hippowdon: { encounters: ['wild'] }, + skorupi: { encounters: ['wild'] }, + drapion: { encounters: ['wild'] }, + croagunk: { encounters: ['wild'] }, + toxicroak: { encounters: ['wild'] }, + carnivine: { encounters: ['wild'] }, + finneon: { encounters: ['wild'] }, + lumineon: { encounters: ['wild'] }, + mantyke: { encounters: ['egg'] }, + snover: { encounters: ['wild'] }, + abomasnow: { encounters: ['wild'] }, + weavile: { encounters: ['wild'] }, + magnezone: { encounters: ['wild'] }, + lickilicky: { encounters: ['wild'] }, + rhyperior: { encounters: ['wild'] }, + tangrowth: { encounters: ['wild'] }, + electivire: { encounters: ['wild'] }, + magmortar: { encounters: ['wild'] }, + togekiss: { encounters: ['wild'] }, + yanmega: { encounters: ['wild'] }, + leafeon: { encounters: ['wild'] }, + glaceon: { encounters: ['wild'] }, + gliscor: { encounters: ['wild'] }, + mamoswine: { encounters: ['wild'] }, + porygonz: { encounters: ['wild'] }, + gallade: { encounters: ['wild'] }, + probopass: { encounters: ['wild'] }, + dusknoir: { encounters: ['wild'] }, + froslass: { encounters: ['wild'] }, + rotom: { encounters: ['wild'] }, + uxie: { encounters: ['wild'] }, + mesprit: { encounters: ['wild'] }, + azelf: { encounters: ['wild'] }, + dialga: { encounters: ['raid', 'specialtrade'] }, + palkia: { encounters: ['giovanni', 'raid', 'specialtrade'] }, + heatran: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + regigigas: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + giratina: { encounters: ['raid', 'specialtrade'] }, + cresselia: { encounters: ['giovanni', 'raid', 'research', 'specialtrade'] }, + darkrai: { encounters: ['raid', 'research', 'notrade'] }, + shaymin: { encounters: ['research', 'notrade'] }, + victini: { encounters: ['research', 'noshiny', 'notrade'] }, + snivy: { encounters: ['wild'] }, + servine: { encounters: ['wild'] }, + serperior: { encounters: ['wild'] }, + tepig: { encounters: ['wild'] }, + pignite: { encounters: ['wild'] }, + emboar: { encounters: ['wild'] }, + oshawott: { encounters: ['wild'] }, + dewott: { encounters: ['wild'] }, + samurott: { encounters: ['wild'] }, + samurotthisui: { encounters: ['raid'] }, + patrat: { encounters: ['wild'] }, + watchog: { encounters: ['wild'] }, + lillipup: { encounters: ['wild'] }, + herdier: { encounters: ['wild'] }, + stoutland: { encounters: ['wild'] }, + purrloin: { encounters: ['wild'] }, + liepard: { encounters: ['wild'] }, + pansage: { encounters: ['wild'] }, + simisage: { encounters: ['wild'] }, + pansear: { encounters: ['wild'] }, + simisear: { encounters: ['wild'] }, + panpour: { encounters: ['wild'] }, + simipour: { encounters: ['wild'] }, + munna: { encounters: ['wild'] }, + musharna: { encounters: ['wild'] }, + pidove: { encounters: ['wild'] }, + tranquill: { encounters: ['wild'] }, + unfezant: { encounters: ['wild'] }, + blitzle: { encounters: ['wild'] }, + zebstrika: { encounters: ['wild'] }, + roggenrola: { encounters: ['wild'] }, + boldore: { encounters: ['wild'] }, + gigalith: { encounters: ['wild'] }, + woobat: { encounters: ['wild'] }, + swoobat: { encounters: ['wild'] }, + drilbur: { encounters: ['wild'] }, + excadrill: { encounters: ['wild'] }, + audino: { encounters: ['wild'] }, + timburr: { encounters: ['wild'] }, + gurdurr: { encounters: ['wild'] }, + conkeldurr: { encounters: ['wild'] }, + tympole: { encounters: ['wild'] }, + palpitoad: { encounters: ['wild'] }, + seismitoad: { encounters: ['wild'] }, + throh: { encounters: ['wild'] }, + sawk: { encounters: ['wild'] }, + sewaddle: { encounters: ['wild'] }, + swadloon: { encounters: ['wild'] }, + leavanny: { encounters: ['wild'] }, + venipede: { encounters: ['wild'] }, + whirlipede: { encounters: ['wild'] }, + scolipede: { encounters: ['wild'] }, + cottonee: { encounters: ['wild'] }, + whimsicott: { encounters: ['wild'] }, + petilil: { encounters: ['wild'] }, + lilligant: { encounters: ['wild'] }, + basculin: { encounters: ['wild', 'noshiny'] }, // Shiny available 2025-02-21 + basculinbluestriped: { encounters: ['wild', 'noshiny'] }, // Shiny available 2025-02-21 + basculinwhitestriped: { encounters: ['wild'] }, + sandile: { encounters: ['12kmegg', 'raid', 'research'] }, + krokorok: { encounters: ['12kmegg', 'raid', 'research'] }, + krookodile: { encounters: ['12kmegg', 'raid', 'research'] }, + darumaka: { encounters: ['wild'] }, + darumakagalar: { encounters: ['wild'] }, + darmanitan: { encounters: ['wild'] }, + darmanitangalar: { encounters: ['wild'] }, + maractus: { encounters: ['wild', 'noshiny'] }, // Shiny available 2025-02-21 + dwebble: { encounters: ['wild'] }, + crustle: { encounters: ['wild'] }, + scraggy: { encounters: ['wild'] }, + scrafty: { encounters: ['wild'] }, + sigilyph: { encounters: ['wild'] }, + yamask: { encounters: ['wild'] }, + yamaskgalar: { encounters: ['egg', 'raid', 'research'] }, + cofagrigus: { encounters: ['wild'] }, + tirtouga: { encounters: ['wild'] }, + carracosta: { encounters: ['wild'] }, + archen: { encounters: ['wild'] }, + archeops: { encounters: ['wild'] }, + trubbish: { encounters: ['wild'] }, + garbodor: { encounters: ['wild'] }, + zorua: { encounters: ['wild'] }, + zoroark: { encounters: ['wild'] }, + minccino: { encounters: ['wild'] }, + cinccino: { encounters: ['wild'] }, + gothita: { encounters: ['wild'] }, + gothorita: { encounters: ['wild'] }, + gothitelle: { encounters: ['wild'] }, + solosis: { encounters: ['wild'] }, + duosion: { encounters: ['wild'] }, + reuniclus: { encounters: ['wild'] }, + ducklett: { encounters: ['wild'] }, + swanna: { encounters: ['wild'] }, + vanillite: { encounters: ['wild'] }, + vanillish: { encounters: ['wild'] }, + vanilluxe: { encounters: ['wild'] }, + deerling: { encounters: ['wild', 'noshiny'] }, // Shiny available 2025-02-21 + deerlingsummer: { encounters: ['wild', 'noshiny'] }, + deerlingautumn: { encounters: ['wild', 'noshiny'] }, + deerlingwinter: { encounters: ['wild', 'noshiny'] }, + sawsbuck: { encounters: ['wild', 'noshiny'] }, + sawsbucksummer: { encounters: ['wild', 'noshiny'] }, + sawsbuckautumn: { encounters: ['wild', 'noshiny'] }, + sawsbuckwinter: { encounters: ['wild', 'noshiny'] }, + emolga: { encounters: ['wild'] }, + karrablast: { encounters: ['wild'] }, + escavalier: { encounters: ['wild'] }, + foongus: { encounters: ['wild'] }, + amoonguss: { encounters: ['wild'] }, + frillish: { encounters: ['wild'] }, + jellicent: { encounters: ['wild'] }, + alomomola: { encounters: ['wild'] }, + joltik: { encounters: ['wild'] }, + galvantula: { encounters: ['wild'] }, + ferroseed: { encounters: ['wild'] }, + ferrothorn: { encounters: ['wild'] }, + klink: { encounters: ['wild'] }, + klang: { encounters: ['wild'] }, + klinklang: { encounters: ['wild'] }, + tynamo: { encounters: ['wild'] }, + eelektrik: { encounters: ['wild'] }, + eelektross: { encounters: ['wild'] }, + elgyem: { encounters: ['wild'] }, + beheeyem: { encounters: ['wild'] }, + litwick: { encounters: ['wild'] }, + lampent: { encounters: ['wild'] }, + chandelure: { encounters: ['wild'] }, + axew: { encounters: ['wild'] }, + fraxure: { encounters: ['wild'] }, + haxorus: { encounters: ['wild'] }, + cubchoo: { encounters: ['wild'] }, + beartic: { encounters: ['wild'] }, + cryogonal: { encounters: ['wild'] }, + shelmet: { encounters: ['wild'] }, + accelgor: { encounters: ['wild'] }, + stunfisk: { encounters: ['wild'] }, + stunfiskgalar: { encounters: ['wild'] }, + mienfoo: { encounters: ['wild'] }, + mienshao: { encounters: ['wild'] }, + druddigon: { encounters: ['wild'] }, + golett: { encounters: ['wild'] }, + golurk: { encounters: ['wild'] }, + pawniard: { encounters: ['wild'] }, + bisharp: { encounters: ['wild'] }, + bouffalant: { encounters: ['wild'] }, + rufflet: { encounters: ['wild'] }, + braviary: { encounters: ['wild'] }, + braviaryhisui: { encounters: ['wild'] }, + vullaby: { encounters: ['wild'] }, + mandibuzz: { encounters: ['wild'] }, + heatmor: { encounters: ['wild'] }, + durant: { encounters: ['wild'] }, + deino: { encounters: ['wild'] }, + zweilous: { encounters: ['wild'] }, + hydreigon: { encounters: ['wild'] }, + larvesta: { encounters: ['egg'] }, + volcarona: { encounters: ['egg'] }, + cobalion: { encounters: ['raid', 'specialtrade'] }, // research available 2025-02-24 + terrakion: { encounters: ['raid', 'specialtrade'] }, // research available 2025-02-24 + virizion: { encounters: ['raid', 'specialtrade'] }, // research available 2025-02-24 + tornadus: { encounters: ['raid', 'research', 'specialtrade'] }, // research available 2025-02-21 + thundurus: { encounters: ['raid', 'research', 'specialtrade'] }, // research available 2025-02-21 + reshiram: { encounters: ['raid', 'specialtrade'] }, + zekrom: { encounters: ['raid', 'specialtrade'] }, + landorus: { encounters: ['raid', 'research', 'specialtrade'] }, // research available 2025-02-21 + kyurem: { encounters: ['raid', 'specialtrade'] }, // Kyurem-Black/White are not directly obtained from Pokemon GO but should be able to have legal Pokemon GO origin - kyuremblack: {encounters: ['raid', 'specialtrade']}, - kyuremwhite: {encounters: ['raid', 'specialtrade']}, - keldeo: {encounters: ['research', 'noshiny', 'notrade']}, - meloetta: {encounters: ['research', 'noshiny', 'notrade']}, - genesect: {encounters: ['raid', 'research', 'notrade']}, - chespin: {encounters: ['wild']}, - quilladin: {encounters: ['wild']}, - chesnaught: {encounters: ['wild']}, - fennekin: {encounters: ['wild']}, - braixen: {encounters: ['wild']}, - delphox: {encounters: ['wild']}, - froakie: {encounters: ['wild']}, - frogadier: {encounters: ['wild']}, - greninja: {encounters: ['wild']}, - bunnelby: {encounters: ['wild']}, - diggersby: {encounters: ['wild']}, - fletchling: {encounters: ['wild']}, - fletchinder: {encounters: ['wild']}, - talonflame: {encounters: ['wild']}, + kyuremblack: { encounters: ['raid', 'specialtrade'] }, + kyuremwhite: { encounters: ['raid', 'specialtrade'] }, + keldeo: { encounters: ['research', 'noshiny', 'notrade'] }, + meloetta: { encounters: ['research', 'noshiny', 'notrade'] }, + genesect: { encounters: ['raid', 'research', 'notrade'] }, + chespin: { encounters: ['wild'] }, + quilladin: { encounters: ['wild'] }, + chesnaught: { encounters: ['wild'] }, + fennekin: { encounters: ['wild'] }, + braixen: { encounters: ['wild'] }, + delphox: { encounters: ['wild'] }, + froakie: { encounters: ['wild'] }, + frogadier: { encounters: ['wild'] }, + greninja: { encounters: ['wild'] }, + bunnelby: { encounters: ['wild'] }, + diggersby: { encounters: ['wild'] }, + fletchling: { encounters: ['wild'] }, + fletchinder: { encounters: ['wild'] }, + talonflame: { encounters: ['wild'] }, // Scatterbug is actually obtained in a special type of encounter, // but the level and IV floors are the same as research encounters - scatterbug: {encounters: ['research']}, - spewpa: {encounters: ['research']}, - vivillon: {encounters: ['research']}, - vivillonarchipelago: {encounters: ['research']}, - vivilloncontinent: {encounters: ['research']}, - vivillonelegant: {encounters: ['research']}, - vivillongarden: {encounters: ['research']}, - vivillonhighplains: {encounters: ['research']}, - vivillonicysnow: {encounters: ['research']}, - vivillonjungle: {encounters: ['research']}, - vivillonmarine: {encounters: ['research']}, - vivillonmodern: {encounters: ['research']}, - vivillonmonsoon: {encounters: ['research']}, - vivillonocean: {encounters: ['research']}, - vivillonpolar: {encounters: ['research']}, - vivillonriver: {encounters: ['research']}, - vivillonsandstorm: {encounters: ['research']}, - vivillonsavanna: {encounters: ['research']}, - vivillonsun: {encounters: ['research']}, - vivillontundra: {encounters: ['research']}, - litleo: {encounters: ['wild']}, - pyroar: {encounters: ['wild']}, - flabebe: {encounters: ['wild']}, - flabebeblue: {encounters: ['wild']}, - flabebeorange: {encounters: ['wild']}, - flabebewhite: {encounters: ['wild']}, - flabebeyellow: {encounters: ['wild']}, - floette: {encounters: ['wild']}, - floetteblue: {encounters: ['wild']}, - floetteorange: {encounters: ['wild']}, - floettewhite: {encounters: ['wild']}, - floetteyellow: {encounters: ['wild']}, - florges: {encounters: ['wild']}, - florgesblue: {encounters: ['wild']}, - florgesorange: {encounters: ['wild']}, - florgeswhite: {encounters: ['wild']}, - florgesyellow: {encounters: ['wild']}, - pancham: {encounters: ['wild']}, - pangoro: {encounters: ['wild']}, - furfrou: {encounters: ['wild']}, - furfroudandy: {encounters: ['wild']}, - furfroudebutante: {encounters: ['wild']}, - furfroudiamond: {encounters: ['wild']}, - furfrouheart: {encounters: ['wild']}, - furfroukabuki: {encounters: ['wild']}, - furfroulareine: {encounters: ['wild']}, - furfroumatron: {encounters: ['wild']}, - furfroupharaoh: {encounters: ['wild']}, - furfroustar: {encounters: ['wild']}, - espurr: {encounters: ['wild']}, - meowstic: {encounters: ['wild']}, - meowsticf: {encounters: ['wild']}, - spritzee: {encounters: ['wild']}, - aromatisse: {encounters: ['wild']}, - swirlix: {encounters: ['wild']}, - slurpuff: {encounters: ['wild']}, - inkay: {encounters: ['wild']}, - malamar: {encounters: ['wild']}, - binacle: {encounters: ['wild']}, - barbaracle: {encounters: ['wild']}, - skrelp: {encounters: ['wild']}, - dragalge: {encounters: ['wild']}, - clauncher: {encounters: ['wild']}, - clawitzer: {encounters: ['wild']}, - helioptile: {encounters: ['wild']}, - heliolisk: {encounters: ['wild']}, - tyrunt: {encounters: ['wild']}, - tyrantrum: {encounters: ['wild']}, - amaura: {encounters: ['wild']}, - aurorus: {encounters: ['wild']}, - sylveon: {encounters: ['wild']}, - hawlucha: {encounters: ['wild', 'noshiny']}, - dedenne: {encounters: ['wild']}, - carbink: {encounters: ['research', 'noshiny']}, - goomy: {encounters: ['wild']}, - sliggoo: {encounters: ['wild']}, - goodra: {encounters: ['wild']}, - klefki: {encounters: ['wild', 'noshiny']}, - phantump: {encounters: ['wild']}, - trevenant: {encounters: ['wild']}, - pumpkaboo: {encounters: ['wild']}, - pumpkaboolarge: {encounters: ['wild']}, - pumpkaboosmall: {encounters: ['wild']}, - pumpkaboosuper: {encounters: ['wild']}, - gourgeist: {encounters: ['wild']}, - gourgeistlarge: {encounters: ['wild']}, - gourgeistsmall: {encounters: ['wild']}, - gourgeistsuper: {encounters: ['wild']}, - bergmite: {encounters: ['wild']}, - avalugg: {encounters: ['wild']}, - avalugghisui: {encounters: ['wild']}, - noibat: {encounters: ['wild']}, - noivern: {encounters: ['wild']}, - xerneas: {encounters: ['raid', 'specialtrade']}, - yveltal: {encounters: ['raid', 'specialtrade']}, + scatterbug: { encounters: ['research'] }, + spewpa: { encounters: ['research'] }, + vivillon: { encounters: ['research'] }, + vivillonarchipelago: { encounters: ['research'] }, + vivilloncontinent: { encounters: ['research'] }, + vivillonelegant: { encounters: ['research'] }, + vivillongarden: { encounters: ['research'] }, + vivillonhighplains: { encounters: ['research'] }, + vivillonicysnow: { encounters: ['research'] }, + vivillonjungle: { encounters: ['research'] }, + vivillonmarine: { encounters: ['research'] }, + vivillonmodern: { encounters: ['research'] }, + vivillonmonsoon: { encounters: ['research'] }, + vivillonocean: { encounters: ['research'] }, + vivillonpolar: { encounters: ['research'] }, + vivillonriver: { encounters: ['research'] }, + vivillonsandstorm: { encounters: ['research'] }, + vivillonsavanna: { encounters: ['research'] }, + vivillonsun: { encounters: ['research'] }, + vivillontundra: { encounters: ['research'] }, + litleo: { encounters: ['wild'] }, + pyroar: { encounters: ['wild'] }, + flabebe: { encounters: ['wild'] }, + flabebeblue: { encounters: ['wild'] }, + flabebeorange: { encounters: ['wild'] }, + flabebewhite: { encounters: ['wild'] }, + flabebeyellow: { encounters: ['wild'] }, + floette: { encounters: ['wild'] }, + floetteblue: { encounters: ['wild'] }, + floetteorange: { encounters: ['wild'] }, + floettewhite: { encounters: ['wild'] }, + floetteyellow: { encounters: ['wild'] }, + florges: { encounters: ['wild'] }, + florgesblue: { encounters: ['wild'] }, + florgesorange: { encounters: ['wild'] }, + florgeswhite: { encounters: ['wild'] }, + florgesyellow: { encounters: ['wild'] }, + pancham: { encounters: ['wild'] }, + pangoro: { encounters: ['wild'] }, + furfrou: { encounters: ['wild'] }, + furfroudandy: { encounters: ['wild'] }, + furfroudebutante: { encounters: ['wild'] }, + furfroudiamond: { encounters: ['wild'] }, + furfrouheart: { encounters: ['wild'] }, + furfroukabuki: { encounters: ['wild'] }, + furfroulareine: { encounters: ['wild'] }, + furfroumatron: { encounters: ['wild'] }, + furfroupharaoh: { encounters: ['wild'] }, + furfroustar: { encounters: ['wild'] }, + espurr: { encounters: ['wild'] }, + meowstic: { encounters: ['wild'] }, + meowsticf: { encounters: ['wild'] }, + spritzee: { encounters: ['wild'] }, + aromatisse: { encounters: ['wild'] }, + swirlix: { encounters: ['wild'] }, + slurpuff: { encounters: ['wild'] }, + inkay: { encounters: ['wild'] }, + malamar: { encounters: ['wild'] }, + binacle: { encounters: ['wild'] }, + barbaracle: { encounters: ['wild'] }, + skrelp: { encounters: ['wild'] }, + dragalge: { encounters: ['wild'] }, + clauncher: { encounters: ['wild'] }, + clawitzer: { encounters: ['wild'] }, + helioptile: { encounters: ['wild'] }, + heliolisk: { encounters: ['wild'] }, + tyrunt: { encounters: ['wild'] }, + tyrantrum: { encounters: ['wild'] }, + amaura: { encounters: ['wild'] }, + aurorus: { encounters: ['wild'] }, + sylveon: { encounters: ['wild'] }, + hawlucha: { encounters: ['wild', 'noshiny'] }, + dedenne: { encounters: ['wild'] }, + carbink: { encounters: ['research', 'noshiny'] }, + goomy: { encounters: ['wild'] }, + sliggoo: { encounters: ['wild'] }, + goodra: { encounters: ['wild'] }, + klefki: { encounters: ['wild', 'noshiny'] }, + phantump: { encounters: ['wild'] }, + trevenant: { encounters: ['wild'] }, + pumpkaboo: { encounters: ['wild'] }, + pumpkaboolarge: { encounters: ['wild'] }, + pumpkaboosmall: { encounters: ['wild'] }, + pumpkaboosuper: { encounters: ['wild'] }, + gourgeist: { encounters: ['wild'] }, + gourgeistlarge: { encounters: ['wild'] }, + gourgeistsmall: { encounters: ['wild'] }, + gourgeistsuper: { encounters: ['wild'] }, + bergmite: { encounters: ['wild'] }, + avalugg: { encounters: ['wild'] }, + avalugghisui: { encounters: ['wild'] }, + noibat: { encounters: ['wild'] }, + noivern: { encounters: ['wild'] }, + xerneas: { encounters: ['raid', 'specialtrade'] }, + yveltal: { encounters: ['raid', 'specialtrade'] }, // zygarde: {encounters: ['research', 'noshiny', 'notrade']}, - diancie: {encounters: ['research', 'noshiny', 'notrade']}, - hoopa: {encounters: ['raid', 'research', 'noshiny', 'notrade']}, - rowlet: {encounters: ['wild']}, - dartrix: {encounters: ['wild']}, - decidueye: {encounters: ['wild']}, - decidueyehisui: {encounters: ['raid']}, - litten: {encounters: ['wild']}, - torracat: {encounters: ['wild']}, - incineroar: {encounters: ['wild']}, - popplio: {encounters: ['wild']}, - brionne: {encounters: ['wild']}, - primarina: {encounters: ['wild']}, - pikipek: {encounters: ['wild', 'noshiny']}, - trumbeak: {encounters: ['wild', 'noshiny']}, - toucannon: {encounters: ['wild', 'noshiny']}, - yungoos: {encounters: ['wild']}, - gumshoos: {encounters: ['wild']}, - grubbin: {encounters: ['wild']}, - charjabug: {encounters: ['wild']}, - vikavolt: {encounters: ['wild']}, - crabrawler: {encounters: ['wild']}, - crabominable: {encounters: ['wild']}, - oricorio: {encounters: ['wild']}, - cutiefly: {encounters: ['wild']}, - ribombee: {encounters: ['wild']}, - rockruff: {encounters: ['wild']}, - rockruffdusk: {encounters: ['wild']}, - lycanroc: {encounters: ['wild']}, - lycanrocmidnight: {encounters: ['wild']}, - lycanrocdusk: {encounters: ['wild']}, - mareanie: {encounters: ['wild']}, - toxapex: {encounters: ['wild']}, + diancie: { encounters: ['research', 'noshiny', 'notrade'] }, + hoopa: { encounters: ['raid', 'research', 'noshiny', 'notrade'] }, + rowlet: { encounters: ['wild'] }, + dartrix: { encounters: ['wild'] }, + decidueye: { encounters: ['wild'] }, + decidueyehisui: { encounters: ['raid'] }, + litten: { encounters: ['wild'] }, + torracat: { encounters: ['wild'] }, + incineroar: { encounters: ['wild'] }, + popplio: { encounters: ['wild'] }, + brionne: { encounters: ['wild'] }, + primarina: { encounters: ['wild'] }, + pikipek: { encounters: ['wild', 'noshiny'] }, + trumbeak: { encounters: ['wild', 'noshiny'] }, + toucannon: { encounters: ['wild', 'noshiny'] }, + yungoos: { encounters: ['wild'] }, + gumshoos: { encounters: ['wild'] }, + grubbin: { encounters: ['wild'] }, + charjabug: { encounters: ['wild'] }, + vikavolt: { encounters: ['wild'] }, + crabrawler: { encounters: ['wild'] }, + crabominable: { encounters: ['wild'] }, + oricorio: { encounters: ['wild'] }, + cutiefly: { encounters: ['wild'] }, + ribombee: { encounters: ['wild'] }, + rockruff: { encounters: ['wild'] }, + rockruffdusk: { encounters: ['wild'] }, + lycanroc: { encounters: ['wild'] }, + lycanrocmidnight: { encounters: ['wild'] }, + lycanrocdusk: { encounters: ['wild'] }, + mareanie: { encounters: ['wild'] }, + toxapex: { encounters: ['wild'] }, // mudbray: {encounters: ['wild']}, available 2025-03-29 // mudsdale: {encounters: ['wild']}, - dewpider: {encounters: ['wild']}, - araquanid: {encounters: ['wild']}, - fomantis: {encounters: ['wild']}, - lurantis: {encounters: ['wild']}, - morelull: {encounters: ['wild']}, - shiinotic: {encounters: ['wild']}, - salandit: {encounters: ['12kmegg', 'research', 'noshiny']}, - salazzle: {encounters: ['12kmegg', 'research', 'noshiny']}, - stufful: {encounters: ['wild']}, - bewear: {encounters: ['wild']}, - bounsweet: {encounters: ['wild']}, - steenee: {encounters: ['wild']}, - tsareena: {encounters: ['wild']}, - comfey: {encounters: ['wild', 'noshiny']}, - oranguru: {encounters: ['wild']}, - passimian: {encounters: ['wild']}, - wimpod: {encounters: ['wild']}, - golisopod: {encounters: ['wild']}, - sandygast: {encounters: ['wild']}, - palossand: {encounters: ['wild']}, - komala: {encounters: ['wild']}, - turtonator: {encounters: ['egg', 'raid', 'research']}, - togedemaru: {encounters: ['wild']}, - bruxish: {encounters: ['wild', 'noshiny']}, - drampa: {encounters: ['egg', 'raid', 'research']}, - dhelmise: {encounters: ['raid', 'noshiny']}, - jangmoo: {encounters: ['wild']}, - hakamoo: {encounters: ['wild']}, - kommoo: {encounters: ['wild']}, - tapukoko: {encounters: ['raid']}, - tapulele: {encounters: ['raid']}, - tapubulu: {encounters: ['raid']}, - tapufini: {encounters: ['raid']}, - cosmog: {encounters: ['research', 'noshiny', 'specialtrade']}, - cosmoem: {encounters: ['research', 'noshiny', 'specialtrade']}, - solgaleo: {encounters: ['research', 'noshiny', 'specialtrade']}, - lunala: {encounters: ['research', 'noshiny', 'specialtrade']}, - nihilego: {encounters: ['raid', 'research', 'specialtrade']}, - buzzwole: {encounters: ['raid', 'research', 'specialtrade']}, - pheromosa: {encounters: ['raid', 'research', 'specialtrade']}, - xurkitree: {encounters: ['raid', 'research', 'specialtrade']}, - celesteela: {encounters: ['raid', 'research', 'specialtrade']}, - kartana: {encounters: ['raid', 'research', 'specialtrade']}, - guzzlord: {encounters: ['raid', 'research', 'specialtrade']}, - poipole: {encounters: ['research', 'noshiny', 'specialtrade']}, - naganadel: {encounters: ['research', 'noshiny', 'specialtrade']}, - stakataka: {encounters: ['raid', 'research', 'noshiny', 'specialtrade']}, - blacephalon: {encounters: ['raid', 'research', 'noshiny', 'specialtrade']}, - necrozma: {encounters: ['raid', 'specialtrade']}, - meltan: {encounters: ['wild']}, - melmetal: {encounters: ['wild']}, - grookey: {encounters: ['wild', 'noshiny']}, - thwackey: {encounters: ['wild', 'noshiny']}, - rillaboom: {encounters: ['wild', 'noshiny']}, - scorbunny: {encounters: ['wild', 'noshiny']}, - raboot: {encounters: ['wild', 'noshiny']}, - cinderace: {encounters: ['wild', 'noshiny']}, - sobble: {encounters: ['wild', 'noshiny']}, - drizzile: {encounters: ['wild', 'noshiny']}, - inteleon: {encounters: ['wild', 'noshiny']}, - skwovet: {encounters: ['wild']}, - greedent: {encounters: ['wild']}, - rookidee: {encounters: ['wild', 'noshiny']}, - corvisquire: {encounters: ['wild', 'noshiny']}, - corviknight: {encounters: ['wild', 'noshiny']}, - toxel: {encounters: ['egg']}, - toxtricity: {encounters: ['egg', 'raid', 'research']}, - toxtricitylowkey: {encounters: ['egg', 'raid', 'research']}, - sinistea: {encounters: ['raid', 'research', 'noshiny']}, - sinisteaantique: {encounters: ['raid', 'research', 'noshiny']}, - polteageist: {encounters: ['raid', 'research', 'noshiny']}, - polteageistantique: {encounters: ['raid', 'research', 'noshiny']}, - hatenna: {encounters: ['wild', 'noshiny']}, - hattrem: {encounters: ['wild', 'noshiny']}, - hatterene: {encounters: ['wild', 'noshiny']}, - obstagoon: {encounters: ['wild']}, - perrserker: {encounters: ['wild']}, - cursola: {encounters: ['egg']}, - sirfetchd: {encounters: ['wild']}, - mrrime: {encounters: ['wild']}, - runerigus: {encounters: ['egg', 'raid', 'research']}, - falinks: {encounters: ['wild']}, - stonjourner: {encounters: ['wild', 'noshiny']}, - morpeko: {encounters: ['wild', 'noshiny']}, - dreepy: {encounters: ['wild', 'noshiny']}, - drakloak: {encounters: ['wild', 'noshiny']}, - dragapult: {encounters: ['wild', 'noshiny']}, - zacian: {encounters: ['raid', 'specialtrade']}, - zamazenta: {encounters: ['raid', 'specialtrade']}, - zarude: {encounters: ['research', 'noshiny', 'notrade']}, - regieleki: {encounters: ['raid', 'specialtrade']}, - regidrago: {encounters: ['raid', 'specialtrade']}, - wyrdeer: {encounters: ['wild']}, - kleavor: {encounters: ['wild']}, - ursaluna: {encounters: ['wild']}, - sneasler: {encounters: ['wild']}, - overqwil: {encounters: ['wild']}, - enamorus: {encounters: ['raid', 'noshiny', 'specialtrade']}, - sprigatito: {encounters: ['wild']}, - floragato: {encounters: ['wild']}, - meowscarada: {encounters: ['wild']}, - fuecoco: {encounters: ['wild', 'noshiny']}, // Shiny available 2025-03-08 - crocalor: {encounters: ['wild', 'noshiny']}, - skeledirge: {encounters: ['wild', 'noshiny']}, - quaxly: {encounters: ['wild', 'noshiny']}, - quaxwell: {encounters: ['wild', 'noshiny']}, - quaquaval: {encounters: ['wild', 'noshiny']}, - lechonk: {encounters: ['wild']}, - oinkologne: {encounters: ['wild']}, - oinkolognef: {encounters: ['wild']}, - nymble: {encounters: ['wild']}, - lokix: {encounters: ['wild']}, - tandemaus: {encounters: ['research', 'noshiny']}, - maushold: {encounters: ['research', 'noshiny']}, - mausholdfour: {encounters: ['research', 'noshiny']}, - fidough: {encounters: ['wild', 'noshiny']}, - dachsbun: {encounters: ['wild', 'noshiny']}, - pawmi: {encounters: ['wild', 'noshiny']}, - pawmo: {encounters: ['wild', 'noshiny']}, - pawmot: {encounters: ['wild', 'noshiny']}, - smoliv: {encounters: ['wild']}, - dolliv: {encounters: ['wild']}, - arboliva: {encounters: ['wild']}, - charcadet: {encounters: ['egg', 'research', 'noshiny']}, - armarouge: {encounters: ['egg', 'research', 'noshiny']}, - ceruledge: {encounters: ['egg', 'research', 'noshiny']}, - tadbulb: {encounters: ['wild', 'noshiny']}, - bellibolt: {encounters: ['wild', 'noshiny']}, - shroodle: {encounters: ['12kmegg', 'noshiny']}, - grafaiai: {encounters: ['12kmegg', 'noshiny']}, - wiglett: {encounters: ['wild', 'noshiny']}, - wugtrio: {encounters: ['wild', 'noshiny']}, - varoom: {encounters: ['12kmegg', 'noshiny']}, - revavroom: {encounters: ['12kmegg', 'noshiny']}, - greavard: {encounters: ['wild', 'noshiny']}, - houndstone: {encounters: ['wild', 'noshiny']}, - cetoddle: {encounters: ['wild']}, - cetitan: {encounters: ['wild']}, - annihilape: {encounters: ['wild']}, - clodsire: {encounters: ['wild', 'noshiny']}, - frigibax: {encounters: ['wild', 'noshiny']}, - arctibax: {encounters: ['wild', 'noshiny']}, - baxcalibur: {encounters: ['wild', 'noshiny']}, - gimmighoulroaming: {encounters: ['wild', 'noshiny']}, - gholdengo: {encounters: ['wild', 'noshiny']}, + dewpider: { encounters: ['wild'] }, + araquanid: { encounters: ['wild'] }, + fomantis: { encounters: ['wild'] }, + lurantis: { encounters: ['wild'] }, + morelull: { encounters: ['wild'] }, + shiinotic: { encounters: ['wild'] }, + salandit: { encounters: ['12kmegg', 'research', 'noshiny'] }, + salazzle: { encounters: ['12kmegg', 'research', 'noshiny'] }, + stufful: { encounters: ['wild'] }, + bewear: { encounters: ['wild'] }, + bounsweet: { encounters: ['wild'] }, + steenee: { encounters: ['wild'] }, + tsareena: { encounters: ['wild'] }, + comfey: { encounters: ['wild', 'noshiny'] }, + oranguru: { encounters: ['wild'] }, + passimian: { encounters: ['wild'] }, + wimpod: { encounters: ['wild'] }, + golisopod: { encounters: ['wild'] }, + sandygast: { encounters: ['wild'] }, + palossand: { encounters: ['wild'] }, + komala: { encounters: ['wild'] }, + turtonator: { encounters: ['egg', 'raid', 'research'] }, + togedemaru: { encounters: ['wild'] }, + bruxish: { encounters: ['wild', 'noshiny'] }, + drampa: { encounters: ['egg', 'raid', 'research'] }, + dhelmise: { encounters: ['raid', 'noshiny'] }, + jangmoo: { encounters: ['wild'] }, + hakamoo: { encounters: ['wild'] }, + kommoo: { encounters: ['wild'] }, + tapukoko: { encounters: ['raid'] }, + tapulele: { encounters: ['raid'] }, + tapubulu: { encounters: ['raid'] }, + tapufini: { encounters: ['raid'] }, + cosmog: { encounters: ['research', 'noshiny', 'specialtrade'] }, + cosmoem: { encounters: ['research', 'noshiny', 'specialtrade'] }, + solgaleo: { encounters: ['research', 'noshiny', 'specialtrade'] }, + lunala: { encounters: ['research', 'noshiny', 'specialtrade'] }, + nihilego: { encounters: ['raid', 'research', 'specialtrade'] }, + buzzwole: { encounters: ['raid', 'research', 'specialtrade'] }, + pheromosa: { encounters: ['raid', 'research', 'specialtrade'] }, + xurkitree: { encounters: ['raid', 'research', 'specialtrade'] }, + celesteela: { encounters: ['raid', 'research', 'specialtrade'] }, + kartana: { encounters: ['raid', 'research', 'specialtrade'] }, + guzzlord: { encounters: ['raid', 'research', 'specialtrade'] }, + poipole: { encounters: ['research', 'noshiny', 'specialtrade'] }, + naganadel: { encounters: ['research', 'noshiny', 'specialtrade'] }, + stakataka: { encounters: ['raid', 'research', 'noshiny', 'specialtrade'] }, + blacephalon: { encounters: ['raid', 'research', 'noshiny', 'specialtrade'] }, + necrozma: { encounters: ['raid', 'specialtrade'] }, + meltan: { encounters: ['wild'] }, + melmetal: { encounters: ['wild'] }, + grookey: { encounters: ['wild', 'noshiny'] }, + thwackey: { encounters: ['wild', 'noshiny'] }, + rillaboom: { encounters: ['wild', 'noshiny'] }, + scorbunny: { encounters: ['wild', 'noshiny'] }, + raboot: { encounters: ['wild', 'noshiny'] }, + cinderace: { encounters: ['wild', 'noshiny'] }, + sobble: { encounters: ['wild', 'noshiny'] }, + drizzile: { encounters: ['wild', 'noshiny'] }, + inteleon: { encounters: ['wild', 'noshiny'] }, + skwovet: { encounters: ['wild'] }, + greedent: { encounters: ['wild'] }, + rookidee: { encounters: ['wild', 'noshiny'] }, + corvisquire: { encounters: ['wild', 'noshiny'] }, + corviknight: { encounters: ['wild', 'noshiny'] }, + toxel: { encounters: ['egg'] }, + toxtricity: { encounters: ['egg', 'raid', 'research'] }, + toxtricitylowkey: { encounters: ['egg', 'raid', 'research'] }, + sinistea: { encounters: ['raid', 'research', 'noshiny'] }, + sinisteaantique: { encounters: ['raid', 'research', 'noshiny'] }, + polteageist: { encounters: ['raid', 'research', 'noshiny'] }, + polteageistantique: { encounters: ['raid', 'research', 'noshiny'] }, + hatenna: { encounters: ['wild', 'noshiny'] }, + hattrem: { encounters: ['wild', 'noshiny'] }, + hatterene: { encounters: ['wild', 'noshiny'] }, + obstagoon: { encounters: ['wild'] }, + perrserker: { encounters: ['wild'] }, + cursola: { encounters: ['egg'] }, + sirfetchd: { encounters: ['wild'] }, + mrrime: { encounters: ['wild'] }, + runerigus: { encounters: ['egg', 'raid', 'research'] }, + falinks: { encounters: ['wild'] }, + stonjourner: { encounters: ['wild', 'noshiny'] }, + morpeko: { encounters: ['wild', 'noshiny'] }, + dreepy: { encounters: ['wild', 'noshiny'] }, + drakloak: { encounters: ['wild', 'noshiny'] }, + dragapult: { encounters: ['wild', 'noshiny'] }, + zacian: { encounters: ['raid', 'specialtrade'] }, + zamazenta: { encounters: ['raid', 'specialtrade'] }, + zarude: { encounters: ['research', 'noshiny', 'notrade'] }, + regieleki: { encounters: ['raid', 'specialtrade'] }, + regidrago: { encounters: ['raid', 'specialtrade'] }, + wyrdeer: { encounters: ['wild'] }, + kleavor: { encounters: ['wild'] }, + ursaluna: { encounters: ['wild'] }, + sneasler: { encounters: ['wild'] }, + overqwil: { encounters: ['wild'] }, + enamorus: { encounters: ['raid', 'noshiny', 'specialtrade'] }, + sprigatito: { encounters: ['wild'] }, + floragato: { encounters: ['wild'] }, + meowscarada: { encounters: ['wild'] }, + fuecoco: { encounters: ['wild', 'noshiny'] }, // Shiny available 2025-03-08 + crocalor: { encounters: ['wild', 'noshiny'] }, + skeledirge: { encounters: ['wild', 'noshiny'] }, + quaxly: { encounters: ['wild', 'noshiny'] }, + quaxwell: { encounters: ['wild', 'noshiny'] }, + quaquaval: { encounters: ['wild', 'noshiny'] }, + lechonk: { encounters: ['wild'] }, + oinkologne: { encounters: ['wild'] }, + oinkolognef: { encounters: ['wild'] }, + nymble: { encounters: ['wild'] }, + lokix: { encounters: ['wild'] }, + tandemaus: { encounters: ['research', 'noshiny'] }, + maushold: { encounters: ['research', 'noshiny'] }, + mausholdfour: { encounters: ['research', 'noshiny'] }, + fidough: { encounters: ['wild', 'noshiny'] }, + dachsbun: { encounters: ['wild', 'noshiny'] }, + pawmi: { encounters: ['wild', 'noshiny'] }, + pawmo: { encounters: ['wild', 'noshiny'] }, + pawmot: { encounters: ['wild', 'noshiny'] }, + smoliv: { encounters: ['wild'] }, + dolliv: { encounters: ['wild'] }, + arboliva: { encounters: ['wild'] }, + charcadet: { encounters: ['egg', 'research', 'noshiny'] }, + armarouge: { encounters: ['egg', 'research', 'noshiny'] }, + ceruledge: { encounters: ['egg', 'research', 'noshiny'] }, + tadbulb: { encounters: ['wild', 'noshiny'] }, + bellibolt: { encounters: ['wild', 'noshiny'] }, + shroodle: { encounters: ['12kmegg', 'noshiny'] }, + grafaiai: { encounters: ['12kmegg', 'noshiny'] }, + wiglett: { encounters: ['wild', 'noshiny'] }, + wugtrio: { encounters: ['wild', 'noshiny'] }, + varoom: { encounters: ['12kmegg', 'noshiny'] }, + revavroom: { encounters: ['12kmegg', 'noshiny'] }, + greavard: { encounters: ['wild', 'noshiny'] }, + houndstone: { encounters: ['wild', 'noshiny'] }, + cetoddle: { encounters: ['wild'] }, + cetitan: { encounters: ['wild'] }, + annihilape: { encounters: ['wild'] }, + clodsire: { encounters: ['wild', 'noshiny'] }, + frigibax: { encounters: ['wild', 'noshiny'] }, + arctibax: { encounters: ['wild', 'noshiny'] }, + baxcalibur: { encounters: ['wild', 'noshiny'] }, + gimmighoulroaming: { encounters: ['wild', 'noshiny'] }, + gholdengo: { encounters: ['wild', 'noshiny'] }, }; diff --git a/data/random-battles/gen1/teams.ts b/data/random-battles/gen1/teams.ts index 59b8bee733..4dc233943d 100644 --- a/data/random-battles/gen1/teams.ts +++ b/data/random-battles/gen1/teams.ts @@ -1,5 +1,5 @@ import RandomGen2Teams from '../gen2/teams'; -import {Utils} from '../../../lib'; +import { Utils } from '../../../lib'; interface HackmonsCupEntry { types: string[]; @@ -15,7 +15,7 @@ interface Gen1RandomBattleSpecies { } export class RandomGen1Teams extends RandomGen2Teams { - randomData: {[species: IDEntry]: Gen1RandomBattleSpecies} = require('./data.json'); + randomData: { [species: IDEntry]: Gen1RandomBattleSpecies } = require('./data.json'); // Challenge Cup or CC teams are basically fully random teams. randomCCTeam() { @@ -77,7 +77,7 @@ export class RandomGen1Teams extends RandomGen2Teams { ivs["spe"] *= 2; // Maxed EVs. - const evs = {hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255}; + const evs = { hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255 }; // Four random unique moves from movepool. don't worry about "attacking" or "viable". // Since Gens 1 and 2 learnsets are shared, we need to weed out Gen 2 moves. @@ -89,8 +89,8 @@ export class RandomGen1Teams extends RandomGen2Teams { moves: this.multipleSamplesNoReplace(pool, 4), gender: false, ability: 'No Ability', - evs: evs, - ivs: ivs, + evs, + ivs, item: '', level, happiness: 0, @@ -120,8 +120,8 @@ export class RandomGen1Teams extends RandomGen2Teams { const rejectedButNotInvalidPool: string[] = []; // Now let's store what we are getting. - const typeCount: {[k: string]: number} = {}; - const weaknessCount: {[k: string]: number} = {Electric: 0, Psychic: 0, Water: 0, Ice: 0, Ground: 0, Fire: 0}; + const typeCount: { [k: string]: number } = {}; + const weaknessCount: { [k: string]: number } = { Electric: 0, Psychic: 0, Water: 0, Ice: 0, Ground: 0, Fire: 0 }; let numMaxLevelPokemon = 0; const pokemonPool = Object.keys(this.getPokemonPool(type, pokemon, isMonotype, Object.keys(this.randomData))[0]); @@ -257,8 +257,8 @@ export class RandomGen1Teams extends RandomGen2Teams { const level = this.getLevel(species); - const evs = {hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255}; - const ivs = {hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30}; + const evs = { hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255 }; + const ivs = { hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30 }; // Should be able to use Substitute four times from full HP without fainting if (moves.has('substitute')) { @@ -308,7 +308,7 @@ export class RandomGen1Teams extends RandomGen2Teams { const typesPool = ['Bird', ...this.dex.types.names()]; const randomN = this.randomNPokemon(this.maxTeamSize); - const hackmonsCup: {[k: string]: HackmonsCupEntry} = {}; + const hackmonsCup: { [k: string]: HackmonsCupEntry } = {}; for (const forme of randomN) { // Choose forme diff --git a/data/random-battles/gen2/teams.ts b/data/random-battles/gen2/teams.ts index 2ff19a98c1..60ee0bb51b 100644 --- a/data/random-battles/gen2/teams.ts +++ b/data/random-battles/gen2/teams.ts @@ -1,6 +1,6 @@ import RandomGen3Teams from '../gen3/teams'; -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import type {MoveCounter} from '../gen8/teams'; +import type { PRNG, PRNGSeed } from '../../../sim/prng'; +import type { MoveCounter } from '../gen8/teams'; // Moves that restore HP: const RECOVERY_MOVES = [ @@ -26,7 +26,7 @@ const MOVE_PAIRS = [ ]; export class RandomGen2Teams extends RandomGen3Teams { - randomSets: {[species: IDEntry]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomSets: { [species: IDEntry]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); constructor(format: string | Format, prng: PRNG | PRNGSeed | null) { super(format, prng); @@ -312,7 +312,7 @@ export class RandomGen2Teams extends RandomGen3Teams { if (['Fast Attacker', 'Setup Sweeper', 'Bulky Attacker'].includes(role)) { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -397,8 +397,8 @@ export class RandomGen2Teams extends RandomGen3Teams { const ability = ''; let item = undefined; - const evs = {hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255}; - const ivs = {hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30}; + const evs = { hp: 255, atk: 255, def: 255, spa: 255, spd: 255, spe: 255 }; + const ivs = { hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30 }; const types = species.types; const abilities: string[] = []; @@ -426,22 +426,22 @@ export class RandomGen2Teams extends RandomGen3Teams { if (move.startsWith('hiddenpower')) hpType = move.substr(11); } if (!hpType) throw new Error(`hasHiddenPower is true, but no Hidden Power move was found.`); - const hpIVs: {[k: string]: Partial} = { - dragon: {def: 28}, - ice: {def: 26}, - psychic: {def: 24}, - electric: {atk: 28}, - grass: {atk: 28, def: 28}, - water: {atk: 28, def: 26}, - fire: {atk: 28, def: 24}, - steel: {atk: 26}, - ghost: {atk: 26, def: 28}, - bug: {atk: 26, def: 26}, - rock: {atk: 26, def: 24}, - ground: {atk: 24}, - poison: {atk: 24, def: 28}, - flying: {atk: 24, def: 26}, - fighting: {atk: 24, def: 24}, + const hpIVs: { [k: string]: Partial } = { + dragon: { def: 28 }, + ice: { def: 26 }, + psychic: { def: 24 }, + electric: { atk: 28 }, + grass: { atk: 28, def: 28 }, + water: { atk: 28, def: 26 }, + fire: { atk: 28, def: 24 }, + steel: { atk: 26 }, + ghost: { atk: 26, def: 28 }, + bug: { atk: 26, def: 26 }, + rock: { atk: 26, def: 24 }, + ground: { atk: 24 }, + poison: { atk: 24, def: 28 }, + flying: { atk: 24, def: 26 }, + fighting: { atk: 24, def: 24 }, }; let iv: StatID; for (iv in hpIVs[hpType]) { diff --git a/data/random-battles/gen3/teams.ts b/data/random-battles/gen3/teams.ts index 3865ed7030..b11a05d220 100644 --- a/data/random-battles/gen3/teams.ts +++ b/data/random-battles/gen3/teams.ts @@ -1,6 +1,6 @@ import RandomGen4Teams from '../gen4/teams'; -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import type {MoveCounter} from '../gen8/teams'; +import type { PRNG, PRNGSeed } from '../../../sim/prng'; +import type { MoveCounter } from '../gen8/teams'; // Moves that restore HP: const RECOVERY_MOVES = [ @@ -30,7 +30,7 @@ export class RandomGen3Teams extends RandomGen4Teams { battleHasDitto: boolean; battleHasWobbuffet: boolean; - randomSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); constructor(format: string | Format, prng: PRNG | PRNGSeed | null) { super(format, prng); @@ -349,7 +349,7 @@ export class RandomGen3Teams extends RandomGen4Teams { if (['Fast Attacker', 'Setup Sweeper', 'Bulky Attacker', 'Wallbreaker', 'Berry Sweeper'].includes(role)) { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -410,7 +410,6 @@ export class RandomGen3Teams extends RandomGen4Teams { return false; } - getAbility( types: Set, moves: Set, @@ -540,8 +539,8 @@ export class RandomGen3Teams extends RandomGen4Teams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const abilities = set.abilities!; @@ -648,10 +647,10 @@ export class RandomGen3Teams extends RandomGen4Teams { const typePool = this.dex.types.names(); const type = this.forceMonotype || this.sample(typePool); - const baseFormes: {[k: string]: number} = {}; - const typeCount: {[k: string]: number} = {}; - const typeWeaknesses: {[k: string]: number} = {}; - const typeDoubleWeaknesses: {[k: string]: number} = {}; + const baseFormes: { [k: string]: number } = {}; + const typeCount: { [k: string]: number } = {}; + const typeWeaknesses: { [k: string]: number } = {}; + const typeDoubleWeaknesses: { [k: string]: number } = {}; const teamDetails: RandomTeamsTypes.TeamDetails = {}; let numMaxLevelPokemon = 0; @@ -701,7 +700,7 @@ export class RandomGen3Teams extends RandomGen4Teams { } if (this.dex.getEffectiveness(typeName, species) > 1) { if (!typeDoubleWeaknesses[typeName]) typeDoubleWeaknesses[typeName] = 0; - if (typeDoubleWeaknesses[typeName] >= 1 * limitFactor) { + if (typeDoubleWeaknesses[typeName] >= limitFactor) { skip = true; break; } diff --git a/data/random-battles/gen4/teams.ts b/data/random-battles/gen4/teams.ts index 77767826d0..6ab4569548 100644 --- a/data/random-battles/gen4/teams.ts +++ b/data/random-battles/gen4/teams.ts @@ -1,6 +1,6 @@ import RandomGen5Teams from '../gen5/teams'; -import {PRNG} from '../../../sim'; -import type {MoveCounter} from '../gen8/teams'; +import type { PRNG } from '../../../sim'; +import type { MoveCounter } from '../gen8/teams'; // Moves that restore HP: const RECOVERY_MOVES = [ @@ -42,7 +42,7 @@ const PRIORITY_POKEMON = [ ]; export class RandomGen4Teams extends RandomGen5Teams { - randomSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); constructor(format: string | Format, prng: PRNG | PRNGSeed | null) { super(format, prng); @@ -427,7 +427,7 @@ export class RandomGen4Teams extends RandomGen5Teams { if (['Fast Attacker', 'Setup Sweeper', 'Bulky Attacker', 'Wallbreaker'].includes(role)) { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -490,7 +490,6 @@ export class RandomGen4Teams extends RandomGen5Teams { return false; } - getAbility( types: Set, moves: Set, @@ -677,8 +676,8 @@ export class RandomGen4Teams extends RandomGen5Teams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const abilities = set.abilities!; diff --git a/data/random-battles/gen5/teams.ts b/data/random-battles/gen5/teams.ts index db1945022f..aca7646ea4 100644 --- a/data/random-battles/gen5/teams.ts +++ b/data/random-battles/gen5/teams.ts @@ -1,7 +1,7 @@ import RandomGen6Teams from '../gen6/teams'; -import {PRNG} from '../../../sim'; -import {MoveCounter} from '../gen8/teams'; -import {toID} from '../../../sim/dex'; +import type { PRNG } from '../../../sim'; +import type { MoveCounter } from '../gen8/teams'; +import { toID } from '../../../sim/dex'; // Moves that restore HP: const RECOVERY_MOVES = [ @@ -51,7 +51,7 @@ const PRIORITY_POKEMON = [ ]; export class RandomGen5Teams extends RandomGen6Teams { - randomSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); constructor(format: string | Format, prng: PRNG | PRNGSeed | null) { super(format, prng); @@ -454,7 +454,7 @@ export class RandomGen5Teams extends RandomGen6Teams { if (['Fast Attacker', 'Setup Sweeper', 'Bulky Attacker', 'Wallbreaker'].includes(role)) { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -521,7 +521,6 @@ export class RandomGen5Teams extends RandomGen6Teams { return false; } - getAbility( types: Set, moves: Set, @@ -659,7 +658,7 @@ export class RandomGen5Teams extends RandomGen6Teams { if (moves.has('outrage') && counter.get('setup')) return 'Lum Berry'; if ( (ability === 'Rough Skin') || (species.id !== 'hooh' && role !== 'Wallbreaker' && - ability === 'Regenerator' && species.baseStats.hp + species.baseStats.def >= 180 && this.randomChance(1, 2)) + ability === 'Regenerator' && species.baseStats.hp + species.baseStats.def >= 180 && this.randomChance(1, 2)) ) return 'Rocky Helmet'; if (['protect', 'substitute'].some(m => moves.has(m))) return 'Leftovers'; if ( @@ -730,8 +729,8 @@ export class RandomGen5Teams extends RandomGen6Teams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const abilities = set.abilities!; @@ -853,10 +852,10 @@ export class RandomGen5Teams extends RandomGen6Teams { const typePool = this.dex.types.names(); const type = this.forceMonotype || this.sample(typePool); - const baseFormes: {[k: string]: number} = {}; - const typeCount: {[k: string]: number} = {}; - const typeWeaknesses: {[k: string]: number} = {}; - const typeDoubleWeaknesses: {[k: string]: number} = {}; + const baseFormes: { [k: string]: number } = {}; + const typeCount: { [k: string]: number } = {}; + const typeWeaknesses: { [k: string]: number } = {}; + const typeDoubleWeaknesses: { [k: string]: number } = {}; const teamDetails: RandomTeamsTypes.TeamDetails = {}; let numMaxLevelPokemon = 0; @@ -905,7 +904,7 @@ export class RandomGen5Teams extends RandomGen6Teams { } if (this.dex.getEffectiveness(typeName, species) > 1) { if (!typeDoubleWeaknesses[typeName]) typeDoubleWeaknesses[typeName] = 0; - if (typeDoubleWeaknesses[typeName] >= 1 * limitFactor) { + if (typeDoubleWeaknesses[typeName] >= limitFactor) { skip = true; break; } diff --git a/data/random-battles/gen6/teams.ts b/data/random-battles/gen6/teams.ts index dce848f40a..054974ae8a 100644 --- a/data/random-battles/gen6/teams.ts +++ b/data/random-battles/gen6/teams.ts @@ -1,7 +1,7 @@ -import {MoveCounter, TeamData} from '../gen8/teams'; -import RandomGen7Teams, {BattleFactorySpecies, ZeroAttackHPIVs} from '../gen7/teams'; -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import {toID} from '../../../sim/dex'; +import { type MoveCounter, type TeamData } from '../gen8/teams'; +import RandomGen7Teams, { type BattleFactorySpecies, ZeroAttackHPIVs } from '../gen7/teams'; +import { type PRNG, type PRNGSeed } from '../../../sim/prng'; +import { toID } from '../../../sim/dex'; // Moves that restore HP: const RECOVERY_MOVES = [ @@ -62,7 +62,7 @@ const PRIORITY_POKEMON = [ ]; export class RandomGen6Teams extends RandomGen7Teams { - randomSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); constructor(format: Format | string, prng: PRNG | PRNGSeed | null) { super(format, prng); @@ -490,7 +490,7 @@ export class RandomGen6Teams extends RandomGen7Teams { if (['Fast Attacker', 'Setup Sweeper', 'Bulky Attacker', 'Wallbreaker'].includes(role)) { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -561,7 +561,6 @@ export class RandomGen6Teams extends RandomGen7Teams { return false; } - getAbility( types: Set, moves: Set, @@ -777,8 +776,8 @@ export class RandomGen6Teams extends RandomGen7Teams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const baseAbilities = set.abilities!; @@ -890,7 +889,7 @@ export class RandomGen6Teams extends RandomGen7Teams { }; } - randomFactorySets: {[format: string]: {[species: string]: BattleFactorySpecies}} = require('./factory-sets.json'); + randomFactorySets: { [format: string]: { [species: string]: BattleFactorySpecies } } = require('./factory-sets.json'); randomFactorySet( species: Species, @@ -901,12 +900,14 @@ export class RandomGen6Teams extends RandomGen7Teams { // const flags = this.randomFactorySets[tier][id].flags; const setList = this.randomFactorySets[tier][id].sets; - const itemsMax: {[k: string]: number} = {choicespecs: 1, choiceband: 1, choicescarf: 1}; - const movesMax: {[k: string]: number} = { + const itemsMax: { [k: string]: number } = { choicespecs: 1, choiceband: 1, choicescarf: 1 }; + const movesMax: { [k: string]: number } = { rapidspin: 1, batonpass: 1, stealthrock: 1, defog: 1, spikes: 1, toxicspikes: 1, }; - const requiredMoves: {[k: string]: string} = {stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear'}; - const weatherAbilitiesRequire: {[k: string]: string} = { + const requiredMoves: { [k: string]: string } = { + stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear', + }; + const weatherAbilitiesRequire: { [k: string]: string } = { hydration: 'raindance', swiftswim: 'raindance', leafguard: 'sunnyday', solarpower: 'sunnyday', chlorophyll: 'sunnyday', sandforce: 'sandstorm', sandrush: 'sandstorm', sandveil: 'sandstorm', @@ -916,7 +917,7 @@ export class RandomGen6Teams extends RandomGen7Teams { // Build a pool of eligible sets, given the team partners // Also keep track of sets with moves the team requires - let effectivePool: {set: AnyObject, moveVariants?: number[], itemVariants?: number, abilityVariants?: number}[] = []; + let effectivePool: { set: AnyObject, moveVariants?: number[], itemVariants?: number, abilityVariants?: number }[] = []; const priorityPool = []; for (const curSet of setList) { if (this.forceMonotype && !species.types.includes(this.forceMonotype)) continue; @@ -945,15 +946,15 @@ export class RandomGen6Teams extends RandomGen7Teams { curSetVariants.push(variantIndex); } if (reject) continue; - effectivePool.push({set: curSet, moveVariants: curSetVariants}); - if (hasRequiredMove) priorityPool.push({set: curSet, moveVariants: curSetVariants}); + effectivePool.push({ set: curSet, moveVariants: curSetVariants }); + if (hasRequiredMove) priorityPool.push({ set: curSet, moveVariants: curSetVariants }); } if (priorityPool.length) effectivePool = priorityPool; if (!effectivePool.length) { if (!teamData.forceResult) return null; for (const curSet of setList) { - effectivePool.push({set: curSet}); + effectivePool.push({ set: curSet }); } } @@ -972,10 +973,10 @@ export class RandomGen6Teams extends RandomGen7Teams { shiny: typeof setData.set.shiny === 'undefined' ? this.randomChance(1, 1024) : setData.set.shiny, level: this.adjustLevel || 100, happiness: typeof setData.set.happiness === 'undefined' ? 255 : setData.set.happiness, - evs: setData.set.evs || {hp: 84, atk: 84, def: 84, spa: 84, spd: 84, spe: 84}, - ivs: setData.set.ivs || {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}, + evs: setData.set.evs || { hp: 84, atk: 84, def: 84, spa: 84, spd: 84, spe: 84 }, + ivs: setData.set.ivs || { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }, nature: setData.set.nature || 'Serious', - moves: moves, + moves, }; } @@ -998,11 +999,13 @@ export class RandomGen6Teams extends RandomGen7Teams { weaknesses: {}, resistances: {}, }; const requiredMoveFamilies = ['hazardSet', 'hazardClear']; - const requiredMoves: {[k: string]: string} = {stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear'}; - const weatherAbilitiesSet: {[k: string]: string} = { + const requiredMoves: { [k: string]: string } = { + stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear', + }; + const weatherAbilitiesSet: { [k: string]: string } = { drizzle: 'raindance', drought: 'sunnyday', snowwarning: 'hail', sandstream: 'sandstorm', }; - const resistanceAbilities: {[k: string]: string[]} = { + const resistanceAbilities: { [k: string]: string[] } = { dryskin: ['Water'], waterabsorb: ['Water'], stormdrain: ['Water'], flashfire: ['Fire'], heatproof: ['Fire'], lightningrod: ['Electric'], motordrive: ['Electric'], voltabsorb: ['Electric'], @@ -1047,7 +1050,7 @@ export class RandomGen6Teams extends RandomGen7Teams { // Drought and Drizzle don't count towards the type combo limit typeCombo = set.ability; } - if (teamData.typeComboCount[typeCombo] >= 1 * limitFactor) continue; + if (teamData.typeComboCount[typeCombo] >= limitFactor) continue; // Okay, the set passes, add it to our team pokemon.push(set); diff --git a/data/random-battles/gen7/teams.ts b/data/random-battles/gen7/teams.ts index 1b76f588b5..508a2316cc 100644 --- a/data/random-battles/gen7/teams.ts +++ b/data/random-battles/gen7/teams.ts @@ -1,9 +1,9 @@ -import {MoveCounter, TeamData, RandomGen8Teams} from '../gen8/teams'; -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import {toID} from '../../../sim/dex'; +import { MoveCounter, type TeamData, RandomGen8Teams } from '../gen8/teams'; +import type { PRNG, PRNGSeed } from '../../../sim/prng'; +import { toID } from '../../../sim/dex'; export interface BattleFactorySpecies { - flags: {megaOnly?: 1, zmoveOnly?: 1, limEevee?: 1}; + flags: { megaOnly?: 1, zmoveOnly?: 1, limEevee?: 1 }; sets: BattleFactorySet[]; } interface BattleFactorySet { @@ -16,16 +16,16 @@ interface BattleFactorySet { ivs?: Partial; } -export const ZeroAttackHPIVs: {[k: string]: SparseStatsTable} = { - grass: {hp: 30, spa: 30}, - fire: {spa: 30, spe: 30}, - ice: {def: 30}, - ground: {spa: 30, spd: 30}, - fighting: {def: 30, spa: 30, spd: 30, spe: 30}, - electric: {def: 30, spe: 30}, - psychic: {spe: 30}, - flying: {spa: 30, spd: 30, spe: 30}, - rock: {def: 30, spd: 30, spe: 30}, +export const ZeroAttackHPIVs: { [k: string]: SparseStatsTable } = { + grass: { hp: 30, spa: 30 }, + fire: { spa: 30, spe: 30 }, + ice: { def: 30 }, + ground: { spa: 30, spd: 30 }, + fighting: { def: 30, spa: 30, spd: 30, spe: 30 }, + electric: { def: 30, spe: 30 }, + psychic: { spe: 30 }, + flying: { spa: 30, spd: 30, spe: 30 }, + rock: { def: 30, spd: 30, spe: 30 }, }; // Moves that restore HP: @@ -98,7 +98,7 @@ function sereneGraceBenefits(move: Move) { } export class RandomGen7Teams extends RandomGen8Teams { - randomSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); protected cachedStatusMoves: ID[]; constructor(format: Format | string, prng: PRNG | PRNGSeed | null) { @@ -159,7 +159,7 @@ export class RandomGen7Teams extends RandomGen8Teams { const types = species.types; if (!moves?.size) return counter; - const categories = {Physical: 0, Special: 0, Status: 0}; + const categories = { Physical: 0, Special: 0, Status: 0 }; // Iterate through all moves we've chosen so far and keep track of what they do: for (const moveid of moves) { @@ -679,7 +679,7 @@ export class RandomGen7Teams extends RandomGen8Teams { if (['Fast Attacker', 'Setup Sweeper', 'Bulky Attacker', 'Wallbreaker', 'Z-Move user'].includes(role)) { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -752,7 +752,6 @@ export class RandomGen7Teams extends RandomGen8Teams { return false; } - getAbility( types: Set, moves: Set, @@ -996,7 +995,7 @@ export class RandomGen7Teams extends RandomGen8Teams { } // Gen 2 still uses tier-based levelling if (this.gen === 2) { - const levelScale: {[k: string]: number} = { + const levelScale: { [k: string]: number } = { ZU: 81, ZUBL: 79, PU: 77, @@ -1044,8 +1043,8 @@ export class RandomGen7Teams extends RandomGen8Teams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const baseAbilities = set.abilities!; @@ -1191,13 +1190,13 @@ export class RandomGen7Teams extends RandomGen8Teams { const typePool = this.dex.types.names(); const type = this.forceMonotype || this.sample(typePool); - const baseFormes: {[k: string]: number} = {}; + const baseFormes: { [k: string]: number } = {}; let hasMega = false; - const typeCount: {[k: string]: number} = {}; - const typeComboCount: {[k: string]: number} = {}; - const typeWeaknesses: {[k: string]: number} = {}; - const typeDoubleWeaknesses: {[k: string]: number} = {}; + const typeCount: { [k: string]: number } = {}; + const typeComboCount: { [k: string]: number } = {}; + const typeWeaknesses: { [k: string]: number } = {}; + const typeDoubleWeaknesses: { [k: string]: number } = {}; const teamDetails: RandomTeamsTypes.TeamDetails = {}; let numMaxLevelPokemon = 0; @@ -1268,7 +1267,7 @@ export class RandomGen7Teams extends RandomGen8Teams { } if (this.dex.getEffectiveness(typeName, species) > 0) { if (!typeDoubleWeaknesses[typeName]) typeDoubleWeaknesses[typeName] = 0; - if (typeDoubleWeaknesses[typeName] >= 1 * limitFactor) { + if (typeDoubleWeaknesses[typeName] >= limitFactor) { skip = true; break; } @@ -1383,7 +1382,7 @@ export class RandomGen7Teams extends RandomGen8Teams { return pokemon; } - randomFactorySets: {[format: string]: {[species: string]: BattleFactorySpecies}} = require('./factory-sets.json'); + randomFactorySets: { [format: string]: { [species: string]: BattleFactorySpecies } } = require('./factory-sets.json'); randomFactorySet( species: Species, teamData: RandomTeamsTypes.FactoryTeamDetails, tier: string @@ -1391,12 +1390,12 @@ export class RandomGen7Teams extends RandomGen8Teams { const id = toID(species.name); const setList = this.randomFactorySets[tier][id].sets; - const itemsMax: {[k: string]: number} = { + const itemsMax: { [k: string]: number } = { choicespecs: 1, choiceband: 1, choicescarf: 1, }; - const movesMax: {[k: string]: number} = { + const movesMax: { [k: string]: number } = { rapidspin: 1, batonpass: 1, stealthrock: 1, @@ -1404,12 +1403,12 @@ export class RandomGen7Teams extends RandomGen8Teams { spikes: 1, toxicspikes: 1, }; - const requiredMoves: {[k: string]: string} = { + const requiredMoves: { [k: string]: string } = { stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear', }; - const weatherAbilitiesRequire: {[k: string]: string} = { + const weatherAbilitiesRequire: { [k: string]: string } = { hydration: 'raindance', swiftswim: 'raindance', leafguard: 'sunnyday', solarpower: 'sunnyday', chlorophyll: 'sunnyday', sandforce: 'sandstorm', sandrush: 'sandstorm', sandveil: 'sandstorm', @@ -1419,7 +1418,7 @@ export class RandomGen7Teams extends RandomGen8Teams { // Build a pool of eligible sets, given the team partners // Also keep track of sets with moves the team requires - let effectivePool: {set: AnyObject, moveVariants?: number[], item?: string, ability?: string}[] = []; + let effectivePool: { set: AnyObject, moveVariants?: number[], item?: string, ability?: string }[] = []; const priorityPool = []; for (const curSet of setList) { if (this.forceMonotype && !species.types.includes(this.forceMonotype)) continue; @@ -1464,7 +1463,7 @@ export class RandomGen7Teams extends RandomGen8Teams { } if (reject) continue; - const fullSetSpec = {set: curSet, moveVariants: curSetVariants, item: curSetItem, ability: curSetAbility}; + const fullSetSpec = { set: curSet, moveVariants: curSetVariants, item: curSetItem, ability: curSetAbility }; effectivePool.push(fullSetSpec); if (hasRequiredMove) priorityPool.push(fullSetSpec); } @@ -1473,7 +1472,7 @@ export class RandomGen7Teams extends RandomGen8Teams { if (!effectivePool.length) { if (!teamData.forceResult) return null; for (const curSet of setList) { - effectivePool.push({set: curSet}); + effectivePool.push({ set: curSet }); } } @@ -1483,7 +1482,6 @@ export class RandomGen7Teams extends RandomGen8Teams { moves.push(setData.moveVariants ? moveSlot[setData.moveVariants[i]] : this.sample(moveSlot)); } - const item = setData.item || this.sampleIfArray(setData.set.item); const ability = setData.ability || this.sampleIfArray(setData.set.ability); const nature = this.sampleIfArray(setData.set.nature); @@ -1498,8 +1496,8 @@ export class RandomGen7Teams extends RandomGen8Teams { shiny: typeof setData.set.shiny === 'undefined' ? this.randomChance(1, 1024) : setData.set.shiny, level, happiness: typeof setData.set.happiness === 'undefined' ? 255 : setData.set.happiness, - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs}, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs }, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs }, nature: nature || 'Serious', moves, }; @@ -1520,7 +1518,7 @@ export class RandomGen7Teams extends RandomGen8Teams { throw new Error(`Can't generate a Monotype Battle Factory set in a battle with factory tier ${this.factoryTier}`); } - const tierValues: {[k: string]: number} = { + const tierValues: { [k: string]: number } = { Uber: 5, OU: 4, UUBL: 4, UU: 3, RUBL: 3, @@ -1537,21 +1535,21 @@ export class RandomGen7Teams extends RandomGen8Teams { const teamData: TeamData = { typeCount: {}, typeComboCount: {}, baseFormes: {}, megaCount: 0, zCount: 0, - has: {}, forceResult: forceResult, weaknesses: {}, resistances: {}, + has: {}, forceResult, weaknesses: {}, resistances: {}, }; const requiredMoveFamilies = ['hazardSet', 'hazardClear']; - const requiredMoves: {[k: string]: string} = { + const requiredMoves: { [k: string]: string } = { stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear', }; - const weatherAbilitiesSet: {[k: string]: string} = { + const weatherAbilitiesSet: { [k: string]: string } = { drizzle: 'raindance', drought: 'sunnyday', snowwarning: 'hail', sandstream: 'sandstorm', }; - const resistanceAbilities: {[k: string]: string[]} = { + const resistanceAbilities: { [k: string]: string[] } = { dryskin: ['Water'], waterabsorb: ['Water'], stormdrain: ['Water'], flashfire: ['Fire'], heatproof: ['Fire'], lightningrod: ['Electric'], motordrive: ['Electric'], voltabsorb: ['Electric'], @@ -1623,7 +1621,7 @@ export class RandomGen7Teams extends RandomGen8Teams { // Drought and Drizzle don't count towards the type combo limit typeCombo = set.ability + ''; } - if (teamData.typeComboCount[typeCombo] >= 1 * limitFactor) continue; + if (teamData.typeComboCount[typeCombo] >= limitFactor) continue; } // Okay, the set passes, add it to our team @@ -1711,7 +1709,7 @@ export class RandomGen7Teams extends RandomGen8Teams { // const flags = this.randomBSSFactorySets[tier][id].flags; const setList = this.randomBSSFactorySets[id].sets; - const movesMax: {[k: string]: number} = { + const movesMax: { [k: string]: number } = { batonpass: 1, stealthrock: 1, spikes: 1, @@ -1719,8 +1717,8 @@ export class RandomGen7Teams extends RandomGen8Teams { doubleedge: 1, trickroom: 1, }; - const requiredMoves: {[k: string]: number} = {}; - const weatherAbilitiesRequire: {[k: string]: string} = { + const requiredMoves: { [k: string]: number } = {}; + const weatherAbilitiesRequire: { [k: string]: string } = { swiftswim: 'raindance', sandrush: 'sandstorm', sandveil: 'sandstorm', }; @@ -1728,7 +1726,7 @@ export class RandomGen7Teams extends RandomGen8Teams { // Build a pool of eligible sets, given the team partners // Also keep track of sets with moves the team requires - let effectivePool: {set: AnyObject, moveVariants?: number[], itemVariants?: number, abilityVariants?: number}[] = []; + let effectivePool: { set: AnyObject, moveVariants?: number[], itemVariants?: number, abilityVariants?: number }[] = []; const priorityPool = []; for (const curSet of setList) { if (this.forceMonotype && !species.types.includes(this.forceMonotype)) continue; @@ -1760,15 +1758,15 @@ export class RandomGen7Teams extends RandomGen8Teams { curSetVariants.push(variantIndex); } if (reject) continue; - effectivePool.push({set: curSet, moveVariants: curSetVariants}); - if (hasRequiredMove) priorityPool.push({set: curSet, moveVariants: curSetVariants}); + effectivePool.push({ set: curSet, moveVariants: curSetVariants }); + if (hasRequiredMove) priorityPool.push({ set: curSet, moveVariants: curSetVariants }); } if (priorityPool.length) effectivePool = priorityPool; if (!effectivePool.length) { if (!teamData.forceResult) return null; for (const curSet of setList) { - effectivePool.push({set: curSet}); + effectivePool.push({ set: curSet }); } } @@ -1787,8 +1785,8 @@ export class RandomGen7Teams extends RandomGen8Teams { shiny: typeof setData.set.shiny === 'undefined' ? this.randomChance(1, 1024) : setData.set.shiny, level: setData.set.level || 50, happiness: typeof setData.set.happiness === 'undefined' ? 255 : setData.set.happiness, - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs}, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs }, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs }, nature: setData.set.nature || 'Serious', moves, }; @@ -1808,14 +1806,14 @@ export class RandomGen7Teams extends RandomGen8Teams { eeveeLimCount: 0, has: {}, forceResult, weaknesses: {}, resistances: {}, }; const requiredMoveFamilies: string[] = []; - const requiredMoves: {[k: string]: string} = {}; - const weatherAbilitiesSet: {[k: string]: string} = { + const requiredMoves: { [k: string]: string } = {}; + const weatherAbilitiesSet: { [k: string]: string } = { drizzle: 'raindance', drought: 'sunnyday', snowwarning: 'hail', sandstream: 'sandstorm', }; - const resistanceAbilities: {[k: string]: string[]} = { + const resistanceAbilities: { [k: string]: string[] } = { waterabsorb: ['Water'], flashfire: ['Fire'], lightningrod: ['Electric'], voltabsorb: ['Electric'], @@ -1866,7 +1864,7 @@ export class RandomGen7Teams extends RandomGen8Teams { // Drought and Drizzle don't count towards the type combo limit typeCombo = set.ability; } - if (teamData.typeComboCount[typeCombo] >= 1 * limitFactor) continue; + if (teamData.typeComboCount[typeCombo] >= limitFactor) continue; // Okay, the set passes, add it to our team pokemon.push(set); diff --git a/data/random-battles/gen7apex/teams.ts b/data/random-battles/gen7apex/teams.ts index 230e2954d0..cdfac40c97 100644 --- a/data/random-battles/gen7apex/teams.ts +++ b/data/random-battles/gen7apex/teams.ts @@ -1,4 +1,4 @@ -import {RandomGen7Teams, ZeroAttackHPIVs} from '../gen7/teams'; +import { RandomGen7Teams, ZeroAttackHPIVs } from '../gen7/teams'; const POWERFUL_ABILITIES = [ 'Adaptability', 'Aftermath', 'Analytic', 'Arena Trap', 'Beast Boost', 'Berserk', 'Comatose', 'Competitive', @@ -45,8 +45,8 @@ export class RandomGen7ApexTeams extends RandomGen7Teams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const baseAbilities = set.abilities!; diff --git a/data/random-battles/gen7letsgo/teams.ts b/data/random-battles/gen7letsgo/teams.ts index 74cca6128f..fc5dc518d7 100644 --- a/data/random-battles/gen7letsgo/teams.ts +++ b/data/random-battles/gen7letsgo/teams.ts @@ -1,8 +1,8 @@ -import type {PRNG} from '../../../sim'; -import {MoveCounter, RandomGen8Teams, OldRandomBattleSpecies} from '../gen8/teams'; +import type { PRNG } from '../../../sim'; +import { type MoveCounter, RandomGen8Teams, type OldRandomBattleSpecies } from '../gen8/teams'; export class RandomLetsGoTeams extends RandomGen8Teams { - randomData: {[species: string]: OldRandomBattleSpecies} = require('./data.json'); + randomData: { [species: string]: OldRandomBattleSpecies } = require('./data.json'); constructor(format: Format | string, prng: PRNG | PRNGSeed | null) { super(format, prng); @@ -28,7 +28,7 @@ export class RandomLetsGoTeams extends RandomGen8Teams { counter: MoveCounter, movePool: string[], teamDetails: RandomTeamsTypes.TeamDetails, - ): {cull: boolean, isSetup?: boolean} { + ): { cull: boolean, isSetup?: boolean } { switch (move.id) { // Set up once and only if we have the moves for it case 'bulkup': case 'swordsdance': @@ -65,45 +65,45 @@ export class RandomLetsGoTeams extends RandomGen8Teams { // Bad after setup case 'dragontail': - return {cull: ( + return { cull: ( !!counter.setupType || !!counter.get('speedsetup') || ['encore', 'roar', 'whirlwind'].some(m => moves.has(m)) - )}; + ) }; case 'fakeout': case 'uturn': case 'teleport': - return {cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('substitute')}; + return { cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('substitute') }; case 'haze': case 'leechseed': case 'roar': case 'whirlwind': - return {cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('dragontail')}; + return { cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('dragontail') }; case 'protect': - return {cull: !!counter.setupType || ['rest', 'lightscreen', 'reflect'].some(m => moves.has(m))}; + return { cull: !!counter.setupType || ['rest', 'lightscreen', 'reflect'].some(m => moves.has(m)) }; case 'seismictoss': - return {cull: counter.damagingMoves.size > 1 || !!counter.setupType}; + return { cull: counter.damagingMoves.size > 1 || !!counter.setupType }; case 'stealthrock': - return {cull: !!counter.setupType || !!counter.get('speedsetup') || !!teamDetails.stealthRock}; + return { cull: !!counter.setupType || !!counter.get('speedsetup') || !!teamDetails.stealthRock }; // Bit redundant to have both case 'leechlife': case 'substitute': - return {cull: moves.has('uturn')}; + return { cull: moves.has('uturn') }; case 'dragonpulse': - return {cull: moves.has('dragontail') || moves.has('outrage')}; + return { cull: moves.has('dragontail') || moves.has('outrage') }; case 'thunderbolt': - return {cull: moves.has('thunder')}; + return { cull: moves.has('thunder') }; case 'flareblitz': case 'flamethrower': - return {cull: moves.has('fireblast') || moves.has('firepunch')}; + return { cull: moves.has('fireblast') || moves.has('firepunch') }; case 'megadrain': - return {cull: moves.has('petaldance') || moves.has('powerwhip')}; + return { cull: moves.has('petaldance') || moves.has('powerwhip') }; case 'bonemerang': - return {cull: moves.has('earthquake')}; + return { cull: moves.has('earthquake') }; case 'icebeam': - return {cull: moves.has('blizzard')}; + return { cull: moves.has('blizzard') }; case 'rockslide': - return {cull: moves.has('stoneedge')}; + return { cull: moves.has('stoneedge') }; case 'hydropump': case 'willowisp': - return {cull: moves.has('scald')}; + return { cull: moves.has('scald') }; case 'surf': - return {cull: moves.has('hydropump') || moves.has('scald')}; + return { cull: moves.has('hydropump') || moves.has('scald') }; } // Increased/decreased priority moves are unneeded with moves that boost only speed - if (move.priority !== 0 && !!counter.get('speedsetup')) return {cull: true}; + if (move.priority !== 0 && !!counter.get('speedsetup')) return { cull: true }; // This move doesn't satisfy our setup requirements: if ( @@ -111,10 +111,10 @@ export class RandomLetsGoTeams extends RandomGen8Teams { (move.category === 'Special' && counter.setupType === 'Physical') ) { // Reject STABs last in case the setup type changes later on - if (!types.has(move.type) || counter.get('stab') > 1 || counter.get(move.category) < 2) return {cull: true}; + if (!types.has(move.type) || counter.get('stab') > 1 || counter.get(move.category) < 2) return { cull: true }; } - return {cull: false}; + return { cull: false }; } randomSet(species: string | Species, teamDetails: RandomTeamsTypes.TeamDetails = {}): RandomTeamsTypes.RandomSet { species = this.dex.species.get(species); @@ -146,7 +146,7 @@ export class RandomLetsGoTeams extends RandomGen8Teams { for (const moveid of moves) { const move = this.dex.moves.get(moveid); - let {cull, isSetup} = this.shouldCullMove(move, types, moves, [], counter, movePool, teamDetails); + let { cull, isSetup } = this.shouldCullMove(move, types, moves, [], counter, movePool, teamDetails); if ( !isSetup && @@ -197,7 +197,7 @@ export class RandomLetsGoTeams extends RandomGen8Teams { } } while (moves.size < this.maxMoveCount && movePool.length); - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; // Minimize confusion damage if (!counter.get('Physical') && !moves.has('transform')) ivs.atk = 0; @@ -211,7 +211,7 @@ export class RandomLetsGoTeams extends RandomGen8Teams { shiny: this.randomChance(1, 1024), item: (requiredItem || ''), ability: 'No Ability', - evs: {hp: 20, atk: 20, def: 20, spa: 20, spd: 20, spe: 20}, + evs: { hp: 20, atk: 20, def: 20, spa: 20, spd: 20, spe: 20 }, moves: Array.from(moves), ivs, }; @@ -238,9 +238,9 @@ export class RandomLetsGoTeams extends RandomGen8Teams { pokemonPool.push(id); } - const typeCount: {[k: string]: number} = {}; - const typeComboCount: {[k: string]: number} = {}; - const baseFormes: {[k: string]: number} = {}; + const typeCount: { [k: string]: number } = {}; + const typeComboCount: { [k: string]: number } = {}; + const baseFormes: { [k: string]: number } = {}; const teamDetails: RandomTeamsTypes.TeamDetails = {}; while (pokemonPool.length && pokemon.length < this.maxTeamSize) { diff --git a/data/random-battles/gen8/teams.ts b/data/random-battles/gen8/teams.ts index 0448cbbb53..13d2c13ccd 100644 --- a/data/random-battles/gen8/teams.ts +++ b/data/random-battles/gen8/teams.ts @@ -1,25 +1,25 @@ -import {Dex, toID} from '../../../sim/dex'; -import {Utils} from '../../../lib'; -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import {RuleTable} from '../../../sim/dex-formats'; -import {Tags} from './../../tags'; +import { Dex, toID } from '../../../sim/dex'; +import { Utils } from '../../../lib'; +import { PRNG, type PRNGSeed } from '../../../sim/prng'; +import { type RuleTable } from '../../../sim/dex-formats'; +import { Tags } from './../../tags'; export interface TeamData { - typeCount: {[k: string]: number}; - typeComboCount: {[k: string]: number}; - baseFormes: {[k: string]: number}; + typeCount: { [k: string]: number }; + typeComboCount: { [k: string]: number }; + baseFormes: { [k: string]: number }; megaCount?: number; zCount?: number; - has: {[k: string]: number}; + has: { [k: string]: number }; forceResult: boolean; - weaknesses: {[k: string]: number}; - resistances: {[k: string]: number}; + weaknesses: { [k: string]: number }; + resistances: { [k: string]: number }; weather?: string; eeveeLimCount?: number; gigantamax?: boolean; } export interface BattleFactorySpecies { - flags: {limEevee?: 1}; + flags: { limEevee?: 1 }; sets: BattleFactorySet[]; } export interface OldRandomBattleSpecies { @@ -107,14 +107,14 @@ export class RandomGen8Teams { readonly maxMoveCount: number; readonly forceMonotype: string | undefined; - randomData: {[species: string]: OldRandomBattleSpecies} = require('./data.json'); + randomData: { [species: string]: OldRandomBattleSpecies } = require('./data.json'); /** * Checkers for move enforcement based on a Pokémon's types or other factors * * returns true to reject one of its other moves to try to roll the forced move, false otherwise. */ - moveEnforcementCheckers: {[k: string]: MoveEnforcementChecker}; + moveEnforcementCheckers: { [k: string]: MoveEnforcementChecker }; /** Used by .getPools() */ private poolsCacheKey: [string | undefined, number | undefined, RuleTable | undefined, boolean] | undefined; @@ -169,7 +169,7 @@ export class RandomGen8Teams { !moves.has('calmmind') && ['protect', 'substitute', 'spikyshield'].some(m => movePool.includes(m)) ), - Bug: (movePool) => movePool.includes('megahorn'), + Bug: movePool => movePool.includes('megahorn'), Dark: (movePool, moves, abilities, types, counter) => { if (!counter.get('Dark')) return true; return moves.has('suckerpunch') && (movePool.includes('knockoff') || movePool.includes('wickedblow')); @@ -249,8 +249,8 @@ export class RandomGen8Teams { getTeam(options?: PlayerOptions | null): PokemonSet[] { const generatorName = ( typeof this.format.team === 'string' && this.format.team.startsWith('random') - ) ? this.format.team + 'Team' : ''; - // @ts-ignore + ) ? this.format.team + 'Team' : ''; + // @ts-expect-error property access return this[generatorName || 'randomTeam'](options); } @@ -446,7 +446,7 @@ export class RandomGen8Teams { const moves = this.multipleSamplesNoReplace(pool, this.maxMoveCount); // Random EVs - const evs: StatsTable = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + const evs: StatsTable = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; const s: StatID[] = ["hp", "atk", "def", "spa", "spd", "spe"]; let evpool = 510; do { @@ -610,7 +610,7 @@ export class RandomGen8Teams { this.cachedPool = pool.slice(); this.cachedSpeciesPool = speciesPool.slice(); } - return {pool, speciesPool}; + return { pool, speciesPool }; } randomNPokemon(n: number, requiredType?: string, minSourceGen?: number, ruleTable?: RuleTable, requireMoves = false) { @@ -621,10 +621,10 @@ export class RandomGen8Teams { throw new Error(`"${requiredType}" is not a valid type.`); } - const {pool, speciesPool} = this.getPools(requiredType, minSourceGen, ruleTable, requireMoves); + const { pool, speciesPool } = this.getPools(requiredType, minSourceGen, ruleTable, requireMoves); const isNotCustom = !ruleTable; - const hasDexNumber: {[k: string]: number} = {}; + const hasDexNumber: { [k: string]: number } = {}; for (let i = 0; i < n; i++) { const num = this.sampleNoReplace(pool); hasDexNumber[num] = i; @@ -813,7 +813,7 @@ export class RandomGen8Teams { } while (m.length < setMoveCount); // Random EVs - const evs = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + const evs = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; if (this.gen === 6) { let evpool = 510; do { @@ -912,7 +912,7 @@ export class RandomGen8Teams { if (!moves?.size) return counter; - const categories = {Physical: 0, Special: 0, Status: 0}; + const categories = { Physical: 0, Special: 0, Status: 0 }; // Iterate through all moves we've chosen so far and keep track of what they do: for (const moveid of moves) { @@ -1054,10 +1054,10 @@ export class RandomGen8Teams { isLead: boolean, isDoubles: boolean, isNoDynamax: boolean, - ): {cull: boolean, isSetup?: boolean} { + ): { cull: boolean, isSetup?: boolean } { if (isDoubles && species.baseStats.def >= 140 && movePool.includes('bodypress')) { // In Doubles, Pokémon with Defense stats >= 140 should always have body press - return {cull: true}; + return { cull: true }; } if ( (species.id === 'doublade' && movePool.includes('swordsdance')) || @@ -1067,7 +1067,7 @@ export class RandomGen8Teams { ) { // Entei should always have Extreme Speed, and Genesect-Douse should always have Techno Blast // Golisopod should always have one of its bug moves (Leech Life or First Impression) - return {cull: true}; + return { cull: true }; } const hasRestTalk = moves.has('rest') && moves.has('sleeptalk'); @@ -1076,91 +1076,91 @@ export class RandomGen8Teams { switch (move.id) { case 'acrobatics': case 'junglehealing': // Special case to prevent lead Acrobatics Rillaboom - return {cull: (species.id.startsWith('rillaboom') && isLead) || (!isDoubles && !counter.setupType)}; + return { cull: (species.id.startsWith('rillaboom') && isLead) || (!isDoubles && !counter.setupType) }; case 'dualwingbeat': case 'fly': - return {cull: !types.has(move.type) && !counter.setupType && !!counter.get('Status')}; + return { cull: !types.has(move.type) && !counter.setupType && !!counter.get('Status') }; case 'healbell': - return {cull: movePool.includes('protect') || movePool.includes('wish')}; + return { cull: movePool.includes('protect') || movePool.includes('wish') }; case 'fireblast': // Special case for Togekiss, which always wants Aura Sphere - return {cull: abilities.includes('Serene Grace') && (!moves.has('trick') || counter.get('Status') > 1)}; + return { cull: abilities.includes('Serene Grace') && (!moves.has('trick') || counter.get('Status') > 1) }; case 'firepunch': // Special case for Darmanitan-Zen-Galar, which doesn't always want Fire Punch - return {cull: movePool.includes('bellydrum') || (moves.has('earthquake') && movePool.includes('substitute'))}; + return { cull: movePool.includes('bellydrum') || (moves.has('earthquake') && movePool.includes('substitute')) }; case 'flamecharge': - return {cull: movePool.includes('swordsdance')}; + return { cull: movePool.includes('swordsdance') }; case 'hypervoice': // Special case for Heliolisk, which always wants Thunderbolt - return {cull: types.has('Electric') && movePool.includes('thunderbolt')}; + return { cull: types.has('Electric') && movePool.includes('thunderbolt') }; case 'payback': case 'psychocut': // Special case for Type: Null and Malamar, which don't want these + RestTalk - return {cull: !counter.get('Status') || hasRestTalk}; + return { cull: !counter.get('Status') || hasRestTalk }; case 'rest': const bulkySetup = !moves.has('sleeptalk') && ['bulkup', 'calmmind', 'coil', 'curse'].some(m => movePool.includes(m)); // Registeel would otherwise get Curse sets without Rest, which are very bad generally - return {cull: species.id !== 'registeel' && (movePool.includes('sleeptalk') || bulkySetup)}; + return { cull: species.id !== 'registeel' && (movePool.includes('sleeptalk') || bulkySetup) }; case 'sleeptalk': - if (!moves.has('rest')) return {cull: true}; + if (!moves.has('rest')) return { cull: true }; if (movePool.length > 1 && !abilities.includes('Contrary')) { const rest = movePool.indexOf('rest'); if (rest >= 0) this.fastPop(movePool, rest); } break; case 'storedpower': - return {cull: !counter.setupType}; + return { cull: !counter.setupType }; case 'switcheroo': case 'trick': - return {cull: counter.get('Physical') + counter.get('Special') < 3 || moves.has('rapidspin')}; + return { cull: counter.get('Physical') + counter.get('Special') < 3 || moves.has('rapidspin') }; case 'trickroom': const webs = !!teamDetails.stickyWeb; - return {cull: + return { cull: isLead || webs || !!counter.get('speedsetup') || counter.damagingMoves.size < 2 || movePool.includes('nastyplot'), }; case 'zenheadbutt': // Special case for Victini, which should prefer Bolt Strike to Zen Headbutt - return {cull: movePool.includes('boltstrike') || (species.id === 'eiscue' && moves.has('substitute'))}; + return { cull: movePool.includes('boltstrike') || (species.id === 'eiscue' && moves.has('substitute')) }; // Set up once and only if we have the moves for it case 'bellydrum': case 'bulkup': case 'coil': case 'curse': case 'dragondance': case 'honeclaws': case 'swordsdance': - if (counter.setupType !== 'Physical') return {cull: true}; // if we're not setting up physically this is pointless - if (counter.get('Physical') + counter.get('physicalpool') < 2 && !hasRestTalk) return {cull: true}; + if (counter.setupType !== 'Physical') return { cull: true }; // if we're not setting up physically this is pointless + if (counter.get('Physical') + counter.get('physicalpool') < 2 && !hasRestTalk) return { cull: true }; // First Impression + setup is undesirable in Doubles - if (isDoubles && moves.has('firstimpression')) return {cull: true}; - if (move.id === 'swordsdance' && moves.has('dragondance')) return {cull: true}; // Dragon Dance is judged as better + if (isDoubles && moves.has('firstimpression')) return { cull: true }; + if (move.id === 'swordsdance' && moves.has('dragondance')) return { cull: true }; // Dragon Dance is judged as better - return {cull: false, isSetup: true}; + return { cull: false, isSetup: true }; case 'calmmind': case 'nastyplot': - if (species.id === 'togekiss') return {cull: false}; - if (counter.setupType !== 'Special') return {cull: true}; + if (species.id === 'togekiss') return { cull: false }; + if (counter.setupType !== 'Special') return { cull: true }; if ( (counter.get('Special') + counter.get('specialpool')) < 2 && !hasRestTalk && !(moves.has('wish') && moves.has('protect')) - ) return {cull: true}; - if (moves.has('healpulse') || move.id === 'calmmind' && moves.has('trickroom')) return {cull: true}; - return {cull: false, isSetup: true}; + ) return { cull: true }; + if (moves.has('healpulse') || move.id === 'calmmind' && moves.has('trickroom')) return { cull: true }; + return { cull: false, isSetup: true }; case 'quiverdance': - return {cull: false, isSetup: true}; + return { cull: false, isSetup: true }; case 'clangoroussoul': case 'shellsmash': case 'workup': - if (counter.setupType !== 'Mixed') return {cull: true}; - if (counter.damagingMoves.size + counter.get('physicalpool') + counter.get('specialpool') < 2) return {cull: true}; - return {cull: false, isSetup: true}; + if (counter.setupType !== 'Mixed') return { cull: true }; + if (counter.damagingMoves.size + counter.get('physicalpool') + counter.get('specialpool') < 2) return { cull: true }; + return { cull: false, isSetup: true }; case 'agility': case 'autotomize': case 'rockpolish': case 'shiftgear': - if (counter.damagingMoves.size < 2 || moves.has('rest')) return {cull: true}; - if (movePool.includes('calmmind') || movePool.includes('nastyplot')) return {cull: true}; - return {cull: false, isSetup: !counter.setupType}; + if (counter.damagingMoves.size < 2 || moves.has('rest')) return { cull: true }; + if (movePool.includes('calmmind') || movePool.includes('nastyplot')) return { cull: true }; + return { cull: false, isSetup: !counter.setupType }; // Bad after setup case 'coaching': case 'counter': case 'reversal': // Counter: special case for Alakazam, which doesn't want Counter + Nasty Plot - return {cull: !!counter.setupType}; + return { cull: !!counter.setupType }; case 'bulletpunch': case 'extremespeed': case 'rockblast': - return {cull: ( + return { cull: ( !!counter.get('speedsetup') || (!isDoubles && moves.has('dragondance')) || counter.damagingMoves.size < 2 - )}; + ) }; case 'closecombat': case 'flashcannon': case 'pollenpuff': const substituteCullCondition = ( (moves.has('substitute') && !types.has('Fighting')) || @@ -1171,43 +1171,43 @@ export class RandomGen8Teams { !counter.setupType && (moves.has('highjumpkick') || movePool.includes('highjumpkick')) ); - return {cull: substituteCullCondition || preferHJKOverCCCullCondition}; + return { cull: substituteCullCondition || preferHJKOverCCCullCondition }; case 'defog': - return {cull: !!counter.setupType || moves.has('healbell') || moves.has('toxicspikes') || !!teamDetails.defog}; + return { cull: !!counter.setupType || moves.has('healbell') || moves.has('toxicspikes') || !!teamDetails.defog }; case 'fakeout': - return {cull: !!counter.setupType || ['protect', 'rapidspin', 'substitute', 'uturn'].some(m => moves.has(m))}; + return { cull: !!counter.setupType || ['protect', 'rapidspin', 'substitute', 'uturn'].some(m => moves.has(m)) }; case 'firstimpression': case 'glare': case 'icywind': case 'tailwind': case 'waterspout': - return {cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('rest')}; + return { cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('rest') }; case 'healingwish': case 'memento': - return {cull: !!counter.setupType || !!counter.get('recovery') || moves.has('substitute') || moves.has('uturn')}; + return { cull: !!counter.setupType || !!counter.get('recovery') || moves.has('substitute') || moves.has('uturn') }; case 'highjumpkick': // Special case for Hitmonlee to prevent non-Unburden Curse - return {cull: moves.has('curse')}; + return { cull: moves.has('curse') }; case 'partingshot': - return {cull: !!counter.get('speedsetup') || moves.has('bulkup') || moves.has('uturn')}; + return { cull: !!counter.get('speedsetup') || moves.has('bulkup') || moves.has('uturn') }; case 'protect': - if (!isDoubles && ((counter.setupType && !moves.has('wish')) || moves.has('rest'))) return {cull: true}; + if (!isDoubles && ((counter.setupType && !moves.has('wish')) || moves.has('rest'))) return { cull: true }; if ( !isDoubles && counter.get('Status') < 2 && ['Hunger Switch', 'Speed Boost'].every(m => !abilities.includes(m)) - ) return {cull: true}; - if (movePool.includes('leechseed') || (movePool.includes('toxic') && !moves.has('wish'))) return {cull: true}; + ) return { cull: true }; + if (movePool.includes('leechseed') || (movePool.includes('toxic') && !moves.has('wish'))) return { cull: true }; if (isDoubles && ( ['bellydrum', 'fakeout', 'shellsmash', 'spore'].some(m => movePool.includes(m)) || moves.has('tailwind') || moves.has('waterspout') || counter.get('recovery') - )) return {cull: true}; - return {cull: false}; + )) return { cull: true }; + return { cull: false }; case 'rapidspin': const setup = ['curse', 'nastyplot', 'shellsmash'].some(m => moves.has(m)); - return {cull: !!teamDetails.rapidSpin || setup || (!!counter.setupType && counter.get('Fighting') >= 2)}; + return { cull: !!teamDetails.rapidSpin || setup || (!!counter.setupType && counter.get('Fighting') >= 2) }; case 'shadowsneak': const sneakIncompatible = ['substitute', 'trickroom', 'dualwingbeat', 'toxic'].some(m => moves.has(m)); - return {cull: hasRestTalk || sneakIncompatible || counter.setupType === 'Special'}; + return { cull: hasRestTalk || sneakIncompatible || counter.setupType === 'Special' }; case 'spikes': - return {cull: !!counter.setupType || (!!teamDetails.spikes && teamDetails.spikes > 1)}; + return { cull: !!counter.setupType || (!!teamDetails.spikes && teamDetails.spikes > 1) }; case 'stealthrock': - return {cull: + return { cull: !!counter.setupType || !!counter.get('speedsetup') || !!teamDetails.stealthRock || @@ -1215,30 +1215,30 @@ export class RandomGen8Teams { (species.id === 'palossand' && movePool.includes('shoreup')), }; case 'stickyweb': - return {cull: counter.setupType === 'Special' || !!teamDetails.stickyWeb}; + return { cull: counter.setupType === 'Special' || !!teamDetails.stickyWeb }; case 'taunt': - return {cull: moves.has('encore') || moves.has('nastyplot') || moves.has('swordsdance')}; + return { cull: moves.has('encore') || moves.has('nastyplot') || moves.has('swordsdance') }; case 'thunderwave': case 'voltswitch': const cullInDoubles = isDoubles && (moves.has('electroweb') || moves.has('nuzzle')); - return {cull: ( + return { cull: ( !!counter.setupType || !!counter.get('speedsetup') || moves.has('shiftgear') || moves.has('raindance') || cullInDoubles - )}; + ) }; case 'toxic': - return {cull: !!counter.setupType || ['sludgewave', 'thunderwave', 'willowisp'].some(m => moves.has(m))}; + return { cull: !!counter.setupType || ['sludgewave', 'thunderwave', 'willowisp'].some(m => moves.has(m)) }; case 'toxicspikes': - return {cull: !!counter.setupType || !!teamDetails.toxicSpikes}; + return { cull: !!counter.setupType || !!teamDetails.toxicSpikes }; case 'uturn': const bugSwordsDanceCase = types.has('Bug') && counter.get('recovery') && moves.has('swordsdance'); - return {cull: ( + return { cull: ( !!counter.get('speedsetup') || (counter.setupType && !bugSwordsDanceCase) || (isDoubles && moves.has('leechlife')) || moves.has('shiftgear') - )}; + ) }; /** * Ineffective to have both moves together @@ -1251,55 +1251,55 @@ export class RandomGen8Teams { case 'explosion': // Rock Blast: Special case for Gigalith to prevent Stone Edge-less Choice Band sets const otherMoves = ['curse', 'stompingtantrum', 'rockblast', 'painsplit', 'wish'].some(m => moves.has(m)); - return {cull: !!counter.get('speedsetup') || !!counter.get('recovery') || otherMoves}; + return { cull: !!counter.get('speedsetup') || !!counter.get('recovery') || otherMoves }; case 'facade': // Special case for Snorlax - return {cull: movePool.includes('doubleedge')}; + return { cull: movePool.includes('doubleedge') }; case 'quickattack': // Diggersby wants U-turn on Choiced sets const diggersbyCull = counter.get('Physical') > 3 && movePool.includes('uturn'); - return {cull: !!counter.get('speedsetup') || (types.has('Rock') && !!counter.get('Status')) || diggersbyCull}; + return { cull: !!counter.get('speedsetup') || (types.has('Rock') && !!counter.get('Status')) || diggersbyCull }; case 'blazekick': - return {cull: species.id === 'genesect' && counter.get('Special') >= 1}; + return { cull: species.id === 'genesect' && counter.get('Special') >= 1 }; case 'blueflare': - return {cull: moves.has('vcreate')}; + return { cull: moves.has('vcreate') }; case 'firefang': case 'flamethrower': // Fire Fang: Special case for Garchomp, which doesn't want Fire Fang w/o Swords Dance const otherFireMoves = ['heatwave', 'overheat'].some(m => moves.has(m)); - return {cull: (moves.has('fireblast') && counter.setupType !== 'Physical') || otherFireMoves}; + return { cull: (moves.has('fireblast') && counter.setupType !== 'Physical') || otherFireMoves }; case 'flareblitz': // Special case for Solgaleo to prevent Flame Charge + Flare Blitz - return {cull: species.id === 'solgaleo' && moves.has('flamecharge')}; + return { cull: species.id === 'solgaleo' && moves.has('flamecharge') }; case 'overheat': - return {cull: moves.has('flareblitz') || (isDoubles && moves.has('calmmind'))}; + return { cull: moves.has('flareblitz') || (isDoubles && moves.has('calmmind')) }; case 'aquatail': case 'flipturn': - return {cull: moves.has('aquajet') || !!counter.get('Status')}; + return { cull: moves.has('aquajet') || !!counter.get('Status') }; case 'hydropump': - return {cull: moves.has('scald') && ( + return { cull: moves.has('scald') && ( (counter.get('Special') < 4 && !moves.has('uturn')) || (species.types.length > 1 && counter.get('stab') < 3) - )}; + ) }; case 'muddywater': - return {cull: moves.has('liquidation')}; + return { cull: moves.has('liquidation') }; case 'scald': // Special case for Clawitzer - return {cull: moves.has('waterpulse')}; + return { cull: moves.has('waterpulse') }; case 'thunderbolt': // Special case for Goodra, which only wants one move to hit Water-types - return {cull: moves.has('powerwhip')}; + return { cull: moves.has('powerwhip') }; case 'energyball': // Special case to prevent Shiinotic with four Grass moves and no Moonblast - return {cull: species.id === 'shiinotic' && !moves.has('moonblast')}; + return { cull: species.id === 'shiinotic' && !moves.has('moonblast') }; case 'gigadrain': // Celebi always wants Leaf Storm on its more pivoting-focused non-Nasty Plot sets const celebiPreferLeafStorm = species.id === 'celebi' && !counter.setupType && moves.has('uturn'); - return {cull: celebiPreferLeafStorm || (types.has('Poison') && !counter.get('Poison'))}; + return { cull: celebiPreferLeafStorm || (types.has('Poison') && !counter.get('Poison')) }; case 'leafblade': // Special case for Virizion to prevent Leaf Blade on Assault Vest sets - return {cull: (moves.has('leafstorm') || movePool.includes('leafstorm')) && counter.setupType !== 'Physical'}; + return { cull: (moves.has('leafstorm') || movePool.includes('leafstorm')) && counter.setupType !== 'Physical' }; case 'leafstorm': const leafBladePossible = movePool.includes('leafblade') || moves.has('leafblade'); - return {cull: + return { cull: // Virizion should always prefer Leaf Blade to Leaf Storm on Physical sets (counter.setupType === 'Physical' && (species.id === 'virizion' || leafBladePossible)) || (moves.has('gigadrain') && !!counter.get('Status')) || @@ -1307,38 +1307,38 @@ export class RandomGen8Teams { }; case 'powerwhip': // Special case for Centiskorch, which doesn't want Assault Vest - return {cull: moves.has('leechlife')}; + return { cull: moves.has('leechlife') }; case 'woodhammer': - return {cull: moves.has('hornleech') && counter.get('Physical') < 4}; + return { cull: moves.has('hornleech') && counter.get('Physical') < 4 }; case 'freezedry': const betterIceMove = ( (moves.has('blizzard') && !!counter.setupType) || (moves.has('icebeam') && counter.get('Special') < 4) ); const preferThunderWave = movePool.includes('thunderwave') && types.has('Electric'); - return {cull: betterIceMove || preferThunderWave || movePool.includes('bodyslam')}; + return { cull: betterIceMove || preferThunderWave || movePool.includes('bodyslam') }; case 'bodypress': // Turtonator never wants Earthquake + Body Press, and wants EQ+Smash or Press+No Smash const turtonatorPressCull = species.id === 'turtonator' && moves.has('earthquake') && movePool.includes('shellsmash'); const pressIncompatible = ['shellsmash', 'mirrorcoat', 'whirlwind'].some(m => moves.has(m)); - return {cull: turtonatorPressCull || pressIncompatible || counter.setupType === 'Special'}; + return { cull: turtonatorPressCull || pressIncompatible || counter.setupType === 'Special' }; case 'circlethrow': // Part of a special case for Throh to pick one specific Fighting move depending on its set - return {cull: moves.has('stormthrow') && !moves.has('rest')}; + return { cull: moves.has('stormthrow') && !moves.has('rest') }; case 'drainpunch': - return {cull: moves.has('closecombat') || (!types.has('Fighting') && movePool.includes('swordsdance'))}; + return { cull: moves.has('closecombat') || (!types.has('Fighting') && movePool.includes('swordsdance')) }; case 'dynamicpunch': case 'thunderouskick': // Dynamic Punch: Special case for Machamp to better split Guts and No Guard sets - return {cull: moves.has('closecombat') || moves.has('facade')}; + return { cull: moves.has('closecombat') || moves.has('facade') }; case 'focusblast': // Special cases for Blastoise and Regice; Blastoise wants Shell Smash, and Regice wants Thunderbolt - return {cull: movePool.includes('shellsmash') || hasRestTalk}; + return { cull: movePool.includes('shellsmash') || hasRestTalk }; case 'hammerarm': // Special case for Kangaskhan, which always wants Sucker Punch - return {cull: moves.has('fakeout')}; + return { cull: moves.has('fakeout') }; case 'stormthrow': // Part of a special case for Throh to pick one specific Fighting move depending on its set - return {cull: hasRestTalk}; + return { cull: hasRestTalk }; case 'superpower': return { cull: moves.has('hydropump') || @@ -1347,22 +1347,22 @@ export class RandomGen8Teams { isSetup: abilities.includes('Contrary'), }; case 'poisonjab': - return {cull: !types.has('Poison') && counter.get('Status') >= 2}; + return { cull: !types.has('Poison') && counter.get('Status') >= 2 }; case 'earthquake': const doublesCull = moves.has('earthpower') || moves.has('highhorsepower'); // Turtonator wants Body Press when it doesn't have Shell Smash const turtQuakeCull = species.id === 'turtonator' && movePool.includes('bodypress') && movePool.includes('shellsmash'); const subToxicPossible = moves.has('substitute') && movePool.includes('toxic'); - return {cull: turtQuakeCull || (isDoubles && doublesCull) || subToxicPossible || moves.has('bonemerang')}; + return { cull: turtQuakeCull || (isDoubles && doublesCull) || subToxicPossible || moves.has('bonemerang') }; case 'scorchingsands': // Special cases for Ninetales and Palossand; prevents status redundancy - return {cull: ( + return { cull: ( moves.has('willowisp') || moves.has('earthpower') || (moves.has('toxic') && movePool.includes('earthpower')) - )}; + ) }; case 'airslash': - return {cull: + return { cull: (species.id === 'naganadel' && moves.has('nastyplot')) || hasRestTalk || (abilities.includes('Simple') && !!counter.get('recovery')) || @@ -1370,28 +1370,28 @@ export class RandomGen8Teams { }; case 'bravebird': // Special case for Mew, which only wants Brave Bird with Swords Dance - return {cull: moves.has('dragondance')}; + return { cull: moves.has('dragondance') }; case 'hurricane': - return {cull: counter.setupType === 'Physical'}; + return { cull: counter.setupType === 'Physical' }; case 'futuresight': - return {cull: moves.has('psyshock') || moves.has('trick') || movePool.includes('teleport')}; + return { cull: moves.has('psyshock') || moves.has('trick') || movePool.includes('teleport') }; case 'photongeyser': // Special case for Necrozma-DM, which always wants Dragon Dance - return {cull: moves.has('morningsun')}; + return { cull: moves.has('morningsun') }; case 'psychic': const alcremieCase = species.id === 'alcremiegmax' && counter.get('Status') < 2; - return {cull: alcremieCase || (moves.has('psyshock') && (!!counter.setupType || isDoubles))}; + return { cull: alcremieCase || (moves.has('psyshock') && (!!counter.setupType || isDoubles)) }; case 'psychicfangs': // Special case for Morpeko, which doesn't want 4 attacks Leftovers - return {cull: moves.has('rapidspin')}; + return { cull: moves.has('rapidspin') }; case 'psyshock': // Special case for Sylveon which only wants Psyshock if it gets a Choice item const sylveonCase = abilities.includes('Pixilate') && counter.get('Special') < 4; - return {cull: moves.has('psychic') || (!counter.setupType && sylveonCase) || (isDoubles && moves.has('psychic'))}; + return { cull: moves.has('psychic') || (!counter.setupType && sylveonCase) || (isDoubles && moves.has('psychic')) }; case 'bugbuzz': - return {cull: moves.has('uturn') && !counter.setupType}; + return { cull: moves.has('uturn') && !counter.setupType }; case 'leechlife': - return {cull: + return { cull: (isDoubles && moves.has('lunge')) || (moves.has('uturn') && !counter.setupType) || movePool.includes('spikes'), @@ -1401,30 +1401,30 @@ export class RandomGen8Teams { const rockSlidePlusStatusPossible = counter.get('Status') && movePool.includes('rockslide'); const otherRockMove = moves.has('rockblast') || moves.has('rockslide'); const lucarioCull = species.id === 'lucario' && !!counter.setupType; - return {cull: gutsCullCondition || (!isDoubles && rockSlidePlusStatusPossible) || otherRockMove || lucarioCull}; + return { cull: gutsCullCondition || (!isDoubles && rockSlidePlusStatusPossible) || otherRockMove || lucarioCull }; case 'poltergeist': // Special case for Dhelmise in Doubles, which doesn't want both - return {cull: moves.has('knockoff')}; + return { cull: moves.has('knockoff') }; case 'shadowball': - return {cull: + return { cull: (isDoubles && moves.has('phantomforce')) || // Special case for Sylveon, which never wants Shadow Ball as its only coverage move (abilities.includes('Pixilate') && (!!counter.setupType || counter.get('Status') > 1)) || (!types.has('Ghost') && movePool.includes('focusblast')), }; case 'shadowclaw': - return {cull: types.has('Steel') && moves.has('shadowsneak') && counter.get('Physical') < 4}; + return { cull: types.has('Steel') && moves.has('shadowsneak') && counter.get('Physical') < 4 }; case 'dragonpulse': case 'spacialrend': - return {cull: moves.has('dracometeor') && counter.get('Special') < 4}; + return { cull: moves.has('dracometeor') && counter.get('Special') < 4 }; case 'darkpulse': const pulseIncompatible = ['foulplay', 'knockoff'].some(m => moves.has(m)) || ( species.id === 'shiftry' && (moves.has('defog') || moves.has('suckerpunch')) ); // Special clause to prevent bugged Shiftry sets with Sucker Punch + Nasty Plot const shiftryCase = movePool.includes('nastyplot') && !moves.has('defog'); - return {cull: pulseIncompatible && !shiftryCase && counter.setupType !== 'Special'}; + return { cull: pulseIncompatible && !shiftryCase && counter.setupType !== 'Special' }; case 'suckerpunch': - return {cull: + return { cull: // Shiftry in No Dynamax would otherwise get Choice Scarf Sucker Punch sometimes. (isNoDynamax && species.id === 'shiftry' && moves.has('defog')) || moves.has('rest') || @@ -1433,25 +1433,25 @@ export class RandomGen8Teams { (counter.get('Dark') > 1 && !types.has('Dark')), }; case 'dazzlinggleam': - return {cull: ['fleurcannon', 'moonblast', 'petaldance'].some(m => moves.has(m))}; + return { cull: ['fleurcannon', 'moonblast', 'petaldance'].some(m => moves.has(m)) }; // Status: case 'bodyslam': case 'clearsmog': const toxicCullCondition = moves.has('toxic') && !types.has('Normal'); - return {cull: moves.has('sludgebomb') || moves.has('trick') || movePool.includes('recover') || toxicCullCondition}; + return { cull: moves.has('sludgebomb') || moves.has('trick') || movePool.includes('recover') || toxicCullCondition }; case 'haze': // Special case for Corsola-Galar, which always wants Will-O-Wisp - return {cull: !teamDetails.stealthRock && (moves.has('stealthrock') || movePool.includes('stealthrock'))}; + return { cull: !teamDetails.stealthRock && (moves.has('stealthrock') || movePool.includes('stealthrock')) }; case 'hypnosis': // Special case for Xurkitree to properly split Blunder Policy and Choice item sets - return {cull: moves.has('voltswitch')}; + return { cull: moves.has('voltswitch') }; case 'willowisp': case 'yawn': // Swords Dance is a special case for Rapidash - return {cull: moves.has('thunderwave') || moves.has('toxic') || moves.has('swordsdance')}; + return { cull: moves.has('thunderwave') || moves.has('toxic') || moves.has('swordsdance') }; case 'painsplit': case 'recover': case 'synthesis': - return {cull: moves.has('rest') || moves.has('wish') || (move.id === 'synthesis' && moves.has('gigadrain'))}; + return { cull: moves.has('rest') || moves.has('wish') || (move.id === 'synthesis' && moves.has('gigadrain')) }; case 'roost': - return {cull: + return { cull: moves.has('throatchop') || // Hawlucha doesn't want Roost + 3 attacks (moves.has('stoneedge') && species.id === 'hawlucha') || @@ -1459,10 +1459,10 @@ export class RandomGen8Teams { (moves.has('dualwingbeat') && (moves.has('outrage') || species.id === 'scizor')), }; case 'reflect': case 'lightscreen': - return {cull: !!teamDetails.screens}; + return { cull: !!teamDetails.screens }; case 'slackoff': // Special case to prevent Scaldless Slowking - return {cull: species.id === 'slowking' && !moves.has('scald')}; + return { cull: species.id === 'slowking' && !moves.has('scald') }; case 'substitute': const moveBasedCull = ['bulkup', 'nastyplot', 'painsplit', 'roost', 'swordsdance'].some(m => movePool.includes(m)); // Smaller formes of Gourgeist in Doubles don't want Poltergeist as their only attack @@ -1471,24 +1471,24 @@ export class RandomGen8Teams { const calmMindCullCondition = !counter.get('recovery') && movePool.includes('calmmind') && species.id !== 'calyrex'; // Eiscue wants to always have Liquidation and Belly Drum const eiscue = species.id === 'eiscue' && moves.has('zenheadbutt'); - return {cull: moves.has('rest') || moveBasedCull || doublesGourgeist || calmMindCullCondition || eiscue}; + return { cull: moves.has('rest') || moveBasedCull || doublesGourgeist || calmMindCullCondition || eiscue }; case 'helpinghand': // Special case for Shuckle in Doubles, which doesn't want sets with no method to harm foes - return {cull: moves.has('acupressure')}; + return { cull: moves.has('acupressure') }; case 'wideguard': - return {cull: moves.has('protect')}; + return { cull: moves.has('protect') }; case 'grassknot': // Special case for Raichu and Heliolisk - return {cull: moves.has('surf')}; + return { cull: moves.has('surf') }; case 'icepunch': // Special case for Marshadow - return {cull: moves.has('rocktomb')}; + return { cull: moves.has('rocktomb') }; case 'leechseed': // Special case for Calyrex to prevent Leech Seed + Calm Mind - return {cull: !!counter.setupType}; + return { cull: !!counter.setupType }; } - return {cull: false}; + return { cull: false }; } shouldCullAbility( @@ -1687,7 +1687,6 @@ export class RandomGen8Teams { return false; } - getAbility( types: Set, moves: Set, @@ -2109,7 +2108,7 @@ export class RandomGen8Teams { PUBL: 87, PU: 88, "(PU)": 88, NFE: 88, }; - const customScale: {[k: string]: number} = { + const customScale: { [k: string]: number } = { // These Pokemon are too strong and need a lower level zaciancrowned: 65, calyrexshadow: 68, xerneas: 70, necrozmaduskmane: 72, zacian: 72, kyogre: 73, eternatus: 73, zekrom: 74, marshadow: 75, urshifurapidstrike: 79, haxorus: 80, inteleon: 80, @@ -2135,7 +2134,7 @@ export class RandomGen8Teams { PUBL: 87, PU: 88, "(PU)": 88, NFE: 88, }; - const customScale: {[k: string]: number} = { + const customScale: { [k: string]: number } = { delibird: 100, dugtrio: 76, glalie: 76, luvdisc: 100, spinda: 100, unown: 100, }; @@ -2204,8 +2203,8 @@ export class RandomGen8Teams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = new Set(species.types); const abilitiesSet = new Set(Object.values(species.abilities)); @@ -2234,14 +2233,14 @@ export class RandomGen8Teams { const runEnforcementChecker = (checkerName: string) => { if (!this.moveEnforcementCheckers[checkerName]) return false; return this.moveEnforcementCheckers[checkerName]( - movePool, moves, abilities, types, counter, species as Species, teamDetails + movePool, moves, abilities, types, counter, species, teamDetails ); }; // Iterate through the moves again, this time to cull them: for (const moveid of moves) { const move = this.dex.moves.get(moveid); - let {cull, isSetup} = this.shouldCullMove( + let { cull, isSetup } = this.shouldCullMove( move, types, moves, abilities, counter, movePool, teamDetails, species, isLead, isDoubles, isNoDynamax ); @@ -2446,9 +2445,9 @@ export class RandomGen8Teams { pokemonToExclude: RandomTeamsTypes.RandomSet[] = [], isMonotype = false, pokemonList: string[] - ): [{[k: string]: string[]}, string[]] { + ): [{ [k: string]: string[] }, string[]] { const exclude = pokemonToExclude.map(p => toID(p.species)); - const pokemonPool: {[k: string]: string[]} = {}; + const pokemonPool: { [k: string]: string[] } = {}; const baseSpeciesPool = []; for (const pokemon of pokemonList) { let species = this.dex.species.get(pokemon); @@ -2493,12 +2492,12 @@ export class RandomGen8Teams { const usePotD = global.Config && Config.potd && ruleTable.has('potd'); const potd = usePotD ? this.dex.species.get(Config.potd) : null; - const baseFormes: {[k: string]: number} = {}; + const baseFormes: { [k: string]: number } = {}; - const typeCount: {[k: string]: number} = {}; - const typeComboCount: {[k: string]: number} = {}; - const typeWeaknesses: {[k: string]: number} = {}; - const typeDoubleWeaknesses: {[k: string]: number} = {}; + const typeCount: { [k: string]: number } = {}; + const typeComboCount: { [k: string]: number } = {}; + const typeWeaknesses: { [k: string]: number } = {}; + const typeDoubleWeaknesses: { [k: string]: number } = {}; const teamDetails: RandomTeamsTypes.TeamDetails = {}; let numMaxLevelPokemon = 0; @@ -2562,7 +2561,7 @@ export class RandomGen8Teams { } if (this.dex.getEffectiveness(typeName, species) > 1) { if (!typeDoubleWeaknesses[typeName]) typeDoubleWeaknesses[typeName] = 0; - if (typeDoubleWeaknesses[typeName] >= 1 * limitFactor) { + if (typeDoubleWeaknesses[typeName] >= limitFactor) { skip = true; break; } @@ -2686,9 +2685,9 @@ export class RandomGen8Teams { ability: (this.sampleIfArray(setData.ability)), shiny: this.randomChance(1, 1024), level: this.adjustLevel || 100, - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.evs}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.evs }, nature: setData.nature, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.ivs || {}}, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.ivs || {} }, moves: setData.moves.map((move: any) => this.sampleIfArray(move)), }; if (this.adjustLevel) set.level = this.adjustLevel; @@ -2697,7 +2696,7 @@ export class RandomGen8Teams { return pokemon; } - randomFactorySets: {[format: string]: {[species: string]: BattleFactorySpecies}} = require('./factory-sets.json'); + randomFactorySets: { [format: string]: { [species: string]: BattleFactorySpecies } } = require('./factory-sets.json'); randomFactorySet( species: Species, teamData: RandomTeamsTypes.FactoryTeamDetails, tier: string @@ -2705,12 +2704,12 @@ export class RandomGen8Teams { const id = toID(species.name); const setList = this.randomFactorySets[tier][id].sets; - const itemsMax: {[k: string]: number} = { + const itemsMax: { [k: string]: number } = { choicespecs: 1, choiceband: 1, choicescarf: 1, }; - const movesMax: {[k: string]: number} = { + const movesMax: { [k: string]: number } = { rapidspin: 1, batonpass: 1, stealthrock: 1, @@ -2718,7 +2717,7 @@ export class RandomGen8Teams { spikes: 1, toxicspikes: 1, }; - const requiredMoves: {[k: string]: string} = { + const requiredMoves: { [k: string]: string } = { stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear', @@ -2727,7 +2726,7 @@ export class RandomGen8Teams { // Build a pool of eligible sets, given the team partners // Also keep track of sets with moves the team requires - let effectivePool: {set: AnyObject, moveVariants?: number[], item?: string, ability?: string}[] = []; + let effectivePool: { set: AnyObject, moveVariants?: number[], item?: string, ability?: string }[] = []; const priorityPool = []; for (const curSet of setList) { // if (this.forceMonotype && !species.types.includes(this.forceMonotype)) continue; @@ -2769,7 +2768,7 @@ export class RandomGen8Teams { } if (reject) continue; - const fullSetSpec = {set: curSet, moveVariants: curSetVariants, item: curSetItem, ability: curSetAbility}; + const fullSetSpec = { set: curSet, moveVariants: curSetVariants, item: curSetItem, ability: curSetAbility }; effectivePool.push(fullSetSpec); if (hasRequiredMove) priorityPool.push(fullSetSpec); } @@ -2778,7 +2777,7 @@ export class RandomGen8Teams { if (!effectivePool.length) { if (!teamData.forceResult) return null; for (const curSet of setList) { - effectivePool.push({set: curSet}); + effectivePool.push({ set: curSet }); } } @@ -2788,7 +2787,6 @@ export class RandomGen8Teams { moves.push(setData.moveVariants ? moveSlot[setData.moveVariants[i]] : this.sample(moveSlot)); } - const item = setData.item || this.sampleIfArray(setData.set.item); const ability = setData.ability || this.sampleIfArray(setData.set.ability); const nature = this.sampleIfArray(setData.set.nature); @@ -2803,8 +2801,8 @@ export class RandomGen8Teams { shiny: typeof setData.set.shiny === 'undefined' ? this.randomChance(1, 1024) : setData.set.shiny, level, happiness: typeof setData.set.happiness === 'undefined' ? 255 : setData.set.happiness, - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs}, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs }, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs }, nature: nature || 'Serious', moves, }; @@ -2830,7 +2828,7 @@ export class RandomGen8Teams { } */ - const tierValues: {[k: string]: number} = { + const tierValues: { [k: string]: number } = { Uber: 5, OU: 4, UUBL: 4, UU: 3, RUBL: 3, @@ -2847,21 +2845,21 @@ export class RandomGen8Teams { const teamData: TeamData = { typeCount: {}, typeComboCount: {}, baseFormes: {}, - has: {}, forceResult: forceResult, weaknesses: {}, resistances: {}, + has: {}, forceResult, weaknesses: {}, resistances: {}, }; const requiredMoveFamilies = ['hazardSet', 'hazardClear']; - const requiredMoves: {[k: string]: string} = { + const requiredMoves: { [k: string]: string } = { stealthrock: 'hazardSet', rapidspin: 'hazardClear', defog: 'hazardClear', }; - const weatherAbilitiesSet: {[k: string]: string} = { + const weatherAbilitiesSet: { [k: string]: string } = { drizzle: 'raindance', drought: 'sunnyday', snowwarning: 'hail', sandstream: 'sandstorm', }; - const resistanceAbilities: {[k: string]: string[]} = { + const resistanceAbilities: { [k: string]: string[] } = { dryskin: ['Water'], waterabsorb: ['Water'], stormdrain: ['Water'], flashfire: ['Fire'], heatproof: ['Fire'], lightningrod: ['Electric'], motordrive: ['Electric'], voltabsorb: ['Electric'], @@ -2925,7 +2923,7 @@ export class RandomGen8Teams { // Drought and Drizzle don't count towards the type combo limit typeCombo = set.ability + ''; } - if (teamData.typeComboCount[typeCombo] >= 1 * limitFactor) continue; + if (teamData.typeComboCount[typeCombo] >= limitFactor) continue; } // Okay, the set passes, add it to our team @@ -3007,7 +3005,7 @@ export class RandomGen8Teams { const id = toID(species.name); const setList = this.randomBSSFactorySets[id].sets; - const movesMax: {[k: string]: number} = { + const movesMax: { [k: string]: number } = { batonpass: 1, stealthrock: 1, toxicspikes: 1, @@ -3015,11 +3013,11 @@ export class RandomGen8Teams { auroraveil: 1, }; - const requiredMoves: {[k: string]: number} = {}; + const requiredMoves: { [k: string]: number } = {}; // Build a pool of eligible sets, given the team partners // Also keep track of sets with moves the team requires - let effectivePool: {set: AnyObject, moveVariants?: number[], itemVariants?: number, abilityVariants?: number}[] = []; + let effectivePool: { set: AnyObject, moveVariants?: number[], itemVariants?: number, abilityVariants?: number }[] = []; const priorityPool = []; for (const curSet of setList) { let reject = false; @@ -3038,7 +3036,7 @@ export class RandomGen8Teams { curSetMoveVariants.push(variantIndex); } if (reject) continue; - const set = {set: curSet, moveVariants: curSetMoveVariants}; + const set = { set: curSet, moveVariants: curSetMoveVariants }; effectivePool.push(set); if (hasRequiredMove) priorityPool.push(set); } @@ -3047,7 +3045,7 @@ export class RandomGen8Teams { if (!effectivePool.length) { if (!teamData.forceResult) return null; for (const curSet of setList) { - effectivePool.push({set: curSet}); + effectivePool.push({ set: curSet }); } } @@ -3068,8 +3066,8 @@ export class RandomGen8Teams { shiny: typeof setData.set.shiny === 'undefined' ? this.randomChance(1, 1024) : setData.set.shiny, level: setData.set.level || 50, happiness: typeof setData.set.happiness === 'undefined' ? 255 : setData.set.happiness, - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs}, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs }, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs }, nature: setData.set.nature || 'Serious', moves, }; @@ -3085,16 +3083,16 @@ export class RandomGen8Teams { const pokemonPool = Object.keys(this.randomBSSFactorySets); const teamData: TeamData = { - typeCount: {}, typeComboCount: {}, baseFormes: {}, has: {}, forceResult: forceResult, + typeCount: {}, typeComboCount: {}, baseFormes: {}, has: {}, forceResult, weaknesses: {}, resistances: {}, }; - const weatherAbilitiesSet: {[k: string]: string} = { + const weatherAbilitiesSet: { [k: string]: string } = { drizzle: 'raindance', drought: 'sunnyday', snowwarning: 'hail', sandstream: 'sandstorm', }; - const resistanceAbilities: {[k: string]: string[]} = { + const resistanceAbilities: { [k: string]: string[] } = { waterabsorb: ['Water'], flashfire: ['Fire'], lightningrod: ['Electric'], voltabsorb: ['Electric'], @@ -3111,8 +3109,8 @@ export class RandomGen8Teams { const shuffledSpecies = []; for (const speciesName of pokemonPool) { const sortObject = { - speciesName: speciesName, - score: Math.pow(this.prng.random(), 1 / this.randomBSSFactorySets[speciesName].usage), + speciesName, + score: this.prng.random() ** (1 / this.randomBSSFactorySets[speciesName].usage), }; shuffledSpecies.push(sortObject); } diff --git a/data/random-battles/gen8bdsp/teams.ts b/data/random-battles/gen8bdsp/teams.ts index c083ff6c54..bf4761d5b6 100644 --- a/data/random-battles/gen8bdsp/teams.ts +++ b/data/random-battles/gen8bdsp/teams.ts @@ -1,10 +1,10 @@ // BDSP team generation logic is currently largely shared with Swsh -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import {MoveCounter, RandomGen8Teams, OldRandomBattleSpecies} from '../gen8/teams'; +import { type PRNG, type PRNGSeed } from '../../../sim/prng'; +import { type MoveCounter, RandomGen8Teams, type OldRandomBattleSpecies } from '../gen8/teams'; export class RandomBDSPTeams extends RandomGen8Teams { - randomData: {[species: string]: OldRandomBattleSpecies} = require('./data.json'); + randomData: { [species: string]: OldRandomBattleSpecies } = require('./data.json'); constructor(format: Format | string, prng: PRNG | PRNGSeed | null) { super(format, prng); @@ -188,19 +188,19 @@ export class RandomBDSPTeams extends RandomGen8Teams { species: Species, isLead: boolean, isDoubles: boolean, - ): {cull: boolean, isSetup?: boolean} { + ): { cull: boolean, isSetup?: boolean } { if (isDoubles && species.baseStats.def >= 140 && movePool.includes('bodypress')) { // In Doubles, Pokémon with Defense stats >= 140 should always have body press - return {cull: true}; + return { cull: true }; } if (species.id === 'entei' && movePool.includes('extremespeed')) { - return {cull: true}; + return { cull: true }; } // Spore is really, really good and should be forced onto all sets. // zzzzzz // Substitute is a hardcode for Breloom. if (movePool.includes('spore') && move.id !== 'substitute') { - return {cull: true}; + return { cull: true }; } const hasRestTalk = moves.has('rest') && moves.has('sleeptalk'); @@ -208,81 +208,81 @@ export class RandomBDSPTeams extends RandomGen8Teams { // Reject moves that need support switch (move.id) { case 'fly': - return {cull: !types.has(move.type) && !counter.setupType && !!counter.get('Status')}; + return { cull: !types.has(move.type) && !counter.setupType && !!counter.get('Status') }; case 'healbell': - return {cull: movePool.includes('protect') || movePool.includes('wish')}; + return { cull: movePool.includes('protect') || movePool.includes('wish') }; case 'fireblast': // Special case for Togekiss, which always wants Aura Sphere - return {cull: abilities.includes('Serene Grace') && (!moves.has('trick') || counter.get('Status') > 1)}; + return { cull: abilities.includes('Serene Grace') && (!moves.has('trick') || counter.get('Status') > 1) }; case 'firepunch': // Special case for Darmanitan-Zen-Galar, which doesn't always want Fire Punch - return {cull: moves.has('earthquake') && movePool.includes('substitute')}; + return { cull: moves.has('earthquake') && movePool.includes('substitute') }; case 'flamecharge': - return {cull: movePool.includes('swordsdance')}; + return { cull: movePool.includes('swordsdance') }; case 'focuspunch': - return {cull: !moves.has('substitute')}; + return { cull: !moves.has('substitute') }; case 'rest': const bulkySetup = !moves.has('sleeptalk') && ['bulkup', 'calmmind', 'coil', 'curse'].some(m => movePool.includes(m)); // Registeel would otherwise get Curse sets without Rest, which are very bad generally - return {cull: species.id !== 'registeel' && (movePool.includes('sleeptalk') || bulkySetup)}; + return { cull: species.id !== 'registeel' && (movePool.includes('sleeptalk') || bulkySetup) }; case 'sleeptalk': // Milotic always wants RestTalk - if (species.id === 'milotic') return {cull: false}; - if (moves.has('stealthrock') || !moves.has('rest')) return {cull: true}; + if (species.id === 'milotic') return { cull: false }; + if (moves.has('stealthrock') || !moves.has('rest')) return { cull: true }; if (movePool.length > 1 && !abilities.includes('Contrary')) { const rest = movePool.indexOf('rest'); if (rest >= 0) this.fastPop(movePool, rest); } break; case 'storedpower': - return {cull: !counter.setupType}; + return { cull: !counter.setupType }; case 'switcheroo': case 'trick': // We cull Switcheroo + Fake Out because Switcheroo is often used with a Choice item - return {cull: counter.get('Physical') + counter.get('Special') < 3 || moves.has('rapidspin') || moves.has('fakeout')}; + return { cull: counter.get('Physical') + counter.get('Special') < 3 || moves.has('rapidspin') || moves.has('fakeout') }; case 'trickroom': const webs = !!teamDetails.stickyWeb; - return {cull: + return { cull: isLead || webs || !!counter.get('speedsetup') || counter.damagingMoves.size < 2 || movePool.includes('nastyplot'), }; // Set up once and only if we have the moves for it case 'bellydrum': case 'bulkup': case 'coil': case 'curse': case 'dragondance': case 'honeclaws': case 'swordsdance': - if (counter.setupType !== 'Physical') return {cull: true}; // if we're not setting up physically this is pointless - if (counter.get('Physical') + counter.get('physicalpool') < 2 && !hasRestTalk) return {cull: true}; - if (move.id === 'swordsdance' && moves.has('dragondance')) return {cull: true}; // Dragon Dance is judged as better + if (counter.setupType !== 'Physical') return { cull: true }; // if we're not setting up physically this is pointless + if (counter.get('Physical') + counter.get('physicalpool') < 2 && !hasRestTalk) return { cull: true }; + if (move.id === 'swordsdance' && moves.has('dragondance')) return { cull: true }; // Dragon Dance is judged as better - return {cull: false, isSetup: true}; + return { cull: false, isSetup: true }; case 'calmmind': case 'nastyplot': - if (counter.setupType !== 'Special') return {cull: true}; + if (counter.setupType !== 'Special') return { cull: true }; if ( (counter.get('Special') + counter.get('specialpool')) < 2 && !hasRestTalk && !(moves.has('wish') && moves.has('protect')) - ) return {cull: true}; - if (moves.has('healpulse') || move.id === 'calmmind' && moves.has('trickroom')) return {cull: true}; - return {cull: false, isSetup: true}; + ) return { cull: true }; + if (moves.has('healpulse') || move.id === 'calmmind' && moves.has('trickroom')) return { cull: true }; + return { cull: false, isSetup: true }; case 'quiverdance': - return {cull: false, isSetup: true}; + return { cull: false, isSetup: true }; case 'shellsmash': case 'workup': - if (counter.setupType !== 'Mixed') return {cull: true}; - if (counter.damagingMoves.size + counter.get('physicalpool') + counter.get('specialpool') < 2) return {cull: true}; - return {cull: false, isSetup: true}; + if (counter.setupType !== 'Mixed') return { cull: true }; + if (counter.damagingMoves.size + counter.get('physicalpool') + counter.get('specialpool') < 2) return { cull: true }; + return { cull: false, isSetup: true }; case 'agility': case 'autotomize': case 'rockpolish': - if (counter.damagingMoves.size < 2 || moves.has('rest')) return {cull: true}; - if (movePool.includes('calmmind') || movePool.includes('nastyplot')) return {cull: true}; - return {cull: false, isSetup: !counter.setupType}; + if (counter.damagingMoves.size < 2 || moves.has('rest')) return { cull: true }; + if (movePool.includes('calmmind') || movePool.includes('nastyplot')) return { cull: true }; + return { cull: false, isSetup: !counter.setupType }; // Bad after setup case 'counter': case 'reversal': // Counter: special case for Alakazam, which doesn't want Counter + Nasty Plot - return {cull: !!counter.setupType}; + return { cull: !!counter.setupType }; case 'bulletpunch': case 'extremespeed': case 'rockblast': - return {cull: ( + return { cull: ( !!counter.get('speedsetup') || (!isDoubles && moves.has('dragondance')) || counter.damagingMoves.size < 2 - )}; + ) }; case 'closecombat': case 'flashcannon': const substituteCullCondition = ( (moves.has('substitute') && !types.has('Fighting')) || @@ -293,77 +293,77 @@ export class RandomBDSPTeams extends RandomGen8Teams { !counter.setupType && (moves.has('highjumpkick') || movePool.includes('highjumpkick')) ); - return {cull: substituteCullCondition || preferHJKOverCCCullCondition}; + return { cull: substituteCullCondition || preferHJKOverCCCullCondition }; case 'defog': - return {cull: ( + return { cull: ( !!counter.setupType || ['healbell', 'toxicspikes', 'stealthrock', 'spikes'].some(m => moves.has(m)) || !!teamDetails.defog - )}; + ) }; case 'fakeout': - return {cull: !!counter.setupType || ['protect', 'rapidspin', 'substitute', 'uturn'].some(m => moves.has(m))}; + return { cull: !!counter.setupType || ['protect', 'rapidspin', 'substitute', 'uturn'].some(m => moves.has(m)) }; case 'glare': case 'icywind': case 'tailwind': case 'waterspout': - return {cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('rest')}; + return { cull: !!counter.setupType || !!counter.get('speedsetup') || moves.has('rest') }; case 'healingwish': case 'memento': - return {cull: !!counter.setupType || !!counter.get('recovery') || moves.has('substitute') || moves.has('uturn')}; + return { cull: !!counter.setupType || !!counter.get('recovery') || moves.has('substitute') || moves.has('uturn') }; case 'partingshot': - return {cull: !!counter.get('speedsetup') || moves.has('bulkup') || moves.has('uturn')}; + return { cull: !!counter.get('speedsetup') || moves.has('bulkup') || moves.has('uturn') }; case 'protect': - if (!isDoubles && ((counter.setupType && !moves.has('wish')) || moves.has('rest'))) return {cull: true}; + if (!isDoubles && ((counter.setupType && !moves.has('wish')) || moves.has('rest'))) return { cull: true }; if ( !isDoubles && counter.get('Status') < 2 && ['Guts', 'Quick Feet', 'Speed Boost', 'Moody'].every(m => !abilities.includes(m)) - ) return {cull: true}; - if (movePool.includes('leechseed') || (movePool.includes('toxic') && !moves.has('wish'))) return {cull: true}; + ) return { cull: true }; + if (movePool.includes('leechseed') || (movePool.includes('toxic') && !moves.has('wish'))) return { cull: true }; if (isDoubles && ( ['bellydrum', 'fakeout', 'shellsmash', 'spore'].some(m => movePool.includes(m)) || moves.has('tailwind') || moves.has('waterspout') - )) return {cull: true}; - return {cull: false}; + )) return { cull: true }; + return { cull: false }; case 'rapidspin': const setup = ['curse', 'nastyplot', 'shellsmash'].some(m => moves.has(m)); - return {cull: !!teamDetails.rapidSpin || setup || (!!counter.setupType && counter.get('Fighting') >= 2)}; + return { cull: !!teamDetails.rapidSpin || setup || (!!counter.setupType && counter.get('Fighting') >= 2) }; case 'roar': // for Blastoise - return {cull: moves.has('shellsmash')}; + return { cull: moves.has('shellsmash') }; case 'shadowsneak': const sneakIncompatible = ['substitute', 'trickroom', 'toxic'].some(m => moves.has(m)); - return {cull: hasRestTalk || sneakIncompatible || counter.setupType === 'Special'}; + return { cull: hasRestTalk || sneakIncompatible || counter.setupType === 'Special' }; case 'spikes': - return {cull: !!counter.setupType || (!!teamDetails.spikes && teamDetails.spikes > 1)}; + return { cull: !!counter.setupType || (!!teamDetails.spikes && teamDetails.spikes > 1) }; case 'stealthrock': - return {cull: + return { cull: !!counter.setupType || !!counter.get('speedsetup') || !!teamDetails.stealthRock || ['rest', 'substitute', 'trickroom', 'teleport'].some(m => moves.has(m)), }; case 'stickyweb': - return {cull: !!teamDetails.stickyWeb}; + return { cull: !!teamDetails.stickyWeb }; case 'taunt': - return {cull: moves.has('encore') || moves.has('nastyplot') || moves.has('swordsdance')}; + return { cull: moves.has('encore') || moves.has('nastyplot') || moves.has('swordsdance') }; case 'thunderwave': case 'voltswitch': const cullInDoubles = isDoubles && (moves.has('electroweb') || moves.has('nuzzle')); - return {cull: ( + return { cull: ( !!counter.setupType || !!counter.get('speedsetup') || moves.has('shiftgear') || moves.has('raindance') || cullInDoubles - )}; + ) }; case 'toxic': - return {cull: !!counter.setupType || ['sludgewave', 'thunderwave', 'willowisp'].some(m => moves.has(m))}; + return { cull: !!counter.setupType || ['sludgewave', 'thunderwave', 'willowisp'].some(m => moves.has(m)) }; case 'toxicspikes': - return {cull: !!counter.setupType || !!teamDetails.toxicSpikes}; + return { cull: !!counter.setupType || !!teamDetails.toxicSpikes }; case 'uturn': const bugSwordsDanceCase = types.has('Bug') && counter.get('recovery') && moves.has('swordsdance'); - return {cull: ( + return { cull: ( !!counter.get('speedsetup') || (counter.setupType && !bugSwordsDanceCase) || (abilities.includes('Speed Boost') && moves.has('protect')) || (isDoubles && moves.has('leechlife')) - )}; + ) }; /** * Ineffective to have both moves together @@ -375,26 +375,26 @@ export class RandomBDSPTeams extends RandomGen8Teams { */ case 'explosion': const otherMoves = ['curse', 'stompingtantrum', 'painsplit', 'wish'].some(m => moves.has(m)); - return {cull: !!counter.get('speedsetup') || !!counter.get('recovery') || otherMoves}; + return { cull: !!counter.get('speedsetup') || !!counter.get('recovery') || otherMoves }; case 'quickattack': - return {cull: !!counter.get('speedsetup') || (types.has('Rock') && !!counter.get('Status'))}; + return { cull: !!counter.get('speedsetup') || (types.has('Rock') && !!counter.get('Status')) }; case 'flamethrower': case 'lavaplume': const otherFireMoves = ['heatwave', 'overheat'].some(m => moves.has(m)); - return {cull: (moves.has('fireblast') && counter.setupType !== 'Physical') || otherFireMoves}; + return { cull: (moves.has('fireblast') && counter.setupType !== 'Physical') || otherFireMoves }; case 'overheat': - return {cull: moves.has('flareblitz') || (isDoubles && moves.has('calmmind'))}; + return { cull: moves.has('flareblitz') || (isDoubles && moves.has('calmmind')) }; case 'aquatail': - return {cull: moves.has('aquajet') || !!counter.get('Status')}; + return { cull: moves.has('aquajet') || !!counter.get('Status') }; case 'hydropump': - return {cull: moves.has('scald') && ( + return { cull: moves.has('scald') && ( (counter.get('Special') < 4 && !moves.has('uturn')) || (species.types.length > 1 && counter.get('stab') < 3) - )}; + ) }; case 'gigadrain': - return {cull: types.has('Poison') && !counter.get('Poison')}; + return { cull: types.has('Poison') && !counter.get('Poison') }; case 'leafstorm': const leafBladePossible = movePool.includes('leafblade') || moves.has('leafblade'); - return {cull: + return { cull: (counter.setupType === 'Physical' && leafBladePossible) || (moves.has('gigadrain') && !!counter.get('Status')) || (isDoubles && moves.has('energyball')), @@ -405,21 +405,21 @@ export class RandomBDSPTeams extends RandomGen8Teams { (moves.has('icebeam') && counter.get('Special') < 4) ); const preferThunderWave = movePool.includes('thunderwave') && types.has('Electric'); - return {cull: betterIceMove || preferThunderWave || movePool.includes('bodyslam')}; + return { cull: betterIceMove || preferThunderWave || movePool.includes('bodyslam') }; // Milotic always wants RestTalk case 'icebeam': - return {cull: moves.has('dragontail')}; + return { cull: moves.has('dragontail') }; case 'bodypress': const pressIncompatible = ['shellsmash', 'mirrorcoat', 'whirlwind'].some(m => moves.has(m)); - return {cull: pressIncompatible || counter.setupType === 'Special'}; + return { cull: pressIncompatible || counter.setupType === 'Special' }; case 'drainpunch': - return {cull: moves.has('closecombat') || (!types.has('Fighting') && movePool.includes('swordsdance'))}; + return { cull: moves.has('closecombat') || (!types.has('Fighting') && movePool.includes('swordsdance')) }; case 'facade': // Prefer Dynamic Punch when it can be a guaranteed-hit STAB move (mostly for Machamp) - return {cull: moves.has('dynamicpunch') && species.types.includes('Fighting') && abilities.includes('No Guard')}; + return { cull: moves.has('dynamicpunch') && species.types.includes('Fighting') && abilities.includes('No Guard') }; case 'focusblast': // Special cases for Blastoise and Regice; Blastoise wants Shell Smash, and Regice wants Thunderbolt - return {cull: movePool.includes('shellsmash') || hasRestTalk}; + return { cull: movePool.includes('shellsmash') || hasRestTalk }; case 'superpower': return { cull: moves.has('hydropump') || @@ -428,25 +428,25 @@ export class RandomBDSPTeams extends RandomGen8Teams { isSetup: abilities.includes('Contrary'), }; case 'poisonjab': - return {cull: !types.has('Poison') && counter.get('Status') >= 2}; + return { cull: !types.has('Poison') && counter.get('Status') >= 2 }; case 'earthquake': const doublesCull = moves.has('earthpower') || moves.has('highhorsepower'); const subToxicPossible = moves.has('substitute') && movePool.includes('toxic'); - return {cull: (isDoubles && doublesCull) || subToxicPossible || moves.has('bonemerang')}; + return { cull: (isDoubles && doublesCull) || subToxicPossible || moves.has('bonemerang') }; case 'airslash': - return {cull: hasRestTalk || counter.setupType === 'Physical'}; + return { cull: hasRestTalk || counter.setupType === 'Physical' }; case 'hurricane': - return {cull: counter.setupType === 'Physical'}; + return { cull: counter.setupType === 'Physical' }; case 'futuresight': - return {cull: moves.has('psyshock') || moves.has('trick') || movePool.includes('teleport')}; + return { cull: moves.has('psyshock') || moves.has('trick') || movePool.includes('teleport') }; case 'psychic': - return {cull: moves.has('psyshock') && (!!counter.setupType || isDoubles)}; + return { cull: moves.has('psyshock') && (!!counter.setupType || isDoubles) }; case 'psyshock': - return {cull: moves.has('psychic')}; + return { cull: moves.has('psychic') }; case 'bugbuzz': - return {cull: moves.has('uturn') && !counter.setupType && !abilities.includes('Tinted Lens')}; + return { cull: moves.has('uturn') && !counter.setupType && !abilities.includes('Tinted Lens') }; case 'leechlife': - return {cull: + return { cull: (isDoubles && moves.has('lunge')) || (moves.has('uturn') && !counter.setupType) || movePool.includes('spikes'), @@ -456,53 +456,53 @@ export class RandomBDSPTeams extends RandomGen8Teams { const rockSlidePlusStatusPossible = counter.get('Status') && movePool.includes('rockslide'); const otherRockMove = moves.has('rockblast') || moves.has('rockslide'); const lucarioCull = species.id === 'lucario' && !!counter.setupType; - return {cull: machampCullCondition || (!isDoubles && rockSlidePlusStatusPossible) || otherRockMove || lucarioCull}; + return { cull: machampCullCondition || (!isDoubles && rockSlidePlusStatusPossible) || otherRockMove || lucarioCull }; case 'shadowball': - return {cull: + return { cull: (isDoubles && moves.has('phantomforce')) || (!types.has('Ghost') && movePool.includes('focusblast')), }; case 'shadowclaw': - return {cull: types.has('Steel') && moves.has('shadowsneak') && counter.get('Physical') < 4}; + return { cull: types.has('Steel') && moves.has('shadowsneak') && counter.get('Physical') < 4 }; case 'dragonpulse': case 'spacialrend': - return {cull: moves.has('dracometeor') && counter.get('Special') < 4}; + return { cull: moves.has('dracometeor') && counter.get('Special') < 4 }; case 'darkpulse': const pulseIncompatible = ['foulplay', 'knockoff'].some(m => moves.has(m)) || ( species.id === 'shiftry' && (moves.has('defog') || moves.has('suckerpunch')) ); // Special clause to prevent bugged Shiftry sets with Sucker Punch + Nasty Plot const shiftryCase = movePool.includes('nastyplot') && !moves.has('defog'); - return {cull: pulseIncompatible && !shiftryCase && counter.setupType !== 'Special'}; + return { cull: pulseIncompatible && !shiftryCase && counter.setupType !== 'Special' }; case 'suckerpunch': - return {cull: + return { cull: moves.has('rest') || counter.damagingMoves.size < 2 || (counter.setupType === 'Special') || (counter.get('Dark') > 1 && !types.has('Dark')), }; case 'dazzlinggleam': - return {cull: ['moonblast', 'petaldance'].some(m => moves.has(m))}; + return { cull: ['moonblast', 'petaldance'].some(m => moves.has(m)) }; // Status: case 'bodyslam': case 'clearsmog': const toxicCullCondition = moves.has('toxic') && !types.has('Normal'); - return {cull: moves.has('sludgebomb') || moves.has('trick') || movePool.includes('recover') || toxicCullCondition}; + return { cull: moves.has('sludgebomb') || moves.has('trick') || movePool.includes('recover') || toxicCullCondition }; case 'willowisp': case 'yawn': // Swords Dance is a special case for Rapidash - return {cull: moves.has('thunderwave') || moves.has('toxic') || moves.has('swordsdance')}; + return { cull: moves.has('thunderwave') || moves.has('toxic') || moves.has('swordsdance') }; case 'painsplit': case 'recover': case 'synthesis': - return {cull: moves.has('rest') || moves.has('wish') || (move.id === 'synthesis' && moves.has('gigadrain'))}; + return { cull: moves.has('rest') || moves.has('wish') || (move.id === 'synthesis' && moves.has('gigadrain')) }; case 'roost': - return {cull: + return { cull: moves.has('throatchop') || // Special cases for Salamence, Dynaless Dragonite, and Scizor to help prevent sets with poor coverage or no setup. (moves.has('dualwingbeat') && (moves.has('outrage') || species.id === 'scizor')), }; case 'reflect': case 'lightscreen': - return {cull: !!teamDetails.screens}; + return { cull: !!teamDetails.screens }; case 'slackoff': // Special case to prevent Scaldless Slowking - return {cull: species.id === 'slowking' && !moves.has('scald')}; + return { cull: species.id === 'slowking' && !moves.has('scald') }; case 'substitute': const moveBasedCull = ( // Breloom is OK with Substitute + Swords Dance (for subpunch sets) @@ -510,18 +510,18 @@ export class RandomBDSPTeams extends RandomGen8Teams { ['bulkup', 'nastyplot', 'painsplit', 'roost', 'swordsdance'].some(m => movePool.includes(m)) ); const shayminCase = abilities.includes('Serene Grace') && movePool.includes('airslash') && !moves.has('airslash'); - return {cull: moves.has('rest') || moveBasedCull || shayminCase}; + return { cull: moves.has('rest') || moveBasedCull || shayminCase }; case 'helpinghand': // Special case for Shuckle in Doubles, which doesn't want sets with no method to harm foes - return {cull: moves.has('acupressure')}; + return { cull: moves.has('acupressure') }; case 'wideguard': - return {cull: moves.has('protect')}; + return { cull: moves.has('protect') }; case 'grassknot': // Special case for Raichu - return {cull: moves.has('surf')}; + return { cull: moves.has('surf') }; } - return {cull: false}; + return { cull: false }; } shouldCullAbility( diff --git a/data/random-battles/gen9/teams.ts b/data/random-battles/gen9/teams.ts index 0040cce305..75e15238a8 100644 --- a/data/random-battles/gen9/teams.ts +++ b/data/random-battles/gen9/teams.ts @@ -1,21 +1,21 @@ -import {Dex, toID} from '../../../sim/dex'; -import {Utils} from '../../../lib'; -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import {RuleTable} from '../../../sim/dex-formats'; -import {Tags} from './../../tags'; -import {Teams} from '../../../sim/teams'; +import { Dex, toID } from '../../../sim/dex'; +import { Utils } from '../../../lib'; +import { PRNG, type PRNGSeed } from '../../../sim/prng'; +import { type RuleTable } from '../../../sim/dex-formats'; +import { Tags } from './../../tags'; +import { Teams } from '../../../sim/teams'; export interface TeamData { - typeCount: {[k: string]: number}; - typeComboCount: {[k: string]: number}; - baseFormes: {[k: string]: number}; + typeCount: { [k: string]: number }; + typeComboCount: { [k: string]: number }; + baseFormes: { [k: string]: number }; megaCount?: number; zCount?: number; wantsTeraCount?: number; - has: {[k: string]: number}; + has: { [k: string]: number }; forceResult: boolean; - weaknesses: {[k: string]: number}; - resistances: {[k: string]: number}; + weaknesses: { [k: string]: number }; + resistances: { [k: string]: number }; weather?: string; eeveeLimCount?: number; gigantamax?: boolean; @@ -168,7 +168,7 @@ export class RandomTeams { * * returns true to try to force the move type, false otherwise. */ - moveEnforcementCheckers: {[k: string]: MoveEnforcementChecker}; + moveEnforcementCheckers: { [k: string]: MoveEnforcementChecker }; /** Used by .getPools() */ private poolsCacheKey: [string | undefined, number | undefined, RuleTable | undefined, boolean] | undefined; @@ -255,11 +255,11 @@ export class RandomTeams { this.prng = PRNG.get(prng); } - getTeam(options?: PlayerOptions | null): PokemonSet[] { + getTeam(options: PlayerOptions | null = null): PokemonSet[] { const generatorName = ( typeof this.format.team === 'string' && this.format.team.startsWith('random') - ) ? this.format.team + 'Team' : ''; - // @ts-ignore + ) ? this.format.team + 'Team' : ''; + // @ts-expect-error property access return this[generatorName || 'randomTeam'](options); } @@ -388,7 +388,7 @@ export class RandomTeams { const types = species.types; if (!moves?.size) return counter; - const categories = {Physical: 0, Special: 0, Status: 0}; + const categories = { Physical: 0, Special: 0, Status: 0 }; // Iterate through all moves we've chosen so far and keep track of what they do: for (const moveid of moves) { @@ -995,7 +995,7 @@ export class RandomTeams { if (!['AV Pivot', 'Fast Support', 'Bulky Support', 'Bulky Protect', 'Doubles Support'].includes(role)) { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -1081,7 +1081,6 @@ export class RandomTeams { return false; } - getAbility( types: string[], moves: Set, @@ -1313,7 +1312,7 @@ export class RandomTeams { } if (isLead && (species.id === 'glimmora' || (['Doubles Fast Attacker', 'Doubles Wallbreaker', 'Offensive Protect'].includes(role) && - species.baseStats.hp + species.baseStats.def + species.baseStats.spd <= 230)) + species.baseStats.hp + species.baseStats.def + species.baseStats.spd <= 230)) ) return 'Focus Sash'; if ( ['Doubles Fast Attacker', 'Doubles Wallbreaker', 'Offensive Protect'].includes(role) && @@ -1499,8 +1498,8 @@ export class RandomTeams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const abilities = set.abilities!; @@ -1564,7 +1563,7 @@ export class RandomTeams { // Physical Tera Blast if ( move.id === 'terablast' && (species.id === 'porygon2' || ['Contrary', 'Defiant'].includes(ability) || - moves.has('shiftgear') || species.baseStats.atk > species.baseStats.spa) + moves.has('shiftgear') || species.baseStats.atk > species.baseStats.spa) ) return false; return move.category !== 'Physical' || move.id === 'bodypress' || move.id === 'foulplay'; }); @@ -1605,9 +1604,9 @@ export class RandomTeams { pokemonToExclude: RandomTeamsTypes.RandomSet[] = [], isMonotype = false, pokemonList: string[] - ): [{[k: string]: string[]}, string[]] { + ): [{ [k: string]: string[] }, string[]] { const exclude = pokemonToExclude.map(p => toID(p.species)); - const pokemonPool: {[k: string]: string[]} = {}; + const pokemonPool: { [k: string]: string[] } = {}; const baseSpeciesPool = []; for (const pokemon of pokemonList) { let species = this.dex.species.get(pokemon); @@ -1635,8 +1634,8 @@ export class RandomTeams { return [pokemonPool, baseSpeciesPool]; } - randomSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); - randomDoublesSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./doubles-sets.json'); + randomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); + randomDoublesSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./doubles-sets.json'); randomTeam() { this.enforceNoDirectCustomBanlistChanges(); @@ -1655,12 +1654,12 @@ export class RandomTeams { const usePotD = global.Config && Config.potd && ruleTable.has('potd'); const potd = usePotD ? this.dex.species.get(Config.potd) : null; - const baseFormes: {[k: string]: number} = {}; + const baseFormes: { [k: string]: number } = {}; - const typeCount: {[k: string]: number} = {}; - const typeComboCount: {[k: string]: number} = {}; - const typeWeaknesses: {[k: string]: number} = {}; - const typeDoubleWeaknesses: {[k: string]: number} = {}; + const typeCount: { [k: string]: number } = {}; + const typeComboCount: { [k: string]: number } = {}; + const typeWeaknesses: { [k: string]: number } = {}; + const typeDoubleWeaknesses: { [k: string]: number } = {}; const teamDetails: RandomTeamsTypes.TeamDetails = {}; let numMaxLevelPokemon = 0; @@ -1715,7 +1714,7 @@ export class RandomTeams { } if (this.dex.getEffectiveness(typeName, species) > 1) { if (!typeDoubleWeaknesses[typeName]) typeDoubleWeaknesses[typeName] = 0; - if (typeDoubleWeaknesses[typeName] >= 1 * limitFactor) { + if (typeDoubleWeaknesses[typeName] >= limitFactor) { skip = true; break; } @@ -1912,7 +1911,7 @@ export class RandomTeams { const moves = this.multipleSamplesNoReplace(pool, this.maxMoveCount); // Random EVs - const evs: StatsTable = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + const evs: StatsTable = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; const s: StatID[] = ["hp", "atk", "def", "spa", "spd", "spe"]; let evpool = 510; do { @@ -2082,7 +2081,7 @@ export class RandomTeams { this.cachedPool = pool.slice(); this.cachedSpeciesPool = speciesPool.slice(); } - return {pool, speciesPool}; + return { pool, speciesPool }; } randomNPokemon(n: number, requiredType?: string, minSourceGen?: number, ruleTable?: RuleTable, requireMoves = false) { @@ -2093,10 +2092,10 @@ export class RandomTeams { throw new Error(`"${requiredType}" is not a valid type.`); } - const {pool, speciesPool} = this.getPools(requiredType, minSourceGen, ruleTable, requireMoves); + const { pool, speciesPool } = this.getPools(requiredType, minSourceGen, ruleTable, requireMoves); const isNotCustom = !ruleTable; - const hasDexNumber: {[k: string]: number} = {}; + const hasDexNumber: { [k: string]: number } = {}; for (let i = 0; i < n; i++) { const num = this.sampleNoReplace(pool); hasDexNumber[num] = i; @@ -2288,7 +2287,7 @@ export class RandomTeams { } while (m.length < setMoveCount); // Random EVs - const evs = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + const evs = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; if (this.gen === 6) { let evpool = 510; do { @@ -2380,7 +2379,7 @@ export class RandomTeams { return team; } - randomFactorySets: {[format: string]: {[species: string]: BattleFactorySpecies}} = require('./factory-sets.json'); + randomFactorySets: { [format: string]: { [species: string]: BattleFactorySpecies } } = require('./factory-sets.json'); randomFactorySet( species: Species, teamData: RandomTeamsTypes.FactoryTeamDetails, tier: string @@ -2389,7 +2388,7 @@ export class RandomTeams { const setList = this.randomFactorySets[tier][id].sets; const itemsLimited = ['choicespecs', 'choiceband', 'choicescarf']; - const movesLimited: {[k: string]: string} = { + const movesLimited: { [k: string]: string } = { stealthrock: 'stealthRock', stoneaxe: 'stealthRock', spikes: 'spikes', @@ -2398,7 +2397,7 @@ export class RandomTeams { rapidspin: 'hazardClear', defog: 'hazardClear', }; - const abilitiesLimited: {[k: string]: string} = { + const abilitiesLimited: { [k: string]: string } = { toxicdebris: 'toxicSpikes', }; @@ -2445,13 +2444,13 @@ export class RandomTeams { moves.push(this.sample(allowedMoves)); } if (reject) continue; - effectivePool.push({set, moves, item}); + effectivePool.push({ set, moves, item }); } if (!effectivePool.length) { if (!teamData.forceResult) return null; for (const set of setList) { - effectivePool.push({set}); + effectivePool.push({ set }); } } @@ -2488,15 +2487,14 @@ export class RandomTeams { shiny: setData.set.shiny || this.randomChance(1, 1024), level: this.adjustLevel || (tier === "LC" ? 5 : 100), happiness: 255, - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs}, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs }, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs }, nature: this.sample(setData.set.nature) || "Serious", moves, wantsTera: setData.set.wantsTera, }; } - randomFactoryTeam(side: PlayerOptions, depth = 0): RandomTeamsTypes.RandomFactorySet[] { this.enforceNoDirectCustomBanlistChanges(); @@ -2507,7 +2505,7 @@ export class RandomTeams { this.factoryTier = this.sample(['Uber', 'OU', 'UU', 'RU', 'NU', 'PU']); } - const tierValues: {[k: string]: number} = { + const tierValues: { [k: string]: number } = { Uber: 5, OU: 4, UUBL: 4, UU: 3, RUBL: 3, @@ -2525,11 +2523,11 @@ export class RandomTeams { baseFormes: {}, has: {}, wantsTeraCount: 0, - forceResult: forceResult, + forceResult, weaknesses: {}, resistances: {}, }; - const resistanceAbilities: {[k: string]: string[]} = { + const resistanceAbilities: { [k: string]: string[] } = { dryskin: ['Water'], waterabsorb: ['Water'], stormdrain: ['Water'], flashfire: ['Fire'], heatproof: ['Fire'], waterbubble: ['Fire'], wellbakedbody: ['Fire'], lightningrod: ['Electric'], motordrive: ['Electric'], voltabsorb: ['Electric'], @@ -2537,7 +2535,7 @@ export class RandomTeams { thickfat: ['Ice', 'Fire'], eartheater: ['Ground'], levitate: ['Ground'], }; - const movesLimited: {[k: string]: string} = { + const movesLimited: { [k: string]: string } = { stealthrock: 'stealthRock', stoneaxe: 'stealthRock', spikes: 'spikes', @@ -2546,7 +2544,7 @@ export class RandomTeams { rapidspin: 'hazardClear', defog: 'hazardClear', }; - const abilitiesLimited: {[k: string]: string} = { + const abilitiesLimited: { [k: string]: string } = { toxicdebris: 'toxicSpikes', }; const limitFactor = Math.ceil(this.maxTeamSize / 6); @@ -2560,7 +2558,7 @@ export class RandomTeams { for (const speciesName of pokemonPool) { const sortObject = { speciesName, - score: Math.pow(this.prng.random(), 1 / this.randomFactorySets[this.factoryTier][speciesName].weight), + score: this.prng.random() ** (1 / this.randomFactorySets[this.factoryTier][speciesName].weight), }; shuffledSpecies.push(sortObject); } @@ -2697,7 +2695,7 @@ export class RandomTeams { const id = toID(species.name); const setList = this.randomBSSFactorySets[id].sets; - const movesMax: {[k: string]: number} = { + const movesMax: { [k: string]: number } = { batonpass: 1, stealthrock: 1, toxicspikes: 1, @@ -2705,14 +2703,14 @@ export class RandomTeams { auroraveil: 1, }; const weatherAbilities = ['drizzle', 'drought', 'snowwarning', 'sandstream']; - const terrainAbilities: {[k: string]: string} = { + const terrainAbilities: { [k: string]: string } = { electricsurge: "electric", psychicsurge: "psychic", grassysurge: "grassy", seedsower: "grassy", mistysurge: "misty", }; - const terrainItemsRequire: {[k: string]: string} = { + const terrainItemsRequire: { [k: string]: string } = { electricseed: "electric", psychicseed: "psychic", grassyseed: "grassy", @@ -2763,14 +2761,14 @@ export class RandomTeams { curSetMoveVariants.push(variantIndex); } if (reject) continue; - const set = {set: curSet, moveVariants: curSetMoveVariants}; + const set = { set: curSet, moveVariants: curSetMoveVariants }; effectivePool.push(set); } if (!effectivePool.length) { if (!teamData.forceResult) return null; for (const curSet of setList) { - effectivePool.push({set: curSet}); + effectivePool.push({ set: curSet }); } } @@ -2805,15 +2803,14 @@ export class RandomTeams { shiny: this.randomChance(1, 1024), level: 50, happiness: 255, - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs}, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0, ...setData.set.evs }, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31, ...setData.set.ivs }, nature: setData.set.nature || "Serious", moves, wantsTera: setData.set.wantsTera, }; } - randomBSSFactoryTeam(side: PlayerOptions, depth = 0): RandomTeamsTypes.RandomFactorySet[] { this.enforceNoDirectCustomBanlistChanges(); @@ -2829,17 +2826,17 @@ export class RandomTeams { baseFormes: {}, has: {}, wantsTeraCount: 0, - forceResult: forceResult, + forceResult, weaknesses: {}, resistances: {}, }; - const weatherAbilitiesSet: {[k: string]: string} = { + const weatherAbilitiesSet: { [k: string]: string } = { drizzle: "raindance", drought: "sunnyday", snowwarning: "hail", sandstream: "sandstorm", }; - const resistanceAbilities: {[k: string]: string[]} = { + const resistanceAbilities: { [k: string]: string[] } = { waterabsorb: ["Water"], flashfire: ["Fire"], lightningrod: ["Electric"], @@ -2858,7 +2855,7 @@ export class RandomTeams { for (const speciesName of pokemonPool) { const sortObject = { speciesName, - score: Math.pow(this.prng.random(), 1 / this.randomBSSFactorySets[speciesName].weight), + score: this.prng.random() ** (1 / this.randomBSSFactorySets[speciesName].weight), }; shuffledSpecies.push(sortObject); } diff --git a/data/random-battles/gen9baby/teams.ts b/data/random-battles/gen9baby/teams.ts index 99ba41ae5d..5422d624d2 100644 --- a/data/random-battles/gen9baby/teams.ts +++ b/data/random-battles/gen9baby/teams.ts @@ -1,6 +1,6 @@ -import {PRNG, PRNGSeed} from "../../../sim/prng"; -import {RandomTeams, MoveCounter} from "../gen9/teams"; -import {Utils} from '../../../lib'; +import type { PRNG, PRNGSeed } from "../../../sim/prng"; +import { RandomTeams, type MoveCounter } from "../gen9/teams"; +import { Utils } from '../../../lib'; // First, some lists of moves that can be used for rules throughout set generation. Taken from regular gen9. @@ -62,7 +62,6 @@ export class RandomBabyTeams extends RandomTeams { ); } - cullMovePool( types: string[], moves: Set, @@ -145,7 +144,7 @@ export class RandomBabyTeams extends RandomTeams { // These moves are redundant with each other [ ['alluringvoice', 'dazzlinggleam', 'drainingkiss', 'moonblast'], - ['alluringvoice', 'dazzlinggleam', 'drainingkiss', 'moonblast'], + ['alluringvoice', 'dazzlinggleam', 'drainingkiss', 'moonblast'], ], [['bulletseed', 'gigadrain', 'leafstorm', 'seedbomb'], ['bulletseed', 'gigadrain', 'leafstorm', 'seedbomb']], [['hypnosis', 'thunderwave', 'toxic', 'willowisp', 'yawn'], ['hypnosis', 'thunderwave', 'toxic', 'willowisp', 'yawn']], @@ -376,7 +375,7 @@ export class RandomBabyTeams extends RandomTeams { if (!['Fast Support', 'Bulky Support'].includes(role) || species.id === 'magnemite') { if (counter.damagingMoves.size === 1) { // Find the type of the current attacking move - const currentAttackType = counter.damagingMoves.values().next().value.type; + const currentAttackType = counter.damagingMoves.values().next().value!.type; // Choose an attacking move that is of different type to the current single attack const coverageMoves = []; for (const moveid of movePool) { @@ -570,8 +569,8 @@ export class RandomBabyTeams extends RandomTeams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const abilities = set.abilities!; @@ -593,7 +592,6 @@ export class RandomBabyTeams extends RandomTeams { // Get level const level = this.getLevel(species); - // Prepare optimal HP for Belly Drum and Life Orb let hp = Math.floor(Math.floor(2 * species.baseStats.hp + ivs.hp + Math.floor(evs.hp / 4) + 100) * level / 100 + 10); let targetHP = hp; @@ -664,7 +662,7 @@ export class RandomBabyTeams extends RandomTeams { }; } - randomSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); randomBabyTeam() { this.enforceNoDirectCustomBanlistChanges(); @@ -731,7 +729,7 @@ export class RandomBabyTeams extends RandomTeams { } } if (this.dex.getEffectiveness(typeName, species) > 1) { - if (typeDoubleWeaknesses.get(typeName) >= 1 * limitFactor) { + if (typeDoubleWeaknesses.get(typeName) >= limitFactor) { skip = true; break; } @@ -758,7 +756,6 @@ export class RandomBabyTeams extends RandomTeams { const set: RandomTeamsTypes.RandomSet = this.randomSet(species, teamDetails, false, false); pokemon.push(set); - // Don't bother tracking details for the last Pokemon if (pokemon.length === this.maxTeamSize) break; diff --git a/data/random-battles/gen9cap/teams.ts b/data/random-battles/gen9cap/teams.ts index 762aa582f8..30ea735f76 100644 --- a/data/random-battles/gen9cap/teams.ts +++ b/data/random-battles/gen9cap/teams.ts @@ -1,4 +1,4 @@ -import {RandomTeams, MoveCounter} from "../gen9/teams"; +import { RandomTeams, type MoveCounter } from "../gen9/teams"; /** Pokemon who should never be in the lead slot */ const NO_LEAD_POKEMON = [ @@ -85,8 +85,8 @@ export class RandomCAPTeams extends RandomTeams { let ability = ''; let item = undefined; - const evs = {hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85}; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const evs = { hp: 85, atk: 85, def: 85, spa: 85, spd: 85, spe: 85 }; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const types = species.types; const abilities = set.abilities!; @@ -180,7 +180,7 @@ export class RandomCAPTeams extends RandomTeams { }; } - randomCAPSets: {[species: string]: RandomTeamsTypes.RandomSpeciesData} = require('./sets.json'); + randomCAPSets: { [species: string]: RandomTeamsTypes.RandomSpeciesData } = require('./sets.json'); randomTeam() { this.enforceNoDirectCustomBanlistChanges(); @@ -195,12 +195,12 @@ export class RandomCAPTeams extends RandomTeams { const typePool = this.dex.types.names().filter(name => name !== "Stellar"); const type = this.forceMonotype || this.sample(typePool); - const baseFormes: {[k: string]: number} = {}; + const baseFormes: { [k: string]: number } = {}; - const typeCount: {[k: string]: number} = {}; - const typeComboCount: {[k: string]: number} = {}; - const typeWeaknesses: {[k: string]: number} = {}; - const typeDoubleWeaknesses: {[k: string]: number} = {}; + const typeCount: { [k: string]: number } = {}; + const typeComboCount: { [k: string]: number } = {}; + const typeWeaknesses: { [k: string]: number } = {}; + const typeDoubleWeaknesses: { [k: string]: number } = {}; const teamDetails: RandomTeamsTypes.TeamDetails = {}; let numMaxLevelPokemon = 0; @@ -265,7 +265,7 @@ export class RandomCAPTeams extends RandomTeams { } if (this.dex.getEffectiveness(typeName, species) > 1) { if (!typeDoubleWeaknesses[typeName]) typeDoubleWeaknesses[typeName] = 0; - if (typeDoubleWeaknesses[typeName] >= 1 * limitFactor) { + if (typeDoubleWeaknesses[typeName] >= limitFactor) { skip = true; break; } diff --git a/data/rulesets.ts b/data/rulesets.ts index 05beeb45b4..0f6c54dfe5 100644 --- a/data/rulesets.ts +++ b/data/rulesets.ts @@ -1,6 +1,6 @@ // Note: These are the rules that formats use -import type {Learnset} from "../sim/dex-species"; +import type { Learnset } from "../sim/dex-species"; // The list of formats is stored in config/formats.js export const Rulesets: import('../sim/dex-formats').FormatDataTable = { @@ -109,7 +109,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { if (this.ruleTable.has(`+move:${move.id}`)) continue; const problem = `${set.name}'s move ${move.name} does not exist in the National Dex.`; if (this.ruleTable.has('omunobtainablemoves')) { - const {outOfBattleSpecies} = this.getValidationSpecies(set); + const { outOfBattleSpecies } = this.getValidationSpecies(set); if (!this.omCheckCanLearn(move, outOfBattleSpecies, this.allSources(outOfBattleSpecies), set, problem)) continue; } return [problem]; @@ -239,7 +239,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { // repealing this will not actually let you USE multiple moves, because of a cart bug: // https://twitter.com/DaWoblefet/status/1396217830006132737 if (set.moves) { - const hasMove: {[k: string]: true} = {}; + const hasMove: { [k: string]: true } = {}; for (const moveId of set.moves) { const move = this.dex.moves.get(moveId); const moveid = move.id; @@ -479,7 +479,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { name: 'PotD', desc: "Forces the Pokemon of the Day onto every random team.", onBegin() { - if (global.Config && global.Config.potd) { + if (global.Config?.potd) { this.add('rule', "Pokemon of the Day: " + this.dex.species.get(Config.potd).name); } }, @@ -859,7 +859,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { onValidateTeam(team) { if (this.format.id === 'gen8multibility') return; const abilityTable = new this.dex.Multiset(); - const base: {[k: string]: string} = { + const base: { [k: string]: string } = { airlock: 'cloudnine', armortail: 'queenlymajesty', battlearmor: 'shellarmor', @@ -1064,7 +1064,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { for (const moveId of set.moves) { const move = this.dex.moves.get(moveId); - if (move.id === 'flamecharge' || (move.boosts && move.boosts.spe && move.boosts.spe > 0)) { + if (move.id === 'flamecharge' || (move.boosts?.spe && move.boosts.spe > 0)) { speedBoosted = true; } const nonSpeedBoostedMoves = [ @@ -1073,7 +1073,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { ]; if (nonSpeedBoostedMoves.includes(move.id) || move.boosts && ((move.boosts.atk && move.boosts.atk > 0) || (move.boosts.def && move.boosts.def > 0) || - (move.boosts.spa && move.boosts.spa > 0) || (move.boosts.spd && move.boosts.spd > 0))) { + (move.boosts.spa && move.boosts.spa > 0) || (move.boosts.spd && move.boosts.spd > 0))) { nonSpeedBoosted = true; } if (item.zMove && move.type === item.zMoveType && move.zMove?.boost) { @@ -1082,8 +1082,8 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { if (!speedBoosted) speedBoosted = move.name; } if ( - ((boosts.atk && boosts.atk > 0) || (boosts.def && boosts.def > 0) || - (boosts.spa && boosts.spa > 0) || (boosts.spd && boosts.spd > 0)) + (boosts.atk && boosts.atk > 0) || (boosts.def && boosts.def > 0) || + (boosts.spa && boosts.spa > 0) || (boosts.spd && boosts.spd > 0) ) { if (!nonSpeedBoosted || move.name === speedBoosted) nonSpeedBoosted = move.name; } @@ -1312,13 +1312,13 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { this.add('rule', 'Sleep Clause Mod: Limit one foe put to sleep'); }, onSetStatus(status, target, source) { - if (source && source.isAlly(target)) { + if (source?.isAlly(target)) { return; } if (status.id === 'slp') { for (const pokemon of target.side.pokemon) { if (pokemon.hp && pokemon.status === 'slp') { - if (!pokemon.statusState.source || !pokemon.statusState.source.isAlly(pokemon)) { + if (!pokemon.statusState.source?.isAlly(pokemon)) { this.add('-message', 'Sleep Clause Mod activated.'); this.hint("Sleep Clause Mod prevents players from putting more than one of their opponent's Pokémon to sleep at a time"); return false; @@ -1336,7 +1336,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { this.add('rule', 'Stadium Sleep Clause: Limit one foe put to sleep'); }, onSetStatus(status, target, source) { - if (source && source.isAlly(target)) { + if (source?.isAlly(target)) { return; } if (status.id === 'slp') { @@ -1384,7 +1384,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { this.add('rule', 'Freeze Clause Mod: Limit one foe frozen'); }, onSetStatus(status, target, source) { - if (source && source.isAlly(target)) { + if (source?.isAlly(target)) { return; } if (status.id === 'frz') { @@ -1427,7 +1427,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { } for (const set of team) { if (this.gen === 9 && set.teraType && - !typeTable.includes(set.teraType) && this.ruleTable.has(`enforcesameteratype`)) { + !typeTable.includes(set.teraType) && this.ruleTable.has(`enforcesameteratype`)) { return [`${set.species}'s Tera Type must match the team's type.`]; } } @@ -1673,7 +1673,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { if (!target) return; // Chat command if (effect && ['imposter', 'transform'].includes(effect.id)) return; const types = [...new Set(target.baseMoveSlots.slice(0, 2).map(move => this.dex.moves.get(move.id).type))]; - return {...species, types: types}; + return { ...species, types }; }, onSwitchIn(pokemon) { this.add('-start', pokemon, 'typechange', (pokemon.illusion || pokemon).getTypes(true).join('/'), '[silent]'); @@ -1917,7 +1917,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { ); const species = this.dex.species.get(set.species); - for (const {learnset} of this.dex.species.getFullLearnset(species.id)) { + for (const { learnset } of this.dex.species.getFullLearnset(species.id)) { for (const moveid in moveSources) { moveSources[moveid].push(...(learnset[moveid] || [])); } @@ -2163,7 +2163,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { const typesSet = new Set(species.types); const bonusType = this.dex.types.get(target.teraType); if (bonusType.exists) typesSet.add(bonusType.name); - return {...species, types: [...typesSet]}; + return { ...species, types: [...typesSet] }; }, onSwitchIn(pokemon) { this.add('-start', pokemon, 'typechange', (pokemon.illusion || pokemon).getTypes(true).join('/'), '[silent]'); @@ -2193,7 +2193,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { }, onModifySpecies(species, target, source, effect) { if (!species.baseStats) return; - const boosts: {[tier: string]: number} = { + const boosts: { [tier: string]: number } = { uu: 15, rubl: 15, ru: 20, @@ -2357,9 +2357,9 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { } else { if (!m.secondaries) m.secondaries = []; if (item.fling.status) { - m.secondaries.push({status: item.fling.status}); + m.secondaries.push({ status: item.fling.status }); } else if (item.fling.volatileStatus) { - m.secondaries.push({volatileStatus: item.fling.volatileStatus}); + m.secondaries.push({ volatileStatus: item.fling.volatileStatus }); } } source.addVolatile('fling'); @@ -2432,7 +2432,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { if (!subtarget.side.addSlotCondition(subtarget, 'futuremove')) return false; Object.assign(subtarget.side.slotConditions[subtarget.position]['futuremove'], { move: 'doomdesire', - source: source, + source, moveData: { id: 'doomdesire', name: "Doom Desire", @@ -2440,7 +2440,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { basePower: 140, category: "Physical", priority: 0, - flags: {futuremove: 1}, + flags: { futuremove: 1 }, effectType: 'Move', type: 'Steel', }, @@ -2456,7 +2456,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { Object.assign(subtarget.side.slotConditions[subtarget.position]['futuremove'], { duration: 3, move: 'futuresight', - source: source, + source, moveData: { id: 'futuresight', name: "Future Sight", @@ -2464,7 +2464,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { basePower: 120, category: "Physical", priority: 0, - flags: {futuremove: 1}, + flags: { futuremove: 1 }, ignoreImmunity: false, effectType: 'Move', type: 'Psychic', @@ -2626,8 +2626,8 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = { } const problemPokemon = this.dex.species.all().filter(s => ( (s.name === 'Xerneas' || s.battleOnly || s.forme === 'Eternamax') && - !(s.isMega || s.isPrimal || ['Greninja-Ash', 'Necrozma-Ultra'].includes(s.name)) && - !(this.ruleTable.has(`+pokemon:${s.id}`) || this.ruleTable.has(`+basepokemon:${this.toID(s.baseSpecies)}`)) + !(s.isMega || s.isPrimal || ['Greninja-Ash', 'Necrozma-Ultra'].includes(s.name)) && + !(this.ruleTable.has(`+pokemon:${s.id}`) || this.ruleTable.has(`+basepokemon:${this.toID(s.baseSpecies)}`)) )); if (problemPokemon.includes(species)) { if (species.requiredItem && this.toID(set.item) !== this.toID(species.requiredItem)) { diff --git a/data/tags.ts b/data/tags.ts index 0913068277..33db539338 100644 --- a/data/tags.ts +++ b/data/tags.ts @@ -9,7 +9,7 @@ interface TagData { genericNumCol?: (thing: Species | Move | Item | Ability) => number; } -export const Tags: {[id: IDEntry]: TagData} = { +export const Tags: { [id: IDEntry]: TagData } = { // Categories // ---------- physical: { diff --git a/data/text/abilities.ts b/data/text/abilities.ts index 5fe012d7dd..409f880769 100644 --- a/data/text/abilities.ts +++ b/data/text/abilities.ts @@ -1,4 +1,4 @@ -export const AbilitiesText: {[id: IDEntry]: AbilityText} = { +export const AbilitiesText: { [id: IDEntry]: AbilityText } = { noability: { name: "No Ability", shortDesc: "Does nothing.", diff --git a/data/text/default.ts b/data/text/default.ts index 2da4a12295..4523fd085f 100644 --- a/data/text/default.ts +++ b/data/text/default.ts @@ -1,4 +1,4 @@ -export const DefaultText: {[id: IDEntry]: DefaultText} = { +export const DefaultText: { [id: IDEntry]: DefaultText } = { default: { startBattle: "Battle started between [TRAINER] and [TRAINER]!", winBattle: "**[TRAINER]** won the battle!", diff --git a/data/text/items.ts b/data/text/items.ts index c4e11f8b73..ad5cd5c191 100644 --- a/data/text/items.ts +++ b/data/text/items.ts @@ -1,4 +1,4 @@ -export const ItemsText: {[id: IDEntry]: ItemText} = { +export const ItemsText: { [id: IDEntry]: ItemText } = { abilityshield: { name: "Ability Shield", shortDesc: "Holder's Ability cannot be changed, suppressed, or ignored by any effect.", diff --git a/data/text/moves.ts b/data/text/moves.ts index 647ff137a5..5b125f8df7 100644 --- a/data/text/moves.ts +++ b/data/text/moves.ts @@ -1,4 +1,4 @@ -export const MovesText: {[id: IDEntry]: MoveText} = { +export const MovesText: { [id: IDEntry]: MoveText } = { "10000000voltthunderbolt": { name: "10,000,000 Volt Thunderbolt", desc: "Has a very high chance for a critical hit.", diff --git a/data/text/pokedex.ts b/data/text/pokedex.ts index 7c45512234..e7f92bab70 100644 --- a/data/text/pokedex.ts +++ b/data/text/pokedex.ts @@ -1,4 +1,4 @@ -export const PokedexText: {[id: IDEntry]: PokedexText} = { +export const PokedexText: { [id: IDEntry]: PokedexText } = { bulbasaur: { name: "Bulbasaur", }, diff --git a/data/typechart.ts b/data/typechart.ts index fa38334709..52f6482605 100644 --- a/data/typechart.ts +++ b/data/typechart.ts @@ -21,8 +21,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {atk: 30, def: 30, spd: 30}, - HPdvs: {atk: 13, def: 13}, + HPivs: { atk: 30, def: 30, spd: 30 }, + HPdvs: { atk: 13, def: 13 }, }, dark: { damageTaken: { @@ -71,8 +71,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 2, }, - HPivs: {atk: 30}, - HPdvs: {def: 14}, + HPivs: { atk: 30 }, + HPdvs: { def: 14 }, }, electric: { damageTaken: { @@ -97,8 +97,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {spa: 30}, - HPdvs: {atk: 14}, + HPivs: { spa: 30 }, + HPdvs: { atk: 14 }, }, fairy: { damageTaken: { @@ -145,8 +145,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {def: 30, spa: 30, spd: 30, spe: 30}, - HPdvs: {atk: 12, def: 12}, + HPivs: { def: 30, spa: 30, spd: 30, spe: 30 }, + HPdvs: { atk: 12, def: 12 }, }, fire: { damageTaken: { @@ -171,8 +171,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 1, }, - HPivs: {atk: 30, spa: 30, spe: 30}, - HPdvs: {atk: 14, def: 12}, + HPivs: { atk: 30, spa: 30, spe: 30 }, + HPdvs: { atk: 14, def: 12 }, }, flying: { damageTaken: { @@ -196,8 +196,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {hp: 30, atk: 30, def: 30, spa: 30, spd: 30}, - HPdvs: {atk: 12, def: 13}, + HPivs: { hp: 30, atk: 30, def: 30, spa: 30, spd: 30 }, + HPdvs: { atk: 12, def: 13 }, }, ghost: { damageTaken: { @@ -222,8 +222,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {def: 30, spd: 30}, - HPdvs: {atk: 13, def: 14}, + HPivs: { def: 30, spd: 30 }, + HPdvs: { atk: 13, def: 14 }, }, grass: { damageTaken: { @@ -248,8 +248,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 2, }, - HPivs: {atk: 30, spa: 30}, - HPdvs: {atk: 14, def: 14}, + HPivs: { atk: 30, spa: 30 }, + HPdvs: { atk: 14, def: 14 }, }, ground: { damageTaken: { @@ -274,8 +274,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 1, }, - HPivs: {spa: 30, spd: 30}, - HPdvs: {atk: 12}, + HPivs: { spa: 30, spd: 30 }, + HPdvs: { atk: 12 }, }, ice: { damageTaken: { @@ -301,8 +301,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {atk: 30, def: 30}, - HPdvs: {def: 13}, + HPivs: { atk: 30, def: 30 }, + HPdvs: { def: 13 }, }, normal: { damageTaken: { @@ -351,8 +351,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {def: 30, spa: 30, spd: 30}, - HPdvs: {atk: 12, def: 14}, + HPivs: { def: 30, spa: 30, spd: 30 }, + HPdvs: { atk: 12, def: 14 }, }, psychic: { damageTaken: { @@ -376,8 +376,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {atk: 30, spe: 30}, - HPdvs: {def: 12}, + HPivs: { atk: 30, spe: 30 }, + HPdvs: { def: 12 }, }, rock: { damageTaken: { @@ -402,8 +402,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 1, }, - HPivs: {def: 30, spd: 30, spe: 30}, - HPdvs: {atk: 13, def: 12}, + HPivs: { def: 30, spd: 30, spe: 30 }, + HPdvs: { atk: 13, def: 12 }, }, steel: { damageTaken: { @@ -430,8 +430,8 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 0, }, - HPivs: {spd: 30}, - HPdvs: {atk: 13}, + HPivs: { spd: 30 }, + HPdvs: { atk: 13 }, }, stellar: { damageTaken: { @@ -478,7 +478,7 @@ export const TypeChart: import('../sim/dex-data').TypeDataTable = { Stellar: 0, Water: 2, }, - HPivs: {atk: 30, def: 30, spa: 30}, - HPdvs: {atk: 14, def: 13}, + HPivs: { atk: 30, def: 30, spa: 30 }, + HPdvs: { atk: 14, def: 13 }, }, }; diff --git a/eslint-ps-standard.mjs b/eslint-ps-standard.mjs new file mode 100644 index 0000000000..81f2493959 --- /dev/null +++ b/eslint-ps-standard.mjs @@ -0,0 +1,435 @@ +/** + * Pokemon Showdown standard style + * + * This is Showdown's shared ESLint configuration. Each project overrides + * at least a little of it here and there, but these are the rules we use + * unless there's a good reason otherwise. + */ +// @ts-check + +import eslint from '@eslint/js'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; +import stylistic from '@stylistic/eslint-plugin'; + +/** @typedef {import('typescript-eslint').Config} ConfigFile */ +/** @typedef {Awaited[number]} Config */ +/** @typedef {NonNullable} Rules */ + +export { eslint, globals, tseslint, stylistic }; + +/** @type {Config} */ +export const plugin = { + plugins: { + '@stylistic': stylistic, + '@typescript-eslint': tseslint.plugin, + }, +}; + +/** @type {typeof tseslint.config} */ +export const configure = (...args) => [ + plugin, + ...tseslint.config(...args), +]; + +/** @type {NonNullable} */ +export const defaultRules = { + ...stylistic.configs.customize({ + braceStyle: '1tbs', + indent: 'tab', + semi: true, + jsx: true, + // ... + }).rules, + + // TODO rules to revisit + // ===================== + + // nice to have but we mostly know && || precedence so not urgent to fix + "@stylistic/no-mixed-operators": "off", + + // test only (should never be committed, but useful when testing) + // ============================================================== + // do we want unused args/destructures to start with _? unsure + "no-unused-vars": ["warn", { + args: "all", + argsIgnorePattern: ".", + caughtErrors: "all", + destructuredArrayIgnorePattern: ".", + ignoreRestSiblings: true, + }], + // "no-unused-vars": ["warn", { + // args: "all", + // argsIgnorePattern: "^_", + // caughtErrors: "all", + // destructuredArrayIgnorePattern: "^_", + // ignoreRestSiblings: true + // }], + "@stylistic/max-len": ["warn", { + "code": 120, "tabWidth": 0, + // DO NOT EDIT DIRECTLY: see bottom of file for source + "ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const |readonly )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:Utils\\.html|(?:this\\.)?(?:room\\.)?tr|\\$\\()?['\"`/]", + }], + "prefer-const": ["warn", { "destructuring": "all" }], + + // PS code (code specific to PS) + // ============================= + "@stylistic/new-parens": "off", // used for the `new class {...}` pattern + "no-prototype-builtins": "off", + + // defaults too strict + // =================== + "no-empty": ["error", { "allowEmptyCatch": true }], + "no-case-declarations": "off", + + // probably bugs + // ============= + "array-callback-return": "error", + "no-constructor-return": "error", + "no-dupe-class-members": "error", + "no-extend-native": "error", + "no-extra-bind": "warn", + "no-extra-label": "warn", + "no-eval": "error", + "no-implied-eval": "error", + "no-inner-declarations": ["error", "functions"], + "no-iterator": "error", + "no-fallthrough": ["error", { allowEmptyCase: true, reportUnusedFallthroughComment: true }], + "no-promise-executor-return": ["error", { allowVoid: true }], + "no-return-assign": "error", + "no-self-compare": "error", + "no-sequences": "error", + "no-shadow": "error", + "no-template-curly-in-string": "error", + "no-throw-literal": "warn", + "no-unmodified-loop-condition": "error", + // best way to read first key of object + // "no-unreachable-loop": "error", + // ternary is used to convert callbacks to Promises + // tagged templates are used for the SQL library + "no-unused-expressions": ["error", { allowTernary: true, allowTaggedTemplates: true, enforceForJSX: true }], + "no-useless-call": "error", + // "no-useless-assignment": "error", + "require-atomic-updates": "error", + + // syntax style (local syntactical, usually autofixable formatting decisions) + // =========================================================================== + "@stylistic/member-delimiter-style": ["error", { + multiline: { delimiter: "comma", requireLast: true }, + singleline: { delimiter: "comma", requireLast: false }, + overrides: { interface: { + multiline: { delimiter: "semi", requireLast: true }, + singleline: { delimiter: "semi", requireLast: false }, + } }, + }], + "default-case-last": "error", + "eqeqeq": ["error", "always", { null: "ignore" }], + "no-array-constructor": "error", + "no-duplicate-imports": "error", + "no-implicit-coercion": ["error", { allow: ["!!", "+"] }], + "no-multi-str": "error", + "no-object-constructor": "error", + "no-proto": "error", + "no-unneeded-ternary": "error", + "no-useless-computed-key": "error", + "no-useless-constructor": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-var": "error", + "object-shorthand": ["error", "always"], + "operator-assignment": ["error", "always"], + "prefer-arrow-callback": "error", + "prefer-exponentiation-operator": "error", + "prefer-numeric-literals": "error", + "prefer-object-has-own": "error", + "prefer-object-spread": "error", + "prefer-promise-reject-errors": "error", + "prefer-regex-literals": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "radix": ["error", "as-needed"], + + // syntax style, overriding base + // ============================= + "@stylistic/quotes": "off", + "@stylistic/quote-props": "off", + "@stylistic/function-call-spacing": "error", + "@stylistic/arrow-parens": ["error", "as-needed"], + "@stylistic/comma-dangle": ["error", { + "arrays": "always-multiline", + "objects": "always-multiline", + "imports": "always-multiline", + "exports": "always-multiline", + "functions": "never", + "importAttributes": "always-multiline", + "dynamicImports": "always-multiline", + "enums": "always-multiline", + "generics": "always-multiline", + "tuples": "always-multiline", + }], + "@stylistic/jsx-wrap-multilines": "off", + "@stylistic/jsx-closing-bracket-location": ["error", "line-aligned"], + // "@stylistic/jsx-closing-tag-location": ["error", "line-aligned"], + "@stylistic/jsx-closing-tag-location": "off", + "@stylistic/jsx-one-expression-per-line": "off", + "@stylistic/jsx-max-props-per-line": "off", + "@stylistic/jsx-function-call-newline": "off", + "no-restricted-syntax": ["error", + { selector: "CallExpression[callee.name='Symbol']", message: "Annoying to serialize, just use a string" }, + ], + + // whitespace + // ========== + "@stylistic/block-spacing": "error", + "@stylistic/operator-linebreak": ["error", "after"], + "@stylistic/max-statements-per-line": ["error", { max: 3, ignoredNodes: ['BreakStatement'] }], + "@stylistic/lines-between-class-members": "off", + "@stylistic/multiline-ternary": "off", + "@stylistic/object-curly-spacing": ["error", "always"], + "@stylistic/indent": ["error", "tab", { "flatTernaryExpressions": true }], +}; + +/** @type {NonNullable} */ +export const defaultRulesTS = { + ...defaultRules, + + // TODO: revisit + // we should do this someday but it'd have to be a gradual manual process + // "@typescript-eslint/explicit-module-boundary-types": "off", + // like above but slightly harder, so do that one first + // "@typescript-eslint/explicit-function-return-type": "off", + // probably we should settle on a standard someday + // "@typescript-eslint/member-ordering": "off", + // "@typescript-eslint/no-extraneous-class": "error", + // maybe we should consider this + "@typescript-eslint/consistent-indexed-object-style": "off", + + // typescript-eslint specific + // ========================== + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": defaultRules["no-unused-vars"], + "no-shadow": "off", + "@typescript-eslint/no-shadow": defaultRules["no-shadow"], + "no-dupe-class-members": "off", + "@typescript-eslint/no-dupe-class-members": defaultRules["no-dupe-class-members"], + "no-unused-expressions": "off", + "@typescript-eslint/no-unused-expressions": defaultRules["no-unused-expressions"], + + // defaults too strict + // =================== + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off", + + // probably bugs + // ============= + "@typescript-eslint/no-empty-object-type": "error", + "@typescript-eslint/no-extra-non-null-assertion": "error", + "@typescript-eslint/no-misused-new": "error", + // no way to get it to be less strict unfortunately + // "@typescript-eslint/no-misused-spread": "error", + "@typescript-eslint/no-non-null-asserted-optional-chain": "error", + + // naming style + // ============ + "@typescript-eslint/naming-convention": ["error", { + "selector": ["class", "interface", "typeAlias"], + "format": ["PascalCase"], + }], + + // syntax style (local syntactical, usually autofixable formatting decisions) + // =========================================================================== + "@typescript-eslint/no-namespace": ["error", { allowDeclarations: true }], + "@typescript-eslint/prefer-namespace-keyword": "error", + "@typescript-eslint/adjacent-overload-signatures": "error", + "@typescript-eslint/array-type": "error", + "@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }], + "@typescript-eslint/consistent-type-definitions": "off", + "@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }], + "@typescript-eslint/explicit-member-accessibility": ["error", { "accessibility": "no-public" }], + "@typescript-eslint/parameter-properties": "error", + // `source` and `target` are frequently used as variables that may point to `this` + // or to another `Pokemon` object, depending on how the given method is invoked + "@typescript-eslint/no-this-alias": ["error", { "allowedNames": ["source", "target"] }], + // unfortunately this has lots of false positives without strict array/object property access + // "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", + "@typescript-eslint/prefer-as-const": "error", + "@typescript-eslint/prefer-for-of": "error", + "@typescript-eslint/prefer-function-type": "error", + "@typescript-eslint/prefer-return-this-type": "error", + "@typescript-eslint/triple-slash-reference": "error", + "@typescript-eslint/unified-signatures": "error", +}; + +/** @type {NonNullable} */ +export const defaultRulesTSChecked = { + ...defaultRulesTS, + + // style + // ===== + "@typescript-eslint/no-unnecessary-type-arguments": "error", + "@typescript-eslint/restrict-plus-operands": ["error", { + allowBoolean: false, allowNullish: false, allowNumberAndString: false, allowRegExp: false, + }], + "@typescript-eslint/restrict-template-expressions": ["error", { + allow: [{ name: ['Error', 'URL', 'URLSearchParams'], from: 'lib' }], + allowBoolean: false, allowNever: false, allowNullish: false, allowRegExp: false, + }], + + // we use `any` + // ============ + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", + "@typescript-eslint/no-unsafe-argument": "off", + + // yes-types syntax style, overriding base + // ======================================= + "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/prefer-nullish-coalescing": "off", + "@typescript-eslint/dot-notation": "off", + "@typescript-eslint/no-confusing-non-null-assertion": "off", +}; + +/** @type {NonNullable} */ +export const defaultRulesES3 = { + ...defaultRules, + // required in ES3 + // ================ + "no-var": "off", + "object-shorthand": ["error", "never"], + "prefer-arrow-callback": "off", + "prefer-exponentiation-operator": "off", + "prefer-object-has-own": "off", + "prefer-object-spread": "off", + "prefer-rest-params": "off", + "prefer-spread": "off", + "radix": "off", + "@stylistic/comma-dangle": "error", + "no-unused-vars": ["warn", { + args: "all", + argsIgnorePattern: ".", + caughtErrors: "all", + caughtErrorsIgnorePattern: "^e(rr)?$", + destructuredArrayIgnorePattern: ".", + ignoreRestSiblings: true, + }], + "no-restricted-syntax": ["error", + { selector: "TaggedTemplateExpression", message: "Hard to compile down to ES3" }, + { selector: "CallExpression[callee.name='Symbol']", message: "Annoying to serialize, just use a string" }, + ], + + // with no block scoping, coming up with original variable names is too hard + "no-redeclare": "off", + + // treat var as let + // unfortunately doesn't actually let me redeclare + // "block-scoped-var": "error", + "no-caller": "error", + "no-invalid-this": "error", + "no-new-wrappers": "error", + // Map/Set can be polyfilled but it's nontrivial and it's easier just to use bare objects + "no-restricted-globals": ["error", "Proxy", "Reflect", "Symbol", "WeakSet", "WeakMap", "Set", "Map"], + "unicode-bom": "error", +}; + +/** + * Actually very different from defaultRulesES3, because we don't have to + * worry about syntax that's easy to transpile to ES3 (which is basically + * all syntax). + * @type {NonNullable} + */ +export const defaultRulesES3TSChecked = { + ...defaultRulesTSChecked, + "radix": "off", + "no-restricted-globals": ["error", "Proxy", "Reflect", "Symbol", "WeakSet", "WeakMap", "Set", "Map"], + "no-restricted-syntax": ["error", "TaggedTemplateExpression", "YieldExpression", "AwaitExpression", "BigIntLiteral"], +}; + +/** + * @param {Config[]} configs + * @returns {Config} + */ +function extractPlugin(configs) { + return configs.find(config => !config.rules) || + (() => { throw new Error('No plugin found'); })(); +} +/** + * @param {Config[]} configs + * @returns {Rules} + */ +function extractRules(configs) { + const rules = {}; + for (const config of configs.filter(c => c.rules)) { + Object.assign(rules, config.rules); + } + return rules; +} +const tseslintPlugin = extractPlugin(tseslint.configs.stylisticTypeChecked); + +/** @type {{[k: string]: Config[]}} */ +export const configs = { + js: [{ + rules: { + ...eslint.configs.recommended.rules, + ...defaultRules, + }, + }], + ts: [tseslintPlugin, { + rules: { + ...eslint.configs.recommended.rules, + ...extractRules(tseslint.configs.recommendedTypeChecked), + ...extractRules(tseslint.configs.stylisticTypeChecked), + ...defaultRulesTSChecked, + }, + }], + es3: [{ + rules: { + ...eslint.configs.recommended.rules, + ...defaultRulesES3, + }, + }], + es3ts: [tseslintPlugin, { + rules: { + ...eslint.configs.recommended.rules, + ...extractRules(tseslint.configs.recommendedTypeChecked), + ...extractRules(tseslint.configs.stylisticTypeChecked), + ...defaultRulesES3TSChecked, + }, + }], +}; + +/* +SOURCE FOR IGNOREPATTERN (compile with https://regexfree.k55.io/ ) + + # indentation + ^\s* + # possibly commented out + (\/\/\ \s*)? + + ( + # define a variable, append to a variable, or define a single-arg arrow function + (export\ )? (let\ |const\ |readonly\ )? [a-zA-Z0-9_$.]+ (\ \+?=>?\ ) + | + # define a property (oversize arrays are only allowed in properties) + [a-zA-Z0-9$]+:\ \[? + | + # optionally return or throw + (return\ |throw\ )? + # call a function or constructor + (new\ )?([a-zA-Z0-9$.]+\()? + )? + + ( + Utils\.html + | + (this\.)?(room\.)?tr + | + \$\( + )? + + # start of string or regex + ['"`\/] + +*/ diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..9038adf78a --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,111 @@ +// @ts-check + +import { configs, configure, globals } from './eslint-ps-standard.mjs'; + +export default configure([ + { + ignores: [ + "logs/", + "node_modules/", + "dist/", + "data/**/learnsets.ts", + "tools/set-import/importer.js", + "tools/set-import/sets", + "tools/modlog/converter.js", + "server/global-variables.d.ts", + ], + }, + { + name: "JavaScript", + files: [ + '*.mjs', // look mom I'm linting myself! + '**/*.js', + ], + extends: [configs.js], + languageOptions: { + globals: { + ...globals.builtin, + ...globals.node, + ...globals.mocha, + // globals in test + Dex: false, toID: false, Teams: false, + Config: false, + Users: false, Rooms: false, Ladders: false, Chat: false, Punishments: false, LoginServer: false, + }, + }, + rules: { + "@stylistic/max-len": "off", + "no-shadow": "off", // mostly just too lazy, someone should fix this sometime + }, + }, + { + name: "TypeScript", + files: [ + "config/*.ts", "data/**/*.ts", "lib/*.ts", + "server/**/*.ts", "server/**/*.tsx", + "sim/**/*.ts", + "tools/set-import/*.ts", + ], + extends: [configs.ts], + languageOptions: { + parserOptions: { + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + rules: { + // TEMPORARY + // "@typescript-eslint/restrict-plus-operands": "off", + + // we use these for grouping + // "@typescript-eslint/restrict-template-expressions": ["error", { + // allow: [ + // {name: ['Error', 'URL', 'URLSearchParams', 'unknown'], from: 'lib'}, + // // {name: ['ModifiableValue'], from: 'file'}, + // ], + // allowBoolean: false, allowNever: false, allowNullish: false, allowRegExp: false, + // }], + "@typescript-eslint/restrict-template-expressions": "off", + + // hotpatching, of course + "@typescript-eslint/no-require-imports": "off", + // too new, let's give it more time + "prefer-object-has-own": "off", + // we do use these for documentation + "@typescript-eslint/no-redundant-type-constituents": "off", + // we actually pass around unbound methods a lot (event handlers in Sim, mainly) + "@typescript-eslint/unbound-method": "off", + // event handlers frequently don't have known types + "@typescript-eslint/no-unsafe-function-type": "off", + // too strict when there's no way to ensure that catch catches an error + "@typescript-eslint/prefer-promise-reject-errors": "off", + // we use import() everywhere + "@typescript-eslint/consistent-type-imports": ["error", { disallowTypeAnnotations: false, fixStyle: "inline-type-imports" }], + // TS has _way_ too many issues to require comments on all of them + // most commonly: + // - closed types https://github.com/microsoft/TypeScript/issues/12936 + // - unknown property access + "@typescript-eslint/ban-ts-comment": ["error", { + 'ts-check': false, + 'ts-expect-error': false, + 'ts-ignore': true, + 'ts-nocheck': true, + }], + // we're inconsistent about comma dangle in functions. TODO: fix later + "@stylistic/comma-dangle": ["error", { + "arrays": "always-multiline", + "objects": "always-multiline", + "imports": "always-multiline", + "exports": "always-multiline", + "functions": "only-multiline", + "importAttributes": "always-multiline", + "dynamicImports": "always-multiline", + "enums": "always-multiline", + "generics": "always-multiline", + "tuples": "always-multiline", + }], + // there are a few of these that make sense, in scripts + "no-useless-return": "off", + }, + }, +]); diff --git a/lib/crashlogger.ts b/lib/crashlogger.ts index ba01b148a9..092c1eeb07 100644 --- a/lib/crashlogger.ts +++ b/lib/crashlogger.ts @@ -42,7 +42,7 @@ export function crashlogger( } console.error(`\nCRASH: ${stack}\n`); - const out = fs.createWriteStream(logPath, {flags: 'a'}); + const out = fs.createWriteStream(logPath, { flags: 'a' }); out.on('open', () => { out.write(`\n${stack}\n`); out.end(); diff --git a/lib/dashycode.ts b/lib/dashycode.ts index 23a0cab283..7779eb6295 100644 --- a/lib/dashycode.ts +++ b/lib/dashycode.ts @@ -159,18 +159,18 @@ export function encode(str: string, allowCaps = false) { let unsafePart = streamGetCode(unsafeStream); if (safePart.startsWith('-')) { safePart = safePart.slice(1); - unsafePart = unsafePart + '2'; + unsafePart = `${unsafePart}2`; } if (safePart.endsWith('-')) { safePart = safePart.slice(0, -1); } if (!safePart) { safePart = '0'; - unsafePart = '0' + unsafePart; + unsafePart = `0${unsafePart}`; if (unsafePart.endsWith('2')) unsafePart = unsafePart.slice(0, -1); } if (!unsafePart) return safePart; - return safePart + '--' + unsafePart; + return `${safePart}--${unsafePart}`; } export function decode(codedStr: string) { @@ -283,7 +283,6 @@ export function vizStream(codeBuf: string, translate = true) { function vizBlock(s: DashyStream, bufLen: number) { const buf = streamRead(s, bufLen); - // @ts-ignore return buf.toString(2).padStart(bufLen, '0'); } diff --git a/lib/database.ts b/lib/database.ts index f14bb5b91b..23a3a00efb 100644 --- a/lib/database.ts +++ b/lib/database.ts @@ -10,8 +10,7 @@ import * as mysql from 'mysql2'; import * as pg from 'pg'; export type BasicSQLValue = string | number | null; -// eslint-disable-next-line -export type SQLRow = {[k: string]: BasicSQLValue}; +export type SQLRow = { [k: string]: BasicSQLValue }; export type SQLValue = BasicSQLValue | SQLStatement | PartialOrSQL | BasicSQLValue[] | undefined; export function isSQL(value: any): value is SQLStatement { @@ -129,7 +128,7 @@ export function SQL(strings: TemplateStringsArray, ...values: SQLValue[]) { return new SQLStatement(strings, values); } -export interface ResultRow {[k: string]: BasicSQLValue} +export interface ResultRow { [k: string]: BasicSQLValue } export const connectedDatabases: Database[] = []; @@ -258,7 +257,7 @@ export class DatabaseTable { eval(): (strings: TemplateStringsArray, ...rest: SQLValue[]) => Promise { return (strings, ...rest) => - this.queryOne<{result: T}>( + this.queryOne<{ result: T }>( )`SELECT ${new SQLStatement(strings, rest)} AS result FROM "${this.name}" LIMIT 1` .then(row => row?.result); } @@ -314,10 +313,10 @@ export class DatabaseTable { export class MySQLDatabase extends Database { override type = 'mysql' as const; - constructor(config: mysql.PoolOptions & {prefix?: string}) { + constructor(config: mysql.PoolOptions & { prefix?: string }) { const prefix = config.prefix || ""; if (config.prefix) { - config = {...config}; + config = { ...config }; delete config.prefix; } super(mysql.createPool(config), prefix); @@ -328,7 +327,7 @@ export class MySQLDatabase extends Database { for (let i = 0; i < query.values.length; i++) { const value = query.values[i]; if (query.sql[i + 1].startsWith('`') || query.sql[i + 1].startsWith('"')) { - sql = sql.slice(0, -1) + this.escapeId('' + value) + query.sql[i + 1].slice(1); + sql = sql.slice(0, -1) + this.escapeId(`${value}`) + query.sql[i + 1].slice(1); } else { sql += '?' + query.sql[i + 1]; values.push(value); @@ -361,7 +360,7 @@ export class MySQLDatabase extends Database { } } -export class PGDatabase extends Database { +export class PGDatabase extends Database { override type = 'pg' as const; constructor(config: pg.PoolConfig) { super(new pg.Pool(config)); @@ -373,7 +372,7 @@ export class PGDatabase extends Database for (let i = 0; i < query.values.length; i++) { const value = query.values[i]; if (query.sql[i + 1].startsWith('`') || query.sql[i + 1].startsWith('"')) { - sql = sql.slice(0, -1) + this.escapeId('' + value) + query.sql[i + 1].slice(1); + sql = sql.slice(0, -1) + this.escapeId(`${value}`) + query.sql[i + 1].slice(1); } else { paramCount++; sql += `$${paramCount}` + query.sql[i + 1]; @@ -386,7 +385,7 @@ export class PGDatabase extends Database return this.connection.query(query, values).then(res => res.rows); } override _queryExec(query: string, values: BasicSQLValue[]) { - return this.connection.query(query, values).then(res => ({affectedRows: res.rowCount})); + return this.connection.query(query, values).then(res => ({ affectedRows: res.rowCount })); } override escapeId(id: string) { // @ts-expect-error @types/pg really needs to be updated diff --git a/lib/fs.ts b/lib/fs.ts index c78f6c29dd..6143535810 100644 --- a/lib/fs.ts +++ b/lib/fs.ts @@ -23,7 +23,7 @@ import * as fs from 'fs'; import * as pathModule from 'path'; -import {ReadStream, WriteStream} from './streams'; +import { ReadStream, WriteStream } from './streams'; // not sure why it's necessary to use path.sep, but testing with Windows showed it was const DIST = `${pathModule.sep}dist${pathModule.sep}`; @@ -35,13 +35,13 @@ interface PendingUpdate { pendingDataFetcher: (() => string | Buffer) | null; pendingOptions: AnyObject | null; throttleTime: number; // throttling until time (0 for no throttle) - throttleTimer: NodeJS.Timer | null; + throttleTimer: NodeJS.Timeout | null; } -declare const __fsState: {pendingUpdates: Map}; +declare const __fsState: { pendingUpdates: Map }; // config needs to be declared here since we access it as global.Config?.nofswriting // (so we can use it without the global) -declare const global: {__fsState: typeof __fsState, Config: any}; +declare const global: { __fsState: typeof __fsState, Config: any }; if (!global.__fsState) { global.__fsState = { pendingUpdates: new Map(), @@ -74,7 +74,7 @@ export class FSPath { if (typeof options !== 'string' && options.encoding === undefined) { options.encoding = 'utf8'; } - return fs.readFileSync(this.path, options as {encoding: 'utf8'}); + return fs.readFileSync(this.path, options as { encoding: 'utf8' }); } readBuffer(options: AnyObject | BufferEncoding = {}): Promise { @@ -86,7 +86,7 @@ export class FSPath { } readBufferSync(options: AnyObject | string = {}) { - return fs.readFileSync(this.path, options as {encoding: null}); + return fs.readFileSync(this.path, options as { encoding: null }); } exists(): Promise { @@ -210,7 +210,7 @@ export class FSPath { if (!pendingUpdate) throw new Error(`FS: Pending update not found`); if (pendingUpdate.isWriting) throw new Error(`FS: Conflicting update`); - const {pendingDataFetcher: dataFetcher, pendingOptions: options} = pendingUpdate; + const { pendingDataFetcher: dataFetcher, pendingOptions: options } = pendingUpdate; if (!dataFetcher || !options) { // no pending update __fsState.pendingUpdates.delete(this.path); @@ -313,21 +313,16 @@ export class FSPath { createWriteStream(options = {}): WriteStream { if (global.Config?.nofswriting) { - // @ts-ignore - return new WriteStream({write() {}}); + return new WriteStream({ write() {} }); } - // @ts-ignore return new WriteStream(fs.createWriteStream(this.path, options)); } - createAppendStream(options = {}): WriteStream { + createAppendStream(options: AnyObject = {}): WriteStream { if (global.Config?.nofswriting) { - // @ts-ignore - return new WriteStream({write() {}}); + return new WriteStream({ write() {} }); } - // @ts-ignore options.flags = options.flags || 'a'; - // @ts-ignore return new WriteStream(fs.createWriteStream(this.path, options)); } @@ -353,7 +348,7 @@ export class FSPath { async rmdir(recursive?: boolean) { if (global.Config?.nofswriting) return Promise.resolve(); return new Promise((resolve, reject) => { - fs.rmdir(this.path, {recursive}, err => { + fs.rmdir(this.path, { recursive }, err => { err ? reject(err) : resolve(); }); }); @@ -361,7 +356,7 @@ export class FSPath { rmdirSync(recursive?: boolean) { if (global.Config?.nofswriting) return; - return fs.rmdirSync(this.path, {recursive}); + return fs.rmdirSync(this.path, { recursive }); } mkdir(mode: string | number = 0o755) { @@ -487,7 +482,7 @@ class FileReadStream extends ReadStream { _read(size = 16384): Promise { return new Promise((resolve, reject) => { - if (this.atEOF) return resolve(); + if (this.atEOF) return void resolve(); this.ensureCapacity(size); void this.fd.then(fd => { fs.read(fd, this.buf, this.bufEnd, size, null, (err, bytesRead, buf) => { diff --git a/lib/index.ts b/lib/index.ts index 0c9208f289..f4fe095cd8 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,10 +1,10 @@ export * as Dashycode from './dashycode'; -export {Repl} from './repl'; -export {Net} from './net'; +export { Repl } from './repl'; +export { Net } from './net'; export * as Streams from './streams'; -export {FS} from './fs'; +export { FS } from './fs'; export * as Utils from './utils'; -export {crashlogger} from './crashlogger'; +export { crashlogger } from './crashlogger'; export * as ProcessManager from './process-manager'; -export {SQL} from './sql'; -export {PostgresDatabase} from './postgres'; +export { SQL } from './sql'; +export { PostgresDatabase } from './postgres'; diff --git a/lib/net.ts b/lib/net.ts index 7d663e617b..e00a8a94f9 100644 --- a/lib/net.ts +++ b/lib/net.ts @@ -76,7 +76,7 @@ export class NetStream extends Streams.ReadWriteStream { } } - const protocol = url.parse(this.uri).protocol as string; + const protocol = url.parse(this.uri).protocol; const net = protocol === 'https:' ? https : http; let resolveResponse: ((value: http.IncomingMessage | null) => void) | null; @@ -143,7 +143,7 @@ export class NetStream extends Streams.ReadWriteStream { let out = ''; for (const key in data) { if (out) out += `&`; - out += `${key}=${encodeURIComponent('' + data[key])}`; + out += `${key}=${encodeURIComponent(`${data[key]}`)}`; } return out; } diff --git a/lib/postgres.ts b/lib/postgres.ts index 9a9ca45cbc..3027375dfc 100644 --- a/lib/postgres.ts +++ b/lib/postgres.ts @@ -4,11 +4,12 @@ * @author mia-pi-git */ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore in case module doesn't exist import type * as PG from 'pg'; -import type {SQLStatement} from 'sql-template-strings'; +import type { SQLStatement } from 'sql-template-strings'; import * as Streams from './streams'; -import {FS} from './fs'; +import { FS } from './fs'; import * as Utils from './utils'; interface MigrationOptions { @@ -22,7 +23,7 @@ export class PostgresDatabase { constructor(config = PostgresDatabase.getConfig()) { try { this.pool = new (require('pg').Pool)(config); - } catch (e: any) { + } catch { this.pool = null!; } } @@ -47,7 +48,7 @@ export class PostgresDatabase { try { config = require(FS.ROOT_PATH + '/config/config').usepostgres; if (!config) throw new Error('Missing config for pg database'); - } catch (e: any) {} + } catch {} return config; } async transaction(callback: (conn: PG.PoolClient) => any, depth = 0): Promise { @@ -55,7 +56,6 @@ export class PostgresDatabase { await conn.query(`BEGIN`); let result; try { - // eslint-disable-next-line callback-return result = await callback(conn); } catch (e: any) { await conn.query(`ROLLBACK`); @@ -97,7 +97,7 @@ export class PostgresDatabase { if (stored.length) { value = stored[0].value || "0"; } - } catch (e) { + } catch { await this.query(`CREATE TABLE db_info (name TEXT NOT NULL, key TEXT NOT NULL, value TEXT NOT NULL)`); } if (!value) { // means nothing inserted - create row diff --git a/lib/process-manager.ts b/lib/process-manager.ts index 4e196c4f14..96248ee639 100644 --- a/lib/process-manager.ts +++ b/lib/process-manager.ts @@ -13,27 +13,29 @@ import * as child_process from 'child_process'; import * as cluster from 'cluster'; import * as path from 'path'; import * as Streams from './streams'; -import {FS} from './fs'; +import { FS } from './fs'; type ChildProcess = child_process.ChildProcess; type Worker = cluster.Worker; export const processManagers: ProcessManager[] = []; -export function exec(args: string, execOptions?: child_process.ExecOptions): Promise<{stderr: string, stdout: string}>; +export function exec( + args: string, execOptions?: child_process.ExecOptions +): Promise<{ stderr: string, stdout: string }>; export function exec( args: [string, ...string[]], execOptions?: child_process.ExecFileOptions -): Promise<{stderr: string, stdout: string}>; +): Promise<{ stderr: string, stdout: string }>; export function exec(args: string | string[], execOptions?: AnyObject) { if (Array.isArray(args)) { const cmd = args.shift(); if (!cmd) throw new Error(`You must pass a command to ProcessManager.exec.`); - return new Promise<{stderr: string, stdout: string}>((resolve, reject) => { + return new Promise<{ stderr: string, stdout: string }>((resolve, reject) => { child_process.execFile(cmd, args, execOptions, (err, stdout, stderr) => { if (err) reject(err); if (typeof stdout !== 'string') stdout = stdout.toString(); if (typeof stderr !== 'string') stderr = stderr.toString(); - resolve({stdout, stderr}); + resolve({ stdout, stderr }); }); }); } else { @@ -111,7 +113,7 @@ export class QueryProcessWrapper implements ProcessWrapper { file: string; constructor(file: string, messageCallback?: (message: string) => any) { - this.process = child_process.fork(file, [], {cwd: FS.ROOT_PATH}); + this.process = child_process.fork(file, [], { cwd: FS.ROOT_PATH }); this.taskId = 0; this.file = file; this.pendingTasks = new Map(); @@ -161,7 +163,7 @@ export class QueryProcessWrapper implements ProcessWrapper { // it's also futureproofing in case other external modfules require this // we also specifically do not throw here because this json might be sensitive, // so we only want it to go to emails - global.Monitor?.crashlog?.(e, `a ${path.basename(this.file)} process`, {result: obj}); + global.Monitor?.crashlog?.(e, `a ${path.basename(this.file)} process`, { result: obj }); return undefined; } } @@ -192,7 +194,7 @@ export class QueryProcessWrapper implements ProcessWrapper { this.resolveRelease = resolve; }); } - return this.pendingRelease as Promise; + return this.pendingRelease!; } destroy() { @@ -230,7 +232,7 @@ export class StreamProcessWrapper implements ProcessWrapper { messageCallback?: (message: string) => any; constructor(file: string, messageCallback?: (message: string) => any) { - this.process = child_process.fork(file, [], {cwd: FS.ROOT_PATH}); + this.process = child_process.fork(file, [], { cwd: FS.ROOT_PATH }); this.messageCallback = messageCallback; this.process.on('message', (message: string) => { @@ -265,7 +267,6 @@ export class StreamProcessWrapper implements ProcessWrapper { if (messageType === 'END') { stream.pushEnd(); this.deleteStream(taskId); - return; } else if (messageType === 'PUSH') { stream.push(message); } else if (messageType === 'THROW') { @@ -309,7 +310,7 @@ export class StreamProcessWrapper implements ProcessWrapper { this.resolveRelease = resolve; }); } - return this.pendingRelease as Promise; + return this.pendingRelease!; } destroy() { @@ -349,7 +350,7 @@ export class StreamWorker { /** Wraps the process object in the PARENT process. */ export class RawProcessWrapper implements ProcessWrapper, StreamWorker { - process: ChildProcess & {process: undefined} | Worker; + process: ChildProcess & { process: undefined } | Worker; taskId = 0; stream: RawSubprocessStream; pendingRelease: Promise | null = null; @@ -369,7 +370,7 @@ export class RawProcessWrapper implements ProcessWrapper, StreamWorker { this.process = cluster.fork(env); this.workerid = this.process.id; } else { - this.process = child_process.fork(file, [], {cwd: FS.ROOT_PATH, env}) as any; + this.process = child_process.fork(file, [], { cwd: FS.ROOT_PATH, env }) as any; } this.process.on('message', (message: string) => { @@ -395,7 +396,7 @@ export class RawProcessWrapper implements ProcessWrapper, StreamWorker { this.resolveRelease = resolve; }); } - return this.pendingRelease as Promise; + return this.pendingRelease!; } destroy() { @@ -405,7 +406,6 @@ export class RawProcessWrapper implements ProcessWrapper, StreamWorker { } void this.stream.destroy(); this.process.disconnect(); - return; } } @@ -630,7 +630,7 @@ export class StreamProcessManager extends ProcessManager { while (!done) { try { let value; - ({value, done} = await stream.next()); + ({ value, done } = await stream.next()); process.send!(`${taskId}\nPUSH\n${value}`); } catch (err: any) { process.send!(`${taskId}\nTHROW\n${err.stack}`); @@ -718,7 +718,6 @@ export class RawProcessManager extends ProcessManager { if (this.isCluster && this.isParentProcess) { cluster.setupMaster({ exec: this.filename, - // @ts-ignore TODO: update type definition cwd: FS.ROOT_PATH, }); } @@ -756,7 +755,7 @@ export class RawProcessManager extends ProcessManager { while (!done) { try { let value; - ({value, done} = await stream.next()); + ({ value, done } = await stream.next()); process.send!(value); } catch (err: any) { process.send!(`THROW\n${err.stack}`); diff --git a/lib/repl.ts b/lib/repl.ts index d76e7b3f8e..070a00b01a 100644 --- a/lib/repl.ts +++ b/lib/repl.ts @@ -12,8 +12,8 @@ import * as fs from 'fs'; import * as net from 'net'; import * as path from 'path'; import * as repl from 'repl'; -import {crashlogger} from './crashlogger'; -import {FS} from './fs'; +import { crashlogger } from './crashlogger'; +import { FS } from './fs'; declare const Config: any; export const Repl = new class { diff --git a/lib/sql.ts b/lib/sql.ts index 4a25eb00e1..ac308c9b80 100644 --- a/lib/sql.ts +++ b/lib/sql.ts @@ -2,11 +2,12 @@ * Async worker thread wrapper around SQLite, written to improve concurrent performance. * @author mia-pi-git */ -import {QueryProcessManager} from './process-manager'; +import { QueryProcessManager } from './process-manager'; import type * as sqlite from 'better-sqlite3'; -import {FS} from './fs'; +import { FS } from './fs'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore in case not installed -import type {SQLStatement} from 'sql-template-strings'; +import type { SQLStatement } from 'sql-template-strings'; export const DB_NOT_FOUND = null; @@ -27,7 +28,7 @@ export interface SQLOptions { type DataType = unknown[] | Record; export type SQLInput = string | number | null; -export interface ResultRow {[k: string]: SQLInput} +export interface ResultRow { [k: string]: SQLInput } export interface TransactionEnvironment { db: sqlite.Database; @@ -124,7 +125,7 @@ export class SQLDatabaseManager extends QueryProcessManager return transaction(query.data, env) || null; } case 'exec': { - if (!this.database) return {changes: 0}; + if (!this.database) return { changes: 0 }; this.database.exec(query.data); return true; } @@ -191,7 +192,7 @@ export class SQLDatabaseManager extends QueryProcessManager this.database!.function(key, cb); } private extractStatement( - query: DatabaseQuery & {statement: string, noPrepare?: boolean} + query: DatabaseQuery & { statement: string, noPrepare?: boolean } ) { query.statement = query.statement.trim(); const statement = query.noPrepare ? @@ -203,7 +204,7 @@ export class SQLDatabaseManager extends QueryProcessManager setupDatabase() { if (this.dbReady) return; this.dbReady = true; - const {file, extension} = this.options; + const { file, extension } = this.options; const Database = getModule(); this.database = Database ? new Database(file) : null; if (extension) this.loadExtensionFile(extension); @@ -259,38 +260,38 @@ export class SQLDatabaseManager extends QueryProcessManager statement: string | Statement, data: DataType = [], noPrepare?: boolean ): Promise { if (typeof statement !== 'string') statement = statement.toString(); - return this.query({type: 'all', statement, data, noPrepare}); + return this.query({ type: 'all', statement, data, noPrepare }); } get( statement: string | Statement, data: DataType = [], noPrepare?: boolean ): Promise { if (typeof statement !== 'string') statement = statement.toString(); - return this.query({type: 'get', statement, data, noPrepare}); + return this.query({ type: 'get', statement, data, noPrepare }); } run( statement: string | Statement, data: DataType = [], noPrepare?: boolean ): Promise { if (typeof statement !== 'string') statement = statement.toString(); - return this.query({type: 'run', statement, data, noPrepare}); + return this.query({ type: 'run', statement, data, noPrepare }); } transaction(name: string, data: DataType = []): Promise { - return this.query({type: 'transaction', name, data}); + return this.query({ type: 'transaction', name, data }); } async prepare(statement: string): Promise { - const source = await this.query({type: 'prepare', data: statement}); + const source = await this.query({ type: 'prepare', data: statement }); if (!source) return null; return new Statement(source, this); } - exec(data: string): Promise<{changes: number}> { - return this.query({type: 'exec', data}); + exec(data: string): Promise<{ changes: number }> { + return this.query({ type: 'exec', data }); } loadExtension(filepath: string) { - return this.query({type: 'load-extension', data: filepath}); + return this.query({ type: 'load-extension', data: filepath }); } async runFile(file: string) { const contents = await FS(file).read(); - return this.query({type: 'exec', data: contents}); + return this.query({ type: 'exec', data: contents }); } } @@ -420,7 +421,7 @@ export class DatabaseTable { // catch-alls for "we can't fit this query into any of the wrapper functions" run(sql: SQLStatement) { - return this.database.run(sql.sql, sql.values) as Promise<{changes: number}>; + return this.database.run(sql.sql, sql.values) as Promise<{ changes: number }>; } all(sql: SQLStatement) { return this.database.all(sql.sql, sql.values); @@ -428,9 +429,9 @@ export class DatabaseTable { } function getSQL( - module: NodeJS.Module, input: SQLOptions & {processes?: number} + module: NodeJS.Module, input: SQLOptions & { processes?: number } ) { - const {processes} = input; + const { processes } = input; const PM = new SQLDatabaseManager(module, input); if (PM.isParentProcess) { if (processes) PM.spawn(processes); @@ -453,7 +454,7 @@ export const SQL = Object.assign(getSQL, { })() as typeof import('sql-template-strings').SQL, }); -export namespace SQL { +export declare namespace SQL { export type DatabaseManager = import('./sql').SQLDatabaseManager; export type Statement = import('./sql').Statement; export type Options = import('./sql').SQLOptions; diff --git a/lib/streams.ts b/lib/streams.ts index cf3482dea4..36a6a0c9b5 100644 --- a/lib/streams.ts +++ b/lib/streams.ts @@ -31,7 +31,7 @@ export class ReadStream { nextPush: Promise; awaitingPush: boolean; - constructor(optionsOrStreamLike: {[k: string]: any} | NodeJS.ReadableStream | string | Buffer = {}) { + constructor(optionsOrStreamLike: { [k: string]: any } | NodeJS.ReadableStream | string | Buffer = {}) { this.buf = Buffer.allocUnsafe(BUF_SIZE); this.bufStart = 0; this.bufEnd = 0; @@ -49,13 +49,13 @@ export class ReadStream { }); this.awaitingPush = false; - let options: {[k: string]: any}; + let options: { [k: string]: any }; if (typeof optionsOrStreamLike === 'string') { - options = {buffer: optionsOrStreamLike}; + options = { buffer: optionsOrStreamLike }; } else if (optionsOrStreamLike instanceof Buffer) { - options = {buffer: optionsOrStreamLike}; + options = { buffer: optionsOrStreamLike }; } else if (typeof (optionsOrStreamLike as any)._readableState === 'object') { - options = {nodeStream: optionsOrStreamLike as NodeJS.ReadableStream}; + options = { nodeStream: optionsOrStreamLike as NodeJS.ReadableStream }; } else { options = optionsOrStreamLike; } @@ -371,13 +371,13 @@ export class ReadStream { async next(byteCount: number | null = null) { const value = await this.read(byteCount); - return {value, done: value === null}; + return { value, done: value === null } as { value: string, done: false } | { value: null, done: true }; } - async pipeTo(outStream: WriteStream, options: {noEnd?: boolean} = {}) { - let value, done; - while (({value, done} = await this.next(), !done)) { - await outStream.write(value!); + async pipeTo(outStream: WriteStream, options: { noEnd?: boolean } = {}) { + let next; + while ((next = await this.next(), !next.done)) { + await outStream.write(next.value); } if (!options.noEnd) return outStream.writeEnd(); } @@ -385,7 +385,7 @@ export class ReadStream { interface WriteStreamOptions { nodeStream?: NodeJS.WritableStream; - write?: (this: WriteStream, data: string | Buffer) => (Promise | undefined); + write?: (this: WriteStream, data: string | Buffer) => (Promise | undefined | void); writeEnd?: (this: WriteStream) => Promise; } @@ -405,7 +405,7 @@ export class WriteStream { let options: WriteStreamOptions = optionsOrStream as any; if ((options as any)._writableState) { - options = {nodeStream: optionsOrStream as NodeJS.WritableStream}; + options = { nodeStream: optionsOrStream as NodeJS.WritableStream }; } if (options.nodeStream) { const nodeStream: NodeJS.WritableStream = options.nodeStream; @@ -574,9 +574,9 @@ export class ObjectReadStream { let options: ObjectReadStreamOptions; if (Array.isArray(optionsOrStreamLike)) { - options = {buffer: optionsOrStreamLike}; + options = { buffer: optionsOrStreamLike }; } else if (typeof (optionsOrStreamLike as any)._readableState === 'object') { - options = {nodeStream: optionsOrStreamLike as NodeJS.ReadableStream}; + options = { nodeStream: optionsOrStreamLike as NodeJS.ReadableStream }; } else { options = optionsOrStreamLike as ObjectReadStreamOptions; } @@ -721,19 +721,18 @@ export class ObjectReadStream { return this._destroy(); } - // eslint-disable-next-line no-restricted-globals [Symbol.asyncIterator]() { return this; } async next() { - if (this.buf.length) return {value: this.buf.shift() as T, done: false as const}; + if (this.buf.length) return { value: this.buf.shift() as T, done: false as const }; await this.loadIntoBuffer(1, true); - if (!this.buf.length) return {value: undefined, done: true as const}; - return {value: this.buf.shift() as T, done: false as const}; + if (!this.buf.length) return { value: undefined, done: true as const }; + return { value: this.buf.shift() as T, done: false as const }; } - async pipeTo(outStream: ObjectWriteStream, options: {noEnd?: boolean} = {}) { - let value, done; - while (({value, done} = await this.next(), !done)) { - await outStream.write(value!); + async pipeTo(outStream: ObjectWriteStream, options: { noEnd?: boolean } = {}) { + let next; + while ((next = await this.next(), !next.done)) { + await outStream.write(next.value); } if (!options.noEnd) return outStream.writeEnd(); } @@ -758,7 +757,7 @@ export class ObjectWriteStream { let options: ObjectWriteStreamOptions = optionsOrStream as any; if (options._writableState) { - options = {nodeStream: optionsOrStream as NodeJS.WritableStream}; + options = { nodeStream: optionsOrStream as NodeJS.WritableStream }; } if (options.nodeStream) { const nodeStream: NodeJS.WritableStream = options.nodeStream; @@ -863,10 +862,10 @@ export function stdout() { export function stdpipe(stream: WriteStream | ReadStream | ReadWriteStream) { const promises = []; - if ((stream as ReadStream | WriteStream & {pipeTo: undefined}).pipeTo) { + if ((stream as ReadStream | WriteStream & { pipeTo: undefined }).pipeTo) { promises.push((stream as ReadStream).pipeTo(stdout())); } - if ((stream as WriteStream | ReadStream & {write: undefined}).write) { + if ((stream as WriteStream | ReadStream & { write: undefined }).write) { promises.push(stdin().pipeTo(stream as WriteStream)); } return Promise.all(promises); diff --git a/lib/utils.ts b/lib/utils.ts index cfabe2cd38..6c6297fa90 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -15,7 +15,7 @@ * that if it's English-specific, it should be left out of here. */ -export type Comparable = number | string | boolean | Comparable[] | {reverse: Comparable}; +export type Comparable = number | string | boolean | Comparable[] | { reverse: Comparable }; /** * Safely converts the passed variable into a string. Unlike '' + str, @@ -33,7 +33,7 @@ export type Comparable = number | string | boolean | Comparable[] | {reverse: Co */ export function getString(str: any): string { - return (typeof str === 'string' || typeof str === 'number') ? '' + str : ''; + return (typeof str === 'string' || typeof str === 'number') ? `${str}` : ''; } export function escapeRegex(str: string) { @@ -45,7 +45,7 @@ export function escapeRegex(str: string) { */ export function escapeHTML(str: string | number) { if (str === null || str === undefined) return ''; - return ('' + str) + return `${str}` .replace(/&/g, '&') .replace(//g, '>') @@ -69,14 +69,14 @@ export function stripHTML(htmlContent: string) { export function formatOrder(place: number) { // anything between 10 and 20 should always end with -th let remainder = place % 100; - if (remainder >= 10 && remainder <= 20) return place + 'th'; + if (remainder >= 10 && remainder <= 20) return `${place}th`; // follow standard rules with -st, -nd, -rd, and -th remainder = place % 10; - if (remainder === 1) return place + 'st'; - if (remainder === 2) return place + 'nd'; - if (remainder === 3) return place + 'rd'; - return place + 'th'; + if (remainder === 1) return `${place}st`; + if (remainder === 2) return `${place}nd`; + if (remainder === 3) return `${place}rd`; + return `${place}th`; } /** @@ -103,7 +103,7 @@ export function visualize(value: any, depth = 0): string { return `${value}`; } let constructor = ''; - if (value.constructor && value.constructor.name && typeof value.constructor.name === 'string') { + if (typeof value.constructor?.name === 'string') { constructor = value.constructor.name; if (constructor === 'Object') constructor = ''; } else { @@ -128,9 +128,11 @@ export function visualize(value: any, depth = 0): string { if (value.toString) { try { const stringValue = value.toString(); - if (typeof stringValue === 'string' && - stringValue !== '[object Object]' && - stringValue !== `[object ${constructor}]`) { + if ( + typeof stringValue === 'string' && + stringValue !== '[object Object]' && + stringValue !== `[object ${constructor}]` + ) { return `${constructor}(${stringValue})`; } } catch {} @@ -180,7 +182,7 @@ export function compare(a: Comparable, b: Comparable): number { return 0; } if ('reverse' in a) { - return compare((b as {reverse: string}).reverse, a.reverse); + return compare((b as { reverse: string }).reverse, a.reverse); } throw new Error(`Passed value ${a} is not comparable`); } @@ -301,7 +303,7 @@ export function clampIntRange(num: any, min?: number, max?: number): number { return num; } -export function clearRequireCache(options: {exclude?: string[]} = {}) { +export function clearRequireCache(options: { exclude?: string[] } = {}) { const excludes = options?.exclude || []; excludes.push('/node_modules/'); diff --git a/package-lock.json b/package-lock.json index 66bf0c5091..103ec86c13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,20 +23,21 @@ "pokemon-showdown": "pokemon-showdown" }, "devDependencies": { + "@stylistic/eslint-plugin": "^4.0.1", "@types/better-sqlite3": "^7.6.2", "@types/cloud-env": "^0.2.2", - "@types/node": "^14.18.36", + "@types/node": "^14.18.63", "@types/node-static": "^0.7.7", "@types/nodemailer": "^6.4.4", "@types/pg": "^8.6.5", "@types/sockjs": "^0.3.33", "@types/sodium-native": "^2.3.9", - "@typescript-eslint/eslint-plugin": "^5.8.0", - "@typescript-eslint/parser": "^5.8.0", - "eslint": "8.5.0", + "eslint": "^9.21.0", + "globals": "^16.0.0", "mocha": "^8.2.0", "smogon": "^3.0.0", - "typescript": "^5.0.4" + "typescript": "^5.7.3", + "typescript-eslint": "^8.24.1" }, "engines": { "node": ">=16.0.0" @@ -69,54 +70,219 @@ "node": ">=12" } }, - "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", "dev": true, + "license": "MIT", "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" + "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, "funding": { "url": "https://opencollective.com/eslint" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, + "license": "MIT", "engines": { - "node": ">=10.10.0" + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "node_modules/@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", + "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz", + "integrity": "sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", + "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -130,6 +296,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } @@ -139,6 +306,7 @@ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -147,6 +315,39 @@ "node": ">= 8" } }, + "node_modules/@stylistic/eslint-plugin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-4.0.1.tgz", + "integrity": "sha512-RwKkRKiDrF4ptiur54ckDhOByQYKYZ1dEmI5K8BJCmuGpauFJXzVL1UQYTA2zq702CqMFdYiJcVFJWfokIgFxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^8.23.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=9.0.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@types/better-sqlite3": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.3.tgz", @@ -162,11 +363,19 @@ "integrity": "sha512-cydYRiL/esxoLgtciH/YURNXsF/JUxEBoO5JakfH8r6F/jsXIM7FyD+Hmfbb2gnT7F/XKAL9NUlO9RPGw0ivvw==", "dev": true }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/mime": { "version": "1.3.2", @@ -175,10 +384,11 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.18.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz", - "integrity": "sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ==", - "dev": true + "version": "14.18.63", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", + "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", + "dev": true, + "license": "MIT" }, "node_modules/@types/node-static": { "version": "0.7.7", @@ -210,12 +420,6 @@ "pg-types": "^2.2.0" } }, - "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", - "dev": true - }, "node_modules/@types/sockjs": { "version": "0.3.33", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", @@ -236,76 +440,72 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", - "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.1.tgz", + "integrity": "sha512-ll1StnKtBigWIGqvYDVuDmXJHVH4zLVot1yQ4fJtLpL7qacwkxJc1T0bptqw+miBQ/QfUbhl1TcQ4accW5KUyA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/type-utils": "5.48.0", - "@typescript-eslint/utils": "5.48.0", - "debug": "^4.3.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/type-utils": "8.24.1", + "@typescript-eslint/utils": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", - "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.1.tgz", + "integrity": "sha512-Tqoa05bu+t5s8CTZFaGpCH2ub3QeT9YDkXbPd3uQ4SfsLoh1/vv2GEYAioPoxCWJJNsenXlC88tRjwoHNts1oQ==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/typescript-estree": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", - "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.1.tgz", + "integrity": "sha512-OdQr6BNBzwRjNEXMQyaGyZzgg7wzjYKfX2ZBV3E04hUCBDv3GQCHiz9RpqdUIiVrMgJGkXm3tcEh4vFSHreS2Q==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0" + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -313,39 +513,37 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", - "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.1.tgz", + "integrity": "sha512-/Do9fmNgCsQ+K4rCz0STI7lYB4phTtEXqqCAs3gZW0pnK7lWNkvWd5iW545GSmApm4AzmQXmSqXPO565B4WVrw==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "5.48.0", - "@typescript-eslint/utils": "5.48.0", + "@typescript-eslint/typescript-estree": "8.24.1", + "@typescript-eslint/utils": "8.24.1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^2.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/types": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", - "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.1.tgz", + "integrity": "sha512-9kqJ+2DkUXiuhoiYIUvIYjGcwle8pcPpdlfkemGvTObzgmYfJ5d0Qm6jwb4NBXP9W1I5tss0VIAnWFumz3mC5A==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -353,69 +551,94 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", - "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.1.tgz", + "integrity": "sha512-UPyy4MJ/0RE648DSKQe9g0VDSehPINiejjA6ElqnFaFIhI6ZEiZAkUI0D5MCk0bQcTf/LVqZStvQ6K4lPn/BRg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", - "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.1.tgz", + "integrity": "sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/typescript-estree": "8.24.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", - "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.1.tgz", + "integrity": "sha512-EwVHlp5l+2vp8CoqJm9KikPZgi3gbdZAtabKT9KPShGeOcJhsv4Zdo3oc8T8I0uKEmYoU4ItyxbptjF08enaxg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.48.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "8.24.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -435,10 +658,11 @@ "optional": true }, "node_modules/acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -451,6 +675,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -460,6 +685,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -545,15 +771,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -645,12 +862,13 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -705,6 +923,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -880,10 +1099,11 @@ "optional": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -894,12 +1114,13 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -950,7 +1171,8 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/delegates": { "version": "1.0.0", @@ -984,18 +1206,6 @@ "node": ">=0.3.1" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/docopt": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/docopt/-/docopt-0.6.2.tgz", @@ -1005,18 +1215,6 @@ "node": ">=0.10.0" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -1032,19 +1230,6 @@ "once": "^1.4.0" } }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/esbuild": { "version": "0.16.15", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.15.tgz", @@ -1103,162 +1288,119 @@ } }, "node_modules/eslint": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.5.0.tgz", - "integrity": "sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.21.0.tgz", + "integrity": "sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg==", "dev": true, + "license": "MIT", "dependencies": { - "@eslint/eslintrc": "^1.0.5", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.21.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.1.0", - "espree": "^9.2.0", - "esquery": "^1.4.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.2.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": ">=4.0" - } - }, - "node_modules/eslint/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, @@ -1266,20 +1408,12 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -1287,20 +1421,12 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } @@ -1310,6 +1436,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -1327,19 +1454,21 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -1350,6 +1479,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1361,19 +1491,22 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", + "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", "dev": true, + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -1390,15 +1523,16 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/file-uri-to-path": { @@ -1408,10 +1542,11 @@ "optional": true }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1445,23 +1580,25 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "dev": true, + "license": "ISC" }, "node_modules/fs-constants": { "version": "1.0.0", @@ -1484,12 +1621,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "devOptional": true }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -1597,6 +1728,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -1605,39 +1737,24 @@ } }, "node_modules/globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz", + "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==", "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "license": "MIT" }, "node_modules/growl": { "version": "1.10.5", @@ -1709,10 +1826,11 @@ "optional": true }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -1727,10 +1845,11 @@ } }, "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -1747,6 +1866,7 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.19" } @@ -1823,6 +1943,7 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1858,6 +1979,7 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -1865,23 +1987,43 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -1933,34 +2075,24 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "devOptional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -2152,12 +2284,6 @@ "node": "*" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "node_modules/mocha/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -2174,9 +2300,10 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, "node_modules/multiline": { "version": "1.0.2", @@ -2285,13 +2412,8 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/needle": { "version": "2.9.1", @@ -2508,17 +2630,18 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" @@ -2593,6 +2716,7 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -2623,15 +2747,7 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -2858,6 +2974,7 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.8.0" } @@ -2883,15 +3000,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "optional": true }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -2903,10 +3011,11 @@ } }, "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -2929,7 +3038,8 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/randombytes": { "version": "2.1.0", @@ -3006,18 +3116,6 @@ "node": ">=8.10.0" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3032,6 +3130,7 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -3041,26 +3140,12 @@ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true, + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -3080,6 +3165,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -3114,13 +3200,11 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "devOptional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -3153,6 +3237,7 @@ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -3165,6 +3250,7 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -3220,15 +3306,6 @@ "simple-concat": "^1.0.0" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/smogon": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/smogon/-/smogon-3.0.0.tgz", @@ -3528,12 +3605,6 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "optional": true }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "node_modules/thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -3560,6 +3631,7 @@ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -3567,6 +3639,19 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/ts-chacha20": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/ts-chacha20/-/ts-chacha20-1.2.0.tgz", @@ -3579,27 +3664,6 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "optional": true }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -3617,6 +3681,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, @@ -3624,29 +3689,41 @@ "node": ">= 0.8.0" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.24.1.tgz", + "integrity": "sha512-cw3rEdzDqBs70TIcb0Gdzbt6h11BSs2pS0yaq7hDWDBtCCSei1pPSUXE9qUdQ/Wm9NgFg8mKtMt1b8fTHIl1jA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.24.1", + "@typescript-eslint/parser": "8.24.1", + "@typescript-eslint/utils": "8.24.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/uri-js": { @@ -3654,6 +3731,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } @@ -3664,12 +3742,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "optional": true }, - "node_modules/v8-compile-cache": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", - "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", - "dev": true - }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", @@ -3716,10 +3788,11 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -3803,12 +3876,6 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "devOptional": true - }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -3894,38 +3961,130 @@ "integrity": "sha512-t7/fOXBUKfigvhJLGKZ9TPHHgqNgpIpYaAbcXQk1X+fPeUG7x0tpAbXJ2wST9F/gJ02+CLETPMnhG7Tra2wqsQ==", "optional": true }, + "@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.4.3" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, + "@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true + }, + "@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "requires": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + } + }, + "@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.15" + } + }, "@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", + "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true + } } }, - "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "@eslint/js": { + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz", + "integrity": "sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==", + "dev": true + }, + "@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true + }, + "@eslint/plugin-kit": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", + "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" } }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true + }, + "@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "requires": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "dependencies": { + "@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true + } + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", "dev": true }, "@nodelib/fs.scandir": { @@ -3954,6 +4113,27 @@ "fastq": "^1.6.0" } }, + "@stylistic/eslint-plugin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-4.0.1.tgz", + "integrity": "sha512-RwKkRKiDrF4ptiur54ckDhOByQYKYZ1dEmI5K8BJCmuGpauFJXzVL1UQYTA2zq702CqMFdYiJcVFJWfokIgFxw==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "^8.23.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.2" + }, + "dependencies": { + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, "@types/better-sqlite3": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.3.tgz", @@ -3969,10 +4149,16 @@ "integrity": "sha512-cydYRiL/esxoLgtciH/YURNXsF/JUxEBoO5JakfH8r6F/jsXIM7FyD+Hmfbb2gnT7F/XKAL9NUlO9RPGw0ivvw==", "dev": true }, + "@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "@types/mime": { @@ -3982,9 +4168,9 @@ "dev": true }, "@types/node": { - "version": "14.18.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz", - "integrity": "sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ==", + "version": "14.18.63", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", + "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", "dev": true }, "@types/node-static": { @@ -4017,12 +4203,6 @@ "pg-types": "^2.2.0" } }, - "@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", - "dev": true - }, "@types/sockjs": { "version": "0.3.33", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", @@ -4042,101 +4222,119 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.48.0.tgz", - "integrity": "sha512-SVLafp0NXpoJY7ut6VFVUU9I+YeFsDzeQwtK0WZ+xbRN3mtxJ08je+6Oi2N89qDn087COdO0u3blKZNv9VetRQ==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.1.tgz", + "integrity": "sha512-ll1StnKtBigWIGqvYDVuDmXJHVH4zLVot1yQ4fJtLpL7qacwkxJc1T0bptqw+miBQ/QfUbhl1TcQ4accW5KUyA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/type-utils": "5.48.0", - "@typescript-eslint/utils": "5.48.0", - "debug": "^4.3.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/type-utils": "8.24.1", + "@typescript-eslint/utils": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" } }, "@typescript-eslint/parser": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.48.0.tgz", - "integrity": "sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.1.tgz", + "integrity": "sha512-Tqoa05bu+t5s8CTZFaGpCH2ub3QeT9YDkXbPd3uQ4SfsLoh1/vv2GEYAioPoxCWJJNsenXlC88tRjwoHNts1oQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/typescript-estree": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.48.0.tgz", - "integrity": "sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.1.tgz", + "integrity": "sha512-OdQr6BNBzwRjNEXMQyaGyZzgg7wzjYKfX2ZBV3E04hUCBDv3GQCHiz9RpqdUIiVrMgJGkXm3tcEh4vFSHreS2Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0" + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1" } }, "@typescript-eslint/type-utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.48.0.tgz", - "integrity": "sha512-vbtPO5sJyFjtHkGlGK4Sthmta0Bbls4Onv0bEqOGm7hP9h8UpRsHJwsrCiWtCUndTRNQO/qe6Ijz9rnT/DB+7g==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.1.tgz", + "integrity": "sha512-/Do9fmNgCsQ+K4rCz0STI7lYB4phTtEXqqCAs3gZW0pnK7lWNkvWd5iW545GSmApm4AzmQXmSqXPO565B4WVrw==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.48.0", - "@typescript-eslint/utils": "5.48.0", + "@typescript-eslint/typescript-estree": "8.24.1", + "@typescript-eslint/utils": "8.24.1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^2.0.1" } }, "@typescript-eslint/types": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.48.0.tgz", - "integrity": "sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.1.tgz", + "integrity": "sha512-9kqJ+2DkUXiuhoiYIUvIYjGcwle8pcPpdlfkemGvTObzgmYfJ5d0Qm6jwb4NBXP9W1I5tss0VIAnWFumz3mC5A==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.48.0.tgz", - "integrity": "sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.1.tgz", + "integrity": "sha512-UPyy4MJ/0RE648DSKQe9g0VDSehPINiejjA6ElqnFaFIhI6ZEiZAkUI0D5MCk0bQcTf/LVqZStvQ6K4lPn/BRg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/visitor-keys": "5.48.0", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/visitor-keys": "8.24.1", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "@typescript-eslint/utils": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.48.0.tgz", - "integrity": "sha512-x2jrMcPaMfsHRRIkL+x96++xdzvrdBCnYRd5QiW5Wgo1OB4kDYPbC1XjWP/TNqlfK93K/lUL92erq5zPLgFScQ==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.1.tgz", + "integrity": "sha512-OOcg3PMMQx9EXspId5iktsI3eMaXVwlhC8BvNnX6B5w9a4dVgpkQZuU8Hy67TolKcl+iFWq0XX+jbDGN4xWxjQ==", "dev": true, "requires": { - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.48.0", - "@typescript-eslint/types": "5.48.0", - "@typescript-eslint/typescript-estree": "5.48.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.24.1", + "@typescript-eslint/types": "8.24.1", + "@typescript-eslint/typescript-estree": "8.24.1" } }, "@typescript-eslint/visitor-keys": { - "version": "5.48.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.48.0.tgz", - "integrity": "sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==", + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.1.tgz", + "integrity": "sha512-EwVHlp5l+2vp8CoqJm9KikPZgi3gbdZAtabKT9KPShGeOcJhsv4Zdo3oc8T8I0uKEmYoU4ItyxbptjF08enaxg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.48.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "8.24.1", + "eslint-visitor-keys": "^4.2.0" } }, "@ungap/promise-all-settled": { @@ -4152,9 +4350,9 @@ "optional": true }, "acorn": { - "version": "8.8.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", - "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true }, "acorn-jsx": { @@ -4235,12 +4433,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -4313,12 +4505,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -4491,9 +4683,9 @@ "optional": true }, "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -4502,12 +4694,12 @@ } }, "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "requires": { - "ms": "2.1.2" + "ms": "^2.1.3" } }, "decamelize": { @@ -4560,30 +4752,12 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, "docopt": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/docopt/-/docopt-0.6.2.tgz", "integrity": "sha512-NqTbaYeE4gA/wU1hdKFdU+AFahpDOpgGLzHP42k6H6DKExJd0A55KEVWYhL9FEmHmgeLvEU2vuKXDuU+4yToOw==", "optional": true }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -4599,16 +4773,6 @@ "once": "^1.4.0" } }, - "enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - } - }, "esbuild": { "version": "0.16.15", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.15.tgz", @@ -4651,134 +4815,81 @@ "dev": true }, "eslint": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.5.0.tgz", - "integrity": "sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.21.0.tgz", + "integrity": "sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.0.5", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.21.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.0", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.1.0", - "espree": "^9.2.0", - "esquery": "^1.4.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.2.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - } + "optionator": "^0.9.3" } }, "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "requires": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } + "estraverse": "^5.2.0" } }, "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true }, "espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "requires": { - "acorn": "^8.8.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^4.2.0" } }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "requires": { "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, "esrecurse": { @@ -4788,20 +4899,12 @@ "dev": true, "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, "esutils": { @@ -4823,16 +4926,16 @@ "dev": true }, "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "dependencies": { "glob-parent": { @@ -4859,9 +4962,9 @@ "dev": true }, "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.0.tgz", + "integrity": "sha512-7SFSRCNjBQIZH/xZR3iy5iQYR8aGBE0h3VG6/cwlbrpdciNYBMotQav8c1XI3HjHH+NikUpP53nPdlZSdWmFzA==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -4876,12 +4979,12 @@ } }, "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "requires": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" } }, "file-uri-to-path": { @@ -4891,9 +4994,9 @@ "optional": true }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -4916,19 +5019,19 @@ "dev": true }, "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "flatted": "^3.2.9", + "keyv": "^4.5.4" } }, "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true }, "fs-constants": { @@ -4952,12 +5055,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "devOptional": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -5051,27 +5148,16 @@ } }, "globals": { - "version": "13.19.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", - "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz", + "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==", + "dev": true }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true }, "growl": { "version": "1.10.5", @@ -5117,9 +5203,9 @@ "optional": true }, "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true }, "ignore-walk": { @@ -5132,9 +5218,9 @@ } }, "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -5240,6 +5326,12 @@ "argparse": "^2.0.1" } }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -5252,6 +5344,15 @@ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -5296,15 +5397,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "devOptional": true, - "requires": { - "yallist": "^4.0.0" - } - }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -5312,12 +5404,12 @@ "dev": true }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, @@ -5466,12 +5558,6 @@ "brace-expansion": "^1.1.7" } }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -5484,9 +5570,9 @@ } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "multiline": { "version": "1.0.2", @@ -5577,12 +5663,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "needle": { "version": "2.9.1", "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", @@ -5756,9 +5836,9 @@ } }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "requires": { "deep-is": "^0.1.3", @@ -5766,7 +5846,7 @@ "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "word-wrap": "^1.2.5" } }, "os-homedir": { @@ -5842,12 +5922,6 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "permessage-deflate": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/permessage-deflate/-/permessage-deflate-0.1.7.tgz", @@ -6033,12 +6107,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "optional": true }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -6050,9 +6118,9 @@ } }, "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true }, "queue-microtask": { @@ -6128,12 +6196,6 @@ "picomatch": "^2.2.1" } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -6152,15 +6214,6 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6186,13 +6239,10 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "devOptional": true, - "requires": { - "lru-cache": "^6.0.0" - } + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "devOptional": true }, "seq-queue": { "version": "0.0.5", @@ -6252,12 +6302,6 @@ "simple-concat": "^1.0.0" } }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, "smogon": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/smogon/-/smogon-3.0.0.tgz", @@ -6508,12 +6552,6 @@ } } }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "thenify": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", @@ -6541,6 +6579,13 @@ "is-number": "^7.0.0" } }, + "ts-api-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "dev": true, + "requires": {} + }, "ts-chacha20": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/ts-chacha20/-/ts-chacha20-1.2.0.tgz", @@ -6552,21 +6597,6 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "optional": true }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -6585,17 +6615,22 @@ "prelude-ls": "^1.2.1" } }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "dev": true }, - "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true + "typescript-eslint": { + "version": "8.24.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.24.1.tgz", + "integrity": "sha512-cw3rEdzDqBs70TIcb0Gdzbt6h11BSs2pS0yaq7hDWDBtCCSei1pPSUXE9qUdQ/Wm9NgFg8mKtMt1b8fTHIl1jA==", + "dev": true, + "requires": { + "@typescript-eslint/eslint-plugin": "8.24.1", + "@typescript-eslint/parser": "8.24.1", + "@typescript-eslint/utils": "8.24.1" + } }, "uri-js": { "version": "4.4.1", @@ -6612,12 +6647,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "optional": true }, - "v8-compile-cache": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", - "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", - "dev": true - }, "websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", @@ -6652,9 +6681,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true }, "wordwrap": { @@ -6717,12 +6746,6 @@ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "devOptional": true - }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", diff --git a/package.json b/package.json index 63d8435c70..960f6e05b6 100644 --- a/package.json +++ b/package.json @@ -35,15 +35,14 @@ "start": "node pokemon-showdown start", "build": "node build", "tsc": "tsc", - "fast-lint": "eslint . --config .eslintrc-no-types.json --cache --cache-location .eslintcache-no-types --ext .js,.ts,.tsx", - "lint": "eslint . --cache --ext .js,.ts,.tsx --max-warnings 0", - "fix": "eslint . --cache --ext .js,.ts,.tsx --fix", + "lint": "eslint --cache", + "fix": "eslint --cache --fix", "full-lint": "npm run lint", "pretest": "npm run lint", "test": "mocha", "posttest": "npm run tsc", "full-test": "npm run lint && npm run tsc && mocha --timeout 8000 --forbid-only -g \".*\"", - "full-test-ci": "eslint --no-error-on-unmatched-pattern ${FILES} --max-warnings 0 && npm run tsc && (([ \"$SKIPSIMTESTS\" = true ] && mocha --timeout 8000 --forbid-only -g \".*\" --exclude \"test/{sim,random-battles}/**\") || mocha --timeout 8000 --forbid-only -g \".*\")", + "full-test-ci": "eslint --max-warnings 0 && tsc && (([ \"$SKIPSIMTESTS\" = true ] && mocha --timeout 8000 --forbid-only -g \".*\" --exclude \"test/{sim,random-battles}/**\") || mocha --timeout 8000 --forbid-only -g \".*\")", "postinstall": "npm run build postinstall" }, "bin": "./pokemon-showdown", @@ -66,19 +65,20 @@ ], "license": "MIT", "devDependencies": { + "@stylistic/eslint-plugin": "^4.0.1", "@types/better-sqlite3": "^7.6.2", "@types/cloud-env": "^0.2.2", - "@types/node": "^14.18.36", + "@types/node": "^14.18.63", "@types/node-static": "^0.7.7", "@types/nodemailer": "^6.4.4", "@types/pg": "^8.6.5", "@types/sockjs": "^0.3.33", "@types/sodium-native": "^2.3.9", - "@typescript-eslint/eslint-plugin": "^5.8.0", - "@typescript-eslint/parser": "^5.8.0", - "eslint": "8.5.0", + "eslint": "^9.21.0", + "globals": "^16.0.0", "mocha": "^8.2.0", "smogon": "^3.0.0", - "typescript": "^5.0.4" + "typescript": "^5.7.3", + "typescript-eslint": "^8.24.1" } } diff --git a/server/artemis/index.ts b/server/artemis/index.ts index e221ebadbd..5ad6b7442f 100644 --- a/server/artemis/index.ts +++ b/server/artemis/index.ts @@ -1,10 +1,10 @@ /** * @author mia-pi-git */ -import {LocalClassifier} from './local'; -import {RemoteClassifier} from './remote'; +import { LocalClassifier } from './local'; +import { RemoteClassifier } from './remote'; -export {LocalClassifier, RemoteClassifier}; +export { LocalClassifier, RemoteClassifier }; export function destroy() { void LocalClassifier.destroy(); diff --git a/server/artemis/local.ts b/server/artemis/local.ts index ff0be3a07d..b256acaf3c 100644 --- a/server/artemis/local.ts +++ b/server/artemis/local.ts @@ -5,9 +5,9 @@ */ import * as child_process from 'child_process'; -import {ProcessManager, Streams, Utils, Repl, FS} from '../../lib'; -import {Config} from '../config-loader'; -import {toID} from '../../sim/dex-data'; +import { ProcessManager, Streams, Utils, Repl, FS } from '../../lib'; +import { Config } from '../config-loader'; +import { toID } from '../../sim/dex-data'; class ArtemisStream extends Streams.ObjectReadWriteStream { tasks = new Set(); @@ -22,7 +22,7 @@ class ArtemisStream extends Streams.ObjectReadWriteStream { listen() { this.process.stdout.setEncoding('utf8'); this.process.stderr.setEncoding('utf8'); - this.process.stdout.on('data', (data) => { + this.process.stdout.on('data', data => { // so many bugs were created by \nready\n data = data.trim(); const [taskId, dataStr] = data.split("|"); diff --git a/server/artemis/remote.ts b/server/artemis/remote.ts index 707a7b2d2f..cbcf2016a9 100644 --- a/server/artemis/remote.ts +++ b/server/artemis/remote.ts @@ -2,9 +2,9 @@ * Code for using Google's Perspective API for filters. * @author mia-pi-git */ -import {ProcessManager, Net, Repl} from '../../lib'; -import {Config} from '../config-loader'; -import {toID} from '../../sim/dex-data'; +import { ProcessManager, Net, Repl } from '../../lib'; +import { Config } from '../config-loader'; +import { toID } from '../../sim/dex-data'; // 20m. this is mostly here so we can use Monitor.slow() const PM_TIMEOUT = 20 * 60 * 1000; @@ -19,11 +19,10 @@ export const ATTRIBUTES = { "FLIRTATION": {}, }; - export interface PerspectiveRequest { languages: string[]; requestedAttributes: AnyObject; - comment: {text: string}; + comment: { text: string }; } function time() { @@ -66,7 +65,7 @@ export const PM = new ProcessManager.QueryProcessManager { if (Config.crashguard) { @@ -137,11 +136,11 @@ export class RemoteClassifier { async suggestScore(text: string, data: Record) { if (!Config.perspectiveKey) return Promise.resolve(null); const body: AnyObject = { - comment: {text}, + comment: { text }, attributeScores: {}, }; for (const k in data) { - body.attributeScores[k] = {summaryScore: {value: data[k]}}; + body.attributeScores[k] = { summaryScore: { value: data[k] } }; } try { const raw = await Net(`https://commentanalyzer.googleapis.com/v1alpha1/comments:suggestscore`).post({ @@ -156,7 +155,7 @@ export class RemoteClassifier { }); return JSON.parse(raw); } catch (e: any) { - return {error: e.message}; + return { error: e.message }; } } destroy() { @@ -172,4 +171,3 @@ export class RemoteClassifier { return PM.processes.length; } } - diff --git a/server/chat-commands/admin.ts b/server/chat-commands/admin.ts index 3f11448f14..9d6c78d0a1 100644 --- a/server/chat-commands/admin.ts +++ b/server/chat-commands/admin.ts @@ -12,7 +12,7 @@ import * as path from 'path'; import * as child_process from 'child_process'; -import {FS, Utils, ProcessManager, SQL} from '../../lib'; +import { FS, Utils, ProcessManager, SQL } from '../../lib'; interface ProcessData { cmd: string; @@ -30,7 +30,7 @@ function bash(command: string, context: Chat.CommandContext, cwd?: string): Prom context.stafflog(`$ ${command}`); if (!cwd) cwd = FS.ROOT_PATH; return new Promise(resolve => { - child_process.exec(command, {cwd}, (error, stdout, stderr) => { + child_process.exec(command, { cwd }, (error, stdout, stderr) => { let log = `[o] ${stdout}[e] ${stderr}`; if (error) log = `[c] ${error.code}\n${log}`; context.stafflog(log); @@ -322,7 +322,7 @@ export const commands: Chat.ChatCommands = { this.checkCan('addhtml', null, room); if (!target) return this.parse("/help pminfobox"); - const {targetUser, rest: html} = this.requireUser(target); + const { targetUser, rest: html } = this.requireUser(target); this.checkHTML(html); this.checkPMHTML(targetUser); @@ -343,7 +343,7 @@ export const commands: Chat.ChatCommands = { this.checkCan('addhtml', null, room); if (!target) return this.parse("/help " + cmd); - const {targetUser, rest: html} = this.requireUser(target); + const { targetUser, rest: html } = this.requireUser(target); this.checkHTML(html); this.checkPMHTML(targetUser); @@ -458,7 +458,7 @@ export const commands: Chat.ChatCommands = { ], highlighthtmlpage(target, room, user) { - const {targetUser, rest} = this.requireUser(target); + const { targetUser, rest } = this.requireUser(target); let [pageid, title, highlight] = Utils.splitFirst(rest, ',', 2); pageid = `${user.id}-${toID(pageid)}`; @@ -530,7 +530,7 @@ export const commands: Chat.ChatCommands = { return errors.push(`${targetUser.name} [locked]`); } - if (!(targetUser.id in room!.users)) { + if (!(targetUser.id in room.users)) { return errors.push(`${targetUser.name} [not in room]`); } @@ -538,7 +538,6 @@ export const commands: Chat.ChatCommands = { targetUser.sendTo(room, `|${messageType}|${html}`); }); - if (successes.length) this.sendReply(`Sent private HTML to ${Chat.toListString(successes)}.`); if (errors.length) this.errorReply(`Unable to send private HTML to ${Chat.toListString(errors)}.`); @@ -551,12 +550,12 @@ export const commands: Chat.ChatCommands = { ], botmsg(target, room, user, connection) { - if (!target || !target.includes(',')) { + if (!target?.includes(',')) { return this.parse('/help botmsg'); } this.checkRecursion(); - let {targetUser, rest: message} = this.requireUser(target); + let { targetUser, rest: message } = this.requireUser(target); const auth = this.room ? this.room.auth : Users.globalAuth; if (!['*', '#'].includes(auth.get(targetUser))) { @@ -589,7 +588,7 @@ export const commands: Chat.ChatCommands = { const units = ["B", "KiB", "MiB", "GiB", "TiB"]; const results = resultNums.map(num => { const unitIndex = Math.floor(Math.log2(num) / 10); // 2^10 base log - return `${(num / Math.pow(2, 10 * unitIndex)).toFixed(2)} ${units[unitIndex]}`; + return `${(num / (2 ** (10 * unitIndex))).toFixed(2)} ${units[unitIndex]}`; }); this.sendReply(`||[Main process] RSS: ${results[0]}, Heap: ${results[1]} / ${results[2]}`); }, @@ -615,7 +614,7 @@ export const commands: Chat.ChatCommands = { target = toID(target); try { - Utils.clearRequireCache({exclude: ['/lib/process-manager']}); + Utils.clearRequireCache({ exclude: ['/lib/process-manager'] }); if (target === 'all') { if (lock['all']) { return this.errorReply(`Hot-patching all has been disabled by ${lock['all'].by} (${lock['all'].reason})`); @@ -671,7 +670,7 @@ export const commands: Chat.ChatCommands = { this.sendReply('Hotpatching processmanager prototypes...'); // keep references - const cache = {...require.cache}; + const cache = { ...require.cache }; Utils.clearRequireCache(); const newPM = require('../../lib/process-manager'); require.cache = cache; @@ -826,7 +825,7 @@ export const commands: Chat.ChatCommands = { this.sendReply("Hotpatching modlog..."); void Rooms.Modlog.database.destroy(); - const {mainModlog} = require('../modlog'); + const { mainModlog } = require('../modlog'); if (mainModlog.readyPromise) { this.sendReply("Waiting for the new SQLite database to be ready..."); await mainModlog.readyPromise; @@ -928,14 +927,14 @@ export const commands: Chat.ChatCommands = { const cwd = FS.ROOT_PATH; await new Promise(resolve => { - const child = child_process.exec('ps -o pid,%cpu,time,rss,command', {cwd}, (err, stdout) => { + const child = child_process.exec('ps -o pid,%cpu,time,rss,command', { cwd }, (err, stdout) => { if (err) throw err; const rows = stdout.split('\n').slice(1); // first line is the table header for (const row of rows) { if (!row.trim()) continue; const [pid, cpu, time, ram, ...rest] = row.split(' ').filter(Boolean); if (pid === `${child.pid}`) continue; // ignore this process - const entry: ProcessData = {cmd: rest.join(' ')}; + const entry: ProcessData = { cmd: rest.join(' ') }; // at the point of 0:00.[num], it's in so few seconds we don't care, so // we don't need to clutter the display if (time && !time.startsWith('0:00')) { @@ -945,7 +944,7 @@ export const commands: Chat.ChatCommands = { const ramNum = parseInt(ram); if (!isNaN(ramNum)) { const unitIndex = Math.floor(Math.log2(ramNum) / 10); // 2^10 base log - entry.ram = `${(ramNum / Math.pow(2, 10 * unitIndex)).toFixed(2)} ${ramUnits[unitIndex]}`; + entry.ram = `${(ramNum / (2 ** (10 * unitIndex))).toFixed(2)} ${ramUnits[unitIndex]}`; } processes.set(pid, entry); } @@ -1030,7 +1029,7 @@ export const commands: Chat.ChatCommands = { )).join('') + `\t}},\n` )).join('') + - `};\n`); + `};\n`); this.sendReply("learnsets.js saved."); }, savelearnsetshelp: [ @@ -1054,7 +1053,7 @@ export const commands: Chat.ChatCommands = { if (!parsed) { return this.errorReply(`Command "/${target}" is in an invalid format.`); } - const {handler, fullCmd} = parsed; + const { handler, fullCmd } = parsed; if (!handler) { return this.errorReply(`Command "/${target}" not found.`); } @@ -1368,7 +1367,6 @@ export const commands: Chat.ChatCommands = { target = toID(target); Monitor.updateServerLock = true; - let success = true; if (target === 'private') { if (!validPrivateCodePath) { @@ -1403,7 +1401,7 @@ export const commands: Chat.ChatCommands = { ['staff', 'development'], `|c|${user.getIdentity()}|/log ${user.name} used /updateloginserver - but something failed while updating.` ); - return this.errorReply(err.message + '\n' + err.stack); + return this.errorReply(`${err.message}\n${err.stack}`); } if (!result) return this.errorReply('No result received.'); this.stafflog(`[o] ${result.success || ""} [e] ${result.actionerror || ""}`); @@ -1436,7 +1434,7 @@ export const commands: Chat.ChatCommands = { ['staff', 'development'], `|c|${user.getIdentity()}|/log ${user.name} used /updateclient - but something failed while updating.` ); - return this.errorReply(err.message + '\n' + err.stack); + return this.errorReply(`${err.message}\n${err.stack}`); } if (!result) return this.errorReply('No result received.'); this.stafflog(`[o] ${result.success || ""} [e] ${result.actionerror || ""}`); @@ -1493,8 +1491,8 @@ export const commands: Chat.ChatCommands = { } const generateHTML = (direction: string, contents: string) => ( `
` + - Utils.escapeHTML(direction).repeat(2) + - ` ${Chat.getReadmoreCodeBlock(contents)}
` + Utils.escapeHTML(direction).repeat(2) + + ` 
${Chat.getReadmoreCodeBlock(contents)}
` ); this.sendReply(`|html|${generateHTML('>', target)}`); logRoom?.roomlog(`>> ${target}`); @@ -1550,7 +1548,7 @@ export const commands: Chat.ChatCommands = { const database = SQL(module, { file: `./databases/${db}.db`, onError(err) { - return {err: err.message, stack: err.stack}; + return { err: err.message, stack: err.stack }; }, }); function formatResult(result: any[] | string) { diff --git a/server/chat-commands/avatars.tsx b/server/chat-commands/avatars.tsx index e4719e6e2e..2ed91570dc 100644 --- a/server/chat-commands/avatars.tsx +++ b/server/chat-commands/avatars.tsx @@ -6,7 +6,7 @@ * @author Zarel */ -import {FS, Net} from "../../lib"; +import { FS, Net } from "../../lib"; const AVATARS_FILE = 'config/avatars.json'; @@ -38,7 +38,7 @@ interface AvatarEntry { default?: AvatarID | null; } -const customAvatars: {[userid: string]: AvatarEntry} = Object.create(null); +const customAvatars: { [userid: string]: AvatarEntry } = Object.create(null); try { const configAvatars = JSON.parse(FS(AVATARS_FILE).readSync()); @@ -46,13 +46,13 @@ try { } catch { if (Config.customavatars) { for (const userid in Config.customavatars) { - customAvatars[userid] = {allowed: [Config.customavatars[userid]]}; + customAvatars[userid] = { allowed: [Config.customavatars[userid]] }; } } if (Config.allowedavatars) { for (const avatar in Config.customavatars) { for (const userid of Config.customavatars[avatar]) { - if (!customAvatars[userid]) customAvatars[userid] = {allowed: [null]}; + if (!customAvatars[userid]) customAvatars[userid] = { allowed: [null] }; customAvatars[userid].allowed.push(avatar); } } @@ -63,7 +63,7 @@ if ((Config.customavatars && Object.keys(Config.customavatars).length) || Config Monitor.crashlog("Please remove 'customavatars' and 'allowedavatars' from Config (config/config.js). Your avatars have been migrated to the new '/addavatar' system."); } function saveCustomAvatars(instant?: boolean) { - FS(AVATARS_FILE).writeUpdate(() => JSON.stringify(customAvatars), {throttle: instant ? null : 60_000}); + FS(AVATARS_FILE).writeUpdate(() => JSON.stringify(customAvatars), { throttle: instant ? null : 60_000 }); } export const Avatars = new class { @@ -109,7 +109,7 @@ export const Avatars = new class { if (avatar.startsWith('#') && avatar.includes('.')) return avatar.slice(1); return avatar; } - async validate(avatar: string, options?: {rejectOfficial?: boolean}) { + async validate(avatar: string, options?: { rejectOfficial?: boolean }) { avatar = this.convert(avatar); if (!/^#?[a-z0-9-]+$/.test(avatar) && !/^[a-z0-9.-]+$/.test(avatar)) { throw new Chat.ErrorMessage(`Avatar "${avatar}" is not in a valid format. ${AVATAR_FORMATS_MESSAGE}`); @@ -126,7 +126,7 @@ export const Avatars = new class { const src = Avatars.src(avatar); if (!src) return {avatar}; return {noAlt; } getDefault(userid: ID) { @@ -141,7 +141,7 @@ export const Avatars = new class { /** does not include validation */ setDefault(userid: ID, avatar: AvatarID | null) { if (avatar === this.getDefault(userid)) return; - if (!customAvatars[userid]) customAvatars[userid] = {allowed: [null]}; + if (!customAvatars[userid]) customAvatars[userid] = { allowed: [null] }; const entry = customAvatars[userid]; if (avatar === entry.allowed[0]) { @@ -152,7 +152,7 @@ export const Avatars = new class { saveCustomAvatars(); } addAllowed(userid: ID, avatar: AvatarID | null) { - if (!customAvatars[userid]) customAvatars[userid] = {allowed: [null]}; + if (!customAvatars[userid]) customAvatars[userid] = { allowed: [null] }; if (customAvatars[userid].allowed.includes(avatar)) return false; @@ -174,7 +174,7 @@ export const Avatars = new class { return true; } addPersonal(userid: ID, avatar: AvatarID | null) { - if (!customAvatars[userid]) customAvatars[userid] = {allowed: [null]}; + if (!customAvatars[userid]) customAvatars[userid] = { allowed: [null] }; const entry = customAvatars[userid]; if (entry.allowed.includes(avatar)) return false; @@ -751,10 +751,11 @@ export const commands: Chat.ChatCommands = {

Custom avatars from account {id}:

, allowed.filter(Boolean).map(avatar => (

- {hasButton ? - : + {hasButton ? ( + + ) : ( Avatars.img(avatar!) - } {} + )} {} /avatar {avatar!.replace('#', '')}

)) @@ -811,7 +812,7 @@ export const commands: Chat.ChatCommands = { throw new Chat.ErrorMessage(`"${inputUsername}" is not a valid username.`); } const userid = toID(inputUsername); - const avatar = await Avatars.validate(inputAvatar, {rejectOfficial: true}); + const avatar = await Avatars.validate(inputAvatar, { rejectOfficial: true }); if (!Avatars.addPersonal(userid, avatar)) { throw new Chat.ErrorMessage(`User "${inputUsername}" can already use avatar "${avatar}".`); @@ -834,7 +835,7 @@ export const commands: Chat.ChatCommands = { throw new Chat.ErrorMessage(`"${inputUsername}" is not a valid username.`); } const userid = toID(inputUsername); - const avatar = await Avatars.validate(inputAvatar, {rejectOfficial: true}); + const avatar = await Avatars.validate(inputAvatar, { rejectOfficial: true }); if (!Avatars.addAllowed(userid, avatar)) { throw new Chat.ErrorMessage(`User "${inputUsername}" can already use avatar "${avatar}".`); @@ -925,7 +926,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`That user has no avatars.`); } const existing = customAvatars[to]?.allowed.filter(Boolean); - customAvatars[to] = {...customAvatars[from]}; + customAvatars[to] = { ...customAvatars[from] }; delete customAvatars[from]; if (existing) { for (const avatar of existing) { diff --git a/server/chat-commands/core.ts b/server/chat-commands/core.ts index a58d348c61..1849433cc7 100644 --- a/server/chat-commands/core.ts +++ b/server/chat-commands/core.ts @@ -14,11 +14,11 @@ */ /* eslint no-else-return: "error" */ -import {Utils} from '../../lib'; -import type {UserSettings} from '../users'; -import type {GlobalPermission, RoomPermission} from '../user-groups'; +import { Utils } from '../../lib'; +import type { UserSettings } from '../users'; +import type { GlobalPermission, RoomPermission } from '../user-groups'; -export const crqHandlers: {[k: string]: Chat.CRQHandler} = { +export const crqHandlers: { [k: string]: Chat.CRQHandler } = { userdetails(target, user, trustable) { if (target.length > 18) { return null; @@ -33,8 +33,8 @@ export const crqHandlers: {[k: string]: Chat.CRQHandler} = { rooms: false, }; } - interface RoomData {p1?: string; p2?: string; isPrivate?: boolean | 'hidden' | 'voice'} - let roomList: {[roomid: string]: RoomData} | false = {}; + interface RoomData { p1?: string; p2?: string; isPrivate?: boolean | 'hidden' | 'voice' } + let roomList: { [roomid: string]: RoomData } | false = {}; for (const roomid of targetUser.inRooms) { const targetRoom = Rooms.get(roomid); if (!targetRoom) continue; // shouldn't happen @@ -65,7 +65,7 @@ export const crqHandlers: {[k: string]: Chat.CRQHandler} = { userid: targetUser.id, name: targetUser.name, avatar: targetUser.avatar, - group: group, + group, customgroup: sectionleader ? "Section Leader" : undefined, autoconfirmed: targetUser.autoconfirmed ? true : undefined, status: targetUser.getStatus() || undefined, @@ -75,7 +75,7 @@ export const crqHandlers: {[k: string]: Chat.CRQHandler} = { }, roomlist(target, user, trustable) { if (!trustable) return false; - return {rooms: Rooms.global.getBattles(target)}; + return { rooms: Rooms.global.getBattles(target) }; }, rooms(target, user, trustable) { if (!trustable) return false; @@ -96,7 +96,7 @@ export const crqHandlers: {[k: string]: Chat.CRQHandler} = { if (!targetRoom || ( targetRoom.settings.isPrivate && !user.inRooms.has(targetRoom.roomid) && !user.games.has(targetRoom.roomid) )) { - const roominfo = {id: target, error: 'not found or access denied'}; + const roominfo = { id: target, error: 'not found or access denied' }; return roominfo; } let visibility; @@ -111,7 +111,7 @@ export const crqHandlers: {[k: string]: Chat.CRQHandler} = { roomid: targetRoom.roomid, title: targetRoom.title, type: targetRoom.type, - visibility: visibility, + visibility, modchat: targetRoom.settings.modchat, modjoin: targetRoom.settings.modjoin, auth: {}, @@ -269,7 +269,7 @@ export const commands: Chat.ChatCommands = { noreply(target, room, user) { if (!target.startsWith('/')) return this.parse('/help noreply'); - return this.parse(target, {isQuiet: true}); + return this.parse(target, { isQuiet: true }); }, noreplyhelp: [`/noreply [command] - Runs the command without displaying the response.`], @@ -307,7 +307,7 @@ export const commands: Chat.ChatCommands = { if (message.trim().startsWith('/msgroom ')) { return this.errorReply(`Please do not nest /msgroom inside itself.`); } - const subcontext = new Chat.CommandContext({room: targetRoom, message, user, connection}); + const subcontext = new Chat.CommandContext({ room: targetRoom, message, user, connection }); await subcontext.parse(); }, msgroomhelp: [`/msgroom [room], [command] - Runs the [command] in the given [room].`], @@ -333,7 +333,7 @@ export const commands: Chat.ChatCommands = { } this.checkRecursion(); - const {targetUser, targetUsername, rest: message} = this.splitUser(target); + const { targetUser, targetUsername, rest: message } = this.splitUser(target); if (targetUsername === '~') { this.pmTarget = null; this.room = null; @@ -495,7 +495,7 @@ export const commands: Chat.ChatCommands = { } else if (target === 'autoconfirmed' || target === 'trusted' || target === 'unlocked') { if (!isOffline) user.settings.blockPMs = target; target = this.tr(target); - this.sendReply(this.tr `You are now blocking ${msg}private messages, except from staff and ${target} users.`); + this.sendReply(this.tr`You are now blocking ${msg}private messages, except from staff and ${target} users.`); } else if (target === 'friends') { if (!isOffline) user.settings.blockPMs = target; this.sendReply(this.tr`You are now blocking ${msg}private messages, except from staff and friends.`); @@ -533,6 +533,7 @@ export const commands: Chat.ChatCommands = { if (isOffline) { await Chat.PrivateMessages.deleteSettings(user.id); } else { + // eslint-disable-next-line require-atomic-updates user.settings.blockPMs = false; } user.update(); @@ -594,7 +595,7 @@ export const commands: Chat.ChatCommands = { }, statushelp: [ `/status [note] - Sets a short note as your status, visible when users click your username.`, - `Use /clearstatus to clear your status message.`, + `Use /clearstatus to clear your status message.`, ], donotdisturb: 'busy', @@ -876,7 +877,7 @@ export const commands: Chat.ChatCommands = { } const formatid = target.slice(formatIndex + 12, nextQuoteIndex); - const battleRoom = Rooms.createBattle({format: formatid, players: [], inputLog: target}); + const battleRoom = Rooms.createBattle({ format: formatid, players: [], inputLog: target }); if (!battleRoom) return; // createBattle will inform the user if creating the battle failed battleRoom.auth.set(user.id, Users.HOST_SYMBOL); @@ -905,10 +906,8 @@ export const commands: Chat.ChatCommands = { if (!showAll) { const parsed = parseInt(target); if (isNaN(parsed)) { - const matchedSet = team.filter(set => { - const id = toID(target); - return toID(set.name) === id || toID(set.species) === id; - })[0]; + const id = toID(target); + const matchedSet = team.find(set => toID(set.name) === id || toID(set.species) === id); if (!matchedSet) return this.errorReply(this.tr`You don't have a Pokémon matching "${target}" in your team.`); team = [matchedSet]; } else { @@ -921,7 +920,7 @@ export const commands: Chat.ChatCommands = { } } - let resultString = Utils.escapeHTML(Teams.export(team, {hideStats})); + let resultString = Utils.escapeHTML(Teams.export(team, { hideStats })); if (showAll) { resultString = `
${this.tr`View team`}${resultString}
`; } @@ -1172,7 +1171,7 @@ export const commands: Chat.ChatCommands = { this.checkCan('joinbattle', null, room); - const {targetUser, targetUsername: name, rest: slot} = this.splitUser(target, {exactName: true}); + const { targetUser, targetUsername: name, rest: slot } = this.splitUser(target, { exactName: true }); if (slot !== 'p1' && slot !== 'p2' && slot !== 'p3' && slot !== 'p4') { this.errorReply(this.tr`Player must be set to "p1" or "p2", not "${slot}".`); return this.parse('/help addplayer'); @@ -1340,12 +1339,12 @@ export const commands: Chat.ChatCommands = { if (room.battle.challengeType === 'tour' || room.battle.rated) { return this.errorReply(this.tr`You can only do this in unrated non-tour battles.`); } - const {targetUser, rest: reason} = this.requireUser(target, {allowOffline: true}); + const { targetUser, rest: reason } = this.requireUser(target, { allowOffline: true }); this.checkCan('kick', targetUser, room); if (room.battle.leaveGame(targetUser)) { const displayReason = reason ? ` (${reason})` : ``; this.addModAction(room.tr`${targetUser.name} was kicked from a battle by ${user.name}.${displayReason}`); - this.modlog('KICKBATTLE', targetUser, reason, {noip: 1, noalts: 1}); + this.modlog('KICKBATTLE', targetUser, reason, { noip: 1, noalts: 1 }); } else { this.errorReply("/kickbattle - User isn't in battle."); } @@ -1488,7 +1487,7 @@ export const commands: Chat.ChatCommands = { chall: 'challenge', challenge(target, room, user, connection) { - const {targetUser, targetUsername, rest: formatName} = this.splitUser(target); + const { targetUser, targetUsername, rest: formatName } = this.splitUser(target); if (!targetUser?.connected) { return this.popupReply(this.tr`The user '${targetUsername}' was not found.`); } @@ -1553,7 +1552,7 @@ export const commands: Chat.ChatCommands = { ], cchall: 'cancelchallenge', cancelchallenge(target, room, user, connection) { - const {targetUser, targetUsername, rest} = this.splitUser(target); + const { targetUser, targetUsername, rest } = this.splitUser(target); if (rest) return this.popupReply(this.tr`This command does not support specifying multiple users`); this.pmTarget = targetUser || this.pmTarget; if (!this.pmTarget) return this.popupReply(this.tr`User "${targetUsername}" not found.`); @@ -1572,7 +1571,7 @@ export const commands: Chat.ChatCommands = { ], async accept(target, room, user, connection) { - const {targetUser, targetUsername, rest} = this.splitUser(target); + const { targetUser, targetUsername, rest } = this.splitUser(target); if (rest) return this.popupReply(this.tr`This command does not support specifying multiple users`); this.pmTarget = targetUser || this.pmTarget; if (!this.pmTarget) return this.popupReply(this.tr`User "${targetUsername}" not found.`); @@ -1594,7 +1593,7 @@ export const commands: Chat.ChatCommands = { accepthelp: [`/accept [user] - Accepts a challenge from the given user.`], reject(target, room, user, connection) { - const {targetUser, targetUsername, rest} = this.splitUser(target); + const { targetUser, targetUsername, rest } = this.splitUser(target); if (rest) return this.popupReply(this.tr`This command does not support specifying multiple users`); this.pmTarget = targetUser || this.pmTarget; if (!this.pmTarget) return this.popupReply(this.tr`User "${targetUsername}" not found.`); @@ -1627,7 +1626,7 @@ export const commands: Chat.ChatCommands = { const format = originalFormat.effectType === 'Format' ? originalFormat : Dex.formats.get('Anything Goes'); if (format.effectType !== 'Format') return this.popupReply(this.tr`Please provide a valid format.`); - return TeamValidatorAsync.get(format.id).validateTeam(user.battleSettings.team, {user: user.id}).then(result => { + return TeamValidatorAsync.get(format.id).validateTeam(user.battleSettings.team, { user: user.id }).then(result => { const matchMessage = (originalFormat === format ? "" : this.tr`The format '${originalFormat.name}' was not found.`); if (result.startsWith('1')) { connection.popup(`${(matchMessage ? matchMessage + "\n\n" : "")}${this.tr`Your team is valid for ${format.name}.`}`); @@ -1673,7 +1672,7 @@ export const commands: Chat.ChatCommands = { const handler = Chat.crqHandlers[cmd]; if (!handler) return connection.send(`|queryresponse|${cmd}|null`); let data = handler.call(this, target, user, trustable); - if (data && data.then) data = await data; + if (data?.then) data = await data; connection.send(`|queryresponse|${cmd}|${JSON.stringify(data)}`); }, @@ -1824,6 +1823,6 @@ process.nextTick(() => { }); export const loginfilter: Chat.LoginFilter = user => { - if (!Chat.PrivateMessages.checkCanUse(user, {isLogin: true, forceBool: true})) return; + if (!Chat.PrivateMessages.checkCanUse(user, { isLogin: true, forceBool: true })) return; void Chat.PrivateMessages.sendReceived(user); }; diff --git a/server/chat-commands/info.ts b/server/chat-commands/info.ts index d4e840f4dd..97cd2984d2 100644 --- a/server/chat-commands/info.ts +++ b/server/chat-commands/info.ts @@ -9,16 +9,16 @@ * @license MIT */ import * as net from 'net'; -import {YouTube, Twitch} from '../chat-plugins/youtube'; -import {Net, Utils} from '../../lib'; -import {RoomSections} from './room-settings'; +import { YouTube, Twitch } from '../chat-plugins/youtube'; +import { Net, Utils } from '../../lib'; +import { RoomSections } from './room-settings'; const ONLINE_SYMBOL = ` \u25C9 `; const OFFLINE_SYMBOL = ` \u25CC `; interface DexResources { url: string; - resources: {resource_name: string, url: string}[]; + resources: { resource_name: string, url: string }[]; } export function getCommonBattles( @@ -46,7 +46,7 @@ export function findFormats(targetId: string, isOMSearch = false) { const formatList = exactFormat.exists ? [exactFormat] : Dex.formats.all(); // Filter formats and group by section - const sections: {[k: string]: {name: string, formats: ID[]}} = {}; + const sections: { [k: string]: { name: string, formats: ID[] } } = {}; let totalMatches = 0; for (const format of formatList) { const sectionId = toID(format.section); @@ -65,11 +65,11 @@ export function findFormats(targetId: string, isOMSearch = false) { } } totalMatches++; - if (!sections[sectionId]) sections[sectionId] = {name: format.section!, formats: []}; + if (!sections[sectionId]) sections[sectionId] = { name: format.section!, formats: [] }; sections[sectionId].formats.push(format.id); } } - return {totalMatches, sections}; + return { totalMatches, sections }; } export const formatsDataCache = new Map(); @@ -106,7 +106,7 @@ export const commands: Chat.ChatCommands = { profile: 'whois', whois(target, room, user, connection, cmd) { if (room?.roomid === 'staff' && !this.runBroadcast()) return; - const targetUser = this.getUserOrSelf(target, {exactName: user.tempGroup === ' '}); + const targetUser = this.getUserOrSelf(target, { exactName: user.tempGroup === ' ' }); const showAll = (cmd === 'ip' || cmd === 'whoare' || cmd === 'alt' || cmd === 'alts' || cmd === 'altsnorecurse'); const showRecursiveAlts = showAll && (cmd !== 'altsnorecurse'); if (!targetUser) { @@ -268,7 +268,7 @@ export const commands: Chat.ChatCommands = { const punishments = Punishments.ips.get(ip); if (user.can('alts') && punishments) { for (const punishment of punishments) { - const {type, id} = punishment; + const { type, id } = punishment; let punishMsg = Punishments.punishmentTypes.get(type)?.desc || type; if (id !== targetUser.id) punishMsg += ` as ${id}`; status.push(punishMsg); @@ -316,17 +316,17 @@ export const commands: Chat.ChatCommands = { } if (canViewPunishments) { - const punishments = Punishments.getRoomPunishments(targetUser, {checkIps: true}); + const punishments = Punishments.getRoomPunishments(targetUser, { checkIps: true }); if (punishments.length) { buf += `
Room punishments: `; buf += punishments.map(([curRoom, curPunishment]) => { - const {type: punishType, id: punishUserid, expireTime, reason} = curPunishment; + const { type: punishType, id: punishUserid, expireTime, reason } = curPunishment; let punishDesc = Punishments.roomPunishmentTypes.get(punishType)?.desc || punishType; if (punishUserid !== targetUser.id) punishDesc += ` as ${punishUserid}`; const expiresIn = new Date(expireTime).getTime() - Date.now(); - const expireString = Chat.toDurationString(expiresIn, {precision: 1}); + const expireString = Chat.toDurationString(expiresIn, { precision: 1 }); punishDesc += ` for ${expireString}`; if (reason) punishDesc += `: ${reason}`; @@ -380,7 +380,7 @@ export const commands: Chat.ChatCommands = { const idPunishments = Punishments.userids.get(userid); if (idPunishments) { for (const p of idPunishments) { - const {type: punishType, id: punishUserid, reason} = p; + const { type: punishType, id: punishUserid, reason } = p; if (!user.can('alts') && !['LOCK', 'BAN'].includes(punishType)) continue; const punishDesc = (Punishments.punishmentTypes.get(punishType)?.desc || punishType); buf += `${punishDesc}: ${punishUserid}`; @@ -399,17 +399,17 @@ export const commands: Chat.ChatCommands = { } } - const punishments = Punishments.getRoomPunishments(targetUser || {id: userid} as User); + const punishments = Punishments.getRoomPunishments(targetUser || { id: userid } as User); if (punishments?.length) { buf += `
Room punishments: `; buf += punishments.map(([curRoom, curPunishment]) => { - const {type: punishType, id: punishUserid, expireTime, reason} = curPunishment; + const { type: punishType, id: punishUserid, expireTime, reason } = curPunishment; let punishDesc = Punishments.roomPunishmentTypes.get(punishType)?.desc || punishType; if (punishUserid !== userid) punishDesc += ` as ${punishUserid}`; const expiresIn = new Date(expireTime).getTime() - Date.now(); - const expireString = Chat.toDurationString(expiresIn, {precision: 1}); + const expireString = Chat.toDurationString(expiresIn, { precision: 1 }); punishDesc += ` for ${expireString}`; if (reason) punishDesc += `: ${reason}`; @@ -471,7 +471,7 @@ export const commands: Chat.ChatCommands = { this.checkCan('alts'); target = target.trim(); if (!net.isIPv4(target)) return this.errorReply('You must pass a valid IPv4 IP to /host.'); - const {dnsbl, host, hostType} = await IPTools.lookup(target); + const { dnsbl, host, hostType } = await IPTools.lookup(target); const dnsblMessage = dnsbl ? ` [${dnsbl}]` : ``; this.sendReply(`IP ${target}: ${host || "ERROR"} [${hostType}]${dnsblMessage}`); }, @@ -541,9 +541,9 @@ export const commands: Chat.ChatCommands = { this.errorReply(`This command must be broadcast:`); return this.parse(`/help checkchallenges`); } - if (!target || !target.includes(',')) return this.parse(`/help checkchallenges`); - const {targetUser: user1, rest} = this.requireUser(target); - const {targetUser: user2, rest: rest2} = this.requireUser(rest); + if (!target?.includes(',')) return this.parse(`/help checkchallenges`); + const { targetUser: user1, rest } = this.requireUser(target); + const { targetUser: user2, rest: rest2 } = this.requireUser(rest); if (user1 === user2 || rest2) return this.parse(`/help checkchallenges`); if (!(user1.id in room.users) || !(user2.id in room.users)) { return this.errorReply(`Both users must be in this room.`); @@ -585,7 +585,7 @@ export const commands: Chat.ChatCommands = { const gen = parseInt(cmd.substr(-1)); if (gen) target += `, gen${gen}`; - const {dex, format, targets} = this.splitFormat(target, true, true); + const { dex, format, targets } = this.splitFormat(target, true, true); let buffer = ''; target = targets.join(','); @@ -602,7 +602,7 @@ export const commands: Chat.ChatCommands = { } const newTargets = dex.dataSearch(target); const showDetails = (cmd.startsWith('dt') || cmd === 'details'); - if (!newTargets || !newTargets.length) { + if (!newTargets?.length) { return this.errorReply(`No Pok\u00e9mon, item, move, ability or nature named '${target}' was found${Dex.gen > dex.gen ? ` in Gen ${dex.gen}` : ""}. (Check your spelling?)`); } @@ -610,7 +610,7 @@ export const commands: Chat.ChatCommands = { if (newTarget.isInexact && !i) { buffer = `No Pok\u00e9mon, item, move, ability or nature named '${target}' was found${Dex.gen > dex.gen ? ` in Gen ${dex.gen}` : ""}. Showing the data of '${newTargets[0].name}' instead.\n`; } - let details: {[k: string]: string} = {}; + let details: { [k: string]: string } = {}; switch (newTarget.searchType) { case 'nature': const nature = Dex.natures.get(newTarget.name); @@ -624,7 +624,7 @@ export const commands: Chat.ChatCommands = { case 'pokemon': let pokemon = dex.species.get(newTarget.name); if (format?.onModifySpecies) { - pokemon = format.onModifySpecies.call({dex, clampIntRange: Utils.clampIntRange, toID} as Battle, pokemon) || pokemon; + pokemon = format.onModifySpecies.call({ dex, clampIntRange: Utils.clampIntRange, toID } as Battle, pokemon) || pokemon; } let tierDisplay = room?.settings.dataCommandTierDisplay; if (!tierDisplay && room?.battle) { @@ -774,7 +774,7 @@ export const commands: Chat.ChatCommands = { } else if (move.zMove?.basePower) { details["Z-Power"] = String(move.zMove.basePower); } else if (move.zMove?.effect) { - const zEffects: {[k: string]: string} = { + const zEffects: { [k: string]: string } = { clearnegativeboost: "Restores negative stat stages to 0", crit2: "Crit ratio +2", heal: "Restores HP 100%", @@ -786,7 +786,7 @@ export const commands: Chat.ChatCommands = { } else if (move.zMove?.boost) { details["Z-Effect"] = ""; const boost = move.zMove.boost; - const stats: {[k in BoostID]: string} = { + const stats: { [k in BoostID]: string } = { atk: 'Attack', def: 'Defense', spa: 'Sp. Atk', spd: 'Sp. Def', spe: 'Speed', accuracy: 'Accuracy', evasion: 'Evasiveness', }; let h: BoostID; @@ -813,7 +813,7 @@ export const commands: Chat.ChatCommands = { details["Dynamax Power"] = String(move.maxMove.basePower); } - const targetTypes: {[k: string]: string} = { + const targetTypes: { [k: string]: string } = { normal: "One Adjacent Pok\u00e9mon", self: "User", adjacentAlly: "One Ally", @@ -902,7 +902,7 @@ export const commands: Chat.ChatCommands = { weakness(target, room, user) { if (!target) return this.parse('/help weakness'); if (!this.runBroadcast()) return; - const {format, dex, targets} = this.splitFormat(target.split(/[,/]/).map(toID)); + const { format, dex, targets } = this.splitFormat(target.split(/[,/]/).map(toID)); let isInverse = false; if (format && Dex.formats.getRuleTable(format).has('inversemod')) { @@ -1025,7 +1025,7 @@ export const commands: Chat.ChatCommands = { } } - const statuses: {[k: string]: string} = { + const statuses: { [k: string]: string } = { brn: "Burn", frz: "Frozen", hail: "Hail damage", @@ -1062,7 +1062,7 @@ export const commands: Chat.ChatCommands = { type: 'effectiveness', matchup: 'effectiveness', effectiveness(target, room, user) { - const {dex, targets} = this.splitFormat(target.split(/[,/]/)); + const { dex, targets } = this.splitFormat(target.split(/[,/]/)); if (targets.length !== 2) return this.errorReply("Attacker and defender must be separated with a comma."); let searchMethods = ['types', 'moves', 'species']; @@ -1098,7 +1098,7 @@ export const commands: Chat.ChatCommands = { defender = foundData; defName = `${foundData.name} (not counting abilities)`; } else { - defender = {types: [foundData.name]}; + defender = { types: [foundData.name] }; defName = foundData.name; } searchMethods = sourceMethods; @@ -1114,11 +1114,11 @@ export const commands: Chat.ChatCommands = { if (source.effectType !== 'Move' || source.category !== 'Status' && (source.basePower || source.basePowerCallback)) { for (const type of defender.types) { const baseMod = dex.getEffectiveness(source, type); - const moveMod = source.onEffectiveness?.call({dex: Dex} as Battle, baseMod, null, type, source); + const moveMod = source.onEffectiveness?.call({ dex: Dex } as Battle, baseMod, null, type, source); totalTypeMod += typeof moveMod === 'number' ? moveMod : baseMod; } } - factor = Math.pow(2, totalTypeMod); + factor = 2 ** totalTypeMod; } const hasThousandArrows = source.id === 'thousandarrows' && defender.types.includes('Flying'); @@ -1136,10 +1136,10 @@ export const commands: Chat.ChatCommands = { if (!this.runBroadcast()) return; if (!target) return this.parse("/help coverage"); - const {dex, targets} = this.splitFormat(target.split(/[,+/]/)); + const { dex, targets } = this.splitFormat(target.split(/[,+/]/)); const sources: (string | Move)[] = []; let dispTable = false; - const bestCoverage: {[k: string]: number} = {}; + const bestCoverage: { [k: string]: number } = {}; let hasThousandArrows = false; for (const type of dex.types.names()) { @@ -1190,7 +1190,7 @@ export const commands: Chat.ChatCommands = { } else { if (!dex.getImmunity(move.type, type) && !move.ignoreImmunity) continue; const baseMod = dex.getEffectiveness(move, type); - const moveMod = move.onEffectiveness?.call({dex} as Battle, baseMod, null, type, move as ActiveMove); + const moveMod = move.onEffectiveness?.call({ dex } as Battle, baseMod, null, type, move as ActiveMove); eff = typeof moveMod === 'number' ? moveMod : baseMod; } if (eff > bestCoverage[type]) bestCoverage[type] = eff; @@ -1205,7 +1205,7 @@ export const commands: Chat.ChatCommands = { bestCoverage[type] = 0; continue; } - bestCoverage[type] = Math.pow(2, bestCoverage[type]); + bestCoverage[type] = 2 ** bestCoverage[type]; } if (!dispTable) { @@ -1234,7 +1234,7 @@ export const commands: Chat.ChatCommands = { return this.sendReplyBox(buffer.join('
')); } else { let buffer = '
'; - const icon: {[k: string]: string} = {}; + const icon: { [k: string]: string } = {}; for (const type of dex.types.names()) { icon[type] = ``; // row of icons at top @@ -1269,10 +1269,10 @@ export const commands: Chat.ChatCommands = { continue; } let baseMod = dex.getEffectiveness(move.type, type1); - let moveMod = move.onEffectiveness?.call({dex} as Battle, baseMod, null, type1, move as ActiveMove); + let moveMod = move.onEffectiveness?.call({ dex } as Battle, baseMod, null, type1, move as ActiveMove); curEff += typeof moveMod === 'number' ? moveMod : baseMod; baseMod = dex.getEffectiveness(move.type, type2); - moveMod = move.onEffectiveness?.call({dex} as Battle, baseMod, null, type2, move as ActiveMove); + moveMod = move.onEffectiveness?.call({ dex } as Battle, baseMod, null, type2, move as ActiveMove); curEff += typeof moveMod === 'number' ? moveMod : baseMod; } @@ -1281,7 +1281,7 @@ export const commands: Chat.ChatCommands = { if (bestEff === -5) { bestEff = 0; } else { - bestEff = Math.pow(2, bestEff); + bestEff = 2 ** bestEff; } } if (bestEff === 0) { @@ -1552,7 +1552,7 @@ export const commands: Chat.ChatCommands = { if (ev < 0) iv += ev; ev *= 4; if (iv < 0 || ev > 255) { - return this.sendReplyBox('No valid EV/IV combination possible with given parameters. Maybe try a different nature?' + ev); + return this.sendReplyBox(`No valid EV/IV combination possible with given parameters. Maybe try a different nature?${ev}`); } } else { return this.sendReplyBox('Too many parameters given; nothing to calculate.'); @@ -1592,13 +1592,13 @@ export const commands: Chat.ChatCommands = { let uptimeText; if (uptime > 24 * 60 * 60) { const uptimeDays = Math.floor(uptime / (24 * 60 * 60)); - uptimeText = uptimeDays + " " + (uptimeDays === 1 ? "day" : "days"); + uptimeText = `${uptimeDays} ${uptimeDays === 1 ? "day" : "days"}`; const uptimeHours = Math.floor(uptime / (60 * 60)) - uptimeDays * 24; - if (uptimeHours) uptimeText += ", " + uptimeHours + " " + (uptimeHours === 1 ? "hour" : "hours"); + if (uptimeHours) uptimeText += `, ${uptimeHours} ${uptimeHours === 1 ? "hour" : "hours"}`; } else { uptimeText = Chat.toDurationString(uptime * 1000); } - this.sendReplyBox("Uptime: " + uptimeText + ""); + this.sendReplyBox(`Uptime: ${uptimeText}`); }, uptimehelp: [`/uptime - Shows how long the server has been online for.`], @@ -1674,8 +1674,8 @@ export const commands: Chat.ChatCommands = { const indefinitePunishments = [ this.tr`Indefinite global punishments:`, this.tr`permalock - Issued for repeated instances of bad behavior and is rarely the result of a single action. ` + - this.tr`These can be appealed in the Discipline Appeal` + - this.tr` forum after at least 3 months without incident.`, + this.tr`These can be appealed in the Discipline Appeal` + + this.tr` forum after at least 3 months without incident.`, this.tr`permaban - Unappealable global ban typically issued for the most severe cases of offensive/inappropriate behavior.`, ]; @@ -1826,7 +1826,7 @@ export const commands: Chat.ChatCommands = { room.battle.format.endsWith('randomdoublesbattle'))); const isBattleSpotBattle = (room?.battle && (SUPPORTED_BATTLESPOT_FORMATS.includes(room.battle.format) || room.battle.format.includes("battlespotspecial"))); - const {dex} = this.extractFormat(room?.battle?.format); + const { dex } = this.extractFormat(room?.battle?.format); if (RANDOMS_CALC_COMMANDS.includes(cmd) || (isRandomBattle && !DEFAULT_CALC_COMMANDS.includes(cmd) && !BATTLESPOT_CALC_COMMANDS.includes(cmd))) { @@ -1899,7 +1899,7 @@ export const commands: Chat.ChatCommands = { let targetId = toID(target); if (targetId === 'ladder') targetId = 'search' as ID; if (targetId === 'all') targetId = ''; - const {totalMatches, sections} = findFormats(targetId, isOMSearch); + const { totalMatches, sections } = findFormats(targetId, isOMSearch); if (!totalMatches) return this.errorReply("No matched formats found."); @@ -1933,7 +1933,7 @@ export const commands: Chat.ChatCommands = { const descHtml: string[] = []; const data = await getFormatResources(format.id); if (data) { - for (const {resource_name, url} of data.resources) { + for (const { resource_name, url } of data.resources) { let rn = resource_name; rn = rn.replace(/ thread$/gi, ''); rn = rn.replace(/Pokemon Showdown/gi, 'PS'); @@ -1967,7 +1967,7 @@ export const commands: Chat.ChatCommands = { const desc = subformat.desc ? [subformat.desc] : []; const data = await getFormatResources(subformat.id); if (data) { - for (const {resource_name, url} of data.resources) { + for (const { resource_name, url } of data.resources) { desc.push(`• ${resource_name}`); } } @@ -2072,7 +2072,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`This is not a room you can set the rules of.`); } const possibleRoom = Rooms.search(toID(target)); - const {totalMatches: formatMatches} = findFormats(toID(target)); + const { totalMatches: formatMatches } = findFormats(toID(target)); if (formatMatches && possibleRoom && cmd !== 'roomrules') { this.errorReply(`'${target}' is both a room and a tier. `); this.errorReply(`If you were looking for rules of that room, use /roomrules [room].`); @@ -2263,7 +2263,7 @@ export const commands: Chat.ChatCommands = { } else if (extraFormat.effectType !== 'Format') { formatName = formatId = ''; } - const supportedLanguages: {[k: string]: string} = { + const supportedLanguages: { [k: string]: string } = { spanish: 'es', french: 'fr', italian: 'it', @@ -2499,7 +2499,7 @@ export const commands: Chat.ChatCommands = { let maxRoll = 0; let minRoll = Number.MAX_SAFE_INTEGER; - const trackRolls = diceQuantity * (('' + diceFaces).length + 1) <= 60; + const trackRolls = diceQuantity * (`${diceFaces}`.length + 1) <= 60; const rolls = []; let rollSum = 0; @@ -2544,7 +2544,7 @@ export const commands: Chat.ChatCommands = { pr: 'pickrandom', pick: 'pickrandom', pickrandom(target, room, user) { - if (!target || !target.includes(',')) return this.parse('/help pick'); + if (!target?.includes(',')) return this.parse('/help pick'); if (!this.runBroadcast(true)) return false; if (this.broadcasting) { [, target] = Utils.splitFirst(this.message, ' '); @@ -2600,9 +2600,9 @@ export const commands: Chat.ChatCommands = { if (!room.pendingApprovals) room.pendingApprovals = new Map(); room.pendingApprovals.set(user.id, { name: user.name, - link: link, - comment: comment, - dimensions: dimensions, + link, + comment, + dimensions, }); this.sendReply(`You have requested to show the link: ${link}${comment ? ` (with the comment ${comment})` : ''}.`); const message = `|tempnotify|pendingapprovals|Pending media request!` + @@ -2764,7 +2764,7 @@ export const commands: Chat.ChatCommands = { } room = this.requireRoom(); room.lastBroadcast = ''; - this.parse(target, {broadcastPrefix: "!rebroadcast "}); + this.parse(target, { broadcastPrefix: "!rebroadcast " }); }, rebroadcasthelp: [ `!rebroadcast ![command] - Bypasses the broadcast cooldown to broadcast a command.`, @@ -2794,7 +2794,7 @@ export const commands: Chat.ChatCommands = { // hardcode, since the loginserver doesn't store exact times, and // so this can look quite inaccurate if it was within the last day const regTimeAgo = duration > 24 * 60 * 60 * 1000 ? - Chat.toDurationString(duration, {precision: 1}) : + Chat.toDurationString(duration, { precision: 1 }) : 'less than a day'; this.sendReplyBox(Utils.html`The user '${target}' registered ${regTimeAgo} ago, on the date ${date.toDateString()}.`); }, @@ -3321,7 +3321,7 @@ export const pages: Chat.PageTable = { return buf; }, approvals(args) { - const room = Rooms.get(args[0]) as ChatRoom | GameRoom; + const room = Rooms.get(args[0])!; this.checkCan('mute', null, room); if (!room.pendingApprovals) room.pendingApprovals = new Map(); if (room.pendingApprovals.size < 1) return `

No pending approvals on ${room.title}

`; diff --git a/server/chat-commands/moderation.ts b/server/chat-commands/moderation.ts index d050a7f694..79b993bc36 100644 --- a/server/chat-commands/moderation.ts +++ b/server/chat-commands/moderation.ts @@ -8,8 +8,8 @@ * * @license MIT */ -import {Utils} from '../../lib'; -import {RoomSection, RoomSections} from './room-settings'; +import { Utils } from '../../lib'; +import { type RoomSection, RoomSections } from './room-settings'; /* eslint no-else-return: "error" */ @@ -142,7 +142,7 @@ export const commands: Chat.ChatCommands = { return this.sendReply("/roomowner - This room isn't designed for per-room moderation to be added"); } if (!target) return this.parse('/help roomowner'); - const {targetUser, targetUsername, rest} = this.splitUser(target, {exactName: true}); + const { targetUser, targetUsername, rest } = this.splitUser(target, { exactName: true }); if (rest) return this.errorReply(`This command does not support specifying a reason.`); const userid = toID(targetUsername); @@ -237,7 +237,7 @@ export const commands: Chat.ChatCommands = { if (this.pmTarget && targetUser) { const text = `${targetUser.name} was invited (and promoted to Room ${nextGroupName}) by ${user.name}.`; room.add(`|c|${user.getIdentity(room)}|/log ${text}`).update(); - this.modlog('INVITE', targetUser, null, {noip: 1, noalts: 1}); + this.modlog('INVITE', targetUser, null, { noip: 1, noalts: 1 }); } else if ( nextSymbol in Config.groups && oldSymbol in Config.groups && nextGroup.rank < Config.groups[oldSymbol].rank @@ -293,7 +293,7 @@ export const commands: Chat.ChatCommands = { return this.parse(`/userauth ${target}`); } const showAll = !!target; - const rankLists: {[k: string]: string[]} = {}; + const rankLists: { [k: string]: string[] } = {}; for (const [id, symbol] of Users.globalAuth) { if (symbol === ' ' || (symbol === '+' && !showAll)) continue; if (!rankLists[symbol]) rankLists[symbol] = []; @@ -333,7 +333,7 @@ export const commands: Chat.ChatCommands = { } const showAll = user.can('mute', null, targetRoom); - const rankLists: {[groupSymbol: string]: ID[]} = {}; + const rankLists: { [groupSymbol: string]: ID[] } = {}; for (const [id, rank] of targetRoom.auth) { if (rank === ' ' && !showAll) continue; if (!rankLists[rank]) rankLists[rank] = []; @@ -350,7 +350,7 @@ export const commands: Chat.ChatCommands = { Utils.sortBy(names).map(userid => { const isOnline = Users.get(userid)?.statusType === 'online'; // targetRoom guaranteed to exist above - return userid in targetRoom!.users && isOnline ? `**${userid}**` : userid; + return userid in targetRoom.users && isOnline ? `**${userid}**` : userid; }).join(', '); }); @@ -445,7 +445,7 @@ export const commands: Chat.ChatCommands = { sectionleaders(target, room, user, connection) { const usernames = Users.globalAuth.usernames; const buffer = []; - const sections: {[k in RoomSection]: Set} = Object.create(null); + const sections: { [k in RoomSection]: Set } = Object.create(null); for (const [id, username] of usernames) { const sectionid = Users.globalAuth.sectionLeaders.get(id); if (!sectionid) continue; @@ -481,6 +481,7 @@ export const commands: Chat.ChatCommands = { ); await Promise.all(promises); + // eslint-disable-next-line require-atomic-updates connection.autojoins = autojoins.join(','); }, autojoinhelp: [`/autojoin [rooms] - Automatically joins all the given rooms.`], @@ -545,9 +546,9 @@ export const commands: Chat.ChatCommands = { room.roomid.startsWith('help-') || (room.battle && (!room.parent || room.parent.type !== 'chat')) ); - const {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, inputUsername, targetUsername, rest: reason } = this.splitUser(target); const targetID = toID(targetUsername); - const {privateReason, publicReason} = this.parseSpoiler(reason); + const { privateReason, publicReason } = this.parseSpoiler(reason); const saveReplay = globalWarn && room?.battle; if (!targetUser?.connected) { @@ -592,7 +593,7 @@ export const commands: Chat.ChatCommands = { this.globalModlog('WARN', targetUser, privateReason); } else { this.addModAction(logMessage); - this.modlog('WARN', targetUser, privateReason, {noalts: 1}); + this.modlog('WARN', targetUser, privateReason, { noalts: 1 }); } targetUser.send(`|c|~|/warn ${publicReason}`); @@ -622,7 +623,7 @@ export const commands: Chat.ChatCommands = { if (room.settings.isPrivate || room.settings.isPersonal) { return this.errorReply("Users cannot be redirected from private or personal rooms."); } - const {targetUser, targetUsername, rest: targetRoomid} = this.splitUser(target); + const { targetUser, targetUsername, rest: targetRoomid } = this.splitUser(target); const targetRoom = Rooms.search(targetRoomid); if (!targetRoom || targetRoom.settings.modjoin || targetRoom.settings.staffRoom) { return this.errorReply(`The room "${targetRoomid}" does not exist.`); @@ -651,7 +652,7 @@ export const commands: Chat.ChatCommands = { targetUser.leaveRoom(room.roomid); targetUser.popup(`You are in the wrong room; please go to <<${targetRoom.roomid}>> instead`); this.addModAction(`${targetUser.name} was redirected to room ${targetRoom.title} by ${user.name}.`); - this.modlog('REDIRECT', targetUser, `to ${targetRoom.title}`, {noip: 1, noalts: 1}); + this.modlog('REDIRECT', targetUser, `to ${targetRoom.title}`, { noip: 1, noalts: 1 }); targetUser.leaveRoom(room); }, redirhelp: [ @@ -665,12 +666,12 @@ export const commands: Chat.ChatCommands = { if (!target) return this.parse('/help mute'); this.checkChat(); - const {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, inputUsername, targetUsername, rest: reason } = this.splitUser(target); if (!targetUser) return this.errorReply(`User '${targetUsername}' not found.`); if (reason.length > MAX_REASON_LENGTH) { return this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`); } - const {publicReason, privateReason} = this.parseSpoiler(reason); + const { publicReason, privateReason } = this.parseSpoiler(reason); const muteDuration = ((cmd === 'hm' || cmd === 'hourmute') ? HOURMUTE_LENGTH : MUTE_LENGTH); this.checkCan('mute', targetUser, room); @@ -721,7 +722,7 @@ export const commands: Chat.ChatCommands = { unmute(target, room, user) { room = this.requireRoom(); if (!target) return this.parse('/help unmute'); - const {targetUser, targetUsername, rest} = this.splitUser(target); + const { targetUser, targetUsername, rest } = this.splitUser(target); if (rest) return this.errorReply(`This command does not support specifying a reason.`); this.checkChat(); this.checkCan('mute', null, room); @@ -732,7 +733,7 @@ export const commands: Chat.ChatCommands = { if (successfullyUnmuted) { this.addModAction(`${(targetUser ? targetUser.name : successfullyUnmuted)} was unmuted by ${user.name}.`); - this.modlog('UNMUTE', (targetUser || successfullyUnmuted), null, {noip: 1, noalts: 1}); + this.modlog('UNMUTE', (targetUser || successfullyUnmuted), null, { noip: 1, noalts: 1 }); } else { this.errorReply(`${(targetUser ? targetUser.name : targetUsername)} is not muted.`); } @@ -755,8 +756,8 @@ export const commands: Chat.ChatCommands = { this.checkChat(); const week = ['wrb', 'wb'].includes(cmd) || cmd.includes('week'); - const {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target); - const {publicReason, privateReason} = this.parseSpoiler(reason); + const { targetUser, inputUsername, targetUsername, rest: reason } = this.splitUser(target); + const { publicReason, privateReason } = this.parseSpoiler(reason); if (!targetUser) return this.errorReply(`User '${targetUsername}' not found.`); if (reason.length > MAX_REASON_LENGTH) { return this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`); @@ -869,7 +870,7 @@ export const commands: Chat.ChatCommands = { return this.parse('/help lock'); } - const {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, inputUsername, targetUsername, rest: reason } = this.splitUser(target); let userid: ID = toID(targetUsername); if (!targetUser && !Punishments.search(userid).length && !force) { @@ -909,8 +910,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`Use /lock; ${name} is not a trusted user and is online.`); } - const {privateReason, publicReason} = this.parseSpoiler(reason); - + const { privateReason, publicReason } = this.parseSpoiler(reason); // Use default time for locks. const duration = week ? Date.now() + 7 * 24 * 60 * 60 * 1000 : (month ? Date.now() + 30 * 24 * 60 * 60 * 1000 : null); @@ -1082,7 +1082,7 @@ export const commands: Chat.ChatCommands = { if (!target) return this.parse('/help globalban'); const force = cmd.includes('force'); - const {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, inputUsername, targetUsername, rest: reason } = this.splitUser(target); let userid: ID = toID(targetUsername); if (!targetUser && !force) { @@ -1118,7 +1118,7 @@ export const commands: Chat.ChatCommands = { if (roomauth.length) { Monitor.log(`[CrisisMonitor] Globally banned user ${name} has public roomauth (${roomauth.join(', ')}), and should probably be demoted.`); } - const {privateReason, publicReason} = this.parseSpoiler(reason); + const { privateReason, publicReason } = this.parseSpoiler(reason); targetUser?.popup( `|modal|${user.name} has globally banned you.${(publicReason ? `\n\nReason: ${publicReason}` : ``)} ` + `${(Config.appealurl ? `\n\nIf you feel that your ban was unjustified, you can appeal:\n${Config.appealurl}` : ``)}` + @@ -1436,7 +1436,7 @@ export const commands: Chat.ChatCommands = { promote(target, room, user, connection, cmd) { if (!target) return this.parse('/help promote'); - const {targetUser, targetUsername, rest: nextGroupName} = this.splitUser(target, {exactName: true}); + const { targetUser, targetUsername, rest: nextGroupName } = this.splitUser(target, { exactName: true }); const userid = toID(targetUsername); const name = targetUser?.name || targetUsername; @@ -1519,7 +1519,7 @@ export const commands: Chat.ChatCommands = { const force = cmd.includes('force'); const untrust = cmd.includes('un'); - const {targetUser, targetUsername, rest} = this.splitUser(target, {exactName: true}); + const { targetUser, targetUsername, rest } = this.splitUser(target, { exactName: true }); if (rest) return this.errorReply(`This command does not support specifying a reason.`); const userid = toID(targetUsername); const name = targetUser?.name || targetUsername; @@ -1576,7 +1576,7 @@ export const commands: Chat.ChatCommands = { const demoting = cmd === 'desectionleader'; if (!target || (target.split(',').length < 2 && !demoting)) return this.parse(`/help sectionleader`); - const {targetUser, targetUsername, rest: sectionid} = this.splitUser(target, {exactName: true}); + const { targetUser, targetUsername, rest: sectionid } = this.splitUser(target, { exactName: true }); const userid = toID(targetUsername); const section = demoting ? Users.globalAuth.sectionLeaders.get(userid)! : room.validateSection(sectionid); const name = targetUser ? targetUser.name : targetUsername; @@ -1625,7 +1625,7 @@ export const commands: Chat.ChatCommands = { forcepromote(target, room, user, connection) { // warning: never document this command in /help this.checkCan('forcepromote'); - const {targetUsername, rest: nextGroupName} = this.splitUser(target, {exactName: true}); + const { targetUsername, rest: nextGroupName } = this.splitUser(target, { exactName: true }); let name = this.filter(targetUsername); if (!name) return; name = name.slice(0, 18); @@ -1781,7 +1781,7 @@ export const commands: Chat.ChatCommands = { if (!target) return this.parse(`/help notifyuser`); this.checkCan('addhtml', null, room); this.checkChat(); - const {targetUser, targetUsername, rest: titleNotification} = this.splitUser(target); + const { targetUser, targetUsername, rest: titleNotification } = this.splitUser(target); if (!targetUser?.connected) return this.errorReply(`User '${targetUsername}' not found.`); const id = `${room.roomid}-user-${toID(targetUsername)}`; if (cmd === 'notifyoffuser') { @@ -1810,12 +1810,12 @@ export const commands: Chat.ChatCommands = { forcerename(target, room, user) { if (!target) return this.parse('/help forcerename'); - const {targetUser, targetUsername, rest: reason} = this.splitUser(target, {exactName: true}); + const { targetUser, targetUsername, rest: reason } = this.splitUser(target, { exactName: true }); const offline = this.cmd.startsWith('o'); const targetID = targetUser?.id || toID(targetUsername); // && !offline because maybe we're trying to disallow the name after they namechanged if (!targetUser && !offline) { - const {targetUser: targetUserInexact, inputUsername} = this.splitUser(target); + const { targetUser: targetUserInexact, inputUsername } = this.splitUser(target); if (targetUserInexact) { return this.errorReply(`User has already changed their name to '${targetUserInexact.name}'.`); } @@ -1829,7 +1829,7 @@ export const commands: Chat.ChatCommands = { return false; } this.checkCan('forcerename', targetID); - const {publicReason, privateReason} = this.parseSpoiler(reason); + const { publicReason, privateReason } = this.parseSpoiler(reason); Monitor.forceRenames.set(targetID, false); @@ -1883,7 +1883,7 @@ export const commands: Chat.ChatCommands = { this.globalModlog('NOFORCERENAME', targetId, rest); }, remove(target, room, user) { - const {targetUsername, rest} = this.splitUser(target); + const { targetUsername, rest } = this.splitUser(target); const targetId = toID(targetUsername); if (!targetId) return this.parse('/help noforcerename'); this.checkCan('bypassall'); @@ -1901,7 +1901,7 @@ export const commands: Chat.ChatCommands = { ], forceclearstatus(target, room, user) { - const {targetUser, rest: reason} = this.requireUser(target, {allowOffline: true}); + const { targetUser, rest: reason } = this.requireUser(target, { allowOffline: true }); this.checkCan('forcerename', targetUser); if (!targetUser.userMessage) return this.errorReply(this.tr`${targetUser.name} does not have a status set.`); @@ -1924,7 +1924,7 @@ export const commands: Chat.ChatCommands = { const week = cmd.includes('w'); const force = cmd.includes('f'); - const {targetUser, inputUsername, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, inputUsername, targetUsername, rest: reason } = this.splitUser(target); const userid = toID(targetUsername); if (!targetUser && !force) { @@ -1949,7 +1949,7 @@ export const commands: Chat.ChatCommands = { } } } - const {privateReason, publicReason} = this.parseSpoiler(reason); + const { privateReason, publicReason } = this.parseSpoiler(reason); const reasonText = publicReason ? ` (${publicReason})` : `.`; this.privateGlobalModAction(`${targetUser?.name || userid} was ${week ? 'week' : ''}namelocked by ${user.name}${reasonText}`); this.globalModlog(`${force ? `FORCE` : ``}${week ? 'WEEK' : ""}NAMELOCK`, targetUser || userid, privateReason); @@ -2024,7 +2024,7 @@ export const commands: Chat.ChatCommands = { room = this.requireRoom(); const hasLineCount = cmd.includes('lines'); const hideRevealButton = cmd.includes('clear') || cmd === 'ctext'; - let {targetUser, inputUsername, targetUsername: name, rest: reason} = this.splitUser(target); + let { targetUser, inputUsername, targetUsername: name, rest: reason } = this.splitUser(target); let lineCount = 0; if (/^[0-9]+\s*(,|$)/.test(reason)) { if (hasLineCount) { @@ -2062,7 +2062,7 @@ export const commands: Chat.ChatCommands = { if (targetUser && showAlts) { message = `${name}'s alts messages were cleared from ${room.title} by ${user.name}.${(reason ? ` (${reason})` : ``)}`; room.sendByUser(sender, message); - this.modlog('HIDEALTSTEXT', targetUser, reason, {noip: 1}); + this.modlog('HIDEALTSTEXT', targetUser, reason, { noip: 1 }); room.hideText([ userid, ...targetUser.previousIDs, @@ -2076,7 +2076,7 @@ export const commands: Chat.ChatCommands = { message = `${name}'s messages were cleared from ${room.title} by ${user.name}.${(reason ? ` (${reason})` : ``)}`; room.sendByUser(sender, message); } - this.modlog('HIDETEXT', targetUser || userid, reason, {noip: 1, noalts: 1}); + this.modlog('HIDETEXT', targetUser || userid, reason, { noip: 1, noalts: 1 }); room.hideText([userid], lineCount, hideRevealButton); this.roomlog(`|c|${user.getIdentity()}|/log ${message}`); } @@ -2101,7 +2101,7 @@ export const commands: Chat.ChatCommands = { this.checkChat(); if (toID(target) === 'show') return this.errorReply(`You're looking for /showbl`); - const {targetUser, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, targetUsername, rest: reason } = this.splitUser(target); if (!targetUser) { this.errorReply(`User ${targetUsername} not found.`); return this.errorReply(`If you want to blacklist an offline account by name (not IP), consider /blacklistname`); @@ -2144,7 +2144,6 @@ export const commands: Chat.ChatCommands = { ); } - const expireTime = cmd.includes('perma') ? Date.now() + (10 * 365 * 24 * 60 * 60 * 1000) : null; const action = expireTime ? 'PERMABLACKLIST' : 'BLACKLIST'; @@ -2189,7 +2188,7 @@ export const commands: Chat.ChatCommands = { room = this.requireRoom(); if (!target) return this.parse(`/help battleban`); - const {targetUser, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, targetUsername, rest: reason } = this.splitUser(target); if (!targetUser) return this.errorReply(`User ${targetUsername} not found.`); if (target.length > MAX_REASON_LENGTH) { return this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`); @@ -2199,7 +2198,7 @@ export const commands: Chat.ChatCommands = { } const includesUrl = reason.includes(`.${Config.routes.root}/`); // lgtm [js/incomplete-url-substring-sanitization] if (!room.battle && !includesUrl && cmd !== 'forcebattleban') { - return this.errorReply(`Battle bans require a battle replay if used outside of a battle; if the battle has expired, use /forcebattleban.`); + return this.errorReply(`Battle bans require a battle replay if used outside of a battle; if the battle has expired, use /forcebattleban.`); } if (!user.can('rangeban', targetUser)) { this.errorReply(`Battlebans have been deprecated. Alternatives:`); @@ -2264,7 +2263,7 @@ export const commands: Chat.ChatCommands = { ); } - const {targetUser, targetUsername, rest: reason} = this.splitUser(target); + const { targetUser, targetUsername, rest: reason } = this.splitUser(target); if (!targetUser) return this.errorReply(`User ${targetUsername} not found.`); if (target.length > MAX_REASON_LENGTH) { return this.errorReply(`The reason is too long. It cannot exceed ${MAX_REASON_LENGTH} characters.`); @@ -2356,7 +2355,7 @@ export const commands: Chat.ChatCommands = { const duplicates = targets.filter(userid => ( // can be asserted, room should always exist - Punishments.roomUserids.nestedGetByType(room!.roomid, userid, 'BLACKLIST') + Punishments.roomUserids.nestedGetByType(room.roomid, userid, 'BLACKLIST') )); if (duplicates.length) { return this.errorReply(`[${duplicates.join(', ')}] ${Chat.plural(duplicates, "are", "is")} already blacklisted.`); @@ -2454,7 +2453,7 @@ export const commands: Chat.ChatCommands = { for (const [userid, punishmentList] of roomUserids) { for (const punishment of punishmentList) { - const {type, id, expireTime} = punishment; + const { type, id, expireTime } = punishment; if (type === 'BLACKLIST') { if (!blMap.has(id)) blMap.set(id, [expireTime]); if (id !== userid) blMap.get(id)!.push(userid); @@ -2469,7 +2468,7 @@ export const commands: Chat.ChatCommands = { ips = '/ips'; for (const [ip, punishments] of roomIps) { for (const punishment of punishments) { - const {type, id} = punishment; + const { type, id } = punishment; if (type === 'BLACKLIST') { if (!blMap.has(id)) blMap.set(id, []); blMap.get(id)!.push(ip); diff --git a/server/chat-commands/room-settings.ts b/server/chat-commands/room-settings.ts index 76e1ce7589..bd59e4c097 100644 --- a/server/chat-commands/room-settings.ts +++ b/server/chat-commands/room-settings.ts @@ -6,8 +6,8 @@ * * @license MIT */ -import {Utils} from '../../lib'; -import type {EffectiveGroupSymbol, RoomPermission} from '../user-groups'; +import { Utils } from '../../lib'; +import type { EffectiveGroupSymbol, RoomPermission } from '../user-groups'; const RANKS = Config.groupsranking; @@ -21,7 +21,7 @@ export const sections = [ export type RoomSection = typeof sections[number]; -export const RoomSections: {sectionNames: {[k in RoomSection]: string}, sections: readonly RoomSection[]} = { +export const RoomSections: { sectionNames: { [k in RoomSection]: string }, sections: readonly RoomSection[] } = { sectionNames: { official: 'Official', battleformats: 'Battle formats', @@ -162,7 +162,7 @@ export const commands: Chat.ChatCommands = { room = this.requireRoom(); if (!target) { if (!room.settings.autoModchat) return this.sendReply(`This room has automodchat OFF.`); - const {rank: curRank, time: curTime} = room.settings.autoModchat; + const { rank: curRank, time: curTime } = room.settings.autoModchat; return this.sendReply(`Automodchat is currently set to set modchat to ${curRank} after ${curTime} minutes.`); } this.checkCan('declare', null, room); @@ -315,14 +315,14 @@ export const commands: Chat.ChatCommands = { } room.saveSettings(); if (target === 'sync' && !room.settings.modchat) { - const lowestGroup = Config.groupsranking.filter(group => { + const lowestGroup = Config.groupsranking.find(group => { const groupInfo = Users.Auth.getGroup(group); return ( groupInfo.symbol !== Users.Auth.defaultSymbol() && - room!.auth.atLeast(user, group) && + room.auth.atLeast(user, group) && Users.Auth.isValidSymbol(groupInfo.symbol) ); - })[0]; + }); if (lowestGroup) void this.parse(`/modchat ${lowestGroup}`); } if (!room.settings.isPrivate) return this.parse('/hiddenroom'); @@ -381,7 +381,7 @@ export const commands: Chat.ChatCommands = { } const slowchatSetting = (room.settings.slowchat || "OFF"); this.privateModAction(`${user.name} set slowchat to ${slowchatSetting}`); - this.modlog('SLOWCHAT', null, '' + slowchatSetting); + this.modlog('SLOWCHAT', null, `${slowchatSetting}`); room.saveSettings(); }, slowchathelp: [ @@ -466,7 +466,7 @@ export const commands: Chat.ChatCommands = { if (handler?.isPrivate && !user.can('lock')) return false; return (perm.startsWith('/') || perm.startsWith('!')) && perm.includes(' '); }); - const subPermissionsByNamespace: {[k: string]: string[]} = {}; + const subPermissionsByNamespace: { [k: string]: string[] } = {}; for (const perm of subPermissions) { const [namespace] = perm.split(' ', 1); if (!subPermissionsByNamespace[namespace]) subPermissionsByNamespace[namespace] = []; @@ -1075,7 +1075,7 @@ export const commands: Chat.ChatCommands = { Rooms.global.notifyRooms( room.settings.isPrivate === true ? ['upperstaff'] : ['upperstaff', 'staff'], Utils.html`|raw|
${privacy} chat room ${oldTitle} renamed to ${target}
` - ); + ); } room.add(Utils.html`|raw|
The room has been renamed to ${target}
`).update(); }, @@ -1134,7 +1134,7 @@ export const commands: Chat.ChatCommands = { if (!room.settings.isPrivate) { return this.errorReply(`This room is already public.`); } - if (room.parent && room.parent.settings.isPrivate) { + if (room.parent?.settings.isPrivate) { return this.errorReply(`This room's parent ${room.parent.title} must be public for this room to be public.`); } if (room.settings.isPersonal && !battle) { @@ -1263,7 +1263,7 @@ export const commands: Chat.ChatCommands = { const settingsList = Rooms.global.settingsList; const parentIndex = settingsList.findIndex(r => r.title === parent.title); - const index = settingsList.findIndex(r => r.title === room!.title); + const index = settingsList.findIndex(r => r.title === room.title); // Ensure that the parent room gets loaded before the subroom. if (parentIndex > index) { @@ -1537,7 +1537,7 @@ export const commands: Chat.ChatCommands = { } this.checkCan('declare', null, room); - const displayIDToName: {[k: string]: Room['settings']['dataCommandTierDisplay']} = { + const displayIDToName: { [k: string]: Room['settings']['dataCommandTierDisplay'] } = { tiers: 'tiers', doublestiers: 'doubles tiers', nationaldextiers: 'National Dex tiers', @@ -1618,7 +1618,7 @@ export const commands: Chat.ChatCommands = { if (format.effectType === 'Format') { target = format.name; } - const {isMatch} = this.extractFormat(target); + const { isMatch } = this.extractFormat(target); if (!isMatch) throw new Chat.ErrorMessage(`Unrecognized format or mod "${target}"`); room.settings.defaultFormat = target; diff --git a/server/chat-formatter.ts b/server/chat-formatter.ts index 2dbd41bd9a..9ccae60f00 100644 --- a/server/chat-formatter.ts +++ b/server/chat-formatter.ts @@ -8,7 +8,7 @@ */ /* -REGEXFREE SOURCE FOR LINKREGEX +SOURCE FOR LINKREGEX (compile with https://regexfree.k55.io/ ) ( ( @@ -113,8 +113,8 @@ class TextFormatter { let slashIndex = uri.lastIndexOf('/'); if (uri.length - slashIndex > 18) slashIndex = uri.length; if (slashIndex - 4 > 19 + 3) { - uri = uri.slice(0, 19) + - '' + uri.slice(19, slashIndex - 4) + '' + uri.slice(slashIndex - 4); + uri = `${uri.slice(0, 19)}${uri.slice(19, slashIndex - 4)}` + + `${uri.slice(slashIndex - 4)}`; } } } diff --git a/server/chat-jsx.tsx b/server/chat-jsx.tsx index 61a5d56ec5..ac2d820370 100644 --- a/server/chat-jsx.tsx +++ b/server/chat-jsx.tsx @@ -4,7 +4,7 @@ */ import preact from 'preact'; import render from 'preact-render-to-string'; -import {Utils} from '../lib'; +import { Utils } from '../lib'; /** For easy concenation of Preact nodes with strings */ export function html( @@ -23,15 +23,15 @@ export function html( /** client-side custom elements */ export interface PSElements extends preact.JSX.IntrinsicElements { - youtube: {src: string}; - twitch: {src: string, width?: number, height?: number}; - spotify: {src: string}; - username: {name?: string, class?: string, children?: preact.VNode | string}; - psicon: {pokemon: string} | {item: string} | {type: string} | {category: string}; - center: {class?: string}; + youtube: { src: string }; + twitch: { src: string, width?: number, height?: number }; + spotify: { src: string }; + username: { name?: string, class?: string, children?: preact.VNode | string }; + psicon: { pokemon: string } | { item: string } | { type: string } | { category: string }; + center: { class?: string }; } -export {render}; +export { render }; export type VNode = preact.VNode; @@ -39,12 +39,12 @@ export const h = preact.h; export const Fragment = preact.Fragment; export const Component = preact.Component; -export class FormatText extends preact.Component<{isTrusted?: boolean, replaceLinebreaks?: boolean}> { +export class FormatText extends preact.Component<{ isTrusted?: boolean, replaceLinebreaks?: boolean }> { render() { const child = this.props.children; if (typeof child !== 'string') throw new Error(`Invalid props.children type: ${!child ? child : typeof child}`); - return ; + return ; } } diff --git a/server/chat-plugins/abuse-monitor.ts b/server/chat-plugins/abuse-monitor.ts index ce59f79c6f..4131602f0f 100644 --- a/server/chat-plugins/abuse-monitor.ts +++ b/server/chat-plugins/abuse-monitor.ts @@ -8,11 +8,11 @@ * @author mia-pi-git */ import * as Artemis from '../artemis'; -import {FS, Utils} from '../../lib'; -import {Config} from '../config-loader'; -import {toID} from '../../sim/dex-data'; -import {getBattleLog, getBattleLinks, HelpTicket} from './helptickets'; -import type {GlobalPermission} from '../user-groups'; +import { FS, Utils } from '../../lib'; +import { Config } from '../config-loader'; +import { toID } from '../../sim/dex-data'; +import { getBattleLog, getBattleLinks, HelpTicket } from './helptickets'; +import type { GlobalPermission } from '../user-groups'; const WHITELIST = ["mia"]; const MUTE_DURATION = 7 * 60 * 1000; @@ -20,7 +20,7 @@ const DAY = 24 * 60 * 60 * 1000; const STAFF_NOTIF_INTERVAL = 10 * 60 * 1000; const MAX_MODLOG_TIME = 2 * 365 * DAY; const NON_PUNISHMENTS = ['MUTE', 'REPORT']; -const NOJOIN_COMMAND_WHITELIST: {[k: string]: string} = { +const NOJOIN_COMMAND_WHITELIST: { [k: string]: string } = { 'lock': '/lock', 'weeklock': '/weeklock', 'warn': '/warn', @@ -38,7 +38,7 @@ export const cache: { // todo: move this to just ID[] staffNotified?: ID | ID[], claimed?: ID, - recommended?: Record, + recommended?: Record, }, } = (() => { const plugin = global.Chat?.oldPlugins['abuse-monitor']; @@ -62,14 +62,14 @@ const defaults: FilterSettings = { thresholdIncrement: null, minScore: 0.65, specials: { - THREAT: {0.96: 'MAXIMUM'}, - IDENTITY_ATTACK: {0.8: 2}, - SEVERE_TOXICITY: {0.8: 2}, + THREAT: { 0.96: 'MAXIMUM' }, + IDENTITY_ATTACK: { 0.8: 2 }, + SEVERE_TOXICITY: { 0.8: 2 }, }, replacements: {}, recommendOnly: true, punishments: [ - {certainty: 0.93, type: 'IDENTITY_ATTACK', punishment: 'WARN', count: 2}, + { certainty: 0.93, type: 'IDENTITY_ATTACK', punishment: 'WARN', count: 2 }, ], }; @@ -77,7 +77,7 @@ export const settings: FilterSettings = (() => { try { // accounting for data changes - // make sure we do have the default data in case it's not in the stored data - return {...defaults, ...JSON.parse(FS('config/chat-plugins/nf.json').readSync())}; + return { ...defaults, ...JSON.parse(FS('config/chat-plugins/nf.json').readSync()) }; } catch (e: any) { if (e.code !== "ENOENT") throw e; return defaults; @@ -119,10 +119,10 @@ interface PunishmentSettings { interface FilterSettings { disabled?: boolean; - thresholdIncrement: {turns: number, amount: number, minTurns?: number} | null; + thresholdIncrement: { turns: number, amount: number, minTurns?: number } | null; threshold: number; minScore: number; - specials: {[k: string]: {[k: number]: number | "MAXIMUM"}}; + specials: { [k: string]: { [k: number]: number | "MAXIMUM" } }; /** Replaces [key] with [value] before processing the string. */ replacements: Record; punishments: PunishmentSettings[]; @@ -140,7 +140,7 @@ interface ReviewRequest { room: string; details: string; time: number; - resolved?: {by: string, time: number, details: string, result: number}; + resolved?: { by: string, time: number, details: string, result: number }; } // stolen from chatlog. necessary here, but importing chatlog sucks. @@ -197,7 +197,7 @@ export const punishmentCache: WeakMap> = ( ); export async function searchModlog( - query: {user: ID, ip?: string | string[], actions?: string[]} + query: { user: ID, ip?: string | string[], actions?: string[] } ) { const userObj = Users.get(query.user); if (userObj) { @@ -217,11 +217,11 @@ export async function searchModlog( actionTaker: [], action: [], }; - if (query.user) search.user.push({search: query.user, isExact: true}); + if (query.user) search.user.push({ search: query.user, isExact: true }); if (query.ip) { if (!Array.isArray(query.ip)) query.ip = [query.ip]; for (const ip of query.ip) { - search.ip.push({search: ip}); + search.ip.push({ search: ip }); } } const modlog = await Rooms.Modlog.search('global', search); @@ -325,7 +325,7 @@ export async function runActions(user: User, room: GameRoom, message: string, re const [punishment, reason] = recommended[0]; if (roomRecord) { if (!roomRecord.recommended) roomRecord.recommended = {}; - roomRecord.recommended[user.id] = {type: punishment, reason: reason.replace(/_/g, ' ').toLowerCase()}; + roomRecord.recommended[user.id] = { type: punishment, reason: reason.replace(/_/g, ' ').toLowerCase() }; } if (user.trusted) { // force just logging for any sort of punishment. requested by staff @@ -355,9 +355,9 @@ export async function runActions(user: User, room: GameRoom, message: string, re delete cache[room.roomid].staffNotified; void Chat.database.run( `INSERT INTO perspective_stats (staff, roomid, result, timestamp) VALUES ($staff, $roomid, $result, $timestamp) ` + - `ON CONFLICT (roomid) DO UPDATE SET result = $result, timestamp = $timestamp`, + `ON CONFLICT (roomid) DO UPDATE SET result = $result, timestamp = $timestamp`, // todo: maybe use 3 to indicate punishment? - {staff: '', roomid: room.roomid, result: 1, timestamp: Date.now()} + { staff: '', roomid: room.roomid, result: 1, timestamp: Date.now() } ); } } @@ -538,7 +538,7 @@ function makeScore(roomid: RoomID, result: Record) { } if (score !== curScore) flags.add(type); } - return {score, flags: [...flags], main}; + return { score, flags: [...flags], main }; } export const chatfilter: Chat.ChatFilter = function (message, user, room) { @@ -576,9 +576,9 @@ export const chatfilter: Chat.ChatFilter = function (message, user, room) { } const response = await classifier.classify(message); - const {score, flags, main} = makeScore(roomid, response || {}); + const { score, flags, main } = makeScore(roomid, response || {}); if (score) { - if (!cache[roomid]) cache[roomid] = {users: {}}; + if (!cache[roomid]) cache[roomid] = { users: {} }; if (!cache[roomid].users[user.id]) cache[roomid].users[user.id] = 0; cache[roomid].users[user.id] += score; let hitThreshold = 0; @@ -626,7 +626,7 @@ function calcThreshold(roomid: RoomID) { const incr = settings.thresholdIncrement; let num = settings.threshold; const room = Rooms.get(roomid); - if (!room || !room.battle || !incr) return num; + if (!room?.battle || !incr) return num; if (!incr.minTurns || room.battle.turn >= incr.minTurns) { num += (Math.floor(room.battle.turn / incr.turns) * incr.amount); } @@ -644,7 +644,7 @@ export const handlers: Chat.Handlers = { `INSERT INTO perspective_stats (staff, roomid, result, timestamp) VALUES ($staff, $roomid, $result, $timestamp) ` + `ON CONFLICT (roomid) DO UPDATE SET result = $result, timestamp = $timestamp`, // 2 means dead - {staff: '', roomid, result: 2, timestamp: Date.now()} + { staff: '', roomid, result: 2, timestamp: Date.now() } ); } } @@ -746,10 +746,10 @@ export const commands: Chat.ChatCommands = { target = target.replace(new RegExp(k, 'gi'), settings.replacements[k]); } // intentionally hardcoded to staff to ensure threshold is never altered. - const {score, flags} = makeScore('staff', response); + const { score, flags } = makeScore('staff', response); let buf = `Score for "${text}"${target === text ? '' : ` (alt: "${target}")`}: ${score}
`; buf += `Flags: ${flags.join(', ')}
`; - const punishments: {punishment: PunishmentSettings, desc: string[], index: number}[] = []; + const punishments: { punishment: PunishmentSettings, desc: string[], index: number }[] = []; for (const [i, p] of settings.punishments.entries()) { const matches = []; for (const k in response) { @@ -764,7 +764,7 @@ export const commands: Chat.ChatCommands = { } const secondaries = Object.entries(p.secondaryTypes || {}); if (secondaries.length) { - if (!secondaries.every(([sK, sV]) => response![sK] >= sV)) continue; + if (!secondaries.every(([sK, sV]) => response[sK] >= sV)) continue; descriptors.push('secondary'); } if (descriptors.length) { // ignore modlog / flag -only based actions @@ -831,7 +831,7 @@ export const commands: Chat.ChatCommands = { target = target.trim(); if (!target) return this.parse(`/help abusemonitor`); const [text, scoreText] = Utils.splitFirst(target, ',').map(f => f.trim()); - const args = Chat.parseArguments(scoreText, ',', {useIDs: false}); + const args = Chat.parseArguments(scoreText, ',', { useIDs: false }); const scores: Record = {}; for (let k in args) { const vals = args[k]; @@ -926,7 +926,7 @@ export const commands: Chat.ChatCommands = { // on conflict in case it's re-triggered later. // (we want it to be updated to success if it is now a success where it was previously inaccurate) `ON CONFLICT (roomid) DO UPDATE SET result = $result, timestamp = $timestamp`, - {staff: this.user.id, roomid, result, timestamp: Date.now()} + { staff: this.user.id, roomid, result, timestamp: Date.now() } ); return this.parse(`/j view-abusemonitor-flagged`); }, @@ -966,7 +966,7 @@ export const commands: Chat.ChatCommands = { } this.room = tarRoom; this.room.reportJoin('j', user.getIdentityWithStatus(this.room), user); - const result = await this.parse(`${cmd} ${rest}`, {bypassRoomCheck: true}); + const result = await this.parse(`${cmd} ${rest}`, { bypassRoomCheck: true }); if (result) { // command succeeded - send followup this.add( '|c|~|/raw If you have questions about this action, please contact staff ' + @@ -1065,7 +1065,7 @@ export const commands: Chat.ChatCommands = { }, async userclear(target, room, user) { checkAccess(this); - const {targetUsername, rest} = this.splitUser(target); + const { targetUsername, rest } = this.splitUser(target); const targetId = toID(targetUsername); if (!targetId) return this.parse(`/help abusemonitor`); if (user.lastCommand !== `am userclear ${targetId}`) { @@ -1117,7 +1117,7 @@ export const commands: Chat.ChatCommands = { let [rawType, rawPercent, rawScore] = target.split(','); const type = rawType.toUpperCase().replace(/\s/g, '_'); rawScore = toID(rawScore); - const types = {...Artemis.RemoteClassifier.ATTRIBUTES, "ALL": {}}; + const types = { ...Artemis.RemoteClassifier.ATTRIBUTES, "ALL": {} }; if (!(type in types)) { return this.errorReply(`Invalid type: ${type}. Valid types: ${Object.keys(types).join(', ')}.`); } @@ -1155,7 +1155,7 @@ export const commands: Chat.ChatCommands = { checkAccess(this); const [rawType, rawPercent] = target.split(','); const type = rawType.toUpperCase().replace(/\s/g, '_'); - const types = {...Artemis.RemoteClassifier.ATTRIBUTES, "ALL": {}}; + const types = { ...Artemis.RemoteClassifier.ATTRIBUTES, "ALL": {} }; if (!(type in types)) { return this.errorReply(`Invalid type: ${type}. Valid types: ${Object.keys(types).join(', ')}.`); } @@ -1187,7 +1187,7 @@ export const commands: Chat.ChatCommands = { saveSettings(); this.refreshPage('abusemonitor-settings'); this.privateGlobalModAction(`${user.name} set the abuse monitor minimum score to ${num}.`); - this.globalModlog("ABUSEMONITOR MIN", null, "" + num); + this.globalModlog("ABUSEMONITOR MIN", null, `${num}`); this.sendReply(`|html|Remember to use /am respawn to deploy the settings to the child processes.`); }, ex: 'exportpunishment', @@ -1237,34 +1237,15 @@ export const commands: Chat.ChatCommands = { checkAccess(this); let buf = settings.punishments.map(punishment => { const line = []; - for (const k in punishment) { - // simplifies code to not need to cast every time. - const key = k as keyof PunishmentSettings; - const val = punishment[key]; - switch (key) { - case 'modlogCount': - line.push(`mlc=${val}`); - break; - case 'modlogActions': - line.push(`${(val as string[]).map(f => `mla=${f}`).join(', ')}`); - break; - case 'punishment': - line.push(`p=${val}`); - break; - case 'type': - line.push(`t=${val}`); - break; - case 'count': - line.push(`c=${val}`); - break; - case 'certainty': - line.push(`ct=${val}`); - break; - case 'secondaryTypes': - for (const type in (val as any)) { - line.push(`st=${type}|${(val as any)[type]}`); - } - break; + if ('modlogCount' in punishment) line.push(`mlc=${punishment.modlogCount}`); + if (punishment.modlogActions) line.push(`${punishment.modlogActions.map(f => `mla=${f}`).join(', ')}`); + line.push(`p=${punishment.punishment}`); + if ('type' in punishment) line.push(`t=${punishment.type}`); + if ('count' in punishment) line.push(`c=${punishment.count}`); + if ('certainty' in punishment) line.push(`ct=${punishment.certainty}`); + if ('secondaryTypes' in punishment) { + for (const type in punishment.secondaryTypes) { + line.push(`st=${type}|${punishment.secondaryTypes[type]}`); } } return line.join(', '); @@ -1417,6 +1398,7 @@ export const commands: Chat.ChatCommands = { this.privateGlobalModAction(`${user.name} removed the abuse-monitor punishment indexed at ${idx + 1}.`); this.stafflog( `Punishment: ` + + // eslint-disable-next-line @typescript-eslint/no-base-to-string `${Object.keys(punishment).map(f => `${f}: ${punishment[f as keyof PunishmentSettings]}`).join(', ')}` ); this.globalModlog(`ABUSEMONITOR REMOVEPUNISHMENT`, null, `${idx + 1}`); @@ -1446,7 +1428,7 @@ export const commands: Chat.ChatCommands = { if (rawMin && isNaN(min)) { return this.errorReply(`Invalid minimum (must be a number).`); } - settings.thresholdIncrement = {amount: increment, turns}; + settings.thresholdIncrement = { amount: increment, turns }; if (min) { settings.thresholdIncrement.minTurns = min; } @@ -1931,7 +1913,7 @@ export const pages: Chat.PageTable = { buf += `
`; Utils.sortBy(logs, log => -log.time); for (const log of logs) { - buf += ``; + buf += ``; buf += ``; buf += Utils.html``; } @@ -1977,7 +1959,7 @@ export const pages: Chat.PageTable = { buf += ``; const prettifyFlag = (flag: string) => flag.toLowerCase().replace(/_/g, ' '); for (const log of logs) { - const {roomid} = log; + const { roomid } = log; buf += ``; buf += ``; if (!userid) buf += ``; @@ -2029,10 +2011,10 @@ export const pages: Chat.PageTable = { let failures = 0; let dead = 0; const staffStats: Record = {}; - const dayStats: Record = {}; + const dayStats: Record = {}; for (const log of logs) { const cur = Chat.toTimestamp(new Date(log.timestamp)).split(' ')[0]; - if (!dayStats[cur]) dayStats[cur] = {successes: 0, failures: 0, dead: 0, total: 0}; + if (!dayStats[cur]) dayStats[cur] = { successes: 0, failures: 0, dead: 0, total: 0 }; if (log.result === 2) { dead++; dayStats[cur].dead++; @@ -2089,7 +2071,7 @@ export const pages: Chat.PageTable = { const punishmentStats = { inaccurate: 0, total: 0, - byDay: {} as Record, + byDay: {} as Record, types: {} as Record, }; const inaccurate = new Set(); @@ -2103,7 +2085,7 @@ export const pages: Chat.PageTable = { if (!punishmentStats.types[chunk.punishment]) punishmentStats.types[chunk.punishment] = 0; punishmentStats.types[chunk.punishment]++; const day = Chat.toTimestamp(new Date(chunk.timestamp)).split(' ')[0]; - if (!punishmentStats.byDay[day]) punishmentStats.byDay[day] = {total: 0, inaccurate: 0}; + if (!punishmentStats.byDay[day]) punishmentStats.byDay[day] = { total: 0, inaccurate: 0 }; punishmentStats.byDay[day].total++; } } @@ -2118,7 +2100,7 @@ export const pages: Chat.PageTable = { punishmentStats.inaccurate++; inaccurate.add(chunk.room); const day = Chat.toTimestamp(new Date(chunk.time)).split(' ')[0]; - if (!punishmentStats.byDay[day]) punishmentStats.byDay[day] = {total: 0, inaccurate: 0}; + if (!punishmentStats.byDay[day]) punishmentStats.byDay[day] = { total: 0, inaccurate: 0 }; punishmentStats.byDay[day].inaccurate++; } } @@ -2321,7 +2303,7 @@ export const pages: Chat.PageTable = { this.title = `[Artemis History] ${targetUser}`; let buf = `

Artemis modlog handling for ${targetUser}


`; const modlogEntries = await Rooms.Modlog.search('global', { - user: [{search: targetUser, isExact: true}], + user: [{ search: targetUser, isExact: true }], note: [], ip: [], action: [], diff --git a/server/chat-plugins/announcements.ts b/server/chat-plugins/announcements.ts index a44ee1e3a9..f19aee5858 100644 --- a/server/chat-plugins/announcements.ts +++ b/server/chat-plugins/announcements.ts @@ -92,7 +92,7 @@ export const commands: Chat.ChatCommands = { const source = supportHTML ? this.checkHTML(Chat.collapseLineBreaksHTML(target)) : Chat.formatText(target, true); - room.setMinorActivity(new Announcement(room, {source})); + room.setMinorActivity(new Announcement(room, { source })); this.roomlog(`${user.name} used ${message}`); this.modlog('ANNOUNCEMENT'); @@ -141,7 +141,7 @@ export const commands: Chat.ChatCommands = { if (isNaN(timeoutMins) || timeoutMins <= 0 || timeoutMins > 7 * 24 * 60) { return this.errorReply(this.tr`Time should be a number of minutes less than one week.`); } - announcement.setTimer({timeoutMins}); + announcement.setTimer({ timeoutMins }); room.add(`The announcement timer was turned on: the announcement will end in ${timeoutMins} minute${Chat.plural(timeoutMins)}.`); this.modlog('ANNOUNCEMENT TIMER', null, `${timeoutMins} minutes`); return this.privateModAction(`The announcement timer was set to ${timeoutMins} minute${Chat.plural(timeoutMins)} by ${user.name}.`); diff --git a/server/chat-plugins/auction.ts b/server/chat-plugins/auction.ts index b768935066..75bd28b3bf 100644 --- a/server/chat-plugins/auction.ts +++ b/server/chat-plugins/auction.ts @@ -5,7 +5,7 @@ * https://github.com/Hidden50/Pokemon-Showdown-Node-Bot/blob/master/commands/base-auctions.js * @author Karthik */ -import {Net, Utils} from '../../lib'; +import { Net, Utils } from '../../lib'; interface Player { id: ID; @@ -86,10 +86,10 @@ function parseCredits(amount: string) { export class Auction extends Rooms.SimpleRoomGame { override readonly gameid = 'auction' as ID; - owners: Set = new Set(); - teams: Map = new Map(); - managers: Map = new Map(); - auctionPlayers: Map = new Map(); + owners = new Set(); + teams = new Map(); + managers = new Map(); + auctionPlayers = new Map(); startingCredits: number; minBid = 3000; @@ -99,10 +99,10 @@ export class Auction extends Rooms.SimpleRoomGame { lastQueue: Team[] | null = null; queue: Team[] = []; - nomTimer: NodeJS.Timer = null!; + nomTimer: NodeJS.Timeout = null!; nomTimeLimit = 0; nomTimeRemaining = 0; - bidTimer: NodeJS.Timer = null!; + bidTimer: NodeJS.Timeout = null!; bidTimeLimit = 10; bidTimeRemaining = 10; nominatingTeam: Team = null!; @@ -110,7 +110,7 @@ export class Auction extends Rooms.SimpleRoomGame { highestBidder: Team = null!; highestBid = 0; /** Used for blind mode */ - bidsPlaced: Map = new Map(); + bidsPlaced = new Map(); state: 'setup' | 'nom' | 'bid' = 'setup'; constructor(room: Room, startingCredits = 100000) { super(room); @@ -261,7 +261,7 @@ export class Auction extends Rooms.SimpleRoomGame { sendTimer(change = false, nom = false) { let buf = `
`; - buf += ` ${Chat.toDurationString((nom ? this.nomTimeRemaining : this.bidTimeRemaining) * 1000, {hhmmss: true}).slice(1)}`; + buf += ` ${Chat.toDurationString((nom ? this.nomTimeRemaining : this.bidTimeRemaining) * 1000, { hhmmss: true }).slice(1)}`; buf += `
`; this.room.add(`|uhtml${change ? 'change' : ''}|timer|${buf}`).update(); } @@ -465,7 +465,7 @@ export class Auction extends Rooms.SimpleRoomGame { for (const id of users.map(toID)) { const manager = this.managers.get(id); if (!manager) { - this.managers.set(id, {id, team}); + this.managers.set(id, { id, team }); } else { manager.team = team; } diff --git a/server/chat-plugins/battlesearch.ts b/server/chat-plugins/battlesearch.ts index 91941893be..b6003137bc 100644 --- a/server/chat-plugins/battlesearch.ts +++ b/server/chat-plugins/battlesearch.ts @@ -1,9 +1,9 @@ /** * Battle search - handles searching battle logs. */ -import {FS, Utils, ProcessManager, Repl} from '../../lib'; +import { FS, Utils, ProcessManager, Repl } from '../../lib'; -import {checkRipgrepAvailability, Config} from '../config-loader'; +import { checkRipgrepAvailability, Config } from '../config-loader'; import * as path from 'path'; import * as child_process from 'child_process'; @@ -18,19 +18,19 @@ interface BattleOutcome { interface BattleSearchResults { totalBattles: number; - /** Total battle outcomes. Null when only searching for one userid.*/ + /** Total battle outcomes. Null when only searching for one userid. */ totalOutcomes: BattleOutcome[] | null; - totalWins: {[k: string]: number}; - totalLosses: {[k: string]: number}; + totalWins: { [k: string]: number }; + totalLosses: { [k: string]: number }; totalTies: number; - timesBattled: {[k: string]: number}; + timesBattled: { [k: string]: number }; } const MAX_BATTLESEARCH_PROCESSES = 1; export async function runBattleSearch(userids: ID[], month: string, tierid: ID, turnLimit?: number) { const useRipgrep = await checkRipgrepAvailability(); const pathString = `${month}/${tierid}/`; - const results: {[k: string]: BattleSearchResults} = {}; + const results: { [k: string]: BattleSearchResults } = {}; let files = []; try { files = await Monitor.logPath(pathString).readdir(); @@ -111,7 +111,7 @@ export async function runBattleSearch(userids: ID[], month: string, tierid: ID, const outcomes = results[day].totalOutcomes; if (outcomes) { - outcomes.push({won: winnerid, lost: loser, turns: data.turns}); + outcomes.push({ won: winnerid, lost: loser, turns: data.turns }); } // we only want foe data for single-userid searches const foe = userids.length > 1 ? null : userid === toID(data.p1) ? toID(data.p2) : toID(data.p1); @@ -167,7 +167,7 @@ export async function runBattleSearch(userids: ID[], month: string, tierid: ID, const outcomes = results[day].totalOutcomes; if (outcomes) { - outcomes.push({won: winnerid, lost: loser, turns: data.turns}); + outcomes.push({ won: winnerid, lost: loser, turns: data.turns }); } // we don't want foe data if we're searching for 2 userids @@ -182,7 +182,7 @@ export async function runBattleSearch(userids: ID[], month: string, tierid: ID, } function buildResults( - data: {[k: string]: BattleSearchResults}, userids: ID[], + data: { [k: string]: BattleSearchResults }, userids: ID[], month: string, tierid: ID, turnLimit?: number ) { let buf = `>view-battlesearch-${userids.join('-')}--${turnLimit}--${month}--${tierid}--confirm\n|init|html\n|title|[Battle Search][${userids.join('-')}][${tierid}][${month}]\n`; @@ -201,7 +201,7 @@ function buildResults( buf += `
DateRoomUserMessage
${Chat.toTimestamp(new Date(log.time), {human: true})}
${Chat.toTimestamp(new Date(log.time), { human: true })}${log.roomid}${log.userid}${log.message}
TimeScore / FlagsOther dataManage
${roomid}${log.userid}

Full summary

`; buf += ``; for (const battle of outcomes) { - const {won, lost, turns} = battle; + const { won, lost, turns } = battle; buf += ``; } } @@ -209,7 +209,7 @@ function buildResults( for (const day in data) { const dayStats = data[day]; buf += `

`; - const {totalWins, totalLosses} = dayStats; + const { totalWins, totalLosses } = dayStats; buf += `

WonLostTurns
${won}${lost}${turns}
`; buf += ``; @@ -245,7 +245,7 @@ async function rustBattleSearch( if (!targetUser) { throw new Chat.ErrorMessage(`No user specified.`); } - const {connection, user} = context; + const { connection, user } = context; const currentDayOfMonth = (new Date()).getDate(); if (days < 1 || days > 15) { return context.errorReply(`Days must be between 1 and 15. To search longer ranges, use psbattletools manually on sim3.`); @@ -253,9 +253,9 @@ async function rustBattleSearch( try { await ProcessManager.exec(`psbattletools --version`, { - env: {PATH: `${process.env.PATH}:${process.env.HOME}/.cargo/bin`}, + env: { PATH: `${process.env.PATH}:${process.env.HOME}/.cargo/bin` }, }); - } catch (e) { + } catch { return context.errorReply( `You must install psbattletools to use the alternate battlesearch.` ); @@ -293,7 +293,7 @@ async function rustBattleSearch( const search = child_process.spawn( 'psbattletools', ['--threads', '3', 'search', targetUser, ...directories], - {env: {PATH: `${process.env.PATH}:${process.env.HOME}/.cargo/bin`}} + { env: { PATH: `${process.env.PATH}:${process.env.HOME}/.cargo/bin` } } ); search.stdout.on('data', data => { buf = buf.replace('', `${Chat.formatText(data.toString()).replace(/\n/g, '
')}`); @@ -313,7 +313,7 @@ async function fsBattleSearch( const user = connection.user; if (!user.can('forcewin')) return connection.popup(`/battlesearch - Access Denied`); - const response = await PM.query({userids, turnLimit, month, tierid}); + const response = await PM.query({ userids, turnLimit, month, tierid }); connection.send(buildResults(response, userids as ID[], month, tierid, turnLimit)); } @@ -343,7 +343,7 @@ export const pages: Chat.PageTable = { const months = Utils.sortBy( (await Monitor.logPath('/').readdir()).filter(f => f.length === 7 && f.includes('-')), - name => ({reverse: name}) + name => ({ reverse: name }) ); if (!month) { buf += `

Please select a month:

    `; @@ -455,7 +455,7 @@ export const commands: Chat.ChatCommands = { *********************************************************/ export const PM = new ProcessManager.QueryProcessManager(module, async data => { - const {userids, turnLimit, month, tierid} = data; + const { userids, turnLimit, month, tierid } = data; const start = Date.now(); try { const result = await runBattleSearch(userids, month, tierid, turnLimit); diff --git a/server/chat-plugins/calculator.ts b/server/chat-plugins/calculator.ts index 4099448a82..5ade4434b3 100644 --- a/server/chat-plugins/calculator.ts +++ b/server/chat-plugins/calculator.ts @@ -1,4 +1,4 @@ -import {Utils} from '../../lib'; +import { Utils } from '../../lib'; type Operator = '^' | 'negative' | '%' | '/' | '*' | '+' | '-' | '('; interface Operators { @@ -6,7 +6,7 @@ interface Operators { associativity: "Left" | "Right"; } -const OPERATORS: {[k in Operator]: Operators} = { +const OPERATORS: { [k in Operator]: Operators } = { "^": { precedence: 5, associativity: "Right", @@ -41,7 +41,7 @@ const OPERATORS: {[k in Operator]: Operators} = { }, }; -const BASE_PREFIXES: {[base: number]: string} = { +const BASE_PREFIXES: { [base: number]: string } = { 2: "0b", 8: "0o", 10: "", @@ -119,7 +119,7 @@ function solveRPN(rpn: string[]): [number, number] { if (token.startsWith('0o')) base = 8; let num = Number(token); if (isNaN(num) && token.toUpperCase() in Math) { - // @ts-ignore + // @ts-expect-error Math consts should be safe num = Math[token.toUpperCase()]; } if (isNaN(num) && token !== 'NaN') { diff --git a/server/chat-plugins/cg-teams-leveling.ts b/server/chat-plugins/cg-teams-leveling.ts index d1795ce1c4..935ebabf3d 100644 --- a/server/chat-plugins/cg-teams-leveling.ts +++ b/server/chat-plugins/cg-teams-leveling.ts @@ -4,8 +4,8 @@ * Handles updating the level database for [Gen 9] Computer-Generated Teams. */ -import {SQL} from "../../lib"; -import {getSpeciesName} from "./randombattles/winrates"; +import { SQL } from "../../lib"; +import { getSpeciesName } from "./randombattles/winrates"; export let addPokemon: SQL.Statement | null = null; export let incrementWins: SQL.Statement | null = null; diff --git a/server/chat-plugins/chat-monitor.ts b/server/chat-plugins/chat-monitor.ts index f74c207834..8dcfc9d600 100644 --- a/server/chat-plugins/chat-monitor.ts +++ b/server/chat-plugins/chat-monitor.ts @@ -1,5 +1,5 @@ -import {FS, Utils} from '../../lib'; -import type {FilterWord} from '../chat'; +import { FS, Utils } from '../../lib'; +import type { FilterWord } from '../chat'; const LEGACY_MONITOR_FILE = 'config/chat-plugins/chat-monitor.tsv'; const MONITOR_FILE = 'config/chat-plugins/chat-filter.json'; @@ -7,7 +7,7 @@ const WRITE_THROTTLE_TIME = 5 * 60 * 1000; // Substitution dictionary adapted from https://github.com/ThreeLetters/NoSwearingPlease/blob/master/index.js // Licensed under MIT. -const EVASION_DETECTION_SUBSTITUTIONS: {[k: string]: string[]} = { +const EVASION_DETECTION_SUBSTITUTIONS: { [k: string]: string[] } = { a: ["a", "4", "@", "á", "â", "ã", "à", "ᗩ", "A", "ⓐ", "Ⓐ", "α", "͏", "₳", "ä", "Ä", "Ꮧ", "λ", "Δ", "Ḁ", "Ꭺ", "ǟ", "̾", "a", "A", "ᴀ", "ɐ", "🅐", "𝐚", "𝐀", "𝘢", "𝘈", "𝙖", "𝘼", "𝒶", "𝓪", "𝓐", "𝕒", "𝔸", "𝔞", "𝔄", "𝖆", "𝕬", "🄰", "🅰", "𝒜", "𝚊", "𝙰", "ꍏ", "а", "𝓪"], b: ["b", "8", "ᗷ", "B", "ⓑ", "Ⓑ", "в", "฿", "ḅ", "Ḅ", "Ᏸ", "ϐ", "Ɓ", "ḃ", "Ḃ", "ɮ", "b", "B", "ʙ", "🅑", "𝐛", "𝐁", "𝘣", "𝘉", "𝙗", "𝘽", "𝒷", "𝓫", "𝓑", "𝕓", "𝔹", "𝔟", "𝔅", "𝖇", "𝕭", "🄱", "🅱", "𝐵", "Ⴆ", "𝚋", "𝙱", "♭", "b"], c: ["c", "ç", "ᑕ", "C", "ⓒ", "Ⓒ", "¢", "͏", "₵", "ċ", "Ċ", "ፈ", "ς", "ḉ", "Ḉ", "Ꮯ", "ƈ", "̾", "c", "C", "ᴄ", "ɔ", "🅒", "𝐜", "𝐂", "𝘤", "𝘊", "𝙘", "𝘾", "𝒸", "𝓬", "𝓒", "𝕔", "ℂ", "𝔠", "ℭ", "𝖈", "𝕮", "🄲", "🅲", "𝒞", "𝚌", "𝙲", "☾", "с"], @@ -44,11 +44,11 @@ const EVASION_DETECTION_SUBSTITUTIONS: {[k: string]: string[]} = { z: ["z", "ᘔ", "Z", "ⓩ", "Ⓩ", "Ⱬ", "ẓ", "Ẓ", "ፚ", "Ꮓ", "ʐ", "z", "Z", "ᴢ", "🅩", "𝐳", "𝐙", "𝘻", "𝘡", "𝙯", "𝙕", "𝓏", "𝔃", "𝓩", "𝕫", "𝕋", "𝔷", "𝔙", "𝖟", "𝖅", "🅉", "🆉", "𝒵", "ȥ", "𝚣", "𝚉", "☡", "z", "𝔃"], }; -const filterWords: {[k: string]: Chat.FilterWord[]} = Chat.filterWords; +const filterWords: { [k: string]: Chat.FilterWord[] } = Chat.filterWords; export const Filters = new class { readonly EVASION_DETECTION_SUBSTITUTIONS = EVASION_DETECTION_SUBSTITUTIONS; - readonly EVASION_DETECTION_SUB_STRINGS: {[k: string]: string} = {}; + readonly EVASION_DETECTION_SUB_STRINGS: { [k: string]: string } = {}; constructor() { for (const letter in EVASION_DETECTION_SUBSTITUTIONS) { this.EVASION_DETECTION_SUB_STRINGS[letter] = `[${EVASION_DETECTION_SUBSTITUTIONS[letter].join('')}]`; @@ -82,20 +82,20 @@ export const Filters = new class { save(force = false) { FS(MONITOR_FILE).writeUpdate(() => { - const buf: {[k: string]: FilterWord[]} = {}; + const buf: { [k: string]: FilterWord[] } = {}; for (const key in Chat.monitors) { buf[key] = []; for (const filterWord of filterWords[key]) { - const word = {...filterWord}; + const word = { ...filterWord }; delete (word as any).regex; // no reason to save this. does not stringify. buf[key].push(word); } } return JSON.stringify(buf); - }, {throttle: force ? 0 : WRITE_THROTTLE_TIME}); + }, { throttle: force ? 0 : WRITE_THROTTLE_TIME }); } - add(filterWord: Partial & {list: string, word: string}) { + add(filterWord: Partial & { list: string, word: string }) { if (!filterWord.hits) filterWord.hits = 0; const punishment = Chat.monitors[filterWord.list].punishment; if (!filterWord.regex) { @@ -175,7 +175,7 @@ export const Filters = new class { regex = new RegExp(punishment === 'SHORTENER' ? `\\b${word}` : word, replacement ? 'igu' : 'iu'); } - const filterWord: FilterWord = {regex, word, hits: parseInt(times) || 0}; + const filterWord: FilterWord = { regex, word, hits: parseInt(times) || 0 }; // "undefined" is the result of an issue with filter storage. // As far as I'm aware, nothing is actually filtered with "undefined" as the reason. @@ -201,7 +201,7 @@ Chat.registerMonitor('autolock', { punishment: 'AUTOLOCK', label: 'Autolock', monitor(line, room, user, message, lcMessage, isStaff) { - const {regex, word, reason, publicReason} = line; + const { regex, word, reason, publicReason } = line; const match = regex.exec(lcMessage); if (match) { if (isStaff) return `${message} __[would be locked: ${word}${reason ? ` (${reason})` : ''}]__`; @@ -225,7 +225,7 @@ Chat.registerMonitor('publicwarn', { punishment: 'WARN', label: 'Filtered in public', monitor(line, room, user, message, lcMessage, isStaff) { - const {regex, word, reason, publicReason} = line; + const { regex, word, reason, publicReason } = line; const match = regex.exec(lcMessage); if (match) { if (isStaff) return `${message} __[would be filtered in public: ${word}${reason ? ` (${reason})` : ''}]__`; @@ -240,7 +240,7 @@ Chat.registerMonitor('warn', { punishment: 'WARN', label: 'Filtered', monitor(line, room, user, message, lcMessage, isStaff) { - const {regex, word, reason, publicReason} = line; + const { regex, word, reason, publicReason } = line; const match = regex.exec(lcMessage); if (match) { if (isStaff) return `${message} __[would be filtered: ${word}${reason ? ` (${reason})` : ''}]__`; @@ -255,7 +255,7 @@ Chat.registerMonitor('evasion', { punishment: 'EVASION', label: 'Filter Evasion Detection', monitor(line, room, user, message, lcMessage, isStaff) { - const {regex, word, reason, publicReason} = line; + const { regex, word, reason, publicReason } = line; // Many codepoints used in filter evasion detection can be decomposed // into multiple codepoints that are canonically equivalent to the @@ -296,7 +296,7 @@ Chat.registerMonitor('wordfilter', { label: 'Filtered to a different phrase', condition: 'notStaff', monitor(line, room, user, message, lcMessage, isStaff) { - const {regex, replacement} = line; + const { regex, replacement } = line; let match = regex.exec(message); while (match) { let filtered = replacement || ''; @@ -322,7 +322,7 @@ Chat.registerMonitor('battlefilter', { punishment: 'MUTE', label: 'Filtered in battles', monitor(line, room, user, message, lcMessage, isStaff) { - const {regex, word, reason, publicReason} = line; + const { regex, word, reason, publicReason } = line; const match = regex.exec(lcMessage); if (match) { if (isStaff) return `${message} __[would be filtered: ${word}${reason ? ` (${reason})` : ''}]__`; @@ -353,7 +353,7 @@ Chat.registerMonitor('shorteners', { label: 'URL Shorteners', condition: 'notTrusted', monitor(line, room, user, message, lcMessage, isStaff) { - const {regex, word, publicReason} = line; + const { regex, word, publicReason } = line; if (regex.test(lcMessage)) { if (isStaff) return `${message} __[shortener: ${word}]__`; this.errorReply(`Please do not use URL shorteners such as '${word}'${publicReason ? ` ${publicReason}` : ``}.`); @@ -389,7 +389,7 @@ export const chatfilter: Chat.ChatFilter = function (message, user, room) { const isStaff = isStaffRoom || user.isStaff || !!(this.pmTarget && this.pmTarget.isStaff); for (const list in Chat.monitors) { - const {location, condition, monitor} = Chat.monitors[list]; + const { location, condition, monitor } = Chat.monitors[list]; if (!monitor) continue; // Ignore challenge games, which are unrated and not part of roomtours. if (location === 'BATTLES' && !(room && room.battle && room.battle.challengeType !== 'challenge')) continue; @@ -418,7 +418,6 @@ export const chatfilter: Chat.ChatFilter = function (message, user, room) { } } - return message; }; /* eslint-enable @typescript-eslint/prefer-optional-chain */ @@ -505,7 +504,7 @@ export const nicknamefilter: Chat.NicknameFilter = (name, user) => { if (!Chat.monitors[list]) continue; if (Chat.monitors[list].location === 'BATTLES') continue; for (const line of filterWords[list]) { - let {regex, word} = line; + let { regex, word } = line; if (Chat.monitors[list].punishment === 'EVASION') { // Evasion banwords by default require whitespace on either side. // If we didn't remove it here, it would be quite easy to evade the filter @@ -587,7 +586,7 @@ export const pages: Chat.PageTable = { for (const key in Chat.monitors) { content += `
`; if (filterWords[key].length) { - content += filterWords[key].map(({regex, word, reason, publicReason, replacement, hits}) => { + content += filterWords[key].map(({ regex, word, reason, publicReason, replacement, hits }) => { let entry = Utils.html`${word}`; if (publicReason) entry += Utils.html` (public reason: ${publicReason})`; if (replacement) entry += Utils.html` ⇒ ${replacement}`; @@ -636,7 +635,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`Invalid list: ${list}. Possible options: ${Object.keys(filterWords).join(', ')}`); } - const filterWord = {list, word: ''} as Partial & {list: string, word: string}; + const filterWord = { list, word: '' } as Partial & { list: string, word: string }; rest = rest.map(part => part.trim()); if (Chat.monitors[list].punishment === 'FILTERTO') { diff --git a/server/chat-plugins/chatlog.ts b/server/chat-plugins/chatlog.ts index 88d7466c40..a5068fe997 100644 --- a/server/chat-plugins/chatlog.ts +++ b/server/chat-plugins/chatlog.ts @@ -5,9 +5,9 @@ * @license MIT */ -import {Utils, FS, Dashycode, ProcessManager, Net, Streams} from '../../lib'; -import {SQL} from '../../lib/database'; -import {roomlogTable} from '../roomlogs'; +import { Utils, FS, Dashycode, ProcessManager, Net, Streams } from '../../lib'; +import { SQL } from '../../lib/database'; +import { roomlogTable } from '../roomlogs'; const DAY = 24 * 60 * 60 * 1000; const MAX_MEMORY = 67108864; // 64MB @@ -28,9 +28,9 @@ interface RoomStats { /** * Lines per user. */ - lines: {[k: string]: number}; + lines: { [k: string]: number }; // guessed from |J| (number of joins) - users: {[k: string]: number}; + users: { [k: string]: number }; days: number; /** * Average wait time between each line ("dead") @@ -93,7 +93,7 @@ export class LogReaderRoom { )`WHERE roomid = ${this.roomid} AND time BETWEEN ${dayStart}::int::timestamp AND ${dayEnd}::int::timestamp`; return new Streams.ObjectReadStream({ read(this: Streams.ObjectReadStream) { - for (const {log, time} of logs) { + for (const { log, time } of logs) { this.buf.push(`${Chat.toTimestamp(time).split(' ')[1]} ${log}`); } this.pushEnd(); @@ -175,7 +175,7 @@ export const LogReader = new class { } if (!atLeastOne) return null; - return {official, normal, hidden, secret, deleted, personal, deletedPersonal}; + return { official, normal, hidden, secret, deleted, personal, deletedPersonal }; } /** @returns [dayStart, dayEnd] as seconds (NOT milliseconds) since Unix epoch */ @@ -258,7 +258,7 @@ export const LogViewer = new class { for await (const line of stream) { // sometimes there can be newlines in there. parse accordingly for (const part of line.split('\n')) { - buf += this.renderLine(part, opts, {roomid, date: day}); + buf += this.renderLine(part, opts, { roomid, date: day }); } } } @@ -277,12 +277,12 @@ export const LogViewer = new class { const [timestamp, type, ...rest] = line.split('|'); if (type === 'c:') { const [time, username, ...message] = rest; - return {time: new Date(time), username, message: message.join('|')}; + return { time: new Date(time), username, message: message.join('|') }; } - return {time: new Date(timestamp + day), username: rest[0], message: rest.join('|')}; + return { time: new Date(timestamp + day), username: rest[0], message: rest.join('|') }; } - renderLine(fullLine: string, opts?: string, data?: {roomid: RoomID, date: string}) { + renderLine(fullLine: string, opts?: string, data?: { roomid: RoomID, date: string }) { if (!fullLine) return ``; let timestamp = fullLine.slice(0, 8); let line; @@ -420,7 +420,7 @@ export const LogViewer = new class { let buf = `

` + `All logs


`; - const categories: {[k: string]: string} = { + const categories: { [k: string]: string } = { 'official': "Official", 'normal': "Public", 'hidden': "Hidden", @@ -429,7 +429,7 @@ export const LogViewer = new class { 'personal': "Personal", 'deletedPersonal': "Deleted Personal", }; - const list = await LogReader.listCategorized(user, opts) as {[k: string]: RoomID[]}; + const list = await LogReader.listCategorized(user, opts) as { [k: string]: RoomID[] }; if (!list) { buf += `

You must be a staff member of a room to view its logs

`; @@ -477,7 +477,7 @@ export abstract class Searcher { } abstract searchLinecounts(roomid: RoomID, month: string, user?: ID): Promise; renderLinecountResults( - results: {[date: string]: {[userid: string]: number}} | null, + results: { [date: string]: { [userid: string]: number } } | null, roomid: RoomID, month: string, user?: ID ) { let buf = Utils.html`

Linecounts on `; @@ -511,7 +511,7 @@ export abstract class Searcher { } else { buf += '
    '; // squish the results together - const totalResults: {[k: string]: number} = {}; + const totalResults: { [k: string]: number } = {}; for (const date of Utils.sortBy(Object.keys(results))) { for (const userid in results[date]) { if (!totalResults[userid]) totalResults[userid] = 0; @@ -560,7 +560,7 @@ export abstract class Searcher { } if (nextExists) { buf += `${prevExists ? `` : `
    `}Next month
    `; - }*/ + } */ buf += this.visualizeStats(stats.average); buf += `
    `; buf += `
    Stats by day`; @@ -573,7 +573,7 @@ export abstract class Searcher { return LogViewer.linkify(buf); } visualizeStats(stats: RoomStats) { - const titles: {[k: string]: string} = { + const titles: { [k: string]: string } = { deadTime: 'Average time between lines', deadPercent: 'Average % of the day spent more than 5 minutes inactive', linesPerUser: 'Average lines per user', @@ -587,7 +587,7 @@ export abstract class Searcher { buf += `

${day}

`; buf += `
CategoryNumber
Total Battles${dayStats.totalBattles}

${Chat.monitors[key].label} [${key}]

`; switch (k) { case 'deadTime': - buf += Chat.toDurationString(stats.deadTime, {precision: 2}); + buf += Chat.toDurationString(stats.deadTime, { precision: 2 }); break; case 'linesPerUser': case 'totalLines': case 'averagePresent': case 'deadPercent': @@ -599,7 +599,7 @@ export abstract class Searcher { buf += `
`; return buf; } - abstract activityStats(room: RoomID, month: string): Promise<{average: RoomStats, days: RoomStats[]}>; + abstract activityStats(room: RoomID, month: string): Promise<{ average: RoomStats, days: RoomStats[] }>; } export class FSLogSearcher extends Searcher { @@ -614,7 +614,7 @@ export class FSLogSearcher extends Searcher { return this.renderLinecountResults(null, roomid, month, user); } const files = await directory.readdir(); - const results: {[date: string]: {[userid: string]: number}} = {}; + const results: { [date: string]: { [userid: string]: number } } = {}; for (const file of files) { const day = file.slice(0, -4); const stream = Monitor.logPath(`chat/${roomid}/${month}/${file}`).createReadStream(); @@ -635,7 +635,7 @@ export class FSLogSearcher extends Searcher { async dayStats(room: RoomID, day: string) { const cached = this.roomstatsCache.get(room + '-' + day); if (cached) return cached; - const results: RoomStats & {day: string} = { + const results: RoomStats & { day: string } = { deadTime: 0, deadPercent: 0, lines: {}, @@ -666,7 +666,7 @@ export class FSLogSearcher extends Searcher { break; } case 'c:': case 'c': { - const {time, username} = LogViewer.parseChatLine(line, day); + const { time, username } = LogViewer.parseChatLine(line, day); const curTime = time.getTime(); if (curTime - lastTime > 5 * 60 * 1000) { // more than 5 minutes waitIncrements.push(curTime - lastTime); @@ -690,7 +690,7 @@ export class FSLogSearcher extends Searcher { results.deadTime = waitIncrements.length ? this.calculateDead(waitIncrements) : 0; results.deadPercent = !results.totalLines ? 100 : (waitIncrements.length / results.totalLines) * 100; results.linesPerUser = (results.totalLines / Object.keys(results.users).length) || 0; - results.averagePresent = results.averagePresent / userstatCount; + results.averagePresent /= userstatCount; // we don't cache the current day's stats because that could be inaccurate, whereas old days will always be the same if (day !== LogReader.today()) { @@ -747,17 +747,17 @@ export class FSLogSearcher extends Searcher { collected[k] /= stats.length; } - return {average: collected, days: stats}; + return { average: collected, days: stats }; } } export class RipgrepLogSearcher extends FSLogSearcher { async ripgrepSearchMonth(opts: ChatlogSearch) { - const {search, room: roomid, date: month, args} = opts; + const { search, room: roomid, date: month, args } = opts; let results: string[]; let lineCount = 0; if (Config.disableripgrep) { - return {lineCount: 0, results: []}; + return { lineCount: 0, results: [] }; } const resultSep = args?.includes('-m') ? '--' : '\n'; try { @@ -769,7 +769,7 @@ export class RipgrepLogSearcher extends FSLogSearcher { if (args) { options.push(...args); } - const {stdout} = await ProcessManager.exec(['rg', ...options], { + const { stdout } = await ProcessManager.exec(['rg', ...options], { maxBuffer: MAX_MEMORY, cwd: FS.ROOT_PATH, }); @@ -785,7 +785,7 @@ export class RipgrepLogSearcher extends FSLogSearcher { } } lineCount += results.length; - return {results, lineCount}; + return { results, lineCount }; } async searchLinecounts(room: RoomID, month: string, user?: ID) { // don't need to check if logs exist since ripgrepSearchMonth does that @@ -794,10 +794,10 @@ export class RipgrepLogSearcher extends FSLogSearcher { ) + `(?!\\/uhtml(change)?)`; const args: string[] = user ? ['--count'] : []; args.push(`--pcre2`); - const {results: rawResults} = await this.ripgrepSearchMonth({ + const { results: rawResults } = await this.ripgrepSearchMonth({ search: regexString, raw: true, date: month, room, args, }); - const results: {[k: string]: {[userid: string]: number}} = {}; + const results: { [k: string]: { [userid: string]: number } } = {}; for (const fullLine of rawResults) { const [data, line] = fullLine.split('.txt:'); const date = data.split('/').pop()!; @@ -824,7 +824,7 @@ export class DatabaseLogSearcher extends Searcher { async searchLinecounts(roomid: RoomID, month: string, user?: ID) { user = toID(user); if (!Rooms.Roomlogs.table) throw new Error(`Database search made while database is disabled.`); - const results: {[date: string]: {[user: string]: number}} = {}; + const results: { [date: string]: { [user: string]: number } } = {}; const [monthStart, monthEnd] = LogReader.monthToRange(month); const rows = await Rooms.Roomlogs.table.selectAll()` WHERE ${user ? SQL`userid = ${user} AND ` : SQL``}roomid = ${roomid} AND @@ -844,7 +844,7 @@ export class DatabaseLogSearcher extends Searcher { return this.renderLinecountResults(results, roomid, month, user); } - activityStats(room: RoomID, month: string): Promise<{average: RoomStats, days: RoomStats[]}> { + activityStats(room: RoomID, month: string): Promise<{ average: RoomStats, days: RoomStats[] }> { throw new Chat.ErrorMessage('This is not yet implemented for the new logs database.'); } } @@ -862,11 +862,11 @@ export const pages: Chat.PageTable = { if (!user.named) return Rooms.RETRY_AFTER_LOGIN; let [roomid, date, opts] = Utils.splitFirst(args.join('-'), '--', 2) as [RoomID, string | undefined, string | undefined]; - if (date) date = date.trim(); if (!roomid || roomid.startsWith('-')) { this.title = '[Logs]'; return LogViewer.list(user, roomid?.slice(1)); } + this.title = '[Logs] ' + roomid; // permission check const room = Rooms.get(roomid); @@ -900,25 +900,30 @@ export const pages: Chat.PageTable = { } void accessLog.writeLine(`${user.id}: <${roomid}> ${date}`); - this.title = '[Logs] ' + roomid; + + if (!date) { + return LogViewer.room(roomid); + } + + date = date.trim(); let search; - const parsedDate = new Date(date as string); + const parsedDate = new Date(date); const validDateStrings = ['all', 'alltime']; - const validNonDateTerm = search ? validDateStrings.includes(date!) : date === 'today'; + const validNonDateTerm = search ? validDateStrings.includes(date) : date === 'today'; // this is apparently the best way to tell if a date is invalid - if (date && isNaN(parsedDate.getTime()) && !validNonDateTerm) { + if (isNaN(parsedDate.getTime()) && !validNonDateTerm) { return this.errorReply(`Invalid date.`); } const isTime = opts?.startsWith('time-'); if (isTime && opts) opts = toID(opts.slice(5)); - if (date && search) { + if (search) { Searcher.checkEnabled(); this.checkCan('bypassall'); return LogSearcher.runSearch(); - } else if (date) { + } else { if (date === 'today') { this.setHTML(await LogViewer.day(roomid, LogReader.today(), opts)); if (isTime) this.send(`|scroll|div[data-server="${opts}"]`); @@ -928,8 +933,6 @@ export const pages: Chat.PageTable = { } else { return LogViewer.month(roomid, parsedDate.toISOString().slice(0, 7)); } - } else { - return LogViewer.room(roomid); } }, roomstats(args, user) { @@ -1077,7 +1080,7 @@ export const commands: Chat.ChatCommands = { roomstats: 'linecount', linecount(target, room, user) { const params = target.split(',').map(f => f.trim()); - const search: Partial<{roomid: RoomID, date: string, user: string}> = {}; + const search: Partial<{ roomid: RoomID, date: string, user: string }> = {}; for (const [i, param] of params.entries()) { let [key, val] = param.split('='); if (!val) { @@ -1162,7 +1165,6 @@ export const commands: Chat.ChatCommands = { `Requires: % @ ~`, ], - gbc: 'getbattlechat', async getbattlechat(target, room, user) { this.checkCan('lock'); @@ -1255,7 +1257,6 @@ export const commands: Chat.ChatCommands = { `Requires: ~`, ], - gcsearch: 'groupchatsearch', async groupchatsearch(target, room, user) { this.checkCan('lock'); diff --git a/server/chat-plugins/daily-spotlight.ts b/server/chat-plugins/daily-spotlight.ts index 380b6c8236..92b8ba0116 100644 --- a/server/chat-plugins/daily-spotlight.ts +++ b/server/chat-plugins/daily-spotlight.ts @@ -1,4 +1,4 @@ -import {FS, Utils} from '../../lib'; +import { FS, Utils } from '../../lib'; const DAY = 24 * 60 * 60 * 1000; const SPOTLIGHT_FILE = 'config/chat-plugins/spotlights.json'; @@ -14,7 +14,7 @@ interface Spotlight { } export let spotlights: { - [roomid: string]: {[k: string]: Spotlight[]}, + [roomid: string]: { [k: string]: Spotlight[] }, } = {}; try { @@ -56,7 +56,7 @@ let timeout = setTimeout(nextDaily, midnight.getTime() - Date.now()); export async function renderSpotlight(roomid: RoomID, key: string, index: number) { let imgHTML = ''; - const {image, description} = spotlights[roomid][key][index]; + const { image, description } = spotlights[roomid][key][index]; if (image) { if (Array.isArray(image)) { @@ -66,6 +66,7 @@ export async function renderSpotlight(roomid: RoomID, key: string, index: number try { const [width, height] = await Chat.fitImage(image, 150, 300); imgHTML = ``; + // eslint-disable-next-line require-atomic-updates spotlights[roomid][key][index].image = [image, width, height]; } catch {} } @@ -249,7 +250,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply("Descriptions can be at most 500 characters long."); } if (img) img = [img, width, height] as StoredImage; - const obj = {image: img, description: desc, time: Date.now()}; + const obj = { image: img, description: desc, time: Date.now() }; if (!spotlights[room.roomid][key]) spotlights[room.roomid][key] = []; if (cmd === 'setdaily') { spotlights[room.roomid][key].shift(); @@ -286,7 +287,7 @@ export const commands: Chat.ChatCommands = { if (!this.runBroadcast()) return; - const {image, description} = spotlights[room.roomid][key][0]; + const { image, description } = spotlights[room.roomid][key][0]; const html = await renderSpotlight(room.roomid, key, 0); this.sendReplyBox(html); diff --git a/server/chat-plugins/datasearch.ts b/server/chat-plugins/datasearch.ts index 8d5162cdfd..f94ff0d5f3 100644 --- a/server/chat-plugins/datasearch.ts +++ b/server/chat-plugins/datasearch.ts @@ -8,41 +8,41 @@ * @license MIT */ -import {ProcessManager, Utils} from '../../lib'; -import {TeamValidator} from '../../sim/team-validator'; -import {Chat} from '../chat'; +import { ProcessManager, Utils } from '../../lib'; +import { TeamValidator } from '../../sim/team-validator'; +import { Chat } from '../chat'; interface DexOrGroup { - abilities: {[k: string]: boolean}; - tiers: {[k: string]: boolean}; - doublesTiers: {[k: string]: boolean}; - colors: {[k: string]: boolean}; - 'egg groups': {[k: string]: boolean}; - formes: {[k: string]: boolean}; - gens: {[k: string]: boolean}; - moves: {[k: string]: boolean}; - types: {[k: string]: boolean}; - resists: {[k: string]: boolean}; - weak: {[k: string]: boolean}; - stats: {[k: string]: {[k in Direction]: number}}; + abilities: { [k: string]: boolean }; + tiers: { [k: string]: boolean }; + doublesTiers: { [k: string]: boolean }; + colors: { [k: string]: boolean }; + 'egg groups': { [k: string]: boolean }; + formes: { [k: string]: boolean }; + gens: { [k: string]: boolean }; + moves: { [k: string]: boolean }; + types: { [k: string]: boolean }; + resists: { [k: string]: boolean }; + weak: { [k: string]: boolean }; + stats: { [k: string]: { [k in Direction]: number } }; skip: boolean; } interface MoveOrGroup { - types: {[k: string]: boolean}; - categories: {[k: string]: boolean}; - contestTypes: {[k: string]: boolean}; - flags: {[k: string]: boolean}; - gens: {[k: string]: boolean}; - other: {[k: string]: boolean}; - mon: {[k: string]: boolean}; - property: {[k: string]: {[k in Direction]: number}}; - boost: {[k: string]: boolean}; - lower: {[k: string]: boolean}; - zboost: {[k: string]: boolean}; - status: {[k: string]: boolean}; - volatileStatus: {[k: string]: boolean}; - targets: {[k: string]: boolean}; + types: { [k: string]: boolean }; + categories: { [k: string]: boolean }; + contestTypes: { [k: string]: boolean }; + flags: { [k: string]: boolean }; + gens: { [k: string]: boolean }; + other: { [k: string]: boolean }; + mon: { [k: string]: boolean }; + property: { [k: string]: { [k in Direction]: number } }; + boost: { [k: string]: boolean }; + lower: { [k: string]: boolean }; + zboost: { [k: string]: boolean }; + status: { [k: string]: boolean }; + volatileStatus: { [k: string]: boolean }; + targets: { [k: string]: boolean }; skip: boolean; multihit: boolean; } @@ -63,7 +63,7 @@ function toListString(arr: string[]) { function checkCanAll(room: Room | null) { if (!room) return false; // no, no good reason for using `all` in pms - const {isPersonal, isHelp} = room.settings; + const { isPersonal, isHelp } = room.settings; // allowed if it's a groupchat return !room.battle && !!isPersonal && !isHelp; } @@ -515,12 +515,12 @@ export const commands: Chat.ChatCommands = { if (!target) return this.parse('/help learn'); if (target.length > 300) throw new Chat.ErrorMessage(`Query too long.`); - const GENS: {[k: string]: number} = {rby: 1, gsc: 2, adv: 3, dpp: 4, bw2: 5, oras: 6, usum: 7, ss: 8}; + const GENS: { [k: string]: number } = { rby: 1, gsc: 2, adv: 3, dpp: 4, bw2: 5, oras: 6, usum: 7, ss: 8 }; const cmdGen = GENS[cmd.slice(0, -5)]; if (cmdGen) target = `gen${cmdGen}, ${target}`; this.checkBroadcast(); - const {format, dex, targets} = this.splitFormat(target); + const { format, dex, targets } = this.splitFormat(target); const formatid = format ? format.id : dex.currentMod; if (cmd === 'learn5') targets.unshift('level5'); @@ -604,18 +604,18 @@ function getMod(target: string) { return sanitizedStr.startsWith('mod='); }).length; if (modTerm) arr.splice(arr.indexOf(modTerm), 1); - return {splitTarget: arr, usedMod: modTerm ? toID(modTerm.split(/ ?= ?/)[1]) : undefined, count}; + return { splitTarget: arr, usedMod: modTerm ? toID(modTerm.split(/ ?= ?/)[1]) : undefined, count }; } function runDexsearch(target: string, cmd: string, canAll: boolean, message: string, isTest: boolean) { const searches: DexOrGroup[] = []; - const {splitTarget, usedMod, count: c} = getMod(target); + const { splitTarget, usedMod, count: c } = getMod(target); if (c > 1) { - return {error: `You can't run searches for multiple mods.`}; + return { error: `You can't run searches for multiple mods.` }; } const mod = Dex.mod(usedMod || 'base'); - const allTiers: {[k: string]: TierTypes.Singles | TierTypes.Other} = Object.assign(Object.create(null), { + const allTiers: { [k: string]: TierTypes.Singles | TierTypes.Other } = Object.assign(Object.create(null), { anythinggoes: 'AG', ag: 'AG', uber: 'Uber', ubers: 'Uber', ou: 'OU', uubl: 'UUBL', uu: 'UU', @@ -627,7 +627,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str lc: 'LC', cap: 'CAP', caplc: 'CAP LC', capnfe: 'CAP NFE', }); - const allDoublesTiers: {[k: string]: TierTypes.Singles | TierTypes.Other} = Object.assign(Object.create(null), { + const allDoublesTiers: { [k: string]: TierTypes.Singles | TierTypes.Other } = Object.assign(Object.create(null), { doublesubers: 'DUber', doublesuber: 'DUber', duber: 'DUber', dubers: 'DUber', doublesou: 'DOU', dou: 'DOU', doublesbl: 'DBL', dbl: 'DBL', @@ -639,7 +639,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str allTypes[type.id] = type.name; } const allColors = ['green', 'red', 'blue', 'white', 'brown', 'yellow', 'purple', 'pink', 'gray', 'black']; - const allEggGroups: {[k: string]: string} = Object.assign(Object.create(null), { + const allEggGroups: { [k: string]: string } = Object.assign(Object.create(null), { amorphous: 'Amorphous', bug: 'Bug', ditto: 'Ditto', @@ -658,7 +658,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str }); const allFormes = ['alola', 'galar', 'hisui', 'paldea', 'primal', 'therian', 'totem']; const allStats = ['hp', 'atk', 'def', 'spa', 'spd', 'spe', 'bst', 'weight', 'height', 'gen']; - const allStatAliases: {[k: string]: string} = { + const allStatAliases: { [k: string]: string } = { attack: 'atk', defense: 'def', specialattack: 'spa', spc: 'spa', special: 'spa', spatk: 'spa', specialdefense: 'spd', spdef: 'spd', speed: 'spe', wt: 'weight', ht: 'height', generation: 'gen', }; @@ -701,7 +701,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str gens: {}, moves: {}, types: {}, resists: {}, weak: {}, stats: {}, skip: false, }; const parameters = andGroup.split("|"); - if (parameters.length > 3) return {error: "No more than 3 alternatives for each parameter may be used."}; + if (parameters.length > 3) return { error: "No more than 3 alternatives for each parameter may be used." }; for (const parameter of parameters) { let isNotSearch = false; target = parameter.trim().toLowerCase(); @@ -713,7 +713,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str const targetAbility = mod.abilities.get(target); if (targetAbility.exists) { const invalid = validParameter("abilities", targetAbility.id, isNotSearch, targetAbility.name); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.abilities[targetAbility.name] = !isNotSearch; continue; } @@ -721,11 +721,11 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (toID(target) in allTiers) { target = allTiers[toID(target)]; if (target.startsWith("CAP")) { - if (capSearch === isNotSearch) return {error: "A search cannot both include and exclude CAP tiers."}; + if (capSearch === isNotSearch) return { error: "A search cannot both include and exclude CAP tiers." }; capSearch = !isNotSearch; } const invalid = validParameter("tiers", target, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; tierSearch = tierSearch || !isNotSearch; orGroup.tiers[target] = !isNotSearch; continue; @@ -734,7 +734,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (toID(target) in allDoublesTiers) { target = allDoublesTiers[toID(target)]; const invalid = validParameter("doubles tiers", target, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; tierSearch = tierSearch || !isNotSearch; orGroup.doublesTiers[target] = !isNotSearch; continue; @@ -743,7 +743,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (allColors.includes(target)) { target = target.charAt(0).toUpperCase() + target.slice(1); const invalid = validParameter("colors", target, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.colors[target] = !isNotSearch; continue; } @@ -751,7 +751,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str const targetMove = mod.moves.get(target); if (targetMove.exists) { const invalid = validParameter("moves", targetMove.id, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.moves[targetMove.id] = !isNotSearch; continue; } @@ -765,31 +765,31 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (targetType in allTypes) { target = allTypes[targetType]; const invalid = validParameter("types", target, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; if ((orGroup.types[target] && isNotSearch) || (orGroup.types[target] === false && !isNotSearch)) { - return {error: 'A search cannot both exclude and include a type.'}; + return { error: 'A search cannot both exclude and include a type.' }; } orGroup.types[target] = !isNotSearch; continue; } if (['mono', 'monotype'].includes(toID(target))) { - if (singleTypeSearch === isNotSearch) return {error: "A search cannot include and exclude 'monotype'."}; - if (parameters.length > 1) return {error: "The parameter 'monotype' cannot have alternative parameters."}; + if (singleTypeSearch === isNotSearch) return { error: "A search cannot include and exclude 'monotype'." }; + if (parameters.length > 1) return { error: "The parameter 'monotype' cannot have alternative parameters." }; singleTypeSearch = !isNotSearch; orGroup.skip = true; continue; } if (target === 'natdex') { - if (parameters.length > 1) return {error: "The parameter 'natdex' cannot have alternative parameters."}; + if (parameters.length > 1) return { error: "The parameter 'natdex' cannot have alternative parameters." }; nationalSearch = true; orGroup.skip = true; continue; } if (target === 'unreleased') { - if (parameters.length > 1) return {error: "The parameter 'unreleased' cannot have alternative parameters."}; + if (parameters.length > 1) return { error: "The parameter 'unreleased' cannot have alternative parameters." }; unreleasedSearch = true; orGroup.skip = true; continue; @@ -802,17 +802,17 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (target in allEggGroups) { target = allEggGroups[toID(target)]; const invalid = validParameter("egg groups", target, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup['egg groups'][target] = !isNotSearch; continue; } else { - return {error: `'${target}' is not a recognized egg group.`}; + return { error: `'${target}' is not a recognized egg group.` }; } } if (toID(target) in allEggGroups) { target = allEggGroups[toID(target)]; const invalid = validParameter("egg groups", target, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup['egg groups'][target] = !isNotSearch; continue; } @@ -825,25 +825,25 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str } if (0 < targetInt && targetInt <= mod.gen) { const invalid = validParameter("gens", String(targetInt), isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.gens[targetInt] = !isNotSearch; continue; } if (target.endsWith(' asc') || target.endsWith(' desc')) { if (parameters.length > 1) { - return {error: `The parameter '${target.split(' ')[1]}' cannot have alternative parameters.`}; + return { error: `The parameter '${target.split(' ')[1]}' cannot have alternative parameters.` }; } const stat = allStatAliases[toID(target.split(' ')[0])] || toID(target.split(' ')[0]); - if (!allStats.includes(stat)) return {error: `'${target}' did not contain a valid stat.`}; + if (!allStats.includes(stat)) return { error: `'${target}' did not contain a valid stat.` }; sort = `${stat}${target.endsWith(' asc') ? '+' : '-'}`; orGroup.skip = true; break; } if (target === 'all') { - if (!canAll) return {error: "A search with the parameter 'all' cannot be broadcast."}; - if (parameters.length > 1) return {error: "The parameter 'all' cannot have alternative parameters."}; + if (!canAll) return { error: "A search with the parameter 'all' cannot be broadcast." }; + if (parameters.length > 1) return { error: "The parameter 'all' cannot have alternative parameters." }; showAll = true; orGroup.skip = true; break; @@ -863,24 +863,24 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str } if (target === 'megas' || target === 'mega') { - if (megaSearch === isNotSearch) return {error: "A search cannot include and exclude 'mega'."}; - if (parameters.length > 1) return {error: "The parameter 'mega' cannot have alternative parameters."}; + if (megaSearch === isNotSearch) return { error: "A search cannot include and exclude 'mega'." }; + if (parameters.length > 1) return { error: "The parameter 'mega' cannot have alternative parameters." }; megaSearch = !isNotSearch; orGroup.skip = true; break; } if (target === 'gmax' || target === 'gigantamax') { - if (gmaxSearch === isNotSearch) return {error: "A search cannot include and exclude 'gigantamax'."}; - if (parameters.length > 1) return {error: "The parameter 'gigantamax' cannot have alternative parameters."}; + if (gmaxSearch === isNotSearch) return { error: "A search cannot include and exclude 'gigantamax'." }; + if (parameters.length > 1) return { error: "The parameter 'gigantamax' cannot have alternative parameters." }; gmaxSearch = !isNotSearch; orGroup.skip = true; break; } if (['fully evolved', 'fullyevolved', 'fe'].includes(target)) { - if (fullyEvolvedSearch === isNotSearch) return {error: "A search cannot include and exclude 'fully evolved'."}; - if (parameters.length > 1) return {error: "The parameter 'fully evolved' cannot have alternative parameters."}; + if (fullyEvolvedSearch === isNotSearch) return { error: "A search cannot include and exclude 'fully evolved'." }; + if (parameters.length > 1) return { error: "The parameter 'fully evolved' cannot have alternative parameters." }; fullyEvolvedSearch = !isNotSearch; orGroup.skip = true; break; @@ -893,10 +893,10 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str ]; for (const move of recoveryMoves) { const invalid = validParameter("moves", move, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; if (isNotSearch) { orGroup.skip = true; - const bufferObj: {moves: {[k: string]: boolean}} = {moves: {}}; + const bufferObj: { moves: { [k: string]: boolean } } = { moves: {} }; bufferObj.moves[move] = false; searches.push(bufferObj as DexOrGroup); } else { @@ -913,10 +913,10 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str ]; for (const moveid of recoveryMoves) { const invalid = validParameter("moves", moveid, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; if (isNotSearch) { orGroup.skip = true; - const bufferObj: {moves: {[k: string]: boolean}} = {moves: {}}; + const bufferObj: { moves: { [k: string]: boolean } } = { moves: {} }; bufferObj.moves[moveid] = false; searches.push(bufferObj as DexOrGroup); } else { @@ -932,10 +932,10 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (move.category === "Status" || move.id === "bide") continue; if (move.priority > 0) { const invalid = validParameter("moves", moveid, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; if (isNotSearch) { orGroup.skip = true; - const bufferObj: {moves: {[k: string]: boolean}} = {moves: {}}; + const bufferObj: { moves: { [k: string]: boolean } } = { moves: {} }; bufferObj.moves[moveid] = false; searches.push(bufferObj as DexOrGroup); } else { @@ -950,22 +950,22 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str const targetResist = target.substr(8, 1).toUpperCase() + target.substr(9); if (mod.types.isName(targetResist)) { const invalid = validParameter("resists", targetResist, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.resists[targetResist] = !isNotSearch; continue; } else { if (toID(targetResist) in mod.data.Moves) { const move = mod.moves.get(targetResist); if (move.category === 'Status') { - return {error: `'${targetResist}' is a status move and can't be used with 'resists'.`}; + return { error: `'${targetResist}' is a status move and can't be used with 'resists'.` }; } else { const invalid = validParameter("resists", targetResist, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.resists[targetResist] = !isNotSearch; continue; } } else { - return {error: `'${targetResist}' is not a recognized type or move.`}; + return { error: `'${targetResist}' is not a recognized type or move.` }; } } } @@ -974,22 +974,22 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str const targetWeak = target.substr(5, 1).toUpperCase() + target.substr(6); if (mod.types.isName(targetWeak)) { const invalid = validParameter("weak", targetWeak, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.weak[targetWeak] = !isNotSearch; continue; } else { if (toID(targetWeak) in mod.data.Moves) { const move = mod.moves.get(targetWeak); if (move.category === 'Status') { - return {error: `'${targetWeak}' is a status move and can't be used with 'weak'.`}; + return { error: `'${targetWeak}' is a status move and can't be used with 'weak'.` }; } else { const invalid = validParameter("weak", targetWeak, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; orGroup.weak[targetWeak] = !isNotSearch; continue; } } else { - return {error: `'${targetWeak}' is not a recognized type or move.`}; + return { error: `'${targetWeak}' is not a recognized type or move.` }; } } } @@ -999,10 +999,10 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str const moveData = mod.moves.get(move); if (moveData.selfSwitch && moveData.id !== 'revivalblessing' && moveData.id !== 'batonpass') { const invalid = validParameter("moves", move, isNotSearch, target); - if (invalid) return {error: invalid}; + if (invalid) return { error: invalid }; if (isNotSearch) { orGroup.skip = true; - const bufferObj: {moves: {[k: string]: boolean}} = {moves: {}}; + const bufferObj: { moves: { [k: string]: boolean } } = { moves: {} }; bufferObj.moves[move] = false; searches.push(bufferObj as DexOrGroup); } else { @@ -1016,7 +1016,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str const inequality = target.search(/>|<|=/); let inequalityString; if (inequality >= 0) { - if (isNotSearch) return {error: "You cannot use the negation symbol '!' in stat ranges."}; + if (isNotSearch) return { error: "You cannot use the negation symbol '!' in stat ranges." }; if (target.charAt(inequality + 1) === '=') { inequalityString = target.substr(inequality, 2); } else { @@ -1039,19 +1039,19 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (inequalityString.startsWith('<')) directions.push('less'); if (inequalityString.startsWith('>')) directions.push('greater'); } else { - return {error: `No value given to compare with '${target}'.`}; + return { error: `No value given to compare with '${target}'.` }; } if (inequalityString.endsWith('=')) directions.push('equal'); if (stat in allStatAliases) stat = allStatAliases[stat]; - if (!allStats.includes(stat)) return {error: `'${target}' did not contain a valid stat.`}; + if (!allStats.includes(stat)) return { error: `'${target}' did not contain a valid stat.` }; if (!orGroup.stats[stat]) orGroup.stats[stat] = Object.create(null); for (const direction of directions) { - if (orGroup.stats[stat][direction]) return {error: `Invalid stat range for ${stat}.`}; + if (orGroup.stats[stat][direction]) return { error: `Invalid stat range for ${stat}.` }; orGroup.stats[stat][direction] = num; } continue; } - return {error: `'${target}' could not be found in any of the search categories.`}; + return { error: `'${target}' could not be found in any of the search categories.` }; } if (!orGroup.skip) { searches.push(orGroup); @@ -1066,7 +1066,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str }; } - const dex: {[k: string]: Species} = {}; + const dex: { [k: string]: Species } = {}; for (const species of mod.species.all()) { const megaSearchResult = megaSearch === null || megaSearch === !!species.isMega; const gmaxSearchResult = gmaxSearch === null || gmaxSearch === species.name.endsWith('-Gmax'); @@ -1137,7 +1137,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (Object.values(alts.tiers).includes(false) && alts.tiers[tier] !== false) continue; // LC handling, checks for LC Pokemon in higher tiers that need to be handled separately, // as well as event-only Pokemon that are not eligible for LC despite being the first stage - let format = Dex.formats.get('gen' + mod.gen + 'lc'); + let format = Dex.formats.get(`gen${mod.gen}lc`); if (format.effectType !== 'Format') format = Dex.formats.get('gen9lc'); if ( alts.tiers.LC && @@ -1183,7 +1183,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str for (const defenderType of dex[mon].types) { const baseMod = mod.getEffectiveness(attackingType, defenderType); const moveMod = move.onEffectiveness?.call( - {dex: mod} as Battle, baseMod, null, defenderType, move as ActiveMove, + { dex: mod } as Battle, baseMod, null, defenderType, move as ActiveMove, ); effectiveness += typeof moveMod === 'number' ? moveMod : baseMod; } @@ -1206,7 +1206,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str for (const defenderType of dex[mon].types) { const baseMod = mod.getEffectiveness(attackingType, defenderType); const moveMod = move.onEffectiveness?.call( - {dex: mod} as Battle, baseMod, null, defenderType, move as ActiveMove, + { dex: mod } as Battle, baseMod, null, defenderType, move as ActiveMove, ); effectiveness += typeof moveMod === 'number' ? moveMod : baseMod; } @@ -1311,7 +1311,7 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str if (!isRegionalForm && !maskForm && dex[mon].baseSpecies && results.includes(dex[mon].baseSpecies) && getSortValue(mon) === getSortValue(dex[mon].baseSpecies)) continue; const teraFormeChangesFrom = dex[mon].forme.endsWith("Tera") ? !Array.isArray(dex[mon].battleOnly) ? - dex[mon].battleOnly as string : null : null; + dex[mon].battleOnly! : null : null; if (teraFormeChangesFrom && results.includes(teraFormeChangesFrom) && getSortValue(mon) === getSortValue(teraFormeChangesFrom)) continue; if (dex[mon].isNonstandard === 'Gigantamax' && !allowGmax) continue; @@ -1322,8 +1322,8 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str results = results.filter(name => { const species = mod.species.get(name); return (species.num <= 151 || ['Meltan', 'Melmetal'].includes(species.name)) && - (!species.forme || (['Alola', 'Mega', 'Mega-X', 'Mega-Y', 'Starter'].includes(species.forme) && - species.name !== 'Pikachu-Alola')); + (!species.forme || (['Alola', 'Mega', 'Mega-X', 'Mega-Y', 'Starter'].includes(species.forme) && + species.name !== 'Pikachu-Alola')); }); } @@ -1359,19 +1359,19 @@ function runDexsearch(target: string, cmd: string, canAll: boolean, message: str resultsStr += `, and ${notShown} more. Redo the search with ', all' at the end to show all results.`; } } else if (results.length === 1) { - return {dt: `${results[0]}${usedMod ? `,${usedMod}` : ''}`}; + return { dt: `${results[0]}${usedMod ? `,${usedMod}` : ''}` }; } else { resultsStr += "No Pokémon found."; } - if (isTest) return {results, reply: resultsStr}; - return {reply: resultsStr}; + if (isTest) return { results, reply: resultsStr }; + return { reply: resultsStr }; } function runMovesearch(target: string, cmd: string, canAll: boolean, message: string, isTest: boolean) { const searches: MoveOrGroup[] = []; - const {splitTarget, usedMod, count} = getMod(target); + const { splitTarget, usedMod, count } = getMod(target); if (count > 1) { - return {error: `You can't run searches for multiple mods.`}; + return { error: `You can't run searches for multiple mods.` }; } const mod = Dex.mod(usedMod || 'base'); @@ -1391,7 +1391,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st const allStatus = ['psn', 'tox', 'brn', 'par', 'frz', 'slp']; const allVolatileStatus = ['flinch', 'confusion', 'partiallytrapped']; const allBoosts = ['hp', 'atk', 'def', 'spa', 'spd', 'spe', 'accuracy', 'evasion']; - const allTargets: {[k: string]: string} = { + const allTargets: { [k: string]: string } = { oneally: 'adjacentAlly', userorally: 'adjacentAllyOrSelf', oneadjacentopponent: 'adjacentFoe', @@ -1408,13 +1408,13 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st scripted: 'scripted', user: 'self', }; - const allTypes: {[k: string]: string} = Object.create(null); + const allTypes: { [k: string]: string } = Object.create(null); for (const type of mod.types.all()) { allTypes[type.id] = type.name; } let showAll = false; let sort: string | null = null; - const targetMons: {name: string, shouldBeExcluded: boolean}[] = []; + const targetMons: { name: string, shouldBeExcluded: boolean }[] = []; let nationalSearch = null; let randomOutput = 0; for (const arg of splitTarget) { @@ -1423,7 +1423,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st boost: {}, lower: {}, zboost: {}, status: {}, volatileStatus: {}, targets: {}, skip: false, multihit: false, }; const parameters = arg.split("|"); - if (parameters.length > 3) return {error: "No more than 3 alternatives for each parameter may be used."}; + if (parameters.length > 3) return { error: "No more than 3 alternatives for each parameter may be used." }; for (const parameter of parameters) { let isNotSearch = false; target = parameter.toLowerCase().trim(); @@ -1440,7 +1440,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (allTypes[targetType]) { target = allTypes[targetType]; if ((orGroup.types[target] && isNotSearch) || (orGroup.types[target] === false && !isNotSearch)) { - return {error: 'A search cannot both exclude and include a type.'}; + return { error: 'A search cannot both exclude and include a type.' }; } orGroup.types[target] = !isNotSearch; continue; @@ -1452,7 +1452,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st (orGroup.categories[target] && isNotSearch) || (orGroup.categories[target] === false && !isNotSearch) ) { - return {error: 'A search cannot both exclude and include a category.'}; + return { error: 'A search cannot both exclude and include a category.' }; } orGroup.categories[target] = !isNotSearch; continue; @@ -1464,7 +1464,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st (orGroup.contestTypes[target] && isNotSearch) || (orGroup.contestTypes[target] === false && !isNotSearch) ) { - return {error: 'A search cannot both exclude and include a contest condition.'}; + return { error: 'A search cannot both exclude and include a contest condition.' }; } orGroup.contestTypes[target] = !isNotSearch; continue; @@ -1481,12 +1481,12 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st (orGroup.targets[moveTarget] && isNotSearch) || (orGroup.targets[moveTarget] === false && !isNotSearch) ) { - return {error: 'A search cannot both exclude and include a move target.'}; + return { error: 'A search cannot both exclude and include a move target.' }; } orGroup.targets[moveTarget] = !isNotSearch; continue; } else { - return {error: `'${target}' isn't a valid move target.`}; + return { error: `'${target}' isn't a valid move target.` }; } } @@ -1502,7 +1502,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (target === 'bounceable' || toID(target) === 'magiccoat' || toID(target) === 'magicbounce') target = 'reflectable'; if (allFlags.includes(target)) { if ((orGroup.flags[target] && isNotSearch) || (orGroup.flags[target] === false && !isNotSearch)) { - return {error: `A search cannot both exclude and include '${target}'.`}; + return { error: `A search cannot both exclude and include '${target}'.` }; } orGroup.flags[target] = !isNotSearch; continue; @@ -1517,22 +1517,22 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (0 < targetInt && targetInt <= mod.gen) { if ((orGroup.gens[targetInt] && isNotSearch) || (orGroup.flags[targetInt] === false && !isNotSearch)) { - return {error: `A search cannot both exclude and include '${target}'.`}; + return { error: `A search cannot both exclude and include '${target}'.` }; } orGroup.gens[targetInt] = !isNotSearch; continue; } if (target === 'all') { - if (!canAll) return {error: "A search with the parameter 'all' cannot be broadcast."}; - if (parameters.length > 1) return {error: "The parameter 'all' cannot have alternative parameters."}; + if (!canAll) return { error: "A search with the parameter 'all' cannot be broadcast." }; + if (parameters.length > 1) return { error: "The parameter 'all' cannot have alternative parameters." }; showAll = true; orGroup.skip = true; continue; } if (target === 'natdex') { - if (parameters.length > 1) return {error: "The parameter 'natdex' cannot have alternative parameters."}; + if (parameters.length > 1) return { error: "The parameter 'natdex' cannot have alternative parameters." }; nationalSearch = !isNotSearch; orGroup.skip = true; continue; @@ -1540,7 +1540,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (target.endsWith(' asc') || target.endsWith(' desc')) { if (parameters.length > 1) { - return {error: `The parameter '${target.split(' ')[1]}' cannot have alternative parameters.`}; + return { error: `The parameter '${target.split(' ')[1]}' cannot have alternative parameters.` }; } let prop = target.split(' ')[0]; switch (toID(prop)) { @@ -1549,7 +1549,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st case 'power': prop = 'basePower'; break; case 'acc': prop = 'accuracy'; break; } - if (!allProperties.includes(prop)) return {error: `'${target}' did not contain a valid property.`}; + if (!allProperties.includes(prop)) return { error: `'${target}' did not contain a valid property.` }; sort = `${prop}${target.endsWith(' asc') ? '+' : '-'}`; orGroup.skip = true; break; @@ -1559,7 +1559,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (orGroup.other.recovery === undefined) { orGroup.other.recovery = !isNotSearch; } else if ((orGroup.other.recovery && isNotSearch) || (!orGroup.other.recovery && !isNotSearch)) { - return {error: 'A search cannot both exclude and include recovery moves.'}; + return { error: 'A search cannot both exclude and include recovery moves.' }; } continue; } @@ -1568,7 +1568,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (orGroup.other.recoil === undefined) { orGroup.other.recoil = !isNotSearch; } else if ((orGroup.other.recoil && isNotSearch) || (!orGroup.other.recoil && !isNotSearch)) { - return {error: 'A search cannot both exclude and include recoil moves.'}; + return { error: 'A search cannot both exclude and include recoil moves.' }; } continue; } @@ -1584,7 +1584,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (orGroup.other.zrecovery === undefined) { orGroup.other.zrecovery = !isNotSearch; } else if ((orGroup.other.zrecovery && isNotSearch) || (!orGroup.other.zrecovery && !isNotSearch)) { - return {error: 'A search cannot both exclude and include z-recovery moves.'}; + return { error: 'A search cannot both exclude and include z-recovery moves.' }; } continue; } @@ -1593,7 +1593,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (orGroup.other.pivot === undefined) { orGroup.other.pivot = !isNotSearch; } else if ((orGroup.other.pivot && isNotSearch) || (!orGroup.other.pivot && !isNotSearch)) { - return {error: 'A search cannot both exclude and include pivot moves.'}; + return { error: 'A search cannot both exclude and include pivot moves.' }; } continue; } @@ -1602,21 +1602,21 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (!orGroup.multihit) { orGroup.multihit = true; } else if ((orGroup.multihit && isNotSearch) || (!orGroup.multihit && !isNotSearch)) { - return {error: 'A search cannot both exclude and include multi-hit moves.'}; + return { error: 'A search cannot both exclude and include multi-hit moves.' }; } continue; } const species = mod.species.get(target); if (species.exists) { - if (parameters.length > 1) return {error: "A Pok\u00e9mon learnset cannot have alternative parameters."}; + if (parameters.length > 1) return { error: "A Pok\u00e9mon learnset cannot have alternative parameters." }; if (targetMons.some(mon => mon.name === species.name && isNotSearch !== mon.shouldBeExcluded)) { - return {error: "A search cannot both exclude and include the same Pok\u00e9mon."}; + return { error: "A search cannot both exclude and include the same Pok\u00e9mon." }; } if (targetMons.some(mon => mon.name === species.name)) { - return {error: "A search should not include a Pok\u00e9mon twice."}; + return { error: "A search should not include a Pok\u00e9mon twice." }; } - targetMons.push({name: species.name, shouldBeExcluded: isNotSearch}); + targetMons.push({ name: species.name, shouldBeExcluded: isNotSearch }); orGroup.skip = true; continue; } @@ -1624,7 +1624,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st const inequality = target.search(/>|<|=/); if (inequality >= 0) { let inequalityString; - if (isNotSearch) return {error: "You cannot use the negation symbol '!' in stat ranges."}; + if (isNotSearch) return { error: "You cannot use the negation symbol '!' in stat ranges." }; if (target.charAt(inequality + 1) === '=') { inequalityString = target.substr(inequality, 2); } else { @@ -1647,7 +1647,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (inequalityString.startsWith('<')) directions.push('less'); if (inequalityString.startsWith('>')) directions.push('greater'); } else { - return {error: `No value given to compare with '${target}'.`}; + return { error: `No value given to compare with '${target}'.` }; } if (inequalityString.endsWith('=')) directions.push('equal'); switch (toID(prop)) { @@ -1656,10 +1656,10 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st case 'power': prop = 'basePower'; break; case 'acc': prop = 'accuracy'; break; } - if (!allProperties.includes(prop)) return {error: `'${target}' did not contain a valid property.`}; + if (!allProperties.includes(prop)) return { error: `'${target}' did not contain a valid property.` }; if (!orGroup.property[prop]) orGroup.property[prop] = Object.create(null); for (const direction of directions) { - if (orGroup.property[prop][direction]) return {error: `Invalid property range for ${prop}.`}; + if (orGroup.property[prop][direction]) return { error: `Invalid property range for ${prop}.` }; orGroup.property[prop][direction] = num; } continue; @@ -1673,10 +1673,10 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st } else if (target === "-") { sign = 'less'; } else { - return {error: `Priority type '${target}' not recognized.`}; + return { error: `Priority type '${target}' not recognized.` }; } if (orGroup.property['priority']) { - return {error: "Priority cannot be set with both shorthand and inequality range."}; + return { error: "Priority cannot be set with both shorthand and inequality range." }; } else { orGroup.property['priority'] = Object.create(null); orGroup.property['priority'][sign] = 0; @@ -1700,15 +1700,15 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st case 'evasiveness': target = 'evasion'; break; default: target = target.substr(7); } - if (!allBoosts.includes(target)) return {error: `'${target}' is not a recognized stat.`}; + if (!allBoosts.includes(target)) return { error: `'${target}' is not a recognized stat.` }; if (isBoost) { if ((orGroup.boost[target] && isNotSearch) || (orGroup.boost[target] === false && !isNotSearch)) { - return {error: 'A search cannot both exclude and include a stat boost.'}; + return { error: 'A search cannot both exclude and include a stat boost.' }; } orGroup.boost[target] = !isNotSearch; } else { if ((orGroup.lower[target] && isNotSearch) || (orGroup.lower[target] === false && !isNotSearch)) { - return {error: 'A search cannot both exclude and include a stat boost.'}; + return { error: 'A search cannot both exclude and include a stat boost.' }; } orGroup.lower[target] = !isNotSearch; } @@ -1728,9 +1728,9 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st case 'evasiveness': target = 'evasion'; break; default: target = target.substr(8); } - if (!allBoosts.includes(target)) return {error: `'${target}' is not a recognized stat.`}; + if (!allBoosts.includes(target)) return { error: `'${target}' is not a recognized stat.` }; if ((orGroup.zboost[target] && isNotSearch) || (orGroup.zboost[target] === false && !isNotSearch)) { - return {error: 'A search cannot both exclude and include a stat boost.'}; + return { error: 'A search cannot both exclude and include a stat boost.' }; } orGroup.zboost[target] = !isNotSearch; continue; @@ -1752,7 +1752,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st if (allStatus.includes(target)) { if ((orGroup.status[target] && isNotSearch) || (orGroup.status[target] === false && !isNotSearch)) { - return {error: 'A search cannot both exclude and include a status.'}; + return { error: 'A search cannot both exclude and include a status.' }; } orGroup.status[target] = !isNotSearch; continue; @@ -1763,13 +1763,13 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st (orGroup.volatileStatus[target] && isNotSearch) || (orGroup.volatileStatus[target] === false && !isNotSearch) ) { - return {error: 'A search cannot both exclude and include a volatile status.'}; + return { error: 'A search cannot both exclude and include a volatile status.' }; } orGroup.volatileStatus[target] = !isNotSearch; continue; } - return {error: `'${oldTarget}' could not be found in any of the search categories.`}; + return { error: `'${oldTarget}' could not be found in any of the search categories.` }; } if (!orGroup.skip) { searches.push(orGroup); @@ -1806,7 +1806,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st // At this point, we've trimmed down the valid moveset to be // the moves that are appropriate considering the requested pokemon. - const dex: {[moveid: string]: Move} = {}; + const dex: { [moveid: string]: Move } = {}; for (const moveid of validMoves) { const move = mod.moves.get(moveid); if (move.gen <= mod.gen) { @@ -2004,7 +2004,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st for (const searchStatus in alts.status) { let canStatus = !!( move.status === searchStatus || - (move.secondaries && move.secondaries.some(entry => entry.status === searchStatus)) + (move.secondaries?.some(entry => entry.status === searchStatus)) ); if (searchStatus === 'slp') { canStatus = canStatus || moveid === 'yawn'; @@ -2022,7 +2022,7 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st for (const searchStatus in alts.volatileStatus) { const canStatus = !!( (move.secondary && move.secondary.volatileStatus === searchStatus) || - (move.secondaries && move.secondaries.some(entry => entry.volatileStatus === searchStatus)) || + (move.secondaries?.some(entry => entry.volatileStatus === searchStatus)) || (move.volatileStatus === searchStatus) ); if (canStatus === alts.volatileStatus[searchStatus]) { @@ -2074,18 +2074,21 @@ function runMovesearch(target: string, cmd: string, canAll: boolean, message: st } resultsStr += results.map( result => `${result}` + - `${sort ? ` (${dex[toID(result)][sort.slice(0, -1) as keyof Move] === true ? '-' : dex[toID(result)][sort.slice(0, -1) as keyof Move]})` : ''}` + (sort ? + // eslint-disable-next-line @typescript-eslint/no-base-to-string + ` (${dex[toID(result)][sort.slice(0, -1) as keyof Move] === true ? '-' : dex[toID(result)][sort.slice(0, -1) as keyof Move]})` : + '') ).join(", "); if (notShown) { resultsStr += `, and ${notShown} more. Redo the search with ', all' at the end to show all results.`; } } else if (results.length === 1) { - return {dt: `${results[0]}${usedMod ? `,${usedMod}` : ''}`}; + return { dt: `${results[0]}${usedMod ? `,${usedMod}` : ''}` }; } else { resultsStr += "No moves found."; } - if (isTest) return {results, reply: resultsStr}; - return {reply: resultsStr}; + if (isTest) return { results, reply: resultsStr }; + return { reply: resultsStr }; } function runItemsearch(target: string, cmd: string, canAll: boolean, message: string) { @@ -2096,7 +2099,7 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st const targetSplit = target.split(','); if (targetSplit[targetSplit.length - 1].trim() === 'all') { - if (!canAll) return {error: "A search ending in ', all' cannot be broadcast."}; + if (!canAll) return { error: "A search ending in ', all' cannot be broadcast." }; showAll = true; targetSplit.pop(); } @@ -2122,17 +2125,17 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st if (newWord.substr(0, 6) === 'maxgen') { const parsedGen = parseInt(newWord.substr(6)); if (!isNaN(parsedGen)) { - if (maxGen) return {error: "You cannot specify 'maxgen' multiple times."}; + if (maxGen) return { error: "You cannot specify 'maxgen' multiple times." }; maxGen = parsedGen; - if (maxGen < 2 || maxGen > Dex.gen) return {error: "Invalid generation"}; + if (maxGen < 2 || maxGen > Dex.gen) return { error: "Invalid generation" }; continue; } } else if (newWord.substr(0, 3) === 'gen') { const parsedGen = parseInt(newWord.substr(3)); if (!isNaN(parsedGen)) { - if (gen) return {error: "You cannot specify 'gen' multiple times."}; + if (gen) return { error: "You cannot specify 'gen' multiple times." }; gen = parsedGen; - if (gen < 2 || gen > Dex.gen) return {error: "Invalid generation"}; + if (gen < 2 || gen > Dex.gen) return { error: "Invalid generation" }; continue; } } @@ -2209,10 +2212,10 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st } if (searchedWords.length === 0 && !gen && !maxGen && randomOutput === 0) { - return {error: "No distinguishing words were used. Try a more specific search."}; + return { error: "No distinguishing words were used. Try a more specific search." }; } - const dex = maxGen ? Dex.mod("gen" + maxGen) : Dex; + const dex = maxGen ? Dex.mod(`gen${maxGen}`) : Dex; if (searchedWords.includes('fling')) { let basePower = 0; let effect; @@ -2233,13 +2236,13 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st case 'badly': wordEff = 'tox'; break; } if (wordEff && effect) { - if (!(wordEff === 'psn' && effect === 'tox')) return {error: "Only specify fling effect once."}; + if (!(wordEff === 'psn' && effect === 'tox')) return { error: "Only specify fling effect once." }; } else if (wordEff) { effect = wordEff; } else { if (word.substr(word.length - 2) === 'bp' && word.length > 2) word = word.substr(0, word.length - 2); if (Number.isInteger(Number(word))) { - if (basePower) return {error: "Only specify a number for base power once."}; + if (basePower) return { error: "Only specify a number for base power once." }; basePower = parseInt(word); } } @@ -2250,26 +2253,26 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st if (basePower && effect) { if (item.fling.basePower === basePower && - (item.fling.status === effect || item.fling.volatileStatus === effect)) foundItems.push(item.name); + (item.fling.status === effect || item.fling.volatileStatus === effect)) foundItems.push(item.name); } else if (basePower) { if (item.fling.basePower === basePower) foundItems.push(item.name); } else { if (item.fling.status === effect || item.fling.volatileStatus === effect) foundItems.push(item.name); } } - if (foundItems.length === 0) return {error: 'No items inflict ' + basePower + 'bp damage when used with Fling.'}; + if (foundItems.length === 0) return { error: `No items inflict ${basePower}bp damage when used with Fling.` }; } else if (target.search(/natural ?gift/i) >= 0) { let basePower = 0; let type = ""; for (let word of searchedWords) { if (word in dex.data.TypeChart) { - if (type) return {error: "Only specify natural gift type once."}; + if (type) return { error: "Only specify natural gift type once." }; type = word.charAt(0).toUpperCase() + word.slice(1); } else { if (word.endsWith('bp') && word.length > 2) word = word.slice(0, -2); if (Number.isInteger(Number(word))) { - if (basePower) return {error: "Only specify a number for base power once."}; + if (basePower) return { error: "Only specify a number for base power once." }; basePower = parseInt(word); } } @@ -2287,7 +2290,7 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st } } if (foundItems.length === 0) { - return {error: 'No berries inflict ' + basePower + 'bp damage when used with Natural Gift.'}; + return { error: `No berries inflict ${basePower}bp damage when used with Natural Gift.` }; } } else { let bestMatched = 0; @@ -2346,7 +2349,7 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st resultsStr += randomItems.map( result => `${result}` ).join(", "); - return {reply: resultsStr}; + return { reply: resultsStr }; } if (foundItems.length > 0) { @@ -2365,7 +2368,7 @@ function runItemsearch(target: string, cmd: string, canAll: boolean, message: st } else { resultsStr += "No items found. Try a more general search"; } - return {reply: resultsStr}; + return { reply: resultsStr }; } function runAbilitysearch(target: string, cmd: string, canAll: boolean, message: string) { @@ -2377,7 +2380,7 @@ function runAbilitysearch(target: string, cmd: string, canAll: boolean, message: const targetSplit = target.split(','); if (targetSplit[targetSplit.length - 1].trim() === 'all') { - if (!canAll) return {error: "A search ending in ', all' cannot be broadcast."}; + if (!canAll) return { error: "A search ending in ', all' cannot be broadcast." }; showAll = true; targetSplit.pop(); } @@ -2405,17 +2408,17 @@ function runAbilitysearch(target: string, cmd: string, canAll: boolean, message: if (newWord.substr(0, 6) === 'maxgen') { const parsedGen = parseInt(newWord.substr(6)); if (parsedGen) { - if (maxGen) return {error: "You cannot specify 'maxgen' multiple times."}; + if (maxGen) return { error: "You cannot specify 'maxgen' multiple times." }; maxGen = parsedGen; - if (maxGen < 3 || maxGen > Dex.gen) return {error: "Invalid generation"}; + if (maxGen < 3 || maxGen > Dex.gen) return { error: "Invalid generation" }; continue; } } else if (newWord.substr(0, 3) === 'gen') { const parsedGen = parseInt(newWord.substr(3)); if (parsedGen) { - if (gen) return {error: "You cannot specify 'gen' multiple times."}; + if (gen) return { error: "You cannot specify 'gen' multiple times." }; gen = parsedGen; - if (gen < 3 || gen > Dex.gen) return {error: "Invalid generation"}; + if (gen < 3 || gen > Dex.gen) return { error: "Invalid generation" }; continue; } } @@ -2473,11 +2476,11 @@ function runAbilitysearch(target: string, cmd: string, canAll: boolean, message: } if (searchedWords.length === 0 && !gen && !maxGen && randomOutput === 0) { - return {error: "No distinguishing words were used. Try a more specific search."}; + return { error: "No distinguishing words were used. Try a more specific search." }; } let bestMatched = 0; - const dex = maxGen ? Dex.mod("gen" + maxGen) : Dex; + const dex = maxGen ? Dex.mod(`gen${maxGen}`) : Dex; for (const ability of dex.abilities.all()) { let matched = 0; // splits words in the description into a toID()-esque format except retaining / and . in numbers @@ -2510,7 +2513,7 @@ function runAbilitysearch(target: string, cmd: string, canAll: boolean, message: } } - if (foundAbilities.length === 1) return {dt: foundAbilities[0]}; + if (foundAbilities.length === 1) return { dt: foundAbilities[0] }; let resultsStr = (message === "" ? message : `${Utils.escapeHTML(message)}:
`); if (randomOutput !== 0) { @@ -2534,7 +2537,7 @@ function runAbilitysearch(target: string, cmd: string, canAll: boolean, message: resultsStr += randomAbilities.map( result => `${result}` ).join(", "); - return {reply: resultsStr}; + return { reply: resultsStr }; } if (foundAbilities.length > 0) { @@ -2553,7 +2556,7 @@ function runAbilitysearch(target: string, cmd: string, canAll: boolean, message: } else { resultsStr += "No abilities found. Try a more general search."; } - return {reply: resultsStr}; + return { reply: resultsStr }; } function runLearn(target: string, cmd: string, canAll: boolean, formatid: string) { @@ -2567,7 +2570,7 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string const targetid = toID(targets[0]); if (targetid === 'pentagon') { if (format.effectType === 'Format') { - return {error: "'pentagon' can't be used with formats."}; + return { error: "'pentagon' can't be used with formats." }; } minSourceGen = 6; targets.shift(); @@ -2575,10 +2578,10 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string } if (targetid.startsWith('minsourcegen')) { if (format.effectType === 'Format') { - return {error: "'min source gen' can't be used with formats."}; + return { error: "'min source gen' can't be used with formats." }; } minSourceGen = parseInt(targetid.slice(12)); - if (isNaN(minSourceGen) || minSourceGen < 1) return {error: `Invalid min source gen "${targetid.slice(12)}"`}; + if (isNaN(minSourceGen) || minSourceGen < 1) return { error: `Invalid min source gen "${targetid.slice(12)}"` }; targets.shift(); continue; } @@ -2593,12 +2596,12 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string if (format.effectType !== 'Format') { if (!(formatid in Dex.dexes)) { // can happen if you hotpatch formats without hotpatching chat - return {error: `"${formatid}" is not a supported format.`}; + return { error: `"${formatid}" is not a supported format.` }; } const dex = Dex.mod(formatid); gen = dex.gen; formatName = `Gen ${gen}`; - format = new Dex.Format({mod: formatid, effectType: 'Format', exists: true}); + format = new Dex.Format({ mod: formatid, effectType: 'Format', exists: true }); const ruleTable = dex.formats.getRuleTable(format); if (minSourceGen) { formatName += ` (Min Source Gen = ${minSourceGen})`; @@ -2621,15 +2624,15 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string const all = (cmd === 'learnall'); if (!species.exists || species.id === 'missingno') { - return {error: `Pok\u00e9mon '${species.id}' not found.`}; + return { error: `Pok\u00e9mon '${species.id}' not found.` }; } if (species.gen > gen) { - return {error: `${species.name} didn't exist yet in generation ${gen}.`}; + return { error: `${species.name} didn't exist yet in generation ${gen}.` }; } if (!targets.length) { - return {error: "You must specify at least one move."}; + return { error: "You must specify at least one move." }; } const moveNames = []; @@ -2641,10 +2644,10 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string const move = validator.dex.moves.get(arg); moveNames.push(move.name); if (!move.exists) { - return {error: `Move '${move.id}' not found.`}; + return { error: `Move '${move.id}' not found.` }; } if (move.gen > gen) { - return {error: `${move.name} didn't exist yet in generation ${gen}.`}; + return { error: `${move.name} didn't exist yet in generation ${gen}.` }; } } @@ -2667,7 +2670,7 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string } buffer += `${species.name}` + (problems.length ? ` can't learn ` : ` can learn `) + toListString(moveNames); if (!problems.length) { - const sourceNames: {[k: string]: string} = { + const sourceNames: { [k: string]: string } = { '7V': "virtual console transfer from gen 1-2", '8V': "Pokémon Home transfer from LGPE", E: "", S: "event", D: "dream world", X: "traded-back ", Y: "traded-back event", }; const sourcesBefore = setSources.sourcesBefore; @@ -2722,7 +2725,7 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string }` : ``; buffer += `
  • ${sourceGen} (all moves are level-up/tutor/TM/HM/egg in Gen ${sourcesBefore}${orEarlier})`; } else { - buffer += `
  • ${sourceGen} (all moves are level-up/tutor/TM/HM in Gen ${Math.min(gen, sourcesBefore)}${sourcesBefore < gen ? " to " + gen : ""})`; + buffer += `
  • ${sourceGen} (all moves are level-up/tutor/TM/HM in Gen ${Math.min(gen, sourcesBefore)}${sourcesBefore < gen ? ` to ${gen}` : ""})`; } } if (setSources.babyOnly && sourcesBefore) { @@ -2737,10 +2740,10 @@ function runLearn(target: string, cmd: string, canAll: boolean, formatid: string buffer += ``; } } - return {reply: buffer}; + return { reply: buffer }; } -function runSearch(query: {target: string, cmd: string, canAll: boolean, message: string}, user?: User) { +function runSearch(query: { target: string, cmd: string, canAll: boolean, message: string }, user?: User) { if (user) { if (user.lastCommand.startsWith('/datasearch ')) { throw new Chat.ErrorMessage( @@ -2781,7 +2784,7 @@ function runRandtype(target: string, cmd: string, canAll: boolean, message: stri resultsStr += randTypes.map( type => icon[type] ).join(' '); - return {reply: resultsStr}; + return { reply: resultsStr }; } /********************************************************* @@ -2829,7 +2832,7 @@ if (!PM.isParentProcess) { const repr = JSON.stringify([error.name, error.message, source, details]); process.send!(`THROW\n@!!@${repr}\n${error.stack}`); }, - }; + } as any; if (Config.crashguard) { process.on('uncaughtException', err => { Monitor.crashlog(err, 'A dexsearch process'); @@ -2840,8 +2843,8 @@ if (!PM.isParentProcess) { global.toID = Dex.toID; Dex.includeData(); - // @ts-ignore - require('../../lib/repl').Repl.start('dexsearch', cmd => eval(cmd)); // eslint-disable-line no-eval + // eslint-disable-next-line no-eval + require('../../lib/repl').Repl.start('dexsearch', (cmd: string) => eval(cmd)); } else { PM.spawn(MAX_PROCESSES); } diff --git a/server/chat-plugins/friends.ts b/server/chat-plugins/friends.ts index d8d43c8a25..3e535bfc7e 100644 --- a/server/chat-plugins/friends.ts +++ b/server/chat-plugins/friends.ts @@ -5,16 +5,16 @@ * @author mia-pi-git */ -import {Utils} from '../../lib/utils'; -import {MAX_REQUESTS, sendPM} from '../friends'; +import { Utils } from '../../lib/utils'; +import { MAX_REQUESTS, sendPM } from '../friends'; -const STATUS_COLORS: {[k: string]: string} = { +const STATUS_COLORS: { [k: string]: string } = { idle: '#ff7000', online: '#009900', busy: '#cc3838', }; -const STATUS_TITLES: {[k: string]: string} = { +const STATUS_TITLES: { [k: string]: string } = { online: 'Online', idle: 'Idle', busy: 'Busy', @@ -64,14 +64,14 @@ export const Friends = new class { } async visualizeList(userid: ID) { const friends = await Chat.Friends.getFriends(userid); - const categorized: {[k: string]: string[]} = { + const categorized: { [k: string]: string[] } = { online: [], idle: [], busy: [], offline: [], }; - const loginTimes: {[k: string]: number} = {}; - for (const {friend: friendID, last_login, allowing_login: hideLogin} of [...friends].sort()) { + const loginTimes: { [k: string]: number } = {}; + for (const { friend: friendID, last_login, allowing_login: hideLogin } of [...friends].sort()) { const friend = Users.getExact(friendID); if (friend?.connected) { categorized[friend.statusType].push(friend.id); @@ -146,7 +146,7 @@ export const Friends = new class { } if (login && typeof login === 'number' && !user?.connected) { buf += `Last seen: `; - buf += ` (${Chat.toDurationString(Date.now() - login, {precision: 1})} ago)`; + buf += ` (${Chat.toDurationString(Date.now() - login, { precision: 1 })} ago)`; } else if (typeof login === 'string') { buf += `${login}`; } @@ -204,7 +204,7 @@ function toLink(buf: string) { function headerButtons(type: string, user: User) { const buf = []; - const icons: {[k: string]: string} = { + const icons: { [k: string]: string } = { sent: '', received: '', all: '', @@ -212,7 +212,7 @@ function headerButtons(type: string, user: User) { settings: '', spectate: '', }; - const titles: {[k: string]: string} = { + const titles: { [k: string]: string } = { all: 'All Friends', spectate: 'Spectate', sent: 'Sent', @@ -395,7 +395,7 @@ export const commands: Chat.ChatCommands = { async listdisplay(target, room, user, connection) { Friends.checkCanUse(this); target = toID(target); - const {public_list: setting} = await Chat.Friends.getSettings(user.id); + const { public_list: setting } = await Chat.Friends.getSettings(user.id); if (this.meansYes(target)) { if (setting) { return this.errorReply(this.tr`You are already allowing other people to view your friends list.`); @@ -485,7 +485,7 @@ export const pages: Chat.PageTable = { if (user.settings.blockFriendRequests) { buf += `

    ${this.tr(`You are currently blocking friend requests`)}.

    `; } - const {sent} = await Chat.Friends.getRequests(user); + const { sent } = await Chat.Friends.getRequests(user); if (sent.size < 1) { buf += `You have no outgoing friend requests pending.
    `; buf += `
    To add a friend, use /friend add [username].`; @@ -504,7 +504,7 @@ export const pages: Chat.PageTable = { case 'received': case 'incoming': this.title = `[Friends] Received`; buf += headerButtons('received', user); - const {received} = await Chat.Friends.getRequests(user); + const { received } = await Chat.Friends.getRequests(user); if (received.size < 1) { buf += `You have no pending friend requests.`; buf += ``; @@ -525,7 +525,7 @@ export const pages: Chat.PageTable = { if (target === user.id) { return this.errorReply(`Use /friends list to view your own list.`); } - const {public_list: isAllowing} = await Chat.Friends.getSettings(target); + const { public_list: isAllowing } = await Chat.Friends.getSettings(target); if (!isAllowing) return this.errorReply(`${target}'s friends list is not public or they do not have one.`); this.title = `[Friends List] ${target}`; buf += await Friends.visualizePublicList(target); @@ -555,7 +555,7 @@ export const pages: Chat.PageTable = { buf += headerButtons('settings', user); buf += `

    Friends Settings:

    `; const settings = user.settings; - const {public_list, send_login_data} = await Chat.Friends.getSettings(user.id); + const { public_list, send_login_data } = await Chat.Friends.getSettings(user.id); buf += `Notify me when my friends come online:
    `; buf += ` `; @@ -629,7 +629,7 @@ export const pages: Chat.PageTable = { .filter(id => { const battle = Rooms.get(id)?.battle; return ( - battle && battle.playerTable[friend.id] && + battle?.playerTable[friend.id] && (!battle.roomid.endsWith('pw') || friend.settings.displayBattlesToFriends) ); }) @@ -645,7 +645,7 @@ export const pages: Chat.PageTable = { buf += battles.map(([friend, battle]) => { // we've already ensured the battle exists in the filter above // (and .battle only exists if it's a GameRoom, so this cast is safe) - const room = Rooms.get(battle) as GameRoom & {battle: Rooms.RoomBattle}; + const room = Rooms.get(battle) as GameRoom & { battle: Rooms.RoomBattle }; const format = Dex.formats.get(room.battle.format).name; const rated = room.battle.rated ? `(Rated: ${room.battle.rated})` : ''; const title = room.title.includes(friend.name) ? diff --git a/server/chat-plugins/github.ts b/server/chat-plugins/github.ts index 3239dbac4d..7c046aada5 100644 --- a/server/chat-plugins/github.ts +++ b/server/chat-plugins/github.ts @@ -4,7 +4,7 @@ * @author mia-pi-git */ -import {FS, Utils} from '../../lib'; +import { FS, Utils } from '../../lib'; const STAFF_REPOS = Config.staffrepos || [ 'pokemon-showdown', 'pokemon-showdown-client', 'Pokemon-Showdown-Dex', 'pokemon-showdown-loginserver', @@ -23,7 +23,7 @@ interface GitHookHandler { interface Push { commits: Commit[]; - sender: {login: string}; + sender: { login: string }; compare: string; } @@ -40,24 +40,24 @@ interface PullRequest { }, merge_commit_sha: string, }; - sender: {login: string}; + sender: { login: string }; } interface Commit { id: string; message: string; - author: {name: string, avatar_url: string}; + author: { name: string, avatar_url: string }; url: string; } interface GitData { - usernames?: {[username: string]: string}; - bans?: {[username: string]: string}; + usernames?: { [username: string]: string }; + bans?: { [username: string]: string }; } export const GitHub = new class { readonly hook: GitHookHandler | null = null; - updates: {[k: string]: number} = Object.create(null); + updates: { [k: string]: number } = Object.create(null); constructor() { // config.github: https://github.com/nlf/node-github-hook#readme if (!Config.github) return; @@ -96,12 +96,12 @@ export const GitHub = new class { handlePush(repo: string, ref: string, result: Push) { const branch = /[^/]+$/.exec(ref)?.[0] || ""; if (branch !== 'master') return; - const messages: {[k: string]: string[]} = { + const messages: { [k: string]: string[] } = { staff: [], development: [], }; for (const commit of result.commits) { - const {message, url} = commit; + const { message, url } = commit; const [shortMessage] = message.split('\n\n'); const username = this.getUsername(commit.author.name); const repoName = this.getRepoName(repo); diff --git a/server/chat-plugins/hangman.ts b/server/chat-plugins/hangman.ts index ecc9c3cf2b..dca90f20dc 100644 --- a/server/chat-plugins/hangman.ts +++ b/server/chat-plugins/hangman.ts @@ -2,7 +2,7 @@ * Hangman chat plugin * By bumbadadabum and Zarel. Art by crobat. */ -import {FS, Utils} from '../../lib'; +import { FS, Utils } from '../../lib'; const HANGMAN_FILE = 'config/chat-plugins/hangman.json'; @@ -22,7 +22,7 @@ interface HangmanOptions { allowCreator?: boolean; } -export let hangmanData: {[roomid: string]: {[phrase: string]: HangmanEntry}} = {}; +export let hangmanData: { [roomid: string]: { [phrase: string]: HangmanEntry } } = {}; try { hangmanData = JSON.parse(FS(HANGMAN_FILE).readSync()); @@ -33,7 +33,7 @@ try { if (roomKeys.length && !roomData[roomKeys[0]].hints) { save = true; for (const key of roomKeys) { - roomData[key] = {hints: roomData[key] as any}; + roomData[key] = { hints: roomData[key] as any }; } } } @@ -312,7 +312,7 @@ export class Hangman extends Rooms.SimpleRoomGame { throw new Chat.ErrorMessage(`Hint must be less than ${MAX_HINT_LENGTH} characters long.`); } } - return {phrase, hint}; + return { phrase, hint }; } } @@ -332,7 +332,7 @@ export const commands: Chat.ChatCommands = { if (room.game) return this.errorReply(`There is already a game of ${room.game.title} in progress in this room.`); if (!params) return this.errorReply("No word entered."); - const {phrase, hint} = Hangman.validateParams(params); + const { phrase, hint } = Hangman.validateParams(params); const game = new Hangman(room, user, phrase, hint); room.game = game; @@ -407,8 +407,8 @@ export const commands: Chat.ChatCommands = { throw new Chat.ErrorMessage(`There is already a game of ${room.game.title} running.`); } target = toID(target); - const {question, hint} = Hangman.getRandom(room.roomid, target); - const game = new Hangman(room, user, question, hint, {allowCreator: true}); + const { question, hint } = Hangman.getRandom(room.roomid, target); + const game = new Hangman(room, user, question, hint, { allowCreator: true }); room.game = game; this.addModAction(`${user.name} started a random game of hangman - use /guess to play!`); game.display(user, true); @@ -421,8 +421,8 @@ export const commands: Chat.ChatCommands = { if (!target) return this.parse('/help hangman'); // validation const args = target.split(target.includes('|') ? '|' : ','); - const {phrase} = Hangman.validateParams(args); - if (!hangmanData[room.roomid][phrase]) hangmanData[room.roomid][phrase] = {hints: []}; + const { phrase } = Hangman.validateParams(args); + if (!hangmanData[room.roomid][phrase]) hangmanData[room.roomid][phrase] = { hints: [] }; args.shift(); hangmanData[room.roomid][phrase].hints.push(...args); Hangman.save(); @@ -481,7 +481,7 @@ export const commands: Chat.ChatCommands = { // only a .trim() because toID will make it unable to find the term if it has caps term = term.trim(); tags = tags.map(i => toID(i)).filter(Boolean); - if (!term || !tags || !tags.length) { + if (!term || !tags?.length) { return this.parse('/help hangman'); } if (!hangmanData[room.roomid]) { diff --git a/server/chat-plugins/helptickets-auto.ts b/server/chat-plugins/helptickets-auto.ts index 9f8e56988b..afcec83861 100644 --- a/server/chat-plugins/helptickets-auto.ts +++ b/server/chat-plugins/helptickets-auto.ts @@ -1,7 +1,7 @@ -import {FS, Utils} from '../../lib'; -import type {ModlogSearch, ModlogEntry} from '../modlog'; +import { FS, Utils } from '../../lib'; +import type { ModlogSearch, ModlogEntry } from '../modlog'; import { - TicketState, getBattleLog, getBattleLinks, + type TicketState, getBattleLog, getBattleLinks, writeTickets, notifyStaff, writeStats, HelpTicket, tickets, } from './helptickets'; @@ -13,7 +13,7 @@ const WHITELIST = ['mia']; export interface AutoPunishment { modlogCount?: number; - severity?: {type: string[], certainty: number}; + severity?: { type: string[], certainty: number }; /** * Should it be run on just one message? * or is it safe to run on averages (for the types that use averages) @@ -32,11 +32,11 @@ const defaults: AutoSettings = { punishments: [{ ticketType: 'inapname', punishment: 'forcerename', - severity: {type: ['sexual_explicit', 'severe_toxicity', 'identity_attack'], certainty: 0.4}, + severity: { type: ['sexual_explicit', 'severe_toxicity', 'identity_attack'], certainty: 0.4 }, }, { ticketType: 'pmharassment', punishment: 'warn', - severity: {type: ['sexual_explicit', 'severe_toxicity', 'identity_attack'], certainty: 0.15}, + severity: { type: ['sexual_explicit', 'severe_toxicity', 'identity_attack'], certainty: 0.15 }, }], applyPunishments: false, }; @@ -45,7 +45,7 @@ export const settings: AutoSettings = (() => { try { // spreading w/ default means that // adding new things won't crash by not existing - return {...defaults, ...JSON.parse(FS('config/chat-plugins/ht-auto.json').readSync())}; + return { ...defaults, ...JSON.parse(FS('config/chat-plugins/ht-auto.json').readSync()) }; } catch { return defaults; } @@ -107,7 +107,7 @@ export function determinePunishment( action = punishment.punishment; } } - return {action, types}; + return { action, types }; } export function globalModlog(action: string, user: User | ID | null, note: string, roomid?: string) { @@ -125,7 +125,7 @@ export function addModAction(message: string) { Rooms.get('staff')?.add(`|c|~|/log ${message}`).update(); } -export async function getModlog(params: {user?: ID, ip?: string, actions?: string[]}) { +export async function getModlog(params: { user?: ID, ip?: string, actions?: string[] }) { const search: ModlogSearch = { note: [], user: [], @@ -133,9 +133,9 @@ export async function getModlog(params: {user?: ID, ip?: string, actions?: strin action: [], actionTaker: [], }; - if (params.user) search.user = [{search: params.user, isExact: true}]; - if (params.ip) search.ip = [{search: params.ip}]; - if (params.actions) search.action = params.actions.map(s => ({search: s})); + if (params.user) search.user = [{ search: params.user, isExact: true }]; + if (params.ip) search.ip = [{ search: params.ip }]; + if (params.actions) search.action = params.actions.map(s => ({ search: s })); const res = await Rooms.Modlog.search('global', search); return res?.results || []; } @@ -274,7 +274,7 @@ function shouldNotProcess(message: string) { } export async function getMessageAverages(messages: string[]) { - const counts: Record = {}; + const counts: Record = {}; const classified = []; for (const message of messages) { if (shouldNotProcess(message)) continue; @@ -282,7 +282,7 @@ export async function getMessageAverages(messages: string[]) { if (!res) continue; classified.push(res); for (const k in res) { - if (!counts[k]) counts[k] = {count: 0, raw: 0}; + if (!counts[k]) counts[k] = { count: 0, raw: 0 }; counts[k].count++; counts[k].raw += res[k]; } @@ -291,7 +291,7 @@ export async function getMessageAverages(messages: string[]) { for (const k in counts) { averages[k] = counts[k].raw / counts[k].count; } - return {averages, classified}; + return { averages, classified }; } interface CheckerResult { @@ -307,7 +307,7 @@ interface CheckerResult { type CheckerOutput = void | Map; export const checkers: { - [k: string]: (ticket: TicketState & {text: [string, string]}) => CheckerOutput | Promise, + [k: string]: (ticket: TicketState & { text: [string, string] }) => CheckerOutput | Promise, } = { async inapname(ticket) { const id = toID(ticket.text[0]); @@ -322,7 +322,7 @@ export const checkers: { ip: user.latestIp, actions: ['FORCERENAME', 'NAMELOCK', 'WEEKNAMELOCK'], }); - let {action} = determinePunishment('inapname', result, modlog); + let { action } = determinePunishment('inapname', result, modlog); if (!action) action = 'forcerename'; return new Map([[user.id, { action, @@ -351,7 +351,7 @@ export const checkers: { // atm don't factor in modlog const curAction = determinePunishment('inappokemon', results, []).action; if (curAction && (!result || supersedes(curAction, result.action))) { - result = {action: curAction, name: set.name, result: results, replay: link}; + result = { action: curAction, name: set.name, result: results, replay: link }; } } if (result) { @@ -382,8 +382,8 @@ export const checkers: { messages[id].push(text); } for (const [id, messageList] of Object.entries(messages)) { - const {averages, classified} = await getMessageAverages(messageList); - const {action} = determinePunishment('battleharassment', averages, []); + const { averages, classified } = await getMessageAverages(messageList); + const { action } = determinePunishment('battleharassment', averages, []); if (action) { const existingPunishment = actions.get(id); if (!existingPunishment || supersedes(action, existingPunishment.action)) { @@ -436,7 +436,7 @@ export const checkers: { const messages: Record = {}; const ids = new Set(); // sort messages by user who sent them, also filter out old ones - for (const {from, message, timestamp} of pmLog) { + for (const { from, message, timestamp } of pmLog) { // ignore pmlogs more than 24h old if ((Date.now() - new Date(timestamp).getTime()) > PMLOG_IGNORE_TIME) continue; const id = toID(from); @@ -446,7 +446,7 @@ export const checkers: { } for (const id of ids) { let punishment; - const {averages, classified} = await getMessageAverages(messages[id]); + const { averages, classified } = await getMessageAverages(messages[id]); const curPunishment = determinePunishment('pmharassment', averages, []).action; if (curPunishment) { if (!punishment || supersedes(curPunishment, punishment)) { @@ -462,7 +462,7 @@ export const checkers: { } } for (const result of classified) { - const {action} = determinePunishment('pmharassment', result, [], true); + const { action } = determinePunishment('pmharassment', result, [], true); if (!action) continue; const exists = actions.get(id); if (!exists || supersedes(action, exists.action)) { @@ -491,7 +491,7 @@ export const checkers: { export const classifier = new Artemis.LocalClassifier(); -export async function runPunishments(ticket: TicketState & {text: [string, string]}, typeId: string) { +export async function runPunishments(ticket: TicketState & { text: [string, string] }, typeId: string) { let result: Map | null = null; if (checkers[typeId]) { result = await checkers[typeId](ticket) || null; @@ -515,6 +515,7 @@ export async function runPunishments(ticket: TicketState & {text: [string, strin closeTicket(ticket); // no good response. just close it, because we __have__ dispatched an action. } } else { + // eslint-disable-next-line require-atomic-updates ticket.recommended = []; for (const res of result.values()) { Rooms.get('abuselog')?.add( @@ -566,7 +567,7 @@ export const commands: Chat.ChatCommands = { } } if (!punishment.severity) { - punishment.severity = {certainty: 0, type: []}; + punishment.severity = { certainty: 0, type: [] }; } punishment.severity.type.push(...types); break; @@ -576,7 +577,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`Certainty must be a number below 1 and above 0.`); } if (!punishment.severity) { - punishment.severity = {certainty: 0, type: []}; + punishment.severity = { certainty: 0, type: [] }; } punishment.severity.certainty = num; break; @@ -751,12 +752,12 @@ export const pages: Chat.PageTable = { buf += ``; buf += `

    Artemis ticket stats


    `; - const dayStats: Record = {}; - const total = {successes: 0, failures: 0, total: 0}; + const dayStats: Record = {}; + const total = { successes: 0, failures: 0, total: 0 }; const failed = []; for (const ticket of found) { const day = Chat.toTimestamp(new Date(ticket.created)).split(' ')[0]; - if (!dayStats[day]) dayStats[day] = {successes: 0, failures: 0, total: 0}; + if (!dayStats[day]) dayStats[day] = { successes: 0, failures: 0, total: 0 }; dayStats[day].total++; total.total++; switch (ticket.state.recommendResult) { diff --git a/server/chat-plugins/helptickets.ts b/server/chat-plugins/helptickets.ts index dfd05778b9..31c9f04df4 100644 --- a/server/chat-plugins/helptickets.ts +++ b/server/chat-plugins/helptickets.ts @@ -1,9 +1,9 @@ -import {FS, Utils, Net, ProcessManager} from '../../lib'; -import {getCommonBattles} from '../chat-commands/info'; -import {checkRipgrepAvailability} from '../config-loader'; -import type {Punishment} from '../punishments'; -import type {PartialModlogEntry, ModlogID} from '../modlog'; -import {runPunishments} from './helptickets-auto'; +import { FS, Utils, Net, ProcessManager } from '../../lib'; +import { getCommonBattles } from '../chat-commands/info'; +import { checkRipgrepAvailability } from '../config-loader'; +import type { Punishment } from '../punishments'; +import type { PartialModlogEntry, ModlogID } from '../modlog'; +import { runPunishments } from './helptickets-auto'; const TICKET_FILE = 'config/tickets.json'; const SETTINGS_FILE = 'config/chat-plugins/ticket-settings.json'; @@ -13,7 +13,7 @@ export const BATTLES_REGEX = /\bbattle-(?:[a-z0-9]+)-(?:[0-9]+)(?:-[a-z0-9]{31}p export const REPLAY_REGEX = new RegExp( `${Utils.escapeRegex(Config.routes.replays)}/(?:[a-z0-9]-)?(?:[a-z0-9]+)-(?:[0-9]+)(?:-[a-z0-9]{31}pw)?`, "g" ); -const REPORT_NAMECOLORS: {[k: string]: string} = { +const REPORT_NAMECOLORS: { [k: string]: string } = { p1: 'DodgerBlue', p2: 'Crimson', p3: '#FBa92C', @@ -28,7 +28,7 @@ Punishments.addPunishmentType({ interface TicketSettings { // {[ticketType]: {[button title]: response}} - responses: {[ticketType: string]: {[title: string]: string}}; + responses: { [ticketType: string]: { [title: string]: string } }; } export interface TicketState { @@ -47,11 +47,11 @@ export interface TicketState { text?: [string, string]; resolved?: ResolvedTicketInfo; meta?: string; - notes?: {[userid: string]: string}; + notes?: { [userid: string]: string }; /** Extra info that they might need for displays or whatnot. * Use `TextTicketInfo#getState` to set it at creation (store properties of the user object, etc) */ - state?: AnyObject & {claimTime?: number}; + state?: AnyObject & { claimTime?: number }; /** Recommendations from the Artemis monitor, if it is set to only recommend. */ recommended?: string[]; } @@ -80,7 +80,7 @@ export interface TextTicketInfo { /** Should this be displayed with all the other tickets of the type on a singular page? */ listOnly?: boolean; getReviewDisplay: ( - ticket: TicketState & {text: [string, string]}, staff: User, conn: Connection, state?: AnyObject + ticket: TicketState & { text: [string, string] }, staff: User, conn: Connection, state?: AnyObject ) => Promise | string | void; onSubmit?: (ticket: TicketState, text: [string, string], submitter: User, conn: Connection) => void | Promise; getState?: (ticket: TicketState, user: User) => AnyObject; @@ -90,22 +90,22 @@ interface BattleInfo { log: string[]; url: string; title: string; - players: {p1: ID, p2: ID, p3?: ID, p4?: ID}; - pokemon: Record; + players: { p1: ID, p2: ID, p3?: ID, p4?: ID }; + pokemon: Record; } type TicketResult = 'approved' | 'valid' | 'assisted' | 'denied' | 'invalid' | 'unassisted' | 'ticketban' | 'deleted'; -const defaults: TicketSettings = {responses: {}}; +const defaults: TicketSettings = { responses: {} }; -export const tickets: {[k: string]: TicketState} = {}; +export const tickets: { [k: string]: TicketState } = {}; export const settings: TicketSettings = (() => { try { // this ensures that if new settings are added to the defaults, they are added // to the JSON as well - return {...defaults, ...JSON.parse(FS(SETTINGS_FILE).readSync())}; + return { ...defaults, ...JSON.parse(FS(SETTINGS_FILE).readSync()) }; } catch { - return {...defaults}; + return { ...defaults }; } })(); @@ -148,7 +148,7 @@ try { export function writeTickets() { FS(TICKET_FILE).writeUpdate( - () => JSON.stringify(tickets), {throttle: 5000} + () => JSON.stringify(tickets), { throttle: 5000 } ); } @@ -235,7 +235,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { } tickets[this.ticket.userid] = this.ticket; writeTickets(); - this.room.modlog({action: 'TICKETCLAIM', isGlobal: false, loggedBy: user.id}); + this.room.modlog({ action: 'TICKETCLAIM', isGlobal: false, loggedBy: user.id }); this.addText(`${user.name} claimed this ticket.`, user); notifyStaff(); } else { @@ -256,13 +256,13 @@ export class HelpTicket extends Rooms.SimpleRoomGame { if (toID(this.ticket.claimed) === user.id) { if (this.claimQueue.length) { this.ticket.claimed = this.claimQueue.shift() || null; - this.room.modlog({action: 'TICKETCLAIM', isGlobal: false, loggedBy: toID(this.ticket.claimed)}); + this.room.modlog({ action: 'TICKETCLAIM', isGlobal: false, loggedBy: toID(this.ticket.claimed) }); this.addText(`This ticket is now claimed by ${this.ticket.claimed}.`, user); } else { const oldClaimed = this.ticket.claimed; this.ticket.claimed = null; this.lastUnclaimedStart = Date.now(); - this.room.modlog({action: 'TICKETUNCLAIM', isGlobal: false, loggedBy: toID(oldClaimed)}); + this.room.modlog({ action: 'TICKETUNCLAIM', isGlobal: false, loggedBy: toID(oldClaimed) }); this.addText(`This ticket is no longer claimed.`, user); notifyStaff(); } @@ -313,7 +313,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { if (!(user.id in this.playerTable)) return; this.removePlayer(this.playerTable[user.id]); if (!this.ticket.open) return; - this.room.modlog({action: 'TICKETABANDON', isGlobal: false, loggedBy: user.id}); + this.room.modlog({ action: 'TICKETABANDON', isGlobal: false, loggedBy: user.id }); this.addText(`${user.name} is no longer interested in this ticket.`, user); if (this.playerCount - 1 > 0) return; // There are still users in the ticket room, dont close the ticket this.close(!!(this.firstClaimTime), user); @@ -384,7 +384,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { this.ticket.open = false; tickets[this.ticket.userid] = this.ticket; writeTickets(); - this.room.modlog({action: 'TICKETCLOSE', isGlobal: false, loggedBy: staff?.id || 'unknown' as ID}); + this.room.modlog({ action: 'TICKETCLOSE', isGlobal: false, loggedBy: staff?.id || 'unknown' as ID }); this.addText(staff ? `${staff.name} closed this ticket.` : `This ticket was closed.`, staff); notifyStaff(); this.room.pokeExpireTimer(); @@ -449,7 +449,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { deleteTicket(staff: User) { this.close('deleted', staff); - this.room.modlog({action: 'TICKETDELETE', isGlobal: false, loggedBy: staff.id}); + this.room.modlog({ action: 'TICKETDELETE', isGlobal: false, loggedBy: staff.id }); this.addText(`${staff.name} deleted this ticket.`, staff); delete tickets[this.ticket.userid]; writeTickets(); @@ -493,7 +493,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { } return Utils.sortBy(Object.values(tickets), sorter); } - static logTextResult(ticket: TicketState & {text: [string, string], resolved: ResolvedTicketInfo}) { + static logTextResult(ticket: TicketState & { text: [string, string], resolved: ResolvedTicketInfo }) { const entry = { text: ticket.text, resolved: ticket.resolved, @@ -544,7 +544,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { if (e.stdout) { lines = e; } else { - lines = {stdout: ""}; + lines = { stdout: "" }; } } for (const line of lines.stdout.split('\n')) { @@ -638,7 +638,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { buf += `
    `; return buf; } - static getTextButton(ticket: TicketState & {text: [string, string]}) { + static getTextButton(ticket: TicketState & { text: [string, string] }) { let buf = ''; const titleBuf = [ ...ticket.text[0].split('\n').map(Utils.escapeHTML), @@ -691,7 +691,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { } static getBanMessage(userid: ID, punishment: Punishment) { if (userid !== punishment.id) { - const {id: punished, reason} = punishment; + const { id: punished, reason } = punishment; return ( `You are banned from creating help tickets` + `${punished !== userid ? `, because you have the same IP as ${userid}` : ''}. ${reason ? `Reason: ${reason}` : ''}` @@ -700,7 +700,7 @@ export class HelpTicket extends Rooms.SimpleRoomGame { return `You are banned from creating help tickets.`; } static notifyResolved(user: User, ticket: TicketState, userid = user.id) { - const {result, time, by, seen, note} = ticket.resolved as ResolvedTicketInfo; + const { result, time, by, seen, note } = ticket.resolved!; if (seen) return; const timeString = (Date.now() - time) > 1000 ? `, ${Chat.toDurationString(Date.now() - time)} ago.` : '.'; user.send(`|pm|~Staff|${user.getIdentity()}|Hello! Your report was resolved by ${by}${timeString}`); @@ -720,8 +720,8 @@ export class HelpTicket extends Rooms.SimpleRoomGame { const NOTIFY_ALL_TIMEOUT = 5 * 60 * 1000; const NOTIFY_ASSIST_TIMEOUT = 60 * 1000; -const unclaimedTicketTimer: {[k: string]: NodeJS.Timer | null} = {upperstaff: null, staff: null}; -const timerEnds: {[k: string]: number} = {upperstaff: 0, staff: 0}; +const unclaimedTicketTimer: { [k: string]: NodeJS.Timeout | null } = { upperstaff: null, staff: null }; +const timerEnds: { [k: string]: number } = { upperstaff: 0, staff: 0 }; function pokeUnclaimedTicketTimer(hasUnclaimed: boolean, hasAssistRequest: boolean) { const room = Rooms.get('staff'); if (!room) return; @@ -807,7 +807,7 @@ export function notifyStaff() { if (ticket.type === 'Public Room Assistance Request') hasAssistRequest = true; } if (ticket.text) { - buf += HelpTicket.getTextButton(ticket as TicketState & {text: [string, string]}); + buf += HelpTicket.getTextButton(ticket as TicketState & { text: [string, string] }); } else if (ticketGame) { buf += ticketGame.getButton(); } @@ -865,8 +865,6 @@ function checkIp(ip: string) { export function getBattleLinks(text: string) { const rooms = new Set(); const battles = text.match(BATTLES_REGEX); - // typescript-eslint is having trouble detecting REPLAY_REGEX as a global regex - // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec const replays = text.match(REPLAY_REGEX); if (battles) { for (const battle of battles) rooms.add(battle); @@ -887,7 +885,7 @@ function getReportedUser(ticket: TicketState) { } export async function listOpponentsFrom( - ticket: TicketState & {text: [string, string]} + ticket: TicketState & { text: [string, string] } ) { const opps = new Utils.Multiset(); const links = getBattleLinks(ticket.text[0]).concat(getBattleLinks(ticket.text[1])); @@ -920,7 +918,7 @@ export async function getOpponent(link: string, submitter: ID): Promise { const battleRoom = Rooms.get(battle); const seenPokemon = new Set(); - let data: {log: string, players: string[]} | null = null; + let data: { log: string, players: string[] } | null = null; // try battle room first if (battleRoom && battleRoom.type !== 'chat' && battleRoom.battle) { data = { @@ -998,7 +996,7 @@ for (const room of Rooms.rooms.values()) { void convertRoomPunishments(); const delayWarningPreamble = `Hi! All global staff members are busy right now and we apologize for the delay. `; -const delayWarnings: {[k: string]: string} = { +const delayWarnings: { [k: string]: string } = { 'PM Harassment': `Please make sure you have given us the permission to check the PMs between you and the user you reported. You can also provide any relevant context; for example, a replay of a battle with the person you're reporting.`, 'Battle Harassment': `Please save the replay of the battle and provide a link to it in this chat, so we can see the harassment even if the battle expires. You can save the replay by clicking on the "Upload and share replay" button once the battle has ended.`, 'Inappropriate Username': `Make sure you have provided the correct username, and if its meaning or why it is offensive is not obvious, please explain why it should not be allowed.`, @@ -1008,7 +1006,7 @@ const delayWarnings: {[k: string]: string} = { 'Public Room Assistance Request': `Please tell us which room you need assistance with and a global staff member will join your room as soon as possible.`, other: `If your issue pertains to battle mechanics or is a question about Pokémon Showdown, you can ask in the <> chatroom.`, }; -const ticketTitles: {[k: string]: string} = { +const ticketTitles: { [k: string]: string } = { pmharassment: `PM Harassment`, battleharassment: `Battle Harassment`, inapname: `Inappropriate Username`, @@ -1018,7 +1016,7 @@ const ticketTitles: {[k: string]: string} = { roomhelp: `Public Room Assistance Request`, other: `Other`, }; -const ticketPages: {[k: string]: string} = { +const ticketPages: { [k: string]: string } = { report: `I want to report someone`, pmharassment: `Someone is harassing me in PMs`, battleharassment: `Someone is harassing me in a battle`, @@ -1088,7 +1086,7 @@ const cheatingScenarios = [ ], ]; -export const textTickets: {[k: string]: TextTicketInfo} = { +export const textTickets: { [k: string]: TextTicketInfo } = { pmharassment: { title: "Who's harassing you in PMs?", checker(input) { @@ -1249,7 +1247,7 @@ export const textTickets: {[k: string]: TextTicketInfo} = { title: "Enter the name of the room", getReviewDisplay(ticket, staff) { let buf = ``; - const room = Rooms.search(ticket.text[0]) as Room; + const room = Rooms.search(ticket.text[0])!; if (!staff.inRooms.has(room.roomid)) { buf += ``; buf += `
    `; @@ -1347,7 +1345,7 @@ export const textTickets: {[k: string]: TextTicketInfo} = { info = []; if (ips?.length) { for (const ip of ips) { - info.push({...await IPTools.lookup(ip), ip}); + info.push({ ...await IPTools.lookup(ip), ip }); } if (!ticket.state) { ticket.state = info; @@ -1390,7 +1388,7 @@ export const textTickets: {[k: string]: TextTicketInfo} = { return buf; }, getState(ticket, user) { - return {ips: user.ips}; + return { ips: user.ips }; }, checker(text, context, pageId, user) { if (!toID(text)) { @@ -1427,7 +1425,7 @@ export const textTickets: {[k: string]: TextTicketInfo} = { async onSubmit(ticket, text, user) { const ips = []; for (const ip of user.ips) { - ips.push({...await IPTools.lookup(ip), ip}); + ips.push({ ...await IPTools.lookup(ip), ip }); } ticket.state = ips; writeTickets(); @@ -1778,10 +1776,10 @@ export const pages: Chat.PageTable = { count++; buf += `Reporter: ${ticket.userid}`; buf += await textTickets[typeId].getReviewDisplay( - ticket as TicketState & {text: [string, string]}, + ticket as TicketState & { text: [string, string] }, user, this.connection, - {list: true} + { list: true } ); buf += `
    `; buf += `
    Resolve:
    `; @@ -1871,7 +1869,7 @@ export const pages: Chat.PageTable = { if (entry.userids) ids = ids.concat(entry.userids); buf += `${ids.map(Utils.escapeHTML).join(', ')}`; buf += `${entry.ips.join(', ')}`; - buf += `${Chat.toDurationString(entry.expireTime - Date.now(), {precision: 1})}`; + buf += `${Chat.toDurationString(entry.expireTime - Date.now(), { precision: 1 })}`; buf += `${entry.reason || ''}`; } buf += ``; @@ -1911,7 +1909,7 @@ export const pages: Chat.PageTable = { buf += `${ticket.userid}`; buf += ` | `; buf += `
    `; - buf += await ticketInfo.getReviewDisplay(ticket as TicketState & {text: [string, string]}, user, connection); + buf += await ticketInfo.getReviewDisplay(ticket as TicketState & { text: [string, string] }, user, connection); buf += `
    `; buf += `
    `; const [text, context] = ticket.text; @@ -1989,8 +1987,8 @@ export const pages: Chat.PageTable = { return buf; } const stringifyDate = (num: number) => { - const dateStrings = Chat.toTimestamp(new Date(num), {human: true}).split(' '); - return {day: dateStrings[0], time: dateStrings[1]}; + const dateStrings = Chat.toTimestamp(new Date(num), { human: true }).split(' '); + return { day: dateStrings[0], time: dateStrings[1] }; }; Utils.sortBy(logs, log => -log.resolved.time); @@ -2009,7 +2007,7 @@ export const pages: Chat.PageTable = { buf += `
    Claimed: ${ticket.claimed}
    `; } buf += await ticketInfo.getReviewDisplay( - ticket as TicketState & {text: [string, string]}, + ticket as TicketState & { text: [string, string] }, user, connection, ticket.state @@ -2096,7 +2094,7 @@ export const pages: Chat.PageTable = { } let buf = `
    ${buttonBar}

    `; - buf += ``; + buf += `

    ${this.tr`Help Ticket Stats`} - ${date.toLocaleString('en-us', {month: 'long', year: 'numeric'})}

    `; if (table === 'tickets') { if (!['type', 'totaltickets', 'total', 'initwait', 'wait', 'resolution', 'result'].includes(col)) col = 'type'; buf += ``; @@ -2105,7 +2103,7 @@ export const pages: Chat.PageTable = { buf += ``; } - const ticketStats: {[k: string]: string}[] = rawTicketStats.split('\n').filter( + const ticketStats: { [k: string]: string }[] = rawTicketStats.split('\n').filter( (line: string) => line ).map( (line: string) => { @@ -2122,7 +2120,7 @@ export const pages: Chat.PageTable = { } ); if (table === 'tickets') { - const typeStats: {[key: string]: {[key: string]: number}} = {}; + const typeStats: { [key: string]: { [key: string]: number } } = {}; for (const stats of ticketStats) { if (!typeStats[stats.type]) { typeStats[stats.type] = { @@ -2172,15 +2170,15 @@ export const pages: Chat.PageTable = { for (const type of sortedStats) { const resolution = `${this.tr`Resolved`}: ${typeStats[type].resolved}%
    ${this.tr`Unresolved`}: ${typeStats[type].unresolved}%
    ${this.tr`Dead`}: ${typeStats[type].dead}%`; - buf += ``; + buf += ``; } } else { - const staffStats: {[key: string]: {[key: string]: number}} = {}; + const staffStats: { [key: string]: { [key: string]: number } } = {}; for (const stats of ticketStats) { const staffArray = (typeof stats.staff === 'string' ? stats.staff.split(',') : []); for (const staff of staffArray) { if (!staff) continue; - if (!staffStats[staff]) staffStats[staff] = {num: 0, time: 0}; + if (!staffStats[staff]) staffStats[staff] = { num: 0, time: 0 }; staffStats[staff].num++; staffStats[staff].time += (parseInt(stats.total) - parseInt(stats.initwait)); } @@ -2196,11 +2194,11 @@ export const pages: Chat.PageTable = { return -staffStats[staff][col]; }); for (const staff of sortedStaff) { - buf += ``; + buf += ``; } } buf += `

    ${this.tr`Help Ticket Stats`} - ${date.toLocaleString('en-us', { month: 'long', year: 'numeric' })}

    ${type}${typeStats[type].totaltickets}${Chat.toDurationString(typeStats[type].total, {hhmmss: true})}${Chat.toDurationString(typeStats[type].initwait, {hhmmss: true}) || '-'}${Chat.toDurationString(typeStats[type].wait, {hhmmss: true}) || '-'}${resolution}${typeStats[type].result}%
    ${type}${typeStats[type].totaltickets}${Chat.toDurationString(typeStats[type].total, { hhmmss: true })}${Chat.toDurationString(typeStats[type].initwait, { hhmmss: true }) || '-'}${Chat.toDurationString(typeStats[type].wait, { hhmmss: true }) || '-'}${resolution}${typeStats[type].result}%
    ${staff}${staffStats[staff].num}${Chat.toDurationString(staffStats[staff].time, {precision: 1})}
    ${staff}${staffStats[staff].num}${Chat.toDurationString(staffStats[staff].time, { precision: 1 })}
    `; - const headerTitles: {[id: string]: string} = { + const headerTitles: { [id: string]: string } = { type: 'Type', totaltickets: 'Total Tickets', total: 'Average Total Time', @@ -2296,7 +2294,7 @@ export const commands: Chat.ChatCommands = { ] = Utils.splitFirst(target, '|', 4).map(s => s.trim()); reportTarget = Utils.escapeHTML(reportTarget); if (!Object.values(ticketTitles).includes(ticketType)) return this.parse('/helpticket'); - const contexts: {[k: string]: string} = { + const contexts: { [k: string]: string } = { 'PM Harassment': `Hi! Who was harassing you in private messages?`, 'Battle Harassment': `Hi! Who was harassing you, and in which battle did it happen? Please post a link to the battle or a replay of the battle.`, 'Inappropriate Username': `Hi! Tell us the username that is inappropriate.`, @@ -2305,9 +2303,9 @@ export const commands: Chat.ChatCommands = { 'IP-Appeal': `Hi! How are you connecting to Showdown right now? At home, at school, on a phone using mobile data, or some other way?`, 'Public Room Assistance Request': `Hi! Which room(s) do you need us to help you watch?`, Other: `Hi! What seems to be the problem? Tell us about any people involved,` + - ` and if this happened in a specific place on the site.`, + ` and if this happened in a specific place on the site.`, }; - const staffContexts: {[k: string]: string} = { + const staffContexts: { [k: string]: string } = { 'IP-Appeal': `

    ${user.name}'s IP Addresses: ${user.ips.map(ip => `${ip}`).join(', ')}

    `, }; ticket = { @@ -2350,6 +2348,7 @@ export const commands: Chat.ChatCommands = { ticket.text = [text, contextString]; ticket.active = true; Chat.runHandlers('onTicketCreate', ticket, user); + // eslint-disable-next-line require-atomic-updates tickets[user.id] = ticket; await HelpTicket.modlog({ action: 'TEXTTICKET OPEN', @@ -2359,7 +2358,7 @@ export const commands: Chat.ChatCommands = { writeTickets(); notifyStaff(); void textTicket.onSubmit?.(ticket, [text, contextString], this.user, this.connection); - void runPunishments(ticket as TicketState & {text: [string, string]}, typeId); + void runPunishments(ticket as TicketState & { text: [string, string] }, typeId); if (textTicket.getState) { ticket.state = textTicket.getState(ticket, user); } @@ -2434,7 +2433,9 @@ export const commands: Chat.ChatCommands = { reportTargetInfo += Utils.html`There are no common battles between '${reportTarget}' and '${ticket.creator}'.`; } else { reportTargetInfo += Utils.html`Showing ${commonBattles.length} common battle(s) between '${reportTarget}' and '${ticket.creator}': `; - reportTargetInfo += commonBattles.map(roomid => Utils.html`${roomid.replace(/^battle-/, '')}`); + reportTargetInfo += commonBattles.map( + roomid => Utils.html`${roomid.replace(/^battle-/, '')}` + ).join(', '); } } } @@ -2445,7 +2446,7 @@ export const commands: Chat.ChatCommands = { isHelp: true, isPrivate: 'hidden', modjoin: '%', - auth: {[user.id]: '+'}, + auth: { [user.id]: '+' }, introMessage: introMsg, staffMessage: staffMessage + staffHint + reportTargetInfo, }); @@ -2459,7 +2460,7 @@ export const commands: Chat.ChatCommands = { } const ticketGame = helpRoom.getGame(HelpTicket)!; Chat.runHandlers('onTicketCreate', ticket, user); - helpRoom.modlog({action: 'TICKETOPEN', isGlobal: false, loggedBy: user.id, note: ticket.type}); + helpRoom.modlog({ action: 'TICKETOPEN', isGlobal: false, loggedBy: user.id, note: ticket.type }); ticketGame.addText(`${user.name} opened a new ticket. Issue: ${ticket.type}`, user); void this.parse(`/join help-${user.id}`); if (!(user.id in ticketGame.playerTable)) { @@ -2508,7 +2509,7 @@ export const commands: Chat.ChatCommands = { if (!ticket.text) { return this.popupReply(`That ticket cannot be resolved with /helpticket resolve. Join it instead.`); } - const {publicReason, privateReason} = this.parseSpoiler(result); + const { publicReason, privateReason } = this.parseSpoiler(result); ticket.resolved = { result: publicReason, time: Date.now(), @@ -2531,7 +2532,7 @@ export const commands: Chat.ChatCommands = { note: privateReason, userid: ticketId, }); - HelpTicket.logTextResult(ticket as TicketState & {text: [string, string], resolved: ResolvedTicketInfo}); + HelpTicket.logTextResult(ticket as TicketState & { text: [string, string], resolved: ResolvedTicketInfo }); notifyStaff(); // force a refresh for everyone in it, otherwise we potentially get two punishments at once // from different people clicking at the same time and reading it separately. @@ -2686,7 +2687,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`Invalid ticket type: ${target}.`); } buf += `${target ? `for the type ${target}:` : ""}
    `; - const table = target ? {[target]: settings.responses[target]} : settings.responses; + const table = target ? { [target]: settings.responses[target] } : settings.responses; if (!Object.keys(table).length) { buf += `

    None

    `; return this.sendReplyBox(buf); @@ -2741,7 +2742,7 @@ export const commands: Chat.ChatCommands = { ticketban: 'ban', async ban(target, room, user) { if (!target) return this.parse('/help helpticket ban'); - const {targetUser, targetUsername, rest: reason} = this.splitUser(target, {exactName: true}); + const { targetUser, targetUsername, rest: reason } = this.splitUser(target, { exactName: true }); this.checkCan('lock', targetUser); const punishment = Punishments.roomUserids.nestedGet('staff', toID(targetUsername)); @@ -2998,7 +2999,7 @@ export const punishmentfilter: Chat.PunishmentFilter = (user, punishment) => { } }; -export const loginfilter: Chat.LoginFilter = (user) => { +export const loginfilter: Chat.LoginFilter = user => { const ticket = tickets[user.id]; if (ticket?.resolved) { HelpTicket.notifyResolved(user, ticket); diff --git a/server/chat-plugins/hosts.ts b/server/chat-plugins/hosts.ts index bd4ac11fa5..b162c5f3b1 100644 --- a/server/chat-plugins/hosts.ts +++ b/server/chat-plugins/hosts.ts @@ -4,12 +4,12 @@ * Original /adddatacenters command written by Zarel */ -import {Utils} from "../../lib"; -import {AddressRange} from "../ip-tools"; -import {GlobalPermission} from "../user-groups"; +import { Utils } from "../../lib"; +import type { AddressRange } from "../ip-tools"; +import type { GlobalPermission } from "../user-groups"; const HOST_SUFFIXES = ['res', 'proxy', 'mobile']; -const SUFFIX_ALIASES: {[k: string]: string} = { +const SUFFIX_ALIASES: { [k: string]: string } = { residential: 'res', }; const WHITELISTED_USERIDS: ID[] = []; @@ -263,7 +263,7 @@ export const commands: Chat.ChatCommands = { // Remove the range that is being widened IPTools.removeRange(IPTools.ranges[result].minIP, IPTools.ranges[result].maxIP); } - IPTools.addRange(range as AddressRange & {host: string}); + IPTools.addRange(range as AddressRange & { host: string }); this.privateGlobalModAction(`${user.name} added the IP range ${formatRange(range)} to the list of ${type} ranges.`); this.globalModlog('IPRANGE ADD', null, formatRange(range, true)); diff --git a/server/chat-plugins/mafia.ts b/server/chat-plugins/mafia.ts index 0e380d8a1b..da898d0b06 100644 --- a/server/chat-plugins/mafia.ts +++ b/server/chat-plugins/mafia.ts @@ -1,13 +1,13 @@ -import {Utils, FS} from '../../lib'; +import { Utils, FS } from '../../lib'; interface MafiaData { // keys for all of these are IDs - alignments: {[k: string]: MafiaDataAlignment}; - roles: {[k: string]: MafiaDataRole}; - themes: {[k: string]: MafiaDataTheme}; - IDEAs: {[k: string]: MafiaDataIDEA}; - terms: {[k: string]: MafiaDataTerm}; - aliases: {[k: string]: ID}; + alignments: { [k: string]: MafiaDataAlignment }; + roles: { [k: string]: MafiaDataRole }; + themes: { [k: string]: MafiaDataTheme }; + IDEAs: { [k: string]: MafiaDataIDEA }; + terms: { [k: string]: MafiaDataTerm }; + aliases: { [k: string]: ID }; } interface MafiaDataAlignment { name: string; @@ -25,12 +25,14 @@ interface MafiaDataRole { } interface MafiaDataTheme { name: string; + memo?: undefined; desc: string; // roles [players: number]: string; } interface MafiaDataIDEA { name: string; + memo?: undefined; roles: string[]; picks: string[]; choices: number; @@ -41,10 +43,10 @@ interface MafiaDataTerm { } interface MafiaLogTable { - [date: string]: {[userid: string]: number}; + [date: string]: { [userid: string]: number }; } type MafiaLogSection = 'leaderboard' | 'mvps' | 'hosts' | 'plays' | 'leavers'; -type MafiaLog = {[section in MafiaLogSection]: MafiaLogTable}; +type MafiaLog = { [section in MafiaLogSection]: MafiaLogTable }; interface MafiaRole { name: string; @@ -78,7 +80,7 @@ interface MafiaIDEAData { interface MafiaIDEAModule { data: MafiaIDEAData | null; - timer: NodeJS.Timer | null; + timer: NodeJS.Timeout | null; discardsHidden: boolean; discardsHTML: string; // users that haven't picked a role yet @@ -88,17 +90,18 @@ interface MafiaIDEAModule { interface MafiaIDEAPlayerData { choices: string[]; originalChoices: string[]; - picks: {[choice: string]: string | null}; + picks: { [choice: string]: string | null }; } // The different possible ways for a player to be eliminated -enum MafiaEliminateType { - ELIMINATE = "was eliminated", // standard (vote + faction kill + anything else) - KICK = "was kicked from the game", // staff kick - TREESTUMP = "was treestumped", // can still talk - SPIRIT = "became a restless spirit", // can still vote - SPIRITSTUMP = "became a restless treestump" // treestump + spirit -} +const MafiaEliminateType = { + ELIMINATE: "was eliminated", // standard (vote + faction kill + anything else) + KICK: "was kicked from the game", // staff kick + TREESTUMP: "was treestumped", // can still talk + SPIRIT: "became a restless spirit", // can still vote + SPIRITSTUMP: "became a restless treestump", // treestump + spirit +} as const; +type MafiaEliminateType = typeof MafiaEliminateType[keyof typeof MafiaEliminateType]; const DATA_FILE = 'config/chat-plugins/mafia-data.json'; const LOGS_FILE = 'config/chat-plugins/mafia-logs.json'; @@ -109,7 +112,7 @@ const VALID_IMAGES = [ ]; let MafiaData: MafiaData = Object.create(null); -let logs: MafiaLog = {leaderboard: {}, mvps: {}, hosts: {}, plays: {}, leavers: {}}; +let logs: MafiaLog = { leaderboard: {}, mvps: {}, hosts: {}, plays: {}, leavers: {} }; Punishments.addRoomPunishmentType({ type: 'MAFIAGAMEBAN', @@ -148,7 +151,7 @@ function writeFile(path: string, data: AnyObject) { // themes and IDEAs have no common keys (looked up together when setting themes) // Load data -MafiaData = readFile(DATA_FILE) || {alignments: {}, roles: {}, themes: {}, IDEAs: {}, terms: {}, aliases: {}}; +MafiaData = readFile(DATA_FILE) || { alignments: {}, roles: {}, themes: {}, IDEAs: {}, terms: {}, aliases: {} }; if (!MafiaData.alignments.town) { MafiaData.alignments.town = { name: 'town', plural: 'town', memo: [`This alignment is required for the script to function properly.`], @@ -160,12 +163,12 @@ if (!MafiaData.alignments.solo) { }; } -logs = readFile(LOGS_FILE) || {leaderboard: {}, mvps: {}, hosts: {}, plays: {}, leavers: {}}; +logs = readFile(LOGS_FILE) || { leaderboard: {}, mvps: {}, hosts: {}, plays: {}, leavers: {} }; const tables: MafiaLogSection[] = ['leaderboard', 'mvps', 'hosts', 'plays', 'leavers']; for (const section of tables) { // Check to see if we need to eliminate an old month's data. - const month = new Date().toLocaleString("en-us", {month: "numeric", year: "numeric"}); + const month = new Date().toLocaleString("en-us", { month: "numeric", year: "numeric" }); if (!logs[section]) logs[section] = {}; if (!logs[section][month]) logs[section][month] = {}; if (Object.keys(logs[section]).length >= 3) { @@ -249,7 +252,7 @@ class MafiaPlayer extends Rooms.RoomGamePlayer { // Only call updateHtmlRoom if the player is still involved in the game in some way tryUpdateHtmlRoom() { if ([null, MafiaEliminateType.SPIRIT, MafiaEliminateType.TREESTUMP, - MafiaEliminateType.SPIRITSTUMP].includes(this.eliminated)) { + MafiaEliminateType.SPIRITSTUMP].includes(this.eliminated as any)) { this.updateHtmlRoom(); } } @@ -261,7 +264,7 @@ class MafiaPlayer extends Rooms.RoomGamePlayer { updateHtmlRoom() { if (this.game.ended) return this.closeHtmlRoom(); const user = Users.get(this.id); - if (!user || !user.connected) return; + if (!user?.connected) return; for (const conn of user.connections) { void Chat.resolvePage(`view-mafia-${this.game.room.roomid}`, user, conn); } @@ -269,7 +272,7 @@ class MafiaPlayer extends Rooms.RoomGamePlayer { closeHtmlRoom() { const user = Users.get(this.id); - if (!user || !user.connected) return; + if (!user?.connected) return; return user.send(`>view-mafia-${this.game.room.roomid}\n|deinit`); } @@ -297,9 +300,9 @@ class Mafia extends Rooms.RoomGame { played: ID[]; hammerCount: number; - votes: {[userid: string]: MafiaVote}; - voteModifiers: {[userid: string]: number}; - hammerModifiers: {[userid: string]: number}; + votes: { [userid: string]: MafiaVote }; + voteModifiers: { [userid: string]: number }; + hammerModifiers: { [userid: string]: number }; hasPlurality: ID | null; enableNV: boolean; @@ -319,7 +322,7 @@ class Mafia extends Rooms.RoomGame { phase: 'signups' | 'locked' | 'IDEApicking' | 'IDEAlocked' | 'day' | 'night'; dayNum: number; - timer: NodeJS.Timer | null; + timer: NodeJS.Timeout | null; dlAt: number; IDEA: MafiaIDEAModule; @@ -548,11 +551,11 @@ class Mafia extends Rooms.RoomGame { const newRoles: MafiaRole[] = []; const problems: string[] = []; const alignments: string[] = []; - const cache: {[k: string]: MafiaRole} = Object.create(null); + const cache: { [k: string]: MafiaRole } = Object.create(null); for (const roleName of roles) { const roleId = roleName.toLowerCase().replace(/[^\w\d\s]/g, ''); if (roleId in cache) { - newRoles.push({...cache[roleId]}); + newRoles.push({ ...cache[roleId] }); } else { const role = Mafia.parseRole(roleName); if (role.problems.length) { @@ -614,7 +617,6 @@ class Mafia extends Rooms.RoomGame { } else { this.sendDeclare(`Night ${this.dayNum}. PM the host your action, or idle.`); } - return; } static parseRole(roleString: string) { @@ -695,7 +697,7 @@ class Mafia extends Rooms.RoomGame { } } - return {role, problems}; + return { role, problems }; } start(user: User, day = false) { @@ -895,9 +897,9 @@ class Mafia extends Rooms.RoomGame { this.hasPlurality = null; if (this.getHammerValue(targetId) <= vote.trueCount) { // HAMMER - this.sendDeclare(`Hammer! ${targetId === 'novote' ? 'Nobody' : Utils.escapeHTML(name as string)} was voted out!`); + this.sendDeclare(`Hammer! ${targetId === 'novote' ? 'Nobody' : Utils.escapeHTML(name!)} was voted out!`); this.sendRoom(`|raw|
    ${this.voteBox()}
    `); - if (targetId !== 'novote') this.eliminate(target as MafiaPlayer, MafiaEliminateType.ELIMINATE); + if (targetId !== 'novote') this.eliminate(target!, MafiaEliminateType.ELIMINATE); this.night(true); return; } @@ -1204,10 +1206,10 @@ class Mafia extends Rooms.RoomGame { revealRole(user: User, toReveal: MafiaPlayer, revealAs: string) { if (!this.started) { - return this.sendUser(user, `|error|You may only reveal roles once the game has started.`); + return this.sendUser(user, `|error|You may only reveal roles once the game has started.`); } if (!toReveal.role) { - return this.sendUser(user, `|error|The user ${toReveal.id} is not assigned a role.`); + return this.sendUser(user, `|error|The user ${toReveal.id} is not assigned a role.`); } toReveal.revealed = revealAs; this.sendDeclare(`${toReveal.safeName}'s role ${toReveal.isEliminated() ? `was` : `is`} ${revealAs}.`); @@ -1334,7 +1336,7 @@ class Mafia extends Rooms.RoomGame { this.updatePlayers(); if (this.room.roomid === 'mafia' && this.started) { - const month = new Date().toLocaleString("en-us", {month: "numeric", year: "numeric"}); + const month = new Date().toLocaleString("en-us", { month: "numeric", year: "numeric" }); if (!logs.leavers[month]) logs.leavers[month] = {}; if (!logs.leavers[month][player.id]) logs.leavers[month][player.id] = 0; logs.leavers[month][player.id]++; @@ -1790,7 +1792,7 @@ class Mafia extends Rooms.RoomGame { } const player = this.getPlayer(user.id); - const eliminated = player && player.isEliminated(); + const eliminated = player?.isEliminated(); const staff = user.can('mute', null, this.room); if (!player) { @@ -1855,7 +1857,7 @@ class Mafia extends Rooms.RoomGame { // Intead of using this.played, which shows players who have subbed out as well // We check who played through to the end when recording playlogs const played = this.players.map(p => p.id); - const month = new Date().toLocaleString("en-us", {month: "numeric", year: "numeric"}); + const month = new Date().toLocaleString("en-us", { month: "numeric", year: "numeric" }); if (!logs.plays[month]) logs.plays[month] = {}; for (const player of played) { if (!logs.plays[month][player]) logs.plays[month][player] = 0; @@ -2128,7 +2130,7 @@ export const pages: Chat.PageTable = { } else { buf += `

    `; } - } else if (!isPlayer || !isPlayer.isEliminated()) { + } else if (!isPlayer?.isEliminated()) { if ((!isPlayer && game.subs.includes(user.id)) || (isPlayer && !game.requestedSub.includes(user.id))) { buf += `

    ${isPlayer ? 'Request to be subbed out' : 'Cancel sub request'}`; buf += `

    `; @@ -2145,32 +2147,32 @@ export const pages: Chat.PageTable = { if (!user.named) return Rooms.RETRY_AFTER_LOGIN; const mafiaRoom = Rooms.get('mafia'); if (!query.length || !mafiaRoom) return this.close(); - const headers: {[k: string]: {title: string, type: string, section: MafiaLogSection}} = { - leaderboard: {title: 'Leaderboard', type: 'Points', section: 'leaderboard'}, - mvpladder: {title: 'MVP Ladder', type: 'MVPs', section: 'mvps'}, - hostlogs: {title: 'Host Logs', type: 'Hosts', section: 'hosts'}, - playlogs: {title: 'Play Logs', type: 'Plays', section: 'plays'}, - leaverlogs: {title: 'Leaver Logs', type: 'Leavers', section: 'leavers'}, + const headers: { [k: string]: { title: string, type: string, section: MafiaLogSection } } = { + leaderboard: { title: 'Leaderboard', type: 'Points', section: 'leaderboard' }, + mvpladder: { title: 'MVP Ladder', type: 'MVPs', section: 'mvps' }, + hostlogs: { title: 'Host Logs', type: 'Hosts', section: 'hosts' }, + playlogs: { title: 'Play Logs', type: 'Plays', section: 'plays' }, + leaverlogs: { title: 'Leaver Logs', type: 'Leavers', section: 'leavers' }, }; const date = new Date(); if (query[1] === 'prev') date.setMonth(date.getMonth() - 1); - const month = date.toLocaleString("en-us", {month: "numeric", year: "numeric"}); + const month = date.toLocaleString("en-us", { month: "numeric", year: "numeric" }); const ladder = headers[query[0]]; if (!ladder) return this.close(); if (['hosts', 'plays', 'leavers'].includes(ladder.section)) this.checkCan('mute', null, mafiaRoom); - this.title = `Mafia ${ladder.title} (${date.toLocaleString("en-us", {month: 'long'})} ${date.getFullYear()})`; + this.title = `Mafia ${ladder.title} (${date.toLocaleString("en-us", { month: 'long' })} ${date.getFullYear()})`; let buf = `
    `; buf += `${query[1] === 'prev' ? '' : ` `}`; buf += `

    `; const section = ladder.section; if (!logs[section][month] || !Object.keys(logs[section][month]).length) { - buf += `${ladder.title} for ${date.toLocaleString("en-us", {month: 'long'})} ${date.getFullYear()} not found.
    `; + buf += `${ladder.title} for ${date.toLocaleString("en-us", { month: 'long' })} ${date.getFullYear()} not found.
    `; return buf; } const entries = Utils.sortBy(Object.entries(logs[section][month]), ([key, value]) => ( -value )); - buf += ``; + buf += `

    Mafia ${ladder.title} for ${date.toLocaleString("en-us", {month: 'long'})} ${date.getFullYear()}

    `; buf += ``; for (const [key, value] of entries) { buf += ``; @@ -2210,7 +2212,7 @@ export const commands: Chat.ChatCommands = { const skipped = []; let hostid; while ((hostid = hostQueue.shift())) { - ({targetUser, targetUsername} = this.splitUser(hostid, {exactName: true})); + ({ targetUser, targetUsername } = this.splitUser(hostid, { exactName: true })); if (!targetUser?.connected || !room.users[targetUser.id] || Mafia.isHostBanned(room, targetUser)) { skipped.push(hostid); @@ -2225,7 +2227,7 @@ export const commands: Chat.ChatCommands = { } if (!targetUser) return this.errorReply(`Nobody on the host queue could be hosted.`); } else { - ({targetUser, targetUsername} = this.splitUser(target, {exactName: true})); + ({ targetUser, targetUsername } = this.splitUser(target, { exactName: true })); if (room.roomid === 'mafia' && hostQueue.length && toID(targetUsername) !== hostQueue[0]) { if (!cmd.includes('force')) { return this.errorReply(`${targetUsername} isn't the next host on the queue. Use /mafia forcehost if you're sure.`); @@ -2257,7 +2259,7 @@ export const commands: Chat.ChatCommands = { if (queueIndex > -1) hostQueue.splice(queueIndex, 1); room.add(`|c:|${(Math.floor(Date.now() / 1000))}|~|**Mafiasignup!**`).update(); } - this.modlog('MAFIAHOST', targetUser, null, {noalts: true, noip: true}); + this.modlog('MAFIAHOST', targetUser, null, { noalts: true, noip: true }); }, hosthelp: [ `/mafia host [user] - Create a game of Mafia with [user] as the host. Requires whitelist + % @ # ~, drivers+ can host other people.`, @@ -2286,7 +2288,7 @@ export const commands: Chat.ChatCommands = { } if (hostQueue.includes(targetUserID)) return this.errorReply(`User ${targetUserID} is already on the host queue.`); if (targetUser && Mafia.isHostBanned(room, targetUser)) { - return this.errorReply(`User ${targetUserID} is banned from hosting mafia games.`); + return this.errorReply(`User ${targetUserID} is banned from hosting mafia games.`); } hostQueue.push(targetUserID); room.add(`User ${targetUserID} has been added to the host queue by ${user.name}.`).update(); @@ -2769,10 +2771,10 @@ export const commands: Chat.ChatCommands = { for (const targetUsername of args) { const player = game.getPlayer(toID(targetUsername)); if (player) { - game.revealRole(user, player, `${cmd === 'revealas' ? revealAs : player.getStylizedRole()}`); + game.revealRole(user, player, `${revealAs || player.getStylizedRole()}`); game.logAction(user, `revealed ${player.name}`); - if (cmd === 'revealas') { - game.secretLogAction(user, `fakerevealed ${player.name} as ${revealedRole!.role.name}`); + if (revealedRole) { + game.secretLogAction(user, `fakerevealed ${player.name} as ${revealedRole.role.name}`); } } else { this.errorReply(`${targetUsername} is not a player.`); @@ -3421,7 +3423,7 @@ export const commands: Chat.ChatCommands = { this.checkChat(); if (!target) return this.parse(`/help mafia ${cmd}`); this.checkCan('mute', null, room); - const {targetUser} = this.requireUser(target); + const { targetUser } = this.requireUser(target); if (!room.users[targetUser.id]) return this.errorReply(`${targetUser.name} is not in this room, and cannot be hosted.`); if (game.hostid === targetUser.id) return this.errorReply(`${targetUser.name} is already the host.`); if (game.cohostids.includes(targetUser.id)) return this.errorReply(`${targetUser.name} is already a cohost.`); @@ -3438,7 +3440,7 @@ export const commands: Chat.ChatCommands = { for (const conn of targetUser.connections) { void Chat.resolvePage(`view-mafia-${room.roomid}`, targetUser, conn); } - this.modlog('MAFIACOHOST', targetUser, null, {noalts: true, noip: true}); + this.modlog('MAFIACOHOST', targetUser, null, { noalts: true, noip: true }); } else { const oldHostid = game.hostid; const oldHost = Users.get(game.hostid); @@ -3452,7 +3454,7 @@ export const commands: Chat.ChatCommands = { void Chat.resolvePage(`view-mafia-${room.roomid}`, targetUser, conn); } game.sendDeclare(Utils.html`${targetUser.name} has been substituted as the new host, replacing ${oldHostid}.`); - this.modlog('MAFIASUBHOST', targetUser, `replacing ${oldHostid}`, {noalts: true, noip: true}); + this.modlog('MAFIASUBHOST', targetUser, `replacing ${oldHostid}`, { noalts: true, noip: true }); } }, subhosthelp: [`/mafia subhost [user] - Substitues the user as the new game host.`], @@ -3478,7 +3480,7 @@ export const commands: Chat.ChatCommands = { } game.cohostids.splice(cohostIndex, 1); game.sendDeclare(Utils.html`${target} was removed as a cohost by ${user.name}`); - this.modlog('MAFIAUNCOHOST', target, null, {noalts: true, noip: true}); + this.modlog('MAFIAUNCOHOST', target, null, { noalts: true, noip: true }); }, end(target, room, user) { @@ -3526,19 +3528,19 @@ export const commands: Chat.ChatCommands = { let result: MafiaDataAlignment | MafiaDataRole | MafiaDataTheme | MafiaDataIDEA | MafiaDataTerm | null = null; let dataType = cmd; - const cmdTypes: {[k: string]: keyof MafiaData} = { + const cmdTypes: { [k: string]: keyof MafiaData } = { role: 'roles', alignment: 'alignments', theme: 'themes', term: 'terms', idea: 'IDEAs', }; if (cmd in cmdTypes) { const toSearch = MafiaData[cmdTypes[cmd]]; - // @ts-ignore guaranteed not an alias + // @ts-expect-error guaranteed not an alias result = toSearch[target]; } else { // search everything for (const [cmdType, dataKey] of Object.entries(cmdTypes)) { if (target in MafiaData[dataKey]) { - // @ts-ignore guaranteed not an alias + // @ts-expect-error guaranteed not an alias result = MafiaData[dataKey][target]; dataType = cmdType; break; @@ -3547,8 +3549,8 @@ export const commands: Chat.ChatCommands = { } if (!result) return this.errorReply(`"${target}" is not a valid mafia alignment, role, theme, or IDEA.`); - // @ts-ignore - let buf = `${result.name}Type: ${dataType}
    `; + // @ts-expect-error property access + let buf = `${result.name}Type: ${dataType}
    `; if (dataType === 'theme') { if ((result as MafiaDataTheme).desc) { buf += `Description: ${(result as MafiaDataTheme).desc}
    Setups:`; @@ -3557,7 +3559,7 @@ export const commands: Chat.ChatCommands = { const num = parseInt(i); if (isNaN(num)) continue; buf += `${i}: `; - const count: {[k: string]: number} = {}; + const count: { [k: string]: number } = {}; const roles = []; for (const role of (result as MafiaDataTheme)[num].split(',').map((x: string) => x.trim())) { count[role] = count[role] ? count[role] + 1 : 1; @@ -3577,7 +3579,6 @@ export const commands: Chat.ChatCommands = { buf += `${idearole}
    `; } } else { - // @ts-ignore if (result.memo) buf += `${result.memo.join('
    ')}`; } return this.sendReplyBox(buf); @@ -3612,7 +3613,7 @@ export const commands: Chat.ChatCommands = { args.shift(); } if (!args.length) return this.parse('/help mafia win'); - const month = new Date().toLocaleString("en-us", {month: "numeric", year: "numeric"}); + const month = new Date().toLocaleString("en-us", { month: "numeric", year: "numeric" }); if (!logs.leaderboard[month]) logs.leaderboard[month] = {}; let toGiveTo = []; @@ -3661,7 +3662,7 @@ export const commands: Chat.ChatCommands = { this.checkCan('mute', null, room); const args = target.split(','); if (!args.length) return this.parse('/help mafia mvp'); - const month = new Date().toLocaleString("en-us", {month: "numeric", year: "numeric"}); + const month = new Date().toLocaleString("en-us", { month: "numeric", year: "numeric" }); if (!logs.mvps[month]) logs.mvps[month] = {}; if (!logs.leaderboard[month]) logs.leaderboard[month] = {}; let gavePoints = false; @@ -3722,7 +3723,7 @@ export const commands: Chat.ChatCommands = { room = this.requireRoom(); this.checkCan('warn', null, room); - const {targetUser, rest} = this.requireUser(target); + const { targetUser, rest } = this.requireUser(target); const [string1, string2] = this.splitOne(rest); let duration, reason; if (parseInt(string1)) { @@ -3775,7 +3776,7 @@ export const commands: Chat.ChatCommands = { room = this.requireRoom(); this.checkCan('warn', null, room); - const {targetUser} = this.requireUser(target, {allowOffline: true}); + const { targetUser } = this.requireUser(target, { allowOffline: true }); if (!Mafia.isGameBanned(room, targetUser) && cmd === 'ungameban') { return this.errorReply(`User '${targetUser.name}' isn't banned from playing mafia games.`); } else if (!Mafia.isHostBanned(room, targetUser) && cmd === 'unhostban') { @@ -3786,7 +3787,7 @@ export const commands: Chat.ChatCommands = { else Mafia.ungameBan(room, targetUser); this.privateModAction(`${targetUser.name} was unbanned from ${cmd === 'unhostban' ? 'hosting' : 'playing'} mafia games by ${user.name}.`); - this.modlog(`MAFIA${cmd.toUpperCase()}`, targetUser, null, {noip: 1, noalts: 1}); + this.modlog(`MAFIA${cmd.toUpperCase()}`, targetUser, null, { noip: 1, noalts: 1 }); }, overwriterole: 'addrole', @@ -3811,13 +3812,13 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`${name} is already an alias (pointing to ${MafiaData.aliases[id]}).`); } - const role: MafiaDataRole = {name, memo}; + const role: MafiaDataRole = { name, memo }; if (alignment) role.alignment = alignment; if (image) role.image = image; MafiaData.roles[id] = role; writeFile(DATA_FILE, MafiaData); - this.modlog(`MAFIAADDROLE`, null, id, {noalts: true, noip: true}); + this.modlog(`MAFIAADDROLE`, null, id, { noalts: true, noip: true }); this.sendReply(`The role ${id} was added to the database.`); }, addrolehelp: [ @@ -3845,14 +3846,14 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`${name} is already an alias (pointing to ${MafiaData.aliases[id]})`); } - const alignment: MafiaDataAlignment = {name, plural, memo}; + const alignment: MafiaDataAlignment = { name, plural, memo }; if (color) alignment.color = color; if (buttonColor) alignment.buttonColor = buttonColor; if (image) alignment.image = image; MafiaData.alignments[id] = alignment; writeFile(DATA_FILE, MafiaData); - this.modlog(`MAFIAADDALIGNMENT`, null, id, {noalts: true, noip: true}); + this.modlog(`MAFIAADDALIGNMENT`, null, id, { noalts: true, noip: true }); this.sendReply(`The alignment ${id} was added to the database.`); }, addalignmenthelp: [ @@ -3878,7 +3879,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`${name} is already an alias (pointing to ${MafiaData.aliases[id]})`); } - const rolelistsMap: {[players: number]: string} = {}; + const rolelistsMap: { [players: number]: string } = {}; const uniqueRoles = new Set(); for (const rolelist of rolelists) { @@ -3897,10 +3898,10 @@ export const commands: Chat.ChatCommands = { } if (problems.length) return this.errorReply(`Problems found when parsing roles:\n${problems.join('\n')}`); - const theme: MafiaDataTheme = {name, desc, ...rolelistsMap}; + const theme: MafiaDataTheme = { name, desc, ...rolelistsMap }; MafiaData.themes[id] = theme; writeFile(DATA_FILE, MafiaData); - this.modlog(`MAFIAADDTHEME`, null, id, {noalts: true, noip: true}); + this.modlog(`MAFIAADDTHEME`, null, id, { noalts: true, noip: true }); this.sendReply(`The theme ${id} was added to the database.`); }, addthemehelp: [ @@ -3941,10 +3942,10 @@ export const commands: Chat.ChatCommands = { } if (problems.length) return this.errorReply(`Problems found when parsing roles:\n${problems.join('\n')}`); - const IDEA: MafiaDataIDEA = {name, choices, picks, roles}; + const IDEA: MafiaDataIDEA = { name, choices, picks, roles }; MafiaData.IDEAs[id] = IDEA; writeFile(DATA_FILE, MafiaData); - this.modlog(`MAFIAADDIDEA`, null, id, {noalts: true, noip: true}); + this.modlog(`MAFIAADDIDEA`, null, id, { noalts: true, noip: true }); this.sendReply(`The IDEA ${id} was added to the database.`); }, addideahelp: [ @@ -3969,10 +3970,10 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`${name} is already an alias (pointing to ${MafiaData.aliases[id]})`); } - const term: MafiaDataTerm = {name, memo}; + const term: MafiaDataTerm = { name, memo }; MafiaData.terms[id] = term; writeFile(DATA_FILE, MafiaData); - this.modlog(`MAFIAADDTERM`, null, id, {noalts: true, noip: true}); + this.modlog(`MAFIAADDTERM`, null, id, { noalts: true, noip: true }); this.sendReply(`The term ${id} was added to the database.`); }, addtermhelp: [`/mafia addterm name|memo1|memo2... - Adds a term to the database. Requires % @ # ~`], @@ -3998,7 +3999,7 @@ export const commands: Chat.ChatCommands = { MafiaData.aliases[from] = to; writeFile(DATA_FILE, MafiaData); - this.modlog(`MAFIAADDALIAS`, null, `${from}: ${to}`, {noalts: true, noip: true}); + this.modlog(`MAFIAADDALIAS`, null, `${from}: ${to}`, { noalts: true, noip: true }); this.sendReply(`The alias ${from} was added, pointing to ${to}.`); }, addaliashelp: [ @@ -4014,7 +4015,7 @@ export const commands: Chat.ChatCommands = { if (!(source in MafiaData)) { return this.errorReply(`Invalid source. Valid sources are ${Object.keys(MafiaData).join(', ')}`); } - // @ts-ignore checked above + // @ts-expect-error checked above const dataSource = MafiaData[source]; if (!(entry in dataSource)) return this.errorReply(`${entry} does not exist in ${source}.`); @@ -4043,7 +4044,7 @@ export const commands: Chat.ChatCommands = { writeFile(DATA_FILE, MafiaData); if (buf) this.sendReply(buf); - this.modlog(`MAFIADELETEDATA`, null, `${entry} from ${source}`, {noalts: true, noip: true}); + this.modlog(`MAFIADELETEDATA`, null, `${entry} from ${source}`, { noalts: true, noip: true }); this.sendReply(`The entry ${entry} was deleted from the ${source} database.`); }, deletedatahelp: [`/mafia deletedata source,entry - Removes an entry from the database. Requires % @ # ~`], diff --git a/server/chat-plugins/modlog-viewer.ts b/server/chat-plugins/modlog-viewer.ts index eeecbfaff0..118fe569b1 100644 --- a/server/chat-plugins/modlog-viewer.ts +++ b/server/chat-plugins/modlog-viewer.ts @@ -7,8 +7,8 @@ * @license MIT */ -import {Dashycode, Utils} from '../../lib'; -import {ModlogID, ModlogSearch, ModlogEntry} from '../modlog'; +import { Dashycode, Utils } from '../../lib'; +import type { ModlogID, ModlogSearch, ModlogEntry } from '../modlog'; const MAX_QUERY_LENGTH = 2500; const DEFAULT_RESULTS_LENGTH = 100; @@ -17,7 +17,7 @@ const LINES_SEPARATOR = 'lines='; const MAX_RESULTS_LENGTH = MORE_BUTTON_INCREMENTS[MORE_BUTTON_INCREMENTS.length - 1]; const IPS_REGEX = /[([]?([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})[)\]]?/g; -const ALIASES: {[k: string]: string} = { +const ALIASES: { [k: string]: string } = { 'helpticket': 'help-rooms', 'groupchat': 'groupchat-rooms', 'battle': 'battle-rooms', @@ -95,7 +95,7 @@ function prettifyResults( const resultString = resultArray.map(result => { const date = new Date(result.time || Date.now()); const entryRoom = result.visualRoomID || result.roomID || 'global'; - let [dateString, timestamp] = Chat.toTimestamp(date, {human: true}).split(' '); + let [dateString, timestamp] = Chat.toTimestamp(date, { human: true }).split(' '); let line = `[${timestamp}] (${entryRoom}) ${result.action}`; if (result.userid) { line += `: [${result.userid}]`; @@ -129,7 +129,7 @@ function prettifyResults( ); return `${dateString}[${timestamp}] (${thisRoomID})${line}`; }).join(`
    `); - const [dateString, timestamp] = Chat.toTimestamp(new Date(), {human: true}).split(' '); + const [dateString, timestamp] = Chat.toTimestamp(new Date(), { human: true }).split(' '); let preamble; const modlogid = roomid + (searchString ? '-' + Dashycode.encode(searchString) : ''); if (searchString) { @@ -179,7 +179,7 @@ async function getModlog( if (search.note?.length) { for (const [i, noteSearch] of search.note.entries()) { if (/^["'].+["']$/.test(noteSearch.search)) { - search.note[i] = {...noteSearch, search: noteSearch.search.substring(1, noteSearch.search.length - 1)}; + search.note[i] = { ...noteSearch, search: noteSearch.search.substring(1, noteSearch.search.length - 1) }; search.note[i].isExact = true; } } @@ -194,7 +194,7 @@ async function getModlog( search.user[i] = userSearch; } - if (onlyNotes) search.action.push({search: 'NOTE'}); + if (onlyNotes) search.action.push({ search: 'NOTE' }); const response = await Rooms.Modlog.search(roomid, search, maxLines, onlyPunishments); if (!response) return connection.popup(`The moderator log is currently disabled.`); @@ -233,7 +233,7 @@ export const commands: Chat.ChatCommands = { let lines; const possibleParam = cmd.slice(2); const targets = target.split(',').map(f => f.trim()).filter(Boolean); - const search: ModlogSearch = {note: [], user: [], ip: [], action: [], actionTaker: []}; + const search: ModlogSearch = { note: [], user: [], ip: [], action: [], actionTaker: [] }; switch (possibleParam) { case 'id': @@ -267,19 +267,19 @@ export const commands: Chat.ChatCommands = { switch (param) { case 'note': case 'text': if (!search.note) search.note = []; - search.note.push({search: value, isExclusion}); + search.note.push({ search: value, isExclusion }); break; case 'user': case 'name': case 'username': case 'userid': - search.user.push({search: value}); + search.user.push({ search: value }); break; case 'ip': case 'ipaddress': case 'ipaddr': - search.ip.push({search: value, isExclusion}); + search.ip.push({ search: value, isExclusion }); break; case 'action': case 'punishment': - search.action.push({search: value.toUpperCase(), isExclusion}); + search.action.push({ search: value.toUpperCase(), isExclusion }); break; case 'actiontaker': case 'moderator': case 'staff': case 'mod': - search.actionTaker.push({search: toID(value), isExclusion}); + search.actionTaker.push({ search: toID(value), isExclusion }); break; case 'room': case 'roomid': roomid = value.toLowerCase().replace(/[^a-z0-9-]+/g, '') as ModlogID; diff --git a/server/chat-plugins/othermetas.ts b/server/chat-plugins/othermetas.ts index 9f5b99b82f..4aa16c3a50 100644 --- a/server/chat-plugins/othermetas.ts +++ b/server/chat-plugins/othermetas.ts @@ -5,10 +5,10 @@ * @author dhelmise */ -import {Utils} from '../../lib'; +import { Utils } from '../../lib'; interface StoneDeltas { - baseStats: {[stat in StatID]: number}; + baseStats: { [stat in StatID]: number }; bst: number; weighthg: number; heightm: number; @@ -187,11 +187,11 @@ export const commands: Chat.ChatCommands = { } else if (mixedSpecies.weighthg >= 100) { weighthit = 40; } - const details: {[k: string]: string} = { - "Dex#": '' + mixedSpecies.num, - Gen: '' + mixedSpecies.gen, - Height: mixedSpecies.heightm + " m", - Weight: mixedSpecies.weighthg / 10 + " kg (" + weighthit + " BP)", + const details: { [k: string]: string } = { + "Dex#": `${mixedSpecies.num}`, + Gen: `${mixedSpecies.gen}`, + Height: `${mixedSpecies.heightm} m`, + Weight: `${mixedSpecies.weighthg / 10} kg (${weighthit} BP)`, "Dex Colour": mixedSpecies.color, }; if (mixedSpecies.eggGroups) details["Egg Group(s)"] = mixedSpecies.eggGroups.join(", "); @@ -301,8 +301,8 @@ export const commands: Chat.ChatCommands = { } const details = { Gen: aStone.gen, - Height: (deltas.heightm < 0 ? "" : "+") + deltas.heightm + " m", - Weight: (deltas.weighthg < 0 ? "" : "+") + deltas.weighthg / 10 + " kg", + Height: `${deltas.heightm < 0 ? "" : "+"}${deltas.heightm} m`, + Weight: `${deltas.weighthg < 0 ? "" : "+"}${deltas.weighthg / 10} kg`, }; let tier; if (['redorb', 'blueorb'].includes(aStone.id)) { @@ -377,7 +377,7 @@ export const commands: Chat.ChatCommands = { species.bst = 0; for (const i in species.baseStats) { if (dex.gen === 1 && i === 'spd') continue; - species.baseStats[i] = species.baseStats[i] * (bst <= 350 ? 2 : 1); + species.baseStats[i] *= (bst <= 350 ? 2 : 1); species.bst += species.baseStats[i]; } this.sendReply(`|html|${Chat.getDataPokemonHTML(species, dex.gen)}`); @@ -414,7 +414,7 @@ export const commands: Chat.ChatCommands = { const additionalReason = species.gen > dex.gen ? ` in Generation ${dex.gen}` : ``; throw new Chat.ErrorMessage(`Error: Pok\u00e9mon '${monName}' not found${additionalReason}.`); } - const boosts: {[tier in TierShiftTiers]: number} = { + const boosts: { [tier in TierShiftTiers]: number } = { UU: 15, RUBL: 15, RU: 20, @@ -465,7 +465,7 @@ export const commands: Chat.ChatCommands = { if (!toID(args[0]) && !toID(args[1])) return this.parse('/help franticfusions'); const targetGen = parseInt(cmd[cmd.length - 1]); if (targetGen && !args[2]) target = `${target},gen${targetGen}`; - const {dex, targets} = this.splitFormat(target, true); + const { dex, targets } = this.splitFormat(target, true); this.runBroadcast(); if (targets.length > 2) return this.parse('/help franticfusions'); const species = Utils.deepClone(dex.species.get(targets[0])); @@ -674,7 +674,7 @@ export const commands: Chat.ChatCommands = { throw new Chat.ErrorMessage(`Error: Pok\u00e9mon '${monName}' not found${additionalReason}.`); } if (dex.gen === 1) { - const flippedStats: {[k: string]: number} = { + const flippedStats: { [k: string]: number } = { hp: species.baseStats.spe, atk: species.baseStats.spa, def: species.baseStats.def, @@ -811,11 +811,11 @@ export const commands: Chat.ChatCommands = { } else if (mixedSpecies.weighthg >= 100) { weighthit = 40; } - const details: {[k: string]: string} = { + const details: { [k: string]: string } = { "Dex#": mixedSpecies.num, Gen: mixedSpecies.gen, - Height: mixedSpecies.heightm + " m", - Weight: mixedSpecies.weighthg / 10 + " kg (" + weighthit + " BP)", + Height: `${mixedSpecies.heightm} m`, + Weight: `${mixedSpecies.weighthg / 10} kg (${weighthit} BP)`, "Dex Colour": mixedSpecies.color, }; if (mixedSpecies.eggGroups) details["Egg Group(s)"] = mixedSpecies.eggGroups.join(", "); @@ -882,7 +882,7 @@ export const commands: Chat.ChatCommands = { } const details = { Gen: evo.gen, - Weight: (deltas.weighthg < 0 ? "" : "+") + deltas.weighthg / 10 + " kg", + Weight: `${deltas.weighthg < 0 ? "" : "+"}${deltas.weighthg / 10} kg`, Stage: (Dex.species.get(prevoSpecies.prevo).exists ? 3 : 2), }; this.sendReply(`|raw|${Chat.getDataPokemonHTML(deltas)}`); @@ -922,7 +922,7 @@ export const commands: Chat.ChatCommands = { } const details = { Gen: evo.gen, - Weight: (deltas.weighthg < 0 ? "" : "+") + deltas.weighthg / 10 + " kg", + Weight: `${deltas.weighthg < 0 ? "" : "+"}${deltas.weighthg / 10} kg`, Stage: (Dex.species.get(prevoSpecies.prevo).exists ? 3 : 2), }; this.sendReply(`|raw|${Chat.getDataPokemonHTML(deltas)}`); @@ -945,7 +945,7 @@ export const commands: Chat.ChatCommands = { const move = Utils.deepClone(Dex.moves.get('tackle')); move.name = species.name; move.type = species.types[0]; - move.flags = {protect: 1}; + move.flags = { protect: 1 }; move.basePower = Math.max(species.baseStats['atk'], species.baseStats['spa']); move.pp = 5; move.gen = species.gen; diff --git a/server/chat-plugins/permalocks.ts b/server/chat-plugins/permalocks.ts index e5708e903f..3be8b864df 100644 --- a/server/chat-plugins/permalocks.ts +++ b/server/chat-plugins/permalocks.ts @@ -3,7 +3,7 @@ * By Mia. * @author mia-pi-git */ -import {Net, FS, Utils} from '../../lib'; +import { Net, FS, Utils } from '../../lib'; export interface Nomination { by: ID; @@ -61,7 +61,7 @@ export const Smogon = new class { // special case to be loud throw new Error("WHO DELETED THE PERMA THREAD"); } - return {error: e.message}; + return { error: e.message }; } } }; @@ -76,7 +76,7 @@ export const Nominations = new class { try { let data = JSON.parse(FS('config/chat-plugins/permas.json').readSync()); if (Array.isArray(data)) { - data = {noms: data, icons: {}}; + data = { noms: data, icons: {} }; FS('config/chat-plugins/permas.json').writeSync(JSON.stringify(data)); } this.noms = data.noms; @@ -85,7 +85,7 @@ export const Nominations = new class { } fetchModlog(id: string) { return Rooms.Modlog.search('global', { - user: [{search: id, isExact: true}], + user: [{ search: id, isExact: true }], note: [], ip: [], action: [], @@ -93,7 +93,7 @@ export const Nominations = new class { }, undefined, true); } save() { - FS('config/chat-plugins/permas.json').writeUpdate(() => JSON.stringify({noms: this.noms, icons: this.icons})); + FS('config/chat-plugins/permas.json').writeUpdate(() => JSON.stringify({ noms: this.noms, icons: this.icons })); } notifyStaff() { const usRoom = Rooms.get('upperstaff'); @@ -129,7 +129,7 @@ export const Nominations = new class { const altTable = new Set([...alts]); for (const alt of [primaryID, ...alts]) { const modlog = await this.fetchModlog(alt); - if (!modlog || !modlog.results.length) continue; + if (!modlog?.results.length) continue; for (const entry of modlog.results) { if (entry.ip) ipTable.add(entry.ip); if (entry.autoconfirmedID) altTable.add(entry.autoconfirmedID); @@ -178,7 +178,7 @@ export const Nominations = new class { title = `${nom.primaryID}`; } buf += `${title} (submitted by ${nom.by})
    `; - buf += `Submitted ${Chat.toTimestamp(new Date(nom.date), {human: true})}
    `; + buf += `Submitted ${Chat.toTimestamp(new Date(nom.date), { human: true })}
    `; buf += `${Chat.count(nom.alts, 'alts')}, ${Chat.count(nom.ips, 'IPs')}`; buf += ``; return buf; @@ -189,7 +189,7 @@ export const Nominations = new class { return results.map(result => { const date = new Date(result.time || Date.now()); const entryRoom = result.visualRoomID || result.roomID || 'global'; - let [dateString, timestamp] = Chat.toTimestamp(date, {human: true}).split(' '); + let [dateString, timestamp] = Chat.toTimestamp(date, { human: true }).split(' '); let line = `[${timestamp}] (${entryRoom}) ${result.action}`; if (result.userid) { line += `: [${result.userid}]`; @@ -270,7 +270,7 @@ export const Nominations = new class { }); if (matches?.results?.length) { buf += `
    Registration IP matches`; - for (const [i, {userid, banstate}] of matches.results.entries()) { + for (const [i, { userid, banstate }] of matches.results.entries()) { buf += `- ${userid}: `; buf += ``; buf += this.standingDropdown("standing", banstate + ""); diff --git a/server/chat-plugins/poll.ts b/server/chat-plugins/poll.ts index 2710e055b6..8041088114 100644 --- a/server/chat-plugins/poll.ts +++ b/server/chat-plugins/poll.ts @@ -2,7 +2,7 @@ * Poll chat plugin * By bumbadadabum and Zarel. */ -import {Utils} from '../../lib'; +import { Utils } from '../../lib'; const MINUTES = 60000; const MAX_QUESTIONS = 10; @@ -16,9 +16,9 @@ export interface PollOptions { question: string; supportHTML: boolean; multiPoll: boolean; - pendingVotes?: {[userid: string]: number[]}; - voters?: {[k: string]: number[]}; - voterIps?: {[k: string]: number[]}; + pendingVotes?: { [userid: string]: number[] }; + voters?: { [k: string]: number[] }; + voterIps?: { [k: string]: number[] }; maxVotes?: number; totalVotes?: number; timeoutMins?: number; @@ -37,9 +37,9 @@ export class Poll extends Rooms.MinorActivity { activityNumber: number; question: string; multiPoll: boolean; - pendingVotes: {[userid: string]: number[]}; - voters: {[k: string]: number[]}; - voterIps: {[k: string]: number[]}; + pendingVotes: { [userid: string]: number[] }; + voters: { [k: string]: number[] }; + voterIps: { [k: string]: number[] }; totalVotes: number; isQuiz: boolean; /** Max votes of 0 means no vote cap */ @@ -571,7 +571,7 @@ export const commands: Chat.ChatCommands = { if (isNaN(timeoutMins) || timeoutMins <= 0 || timeoutMins > 7 * 24 * 60) { return this.errorReply(this.tr`Time should be a number of minutes less than one week.`); } - poll.setTimer({timeoutMins}); + poll.setTimer({ timeoutMins }); room.add(this.tr`The poll timer was turned on: the poll will end in ${Chat.toDurationString(timeoutMins * MINUTES)}.`); this.modlog('POLL TIMER', null, `${timeoutMins} minutes`); return this.privateModAction(room.tr`The poll timer was set to ${timeoutMins} minute(s) by ${user.name}.`); @@ -708,20 +708,20 @@ process.nextTick(() => { Chat.multiLinePattern.register('/poll (new|create|createmulti|htmlcreate|htmlcreatemulti|queue|queuemulti|htmlqueuemulti) '); }); -// should handle restarts and also hotpatches +// convert from old format (should handle restarts and also hotpatches) for (const room of Rooms.rooms.values()) { if (room.getMinorActivityQueue(true)) { for (const poll of room.getMinorActivityQueue(true)!) { if (!poll.activityid) { - // @ts-ignore + // @ts-expect-error old format poll.activityid = poll.activityId; - // @ts-ignore + // @ts-expect-error old format delete poll.activityId; } if (!poll.activityNumber) { - // @ts-ignore + // @ts-expect-error old format poll.activityNumber = poll.pollNumber; - // @ts-ignore + // @ts-expect-error old format delete poll.pollNumber; } room.saveSettings(); @@ -729,15 +729,15 @@ for (const room of Rooms.rooms.values()) { } if (room.settings.minorActivity) { if (!room.settings.minorActivity.activityid) { - // @ts-ignore + // @ts-expect-error old format room.settings.minorActivity.activityid = room.settings.minorActivity.activityId; - // @ts-ignore + // @ts-expect-error old format delete room.settings.minorActivity.activityId; } if (typeof room.settings.minorActivity.activityNumber !== 'number') { - // @ts-ignore + // @ts-expect-error old format room.settings.minorActivity.activityNumber = room.settings.minorActivity.pollNumber || - // @ts-ignore + // @ts-expect-error old format room.settings.minorActivity.announcementNumber; } room.saveSettings(); diff --git a/server/chat-plugins/quotes.ts b/server/chat-plugins/quotes.ts index 4557e952d3..ff21553962 100644 --- a/server/chat-plugins/quotes.ts +++ b/server/chat-plugins/quotes.ts @@ -1,4 +1,4 @@ -import {FS, Utils} from '../../lib'; +import { FS, Utils } from '../../lib'; const STORAGE_PATH = 'config/chat-plugins/quotes.json'; const MAX_QUOTES = 300; @@ -9,17 +9,14 @@ interface Quote { date: number; } -const quotes: {[room: string]: Quote[]} = JSON.parse(FS(STORAGE_PATH).readIfExistsSync() || "{}"); +const quotes: { [room: string]: Quote[] } = JSON.parse(FS(STORAGE_PATH).readIfExistsSync() || "{}"); // migrate quotes out of roomsettings function convertOldQuotes() { for (const room of Rooms.rooms.values()) { - // @ts-ignore - if (room.settings.quotes) { - // @ts-ignore - quotes[room.roomid] = room.settings.quotes; - // @ts-ignore - delete room.settings.quotes; + if ((room.settings as any).quotes) { + quotes[room.roomid] = (room.settings as any).quotes; + delete (room.settings as any).quotes; room.saveSettings(); saveQuotes(); } @@ -38,8 +35,8 @@ export const commands: Chat.ChatCommands = { const roomQuotes = quotes[room.roomid]; if (!roomQuotes?.length) return this.errorReply(`This room has no quotes.`); this.runBroadcast(true); - const {quote, date, userid} = roomQuotes[Math.floor(Math.random() * roomQuotes.length)]; - const time = Chat.toTimestamp(new Date(date), {human: true}); + const { quote, date, userid } = roomQuotes[Math.floor(Math.random() * roomQuotes.length)]; + const time = Chat.toTimestamp(new Date(date), { human: true }); const attribution = toID(target) === 'showauthor' ? `
    Added by ${userid} on ${time}` : ''; return this.sendReplyBox(`${Chat.getReadmoreBlock(quote)}${attribution}`); }, @@ -70,7 +67,7 @@ export const commands: Chat.ChatCommands = { if (room.settings.isPrivate && roomQuotes.length >= MAX_QUOTES) { return this.errorReply(`This room already has ${MAX_QUOTES} quotes, which is the maximum for private rooms.`); } - roomQuotes.push({userid: user.id, quote: target, date: Date.now()}); + roomQuotes.push({ userid: user.id, quote: target, date: Date.now() }); saveQuotes(); this.refreshPage(`quotes-${room.roomid}`); const collapsedQuote = target.replace(/\n/g, ' '); @@ -113,8 +110,8 @@ export const commands: Chat.ChatCommands = { return this.errorReply(`Quote not found.`); } this.runBroadcast(true); - const {quote, date, userid} = roomQuotes[index]; - const time = Chat.toTimestamp(new Date(date), {human: true}); + const { quote, date, userid } = roomQuotes[index]; + const time = Chat.toTimestamp(new Date(date), { human: true }); const attribution = toID(showAuthor) === 'showauthor' ? `
    Added by ${userid} on ${time}` : ''; return this.sendReplyBox(`${Chat.formatText(quote, false, true)}${attribution}`); }, @@ -163,9 +160,9 @@ export const pages: Chat.PageTable = { buffer += Utils.html`

    Quotes for ${room.title} (${roomQuotes.length}):

    `; for (const [i, quoteObj] of roomQuotes.entries()) { const index = i + 1; - const {quote, userid, date} = quoteObj; + const { quote, userid, date } = quoteObj; buffer += `
    #${index}: ${Chat.formatText(quote, false, true)}`; - buffer += `

    Added by ${userid} on ${Chat.toTimestamp(new Date(date), {human: true})}`; + buffer += `

    Added by ${userid} on ${Chat.toTimestamp(new Date(date), { human: true })}`; if (user.can('mute', null, room)) { buffer += ` `; } diff --git a/server/chat-plugins/randombattles/index.ts b/server/chat-plugins/randombattles/index.ts index 5c4df7ad4a..8ac43f0c72 100644 --- a/server/chat-plugins/randombattles/index.ts +++ b/server/chat-plugins/randombattles/index.ts @@ -5,23 +5,21 @@ * Set probability code written by Annika */ -import {FS, Utils} from '../../../lib'; - +import { FS, Utils } from '../../../lib'; interface SetCriteria { - moves: {mustHave: Move[], mustNotHave: Move[]}; - ability: {mustHave?: Ability, mustNotHave: Ability[]}; - item: {mustHave?: Item, mustNotHave: Item[]}; - nature: {mustHave?: Nature, mustNotHave: Nature[]}; - teraType: {mustHave?: TypeInfo, mustNotHave: TypeInfo[]}; + moves: { mustHave: Move[], mustNotHave: Move[] }; + ability: { mustHave?: Ability, mustNotHave: Ability[] }; + item: { mustHave?: Item, mustNotHave: Item[] }; + nature: { mustHave?: Nature, mustNotHave: Nature[] }; + teraType: { mustHave?: TypeInfo, mustNotHave: TypeInfo[] }; } - function getHTMLCriteriaDescription(criteria: SetCriteria) { - const format = (list: {name: string}[]) => list.map(m => Utils.html`${m.name}`); + const format = (list: { name: string }[]) => list.map(m => Utils.html`${m.name}`); const parts = []; - const {moves, ability, item, nature, teraType} = criteria; + const { moves, ability, item, nature, teraType } = criteria; if (moves.mustHave.length) { parts.push(`had the move${Chat.plural(moves.mustHave)} ${Chat.toListString(format(moves.mustHave))}`); @@ -66,8 +64,8 @@ function setProbability( format: Format, criteria: SetCriteria, rounds = 700 -): {rounds: number, matches: number} { - const results = {rounds, matches: 0}; +): { rounds: number, matches: number } { + const results = { rounds, matches: 0 }; const generator = Teams.getGenerator(format); for (let i = 0; i < rounds; i++) { @@ -104,16 +102,16 @@ function setProbability( return results; } -const GEN_NAMES: {[k: string]: string} = { +const GEN_NAMES: { [k: string]: string } = { gen1: '[Gen 1]', gen2: '[Gen 2]', gen3: '[Gen 3]', gen4: '[Gen 4]', gen5: '[Gen 5]', gen6: '[Gen 6]', gen7: '[Gen 7]', gen8: '[Gen 8]', gen9: '[Gen 9]', }; -export const STAT_NAMES: {[k: string]: string} = { +export const STAT_NAMES: { [k: string]: string } = { hp: "HP", atk: "Atk", def: "Def", spa: "SpA", spd: "SpD", spe: "Spe", }; -const TIERS: {[k: string]: string} = { +const TIERS: { [k: string]: string } = { uber: "Uber", ubers: "Uber", ou: "OU", uu: "UU", ru: "RU", nu: "NU", pu: "PU", mono: "Mono", monotype: "Mono", lc: "LC", littlecup: "LC", @@ -175,7 +173,7 @@ function getSets(species: string | Species, format: string | Format = 'gen9rando /** * Gets the random battles data for a Pokemon for formats with the old schema. */ -function getData(species: string | Species, format: string | Format): any | null { +function getData(species: string | Species, format: string | Format): AnyObject | null { const dex = Dex.forFormat(format); format = Dex.formats.get(format); species = dex.species.get(species); @@ -198,7 +196,7 @@ function getLevel(species: string | Species, format: string | Format): number { switch (format.id) { // Only formats where levels are not all manually assigned should be copied here case 'gen2randombattle': - const levelScale: {[k: string]: number} = { + const levelScale: { [k: string]: number } = { ZU: 81, ZUBL: 79, PU: 77, @@ -273,15 +271,15 @@ function battleFactorySets(species: string | Species, tier: string | null, gen = if (!Object.keys(statsFile).length) return null; let buf = ``; if (!isBSS) { - if (!tier) return {e: `Please provide a valid tier.`}; - if (!(toID(tier) in TIERS)) return {e: `That tier isn't supported.`}; + if (!tier) throw new Chat.ErrorMessage(`Please provide a valid tier.`); + if (!(toID(tier) in TIERS)) throw new Chat.ErrorMessage(`That tier isn't supported.`); if (!(TIERS[toID(tier)] in statsFile)) { - return {e: `${TIERS[toID(tier)]} is not included in [Gen ${genNum}] Battle Factory.`}; + throw new Chat.ErrorMessage(`${TIERS[toID(tier)]} is not included in [Gen ${genNum}] Battle Factory.`); } const t = statsFile[TIERS[toID(tier)]]; if (!(species.id in t)) { const formatName = Dex.formats.get(`${gen}battlefactory`).name; - return {e: `${species.name} doesn't have any sets in ${TIERS[toID(tier)]} for ${formatName}.`}; + throw new Chat.ErrorMessage(`${species.name} doesn't have any sets in ${TIERS[toID(tier)]} for ${formatName}.`); } const setObj = t[species.id]; if (genNum >= 9) { @@ -332,7 +330,7 @@ function battleFactorySets(species: string | Species, tier: string | null, gen = } } else { const format = Dex.formats.get(`${gen}bssfactory`); - if (!(species.id in statsFile)) return {e: `${species.name} doesn't have any sets in ${format.name}.`}; + if (!(species.id in statsFile)) throw new Chat.ErrorMessage(`${species.name} doesn't have any sets in ${format.name}.`); const setObj = statsFile[species.id]; if (genNum >= 9) { buf += `Species rarity: ${setObj.weight} (higher is more common, max 10)
    `; @@ -426,7 +424,7 @@ function CAP1v1Sets(species: string | Species) { }; } if (species.isNonstandard === "CAP" && !(species.name in statsFile)) { - return {e: `${species.name} doesn't have any sets in [Gen 8] CAP 1v1.`}; + return { e: `${species.name} doesn't have any sets in [Gen 8] CAP 1v1.` }; } let buf = `Sets for ${species.name} in [Gen 8] CAP 1v1:
    `; for (const [i, set] of statsFile[species.name].entries()) { @@ -489,12 +487,12 @@ export const commands: Chat.ChatCommands = { const args = target.split(','); if (!args[0]) return this.parse(`/help randombattles`); - const {dex} = this.splitFormat(target, true); + const { dex } = this.splitFormat(target, true); const isLetsGo = (dex.currentMod === 'gen7letsgo'); const searchResults = dex.dataSearch(args[0], ['Pokedex']); - if (!searchResults || !searchResults.length) { + if (!searchResults?.length) { this.errorReply(`No Pok\u00e9mon named '${args[0]}' was found${Dex.gen > dex.gen ? ` in Gen ${dex.gen}` : ""}. (Check your spelling?)`); return; } @@ -613,9 +611,6 @@ export const commands: Chat.ChatCommands = { if (args[1] && toID(args[1]) in Dex.dexes && Dex.dexes[toID(args[1])].gen >= 7) mod = toID(args[1]); const bssSets = battleFactorySets(species, null, mod, true); if (!bssSets) return this.parse(`/help battlefactory`); - if (typeof bssSets !== 'string') { - return this.errorReply(`Error: ${bssSets.e}`); - } return this.sendReplyBox(bssSets); } else { const args = target.split(','); @@ -634,21 +629,18 @@ export const commands: Chat.ChatCommands = { let bfSets; if (species.name === 'Necrozma-Ultra') { bfSets = battleFactorySets(Dex.species.get('necrozma-dawnwings'), tier, mod); - if (typeof bfSets === 'string') { - bfSets += battleFactorySets(Dex.species.get('necrozma-duskmane'), tier, mod); + if (bfSets) { + bfSets += battleFactorySets(Dex.species.get('necrozma-duskmane'), tier, mod)!; } } else if (species.name === 'Zygarde-Complete') { bfSets = battleFactorySets(Dex.species.get('zygarde'), tier, mod); - if (typeof bfSets === 'string') { - bfSets += battleFactorySets(Dex.species.get('zygarde-10'), tier, mod); + if (bfSets) { + bfSets += battleFactorySets(Dex.species.get('zygarde-10'), tier, mod)!; } } else { bfSets = battleFactorySets(species, tier, mod); } if (!bfSets) return this.parse(`/help battlefactory`); - if (typeof bfSets !== 'string') { - return this.errorReply(`Error: ${bfSets.e}`); - } return this.sendReplyBox(bfSets); } }, @@ -682,7 +674,7 @@ export const commands: Chat.ChatCommands = { randombattlesetprobabilities(target, room, user) { // Restricted to global staff and randbats room auth const randbatsRoom = Rooms.get('randombattles'); - if (!(randbatsRoom && randbatsRoom.auth.has(user.id))) { + if (!randbatsRoom?.auth.has(user.id)) { this.checkCan('lock'); } @@ -730,11 +722,11 @@ export const commands: Chat.ChatCommands = { // Criteria const criteria: SetCriteria = { - moves: {mustHave: [], mustNotHave: []}, - item: {mustNotHave: []}, - ability: {mustNotHave: []}, - nature: {mustNotHave: []}, - teraType: {mustNotHave: []}, + moves: { mustHave: [], mustNotHave: [] }, + item: { mustNotHave: [] }, + ability: { mustNotHave: [] }, + nature: { mustNotHave: [] }, + teraType: { mustNotHave: [] }, }; if (args.length < 1) { diff --git a/server/chat-plugins/randombattles/ssb.ts b/server/chat-plugins/randombattles/ssb.ts index b707400d77..5bb8ff1774 100644 --- a/server/chat-plugins/randombattles/ssb.ts +++ b/server/chat-plugins/randombattles/ssb.ts @@ -1,6 +1,6 @@ -import {SSBSet, ssbSets} from "../../../data/mods/gen9ssb/random-teams"; -import {Utils} from "../../../lib"; -import {formatNature, STAT_NAMES} from "."; +import { type SSBSet, ssbSets } from "../../../data/mods/gen9ssb/random-teams"; +import { Utils } from "../../../lib"; +import { formatNature, STAT_NAMES } from "."; function generateSSBSet(set: SSBSet, dex: ModdedDex, baseDex: ModdedDex) { if (set.skip) { @@ -53,7 +53,7 @@ function generateSSBMoveInfo(sigMove: Move, dex: ModdedDex) { if (sigMove.shortDesc || sigMove.desc) { buf += `
    `; buf += Chat.getDataMoveHTML(sigMove); - const details: {[k: string]: string} = { + const details: { [k: string]: string } = { Priority: String(sigMove.priority), Gen: String(sigMove.gen || 9), }; @@ -81,7 +81,7 @@ function generateSSBMoveInfo(sigMove: Move, dex: ModdedDex) { if (sigMove.zMove?.basePower) { details["Z-Power"] = String(sigMove.zMove.basePower); } else if (sigMove.zMove?.effect) { - const zEffects: {[k: string]: string} = { + const zEffects: { [k: string]: string } = { clearnegativeboost: "Restores negative stat stages to 0", crit2: "Crit ratio +2", heal: "Restores HP 100%", @@ -108,7 +108,7 @@ function generateSSBMoveInfo(sigMove: Move, dex: ModdedDex) { details["Z-Effect"] = "None"; } - const targetTypes: {[k: string]: string} = { + const targetTypes: { [k: string]: string } = { normal: "One Adjacent Pok\u00e9mon", self: "User", adjacentAlly: "One Ally", @@ -147,7 +147,7 @@ function generateSSBItemInfo(set: SSBSet, dex: ModdedDex, baseDex: ModdedDex) { if (!baseItem.exists || (baseItem.desc || baseItem.shortDesc) !== (sigItem.desc || sigItem.shortDesc)) { buf += `
    `; buf += Chat.getDataItemHTML(sigItem); - const details: {[k: string]: string} = { + const details: { [k: string]: string } = { Gen: String(sigItem.gen), }; @@ -196,7 +196,7 @@ function generateSSBAbilityInfo(set: SSBSet, dex: ModdedDex, baseDex: ModdedDex) } buf += `
    `; buf += Chat.getDataAbilityHTML(sigAbil); - const details: {[k: string]: string} = { + const details: { [k: string]: string } = { Gen: String(sigAbil.gen || 9) || 'CAP', }; if (sigAbil.flags['cantsuppress']) details["✓ Not affected by Gastro Acid"] = ""; @@ -234,7 +234,7 @@ function generateSSBPokemonInfo(species: string, dex: ModdedDex, baseDex: Modded } else if (newSpecies.weighthg >= 100) { weighthit = 40; } - const details: {[k: string]: string} = { + const details: { [k: string]: string } = { "Dex#": String(newSpecies.num), Gen: String(newSpecies.gen) || 'CAP', Height: `${newSpecies.heightm} m`, @@ -319,7 +319,7 @@ function generateSSBInnateInfo(name: string, dex: ModdedDex, baseDex: ModdedDex) } } if (buf) { - const details: {[k: string]: string} = {Gen: '9'}; + const details: { [k: string]: string } = { Gen: '9' }; buf += `${Object.entries(details).map(([detail, value]) => ( value === '' ? detail : `${detail}: ${value}` )).join(" |  ")}`; @@ -334,7 +334,7 @@ function SSBSets(target: string) { const baseDex = Dex; const dex = Dex.forFormat('gen9superstaffbrosultimate'); if (!Object.keys(ssbSets).map(toID).includes(toID(target))) { - return {e: `Error: ${target.trim()} doesn't have a [Gen 9] Super Staff Bros Ultimate set.`}; + return { e: `Error: ${target.trim()} doesn't have a [Gen 9] Super Staff Bros Ultimate set.` }; } let name = ''; for (const member in ssbSets) { @@ -380,7 +380,6 @@ function SSBSets(target: string) { return buf; } - export const disabledSets = Chat.oldPlugins.ssb?.disabledSets || []; function enforceDisabledSets() { diff --git a/server/chat-plugins/randombattles/winrates.ts b/server/chat-plugins/randombattles/winrates.ts index da168fd78a..cced97f676 100644 --- a/server/chat-plugins/randombattles/winrates.ts +++ b/server/chat-plugins/randombattles/winrates.ts @@ -3,7 +3,7 @@ * @author mia-pi-git */ -import {FS, Utils} from '../../../lib'; +import { FS, Utils } from '../../../lib'; interface Stats { elo: number; @@ -44,25 +44,25 @@ function getDefaultStats() { formats: { // all of these requested by rands staff. they don't anticipate it being changed much // so i'm not spending the time to add commands to toggle this - gen9randombattle: {mons: {}}, - gen9randomdoublesbattle: {mons: {}}, - gen9babyrandombattle: {mons: {}}, - gen9superstaffbrosultimate: {mons: {}}, - gen8randombattle: {mons: {}}, - gen7randombattle: {mons: {}}, - gen6randombattle: {mons: {}}, - gen5randombattle: {mons: {}}, - gen4randombattle: {mons: {}}, - gen3randombattle: {mons: {}}, - gen2randombattle: {mons: {}}, - gen1randombattle: {mons: {}}, + gen9randombattle: { mons: {} }, + gen9randomdoublesbattle: { mons: {} }, + gen9babyrandombattle: { mons: {} }, + gen9superstaffbrosultimate: { mons: {} }, + gen8randombattle: { mons: {} }, + gen7randombattle: { mons: {} }, + gen6randombattle: { mons: {} }, + gen5randombattle: { mons: {} }, + gen4randombattle: { mons: {} }, + gen3randombattle: { mons: {} }, + gen2randombattle: { mons: {} }, + gen1randombattle: { mons: {} }, }, } as Stats; } export function saveStats(month = getMonth()) { // clone to avoid race conditions with the data getting deleted later (on month rollover) - const curStats = {...stats}; + const curStats = { ...stats }; FS(STATS_PATH.replace('{{MONTH}}', month)).writeUpdate(() => JSON.stringify(curStats)); } @@ -81,11 +81,11 @@ export function getSpeciesName(set: PokemonSet, format: Format) { if (species.startsWith("Pikachu-")) { return 'Pikachu'; } else if (species.startsWith("Unown-")) { - return 'Unown'; + return 'Unown'; } else if (species === "Gastrodon-East") { return 'Gastrodon'; } else if (species === "Magearna-Original") { - return "Magearna"; + return "Magearna"; } else if (species === "Genesect-Douse") { return "Genesect"; } else if (species === "Dudunsparce-Three-Segment") { @@ -163,7 +163,6 @@ const getZScore = (data: MonEntry) => ( 2 * Math.sqrt(data.timesGenerated) * (data.numWins / data.timesGenerated - 0.5) ); - export const handlers: Chat.Handlers = { onBattleEnd(battle, winner, players) { void collectStats(battle, winner, players); @@ -190,7 +189,7 @@ async function collectStats(battle: RoomBattle, winner: ID, players: ID[]) { if (!team) return; // ??? const mons = team.map(f => getSpeciesName(f, format)); for (const mon of mons) { - if (!formatData.mons[mon]) formatData.mons[mon] = {timesGenerated: 0, numWins: 0}; + if (!formatData.mons[mon]) formatData.mons[mon] = { timesGenerated: 0, numWins: 0 }; formatData.mons[mon].timesGenerated++; if (toID(winner) === toID(p.name)) { formatData.mons[mon].numWins++; @@ -292,7 +291,7 @@ export const pages: Chat.PageTable = { buf += `
    `; for (const [mon, data] of mons) { buf += ``; - const {timesGenerated, numWins} = data; + const { timesGenerated, numWins } = data; buf += ``; buf += ``; buf += ``; diff --git a/server/chat-plugins/repeats.ts b/server/chat-plugins/repeats.ts index 495d970129..be7a1a3c82 100644 --- a/server/chat-plugins/repeats.ts +++ b/server/chat-plugins/repeats.ts @@ -4,8 +4,8 @@ * @author Annika, Zarel */ -import {roomFaqs, getAlias, visualizeFaq} from './room-faqs'; -import type {MessageHandler} from '../rooms'; +import { roomFaqs, getAlias, visualizeFaq } from './room-faqs'; +import type { MessageHandler } from '../rooms'; export interface RepeatedPhrase { /** Identifier for deleting */ @@ -82,7 +82,7 @@ export const Repeats = new class { roomRepeats = new Map(); this.repeats.set(room, roomRepeats); } - const {id, phrase, interval} = repeat; + const { id, phrase, interval } = repeat; if (roomRepeats.has(id)) { throw new Error(`Repeat already exists`); @@ -278,7 +278,7 @@ export const commands: Chat.ChatCommands = { return this.errorReply(this.tr`There are no repeated phrases in this room.`); } - for (const {id} of room.settings.repeats) { + for (const { id } of room.settings.repeats) { Repeats.removeRepeat(room, id); } diff --git a/server/chat-plugins/responder.ts b/server/chat-plugins/responder.ts index d23d6bcfa1..b37200ab70 100644 --- a/server/chat-plugins/responder.ts +++ b/server/chat-plugins/responder.ts @@ -7,14 +7,14 @@ * @author mia-pi-git */ -import {FS, Utils} from '../../lib'; -import {LogViewer} from './chatlog'; -import {roomFaqs, visualizeFaq} from './room-faqs'; +import { FS, Utils } from '../../lib'; +import { LogViewer } from './chatlog'; +import { roomFaqs, visualizeFaq } from './room-faqs'; const DATA_PATH = 'config/chat-plugins/responder.json'; const LOG_PATH = Monitor.logPath('responder.jsonl').path; -export let answererData: {[roomid: string]: PluginData} = {}; +export let answererData: { [roomid: string]: PluginData } = {}; try { answererData = JSON.parse(FS(DATA_PATH).readSync()); @@ -34,7 +34,7 @@ interface LoggedMessage { } interface PluginData { /** Word pairs that have been marked as a match for a specific FAQ. */ - pairs: {[k: string]: string[]}; + pairs: { [k: string]: string[] }; /** Common terms to be ignored in question parsing. */ ignore?: string[]; } @@ -44,14 +44,14 @@ export class AutoResponder { room: Room; constructor(room: Room, data?: PluginData) { this.room = room; - this.data = data || {pairs: {}, ignore: []}; + this.data = data || { pairs: {}, ignore: [] }; AutoResponder.migrateStats(this.data, this); } static migrateStats(data: any, responder: AutoResponder) { if (!data.stats) return data; for (const date in data.stats) { for (const entry of data.stats[date].matches) { - void this.logMessage(responder.room.roomid, {...entry, date}); + void this.logMessage(responder.room.roomid, { ...entry, date }); } } delete data.stats; @@ -190,7 +190,7 @@ export class AutoResponder { const regexes = this.data.pairs[faq].map(item => new RegExp(item, "i")); if (!regexes.length) return; for (const regex of regexes) { - if (regex.test(question)) return {faq, regex: regex.toString()}; + if (regex.test(question)) return { faq, regex: regex.toString() }; } return null; } @@ -241,8 +241,7 @@ export class AutoResponder { destroy() { this.writeState(); this.room.responder = null; - // @ts-ignore deallocating - this.room = null; + this.room = null!; } ignore(terms: string[], context: Chat.CommandContext) { const filtered = terms.map(t => context.filter(t)).filter(Boolean); @@ -532,7 +531,7 @@ export const pages: Chat.PageTable = { export const handlers: Chat.Handlers = { onRenameRoom(oldID, newID) { if (answererData[oldID]) { - if (!answererData[newID]) answererData[newID] = {pairs: {}}; + if (!answererData[newID]) answererData[newID] = { pairs: {} }; Object.assign(answererData[newID], answererData[oldID]); delete answererData[oldID]; FS(DATA_PATH).writeUpdate(() => JSON.stringify(answererData)); diff --git a/server/chat-plugins/room-events.ts b/server/chat-plugins/room-events.ts index 8e46b591fe..f823c2b29e 100644 --- a/server/chat-plugins/room-events.ts +++ b/server/chat-plugins/room-events.ts @@ -6,7 +6,7 @@ * * @license MIT license */ -import {Utils} from '../../lib'; +import { Utils } from '../../lib'; export interface RoomEvent { eventName: string; @@ -28,7 +28,7 @@ function convertAliasFormat(room: Room) { for (const event of Object.values(room.settings.events) as AnyObject[]) { if (!event.aliases) continue; for (const alias of event.aliases) { - room.settings.events[alias] = {eventID: toID(event.eventName)}; + room.settings.events[alias] = { eventID: toID(event.eventName) }; } delete event.aliases; } @@ -41,7 +41,7 @@ function formatEvent(room: Room, event: RoomEvent, showAliases?: boolean, showCa if (timeRemaining < 0) explanation = "This event will start soon"; if (event.started) explanation = "This event has started"; if (!isNaN(timeRemaining)) { - explanation = `This event will start in: ${Chat.toDurationString(timeRemaining, {precision: 2})}`; + explanation = `This event will start in: ${Chat.toDurationString(timeRemaining, { precision: 2 })}`; } const eventID = toID(event.eventName); @@ -65,7 +65,7 @@ function getAliases(room: Room, eventID?: ID) { for (const aliasID in room.settings.events) { if ( 'eventID' in room.settings.events[aliasID] && - (!eventID || (room.settings.events[aliasID] as RoomEventAlias).eventID === eventID) + (!eventID || room.settings.events[aliasID].eventID === eventID) ) aliases.push(aliasID); } return aliases; @@ -254,7 +254,7 @@ export const commands: Chat.ChatCommands = { for (const alias of getAliases(room, eventID)) { delete room.settings.events[alias]; } - for (const category of getAllCategories(room).map(cat => room!.settings.events?.[cat] as RoomEventCategory)) { + for (const category of getAllCategories(room).map(cat => room.settings.events?.[cat] as RoomEventCategory)) { category.events = category.events.filter(event => event !== eventID); } @@ -280,7 +280,7 @@ export const commands: Chat.ChatCommands = { const category = room.settings.events[categoryID]; if ('events' in category && categoryID === target) { events = category.events - .map(e => room!.settings.events?.[e] as RoomEvent) + .map(e => room.settings.events?.[e] as RoomEvent) .filter(e => e); break; } @@ -301,7 +301,7 @@ export const commands: Chat.ChatCommands = { for (const potentialCategory of getAllCategories(room)) { if ( events.map(event => toID(event.eventName)) - .filter(id => (room!.settings.events?.[potentialCategory] as RoomEventCategory).events.includes(id)).length + .filter(id => (room.settings.events?.[potentialCategory] as RoomEventCategory).events.includes(id)).length ) hasCategories = true; break; } @@ -339,7 +339,7 @@ export const commands: Chat.ChatCommands = { if (!(event && 'eventName' in event)) return this.errorReply(`There is no event titled "${eventId}".`); if (room.settings.events[alias]) return this.errorReply(`"${alias}" is already an event, alias, or category.`); - room.settings.events[alias] = {eventID: eventId}; + room.settings.events[alias] = { eventID: eventId }; this.privateModAction(`${user.name} added an alias "${alias}" for the roomevent "${eventId}".`); this.modlog('ROOMEVENT', null, `alias for "${eventId}": "${alias}"`); room.saveSettings(); @@ -443,7 +443,7 @@ export const commands: Chat.ChatCommands = { if (!room.settings.events) room.settings.events = Object.create(null); if (room.settings.events?.[categoryId]) return this.errorReply(`The category "${target}" already exists.`); - room.settings.events![categoryId] = {events: []}; + room.settings.events![categoryId] = { events: [] }; this.privateModAction(`${user.name} added the category "${categoryId}".`); this.modlog('ROOMEVENT', null, `category: added "${categoryId}"`); @@ -504,8 +504,7 @@ export const commands: Chat.ChatCommands = { let columnName = ""; const delimited = target.split(target.includes('|') ? '|' : ','); const sortable = Object.values(room.settings.events) - .filter(event => 'eventName' in event) - .map(event => event as RoomEvent); + .filter((event): event is RoomEvent => 'eventName' in event); // id tokens if (delimited.length === 1) { @@ -524,8 +523,8 @@ export const commands: Chat.ChatCommands = { case "eventdate": sortable.sort( (a, b) => - (toID(a.date) < toID(b.date)) ? -1 * multiplier : - (toID(b.date) < toID(a.date)) ? 1 * multiplier : 0 + (toID(a.date) < toID(b.date)) ? -multiplier : + (toID(b.date) < toID(a.date)) ? multiplier : 0 ); break; case "desc": @@ -533,16 +532,16 @@ export const commands: Chat.ChatCommands = { case "eventdescription": sortable.sort( (a, b) => - (toID(a.desc) < toID(b.desc)) ? -1 * multiplier : - (toID(b.desc) < toID(a.desc)) ? 1 * multiplier : 0 + (toID(a.desc) < toID(b.desc)) ? -multiplier : + (toID(b.desc) < toID(a.desc)) ? multiplier : 0 ); break; case "eventname": case "name": sortable.sort( (a, b) => - (toID(a.eventName) < toID(b.eventName)) ? -1 * multiplier : - (toID(b.eventName) < toID(a.eventName)) ? 1 * multiplier : 0 + (toID(a.eventName) < toID(b.eventName)) ? -multiplier : + (toID(b.eventName) < toID(a.eventName)) ? multiplier : 0 ); break; default: diff --git a/server/chat-plugins/room-faqs.ts b/server/chat-plugins/room-faqs.ts index cff37190ff..ef67191e55 100644 --- a/server/chat-plugins/room-faqs.ts +++ b/server/chat-plugins/room-faqs.ts @@ -1,9 +1,9 @@ -import {FS, Utils} from '../../lib'; +import { FS, Utils } from '../../lib'; export const ROOMFAQ_FILE = 'config/chat-plugins/faqs.json'; const MAX_ROOMFAQ_LENGTH = 8192; -export const roomFaqs: {[k: string]: {[k: string]: RoomFAQ}} = (() => { +export const roomFaqs: { [k: string]: { [k: string]: RoomFAQ } } = (() => { const data = JSON.parse(FS(ROOMFAQ_FILE).readIfExistsSync() || "{}"); let save = false; for (const k in data) { @@ -24,7 +24,7 @@ interface RoomFAQ { html?: boolean; } -function saveRoomFaqs(table?: {[k: string]: {[k: string]: RoomFAQ}}) { +function saveRoomFaqs(table?: { [k: string]: { [k: string]: RoomFAQ } }) { FS(ROOMFAQ_FILE).writeUpdate(() => JSON.stringify(table || roomFaqs)); } @@ -108,7 +108,7 @@ export const commands: Chat.ChatCommands = { const topic = toID(target); if (!topic) return this.parse('/help roomfaq'); - if (!(roomFaqs[room.roomid] && roomFaqs[room.roomid][topic])) return this.errorReply("Invalid topic."); + if (!roomFaqs[room.roomid]?.[topic]) return this.errorReply("Invalid topic."); if ( room.settings.repeats?.length && room.settings.repeats.filter(x => x.faq && x.id === topic).length @@ -117,9 +117,9 @@ export const commands: Chat.ChatCommands = { } delete roomFaqs[room.roomid][topic]; Object.keys(roomFaqs[room.roomid]).filter( - val => getAlias(room!.roomid, val) === topic + val => getAlias(room.roomid, val) === topic ).map( - val => delete roomFaqs[room!.roomid][val] + val => delete roomFaqs[room.roomid][val] ); if (!Object.keys(roomFaqs[room.roomid]).length) delete roomFaqs[room.roomid]; saveRoomFaqs(); diff --git a/server/chat-plugins/sample-teams.ts b/server/chat-plugins/sample-teams.ts index 3ff4663f33..81c8741752 100644 --- a/server/chat-plugins/sample-teams.ts +++ b/server/chat-plugins/sample-teams.ts @@ -4,17 +4,17 @@ * @author Kris */ -import {FS, Utils} from "../../lib"; +import { FS, Utils } from "../../lib"; const SAMPLE_TEAMS = 'config/chat-plugins/sample-teams.json'; interface SampleTeamsData { - whitelist: {[formatid: string]: RoomID[]}; + whitelist: { [formatid: string]: RoomID[] }; /** Teams are stored in the packed format */ teams: { [formatid: string]: { - uncategorized: {[k: string]: string}, - [category: string]: {[teamName: string]: string}, + uncategorized: { [k: string]: string }, + [category: string]: { [teamName: string]: string }, }, }; } @@ -65,7 +65,7 @@ export const SampleTeams = new class SampleTeams { whitelistedRooms(formatid: string, names = false) { formatid = this.sanitizeFormat(formatid); if (!teamData.whitelist[formatid]?.length) return null; - return Utils.sortBy(teamData.whitelist[formatid], (x) => { + return Utils.sortBy(teamData.whitelist[formatid], x => { if (!names) return x; const room = Rooms.search(x); if (!room) return x; @@ -118,7 +118,7 @@ export const SampleTeams = new class SampleTeams { initializeFormat(formatid: string) { if (!teamData.teams[formatid]) { - teamData.teams[formatid] = {uncategorized: {}}; + teamData.teams[formatid] = { uncategorized: {} }; save(); } } diff --git a/server/chat-plugins/scavenger-games.ts b/server/chat-plugins/scavenger-games.ts index beeec1aadc..996e7b158f 100644 --- a/server/chat-plugins/scavenger-games.ts +++ b/server/chat-plugins/scavenger-games.ts @@ -7,8 +7,8 @@ * @license MIT license */ -import {ScavengerHunt, ScavengerHuntPlayer, sanitizeAnswer} from './scavengers'; -import {Utils} from '../../lib'; +import { ScavengerHunt, type ScavengerHuntPlayer, sanitizeAnswer } from './scavengers'; +import { Utils } from '../../lib'; export type TwistEvent = (this: ScavengerHunt, ...args: any[]) => void; interface Twist { @@ -35,11 +35,11 @@ interface GameMode { function toSeconds(time: string) { // hhmmss => ss const parts = time.split(':').reverse(); - return parts.map((value, index) => parseInt(value) * Math.pow(60, index)).reduce((a, b) => a + b); + return parts.map((value, index) => parseInt(value) * (60 ** index)).reduce((a, b) => a + b); } class Leaderboard { - data: {[userid: string]: AnyObject}; + data: { [userid: string]: AnyObject }; constructor() { this.data = {}; @@ -49,7 +49,7 @@ class Leaderboard { const userid: string = toID(name); if (!userid || userid === 'constructor' || !points) return this; - if (!this.data[userid]) this.data[userid] = {name: name}; + if (!this.data[userid]) this.data[userid] = { name }; if (!this.data[userid][aspect]) this.data[userid][aspect] = 0; this.data[userid][aspect] += points; @@ -59,8 +59,8 @@ class Leaderboard { return this; // allow chaining } - visualize(sortBy: string): Promise<({rank: number} & AnyObject)[]>; - visualize(sortBy: string, userid: string): Promise<({rank: number} & AnyObject) | undefined>; + visualize(sortBy: string): Promise<({ rank: number } & AnyObject)[]>; + visualize(sortBy: string, userid: string): Promise<({ rank: number } & AnyObject) | undefined>; visualize(sortBy: string, userid?: string) { // FIXME: this is not how promises work // return a promise for async sorting - make this less exploitable @@ -79,7 +79,7 @@ class Leaderboard { return { rank: lastPlacement, ...bit, - } as {rank: number} & AnyObject; + } as { rank: number } & AnyObject; }); // identify ties if (userid) { const rank = ladder.find(entry => toID(entry.name) === userid); @@ -98,7 +98,7 @@ class Leaderboard { } } -const TWISTS: {[k: string]: Twist} = { +const TWISTS: { [k: string]: Twist } = { perfectscore: { name: 'Perfect Score', id: 'perfectscore', @@ -124,7 +124,7 @@ const TWISTS: {[k: string]: Twist} = { onComplete(player, time, blitz) { const isPerfect = !this.leftGame?.includes(player.id) && Object.values(player.answers).every((attempts: any) => attempts.length <= 1); - return {name: player.name, time, blitz, isPerfect}; + return { name: player.name, time, blitz, isPerfect }; }, onAfterEndPriority: 1, @@ -172,7 +172,7 @@ const TWISTS: {[k: string]: Twist} = { onComplete(player, time, blitz) { const noSkip = !player.skippedQuestion; - return {name: player.name, time, blitz, noSkip}; + return { name: player.name, time, blitz, noSkip }; }, onAfterEndPriority: 1, @@ -202,13 +202,13 @@ const TWISTS: {[k: string]: Twist} = { onPreComplete(player) { const now = Date.now(); - const time = Chat.toDurationString(now - this.startTime, {hhmmss: true}); + const time = Chat.toDurationString(now - this.startTime, { hhmmss: true }); const canBlitz = this.completed.length < 3; const blitz = now - this.startTime <= 60000 && canBlitz && (this.room.settings.scavSettings?.blitzPoints?.[this.gameType] || this.gameType === 'official'); - const result = this.runEvent('Complete', player, time, blitz) || {name: player.name, time, blitz}; + const result = this.runEvent('Complete', player, time, blitz) || { name: player.name, time, blitz }; this.preCompleted = this.preCompleted ? [...this.preCompleted, result] : [result]; player.completed = true; @@ -236,13 +236,13 @@ const TWISTS: {[k: string]: Twist} = { onComplete(player, time, blitz) { const seconds = toSeconds(time); - if (!player.incorrect) return {name: player.name, total: seconds, blitz, time, original_time: time}; + if (!player.incorrect) return { name: player.name, total: seconds, blitz, time, original_time: time }; const total = seconds + (30 * player.incorrect.length); - const finalTime = Chat.toDurationString(total * 1000, {hhmmss: true}); + const finalTime = Chat.toDurationString(total * 1000, { hhmmss: true }); if (total > 60) blitz = false; - return {name: player.name, total, blitz, time: finalTime, original_time: time}; + return { name: player.name, total, blitz, time: finalTime, original_time: time }; }, onConfirmCompletion(player, time, blitz, place, result) { @@ -289,13 +289,13 @@ const TWISTS: {[k: string]: Twist} = { onPreComplete(player) { const now = Date.now(); - const time = Chat.toDurationString(now - this.startTime, {hhmmss: true}); + const time = Chat.toDurationString(now - this.startTime, { hhmmss: true }); const canBlitz = this.completed.length < 3; const blitz = now - this.startTime <= 60000 && canBlitz && (this.room.settings.scavSettings?.blitzPoints?.[this.gameType] || this.gameType === 'official'); - const result = this.runEvent('Complete', player, time, blitz) || {name: player.name, time, blitz}; + const result = this.runEvent('Complete', player, time, blitz) || { name: player.name, time, blitz }; this.preCompleted = this.preCompleted ? [...this.preCompleted, result] : [result]; player.precompleted = true; @@ -342,7 +342,7 @@ const TWISTS: {[k: string]: Twist} = { onLeave(player) { for (const ip of player.joinIps) { - this.altIps[ip] = {id: player.id, name: player.name}; + this.altIps[ip] = { id: player.id, name: player.name }; } }, @@ -359,7 +359,7 @@ const TWISTS: {[k: string]: Twist} = { const result = { name: player.name, id: player.id, - time: Chat.toDurationString(takenTime, {hhmmss: true}), + time: Chat.toDurationString(takenTime, { hhmmss: true }), duration: takenTime, blitz, }; @@ -424,7 +424,7 @@ const TWISTS: {[k: string]: Twist} = { // collate the data for each question let collection = []; for (const str in data) { - collection.push({count: data[str].length, value: str}); + collection.push({ count: data[str].length, value: str }); } collection = collection.sort((a, b) => b.count - a.count); const maxValue = collection[0]?.count || 0; @@ -520,16 +520,16 @@ const TWISTS: {[k: string]: Twist} = { const sliceIndex = this.gameType === 'official' ? 5 : 3; const hosts = Chat.toListString(this.hosts.map(h => `${Utils.escapeHTML(h.name)}`)); - const mines: {mine: string, users: string[]}[][] = []; + const mines: { mine: string, users: string[] }[][] = []; for (const mineSet of this.mines as string[][]) { - mines.push(mineSet.map(mine => ({mine: mine.substr(1), users: [] as string[]}))); + mines.push(mineSet.map(mine => ({ mine: mine.substr(1), users: [] as string[] }))); } for (const player of Object.values(this.playerTable)) { if (!player) continue; if (player.mines) { - for (const {index, mine} of player.mines) { + for (const { index, mine } of player.mines) { mines[index].find(obj => obj.mine === mine)?.users.push(player.name); } } @@ -544,7 +544,7 @@ const TWISTS: {[k: string]: Twist} = { `
    Solution:
    ` + `${this.questions.map((q, i) => ( `${i + 1}) ${this.formatOutput(q.hint)} [${Utils.escapeHTML(q.answer.join(' / '))}]
    ` + - `
    Mines: ${mines[i].map(({mine, users}) => Utils.escapeHTML(`${mine}: ${users.join(' / ') || '-'}`)).join('
    ')}
    ` + `
    Mines: ${mines[i].map(({ mine, users }) => Utils.escapeHTML(`${mine}: ${users.join(' / ') || '-'}`)).join('
    ')}
    ` )).join("
    ")}` + `
    ` ); @@ -559,9 +559,9 @@ const TWISTS: {[k: string]: Twist} = { const player = this.playerTable[playerId]; if (!player) continue; if (!player.mines) player.mines = []; - (player.mines as {index: number, mine: string}[]).push(...mines + (player.mines as { index: number, mine: string }[]).push(...mines .filter(mine => (guesses as Set).has(sanitizeAnswer(mine))) - .map(mine => ({index: q, mine: mine.substr(1)}))); + .map(mine => ({ index: q, mine: mine.substr(1) }))); } } }, @@ -570,7 +570,7 @@ const TWISTS: {[k: string]: Twist} = { onAfterEnd(isReset) { if (isReset) return; const noMines = []; - for (const {name} of this.completed) { + for (const { name } of this.completed) { const player = this.playerTable[toID(name)]; if (!player) continue; if (!player.mines?.length) noMines.push(name); @@ -583,7 +583,7 @@ const TWISTS: {[k: string]: Twist} = { }, }; -const MODES: {[k: string]: GameMode | string} = { +const MODES: { [k: string]: GameMode | string } = { ko: 'kogames', kogames: { name: 'KO Games', @@ -1008,7 +1008,7 @@ const MODES: {[k: string]: GameMode | string} = { const game = this.room.scavgame!; const team = game.getPlayerTeam(player); - return {name: team.name, time, blitz}; + return { name: team.name, time, blitz }; }, // workaround that gives the answer after verifying that completion should not be hidden @@ -1040,7 +1040,7 @@ const MODES: {[k: string]: GameMode | string} = { export class ScavengerGameTemplate { room: Room; playerlist: null | string[]; - timer: NodeJS.Timer | null; + timer: NodeJS.Timeout | null; [k: string]: any; constructor(room: Room) { diff --git a/server/chat-plugins/scavengers.ts b/server/chat-plugins/scavengers.ts index 7f8603dc6a..bace5070b9 100644 --- a/server/chat-plugins/scavengers.ts +++ b/server/chat-plugins/scavengers.ts @@ -8,14 +8,14 @@ * @license MIT license */ -import {FS, Utils} from '../../lib'; -import {ScavMods, TwistEvent} from './scavenger-games'; -import {ChatHandler} from '../chat'; +import { FS, Utils } from '../../lib'; +import { ScavMods, type TwistEvent } from './scavenger-games'; +import type { ChatHandler } from '../chat'; type GameTypes = 'official' | 'regular' | 'mini' | 'unrated' | 'practice' | 'recycled'; export interface QueuedHunt { - hosts: {id: string, name: string, noUpdate?: boolean}[]; + hosts: { id: string, name: string, noUpdate?: boolean }[]; questions: (string | string[])[]; isHTML: boolean; staffHostId: string; @@ -33,10 +33,10 @@ interface ModEvent { } const RATED_TYPES = ['official', 'regular', 'mini']; -const DEFAULT_POINTS: {[k: string]: number[]} = { +const DEFAULT_POINTS: { [k: string]: number[] } = { official: [20, 15, 10, 5, 1], }; -const DEFAULT_BLITZ_POINTS: {[k: string]: number} = { +const DEFAULT_BLITZ_POINTS: { [k: string]: number } = { official: 10, }; const DEFAULT_HOST_POINTS = 4; @@ -54,7 +54,7 @@ const FILTER_LENIENCY = 7; const HISTORY_PERIOD = 6; // months const databaseContentsJSON = FS(DATABASE_FILE).readIfExistsSync(); -const scavengersData = databaseContentsJSON ? JSON.parse(databaseContentsJSON) : {recycledHunts: []}; +const scavengersData = databaseContentsJSON ? JSON.parse(databaseContentsJSON) : { recycledHunts: [] }; const SCAVENGER_ROOMID = 'scavengers'; function getScavsRoom(room?: Room) { @@ -71,7 +71,7 @@ export function sanitizeAnswer(answer: string): string { class Ladder { file: string; - data: {[userid: string]: AnyObject}; + data: { [userid: string]: AnyObject }; constructor(file: string) { this.file = file; this.data = {}; @@ -88,7 +88,7 @@ class Ladder { const userid = toID(name); if (!userid || userid === 'constructor' || !points) return this; - if (!this.data[userid]) this.data[userid] = {name: name}; + if (!this.data[userid]) this.data[userid] = { name }; if (!this.data[userid][aspect]) this.data[userid][aspect] = 0; this.data[userid][aspect] += points; @@ -107,8 +107,8 @@ class Ladder { FS(this.file).writeUpdate(() => JSON.stringify(this.data)); } - visualize(sortBy: string): Promise<({rank: number} & AnyObject)[]>; - visualize(sortBy: string, userid: ID): Promise<({rank: number} & AnyObject) | undefined>; + visualize(sortBy: string): Promise<({ rank: number } & AnyObject)[]>; + visualize(sortBy: string, userid: ID): Promise<({ rank: number } & AnyObject) | undefined>; visualize(sortBy: string, userid?: ID) { // return a promise for async sorting - make this less exploitable return new Promise((resolve, reject) => { @@ -126,7 +126,7 @@ class Ladder { return { rank: lastPlacement, ...chunk, - } as {rank: number} & AnyObject; + } as { rank: number } & AnyObject; }); // identify ties if (userid) { const rank = ladder.find(entry => toID(entry.name) === userid); @@ -139,10 +139,6 @@ class Ladder { } class PlayerLadder extends Ladder { - constructor(file: string) { - super(file); - } - addPoints(name: string, aspect: string, points: number, noUpdate?: boolean) { if (!aspect.startsWith('cumulative-')) { this.addPoints(name, `cumulative-${aspect}`, points, noUpdate); @@ -150,7 +146,7 @@ class PlayerLadder extends Ladder { const userid = toID(name); if (!userid || userid === 'constructor' || !points) return this; - if (!this.data[userid]) this.data[userid] = {name: name}; + if (!this.data[userid]) this.data[userid] = { name }; if (!this.data[userid][aspect]) this.data[userid][aspect] = 0; this.data[userid][aspect] += points; @@ -262,12 +258,12 @@ class ScavengerHuntDatabase { } static addRecycledHuntToDatabase(hosts: FakeUser[], params: (string | string[])[]) { - const huntSchema: {hosts: FakeUser[], questions: AnyObject[]} = { - hosts: hosts, + const huntSchema: { hosts: FakeUser[], questions: AnyObject[] } = { + hosts, questions: [], }; - let questionSchema: {text: string, answers: string[], hints?: string[]} = { + let questionSchema: { text: string, answers: string[], hints?: string[] } = { text: '', answers: [], hints: [], @@ -320,7 +316,9 @@ class ScavengerHuntDatabase { return !isNaN(hunt_number) && hunt_number > 0 && hunt_number <= scavengersData.recycledHunts.length; } - static getFullTextOfHunt(hunt: {hosts: FakeUser[], questions: {text: string, answers: string[], hints?: string[]}[]}) { + static getFullTextOfHunt( + hunt: { hosts: FakeUser[], questions: { text: string, answers: string[], hints?: string[] }[] } + ) { return `${hunt.hosts.map(host => host.name).join(',')} | ${hunt.questions.map(question => `${question.text} | ${question.answers.join(';')}`).join(' | ')}`; } } @@ -329,23 +327,23 @@ export class ScavengerHunt extends Rooms.RoomGame { gameType: GameTypes; joinedIps: string[]; startTime: number; - questions: {hint: string, answer: string[], spoilers: string[]}[]; + questions: { hint: string, answer: string[], spoilers: string[] }[]; completed: AnyObject[]; - leftHunt: {[userid: string]: 1 | undefined}; + leftHunt: { [userid: string]: 1 | undefined }; hosts: FakeUser[]; isHTML: boolean; modsList: string[]; - mods: {[k: string]: ModEvent[]}; + mods: { [k: string]: ModEvent[] }; staffHostId: string; staffHostName: string; scavGame: true; timerEnd: number | null; - timer: NodeJS.Timer | null; + timer: NodeJS.Timeout | null; readonly checkChat = true; [k: string]: any; // for purposes of adding new temporary properties for the purpose of twists. - constructor({room, staffHost, hosts, gameType, questions, isHTML, mod}: + constructor({ room, staffHost, hosts, gameType, questions, isHTML, mod }: { room: Room, staffHost: User | FakeUser, @@ -425,7 +423,7 @@ export class ScavengerHunt extends Rooms.RoomGame { if (!key.startsWith('on')) continue; const priority = twist[key + 'Priority'] || 0; if (!this.mods[key]) this.mods[key] = []; - this.mods[key].push({exec: twist[key], priority}); + this.mods[key].push({ exec: twist[key], priority }); } if (twist.isGameMode) { this.announce(`This hunt is part of an ongoing ${twist.name}.`); @@ -516,7 +514,7 @@ export class ScavengerHunt extends Rooms.RoomGame { const hint = q[i] as string; const answer = q[i + 1] as string[]; - this.questions.push({hint: hint, answer: answer, spoilers: []}); + this.questions.push({ hint, answer, spoilers: [] }); } const message = this.getCreationMessage(true); @@ -695,7 +693,7 @@ export class ScavengerHunt extends Rooms.RoomGame { if (player.completed) return false; const now = Date.now(); - const time = Chat.toDurationString(now - this.startTime, {hhmmss: true}); + const time = Chat.toDurationString(now - this.startTime, { hhmmss: true }); const canBlitz = this.completed.length < 3; const blitz = now - this.startTime <= 60000 && canBlitz && @@ -704,7 +702,7 @@ export class ScavengerHunt extends Rooms.RoomGame { player.completed = true; let result = this.runEvent('Complete', player, time, blitz); if (result === true) return; - result = result || {name: player.name, time: time, blitz: blitz}; + result = result || { name: player.name, time, blitz }; this.completed.push(result); const place = Utils.formatOrder(this.completed.length); @@ -829,7 +827,7 @@ export class ScavengerHunt extends Rooms.RoomGame { return; // don't run the queue for child games } // prepare the next queue'd game - if (this.room.settings.scavQueue && this.room.settings.scavQueue.length) { + if (this.room.settings.scavQueue?.length) { setTimeout(() => { const room = Rooms.get(roomid) as ChatRoom; if (!room || room.game || !room.settings.scavQueue?.length || room.settings.scavSettings?.scavQueueDisabled) return; @@ -838,8 +836,8 @@ export class ScavengerHunt extends Rooms.RoomGame { const duration = room.settings.scavSettings?.defaultScavTimer || DEFAULT_TIMER_DURATION; room.game = new ScavengerHunt( { - room: room, - staffHost: {id: next.staffHostId, name: next.staffHostName}, + room, + staffHost: { id: next.staffHostId, name: next.staffHostName }, hosts: next.hosts, gameType: next.gameType, questions: next.questions, @@ -850,7 +848,7 @@ export class ScavengerHunt extends Rooms.RoomGame { if (game) { game.setTimer(duration); // auto timer for queue'd games. room.add(`|c|~|[ScavengerManager] A scavenger hunt by ${Chat.toListString(next.hosts.map(h => h.name))} has been automatically started. It will automatically end in ${duration} minutes.`).update(); // highlight the users with "hunt by" - room.modlog({action: 'SCAV NEW', note: `${game.gameType.toUpperCase()}: creators - ${game.hosts.map(h => h.id)}`}); + room.modlog({ action: 'SCAV NEW', note: `${game.gameType.toUpperCase()}: creators - ${game.hosts.map(h => h.id)}` }); } // update the saved queue. @@ -945,11 +943,10 @@ export class ScavengerHunt extends Rooms.RoomGame { })); if (filtered) return "Please do not leak the answer. Use /scavenge [guess] to submit your guess instead."; - return; } hasFinished(user: User) { - return this.playerTable[user.id] && this.playerTable[user.id].completed; + return this.playerTable[user.id]?.completed; } getUniqueConnections(userid: string) { @@ -969,18 +966,18 @@ export class ScavengerHunt extends Rooms.RoomGame { if (!user) { // simply stick the ID's in there - don't keep any benign symbols passed by the hunt maker - hosts.push({name: id, id: id, noUpdate: true}); + hosts.push({ name: id, id, noUpdate: true }); continue; } - hosts.push({id: '' + user.id, name: '' + user.name}); + hosts.push({ id: '' + user.id, name: '' + user.name }); } return hosts; } static parseQuestions(questionArray: string[], force = false): AnyObject { - if (questionArray.length % 2 === 1 && !force) return {err: "Your final question is missing an answer"}; - if (questionArray.length < 6 && !force) return {err: "You must have at least 3 hints and answers"}; + if (questionArray.length % 2 === 1 && !force) return { err: "Your final question is missing an answer" }; + if (questionArray.length < 6 && !force) return { err: "You must have at least 3 hints and answers" }; const formattedQuestions = []; @@ -989,7 +986,7 @@ export class ScavengerHunt extends Rooms.RoomGame { const answers = question.split(';').map(p => p.trim()); formattedQuestions[i] = answers; if (!force && (!answers.length || answers.some(a => !toID(a)))) { - return {err: "Empty answer - only alphanumeric characters will count in answers."}; + return { err: "Empty answer - only alphanumeric characters will count in answers." }; } } else { // Skip last question if there is no answer @@ -997,11 +994,11 @@ export class ScavengerHunt extends Rooms.RoomGame { question = question.trim(); formattedQuestions[i] = question; - if (!question && !force) return {err: "Empty question."}; + if (!question && !force) return { err: "Empty question." }; } } - return {result: formattedQuestions}; + return { result: formattedQuestions }; } } @@ -1193,7 +1190,7 @@ const ScavengerCommands: Chat.ChatCommands = { if (!leaderUser) return this.errorReply('The user you specified is currently not online'); if (game.getPlayerTeam(leaderUser)) return this.errorReply('The user is already a member of another team.'); - game.teams[teamName] = {name: teamName, answers: [], players: [leaderUser.id], question: 1, completed: false}; + game.teams[teamName] = { name: teamName, answers: [], players: [leaderUser.id], question: 1, completed: false }; game.announce(Utils.html`A new team "${teamName}" has been created with ${leaderUser.name} as the leader.`); }, @@ -1410,7 +1407,7 @@ const ScavengerCommands: Chat.ChatCommands = { // mini and officials can be started anytime if ( !cmd.includes('force') && ['regular', 'unrated', 'recycled'].includes(gameType) && !mod && - room.settings.scavQueue && room.settings.scavQueue.length && !room.scavgame + room.settings.scavQueue?.length && !room.scavgame ) { return this.errorReply(`There are currently hunts in the queue! If you would like to start the hunt anyways, use /forcestart${gameType === 'regular' ? 'hunt' : gameType}.`); } @@ -1449,17 +1446,15 @@ const ScavengerCommands: Chat.ChatCommands = { const res = ScavengerHunt.parseQuestions(params); if (res.err) return this.errorReply(res.err); - room.game = new ScavengerHunt( - { - room: room, - staffHost: user, - hosts: hosts, - gameType: gameType, - questions: res.result, - isHTML: isHTML, - mod: mod, - } - ); + room.game = new ScavengerHunt({ + room, + staffHost: user, + hosts, + gameType, + questions: res.result, + isHTML, + mod, + }); this.privateModAction(`A new scavenger hunt was created by ${user.name}.`); this.modlog('SCAV NEW', null, `${gameType.toUpperCase()}: creators - ${hosts.map(h => h.id)}`); @@ -1470,21 +1465,21 @@ const ScavengerCommands: Chat.ChatCommands = { const game = room.getGame(ScavengerHunt); if (!game) return this.errorReply(`There is no scavenger hunt currently running.`); - const elapsedMsg = Chat.toDurationString(Date.now() - game.startTime, {hhmmss: true}); + const elapsedMsg = Chat.toDurationString(Date.now() - game.startTime, { hhmmss: true }); const gameTypeMsg = game.gameType ? `${game.gameType} ` : ''; const hostersMsg = Utils.escapeHTML(Chat.toListString(game.hosts.map(h => h.name))); const hostMsg = game.hosts.some(h => h.id === game.staffHostId) ? '' : Utils.html` (started by - ${game.staffHostName})`; const finishers = Utils.html`${game.completed.map(u => u.name).join(', ')}`; - let buffer = `
    The current ${gameTypeMsg}scavenger hunt by ${hostersMsg}${hostMsg} has been up for: ${elapsedMsg}
    ${!game.timerEnd ? 'The timer is currently off.' : `The hunt ends in: ${Chat.toDurationString(game.timerEnd - Date.now(), {hhmmss: true})}`}
    Completed (${game.completed.length}): ${finishers}
    `; + let buffer = `
    The current ${gameTypeMsg}scavenger hunt by ${hostersMsg}${hostMsg} has been up for: ${elapsedMsg}
    ${!game.timerEnd ? 'The timer is currently off.' : `The hunt ends in: ${Chat.toDurationString(game.timerEnd - Date.now(), { hhmmss: true })}`}
    Completed (${game.completed.length}): ${finishers}
    `; if (game.modsList.includes('timetrial')) { const finisher = game.completed.find(player => player.id === user.id); const timeTrialMsg = finisher ? `You finished the hunt in: ${finisher.time}.` : (game.startTimes?.[user.id] ? - `You joined the hunt ${Chat.toDurationString(Date.now() - game.startTimes[user.id], {hhmmss: true})} ago.` : + `You joined the hunt ${Chat.toDurationString(Date.now() - game.startTimes[user.id], { hhmmss: true })} ago.` : 'You have not joined the hunt.'); - buffer = `
    The current ${gameTypeMsg}scavenger hunt by ${hostersMsg}${hostMsg} has been up for: ${elapsedMsg}
    ${timeTrialMsg}
    ${!game.timerEnd ? 'The timer is currently off.' : `The hunt ends in: ${Chat.toDurationString(game.timerEnd - Date.now(), {hhmmss: true})}`}
    Completed (${game.completed.length}): ${finishers}
    `; + buffer = `
    The current ${gameTypeMsg}scavenger hunt by ${hostersMsg}${hostMsg} has been up for: ${elapsedMsg}
    ${timeTrialMsg}
    ${!game.timerEnd ? 'The timer is currently off.' : `The hunt ends in: ${Chat.toDurationString(game.timerEnd - Date.now(), { hhmmss: true })}`}
    Completed (${game.completed.length}): ${finishers}
    `; } if (game.hosts.some(h => h.id === user.id) || game.staffHostId === user.id) { @@ -1686,7 +1681,6 @@ const ScavengerCommands: Chat.ChatCommands = { const question = parseInt(parts[0]) - 1; const hint = parseInt(parts[1]) - 1; - if (!game.questions[question]) return this.errorReply(`Invalid question number.`); if (!game.questions[question].spoilers[hint]) return this.errorReply('Invalid hint number.'); game.questions[question].spoilers.splice(hint, 1); @@ -1800,7 +1794,7 @@ const ScavengerCommands: Chat.ChatCommands = { room.settings.scavQueue.push({ hosts: next.hosts, questions: correctlyFormattedQuestions, - isHTML: isHTML, + isHTML, staffHostId: 'scavengermanager', staffHostName: 'Scavenger Manager', gameType: 'unrated', @@ -1818,9 +1812,9 @@ const ScavengerCommands: Chat.ChatCommands = { if (!room.settings.scavQueue) room.settings.scavQueue = []; room.settings.scavQueue.push({ - hosts: hosts, + hosts, questions: results.result, - isHTML: isHTML, + isHTML, staffHostId: user.id, staffHostName: user.name, gameType: (this.cmd.includes('unrated') ? 'unrated' : 'regular'), @@ -1878,8 +1872,8 @@ const ScavengerCommands: Chat.ChatCommands = { const next = room.settings.scavQueue.splice(huntId, 1)[0]; room.game = new ScavengerHunt( { - room: room, - staffHost: {id: next.staffHostId, name: next.staffHostName}, + room, + staffHost: { id: next.staffHostId, name: next.staffHostName }, hosts: next.hosts, gameType: next.gameType, questions: next.questions, @@ -1902,7 +1896,6 @@ const ScavengerCommands: Chat.ChatCommands = { } this.checkCan('mute', null, room); - if (!room.settings.scavSettings) room.settings.scavSettings = {}; const state = this.cmd === 'disablequeue'; if ((room.settings.scavSettings.scavQueueDisabled || false) === state) { @@ -1958,7 +1951,7 @@ const ScavengerCommands: Chat.ChatCommands = { Leaderboard.addPoints(targetId, 'points', points, true).write(); this.privateModAction(`${targetId} was given ${points} points on the current scavengers ladder by ${user.name}.`); - this.modlog('SCAV ADDPOINTS', targetId, '' + points); + this.modlog('SCAV ADDPOINTS', targetId, `${points}`); }, removepoints(target, room, user) { @@ -1975,7 +1968,7 @@ const ScavengerCommands: Chat.ChatCommands = { Leaderboard.addPoints(targetId, 'points', -points, true).write(); this.privateModAction(`${user.name} has taken ${points} points from ${targetId} on the current scavengers ladder.`); - this.modlog('SCAV REMOVEPOINTS', targetId, '' + points); + this.modlog('SCAV REMOVEPOINTS', targetId, `${points}`); }, resetladder(target, room, user) { @@ -2001,7 +1994,7 @@ const ScavengerCommands: Chat.ChatCommands = { const ladder = await Leaderboard.visualize('points') as AnyObject[]; this.sendReply( `|uhtml${isChange ? 'change' : ''}|scavladder|

    Mafia ${ladder.title} for ${date.toLocaleString("en-us", { month: 'long' })} ${date.getFullYear()}

    User${ladder.type}
    ${key}${value}
    Raw winsTimes generated
    ${Dex.species.get(mon).name}${((numWins / timesGenerated) * 100).toFixed(2)}%${getZScore(data).toFixed(3)}${numWins}${timesGenerated}
    ${ladder.map(entry => { - const roomRank = room!.auth.getDirect(toID(entry.name)); + const roomRank = room.auth.getDirect(toID(entry.name)); const isStaff = Users.Auth.atLeast(roomRank, '+'); if (isStaff && hideStaff) return ''; return ``; @@ -2266,7 +2259,7 @@ const ScavengerCommands: Chat.ChatCommands = { this.sendReply( `|${isUhtmlChange ? 'uhtmlchange' : 'uhtml'}|scav-huntlogs|
    RankNamePoints
    ${entry.rank}${(isStaff ? `${Utils.escapeHTML(entry.name)}` : (entry.rank <= 5 ? `${Utils.escapeHTML(entry.name)}` : Utils.escapeHTML(entry.name)))}${entry.points}
    ${ data.map(entry => { - const auth = room!.auth.get(toID(entry.name)).trim(); + const auth = room.auth.get(toID(entry.name)).trim(); const color = auth ? 'inherit' : 'gray'; return `` + `` + @@ -2318,7 +2311,7 @@ const ScavengerCommands: Chat.ChatCommands = { this.sendReply( `|${isUhtmlChange ? 'uhtmlchange' : 'uhtml'}|scav-playlogs|
    RankNameHunts CreatedTotal Hunts CreatedHistory
    ${entry.rank}${auth || ' '}${Utils.escapeHTML(entry.name)}${(entry.points || 0)}
    ${ formattedData.map(entry => { - const auth = room!.auth.get(toID(entry.name)).trim(); + const auth = room.auth.get(toID(entry.name)).trim(); const color = auth ? 'inherit' : 'gray'; return `` + @@ -2373,7 +2366,7 @@ const ScavengerCommands: Chat.ChatCommands = { const settings = room.settings.scavSettings.scavmod || {}; target = toID(target); - const setting: {[k: string]: boolean} = { + const setting: { [k: string]: boolean } = { 'on': true, 'off': false, 'toggle': !settings.ipcheck, @@ -2430,14 +2423,13 @@ const ScavengerCommands: Chat.ChatCommands = { // The rest of the commands depend on there already being hunts in the database. if (ScavengerHuntDatabase.isEmpty()) return this.errorReply("There are no hunts in the database."); - if (cmd === 'list') { return this.parse(`/join view-recycledHunts-${room}`); } const params = target.split(',').map(param => param.trim()).filter(param => param !== ''); - const usageMessages: {[k: string]: string} = { + const usageMessages: { [k: string]: string } = { 'removehunt': 'Usage: removehunt hunt_number', 'addhint': 'Usage: addhint hunt number, question number, hint text', 'removehint': 'Usage: removehint hunt number, question number, hint text', @@ -2445,7 +2437,7 @@ const ScavengerCommands: Chat.ChatCommands = { }; if (!params) return this.errorReply(usageMessages[cmd]); - const numberOfRequiredParameters: {[k: string]: number} = { + const numberOfRequiredParameters: { [k: string]: number } = { 'removehunt': 1, 'addhint': 3, 'removehint': 3, @@ -2453,7 +2445,7 @@ const ScavengerCommands: Chat.ChatCommands = { }; if (params.length < numberOfRequiredParameters[cmd]) return this.errorReply(usageMessages[cmd]); - const [huntNumber, questionNumber, hintNumber] = params.map((param) => parseInt(param)); + const [huntNumber, questionNumber, hintNumber] = params.map(param => parseInt(param)); const cmdsNeedingHuntNumber = ['removehunt', 'removehint', 'addhint']; if (cmdsNeedingHuntNumber.includes(cmd)) { if (!ScavengerHuntDatabase.hasHunt(huntNumber)) return this.errorReply("You specified an invalid hunt number."); diff --git a/server/chat-plugins/seasons.ts b/server/chat-plugins/seasons.ts index 117082ed8a..15ae3f9a6d 100644 --- a/server/chat-plugins/seasons.ts +++ b/server/chat-plugins/seasons.ts @@ -2,7 +2,7 @@ * @author mia-pi-git */ -import {FS, Net, Utils} from '../../lib'; +import { FS, Net, Utils } from '../../lib'; export const SEASONS_PER_YEAR = 4; export const FORMATS_PER_SEASON = 4; @@ -16,8 +16,8 @@ export const FORMAT_POOL = ['ubers', 'uu', 'ru', 'nu', 'pu', 'lc', 'doublesou', export const PUBLIC_PHASE_LENGTH = 3; interface SeasonData { - current: {period: number, year: number, formatsGeneratedAt: number, season: number}; - badgeholders: {[period: string]: {[format: string]: {[badgeType: string]: string[]}}}; + current: { period: number, year: number, formatsGeneratedAt: number, season: number }; + badgeholders: { [period: string]: { [format: string]: { [badgeType: string]: string[] } } }; formatSchedule: Record; } @@ -28,21 +28,21 @@ try { } catch { data = { // force a reroll - current: {season: null!, year: null!, formatsGeneratedAt: null!, period: null!}, + current: { season: null!, year: null!, formatsGeneratedAt: null!, period: null! }, formatSchedule: {}, badgeholders: {}, }; } export function getBadges(user: User, curFormat: string) { - let userBadges: {type: string, format: string}[] = []; + let userBadges: { type: string, format: string }[] = []; const season = data.current.season; // don't factor in old badges for (const format in data.badgeholders[season]) { const badges = data.badgeholders[season][format]; for (const type in badges) { if (badges[type].includes(user.id)) { // ex badge-bronze-gen9ou-250-1-2024 - userBadges.push({type, format}); + userBadges.push({ type, format }); } } } @@ -64,7 +64,7 @@ export function getBadges(user: User, curFormat: string) { function getUserHTML(user: User, format: string) { const buf = `${user.name}`; - const badgeType = getBadges(user, format).filter(x => x.format === format)[0]?.type; + const badgeType = getBadges(user, format).find(x => x.format === format)?.type; if (badgeType) { let formatType = format.split(/gen\d+/)[1]; if (!['ou', 'randombattle'].includes(formatType)) formatType = 'rotating'; @@ -217,7 +217,7 @@ export function rollSeason() { } } -export let updateTimeout: NodeJS.Timer | true | null = null; +export let updateTimeout: NodeJS.Timeout | true | null = null; export function rollTimer() { if (updateTimeout === true) return; diff --git a/server/chat-plugins/smogtours.ts b/server/chat-plugins/smogtours.ts index 1ce3259842..ead5cd5bc2 100644 --- a/server/chat-plugins/smogtours.ts +++ b/server/chat-plugins/smogtours.ts @@ -2,7 +2,7 @@ * Integration for Smogon tournaments. * @author mia-pi-git */ -import {FS, Utils} from '../../lib'; +import { FS, Utils } from '../../lib'; type Image = [string, number, number]; interface TourEvent { @@ -11,7 +11,7 @@ interface TourEvent { desc: string; image?: Image; /** If there's an image, there needs to be credit to wherever they got it */ - artistCredit?: {url: string, name: string}; + artistCredit?: { url: string, name: string }; id: string; shortDesc: string; date: number; @@ -143,7 +143,7 @@ export const commands: Chat.ChatCommands = { try { const dimensions = await Chat.fitImage(rawImg, 300, 300); image = [rawImg, ...dimensions.slice(0, -1)] as Image; - } catch (e) { + } catch { return this.popupReply(`Invalid image URL: ${rawImg}`); } } @@ -155,7 +155,7 @@ export const commands: Chat.ChatCommands = { if (!artistUrl) { return this.errorReply(`Invalid artist credit URL.`); } - artistCredit = {url: artistUrl, name: rawArtistName.trim()}; + artistCredit = { url: artistUrl, name: rawArtistName.trim() }; } if (!rawShort?.length || !rawDesc?.length) { return this.popupReply(`Must provide both a short description and a full description.`); diff --git a/server/chat-plugins/suspect-tests.ts b/server/chat-plugins/suspect-tests.ts index 17b659244c..f408f63042 100644 --- a/server/chat-plugins/suspect-tests.ts +++ b/server/chat-plugins/suspect-tests.ts @@ -1,5 +1,5 @@ -import {Utils} from '../../lib'; -import {FS} from '../../lib/fs'; +import { Utils } from '../../lib'; +import { FS } from '../../lib/fs'; const SUSPECTS_FILE = 'config/suspects.json'; @@ -12,7 +12,7 @@ interface SuspectTest { interface SuspectsFile { whitelist: string[]; - suspects: {[format: string]: SuspectTest}; + suspects: { [format: string]: SuspectTest }; } export let suspectTests: SuspectsFile = JSON.parse(FS(SUSPECTS_FILE).readIfExistsSync() || "{}"); @@ -27,8 +27,8 @@ const defaults: SuspectsFile = { }; if (!suspectTests.whitelist && !suspectTests.suspects) { - const suspects = {...suspectTests} as unknown as {[format: string]: SuspectTest}; - suspectTests = {...defaults, suspects}; + const suspects = { ...suspectTests } as unknown as { [format: string]: SuspectTest }; + suspectTests = { ...defaults, suspects }; saveSuspectTests(); } diff --git a/server/chat-plugins/teams.ts b/server/chat-plugins/teams.ts index 8ff144357e..1a7589064e 100644 --- a/server/chat-plugins/teams.ts +++ b/server/chat-plugins/teams.ts @@ -4,7 +4,7 @@ * @author mia-pi-git */ -import {PostgresDatabase, FS, Utils} from '../../lib'; +import { PostgresDatabase, FS, Utils } from '../../lib'; import * as crypto from 'crypto'; /** Maximum amount of teams a user can have stored at once. */ @@ -283,7 +283,7 @@ export const TeamsHandler = new class { if (teamData.private) buf += ` (Private)`; buf += `
    `; buf += `Uploaded by: ${teamData.ownerid}
    `; - buf += `Uploaded on: ${Chat.toTimestamp(teamData.date, {human: true})}
    `; + buf += `Uploaded on: ${Chat.toTimestamp(teamData.date, { human: true })}
    `; buf += `Format: ${Dex.formats.get(teamData.format).name}
    `; buf += `Views: ${teamData.views === -1 ? 0 : teamData.views}`; const team = Teams.import(teamData.team); @@ -358,7 +358,7 @@ export const TeamsHandler = new class { } async count(user: string | User) { const id = toID(user); - const result = await this.query<{count: number}>(`SELECT count(*) AS count FROM teams WHERE ownerid = $1`, [id]); + const result = await this.query<{ count: number }>(`SELECT count(*) AS count FROM teams WHERE ownerid = $1`, [id]); return result?.[0]?.count || 0; } async get(teamid: number | string): Promise { @@ -418,12 +418,11 @@ export const commands: Chat.ChatCommands = { const page = isEdit ? 'edit' : 'upload'; if (id) { - connection.send(`|queryresponse|teamupload|` + JSON.stringify({teamid: id, teamName})); + connection.send(`|queryresponse|teamupload|` + JSON.stringify({ teamid: id, teamName })); connection.send(`>view-teams-${page}\n|deinit`); this.parse(`/join view-teams-view-${id}-${id}`); } else { this.parse(`/join view-teams-${page}`); - return; } }, ''(target) { @@ -557,7 +556,7 @@ export const pages: Chat.PageTable = { let count = Number(query.shift()) || 50; if (count > MAX_TEAMS) count = MAX_TEAMS; let teams: StoredTeam[] = [], title = ''; - const buttons: {[k: string]: string} = { + const buttons: { [k: string]: string } = { views: ``, latest: ``, }; diff --git a/server/chat-plugins/the-studio.ts b/server/chat-plugins/the-studio.ts index 4b9ebfbd15..911db3ccf4 100644 --- a/server/chat-plugins/the-studio.ts +++ b/server/chat-plugins/the-studio.ts @@ -6,8 +6,8 @@ * @author dhelmise */ -import {FS, Net, Utils} from '../../lib'; -import {YouTube, VideoData} from './youtube'; +import { FS, Net, Utils } from '../../lib'; +import { YouTube, type VideoData } from './youtube'; const LASTFM_DB = 'config/chat-plugins/lastfm.json'; const RECOMMENDATIONS = 'config/chat-plugins/the-studio.json'; @@ -44,7 +44,7 @@ interface Recommendations { youtubeSearchDisabled?: boolean; } -const lastfm: {[userid: string]: string} = JSON.parse(FS(LASTFM_DB).readIfExistsSync() || "{}"); +const lastfm: { [userid: string]: string } = JSON.parse(FS(LASTFM_DB).readIfExistsSync() || "{}"); const recommendations: Recommendations = JSON.parse(FS(RECOMMENDATIONS).readIfExistsSync() || "{}"); if (!recommendations.saved) recommendations.saved = []; @@ -159,13 +159,13 @@ export class LastFMInterface { async tryGetTrackData(track: string, artist?: string) { this.checkHasKey(); - const query: {[k: string]: any} = { + const query: { [k: string]: any } = { method: 'track.search', limit: 1, api_key: Config.lastfmkey, track, format: 'json', }; if (artist) query.artist = artist; let raw; try { - raw = await Net(API_ROOT).get({query}); + raw = await Net(API_ROOT).get({ query }); } catch { throw new Chat.ErrorMessage(`No track data found.`); } @@ -244,7 +244,9 @@ class RecommendationsInterface { this.checkTags(tags); // JUST in case if (!recommendations.saved) recommendations.saved = []; - const rec: Recommendation = {artist, title, videoInfo, url, description, tags, userData: {name: username}, likes: 0}; + const rec: Recommendation = { + artist, title, videoInfo, url, description, tags, userData: { name: username }, likes: 0, + }; if (!rec.tags.map(toID).includes(toID(username))) rec.tags.push(username); if (!rec.tags.map(toID).includes(toID(artist))) rec.tags.push(artist); if (avatar) rec.userData.avatar = avatar; @@ -285,7 +287,9 @@ class RecommendationsInterface { url = url.split('~')[0]; const videoInfo = await YouTube.getVideoData(url); this.checkTags(tags); - const rec: Recommendation = {artist, title, videoInfo, url, description, tags, userData: {name: username}, likes: 0}; + const rec: Recommendation = { + artist, title, videoInfo, url, description, tags, userData: { name: username }, likes: 0, + }; if (!rec.tags.map(toID).includes(toID(username))) rec.tags.push(username); if (!rec.tags.map(toID).includes(toID(artist))) rec.tags.push(artist); if (avatar) rec.userData.avatar = avatar; @@ -321,8 +325,9 @@ class RecommendationsInterface { let buf = ``; buf += `
    `; buf += `
    RankNameFinished HuntsJoined HuntsRatioInfractions
    ${entry.rank}${auth || ' '}${Utils.escapeHTML(entry.name)}
    `; - if (rec.videoInfo === undefined) { - rec.videoInfo = await YouTube.getVideoData(rec.videoInfo); + if (!rec.videoInfo) { + // eslint-disable-next-line require-atomic-updates + rec.videoInfo = await YouTube.getVideoData(YouTube.getId(rec.url)); saveRecommendations(); } if (rec.videoInfo) { @@ -374,7 +379,7 @@ class RecommendationsInterface { throw new Chat.ErrorMessage(`The song titled '${title}' by ${artist} isn't recommended.`); } if (!rec.liked) { - rec.liked = {ips: [], userids: []}; + rec.liked = { ips: [], userids: [] }; } if ((!Config.noipchecks && rec.liked.ips.includes(liker.latestIp)) || rec.liked.userids.includes(liker.id)) { throw new Chat.ErrorMessage(`You've already liked this recommendation.`); @@ -510,7 +515,8 @@ export const commands: Chat.ChatCommands = { delrec: 'removerecommendation', removerecommendation(target, room, user) { - room = this.requireRoom('thestudio' as RoomID); const [artist, title] = target.split(`|`).map(x => x.trim()); + room = this.requireRoom('thestudio' as RoomID); + const [artist, title] = target.split(`|`).map(x => x.trim()); if (!(artist && title)) return this.parse(`/help removerecommendation`); const rec = Recs.get(artist, title); if (!rec) throw new Chat.ErrorMessage(`Recommendation not found.`); @@ -546,7 +552,7 @@ export const commands: Chat.ChatCommands = { this.sendReply(`Your suggestion for '${title}' by ${artist} has been submitted.`); const html = await Recs.render({ artist, title, url, description, - userData: {name: user.name, avatar: String(user.avatar)}, + userData: { name: user.name, avatar: String(user.avatar) }, tags: cleansedTags, likes: 0, videoInfo: null, }, true); room.sendRankedUsers(`|html|${html}`, '%'); diff --git a/server/chat-plugins/thing-of-the-day.ts b/server/chat-plugins/thing-of-the-day.ts index 28495bc954..a7dae2b963 100644 --- a/server/chat-plugins/thing-of-the-day.ts +++ b/server/chat-plugins/thing-of-the-day.ts @@ -1,5 +1,5 @@ -import {FS, Utils} from '../../lib'; -import {YouTube} from './youtube'; +import { FS, Utils } from '../../lib'; +import { YouTube } from './youtube'; const MINUTE = 60 * 1000; const PRENOM_BUMP_TIME = 2 * 60 * MINUTE; @@ -7,13 +7,13 @@ const PRENOM_BUMP_TIME = 2 * 60 * MINUTE; const PRENOMS_FILE = 'config/chat-plugins/otd-prenoms.json'; const DATA_FILE = 'config/chat-plugins/otds.json'; -export const prenoms: {[k: string]: [string, AnyObject][]} = JSON.parse(FS(PRENOMS_FILE).readIfExistsSync() || "{}"); +export const prenoms: { [k: string]: [string, AnyObject][] } = JSON.parse(FS(PRENOMS_FILE).readIfExistsSync() || "{}"); export const otdData: OtdData = JSON.parse(FS(DATA_FILE).readIfExistsSync() || "{}"); export const otds = new Map(); -const FINISH_HANDLERS: {[k: string]: (winner: AnyObject) => Promise} = { +const FINISH_HANDLERS: { [k: string]: (winner: AnyObject) => Promise } = { cotw: async winner => { - const {channel, nominator} = winner; + const { channel, nominator } = winner; const searchResults = await YouTube.searchChannel(channel, 1); const result = searchResults?.[0]; if (result) { @@ -44,7 +44,7 @@ interface OtdSettings { } interface OtdData { - [k: string]: {settings: OtdSettings, winners: AnyObject[]}; + [k: string]: { settings: OtdSettings, winners: AnyObject[] }; } function savePrenoms() { @@ -93,7 +93,7 @@ class OtdHandler { } static create(room: Room, settings: OtdSettings) { - const {title, timeLabel} = settings; + const { title, timeLabel } = settings; const id = settings.id || toID(title).charAt(0) + 'ot' + timeLabel.charAt(0); const handler = new OtdHandler(id, room, settings); otds.set(id, handler); @@ -195,11 +195,11 @@ class OtdHandler { } } - const obj: {[k: string]: string} = {}; + const obj: { [k: string]: string } = {}; obj[user.id] = user.name; const nomObj = { - nomination: nomination, + nomination, name: user.name, userids: user.previousIDs.concat(user.id), ips: user.ips.slice(), @@ -294,7 +294,7 @@ class OtdHandler { void finishHandler(winnerEntry); } this.room.add( - Utils.html `|uhtml|otd|

    ` + + Utils.html`|uhtml|otd|

    ` + `Nominations for ${this.name} of the ${this.timeLabel} are over!

    ` + `Out of ${keys.length} nominations, we randomly selected ${winner.nomination} as the winner! ` + `(Nomination by ${winner.name})

    Thanks to today's participants:` + namesHTML @@ -334,7 +334,7 @@ class OtdHandler { } appendWinner(nomination: string, user: string): AnyObject { - const entry: AnyObject = {time: Date.now(), nominator: user}; + const entry: AnyObject = { time: Date.now(), nominator: user }; entry[this.keys[0]] = nomination; this.winners.push(entry); this.save(); @@ -352,7 +352,7 @@ class OtdHandler { throw new Chat.ErrorMessage(`The winner with nomination ${nominationName} could not be found.`); } - setWinnerProperty(properties: {[k: string]: string}) { + setWinnerProperty(properties: { [k: string]: string }) { if (!this.winners.length) return; for (const i in properties) { this.winners[this.winners.length - 1][i] = properties[i]; @@ -383,46 +383,46 @@ class OtdHandler { if (!this.winners.length) return false; const winner = this.winners[this.winners.length - 1]; - let output = Utils.html `

    ` + - `

    The ${this.name} of the ${this.timeLabel} is ` + - `${winner[this.keys[0]]}${winner.author ? ` by ${winner.author}` : ''}.`; + let output = `

    ` + + Utils.html`

    The ${this.name} of the ${this.timeLabel} is ` + + Utils.html`${winner[this.keys[0]]}${winner.author ? ` by ${winner.author}` : ''}.`; - if (winner.quote) output += Utils.html `
    "${winner.quote}"`; - if (winner.tagline) output += Utils.html `
    ${winner.tagline}`; + if (winner.quote) output += Utils.html`
    "${winner.quote}"`; + if (winner.tagline) output += Utils.html`
    ${winner.tagline}`; output += `

    `; if (winner.image) { try { const [width, height] = await Chat.fitImage(winner.image, 100, 100); - output += Utils.html ``; + output += Utils.html``; } catch {} } output += `
    `; - if (winner.event) output += Utils.html `Event: ${winner.event}
    `; + if (winner.event) output += Utils.html`Event: ${winner.event}
    `; if (winner.song) { output += `Song: `; if (winner.link) { - output += Utils.html `${winner.song}`; + output += Utils.html`${winner.song}`; } else { output += Utils.escapeHTML(winner.song); } output += `
    `; } else if (winner.link) { - output += Utils.html `Link: ${winner.link}
    `; + output += Utils.html`Link: ${winner.link}
    `; } // Batch these together on 2 lines. Order intentional. const athleteDetails = []; - if (winner.sport) athleteDetails.push(Utils.html `Sport: ${winner.sport}`); - if (winner.team) athleteDetails.push(Utils.html `Team: ${winner.team}`); - if (winner.age) athleteDetails.push(Utils.html `Age: ${winner.age}`); - if (winner.country) athleteDetails.push(Utils.html `Nationality: ${winner.country}`); + if (winner.sport) athleteDetails.push(Utils.html`Sport: ${winner.sport}`); + if (winner.team) athleteDetails.push(Utils.html`Team: ${winner.team}`); + if (winner.age) athleteDetails.push(Utils.html`Age: ${winner.age}`); + if (winner.country) athleteDetails.push(Utils.html`Nationality: ${winner.country}`); if (athleteDetails.length) { output += athleteDetails.slice(0, 2).join(' | ') + '
    '; if (athleteDetails.length > 2) output += athleteDetails.slice(2).join(' | ') + '
    '; } - output += Utils.html `Nominated by ${winner.nominator}.`; + output += Utils.html`Nominated by ${winner.nominator}.`; output += `
    `; return output; @@ -460,7 +460,7 @@ class OtdHandler { case 'time': const date = new Date(parseInt(this.winners[i].time)); - const pad = (num: number) => num < 10 ? '0' + num : num; + const pad = (num: number) => `${num}`.padStart(2, '0'); return Utils.html`${pad(date.getMonth() + 1)}-${pad(date.getDate())}-${date.getFullYear()}`; case 'song': @@ -472,7 +472,7 @@ class OtdHandler { val = `${val}${this.winners[i].author ? ` by ${this.winners[i].author}` : ''}`; // falls through case columns[0]: - return `${Utils.escapeHTML(val)}${this.winners[i].nominator ? Utils.html `
    nominated by ${this.winners[i].nominator}` : ''}`; + return `${Utils.escapeHTML(val)}${this.winners[i].nominator ? Utils.html`
    nominated by ${this.winners[i].nominator}` : ''}`; default: return Utils.escapeHTML(val); } @@ -596,7 +596,7 @@ export const otdCommands: Chat.ChatCommands = { }, removehelp: [ `/-otd remove [username] - Remove a user's nomination for the Thing of the Day.`, - `Prevents them from voting again until the next round. Requires: % @ # ~`, + `Prevents them from voting again until the next round. Requires: % @ # ~`, ], removewinner(target, room, user) { @@ -669,7 +669,7 @@ export const otdCommands: Chat.ChatCommands = { const params = target.split(target.includes('|') ? '|' : ',').map(param => param.trim()); - const changelist: {[k: string]: string} = {}; + const changelist: { [k: string]: string } = {}; for (const param of params) { let [key, ...values] = param.split(':'); @@ -802,7 +802,7 @@ export const commands: Chat.ChatCommands = { if (room.settings.isPrivate) { return this.errorReply(`This command is only available in public rooms`); } - const count = [...otds.values()].filter(otd => otd.room.roomid === room!.roomid).length; + const count = [...otds.values()].filter(otd => otd.room.roomid === room.roomid).length; if (count > 3) { return this.errorReply(`This room already has 3+ -otd's.`); } diff --git a/server/chat-plugins/trivia/database.ts b/server/chat-plugins/trivia/database.ts index e253642fa5..1b26e371fa 100644 --- a/server/chat-plugins/trivia/database.ts +++ b/server/chat-plugins/trivia/database.ts @@ -4,10 +4,12 @@ * @author Annika */ -import type {TriviaGame, TriviaHistory, TriviaLeaderboardData, TriviaLeaderboardScore, TriviaQuestion} from "./trivia"; -import {FS} from "../../../lib"; -import {formatSQLArray} from "../../../lib/utils"; -import type {Statement} from "../../../lib/sql"; +import type { + TriviaGame, TriviaHistory, TriviaLeaderboardData, TriviaLeaderboardScore, TriviaQuestion, +} from "./trivia"; +import { FS } from "../../../lib"; +import { formatSQLArray } from "../../../lib/utils"; +import type { Statement } from "../../../lib/sql"; export type Leaderboard = 'alltime' | 'nonAlltime' | 'cycle'; /** @@ -40,11 +42,11 @@ export interface TriviaDatabase { editQuestion(oldQuestionText: string, newQuestionText?: string, newAnswers?: string[]): Promise; getHistory(numberOfLines: number): Promise | TriviaGame[]; - getScoresForLastGame(): Promise<{[k: string]: number}> | {[k: string]: number}; + getScoresForLastGame(): Promise<{ [k: string]: number }> | { [k: string]: number }; getQuestions( categories: string[] | 'all', limit: number, - options: {order: 'newestfirst' | 'oldestfirst' | 'random'} + options: { order: 'newestfirst' | 'oldestfirst' | 'random' } ): Promise | TriviaQuestion[]; getLeaderboardEntry( id: ID, @@ -56,10 +58,10 @@ export interface TriviaDatabase { ensureQuestionExists(questionText: string): Promise | TriviaQuestion; ensureQuestionDoesNotExist(questionText: string): Promise | void; getSubmissions(): Promise | TriviaQuestion[]; - getQuestionCounts(): Promise<{[k: string]: number, total: number}> | {[k: string]: number, total: number}; + getQuestionCounts(): Promise<{ [k: string]: number, total: number }> | { [k: string]: number, total: number }; searchQuestions( search: string, - options: {searchSubmissions: boolean, caseSensitive?: boolean} + options: { searchSubmissions: boolean, caseSensitive?: boolean } ): Promise | TriviaQuestion[]; clearSubmissions(): Promise | void; @@ -171,9 +173,9 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { for (const [lb, discrim] of Object.entries(LEADERBOARD_ENUM) as [Leaderboard, number][]) { if (!additions[lb]) continue; await this.leaderboardChangeQuery!.run({ - score: additions[lb]!.score, - totalPoints: additions[lb]!.totalPoints, - totalCorrectAnswers: additions[lb]!.totalCorrectAnswers, + score: additions[lb].score, + totalPoints: additions[lb].totalPoints, + totalCorrectAnswers: additions[lb].totalCorrectAnswers, userid, leaderboard: discrim, }); @@ -272,7 +274,7 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { throw new Chat.ErrorMessage(`Can't find out if we are moving event questions because SQLite is not enabled.`); } - return (await this.eventQuestionQuery!.get([]) || {value: false}).value; + return (await this.eventQuestionQuery!.get([]) || { value: false }).value; } async moveQuestionToCategory(question: string, newCategory: string) { @@ -289,7 +291,7 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { throw new Chat.ErrorMessage(`Can't migrate categories because SQLite is not enabled.`); } - const {changes} = await this.migrateCategoryQuery!.run([targetCategory, sourceCategory]); + const { changes } = await this.migrateCategoryQuery!.run([targetCategory, sourceCategory]); return changes; } @@ -337,14 +339,14 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { })); } - async getScoresForLastGame(): Promise<{[k: string]: number}> { + async getScoresForLastGame(): Promise<{ [k: string]: number }> { if (this.readyPromise) await this.readyPromise; if (!Config.usesqlite) { throw new Chat.ErrorMessage(`Can't get Trivia game scores because SQLite is not enabled.`); } - const {game_id} = await this.historyQuery!.get([1]); + const { game_id } = await this.historyQuery!.get([1]); - const results: {[k: string]: number} = {}; + const results: { [k: string]: number } = {}; for (const row of await this.historyScoresQuery!.all([game_id])) { results[row.userid] = row.score; } @@ -354,7 +356,7 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { async getQuestions( categories: string[] | 'all', limit: number, - options: {order: 'newestfirst' | 'oldestfirst' | 'random'} + options: { order: 'newestfirst' | 'oldestfirst' | 'random' } ): Promise { if (this.readyPromise) await this.readyPromise; if (!Config.usesqlite) throw new Chat.ErrorMessage(`Can't get Trivia questions because SQLite is not enabled.`); @@ -463,7 +465,7 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { return Promise.all(rows.map((row: AnyObject) => this.rowToQuestion(row))); } - async getQuestionCounts(): Promise<{[k: string]: number, total: number}> { + async getQuestionCounts(): Promise<{ [k: string]: number, total: number }> { if (this.readyPromise) await this.readyPromise; if (!Config.usesqlite) { throw new Chat.ErrorMessage(`Can't retrieve the Trivia question counts because SQLite is not enabled.`); @@ -472,7 +474,7 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { const allCategories = (await this.categoriesQuery!.all([])).map((row: AnyObject) => row.category); const total = (await this.questionCountQuery!.get([])).count; - const result: {[k: string]: number, total: number} = {total}; + const result: { [k: string]: number, total: number } = { total }; for (const category of allCategories) { result[category] = (await this.categoryQuestionCountQuery!.get([category])).count; } @@ -481,7 +483,7 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { async searchQuestions( search: string, - options: {searchSubmissions: boolean, caseSensitive?: boolean} + options: { searchSubmissions: boolean, caseSensitive?: boolean } ): Promise { if (this.readyPromise) await this.readyPromise; if (!Config.usesqlite) { @@ -495,7 +497,6 @@ export class TriviaSQLiteDatabase implements TriviaDatabase { return Promise.all(rows.map((row: AnyObject) => this.rowToQuestion(row))); } - /***************************** * Methods for deleting data * * ***************************/ diff --git a/server/chat-plugins/trivia/transactions.ts b/server/chat-plugins/trivia/transactions.ts index 8da8fa7131..b333e0519a 100644 --- a/server/chat-plugins/trivia/transactions.ts +++ b/server/chat-plugins/trivia/transactions.ts @@ -2,12 +2,12 @@ * SQL transactions for the Trivia plugin. */ -import type {TransactionEnvironment} from '../../../lib/sql'; -import type {TriviaHistory, TriviaQuestion} from './trivia'; +import type { TransactionEnvironment } from '../../../lib/sql'; +import type { TriviaHistory, TriviaQuestion } from './trivia'; export const transactions = { addHistory: ( - args: {history: Iterable, gameHistoryInsertion: string, scoreHistoryInsertion: string}, + args: { history: Iterable, gameHistoryInsertion: string, scoreHistoryInsertion: string }, env: TransactionEnvironment ) => { const gameHistoryInsertion = env.statements.get(args.gameHistoryInsertion); @@ -15,7 +15,7 @@ export const transactions = { if (!gameHistoryInsertion || !scoreHistoryInsertion) throw new Error('Statements not found'); for (const game of args.history) { - const {lastInsertRowid} = gameHistoryInsertion.run( + const { lastInsertRowid } = gameHistoryInsertion.run( game.mode, game.length, game.category, game.startTime, game.creator, Number(game.givesPoints) ); for (const userid in game.scores) { @@ -27,12 +27,12 @@ export const transactions = { }, editQuestion( - args: {oldQuestionText: string, newQuestionText?: string, newAnswers?: string[]}, + args: { oldQuestionText: string, newQuestionText?: string, newAnswers?: string[] }, env: TransactionEnvironment, ) { // Question editing is likely to be infrequent, so I've optimized for readability and proper argument checking // rather than performance (i.e. not passing in prepared statements). - const {oldQuestionText, newQuestionText, newAnswers} = args; + const { oldQuestionText, newQuestionText, newAnswers } = args; if (newAnswers) { const questionID = (env.db @@ -68,7 +68,7 @@ export const transactions = { const isSubmissionForSQLite = Number(args.isSubmission); for (const question of args.questions) { - const {lastInsertRowid} = questionInsertion.run( + const { lastInsertRowid } = questionInsertion.run( question.question, question.category, question.addedAt, question.user, isSubmissionForSQLite ); for (const answer of question.answers) { diff --git a/server/chat-plugins/trivia/trivia.ts b/server/chat-plugins/trivia/trivia.ts index 5f613c5db3..0ac7d0b553 100644 --- a/server/chat-plugins/trivia/trivia.ts +++ b/server/chat-plugins/trivia/trivia.ts @@ -3,17 +3,17 @@ * Written by Morfent */ -import {Utils} from '../../../lib'; -import {Leaderboard, LEADERBOARD_ENUM, TriviaDatabase, TriviaSQLiteDatabase} from './database'; +import { Utils } from '../../../lib'; +import { type Leaderboard, LEADERBOARD_ENUM, type TriviaDatabase, TriviaSQLiteDatabase } from './database'; -const MAIN_CATEGORIES: {[k: string]: string} = { +const MAIN_CATEGORIES: { [k: string]: string } = { ae: 'Arts and Entertainment', pokemon: 'Pok\u00E9mon', sg: 'Science and Geography', sh: 'Society and Humanities', }; -const SPECIAL_CATEGORIES: {[k: string]: string} = { +const SPECIAL_CATEGORIES: { [k: string]: string } = { misc: 'Miscellaneous', event: 'Event', eventused: 'Event (used)', @@ -28,24 +28,24 @@ const SPECIAL_CATEGORIES: {[k: string]: string} = { oldpoke: 'Old Pok\u00E9mon', }; -const ALL_CATEGORIES: {[k: string]: string} = {...SPECIAL_CATEGORIES, ...MAIN_CATEGORIES}; +const ALL_CATEGORIES: { [k: string]: string } = { ...SPECIAL_CATEGORIES, ...MAIN_CATEGORIES }; /** * Aliases for keys in the ALL_CATEGORIES object. */ -const CATEGORY_ALIASES: {[k: string]: ID} = { +const CATEGORY_ALIASES: { [k: string]: ID } = { poke: 'pokemon' as ID, subcat1: 'subcat' as ID, }; -const MODES: {[k: string]: string} = { +const MODES: { [k: string]: string } = { first: 'First', number: 'Number', timer: 'Timer', triumvirate: 'Triumvirate', }; -const LENGTHS: {[k: string]: {cap: number | false, prizes: number[]}} = { +const LENGTHS: { [k: string]: { cap: number | false, prizes: number[] } } = { short: { cap: 20, prizes: [3, 2, 1], @@ -117,12 +117,12 @@ export interface TriviaGame { } type TriviaLadder = ID[][]; -export type TriviaHistory = TriviaGame & {scores: {[k: string]: number}}; +export type TriviaHistory = TriviaGame & { scores: { [k: string]: number } }; export interface TriviaData { /** category:questions */ - questions?: {[k: string]: TriviaQuestion[]}; - submissions?: {[k: string]: TriviaQuestion[]}; + questions?: { [k: string]: TriviaQuestion[] }; + submissions?: { [k: string]: TriviaQuestion[] }; leaderboard?: TriviaLeaderboardData; altLeaderboard?: TriviaLeaderboardData; /* `scores` key is a user ID */ @@ -201,22 +201,21 @@ async function getQuestions( Object.keys(MAIN_CATEGORIES) .filter(cat => toID(MAIN_CATEGORIES[cat]) !== lastCategoryID) ); - return database.getQuestions([randCategory], limit, {order}); + return database.getQuestions([randCategory], limit, { order }); } else { const questions = []; for (const category of categories) { if (category === 'all') { - questions.push(...(await database.getQuestions('all', limit, {order}))); + questions.push(...(await database.getQuestions('all', limit, { order }))); } else if (!ALL_CATEGORIES[category]) { throw new Chat.ErrorMessage(`"${category}" is an invalid category.`); } } - questions.push(...(await database.getQuestions(categories.filter(c => c !== 'all'), limit, {order}))); + questions.push(...(await database.getQuestions(categories.filter(c => c !== 'all'), limit, { order }))); return questions; } } - /** * Records a pending alt merge */ @@ -231,7 +230,6 @@ export async function requestAltMerge(from: ID, to: ID) { pendingAltMerges.set(from, to); } - /** * Checks that it has been approved by both users, * and merges two alts on the Trivia leaderboard. @@ -254,7 +252,7 @@ export async function mergeAlts(from: ID, to: ID) { // TODO: fix /trivia review class Ladder { - cache: Record; + cache: Record; constructor() { this.cache = { alltime: null, @@ -275,7 +273,6 @@ class Ladder { return this.cache[leaderboard]; } - async computeCachedLadder() { const leaderboards = await database.getLeaderboards(); for (const [lb, data] of Object.entries(leaderboards) as [Leaderboard, TriviaLeaderboardData][]) { @@ -283,7 +280,7 @@ class Ladder { const ladder: TriviaLadder = []; const ranks: TriviaLeaderboardData = {}; for (const [leader] of leaders) { - ranks[leader] = {score: 0, totalPoints: 0, totalCorrectAnswers: 0}; + ranks[leader] = { score: 0, totalPoints: 0, totalCorrectAnswers: 0 }; } for (const key of ['score', 'totalPoints', 'totalCorrectAnswers'] as (keyof TriviaLeaderboardScore)[]) { Utils.sortBy(leaders, ([, scores]) => -scores[key]); @@ -303,7 +300,7 @@ class Ladder { ranks[leader][key] = rank + 1; } } - this.cache[lb] = {ladder, ranks}; + this.cache[lb] = { ladder, ranks }; } } } @@ -371,7 +368,7 @@ export class Trivia extends Rooms.RoomGame { questions: TriviaQuestion[]; isPaused = false; phase: string; - phaseTimeout: NodeJS.Timer | null; + phaseTimeout: NodeJS.Timeout | null; questionNumber: number; curQuestion: string; curAnswers: string[]; @@ -399,13 +396,12 @@ export class Trivia extends Rooms.RoomGame { let category = [...uniqueCategories].join(' + '); if (isRandomCategory) category = this.room.tr`Random (${category})`; - this.game = { mode: (isRandomMode ? `Random (${MODES[mode]})` : MODES[mode]), - length: length, - category: category, - creator: creator, - givesPoints: givesPoints, + length, + category, + creator, + givesPoints, startTime: Date.now(), }; @@ -430,8 +426,8 @@ export class Trivia extends Rooms.RoomGame { } getCap() { - if (this.game.length in LENGTHS) return {points: LENGTHS[this.game.length].cap}; - if (typeof this.game.length === 'number') return {questions: this.game.length}; + if (this.game.length in LENGTHS) return { points: LENGTHS[this.game.length].cap }; + if (typeof this.game.length === 'number') return { questions: this.game.length }; throw new Error(`Couldn't determine cap for Trivia game with length ${this.game.length}`); } @@ -534,7 +530,7 @@ export class Trivia extends Rooms.RoomGame { /** * Formats the player list for display when using /trivia players. */ - formatPlayerList(settings: {max: number | null, requirePoints?: boolean}) { + formatPlayerList(settings: { max: number | null, requirePoints?: boolean }) { return this.getTopPlayers(settings).map(player => { const buf = Utils.html`${player.name} (${player.player.points || "0"})`; return player.player.isAbsent ? `${buf}` : buf; @@ -661,7 +657,7 @@ export class Trivia extends Rooms.RoomGame { } setTallyTimeout() { - this.setPhaseTimeout(() => this.tallyAnswers(), this.getRoundLength()); + this.setPhaseTimeout(() => void this.tallyAnswers(), this.getRoundLength()); } /** @@ -719,7 +715,7 @@ export class Trivia extends Rooms.RoomGame { * on. This is obligated to update the game phase, but it can be entirely * arbitrary otherwise. */ - tallyAnswers() {} + tallyAnswers(): void | Promise {} /** * Ends the game after a player's score has exceeded the score cap. @@ -727,8 +723,8 @@ export class Trivia extends Rooms.RoomGame { async win(buffer: string) { if (this.phaseTimeout) clearTimeout(this.phaseTimeout); this.phaseTimeout = null; - const winners = this.getTopPlayers({max: 3, requirePoints: true}); - buffer += '
    ' + this.getWinningMessage(winners); + const winners = this.getTopPlayers({ max: 3, requirePoints: true }); + buffer += `
    ${this.getWinningMessage(winners)}`; broadcast(this.room, this.room.tr`The answering period has ended!`, buffer); for (const i in this.playerTable) { @@ -756,7 +752,7 @@ export class Trivia extends Rooms.RoomGame { const prizes = this.getPrizes(); // these are for the non-all-time leaderboard // only the #1 player gets a prize on the all-time leaderboard - const scores: Map = new Map(); + const scores = new Map(); for (let i = 0; i < winners.length; i++) { scores.set(winners[i].id as ID, prizes[i]); } @@ -789,7 +785,7 @@ export class Trivia extends Rooms.RoomGame { if (typeof this.game.length === 'number') this.game.length = `${this.game.length} questions`; - const scores = Object.fromEntries(this.getTopPlayers({max: null}) + const scores = Object.fromEntries(this.getTopPlayers({ max: null }) .map(player => [player.player.id, player.player.points])); if (this.game.givesPoints) { await database.addHistory([{ @@ -808,15 +804,17 @@ export class Trivia extends Rooms.RoomGame { return (LENGTHS[this.game.length]?.prizes || [5, 3, 1]).map(prize => prize * multiplier); } - getTopPlayers(options: {max: number | null, requirePoints?: boolean} = {max: null, requirePoints: true}): TopPlayer[] { + getTopPlayers( + options: { max: number | null, requirePoints?: boolean } = { max: null, requirePoints: true } + ): TopPlayer[] { const ranks = []; for (const userid in this.playerTable) { const user = Users.get(userid); const player = this.playerTable[userid]; if ((options.requirePoints && !player.points) || !user) continue; - ranks.push({id: userid, player, name: user.name}); + ranks.push({ id: userid, player, name: user.name }); } - Utils.sortBy(ranks, ({player}) => ( + Utils.sortBy(ranks, ({ player }) => ( [-player.points, player.lastQuestion, hrtimeToNanoseconds(player.answeredAt)] )); return options.max === null ? ranks : ranks.slice(0, options.max); @@ -839,7 +837,7 @@ export class Trivia extends Rooms.RoomGame { return this.room.tr`${initialPart}their leaderboard score has increased by ${prizes[0]} points!`; case 2: return this.room.tr`${initialPart}their leaderboard score has increased by ${prizes[0]} points! ` + - this.room.tr`${Utils.escapeHTML(p2.name)} was a runner-up and their leaderboard score has increased by ${prizes[1]} points!`; + this.room.tr`${Utils.escapeHTML(p2.name)} was a runner-up and their leaderboard score has increased by ${prizes[1]} points!`; case 3: return initialPart + Utils.html`${this.room.tr`${p2.name} and ${p3.name} were runners-up. `}` + this.room.tr`Their leaderboard score has increased by ${prizes[0]}, ${prizes[1]}, and ${prizes[2]}, respectively!`; @@ -909,7 +907,7 @@ export class FirstModeTrivia extends Trivia { const buffer = Utils.html`${this.room.tr`Correct: ${players}`}
    ` + this.room.tr`Answer(s): ${this.curAnswers.join(', ')}` + `
    ` + this.room.tr`They gained 5 points!` + `
    ` + - this.room.tr`The top 5 players are: ${this.formatPlayerList({max: 5})}`; + this.room.tr`The top 5 players are: ${this.formatPlayerList({ max: 5 })}`; const cap = this.getCap(); if ((cap.points && player.points >= cap.points) || (cap.questions && this.questionNumber >= cap.questions)) { @@ -944,7 +942,7 @@ export class FirstModeTrivia extends Trivia { this.room.tr`Correct: no one...` + `
    ` + this.room.tr`Answers: ${this.curAnswers.join(', ')}` + `
    ` + this.room.tr`Nobody gained any points.` + `
    ` + - this.room.tr`The top 5 players are: ${this.formatPlayerList({max: 5})}` + this.room.tr`The top 5 players are: ${this.formatPlayerList({ max: 5 })}` ); this.setAskTimeout(); } @@ -985,14 +983,13 @@ export class TimerModeTrivia extends Trivia { let buffer = ( this.room.tr`Answer(s): ${this.curAnswers.join(', ')}
    ` + - '' + - '' + - '' + - `` + - '' + `
    Points gained${this.room.tr`Correct`}
    ` + + `` + + `` + + `` + + `` ); - const innerBuffer: Map = new Map([5, 4, 3, 2, 1].map(n => [n, []])); - + const innerBuffer = new Map([5, 4, 3, 2, 1].map(n => [n, []])); const now = hrtimeToNanoseconds(process.hrtime()); const askedAt = hrtimeToNanoseconds(this.askedAt); @@ -1048,7 +1045,7 @@ export class TimerModeTrivia extends Trivia { } buffer += '
    Points gained${this.room.tr`Correct`}
    '; - buffer += `
    ${this.room.tr`The top 5 players are: ${this.formatPlayerList({max: 5})}`}`; + buffer += `
    ${this.room.tr`The top 5 players are: ${this.formatPlayerList({ max: 5 })}`}`; if (winner) { return this.win(buffer); @@ -1125,7 +1122,7 @@ export class NumberModeTrivia extends Trivia { this.room.tr`Nobody gained any points.`; } - buffer += `
    ${this.room.tr`The top 5 players are: ${this.formatPlayerList({max: 5})}`}`; + buffer += `
    ${this.room.tr`The top 5 players are: ${this.formatPlayerList({ max: 5 })}`}`; if (winner) { return this.win(buffer); @@ -1157,7 +1154,7 @@ export class TriumvirateModeTrivia extends Trivia { return 5 - answerNumber * 2; // 5 points to 1st, 3 points to 2nd, 1 point to 1st } - async tallyAnswers() { + tallyAnswers() { if (this.isPaused) return; this.phase = INTERMISSION_PHASE; const correctPlayers = Object.values(this.playerTable).filter(p => p.isCorrect); @@ -1182,13 +1179,13 @@ export class TriumvirateModeTrivia extends Trivia { if (playersWithPoints.length) { const players = playersWithPoints.join(", "); buffer = this.room.tr`Correct: ${players}
    ` + - this.room.tr`Answers: ${this.curAnswers.join(', ')}
    ` + - this.room.tr`The top 5 players are: ${this.formatPlayerList({max: 5})}`; + this.room.tr`Answers: ${this.curAnswers.join(', ')}
    ` + + this.room.tr`The top 5 players are: ${this.formatPlayerList({ max: 5 })}`; } else { buffer = this.room.tr`Correct: no one...` + `
    ` + - this.room.tr`Answers: ${this.curAnswers.join(', ')}
    ` + - this.room.tr`Nobody gained any points.` + `
    ` + - this.room.tr`The top 5 players are: ${this.formatPlayerList({max: 5})}`; + this.room.tr`Answers: ${this.curAnswers.join(', ')}
    ` + + this.room.tr`Nobody gained any points.` + `
    ` + + this.room.tr`The top 5 players are: ${this.formatPlayerList({ max: 5 })}`; } if (winner) return this.win(buffer); @@ -1207,7 +1204,7 @@ export class TriumvirateModeTrivia extends Trivia { export class Mastermind extends Rooms.SimpleRoomGame { override readonly gameid = 'mastermind' as ID; /** userid:score Map */ - leaderboard: Map; + leaderboard: Map; phase: string; currentRound: MastermindRound | MastermindFinals | null; numFinalists: number; @@ -1255,7 +1252,7 @@ export class Mastermind extends Rooms.SimpleRoomGame { formatPlayerList() { return Utils.sortBy( Object.values(this.playerTable), - player => -(this.leaderboard.get(player.id) || 0) + player => -(this.leaderboard.get(player.id)?.score || 0) ).map(player => { const isFinalist = this.currentRound instanceof MastermindFinals && player.id in this.currentRound.playerTable; const name = isFinalist ? Utils.html`${player.name}` : Utils.escapeHTML(player.name); @@ -1287,20 +1284,20 @@ export class Mastermind extends Rooms.SimpleRoomGame { this.phase = MASTERMIND_ROUNDS_PHASE; this.currentRound = new MastermindRound(this.room, category, questions, playerID); - setTimeout((id) => { + setTimeout(() => { if (!this.currentRound) return; const points = this.currentRound.playerTable[playerID]?.points; - const player = this.playerTable[id].name; + const player = this.playerTable[playerID].name; broadcast( this.room, this.room.tr`The round of Mastermind has ended!`, points ? this.room.tr`${player} earned ${points} points!` : undefined ); - this.leaderboard.set(id, {score: points || 0}); + this.leaderboard.set(playerID, { score: points || 0 }); this.currentRound.destroy(); this.currentRound = null; - }, timeout * 1000, playerID); + }, timeout * 1000); } /** @@ -1391,7 +1388,7 @@ export class Mastermind extends Rooms.SimpleRoomGame { } const lbEntry = this.leaderboard.get(user.id); if (lbEntry) { - this.leaderboard.set(user.id, {...lbEntry, hasLeft: true}); + this.leaderboard.set(user.id, { ...lbEntry, hasLeft: true }); } this.removePlayer(this.playerTable[user.id]); } @@ -1437,9 +1434,8 @@ export class MastermindRound extends FirstModeTrivia { } init() { - return; } - start(): string | undefined { + start() { const player = Object.values(this.playerTable)[0]; const name = Utils.escapeHTML(player.name); broadcast(this.room, this.room.tr`A Mastermind round in the ${this.game.category} category for ${name} is starting!`); @@ -1449,7 +1445,6 @@ export class MastermindRound extends FirstModeTrivia { this.phase = INTERMISSION_PHASE; this.setPhaseTimeout(() => void this.askQuestion(), MASTERMIND_INTERMISSION_INTERVAL); - return; } win(): Promise { @@ -1464,7 +1459,6 @@ export class MastermindRound extends FirstModeTrivia { setTallyTimeout() { // Players must use /mastermind pass to pass on a question - return; } pass() { @@ -1491,12 +1485,11 @@ export class MastermindFinals extends MastermindRound { } } - start(): string | undefined { + override start() { broadcast(this.room, this.room.tr`The Mastermind finals are starting!`); this.phase = INTERMISSION_PHASE; // Use the regular start timeout since there are many players this.setPhaseTimeout(() => void this.askQuestion(), MASTERMIND_FINALS_START_TIMEOUT); - return; } async win() { @@ -1616,7 +1609,7 @@ const triviaCommands: Chat.ChatCommands = { this.checkChat(); this.checkCan('mute', null, room); - const {targetUser} = this.requireUser(target, {allowOffline: true}); + const { targetUser } = this.requireUser(target, { allowOffline: true }); getTriviaOrMastermindGame(room).kick(targetUser, user); }, kickhelp: [`/trivia kick [username] - Kick players from a trivia game by username. Requires: % @ # ~`], @@ -1719,7 +1712,7 @@ const triviaCommands: Chat.ChatCommands = { } else if (targetUser.id !== user.id) { return this.errorReply(this.tr`User ${targetUser.name} is not a player in the current trivia game.`); } - buffer += `
    ${this.tr`Players: ${game.formatPlayerList({max: null, requirePoints: false})}`}`; + buffer += `
    ${this.tr`Players: ${game.formatPlayerList({ max: null, requirePoints: false })}`}`; this.sendReplyBox(buffer); }, @@ -1782,9 +1775,9 @@ const triviaCommands: Chat.ChatCommands = { } questions.push({ - category: category, - question: question, - answers: answers, + category, + question, + answers, user: user.id, addedAt: Date.now(), }); @@ -1924,7 +1917,7 @@ const triviaCommands: Chat.ChatCommands = { return this.errorReply(this.tr`'${target}' is not a valid argument. View /trivia help questions for more information.`); } - const {category} = await database.ensureQuestionExists(question); + const { category } = await database.ensureQuestionExists(question); await database.deleteQuestion(question); this.modlog('TRIVIAQUESTION', null, `removed '${target}' from ${category}`); @@ -1960,7 +1953,7 @@ const triviaCommands: Chat.ChatCommands = { continue; } - const {category: oldCat} = await database.ensureQuestionExists(question); + const { category: oldCat } = await database.ensureQuestionExists(question); await database.moveQuestionToCategory(question, category); this.modlog('TRIVIAQUESTION', null, `changed category for '${param[1].trim()}' from '${oldCat}' to '${param[0]}'`); return this.privateModAction( @@ -2026,7 +2019,7 @@ const triviaCommands: Chat.ChatCommands = { } if (!oldQuestionText) return this.parse(`/help trivia edit`); - const {category} = await database.ensureQuestionExists(Utils.escapeHTML(oldQuestionText)); + const { category } = await database.ensureQuestionExists(Utils.escapeHTML(oldQuestionText)); let newQuestionText: string | undefined; if (!isAnswersOnly) { @@ -2122,7 +2115,7 @@ const triviaCommands: Chat.ChatCommands = { return this.errorReply(this.tr`'${target}' is not a valid category. View /help trivia for more information.`); } - const list = await database.getQuestions([category], Number.MAX_SAFE_INTEGER, {order: 'oldestfirst'}); + const list = await database.getQuestions([category], Number.MAX_SAFE_INTEGER, { order: 'oldestfirst' }); if (!list.length) { buffer += `${this.tr`There are no questions in the ${ALL_CATEGORIES[category]} category.`}`; return this.sendReply(buffer); @@ -2172,9 +2165,9 @@ const triviaCommands: Chat.ChatCommands = { let options; if (/^q(?:uestion)?s?$/.test(type)) { - options = {searchSubmissions: false, caseSensitive: cmd !== 'search'}; + options = { searchSubmissions: false, caseSensitive: cmd !== 'search' }; } else if (/^sub(?:mission)?s?$/.test(type)) { - options = {searchSubmissions: true, caseSensitive: cmd !== 'search'}; + options = { searchSubmissions: true, caseSensitive: cmd !== 'search' }; } else { return this.sendReplyBox( this.tr`No valid search category was entered. Valid categories: submissions, subs, questions, qs` @@ -2258,7 +2251,7 @@ const triviaCommands: Chat.ChatCommands = { if (!allTimeScore) return this.sendReplyBox(this.tr`User '${name}' has not played any Trivia games yet.`); const score = ( await database.getLeaderboardEntry(userid, 'nonAlltime') || - {score: 0, totalPoints: 0, totalCorrectAnswers: 0} + { score: 0, totalPoints: 0, totalCorrectAnswers: 0 } ); const cycleScore = await database.getLeaderboardEntry(userid, 'cycle'); @@ -2279,19 +2272,19 @@ const triviaCommands: Chat.ChatCommands = { `
    ` + `` + `` + - display(cycleScore, cycleRanks, 'score') + - display(score, ranks, 'score') + - display(allTimeScore, allTimeRanks, 'score') + + display(cycleScore, cycleRanks, 'score') + + display(score, ranks, 'score') + + display(allTimeScore, allTimeRanks, 'score') + `` + `` + - display(cycleScore, cycleRanks, 'totalPoints') + - display(score, ranks, 'totalPoints') + - display(allTimeScore, allTimeRanks, 'totalPoints') + + display(cycleScore, cycleRanks, 'totalPoints') + + display(score, ranks, 'totalPoints') + + display(allTimeScore, allTimeRanks, 'totalPoints') + `` + `` + - display(cycleScore, cycleRanks, 'totalCorrectAnswers') + - display(score, ranks, 'totalCorrectAnswers') + - display(allTimeScore, allTimeRanks, 'totalCorrectAnswers') + + display(cycleScore, cycleRanks, 'totalCorrectAnswers') + + display(score, ranks, 'totalCorrectAnswers') + + display(allTimeScore, allTimeRanks, 'totalCorrectAnswers') + `` + `
    ${name}Cycle LadderAll-time Score LadderAll-time Wins Ladder
    Leaderboard score
    Total game points
    Total correct answers
    ` ); @@ -2426,7 +2419,7 @@ const triviaCommands: Chat.ChatCommands = { if (isNaN(points)) return this.errorReply(`You must specify a number of points to add/remove.`); const isRemoval = cmd === 'removepoints'; - const change = {score: isRemoval ? -points : points, totalPoints: 0, totalCorrectAnswers: 0}; + const change = { score: isRemoval ? -points : points, totalPoints: 0, totalCorrectAnswers: 0 }; await database.updateLeaderboardForUser(userid, { alltime: change, nonAlltime: change, @@ -2510,75 +2503,73 @@ const triviaCommands: Chat.ChatCommands = { `|html|
    ` + `Categories: Arts & Entertainment, Pokémon, Science & Geography, Society & Humanities, Random, and All.
    ` + `
    Modes
      ` + - `
    • First: the first correct responder gains 5 points.
    • ` + - `
    • Timer: each correct responder gains up to 5 points based on how quickly they answer.
    • ` + - `
    • Number: each correct responder gains up to 5 points based on how many participants are correct.
    • ` + - `
    • Triumvirate: The first correct responder gains 5 points, the second 3 points, and the third 1 point.
    • ` + - `
    • Random: randomly chooses one of First, Timer, Number, or Triumvirate.
    • ` + + `
    • First: the first correct responder gains 5 points.
    • ` + + `
    • Timer: each correct responder gains up to 5 points based on how quickly they answer.
    • ` + + `
    • Number: each correct responder gains up to 5 points based on how many participants are correct.
    • ` + + `
    • Triumvirate: The first correct responder gains 5 points, the second 3 points, and the third 1 point.
    • ` + + `
    • Random: randomly chooses one of First, Timer, Number, or Triumvirate.
    • ` + `
    ` + `
    Game lengths
      ` + - `
    • Short: 20 point score cap. The winner gains 3 leaderboard points.
    • ` + - `
    • Medium: 35 point score cap. The winner gains 4 leaderboard points.
    • ` + - `
    • Long: 50 point score cap. The winner gains 5 leaderboard points.
    • ` + - `
    • Infinite: No score cap. The winner gains 5 leaderboard points, which increases the more questions they answer.
    • ` + - `
    • You may also specify a number for length; in this case, the game will end after that number of questions have been asked.
    • ` + + `
    • Short: 20 point score cap. The winner gains 3 leaderboard points.
    • ` + + `
    • Medium: 35 point score cap. The winner gains 4 leaderboard points.
    • ` + + `
    • Long: 50 point score cap. The winner gains 5 leaderboard points.
    • ` + + `
    • Infinite: No score cap. The winner gains 5 leaderboard points, which increases the more questions they answer.
    • ` + + `
    • You may also specify a number for length; in this case, the game will end after that number of questions have been asked.
    • ` + `
    ` + `
    Game commands
      ` + - `
    • /trivia new [mode], [categories], [length] - Begin signups for a new Trivia game. [categories] can be either one category, or a +-separated list of categories. Requires: + % @ # ~
    • ` + - `
    • /trivia unrankednew [mode], [category], [length] - Begin a new Trivia game that does not award leaderboard points. Requires: + % @ # ~
    • ` + - `
    • /trivia sortednew [mode], [category], [length] — Begin a new Trivia game in which the question order is not randomized. Requires: + % @ # ~
    • ` + - `
    • /trivia join - Join a game of Trivia or Mastermind during signups.
    • ` + - `
    • /trivia start - Begin the game once enough users have signed up. Requires: + % @ # ~
    • ` + - `
    • /ta [answer] - Answer the current question.
    • ` + - `
    • /trivia kick [username] - Disqualify a participant from the current trivia game. Requires: % @ # ~
    • ` + - `
    • /trivia leave - Makes the player leave the game.
    • ` + - `
    • /trivia end - End a trivia game. Requires: + % @ # ~
    • ` + - `
    • /trivia win - End a trivia game and tally the points to find winners. Requires: + % @ # ~ in Infinite length, else # ~
    • ` + - `
    • /trivia pause - Pauses a trivia game. Requires: + % @ # ~
    • ` + - `
    • /trivia resume - Resumes a paused trivia game. Requires: + % @ # ~
    • ` + + `
    • /trivia new [mode], [categories], [length] - Begin signups for a new Trivia game. [categories] can be either one category, or a +-separated list of categories. Requires: + % @ # ~
    • ` + + `
    • /trivia unrankednew [mode], [category], [length] - Begin a new Trivia game that does not award leaderboard points. Requires: + % @ # ~
    • ` + + `
    • /trivia sortednew [mode], [category], [length] — Begin a new Trivia game in which the question order is not randomized. Requires: + % @ # ~
    • ` + + `
    • /trivia join - Join a game of Trivia or Mastermind during signups.
    • ` + + `
    • /trivia start - Begin the game once enough users have signed up. Requires: + % @ # ~
    • ` + + `
    • /ta [answer] - Answer the current question.
    • ` + + `
    • /trivia kick [username] - Disqualify a participant from the current trivia game. Requires: % @ # ~
    • ` + + `
    • /trivia leave - Makes the player leave the game.
    • ` + + `
    • /trivia end - End a trivia game. Requires: + % @ # ~
    • ` + + `
    • /trivia win - End a trivia game and tally the points to find winners. Requires: + % @ # ~ in Infinite length, else # ~
    • ` + + `
    • /trivia pause - Pauses a trivia game. Requires: + % @ # ~
    • ` + + `
    • /trivia resume - Resumes a paused trivia game. Requires: + % @ # ~
    • ` + `
    ` + - `
    Question-modifying commands
      ` + - `
    • /trivia submit [category] | [question] | [answer1], [answer2] ... [answern] - Adds question(s) to the submission database for staff to review. Requires: + % @ # ~
    • ` + - `
    • /trivia review - View the list of submitted questions. Requires: @ # ~
    • ` + - `
    • /trivia accept [index1], [index2], ... [indexn] OR all - Add questions from the submission database to the question database using their index numbers or ranges of them. Requires: @ # ~
    • ` + - `
    • /trivia reject [index1], [index2], ... [indexn] OR all - Remove questions from the submission database using their index numbers or ranges of them. Requires: @ # ~
    • ` + - `
    • /trivia add [category] | [question] | [answer1], [answer2], ... [answern] - Adds question(s) to the question database. Requires: % @ # ~
    • ` + - `
    • /trivia delete [question] - Delete a question from the trivia database. Requires: % @ # ~
    • ` + - `
    • /trivia move [category] | [question] - Change the category of question in the trivia database. Requires: % @ # ~
    • ` + - `
    • /trivia migrate [source category], [destination category] — Moves all questions in a category to another category. Requires: # ~
    • ` + - Utils.html`
    • ${'/trivia edit | | '}: Edit a question in the trivia database, replacing answers if specified. Requires: % @ # ~` + - Utils.html`
    • ${'/trivia edit answers | | '}: Replaces the answers of a question. Requires: % @ # ~
    • ` + - Utils.html`
    • ${'/trivia edit question | | '}: Edits only the text of a question. Requires: % @ # ~
    • ` + - `
    • /trivia qs - View the distribution of questions in the question database.
    • ` + - `
    • /trivia qs [category] - View the questions in the specified category. Requires: % @ # ~
    • ` + - `
    • /trivia clearqs [category] - Clear all questions in the given category. Requires: # ~
    • ` + - `
    • /trivia moveusedevent - Tells you whether or not moving used event questions to a different category is enabled.
    • ` + - `
    • /trivia moveusedevent [on or off] - Toggles moving used event questions to a different category. Requires: # ~
    • ` + + `
      Question-modifying commands
        ` + + `
      • /trivia submit [category] | [question] | [answer1], [answer2] ... [answern] - Adds question(s) to the submission database for staff to review. Requires: + % @ # ~
      • ` + + `
      • /trivia review - View the list of submitted questions. Requires: @ # ~
      • ` + + `
      • /trivia accept [index1], [index2], ... [indexn] OR all - Add questions from the submission database to the question database using their index numbers or ranges of them. Requires: @ # ~
      • ` + + `
      • /trivia reject [index1], [index2], ... [indexn] OR all - Remove questions from the submission database using their index numbers or ranges of them. Requires: @ # ~
      • ` + + `
      • /trivia add [category] | [question] | [answer1], [answer2], ... [answern] - Adds question(s) to the question database. Requires: % @ # ~
      • ` + + `
      • /trivia delete [question] - Delete a question from the trivia database. Requires: % @ # ~
      • ` + + `
      • /trivia move [category] | [question] - Change the category of question in the trivia database. Requires: % @ # ~
      • ` + + `
      • /trivia migrate [source category], [destination category] — Moves all questions in a category to another category. Requires: # ~
      • ` + + Utils.html`
      • ${'/trivia edit | | '}: Edit a question in the trivia database, replacing answers if specified. Requires: % @ # ~` + + Utils.html`
      • ${'/trivia edit answers | | '}: Replaces the answers of a question. Requires: % @ # ~
      • ` + + Utils.html`
      • ${'/trivia edit question | | '}: Edits only the text of a question. Requires: % @ # ~
      • ` + + `
      • /trivia qs - View the distribution of questions in the question database.
      • ` + + `
      • /trivia qs [category] - View the questions in the specified category. Requires: % @ # ~
      • ` + + `
      • /trivia clearqs [category] - Clear all questions in the given category. Requires: # ~
      • ` + + `
      • /trivia moveusedevent - Tells you whether or not moving used event questions to a different category is enabled.
      • ` + + `
      • /trivia moveusedevent [on or off] - Toggles moving used event questions to a different category. Requires: # ~
      • ` + `
      ` + `
      Informational commands
        ` + - `
      • /trivia search [type], [query] - Searches for questions based on their type and their query. Valid types: submissions, subs, questions, qs. Requires: + % @ # ~
      • ` + - `
      • /trivia casesensitivesearch [type], [query] - Like /trivia search, but is case sensitive (i.e., capitalization matters). Requires: + % @ * ~
      • ` + - `
      • /trivia status [player] - lists the player's standings (your own if no player is specified) and the list of players in the current trivia game.
      • ` + - `
      • /trivia rank [username] - View the rank of the specified user. If none is given, view your own.
      • ` + - `
      • /trivia history - View a list of the 10 most recently played trivia games.
      • ` + - `
      • /trivia lastofficialscore - View the scores from the last Trivia game. Intended for bots.
      • ` + + `
      • /trivia search [type], [query] - Searches for questions based on their type and their query. Valid types: submissions, subs, questions, qs. Requires: + % @ # ~
      • ` + + `
      • /trivia casesensitivesearch [type], [query] - Like /trivia search, but is case sensitive (i.e., capitalization matters). Requires: + % @ * ~
      • ` + + `
      • /trivia status [player] - lists the player's standings (your own if no player is specified) and the list of players in the current trivia game.
      • ` + + `
      • /trivia rank [username] - View the rank of the specified user. If none is given, view your own.
      • ` + + `
      • /trivia history - View a list of the 10 most recently played trivia games.
      • ` + + `
      • /trivia lastofficialscore - View the scores from the last Trivia game. Intended for bots.
      • ` + `
      ` + `
      Leaderboard commands
        ` + - `
      • /trivia ladder [n] - Displays the top [n] users on the cycle-specific Trivia leaderboard. If [n] isn't specified, shows 100 users.
      • ` + - `
      • /trivia alltimewinsladder - Like /trivia ladder, but displays the all-time wins Trivia leaderboard (formerly all-time).
      • ` + - `
      • /trivia alltimescoreladder - Like /trivia ladder, but displays the all-time score Trivia leaderboard (formerly non—all-time)
      • ` + - `
      • /trivia resetcycleleaderboard - Resets the cycle-specific Trivia leaderboard. Requires: # ~` + - `
      • /trivia mergescore [user] — Merge another user's Trivia leaderboard score with yours.
      • ` + - `
      • /trivia addpoints [user], [points] - Add points to a given user's score on the Trivia leaderboard. Requires: # ~
      • ` + - `
      • /trivia removepoints [user], [points] - Remove points from a given user's score on the Trivia leaderboard. Requires: # ~
      • ` + - `
      • /trivia removeleaderboardentry [user] — Remove all Trivia leaderboard entries for a user. Requires: # ~
      • ` + - + `
      • /trivia ladder [n] - Displays the top [n] users on the cycle-specific Trivia leaderboard. If [n] isn't specified, shows 100 users.
      • ` + + `
      • /trivia alltimewinsladder - Like /trivia ladder, but displays the all-time wins Trivia leaderboard (formerly all-time).
      • ` + + `
      • /trivia alltimescoreladder - Like /trivia ladder, but displays the all-time score Trivia leaderboard (formerly non—all-time)
      • ` + + `
      • /trivia resetcycleleaderboard - Resets the cycle-specific Trivia leaderboard. Requires: # ~` + + `
      • /trivia mergescore [user] — Merge another user's Trivia leaderboard score with yours.
      • ` + + `
      • /trivia addpoints [user], [points] - Add points to a given user's score on the Trivia leaderboard. Requires: # ~
      • ` + + `
      • /trivia removepoints [user], [points] - Remove points from a given user's score on the Trivia leaderboard. Requires: # ~
      • ` + + `
      • /trivia removeleaderboardentry [user] — Remove all Trivia leaderboard entries for a user. Requires: # ~
      • ` + `
      ` ); }, }; - const mastermindCommands: Chat.ChatCommands = { answer: triviaCommands.answer, end: triviaCommands.end, @@ -2652,7 +2643,6 @@ const mastermindCommands: Chat.ChatCommands = { }, joinhelp: [`/mastermind join — Joins the current game of Mastermind.`], - leave(target, room, user) { getMastermindGame(room).leave(user); this.sendReply(this.tr`You have left the current game of Mastermind.`); diff --git a/server/chat-plugins/uno.ts b/server/chat-plugins/uno.ts index 507b27c733..5e203bde82 100644 --- a/server/chat-plugins/uno.ts +++ b/server/chat-plugins/uno.ts @@ -6,7 +6,7 @@ * * @license MIT license */ -import {Utils} from '../../lib'; +import { Utils } from '../../lib'; type Color = 'Green' | 'Yellow' | 'Red' | 'Blue' | 'Black'; interface Card { @@ -18,7 +18,7 @@ interface Card { const MAX_TIME = 60; // seconds -const rgbGradients: {[k in Color]: string} = { +const rgbGradients: { [k in Color]: string } = { Green: "rgba(0, 122, 0, 1), rgba(0, 185, 0, 0.9)", Yellow: "rgba(255, 225, 0, 1), rgba(255, 255, 85, 0.9)", Blue: "rgba(40, 40, 255, 1), rgba(125, 125, 255, 0.9)", @@ -26,7 +26,7 @@ const rgbGradients: {[k in Color]: string} = { Black: "rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.55)", }; -const textColors: {[k in Color]: string} = { +const textColors: { [k in Color]: string } = { Green: "rgb(0, 128, 0)", Yellow: "rgb(175, 165, 40)", Blue: "rgb(75, 75, 255)", @@ -52,7 +52,7 @@ function createDeck() { for (const color of colors) { basic.push(...values.map(v => { - const c: Card = {value: v, color: color, name: `${color} ${v}`}; + const c: Card = { value: v, color, name: `${color} ${v}` }; return c; })); } @@ -63,17 +63,17 @@ function createDeck() { ...basic, // The four 0s ...[0, 1, 2, 3].map(v => { - const c: Card = {color: colors[v], value: '0', name: `${colors[v]} 0`}; + const c: Card = { color: colors[v], value: '0', name: `${colors[v]} 0` }; return c; }), - // Wild cards + // Wild cards ...[0, 1, 2, 3].map(v => { - const c: Card = {color: 'Black', value: 'Wild', name: 'Wild'}; + const c: Card = { color: 'Black', value: 'Wild', name: 'Wild' }; return c; }), // Wild +4 cards ...[0, 1, 2, 3].map(v => { - const c: Card = {color: 'Black', value: '+4', name: 'Wild +4'}; + const c: Card = { color: 'Black', value: '+4', name: 'Wild +4' }; return c; }), ]; // 108 cards @@ -83,9 +83,9 @@ export class UNO extends Rooms.RoomGame { override readonly gameid = 'uno' as ID; override title = 'UNO'; override readonly allowRenames = true; - override timer: NodeJS.Timer | null = null; + override timer: NodeJS.Timeout | null = null; maxTime = MAX_TIME; - autostartTimer: NodeJS.Timer | null = null; + autostartTimer: NodeJS.Timeout | null = null; state: 'signups' | 'color' | 'play' | 'uno' = 'signups'; currentPlayer: UNOPlayer | null = null; deck: Card[] = Utils.shuffle(createDeck()); @@ -95,7 +95,7 @@ export class UNO extends Rooms.RoomGame { unoId: ID | null = null; direction: 1 | -1 = 1; suppressMessages: boolean; - spectators: {[k: string]: number} = Object.create(null); + spectators: { [k: string]: number } = Object.create(null); isPlusFour = false; gameNumber: number; @@ -283,7 +283,7 @@ export class UNO extends Rooms.RoomGame { onAwaitUno() { return new Promise(resolve => { - if (!this.awaitUnoPlayer) return resolve(); + if (!this.awaitUnoPlayer) return void resolve(); this.state = "uno"; // the throttle for sending messages is at 600ms for non-authed users, diff --git a/server/chat-plugins/username-prefixes.ts b/server/chat-plugins/username-prefixes.ts index 838169d0ff..1c9bb8d676 100644 --- a/server/chat-plugins/username-prefixes.ts +++ b/server/chat-plugins/username-prefixes.ts @@ -3,7 +3,7 @@ * @author Annika */ -import {FS} from '../../lib'; +import { FS } from '../../lib'; const PREFIXES_FILE = 'config/chat-plugins/username-prefixes.json'; const PREFIX_DURATION = 10 * 24 * 60 * 60 * 1000; @@ -25,7 +25,7 @@ export class PrefixManager { const convertedPrefixes = []; for (const type in Config.forcedprefixes) { for (const prefix of Config.forcedprefixes[type].map(toID)) { - convertedPrefixes.push({type, prefix, expireAt: Date.now() + PREFIX_DURATION}); + convertedPrefixes.push({ type, prefix, expireAt: Date.now() + PREFIX_DURATION }); } } Config.forcedprefixes = convertedPrefixes; @@ -58,7 +58,7 @@ export class PrefixManager { throw new Chat.ErrorMessage(`Username prefix '${prefix}' is already configured to force ${type}.`); } - Config.forcedprefixes.push({type, prefix, expireAt: Date.now() + PREFIX_DURATION}); + Config.forcedprefixes.push({ type, prefix, expireAt: Date.now() + PREFIX_DURATION }); this.save(); } diff --git a/server/chat-plugins/usersearch.tsx b/server/chat-plugins/usersearch.tsx index 226274912f..b7aeddf116 100644 --- a/server/chat-plugins/usersearch.tsx +++ b/server/chat-plugins/usersearch.tsx @@ -1,4 +1,4 @@ -import {Utils, FS} from '../../lib'; +import { Utils, FS } from '../../lib'; export const nameList = new Set(JSON.parse( FS('config/chat-plugins/usersearch.json').readIfExistsSync() || "[]" @@ -7,28 +7,28 @@ export const nameList = new Set(JSON.parse( const ONLINE_SYMBOL = ` \u25C9 `; const OFFLINE_SYMBOL = ` \u25CC `; -class PunishmentHTML extends Chat.JSX.Component<{userid: ID, target: string}> { +class PunishmentHTML extends Chat.JSX.Component<{ userid: ID, target: string }> { render() { - const {userid, target} = {...this.props}; + const { userid, target } = { ...this.props }; const buf = []; for (const cmdName of ['Forcerename', 'Namelock', 'Weeknamelock']) { // We have to use dangerouslySetInnerHTML here because otherwise the `value` // property of the button tag is auto escaped, making into &#10; - buf.push(${cmdName}`, - } - } />); + ` /uspage ${target}">${cmdName}`, + }} + />); } return buf; } } -class SearchUsernames extends Chat.JSX.Component<{target: string, page?: boolean}> { +class SearchUsernames extends Chat.JSX.Component<{ target: string, page?: boolean }> { render() { - const {target, page} = {...this.props}; - const results: {offline: string[], online: string[]} = { + const { target, page } = { ...this.props }; + const results: { offline: string[], online: string[] } = { offline: [], online: [], }; @@ -47,19 +47,22 @@ class SearchUsernames extends Chat.JSX.Component<{target: string, page?: boolean if (!page) { return <> Users with a name matching '{target}':
      - {!results.offline.length && !results.online.length ? - <>No users found. : <> + {!results.offline.length && !results.online.length ? ( + <>No users found. + ) : ( + <> {results.online.join('; ')} {!!results.offline.length && <>{!!results.online.length && <>

      }{results.offline.join('; ')}} - } + )} ; } return

      Usernames containing "{target}"

      - {!results.online.length && !results.offline.length ? -

      No results found.

      : + {!results.online.length && !results.offline.length ? ( +

      No results found.

      + ) : ( <>{!!results.online.length &&

      Online users

      @@ -99,7 +102,7 @@ class SearchUsernames extends Chat.JSX.Component<{target: string, page?: boolean })()}
      } - } + )}
      ; } } @@ -214,7 +217,7 @@ export const pages: Chat.PageTable = { const target = toID(query.shift()); if (!target) { this.title = `[Usersearch Terms]`; - const sorted: {[k: string]: number} = {}; + const sorted: { [k: string]: number } = {}; for (const curUser of Users.users.values()) { for (const term of nameList) { if (curUser.id.includes(term)) { @@ -225,12 +228,13 @@ export const pages: Chat.PageTable = { } return
      Usersearch term list -
      - {!nameList.size ? -

      None found.

      : + {!nameList.size ? ( +

      None found.

      + ) : (
      @@ -247,12 +251,12 @@ export const pages: Chat.PageTable = { ); } - if (!buf.length) return ; + if (!buf.length) return ; return buf; })()}
      No names found.
      No names found.
      - } + )}
      ; } this.title = `[Usersearch] ${target}`; diff --git a/server/chat-plugins/wifi.tsx b/server/chat-plugins/wifi.tsx index ea5d154a57..be1490beb3 100644 --- a/server/chat-plugins/wifi.tsx +++ b/server/chat-plugins/wifi.tsx @@ -5,7 +5,7 @@ * plugin as written by Codelegend, SilverTactic, DanielCranham */ -import {FS, Utils} from '../../lib'; +import { FS, Utils } from '../../lib'; Punishments.addRoomPunishmentType({ type: 'GIVEAWAYBAN', @@ -43,9 +43,9 @@ interface LotteryGiveawayData extends GiveawayData { interface WifiData { whitelist: string[]; - stats: {[k: string]: number[]}; - storedGiveaways: {question: QuestionGiveawayData[], lottery: LotteryGiveawayData[]}; - submittedGiveaways: {question: QuestionGiveawayData[], lottery: LotteryGiveawayData[]}; + stats: { [k: string]: number[] }; + storedGiveaways: { question: QuestionGiveawayData[], lottery: LotteryGiveawayData[] }; + submittedGiveaways: { question: QuestionGiveawayData[], lottery: LotteryGiveawayData[] }; } const defaults: WifiData = { @@ -77,8 +77,8 @@ function saveData() { // Convert old file type if (!wifiData.stats && !wifiData.storedGiveaways && !wifiData.submittedGiveaways) { // we cast under the assumption that it's the old file format - const stats = {...wifiData} as unknown as {[k: string]: number[]}; - wifiData = {...defaults, stats}; + const stats = { ...wifiData } as unknown as { [k: string]: number[] }; + wifiData = { ...defaults, stats }; saveData(); } // ensure the whitelist exists for those who might have the conversion above but not the stats @@ -86,12 +86,12 @@ if (!wifiData.whitelist) wifiData.whitelist = []; const statNames = ["HP", "Atk", "Def", "SpA", "SpD", "Spe"]; -const gameName: {[k in Game]: string} = { +const gameName: { [k in Game]: string } = { SwSh: 'Sword/Shield', BDSP: 'Brilliant Diamond/Shining Pearl', SV: 'Scarlet/Violet', }; -const gameidToGame: {[k: string]: Game} = { +const gameidToGame: { [k: string]: Game } = { swsh: 'SwSh', bdsp: 'BDSP', sv: 'SV', @@ -116,7 +116,7 @@ abstract class Giveaway extends Rooms.SimpleRoomGame { * IP:userid */ joined: Map; - timer: NodeJS.Timer | null; + timer: NodeJS.Timeout | null; pokemonID: ID; sprite: Chat.VNode; @@ -157,9 +157,9 @@ abstract class Giveaway extends Rooms.SimpleRoomGame { } getStyle() { - const css: {[k: string]: string | {[k: string]: string}} = {class: "broadcast-blue"}; - if (this.game === 'BDSP') css.style = {background: '#aa66a9', color: '#fff'}; - if (this.game === 'SV') css.style = {background: '#CD5C5C', color: '#fff'}; + const css: { [k: string]: string | { [k: string]: string } } = { class: "broadcast-blue" }; + if (this.game === 'BDSP') css.style = { background: '#aa66a9', color: '#fff' }; + if (this.game === 'SV') css.style = { background: '#CD5C5C', color: '#fff' }; return css; } @@ -294,7 +294,7 @@ abstract class Giveaway extends Rooms.SimpleRoomGame { let set = Teams.exportSet(setObj); let ivsStr = ''; if (ivs.length) { - const convertedIVs = {hp: '31', atk: '31', def: '31', spa: '31', spd: '31', spe: '31'}; + const convertedIVs = { hp: '31', atk: '31', def: '31', spa: '31', spd: '31', spe: '31' }; for (const [i, iv] of ivs.entries()) { const numStr = iv.trim().split(' ')[0]; const statName = statNames[i]; @@ -326,28 +326,28 @@ abstract class Giveaway extends Rooms.SimpleRoomGame { return

      It's {this.game} giveaway time!

      Giveaway started by {this.host.name} - +
      - - - + {!!this.extraInfo?.trim().length && - }
      + Giver: {this.giver.name}
      OT: {this.ot}, TID: {this.tid}
      + {this.sprite}
      {set}
      {rightSide}{rightSide}
      + Extra Information
      {this.extraInfo.trim().replace(/
      /g, '\n')}
      -

      +

      Note: You must have a Switch, Pokémon {gameName[this.game]}, {} and NSO to receive the prize. {} Do not join if you are currently unable to trade. Do not enter if you have already won this exact Pokémon, {} @@ -427,13 +427,13 @@ export class QuestionGiveaway extends Giveaway { generateQuestion() { return this.generateWindow(<> -

      Giveaway Question: {this.question}

      -

      use /guess to answer.

      +

      Giveaway Question: {this.question}

      +

      use /guess to answer.

      ); } start() { - this.changeUhtml(

      + this.changeUhtml(

      The giveaway has started! Scroll down to see the question.

      ); this.phase = 'started'; @@ -497,7 +497,7 @@ export class QuestionGiveaway extends Giveaway { } end(force: boolean) { - const style = {textAlign: 'center', fontSize: '13pt', fontWeight: 'bold'}; + const style = { textAlign: 'center', fontSize: '13pt', fontWeight: 'bold' }; if (force) { this.clearTimer(); this.changeUhtml(

      The giveaway was forcibly ended.

      ); @@ -516,10 +516,10 @@ export class QuestionGiveaway extends Giveaway { note: `${this.giver.name}'s giveaway for a "${this.prize.species}" (OT: ${this.ot} TID: ${this.tid} Nature: ${this.prize.nature} Ball: ${this.ball}${this.extraInfo ? ` Other box info: ${this.extraInfo}` : ''})`, }); this.send(this.generateWindow(<> -

      +

      {this.winner.name} won the giveaway! Congratulations!

      -

      +

      {this.question}
      Correct answer{Chat.plural(this.answers)}: {this.answers.join(', ')}

      @@ -683,7 +683,7 @@ export class LotteryGiveaway extends Giveaway { const userlist = [...this.joined.values()]; if (userlist.length === 0) { - this.changeUhtml(

      + this.changeUhtml(

      The giveaway was forcibly ended.

      ); this.room.send("The giveaway has been forcibly ended as there are no participants."); @@ -699,7 +699,7 @@ export class LotteryGiveaway extends Giveaway { } end(force = false) { - const style = {textAlign: 'center', fontSize: '13pt', fontWeight: 'bold'}; + const style = { textAlign: 'center', fontSize: '13pt', fontWeight: 'bold' }; if (force) { this.clearTimer(); this.changeUhtml(

      The giveaway was forcibly ended.

      ); @@ -715,9 +715,9 @@ export class LotteryGiveaway extends Giveaway { note: `${winnerNames} won ${this.giver.name}'s giveaway for "${this.prize.species}" (OT: ${this.ot} TID: ${this.tid} Nature: ${this.prize.nature} Ball: ${this.ball}${this.extraInfo ? ` Other box info: ${this.extraInfo}` : ''})`, }); this.send(this.generateWindow(<> -

      Lottery Draw

      -

      {Chat.count(this.joined.size, 'users')} joined the giveaway.
      - Our lucky winner{Chat.plural(this.winners)}: {winnerNames}!
      Congratulations!

      +

      Lottery Draw

      +

      {Chat.count(this.joined.size, 'users')} joined the giveaway.
      + Our lucky winner{Chat.plural(this.winners)}: {winnerNames}!
      Congratulations!

      )); this.room.sendMods(`|c|~|Participants: ${[...this.joined.values()].join(', ')}`); for (const winner of this.winners) { @@ -749,7 +749,7 @@ export class GTS extends Rooms.SimpleRoomGame { sprite: Chat.VNode; sent: string[]; noDeposits: boolean; - timer: NodeJS.Timer | null; + timer: NodeJS.Timeout | null; constructor( room: Room, giver: User, amount: number, @@ -766,7 +766,7 @@ export class GTS extends Rooms.SimpleRoomGame { this.lookfor = lookfor; // Deprecated, just typed like this to prevent errors, will rewrite when GTS is planned to be used again - [this.pokemonID, this.sprite] = Giveaway.getSprite({species: summary} as PokemonSet); + [this.pokemonID, this.sprite] = Giveaway.getSprite({ species: summary } as PokemonSet); this.sent = []; this.noDeposits = false; @@ -802,23 +802,23 @@ export class GTS extends Rooms.SimpleRoomGame { To participate, deposit {this.deposit} into the GTS and look for {this.lookfor} ; return <> -

      +

      There is a GTS giveaway going on!

      -

      +

      Hosted by: {this.giver.name} | Left: {this.left}

      - +
      - {!!sentModifier && } - - + - +
      + {!!sentModifier && Last winners:
      {this.sent.join(
      )}
      {this.sprite} + {this.sprite} {this.summary} {rightSide}{rightSide}
      ; @@ -844,7 +844,7 @@ export class GTS extends Rooms.SimpleRoomGame { stopDeposits() { this.noDeposits = true; - this.room.send(Chat.html`|html|${

      + this.room.send(Chat.html`|html|${

      More Pokémon have been deposited than there are prizes in this giveaway and new deposits will not be accepted. {} If you have already deposited a Pokémon, please be patient, and do not withdraw your Pokémon.

      }`); @@ -855,20 +855,20 @@ export class GTS extends Rooms.SimpleRoomGame { if (force) { this.clearTimer(); this.changeUhtml( -

      The GTS giveaway was forcibly ended.

      +

      The GTS giveaway was forcibly ended.

      ); this.room.send("The GTS giveaway was forcibly ended."); } else { this.clearTimer(); this.changeUhtml( -

      The GTS giveaway has finished.

      +

      The GTS giveaway has finished.

      ); this.room.modlog({ action: 'GTS FINISHED', userid: this.giver.id, note: `their GTS giveaway for "${this.summary}"`, }); - this.send(

      + this.send(

      The GTS giveaway for a "{this.lookfor}" has finished.

      ); Giveaway.updateStats(new Set([this.pokemonID])); @@ -906,7 +906,7 @@ function hasSubmittedGiveaway(user: User) { for (const [key, giveaways] of Object.entries(wifiData.submittedGiveaways)) { for (const [index, giveaway] of giveaways.entries()) { if (user.id === giveaway.targetUserID) { - return {index, type: key as 'question' | 'lottery'}; + return { index, type: key as 'question' | 'lottery' }; } } } @@ -1093,7 +1093,7 @@ export const commands: Chat.ChatCommands = { room = this.requireRoom('wifi' as RoomID); this.checkCan('warn', null, room); - const {targetUser, rest: reason} = this.requireUser(target, {allowOffline: true}); + const { targetUser, rest: reason } = this.requireUser(target, { allowOffline: true }); if (reason.length > 300) { return this.errorReply("The reason is too long. It cannot exceed 300 characters."); } @@ -1117,14 +1117,14 @@ export const commands: Chat.ChatCommands = { room = this.requireRoom('wifi' as RoomID); this.checkCan('warn', null, room); - const {targetUser} = this.requireUser(target, {allowOffline: true}); + const { targetUser } = this.requireUser(target, { allowOffline: true }); if (!Giveaway.checkBanned(room, targetUser)) { return this.errorReply(`User '${targetUser.name}' isn't banned from entering giveaways.`); } Giveaway.unban(room, targetUser); this.privateModAction(`${targetUser.name} was unbanned from entering giveaways by ${user.name}.`); - this.modlog('GIVEAWAYUNBAN', targetUser, null, {noip: 1, noalts: 1}); + this.modlog('GIVEAWAYUNBAN', targetUser, null, { noip: 1, noalts: 1 }); }, new: 'create', start: 'create', @@ -1228,7 +1228,7 @@ export const commands: Chat.ChatCommands = { if (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`); if (!wifiData.storedGiveaways.question) wifiData.storedGiveaways.question = []; - const data = {targetUserID: targetUser.id, ot, tid, game, prize: set, question, answers, ivs, ball, extraInfo}; + const data = { targetUserID: targetUser.id, ot, tid, game, prize: set, question, answers, ivs, ball, extraInfo }; wifiData.storedGiveaways.question.push(data); saveData(); @@ -1247,7 +1247,7 @@ export const commands: Chat.ChatCommands = { if (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`); if (!wifiData.storedGiveaways.lottery) wifiData.storedGiveaways.lottery = []; - const data = {targetUserID: targetUser.id, ot, tid, game, prize: set, winners, ball, extraInfo, ivs}; + const data = { targetUserID: targetUser.id, ot, tid, game, prize: set, winners, ball, extraInfo, ivs }; wifiData.storedGiveaways.lottery.push(data); saveData(); @@ -1273,7 +1273,7 @@ export const commands: Chat.ChatCommands = { if (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`); if (!wifiData.submittedGiveaways.question) wifiData.submittedGiveaways.question = []; - const data = {targetUserID: targetUser.id, ot, tid, game, prize: set, question, answers, ball, extraInfo, ivs}; + const data = { targetUserID: targetUser.id, ot, tid, game, prize: set, question, answers, ball, extraInfo, ivs }; wifiData.submittedGiveaways.question.push(data); saveData(); @@ -1300,7 +1300,7 @@ export const commands: Chat.ChatCommands = { if (!set) throw new Chat.ErrorMessage(`Please submit the prize in the form of a PS set importable.`); if (!wifiData.submittedGiveaways.lottery) wifiData.submittedGiveaways.lottery = []; - const data = {targetUserID: targetUser.id, ot, tid, game, prize: set, winners, ball, extraInfo, ivs}; + const data = { targetUserID: targetUser.id, ot, tid, game, prize: set, winners, ball, extraInfo, ivs }; wifiData.submittedGiveaways.lottery.push(data); saveData(); @@ -1332,17 +1332,17 @@ export const commands: Chat.ChatCommands = { const giveaway = wifiData.submittedGiveaways[hasGiveaway.type][hasGiveaway.index]; if (hasGiveaway.type === 'question') { const data = giveaway as QuestionGiveawayData; - this.parse(`/giveaway create question ${data.targetUserID}|${data.ot}|${data.tid}|${data.game}|${data.question}|${data.answers.join(',')}|${data.ivs.join('/')}|${data.ball}|${data.extraInfo}|${Teams.pack([data.prize])!}`); + this.parse(`/giveaway create question ${data.targetUserID}|${data.ot}|${data.tid}|${data.game}|${data.question}|${data.answers.join(',')}|${data.ivs.join('/')}|${data.ball}|${data.extraInfo}|${Teams.pack([data.prize])}`); } else { const data = giveaway as LotteryGiveawayData; - this.parse(`/giveaway create lottery ${data.targetUserID}|${data.ot}|${data.tid}|${data.game}|${data.winners}|${data.ivs.join('/')}|${data.ball}|${data.extraInfo}|${Teams.pack([data.prize])!}`); + this.parse(`/giveaway create lottery ${data.targetUserID}|${data.ot}|${data.tid}|${data.game}|${data.winners}|${data.ivs.join('/')}|${data.ball}|${data.extraInfo}|${Teams.pack([data.prize])}`); } wifiData.submittedGiveaways[hasGiveaway.type].splice(hasGiveaway.index, 1); saveData(); this.refreshPage(`giveaways-submitted`); targetUser.send(`${user.name} has approved your ${hasGiveaway.type} giveaway!`); this.privateModAction(`${user.name} approved a ${hasGiveaway.type} giveaway by ${targetUser.name}.`); - this.modlog(`GIVEAWAY APPROVE ${hasGiveaway.type.toUpperCase()}`, targetUser, null, {noalts: true, noip: true}); + this.modlog(`GIVEAWAY APPROVE ${hasGiveaway.type.toUpperCase()}`, targetUser, null, { noalts: true, noip: true }); }, deny: 'delete', delete(target, room, user, connection, cmd) { @@ -1370,7 +1370,7 @@ export const commands: Chat.ChatCommands = { this.privateModAction(`${user.name} deleted a ${typedType} giveaway by ${giveaway.targetUserID}.`); this.modlog(`GIVEAWAY DELETE ${typedType.toUpperCase()}`); } else { - const {targetUser, rest: reason} = this.splitUser(target); + const { targetUser, rest: reason } = this.splitUser(target); if (!targetUser?.connected) { throw new Chat.ErrorMessage(`${targetUser?.name || toID(target)} is offline, so their giveaway can't be run.`); } @@ -1383,7 +1383,7 @@ export const commands: Chat.ChatCommands = { saveData(); targetUser?.send(`Staff have rejected your giveaway${reason ? `: ${reason}` : '.'}`); this.privateModAction(`${user.name} denied a ${hasGiveaway.type} giveaway by ${targetUser.name}.`); - this.modlog(`GIVEAWAY DENY ${hasGiveaway.type.toUpperCase()}`, targetUser, reason || null, {noalts: true, noip: true}); + this.modlog(`GIVEAWAY DENY ${hasGiveaway.type.toUpperCase()}`, targetUser, reason || null, { noalts: true, noip: true }); } this.refreshPage(del ? `giveaways-stored` : 'giveaways-submitted'); }, @@ -1430,7 +1430,7 @@ export const commands: Chat.ChatCommands = { claim(target, room, user) { room = this.requireRoom('wifi' as RoomID); this.checkCan('mute', null, room); - const {targetUser} = this.requireUser(target); + const { targetUser } = this.requireUser(target); const hasGiveaway = hasSubmittedGiveaway(targetUser); if (!hasGiveaway) { this.refreshPage('giveaways-submitted'); @@ -1447,7 +1447,7 @@ export const commands: Chat.ChatCommands = { unclaim(target, room, user) { room = this.requireRoom('wifi' as RoomID); this.checkCan('mute', null, room); - const {targetUser} = this.requireUser(target); + const { targetUser } = this.requireUser(target); const hasGiveaway = hasSubmittedGiveaway(targetUser); if (!hasGiveaway) { this.refreshPage('giveaways-submitted'); @@ -1517,7 +1517,7 @@ export const commands: Chat.ChatCommands = { }; function makePageHeader(user: User, pageid?: string) { - const titles: {[k: string]: string} = { + const titles: { [k: string]: string } = { create: `Create`, stored: `View Stored`, 'stored-add': 'Store', @@ -1532,9 +1532,10 @@ function makePageHeader(user: User, pageid?: string) { 'submitted-add': , }; const buf = []; - buf.push(); buf.push(

      Wi-Fi Giveaways

      ); @@ -1558,7 +1559,7 @@ function makePageHeader(user: User, pageid?: string) { } function formatFakeButton(url: string, text: Chat.VNode): Chat.VNode { - return {text}; + return {text}; } function generatePokeballDropdown() { @@ -1601,7 +1602,7 @@ export const pages: Chat.PageTable = { case 'lottery': return <>

      Make a Lottery Giveaway

      - +





      @@ -1614,9 +1615,10 @@ export const pages: Chat.PageTable = { {generatePokeballDropdown()}




      -

      + +


      - +

      @@ -1624,9 +1626,9 @@ export const pages: Chat.PageTable = { case 'question': return <>

      Make a Question Giveaway

      -
      +





      @@ -1640,10 +1642,10 @@ export const pages: Chat.PageTable = { {generatePokeballDropdown()}



      - +


      - +

      @@ -1657,8 +1659,8 @@ export const pages: Chat.PageTable = { this.checkCan('warn', null, Rooms.search('wifi')!); const [add, type] = args; const giveaways = [ - ...((wifiData.storedGiveaways || {}).lottery || []), - ...((wifiData.storedGiveaways || {}).question || []), + ...(wifiData.storedGiveaways?.lottery || []), + ...(wifiData.storedGiveaways?.question || []), ]; const adding = add === 'add'; if (!giveaways.length && !adding) { @@ -1677,7 +1679,7 @@ export const pages: Chat.PageTable = { giveaway = giveaway as LotteryGiveawayData; const targetUser = Users.get(giveaway.targetUserID); buf.push(
      -

      Lottery

      +

      Lottery


      Game: {gameName[giveaway.game]}
      Giver: {giveaway.targetUserID}, {} @@ -1696,23 +1698,28 @@ export const pages: Chat.PageTable = {
    }
    - - {!targetUser?.connected ? - + {!targetUser?.connected ? ( + : - - } + + ) : ( + + )}
    ); } else { giveaway = giveaway as QuestionGiveawayData; const targetUser = Users.get(giveaway.targetUserID); buf.push(
    -

    Lottery

    +

    Lottery


    Game: {gameName[giveaway.game]}
    Giver: {giveaway.targetUserID}, {} @@ -1732,19 +1739,23 @@ export const pages: Chat.PageTable = { }
    - - {!targetUser?.connected ? - : - - } + + ) : ( + + )}
    ); } } @@ -1777,16 +1788,17 @@ export const pages: Chat.PageTable = { {generatePokeballDropdown()}




    -

    + +


    - +

    ; case 'question': - return
    + return





    @@ -1800,10 +1812,10 @@ export const pages: Chat.PageTable = { {generatePokeballDropdown()}



    - +


    - +

    ; @@ -1821,8 +1833,8 @@ export const pages: Chat.PageTable = { const adding = add === 'add'; if (!adding) this.checkCan('warn', null, Rooms.get('wifi')!); const giveaways = [ - ...((wifiData.submittedGiveaways || {}).lottery || []), - ...((wifiData.submittedGiveaways || {}).question || []), + ...(wifiData.submittedGiveaways?.lottery || []), + ...(wifiData.submittedGiveaways?.question || []), ]; if (!giveaways.length && !adding) { return
    @@ -1848,7 +1860,7 @@ export const pages: Chat.PageTable = { if (wifiData.submittedGiveaways.lottery.includes(giveaway as LotteryGiveawayData)) { giveaway = giveaway as LotteryGiveawayData; return <> -

    Lottery

    +

    Lottery


    Game: {gameName[giveaway.game]}, Giver: {giveaway.targetUserID}, {} OT: {giveaway.ot}, TID: {giveaway.tid}, {} @@ -1870,7 +1882,7 @@ export const pages: Chat.PageTable = { } else { giveaway = giveaway as QuestionGiveawayData; return <> -

    Question

    +

    Question


    Game: {gameName[giveaway.game]}, Giver: {giveaway.targetUserID}, {} OT: {giveaway.ot}, TID: {giveaway.tid} @@ -1897,20 +1909,20 @@ export const pages: Chat.PageTable = { - - : <> - - } @@ -1946,16 +1958,17 @@ export const pages: Chat.PageTable = { {generatePokeballDropdown()}




    -

    + +


    - +

    ; case 'question': - return
    + return





    @@ -1969,9 +1982,10 @@ export const pages: Chat.PageTable = { {generatePokeballDropdown()}



    -

    + +


    - +

    ; diff --git a/server/chat-plugins/youtube.ts b/server/chat-plugins/youtube.ts index ae92961f8b..97433e9895 100644 --- a/server/chat-plugins/youtube.ts +++ b/server/chat-plugins/youtube.ts @@ -6,7 +6,7 @@ * @author mia-pi-git */ -import {Utils, FS, Net} from '../../lib'; +import { Utils, FS, Net } from '../../lib'; const ROOT = 'https://www.googleapis.com/youtube/v3/'; const STORAGE_PATH = 'config/chat-plugins/youtube.json'; @@ -59,7 +59,7 @@ interface TwitchChannel { } interface ChannelData { - channels: {[k: string]: ChannelEntry}; + channels: { [k: string]: ChannelEntry }; categories: string[]; intervalTime?: number; } @@ -80,12 +80,12 @@ function loadData() { const channelData: ChannelData = loadData(); export class YoutubeInterface { - interval: NodeJS.Timer | null; + interval: NodeJS.Timeout | null; intervalTime: number; data: ChannelData; linkRegex = /^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)(\/|$)/i; constructor(data?: ChannelData) { - this.data = data ? data : {categories: [], channels: {}}; + this.data = data ? data : { categories: [], channels: {} }; this.interval = null; this.intervalTime = 0; if (data?.intervalTime) { @@ -98,7 +98,7 @@ export class YoutubeInterface { } const id = this.getId(link); const raw = await Net(`${ROOT}channels`).get({ - query: {part: 'snippet,statistics', id, key: Config.youtubeKey}, + query: { part: 'snippet,statistics', id, key: Config.youtubeKey }, }); const res = JSON.parse(raw); if (!res?.items || res.items.length < 1) { @@ -113,15 +113,15 @@ export class YoutubeInterface { videos: Number(data.statistics.videoCount), subs: Number(data.statistics.subscriberCount), views: Number(data.statistics.viewCount), - username: username, + username, }; - this.data.channels[id] = {...cache}; + this.data.channels[id] = { ...cache }; this.save(); return cache; } async generateChannelDisplay(link: string) { const id = this.getId(link); - const {name, description, icon, videos, subs, views, username} = await this.get(id); + const { name, description, icon, videos, subs, views, username } = await this.get(id); // credits bumbadadabum for most of the html let buf = `
    `; buf += ``; buf += ``; buf += ``; @@ -2084,7 +2082,7 @@ export const Punishments = new class { const minPunishments = (typeof Config.monitorminpunishments === 'number' ? Config.monitorminpunishments : 3); if (!minPunishments) return; - let punishments = Punishments.getRoomPunishments(user, {checkIps: true, publicOnly: true}); + let punishments = Punishments.getRoomPunishments(user, { checkIps: true, publicOnly: true }); punishments = punishments.filter(([room, punishment]) => ( Punishments.roomPunishmentTypes.get(punishment.type)?.activatePunishMonitor )); @@ -2093,7 +2091,7 @@ export const Punishments = new class { let points = 0; const punishmentText = punishments.map(([room, punishment]) => { - const {type: punishType, id: punishUserid, reason} = punishment; + const { type: punishType, id: punishUserid, reason } = punishment; if (punishType in PUNISHMENT_POINT_VALUES) points += PUNISHMENT_POINT_VALUES[punishType]; let punishDesc = Punishments.roomPunishmentTypes.get(punishType)?.desc; if (!punishDesc) punishDesc = `punished`; @@ -2118,7 +2116,9 @@ export const Punishments = new class { if (typeof user !== 'string') { user.popup( `|modal|You've been locked for breaking the rules in multiple chatrooms.\n\n` + - `If you feel that your lock was unjustified, you can still PM staff members (%, @, ~) to discuss it${Config.appealurl ? " or you can appeal:\n" + Config.appealurl : "."}\n\n` + + `If you feel that your lock was unjustified, you can still PM staff members (%, @, ~) to discuss it${ + Config.appealurl ? ` or you can appeal:\n${Config.appealurl}` : "." + }\n\n` + `Your lock will expire in a few days.` ); } diff --git a/server/replays.ts b/server/replays.ts index 63fca4f073..c8f36d70a7 100644 --- a/server/replays.ts +++ b/server/replays.ts @@ -3,13 +3,13 @@ * * Ported to TypeScript by Annika and Mia. */ -import {SQL, PGDatabase} from '../lib/database'; +import { SQL, PGDatabase } from '../lib/database'; import * as crypto from 'crypto'; export const replaysDB = Config.replaysdb ? new PGDatabase(Config.replaysdb) : null!; export const replays = replaysDB?.getTable< -ReplayRow + ReplayRow >('replays', 'id'); export const replayPlayers = replaysDB?.getTable<{ @@ -26,7 +26,6 @@ export const replayPlayers = replaysDB?.getTable<{ }>('replayplayers'); // must be a type and not an interface to qualify as an SQLRow -// eslint-disable-next-line export type ReplayRow = { id: string, format: string, @@ -132,14 +131,14 @@ export const Replays = new class { const replayData = await replays.get(id); if (!replayData) return null; - await replays.update(replayData.id, {views: SQL`views + 1`}); + await replays.update(replayData.id, { views: SQL`views + 1` }); return this.toReplay(replayData); } async edit(replay: Replay) { const replayData = this.toReplayRow(replay); - await replays.update(replay.id, {private: replayData.private, password: replayData.password}); + await replays.update(replay.id, { private: replayData.private, password: replayData.password }); } generatePassword(length = 31) { diff --git a/server/room-battle-bestof.ts b/server/room-battle-bestof.ts index 13a0bff99b..d852a724ec 100644 --- a/server/room-battle-bestof.ts +++ b/server/room-battle-bestof.ts @@ -1,18 +1,18 @@ -import {Utils} from '../lib'; -import {RoomGamePlayer, RoomGame} from "./room-game"; -import type {RoomBattlePlayerOptions, RoomBattleOptions} from './room-battle'; -import type {PrivacySetting, RoomSettings} from './rooms'; +import { Utils } from '../lib'; +import { RoomGamePlayer, RoomGame } from "./room-game"; +import type { RoomBattlePlayerOptions, RoomBattleOptions } from './room-battle'; +import type { PrivacySetting, RoomSettings } from './rooms'; const BEST_OF_IN_BETWEEN_TIME = 40; export class BestOfPlayer extends RoomGamePlayer { wins = 0; ready: boolean | null = null; - options: Omit & {user: null}; + options: Omit & { user: null }; dcAutoloseTime: number | null = null; constructor(user: User | null, game: BestOfGame, num: number, options: RoomBattlePlayerOptions) { super(user, game, num); - this.options = {...options, user: null}; + this.options = { ...options, user: null }; } avatar() { let avatar = Users.get(this.id)?.avatar; @@ -54,7 +54,8 @@ export class BestOfPlayer extends RoomGamePlayer { const button = `|c|~|/uhtml controls,

    Are you ready for game ${gameNum}, ${this.name}?

    ` + (this.ready ? ` – waiting for opponent...` : - ``) + + `` + ) + `

    `; this.sendRoom(button); battleRoom?.sendUser(user, button); @@ -68,17 +69,17 @@ export class BestOfGame extends RoomGame { bestOf: number; format: Format; winThreshold: number; - options: Omit & {parent: Room, players: null}; - forcedSettings: {modchat?: string | null, privacy?: string | null} = {}; + options: Omit & { parent: Room, players: null }; + forcedSettings: { modchat?: string | null, privacy?: string | null } = {}; ties = 0; - games: {room: GameRoom, winner: BestOfPlayer | null | undefined, rated: number}[] = []; + games: { room: GameRoom, winner: BestOfPlayer | null | undefined, rated: number }[] = []; playerNum = 0; /** null = tie, undefined = not ended */ winner: BestOfPlayer | null | undefined = undefined; /** when waiting between battles, this is the just-ended battle room, the one with the |tempnotify| */ waitingBattle: GameRoom | null = null; nextBattleTimerEnd: number | null = null; - nextBattleTimer: NodeJS.Timer | null = null; + nextBattleTimer: NodeJS.Timeout | null = null; /** Does NOT control bestof's own timer, which is always-on. Controls timers in sub-battles. */ needsTimer = false; score: number[] | null = null; @@ -329,7 +330,7 @@ export class BestOfGame extends RoomGame { buf += `
    `; @@ -163,7 +163,7 @@ export class YoutubeInterface { } get(id: string, username?: string): Promise { if (!(id in this.data.channels)) return this.getChannelData(id, username); - return Promise.resolve({...this.data.channels[id]}); + return Promise.resolve({ ...this.data.channels[id] }); } async getVideoData(id: string): Promise { const cached = videoDataCache.get(id); @@ -171,7 +171,7 @@ export class YoutubeInterface { let raw; try { raw = await Net(`${ROOT}videos`).get({ - query: {part: 'snippet,statistics', id, key: Config.youtubeKey}, + query: { part: 'snippet,statistics', id, key: Config.youtubeKey }, }); } catch (e: any) { throw new Chat.ErrorMessage(`Failed to retrieve video data: ${e.message}.`); @@ -321,11 +321,11 @@ export class YoutubeInterface { const id = this.getId(url); const data = await this.getVideoData(id); if (!data) throw new Chat.ErrorMessage(`Video not found.`); - videoInfo = Object.assign(data, {groupwatchType: 'youtube'}) as GroupwatchData; + videoInfo = Object.assign(data, { groupwatchType: 'youtube' }) as GroupwatchData; } else if (host === 'www.twitch.tv') { const data = await Twitch.getChannel(urlData.pathname.slice(1)); if (!data) throw new Chat.ErrorMessage(`Channel not found`); - videoInfo = Object.assign(data, {groupwatchType: 'twitch'}) as GroupwatchData; + videoInfo = Object.assign(data, { groupwatchType: 'twitch' }) as GroupwatchData; } else { throw new Chat.ErrorMessage(`Invalid URL: must be either a Youtube or Twitch link.`); } @@ -349,7 +349,7 @@ export const Twitch = new class { 'Content-Type': 'application/json', 'Accept': "application/vnd.twitchtv.v5+json", }, - query: {query: channel}, + query: { query: channel }, }); } catch (e: any) { throw new Chat.ErrorMessage(`Error retrieving twitch channel: ${e.message}`); @@ -377,7 +377,7 @@ export const Twitch = new class { } }; -type GroupwatchData = VideoData & {groupwatchType: 'youtube'} | TwitchChannel & {groupwatchType: 'twitch'}; +type GroupwatchData = VideoData & { groupwatchType: 'youtube' } | TwitchChannel & { groupwatchType: 'twitch' }; export class GroupWatch extends Rooms.SimpleRoomGame { override readonly gameid = 'groupwatch' as ID; url: string; @@ -664,7 +664,7 @@ export const commands: Chat.ChatCommands = { youtubehelp: [ `YouTube commands:`, `/randchannel [optional category]- View data of a random channel from the YouTube database.` + - ` If a category is given, the random channel will be in the given category.`, + ` If a category is given, the random channel will be in the given category.`, `/youtube addchannel [channel] - Add channel data to the YouTube database. Requires: % @ #`, `/youtube removechannel [channel]- Delete channel data from the YouTube database. Requires: % @ #`, `/youtube channel [channel] - View the data of a specified channel. Can be either channel ID or channel name.`, @@ -749,7 +749,7 @@ export const pages: Chat.PageTable = { async channels(args, user) { const [type] = args; if (!Config.youtubeKey) return `

    Youtube is not configured.

    `; - const titles: {[k: string]: string} = { + const titles: { [k: string]: string } = { all: 'All channels', categories: 'by category', }; @@ -763,7 +763,7 @@ export const pages: Chat.PageTable = { if (!YouTube.data.categories.length) { return this.errorReply(`There are currently no categories in the Youtube channel database.`); } - const sorted: {[k: string]: string[]} = {}; + const sorted: { [k: string]: string[] } = {}; const channels = YouTube.data.channels; for (const [id, channel] of Object.entries(channels)) { const category = channel.category || "No category"; @@ -784,7 +784,7 @@ export const pages: Chat.PageTable = { break; default: for (const id of Utils.shuffle(Object.keys(YouTube.data.channels))) { - const {name, username} = await YouTube.get(id); + const { name, username } = await YouTube.get(id); if (toID(type) !== 'all' && !username) continue; buffer += `
    ${name}`; buffer += ` (Channel ID: ${id})`; diff --git a/server/chat.ts b/server/chat.ts index a80e2cc99a..9bf6f92ad0 100644 --- a/server/chat.ts +++ b/server/chat.ts @@ -23,14 +23,14 @@ To reload chat commands: */ -import type {RoomPermission, GlobalPermission} from './user-groups'; -import type {Punishment} from './punishments'; -import type {PartialModlogEntry} from './modlog'; -import {FriendsDatabase, PM} from './friends'; -import {SQL, Repl, FS, Utils} from '../lib'; +import type { RoomPermission, GlobalPermission } from './user-groups'; +import type { Punishment } from './punishments'; +import type { PartialModlogEntry } from './modlog'; +import { FriendsDatabase, PM } from './friends'; +import { SQL, Repl, FS, Utils } from '../lib'; import * as Artemis from './artemis'; -import {Dex} from '../sim'; -import {PrivateMessages} from './private-messages'; +import { Dex } from '../sim'; +import { PrivateMessages } from './private-messages'; import * as pathModule from 'path'; import * as JSX from './chat-jsx'; @@ -67,7 +67,7 @@ export interface AnnotatedChatCommands { [k: string]: AnnotatedChatHandler | string | string[] | AnnotatedChatCommands; } -export type HandlerTable = {[key in keyof Handlers]?: Handlers[key]}; +export type HandlerTable = { [key in keyof Handlers]?: Handlers[key] }; interface Handlers { onRoomClose: (id: string, user: User, connection: Connection, page: boolean) => any; @@ -98,8 +98,8 @@ export interface ChatPlugin { roomSettings?: SettingsHandler | SettingsHandler[]; [k: string]: any; } - export type SettingsHandler = ( + room: Room, user: User, connection: Connection @@ -127,7 +127,7 @@ export type ChatFilter = (( connection: Connection, targetUser: User | null, originalMessage: string -) => string | false | null | undefined | void) & {priority?: number}; +) => string | false | null | undefined | void) & { priority?: number }; export type NameFilter = (name: string, user: User) => string; export type NicknameFilter = (name: string, user: User) => string | false; @@ -138,7 +138,7 @@ export type HostFilter = (host: string, user: User, connection: Connection, host export interface Translations { name?: string; - strings: {[english: string]: string}; + strings: { [english: string]: string }; } const LINK_WHITELIST = [ @@ -159,11 +159,11 @@ const BROADCAST_TOKEN = '!'; const PLUGIN_DATABASE_PATH = './databases/chat-plugins.db'; const MAX_PLUGIN_LOADING_DEPTH = 3; -import {formatText, linkRegex, stripFormatting} from './chat-formatter'; +import { formatText, linkRegex, stripFormatting } from './chat-formatter'; -// @ts-ignore no typedef available +// @ts-expect-error no typedef available import ProbeModule = require('probe-image-size'); -const probe: (url: string) => Promise<{width: number, height: number}> = ProbeModule; +const probe: (url: string) => Promise<{ width: number, height: number }> = ProbeModule; const EMOJI_REGEX = /[\p{Emoji_Modifier_Base}\p{Emoji_Presentation}\uFE0F]/u; @@ -296,41 +296,41 @@ export abstract class MessageContext { if (!targets[0].trim()) targets.pop(); if (targets.length > (atLeastOneTarget ? 1 : 0)) { - const {dex, format, isMatch} = this.extractFormat(targets[0].trim(), allowRules); + const { dex, format, isMatch } = this.extractFormat(targets[0].trim(), allowRules); if (isMatch) { targets.shift(); - return {dex, format, targets}; + return { dex, format, targets }; } } if (targets.length > 1) { - const {dex, format, isMatch} = this.extractFormat(targets[targets.length - 1].trim(), allowRules); + const { dex, format, isMatch } = this.extractFormat(targets[targets.length - 1].trim(), allowRules); if (isMatch) { targets.pop(); - return {dex, format, targets}; + return { dex, format, targets }; } } const room = (this as any as CommandContext).room; - const {dex, format} = this.extractFormat(room?.settings.defaultFormat || room?.battle?.format, allowRules); - return {dex, format, targets}; + const { dex, format } = this.extractFormat(room?.settings.defaultFormat || room?.battle?.format, allowRules); + return { dex, format, targets }; } - extractFormat(formatOrMod?: string, allowRules?: boolean): {dex: ModdedDex, format: Format | null, isMatch: boolean} { + extractFormat(formatOrMod?: string, allowRules?: boolean): { dex: ModdedDex, format: Format | null, isMatch: boolean } { if (!formatOrMod) { - return {dex: Dex.includeData(), format: null, isMatch: false}; + return { dex: Dex.includeData(), format: null, isMatch: false }; } const format = Dex.formats.get(formatOrMod); if (format.effectType === 'Format' || allowRules && format.effectType === 'Rule') { - return {dex: Dex.forFormat(format), format: format, isMatch: true}; + return { dex: Dex.forFormat(format), format, isMatch: true }; } if (toID(formatOrMod) in Dex.dexes) { - return {dex: Dex.mod(toID(formatOrMod)), format: null, isMatch: true}; + return { dex: Dex.mod(toID(formatOrMod)), format: null, isMatch: true }; } return this.extractFormat(); } - splitUser(target: string, {exactName}: {exactName?: boolean} = {}) { + splitUser(target: string, { exactName }: { exactName?: boolean } = {}) { const [inputUsername, rest] = this.splitOne(target).map(str => str.trim()); const targetUser = Users.get(inputUsername, exactName); @@ -341,8 +341,8 @@ export abstract class MessageContext { rest, }; } - requireUser(target: string, options: {allowOffline?: boolean, exactName?: boolean} = {}) { - const {targetUser, targetUsername, rest} = this.splitUser(target, options); + requireUser(target: string, options: { allowOffline?: boolean, exactName?: boolean } = {}) { + const { targetUser, targetUsername, rest } = this.splitUser(target, options); if (!targetUser) { throw new Chat.ErrorMessage(`The user "${targetUsername}" is offline or misspelled.`); @@ -353,9 +353,9 @@ export abstract class MessageContext { // `inputUsername` and `targetUsername` are never needed because we already handle the "user not found" error messages // just use `targetUser.name` where previously necessary - return {targetUser, rest}; + return { targetUser, rest }; } - getUserOrSelf(target: string, {exactName}: {exactName?: boolean} = {}) { + getUserOrSelf(target: string, { exactName }: { exactName?: boolean } = {}) { if (!target.trim()) return this.user; return Users.get(target, exactName); @@ -372,7 +372,7 @@ export class PageContext extends MessageContext { initialized: boolean; title: string; args: string[]; - constructor(options: {pageid: string, user: User, connection: Connection, language?: ID}) { + constructor(options: { pageid: string, user: User, connection: Connection, language?: ID }) { super(options.user, options.language); this.connection = options.connection; @@ -561,7 +561,7 @@ export class CommandContext extends MessageContext { // TODO: return should be void | boolean | Promise parse( msg?: string, - options: Partial<{isQuiet: boolean, broadcastPrefix: string, bypassRoomCheck: boolean}> = {} + options: Partial<{ isQuiet: boolean, broadcastPrefix: string, bypassRoomCheck: boolean }> = {} ): any { if (typeof msg === 'string') { // spawn subcontext @@ -614,8 +614,10 @@ export class CommandContext extends MessageContext { if (!(this.shouldBroadcast() && !/[a-z0-9]/.test(this.cmd.charAt(0)))) { this.commandDoesNotExist(); } - } else if (!VALID_COMMAND_TOKENS.includes(message.charAt(0)) && - VALID_COMMAND_TOKENS.includes(message.trim().charAt(0))) { + } else if ( + !VALID_COMMAND_TOKENS.includes(message.charAt(0)) && + VALID_COMMAND_TOKENS.includes(message.trim().charAt(0)) + ) { message = message.trim(); if (!message.startsWith(BROADCAST_TOKEN)) { message = message.charAt(0) + message; @@ -744,6 +746,7 @@ export class CommandContext extends MessageContext { throw new Chat.ErrorMessage(`Your username contains emojis, which this room doesn't allow.`); } // Removes extra spaces and null characters + // eslint-disable-next-line no-control-regex message = message.trim().replace(/[ \u0000\u200B-\u200F]+/g, ' '); if (room.settings.filterStretching && /(.+?)\1{7,}/i.test(message)) { @@ -772,7 +775,7 @@ export class CommandContext extends MessageContext { checkBanwords(room: BasicRoom | null | undefined, message: string): boolean { if (!room) return true; if (!room.banwordRegex) { - if (room.settings.banwords && room.settings.banwords.length) { + if (room.settings.banwords?.length) { room.banwordRegex = new RegExp('(?:\\b|(?!\\w))(?:' + room.settings.banwords.join('|') + ')(?:\\b|\\B(?!\\w))', 'i'); } else { room.banwordRegex = true; @@ -943,7 +946,7 @@ export class CommandContext extends MessageContext { action: string, user: string | User | null = null, note: string | null = null, - options: Partial<{noalts: any, noip: any}> = {} + options: Partial<{ noalts: any, noip: any }> = {} ) { const entry: PartialModlogEntry = { action, @@ -967,7 +970,7 @@ export class CommandContext extends MessageContext { (this.room || Rooms.global).modlog(entry); } parseSpoiler(reason: string) { - if (!reason) return {publicReason: "", privateReason: ""}; + if (!reason) return { publicReason: "", privateReason: "" }; let publicReason = reason; let privateReason = reason; @@ -979,7 +982,7 @@ export class CommandContext extends MessageContext { publicReason = reason.slice(0, proofIndex).trim(); privateReason = `${publicReason}${proof ? ` (PROOF: ${proof})` : ''}`; } - return {publicReason, privateReason}; + return { publicReason, privateReason }; } roomlog(data: string) { if (this.room) this.room.roomlog(data); @@ -1105,7 +1108,6 @@ export class CommandContext extends MessageContext { return true; } /* The sucrase transformation of optional chaining is too expensive to be used in a hot function like this. */ - /* eslint-disable @typescript-eslint/prefer-optional-chain */ checkChat(message: string, room?: Room | null, targetUser?: User | null): string; checkChat(message?: null, room?: Room | null, targetUser?: User | null): void; checkChat(message: string | null = null, room: Room | null = null, targetUser: User | null = null) { @@ -1115,7 +1117,6 @@ export class CommandContext extends MessageContext { if (targetUser) { room = null; } else if (!room) { - // @ts-ignore excludes GlobalRoom above room = this.room; } const user = this.user; @@ -1295,11 +1296,12 @@ export class CommandContext extends MessageContext { throw new Chat.ErrorMessage("You do not have permission to use PM HTML to users who are not in this room."); } const friends = targetUser.friends || new Set(); - if (targetUser.settings.blockPMs && + if ( + targetUser.settings.blockPMs && (targetUser.settings.blockPMs === true || - (targetUser.settings.blockPMs === 'friends' && !friends.has(this.user.id)) || - !Users.globalAuth.atLeast(this.user, targetUser.settings.blockPMs as AuthLevel)) && - !this.user.can('lock') + (targetUser.settings.blockPMs === 'friends' && !friends.has(this.user.id)) || + !Users.globalAuth.atLeast(this.user, targetUser.settings.blockPMs as AuthLevel)) && + !this.user.can('lock') ) { Chat.maybeNotifyBlocked('pm', targetUser, this.user); throw new Chat.ErrorMessage("This user is currently blocking PMs."); @@ -1312,7 +1314,6 @@ export class CommandContext extends MessageContext { checkBannedLinks(message: string) { // RegExp#exec only returns one match, String#match returns all of them - // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec return (message.match(Chat.linkRegex) || []).filter(link => { link = link.toLowerCase(); const domainMatches = /^(?:http:\/\/|https:\/\/)?(?:[^/]*\.)?([^/.]*\.[^/.]*)\.?($|\/|:)/.exec(link); @@ -1324,7 +1325,6 @@ export class CommandContext extends MessageContext { return !(LINK_WHITELIST.includes(host) || LINK_WHITELIST.includes(`*.${domain}`)); }); } - /* eslint-enable @typescript-eslint/prefer-optional-chain */ checkEmbedURI(uri: string) { if (uri.startsWith('https://')) return uri; if (uri.startsWith('//')) return uri; @@ -1465,7 +1465,6 @@ export class CommandContext extends MessageContext { } return this.room; } - // eslint-disable-next-line @typescript-eslint/type-annotation-spacing requireGame(constructor: new (...args: any[]) => T, subGame = false) { const room = this.requireRoom(); if (subGame) { @@ -1554,12 +1553,12 @@ export const Chat = new class { basePages!: PageTable; pages!: PageTable; readonly destroyHandlers: (() => void)[] = [Artemis.destroy]; - readonly crqHandlers: {[k: string]: CRQHandler} = {}; - readonly handlers: {[k: string]: ((...args: any) => any)[]} = Object.create(null); + readonly crqHandlers: { [k: string]: CRQHandler } = {}; + readonly handlers: { [k: string]: ((...args: any) => any)[] } = Object.create(null); /** The key is the name of the plugin. */ - readonly plugins: {[k: string]: ChatPlugin} = {}; + readonly plugins: { [k: string]: ChatPlugin } = {}; /** Will be empty except during hotpatch */ - oldPlugins: {[k: string]: ChatPlugin} = {}; + oldPlugins: { [k: string]: ChatPlugin } = {}; roomSettings: SettingsHandler[] = []; /********************************************************* @@ -1766,7 +1765,7 @@ export const Chat = new class { throw new Error(`Trying to translate to a nonexistent language: ${language}`); } if (!strings.length) { - return ((fStrings: TemplateStringsArray | string, ...fKeys: any) => Chat.tr(language, fStrings, ...fKeys)); + return (fStrings: TemplateStringsArray | string, ...fKeys: any) => Chat.tr(language, fStrings, ...fKeys); } const entry = Chat.translations.get(language)?.get(trString); @@ -1803,7 +1802,7 @@ export const Chat = new class { * Chat.databaseReadyPromise will be truthy if the database is not yet ready. */ database = SQL(module, { - file: ('Config' in global && Config.nofswriting) ? ':memory:' : PLUGIN_DATABASE_PATH, + file: global.Config?.nofswriting ? ':memory:' : PLUGIN_DATABASE_PATH, processes: global.Config?.chatdbprocesses, }); databaseReadyPromise: Promise | null = null; @@ -1815,7 +1814,7 @@ export const Chat = new class { if (process.send) return; // We don't need a database in a subprocess that requires Chat. if (!Config.usesqlite) return; // check if we have the db_info table, which will always be present unless the schema needs to be initialized - const {hasDBInfo} = await this.database.get( + const { hasDBInfo } = await this.database.get( `SELECT count(*) AS hasDBInfo FROM sqlite_master WHERE type = 'table' AND name = 'db_info'` ); if (!hasDBInfo) await this.database.runFile('./databases/schemas/chat-plugins.sql'); @@ -1833,12 +1832,12 @@ export const Chat = new class { const migrationVersion = parseInt(/v(\d+)\.sql$/.exec(migrationFile)?.[1] || ''); if (!migrationVersion) continue; if (migrationVersion > curVersion) { - migrationsToRun.push({version: migrationVersion, file: migrationFile}); + migrationsToRun.push({ version: migrationVersion, file: migrationFile }); Monitor.adminlog(`Pushing to migrationsToRun: ${migrationVersion} at ${migrationFile} - mainModule ${process.mainModule === module} !process.send ${!process.send}`); } } - Utils.sortBy(migrationsToRun, ({version}) => version); - for (const {file} of migrationsToRun) { + Utils.sortBy(migrationsToRun, ({ version }) => version); + for (const { file } of migrationsToRun) { await this.database.runFile(pathModule.resolve(migrationsFolder, file)); } @@ -1891,7 +1890,7 @@ export const Chat = new class { Chat.loadPlugins(); const initialRoomlogLength = room?.log.getLineCount(); - const context = new CommandContext({message, room, user, connection}); + const context = new CommandContext({ message, room, user, connection }); const start = Date.now(); const result = context.parse(); if (typeof result?.then === 'function') { @@ -2000,7 +1999,7 @@ export const Chat = new class { loadPlugin(plugin: AnyObject, name: string) { // esbuild builds cjs exports in such a way that they use getters, leading to crashes // in the plugin.roomSettings = [plugin.roomSettings] action. So, we have to make them not getters - plugin = {...plugin}; + plugin = { ...plugin }; if (plugin.commands) { Object.assign(Chat.commands, this.annotateCommands(plugin.commands)); } @@ -2041,7 +2040,7 @@ export const Chat = new class { } Chat.plugins[name] = plugin; } - loadPlugins(oldPlugins?: {[k: string]: ChatPlugin}) { + loadPlugins(oldPlugins?: { [k: string]: ChatPlugin }) { if (Chat.commands) return; if (oldPlugins) Chat.oldPlugins = oldPlugins; @@ -2051,7 +2050,6 @@ export const Chat = new class { // Install plug-in commands and chat filters - Chat.commands = Object.create(null); Chat.pages = Object.create(null); this.loadPluginDirectory('dist/server/chat-commands'); @@ -2172,8 +2170,10 @@ export const Chat = new class { return this.parseCommand(`/promote ${target}, ${g}`, true); } else if (fullCmd === 'global' + groupid) { return this.parseCommand(`/globalpromote ${target}, ${g}`, true); - } else if (fullCmd === 'de' + groupid || fullCmd === 'un' + groupid || - fullCmd === 'globalde' + groupid || fullCmd === 'deglobal' + groupid) { + } else if ( + fullCmd === 'de' + groupid || fullCmd === 'un' + groupid || + fullCmd === 'globalde' + groupid || fullCmd === 'deglobal' + groupid + ) { return this.parseCommand(`/demote ${target}`, true); } else if (fullCmd === 'room' + groupid) { return this.parseCommand(`/roompromote ${target}, ${g}`, true); @@ -2186,10 +2186,10 @@ export const Chat = new class { } return { - cmd: cmd, - cmdToken: cmdToken, - target: target, - fullCmd: fullCmd, + cmd, + cmdToken, + target, + fullCmd, handler: commandHandler as AnnotatedChatHandler | null, }; } @@ -2226,7 +2226,6 @@ export const Chat = new class { throw new Chat.ErrorMessage(`Your regex was rejected because it included an unterminated |.`); } try { - // eslint-disable-next-line no-new new RegExp(word); } catch (e: any) { throw new Chat.ErrorMessage( @@ -2287,7 +2286,7 @@ export const Chat = new class { * * options.human = true will reports hours human-readable */ - toTimestamp(date: Date, options: {human?: boolean} = {}) { + toTimestamp(date: Date, options: { human?: boolean } = {}) { const human = options.human; let parts: any[] = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), @@ -2307,7 +2306,7 @@ export const Chat = new class { * options.hhmmss = true will instead report the duration in 00:00:00 format * */ - toDurationString(val: number, options: {hhmmss?: boolean, precision?: number} = {}) { + toDurationString(val: number, options: { hhmmss?: boolean, precision?: number } = {}) { // TODO: replace by Intl.DurationFormat or equivalent when it becomes available (ECMA-402) // https://github.com/tc39/ecma402/issues/47 const date = new Date(+val); @@ -2322,7 +2321,7 @@ export const Chat = new class { const positiveIndex = parts.findIndex(elem => elem > 0); let precision = (options?.precision ? options.precision : 3); if (options?.hhmmss) { - const str = parts.slice(positiveIndex).map(value => value < 10 ? "0" + value : "" + value).join(":"); + const str = parts.slice(positiveIndex).map(value => `${value}`.padStart(2, '0')).join(":"); return str.length === 2 ? "00:" + str : str; } @@ -2417,7 +2416,7 @@ export const Chat = new class { getDataPokemonHTML(species: Species, gen = 8, tier = '') { let buf = '
  • '; - buf += '' + (tier || species.tier) + ' '; + buf += `${tier || species.tier} `; buf += ` `; buf += `${species.name} `; buf += ''; @@ -2430,34 +2429,34 @@ export const Chat = new class { if (gen >= 3) { buf += ''; if (species.abilities['1'] && (gen >= 4 || Dex.abilities.get(species.abilities['1']).gen === 3)) { - buf += '' + species.abilities['0'] + '
    ' + species.abilities['1'] + '
    '; + buf += `${species.abilities['0']}
    ${species.abilities['1']}
    `; } else { - buf += '' + species.abilities['0'] + ''; + buf += `${species.abilities['0']}`; } if (species.abilities['H'] && species.abilities['S']) { - buf += '' + species.abilities['H'] + '
    (' + species.abilities['S'] + ')
    '; + buf += `${species.abilities['H']}
    (${species.abilities['S']})
    `; } else if (species.abilities['H']) { - buf += '' + species.abilities['H'] + ''; + buf += `${species.abilities['H']}`; } else if (species.abilities['S']) { // special case for Zygarde - buf += '(' + species.abilities['S'] + ')'; + buf += `(${species.abilities['S']})`; } else { buf += ''; } buf += '
    '; } buf += ''; - buf += 'HP
    ' + species.baseStats.hp + '
    '; - buf += 'Atk
    ' + species.baseStats.atk + '
    '; - buf += 'Def
    ' + species.baseStats.def + '
    '; + buf += `HP
    ${species.baseStats.hp}
    `; + buf += `Atk
    ${species.baseStats.atk}
    `; + buf += `Def
    ${species.baseStats.def}
    `; if (gen <= 1) { - buf += 'Spc
    ' + species.baseStats.spa + '
    '; + buf += `Spc
    ${species.baseStats.spa}
    `; } else { - buf += 'SpA
    ' + species.baseStats.spa + '
    '; - buf += 'SpD
    ' + species.baseStats.spd + '
    '; + buf += `SpA
    ${species.baseStats.spa}
    `; + buf += `SpD
    ${species.baseStats.spd}
    `; } - buf += 'Spe
    ' + species.baseStats.spe + '
    '; - buf += 'BST
    ' + species.bst + '
    '; + buf += `Spe
    ${species.baseStats.spe}
    `; + buf += `BST
    ${species.bst}
    `; buf += '
    '; buf += '
  • '; return `
      ${buf}
    `; @@ -2472,7 +2471,7 @@ export const Chat = new class { if (move.basePower) { buf += `Power
    ${typeof move.basePower === 'number' ? move.basePower : '—'}
    `; } - buf += `Accuracy
    ${typeof move.accuracy === 'number' ? (move.accuracy + '%') : '—'}
    `; + buf += `Accuracy
    ${typeof move.accuracy === 'number' ? (`${move.accuracy}%`) : '—'}
    `; const basePP = move.pp || 1; const pp = Math.floor(move.noPPBoosts ? basePP : basePP * 8 / 5); buf += `PP
    ${pp}
    `; @@ -2498,14 +2497,14 @@ export const Chat = new class { /** * Gets the dimension of the image at url. Returns 0x0 if the image isn't found, as well as the relevant error. */ - getImageDimensions(url: string): Promise<{height: number, width: number}> { + getImageDimensions(url: string): Promise<{ height: number, width: number }> { return probe(url); } parseArguments( str: string, delim = ',', - opts: Partial<{paramDelim: string, useIDs: boolean, allowEmpty: boolean}> = {useIDs: true} + opts: Partial<{ paramDelim: string, useIDs: boolean, allowEmpty: boolean }> = { useIDs: true } ) { const result: Record = {}; for (const part of str.split(delim)) { @@ -2542,7 +2541,7 @@ export const Chat = new class { * @return [width, height, resized] */ async fitImage(url: string, maxHeight = 300, maxWidth = 300): Promise<[number, number, boolean]> { - const {height, width} = await Chat.getImageDimensions(url); + const { height, width } = await Chat.getImageDimensions(url); if (width <= maxWidth && height <= maxHeight) return [width, height, false]; @@ -2613,8 +2612,8 @@ export const Chat = new class { return this.linkRegex.test(possibleUrl); } - readonly filterWords: {[k: string]: FilterWord[]} = {}; - readonly monitors: {[k: string]: Monitor} = {}; + readonly filterWords: { [k: string]: FilterWord[] } = {}; + readonly monitors: { [k: string]: Monitor } = {}; registerMonitor(id: string, entry: Monitor) { if (!Chat.filterWords[id]) Chat.filterWords[id] = []; @@ -2622,7 +2621,7 @@ export const Chat = new class { } resolvePage(pageid: string, user: User, connection: Connection) { - return (new PageContext({pageid, user, connection, language: user.language!})).resolve(); + return (new PageContext({ pageid, user, connection, language: user.language! })).resolve(); } }; @@ -2646,7 +2645,7 @@ export const Chat = new class { return user; }; (CommandContext.prototype as any).splitTarget = function (this: any, target: string, exactName: boolean) { - const {targetUser, inputUsername, targetUsername, rest} = this.splitUser(target, exactName); + const { targetUser, inputUsername, targetUsername, rest } = this.splitUser(target, exactName); this.targetUser = targetUser; this.inputUsername = inputUsername; this.targetUsername = targetUsername; @@ -2694,7 +2693,7 @@ if (!process.send) { const repr = JSON.stringify([error.name, error.message, source, details]); process.send!(`THROW\n@!!@${repr}\n${error.stack}`); }, - }; + } as any; process.on('uncaughtException', err => { Monitor.crashlog(err, 'A chat database process'); }); diff --git a/server/config-loader.ts b/server/config-loader.ts index 13f02ca19b..79ca04fab2 100644 --- a/server/config-loader.ts +++ b/server/config-loader.ts @@ -6,13 +6,13 @@ */ import * as defaults from '../config/config-example'; -import type {GroupInfo, EffectiveGroupSymbol} from './user-groups'; -import {ProcessManager, FS} from '../lib'; +import type { GroupInfo, EffectiveGroupSymbol } from './user-groups'; +import { ProcessManager, FS } from '../lib'; export type ConfigType = typeof defaults & { - groups: {[symbol: string]: GroupInfo}, + groups: { [symbol: string]: GroupInfo }, groupsranking: EffectiveGroupSymbol[], - greatergroupscache: {[combo: string]: GroupSymbol}, + greatergroupscache: { [combo: string]: GroupSymbol }, [k: string]: any, }; /** Map */ @@ -24,9 +24,9 @@ const CONFIG_PATH = FS('./config/config.js').path; export function load(invalidate = false) { if (invalidate) delete require.cache[CONFIG_PATH]; - const config = ({...defaults, ...require(CONFIG_PATH)}) as ConfigType; + const config = ({ ...defaults, ...require(CONFIG_PATH) }) as ConfigType; // config.routes is nested - we need to ensure values are set for its keys as well. - config.routes = {...defaults.routes, ...config.routes}; + config.routes = { ...defaults.routes, ...config.routes }; // Automatically stop startup if better-sqlite3 isn't installed and SQLite is enabled if (config.usesqlite) { @@ -65,7 +65,7 @@ export function cacheGroupData(config: ConfigType) { const groups = config.groups; const punishgroups = config.punishgroups; - const cachedGroups: {[k: string]: 'processing' | true} = {}; + const cachedGroups: { [k: string]: 'processing' | true } = {}; function isPermission(key: string) { return !['symbol', 'id', 'name', 'rank', 'globalGroupInPersonalRoom'].includes(key); @@ -147,8 +147,8 @@ export function checkRipgrepAvailability() { const cwd = FS.ROOT_PATH; Config.ripgrepmodlog = (async () => { try { - await ProcessManager.exec(['rg', '--version'], {cwd}); - await ProcessManager.exec(['tac', '--version'], {cwd}); + await ProcessManager.exec(['rg', '--version'], { cwd }); + await ProcessManager.exec(['tac', '--version'], { cwd }); return true; } catch { return false; @@ -158,12 +158,10 @@ export function checkRipgrepAvailability() { return Config.ripgrepmodlog; } - function reportError(msg: string) { // This module generally loads before Monitor, so we put this in a setImmediate to wait for it to load. // Most child processes don't have Monitor.error, but the main process should always have them, and Config // errors should always be the same across processes, so this is a neat way to avoid unnecessary logging. - // @ts-ignore typescript doesn't like us accessing Monitor like this setImmediate(() => global.Monitor?.error?.(msg)); } export const Config = load(); diff --git a/server/friends.ts b/server/friends.ts index 57fd255833..f1be0817b7 100644 --- a/server/friends.ts +++ b/server/friends.ts @@ -2,10 +2,11 @@ * Friends chat-plugin database handler. * @author mia-pi-git */ +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore in case it isn't installed import type * as Database from 'better-sqlite3'; -import {Utils, FS, ProcessManager, Repl} from '../lib'; -import {Config} from './config-loader'; +import { Utils, FS, ProcessManager, Repl } from '../lib'; +import { Config } from './config-loader'; import * as path from 'path'; /** Max friends per user */ @@ -65,7 +66,7 @@ export function sendPM(message: string, to: string, from = '~') { } function canPM(sender: User, receiver: User | null) { - if (!receiver || !receiver.settings.blockPMs) return true; + if (!receiver?.settings.blockPMs) return true; if (receiver.settings.blockPMs === true) return sender.can('lock'); if (receiver.settings.blockPMs === 'friends') return false; return Users.globalAuth.atLeast(sender, receiver.settings.blockPMs); @@ -125,44 +126,44 @@ export class FriendsDatabase { } statements.expire.run(); - return {database, statements}; + return { database, statements }; } async getFriends(userid: ID): Promise { return (await this.all('get', [userid, MAX_FRIENDS])) || []; } async getRequests(user: User) { - const sent: Set = new Set(); - const received: Set = new Set(); + const sent = new Set(); + const received = new Set(); if (user.settings.blockFriendRequests) { // delete any pending requests that may have been sent to them while offline // we used to return but we will not since you can send requests while blocking await this.run('deleteReceivedRequests', [user.id]); } const sentResults = await this.all('getSent', [user.id]); - if (sentResults === null) return {sent, received}; + if (sentResults === null) return { sent, received }; for (const request of sentResults) { sent.add(request.receiver); } const receivedResults = await this.all('getReceived', [user.id]) || []; if (!receivedResults) { - return {received, sent}; + return { received, sent }; } for (const request of receivedResults) { received.add(request.sender); } - return {sent, received}; + return { sent, received }; } all(statement: string, data: any[] | AnyObject): Promise { - return this.query({type: 'all', data, statement}); + return this.query({ type: 'all', data, statement }); } - transaction(statement: string, data: any[] | AnyObject): Promise<{result: any} | null> { - return this.query({data, statement, type: 'transaction'}); + transaction(statement: string, data: any[] | AnyObject): Promise<{ result: any } | null> { + return this.query({ data, statement, type: 'transaction' }); } - run(statement: string, data: any[] | AnyObject): Promise<{changes: number, lastInsertRowid: number}> { - return this.query({statement, data, type: 'run'}); + run(statement: string, data: any[] | AnyObject): Promise<{ changes: number, lastInsertRowid: number }> { + return this.query({ statement, data, type: 'run' }); } get(statement: string, data: any[] | AnyObject): Promise { - return this.query({statement, data, type: 'get'}); + return this.query({ statement, data, type: 'get' }); } private async query(input: DatabaseRequest) { const process = PM.acquire(); @@ -226,7 +227,7 @@ export class FriendsDatabase { async removeFriend(userid: ID, friendID: ID) { if (!friendID || !userid) throw new Chat.ErrorMessage(`Invalid usernames supplied.`); - const result = await this.run('delete', {user1: userid, user2: friendID}); + const result = await this.run('delete', { user1: userid, user2: friendID }); if (result.changes < 1) { throw new Chat.ErrorMessage(`You do not have ${friendID} friended.`); } @@ -255,12 +256,12 @@ export class FriendsDatabase { async findFriendship(user1: string, user2: string): Promise { user1 = toID(user1); user2 = toID(user2); - return !!(await this.get('findFriendship', {user1, user2}))?.length; + return !!(await this.get('findFriendship', { user1, user2 }))?.length; } } -const statements: {[k: string]: Database.Statement} = {}; -const transactions: {[k: string]: Database.Transaction} = {}; +const statements: { [k: string]: Database.Statement } = {}; +const transactions: { [k: string]: Database.Transaction } = {}; const ACTIONS = { add: ( @@ -305,26 +306,26 @@ const ACTIONS = { ), }; -const FUNCTIONS: {[k: string]: (...input: any[]) => any} = { +const FUNCTIONS: { [k: string]: (...input: any[]) => any } = { 'should_expire': (sentTime: number) => { if (Date.now() - sentTime > REQUEST_EXPIRY_TIME) return 1; return 0; }, }; -const TRANSACTIONS: {[k: string]: (input: any[]) => DatabaseResult} = { +const TRANSACTIONS: { [k: string]: (input: any[]) => DatabaseResult } = { send: requests => { for (const request of requests) { const [senderID, receiverID] = request; const hasSentRequest = ( - statements.findRequest.get({user1: senderID, user2: receiverID}) as AnyObject + statements.findRequest.get({ user1: senderID, user2: receiverID }) as AnyObject )['num']; const friends = (statements.countFriends.get(senderID, senderID) as AnyObject)['num']; const totalRequests = (statements.countRequests.get(senderID, senderID) as AnyObject)['num']; if (friends >= MAX_FRIENDS) { throw new FailureMessage(`You are at the maximum number of friends.`); } - const existingFriendship = statements.findFriendship.all({user1: senderID, user2: receiverID}); + const existingFriendship = statements.findFriendship.all({ user1: senderID, user2: receiverID }); if (existingFriendship.length) { throw new FailureMessage(`You are already friends with '${receiverID}'.`); } @@ -338,14 +339,14 @@ const TRANSACTIONS: {[k: string]: (input: any[]) => DatabaseResult} = { } statements.insertRequest.run(senderID, receiverID, Date.now()); } - return {result: []}; + return { result: [] }; }, add: requests => { for (const request of requests) { const [senderID, receiverID] = request; - statements.add.run({user1: senderID, user2: receiverID}); + statements.add.run({ user1: senderID, user2: receiverID }); } - return {result: []}; + return { result: [] }; }, accept: requests => { for (const request of requests) { @@ -354,20 +355,20 @@ const TRANSACTIONS: {[k: string]: (input: any[]) => DatabaseResult} = { if (friends?.length >= MAX_FRIENDS) { throw new FailureMessage(`You are at the maximum number of friends.`); } - const {result} = TRANSACTIONS.removeRequest([request]); + const { result } = TRANSACTIONS.removeRequest([request]); if (!result.length) throw new FailureMessage(`You have no request pending from ${senderID}.`); TRANSACTIONS.add([request]); } - return {result: []}; + return { result: [] }; }, removeRequest: requests => { const result = []; for (const request of requests) { const [to, from] = request; - const {changes} = statements.deleteRequest.run(to, from); + const { changes } = statements.deleteRequest.run(to, from); if (changes) result.push(changes); } - return {result}; + return { result }; }, }; @@ -376,10 +377,10 @@ const TRANSACTIONS: {[k: string]: (input: any[]) => DatabaseResult} = { * todo: should these be under a namespace? */ -/** Find if a friendship exists between two users.*/ +/** Find if a friendship exists between two users. */ export function findFriendship(users: [string, string]) { setup(); - return !!statements.findFriendship.get({user1: users[0], user2: users[1]}); + return !!statements.findFriendship.get({ user1: users[0], user2: users[1] }); } // internal for child process api - ensures statements are only set up @@ -390,7 +391,7 @@ const setup = () => { /** Process manager for main process use. */ export const PM = new ProcessManager.QueryProcessManager(module, query => { - const {type, statement, data} = query; + const { type, statement, data } = query; const start = Date.now(); const result: DatabaseResult = {}; try { @@ -443,7 +444,7 @@ if (require.main === module) { slow(message: string) { process.send!(`CALLBACK\nSLOW\n${message}`); }, - }; + } as any; process.on('uncaughtException', err => { if (Config.crashguard) { Monitor.crashlog(err, 'A friends child process'); diff --git a/server/global-types.ts b/server/global-types.ts index d03b456802..c42689a27d 100644 --- a/server/global-types.ts +++ b/server/global-types.ts @@ -7,7 +7,7 @@ type AuthLevel = import('./user-groups').AuthLevel; type PunishType = '#hostfilter' | '#dnsbl' | '#ipban'; // Chat -namespace Chat { +declare namespace Chat { export type CommandContext = import('./chat').CommandContext; export type PageContext = import('./chat').PageContext; export type SettingsHandler = import('./chat').SettingsHandler; @@ -37,8 +37,8 @@ type RoomGame = Rooms.RoomGame; type MinorActivity = Rooms.MinorActivity; type RoomBattle = Rooms.RoomBattle; type Room = Rooms.Room; -type RoomID = "" | "lobby" | "staff" | "upperstaff" | "development" | Lowercase & {__isRoomID: true}; -namespace Rooms { +type RoomID = "" | "lobby" | "staff" | "upperstaff" | "development" | Lowercase & { __isRoomID: true }; +declare namespace Rooms { export type GlobalRoomState = import('./rooms').GlobalRoomState; export type ChatRoom = import('./rooms').ChatRoom; export type GameRoom = import('./rooms').GameRoom; @@ -54,19 +54,19 @@ namespace Rooms { export type Room = import('./rooms').Room; } -namespace JSX { +declare namespace JSX { export type IntrinsicElements = import('./chat-jsx').PSElements; } // Users type User = Users.User; type Connection = Users.Connection; -namespace Users { +declare namespace Users { export type User = import('./users').User; export type Connection = import('./users').Connection; } -namespace Ladders { +declare namespace Ladders { export type Challenge = import('./ladders-challenges').Challenge; export type BattleChallenge = import('./ladders-challenges').BattleChallenge; export type GameChallenge = import('./ladders-challenges').GameChallenge; diff --git a/server/global-variables.d.ts b/server/global-variables.d.ts index a9ae719588..9c8665bfc7 100644 --- a/server/global-variables.d.ts +++ b/server/global-variables.d.ts @@ -40,20 +40,20 @@ declare global { __version: {head: string, origin?: string, tree?: string}; } } - const Config: ConfigType; - const Chat: typeof ChatType.Chat; - const Dex: typeof DexType; - const Teams: typeof TeamsType; - const IPTools: typeof IPToolsType; - const Ladders: typeof LaddersType; - const LoginServer: typeof LoginServerType; - const Monitor: typeof MonitorType; - const Punishments: typeof PunishmentsType; - const Rooms: typeof RoomsType.Rooms; - const Sockets: typeof SocketsType.Sockets; - const TeamValidatorAsync: typeof TeamValidatorAsyncType; - const Tournaments: typeof TournamentsType; - const Users: typeof UsersType.Users; - const Verifier: typeof VerifierType; - const toID: typeof DexType.toID; + var Config: ConfigType; + var Chat: typeof ChatType.Chat; + var Dex: typeof DexType; + var Teams: typeof TeamsType; + var IPTools: typeof IPToolsType; + var Ladders: typeof LaddersType; + var LoginServer: typeof LoginServerType; + var Monitor: typeof MonitorType; + var Punishments: typeof PunishmentsType; + var Rooms: typeof RoomsType.Rooms; + var Sockets: typeof SocketsType.Sockets; + var TeamValidatorAsync: typeof TeamValidatorAsyncType; + var Tournaments: typeof TournamentsType; + var Users: typeof UsersType.Users; + var Verifier: typeof VerifierType; + var toID: typeof DexType.toID; } diff --git a/server/index.ts b/server/index.ts index a0f29c9ef4..664c4dfcd8 100644 --- a/server/index.ts +++ b/server/index.ts @@ -46,15 +46,15 @@ require('source-map-support').install(); // NOTE: This file intentionally doesn't use too many modern JavaScript // features, so that it doesn't crash old versions of Node.js, so we -// can successfully print the "We require Node.js 16+" message. +// can successfully print the "We require Node.js 18+" message. // Check for version const nodeVersion = parseInt(process.versions.node); -if (isNaN(nodeVersion) || nodeVersion < 16) { - throw new Error("We require Node.js version 16 or later; you're using " + process.version); +if (isNaN(nodeVersion) || nodeVersion < 18) { + throw new Error("We require Node.js version 18 or later; you're using " + process.version); } -import {FS, Repl} from '../lib'; +import { FS, Repl } from '../lib'; /********************************************************* * Set up most of our globals @@ -65,9 +65,9 @@ function setupGlobals() { const ConfigLoader = require('./config-loader'); global.Config = ConfigLoader.Config; - const {Monitor} = require('./monitor'); + const { Monitor } = require('./monitor'); global.Monitor = Monitor; - global.__version = {head: ''}; + global.__version = { head: '' }; void Monitor.version().then((hash: any) => { global.__version.tree = hash; }); @@ -87,29 +87,29 @@ function setupGlobals() { }); } - const {Dex} = require('../sim/dex'); + const { Dex } = require('../sim/dex'); global.Dex = Dex; global.toID = Dex.toID; - const {Teams} = require('../sim/teams'); + const { Teams } = require('../sim/teams'); global.Teams = Teams; - const {LoginServer} = require('./loginserver'); + const { LoginServer } = require('./loginserver'); global.LoginServer = LoginServer; - const {Ladders} = require('./ladders'); + const { Ladders } = require('./ladders'); global.Ladders = Ladders; - const {Chat} = require('./chat'); + const { Chat } = require('./chat'); global.Chat = Chat; - const {Users} = require('./users'); + const { Users } = require('./users'); global.Users = Users; - const {Punishments} = require('./punishments'); + const { Punishments } = require('./punishments'); global.Punishments = Punishments; - const {Rooms} = require('./rooms'); + const { Rooms } = require('./rooms'); global.Rooms = Rooms; // We initialize the global room here because roomlogs.ts needs the Rooms global Rooms.global = new Rooms.GlobalRoomState(); @@ -118,10 +118,10 @@ function setupGlobals() { global.Verifier = Verifier; Verifier.PM.spawn(); - const {Tournaments} = require('./tournaments'); + const { Tournaments } = require('./tournaments'); global.Tournaments = Tournaments; - const {IPTools} = require('./ip-tools'); + const { IPTools } = require('./ip-tools'); global.IPTools = IPTools; void IPTools.loadHostsAndRanges(); } @@ -142,7 +142,7 @@ if (Config.crashguard) { * Start networking processes to be connected to *********************************************************/ -import {Sockets} from './sockets'; +import { Sockets } from './sockets'; global.Sockets = Sockets; export function listen(port: number, bindAddress: string, workerCount: number) { diff --git a/server/ip-tools.ts b/server/ip-tools.ts index 1eb0bdfb6a..dc5fddc181 100644 --- a/server/ip-tools.ts +++ b/server/ip-tools.ts @@ -19,7 +19,7 @@ const HOSTS_FILE = 'config/hosts.csv'; const PROXIES_FILE = 'config/proxies.csv'; import * as dns from 'dns'; -import {FS, Net, Utils} from '../lib'; +import { FS, Net, Utils } from '../lib'; export interface AddressRange { minIP: number; @@ -55,7 +55,7 @@ export const IPTools = new class { ]); const shortHost = this.shortenHost(host); const hostType = this.getHostType(shortHost, ip); - return {dnsbl, host, shortHost, hostType}; + return { dnsbl, host, shortHost, hostType }; } queryDnsblLoop(ip: string, callback: (val: string | null) => void, reversedIpDot: string, index: number) { @@ -143,7 +143,7 @@ export const IPTools = new class { if (index <= 0) { const ip = IPTools.ipToNumber(cidr); if (ip === null) return null; - return {minIP: ip, maxIP: ip}; + return { minIP: ip, maxIP: ip }; } const low = IPTools.ipToNumber(cidr.slice(0, index)); const bits = Utils.parseExactInt(cidr.slice(index + 1)); @@ -151,13 +151,13 @@ export const IPTools = new class { // does << with signed int32s. if (low === null || !bits || bits < 2 || bits > 32) return null; const high = low + (1 << (32 - bits)) - 1; - return {minIP: low, maxIP: high}; + return { minIP: low, maxIP: high }; } /** Is this an IP range supported by `stringToRange`? Note that exact IPs are also valid IP ranges. */ isValidRange(range: string): boolean { return IPTools.stringToRange(range) !== null; } - stringToRange(range: string | null): AddressRange | null { + stringToRange(this: void, range: string | null): AddressRange | null { if (!range) return null; if (range.endsWith('*')) { const parts = range.replace('.*', '').split('.'); @@ -166,7 +166,7 @@ export const IPTools = new class { const minIP = IPTools.ipToNumber(`${a || '0'}.${b || '0'}.${c || '0'}.0`); const maxIP = IPTools.ipToNumber(`${a || '255'}.${b || '255'}.${c || '255'}.255`); if (minIP === null || maxIP === null) return null; - return {minIP, maxIP}; + return { minIP, maxIP }; } const index = range.indexOf('-'); if (index <= 0) { @@ -174,13 +174,13 @@ export const IPTools = new class { const ip = IPTools.ipToNumber(range); if (ip === null) return null; - return {maxIP: ip, minIP: ip}; + return { maxIP: ip, minIP: ip }; } const minIP = IPTools.ipToNumber(range.slice(0, index)); const maxIP = IPTools.ipToNumber(range.slice(index + 1)); if (minIP === null || maxIP === null || maxIP < minIP) return null; - return {minIP, maxIP}; + return { minIP, maxIP }; } rangeToString(range: AddressRange, sep = '-') { return `${this.numberToIP(range.minIP)}${sep}${this.numberToIP(range.maxIP)}`; @@ -223,7 +223,7 @@ export const IPTools = new class { /** * Proxy and host management functions */ - ranges: (AddressRange & {host: string})[] = []; + ranges: (AddressRange & { host: string })[] = []; singleIPOpenProxies = new Set(); torProxyIps = new Set(); proxyHosts = new Set(); @@ -269,7 +269,7 @@ export const IPTools = new class { continue; } - const range = {host: IPTools.urlToHost(host), maxIP, minIP}; + const range = { host: IPTools.urlToHost(host), maxIP, minIP }; if (range.maxIP < range.minIP) throw new Error(`Bad range at ${hostOrLowIP}.`); ranges.push(range); break; @@ -453,7 +453,7 @@ export const IPTools = new class { } } - addRange(range: AddressRange & {host: string}) { + addRange(range: AddressRange & { host: string }) { if (IPTools.getRange(range.minIP, range.maxIP)) { IPTools.removeRange(range.minIP, range.maxIP); } @@ -638,7 +638,7 @@ export const IPTools = new class { } }; -const telstraRange: AddressRange & {host: string} = { +const telstraRange: AddressRange & { host: string } = { minIP: IPTools.ipToNumber("101.160.0.0")!, maxIP: IPTools.ipToNumber("101.191.255.255")!, host: 'telstra.net?/res', diff --git a/server/ladders-challenges.ts b/server/ladders-challenges.ts index b075a76524..65ae5eaada 100644 --- a/server/ladders-challenges.ts +++ b/server/ladders-challenges.ts @@ -1,4 +1,4 @@ -import type {ChallengeType} from './room-battle'; +import type { ChallengeType } from './room-battle'; /** * A bundle of: diff --git a/server/ladders-local.ts b/server/ladders-local.ts index 6f96c5a55a..a2ddf87a84 100644 --- a/server/ladders-local.ts +++ b/server/ladders-local.ts @@ -13,7 +13,7 @@ * @license MIT */ -import {FS, Utils} from '../lib'; +import { FS, Utils } from '../lib'; // ladderCaches = {formatid: ladder OR Promise(ladder)} // Use Ladders(formatid).ladder to guarantee a Promise(ladder). @@ -53,13 +53,11 @@ export class LadderStore { // ladderCaches[formatid] const cachedLadder = ladderCaches.get(this.formatid); if (cachedLadder) { - // @ts-ignore - if (cachedLadder.then) { + if ((cachedLadder as Promise).then) { const ladder = await cachedLadder; return (this.ladder = ladder); } - // @ts-ignore - return (this.ladder = cachedLadder); + return (this.ladder = cachedLadder as LadderRow[]); } try { const data = await FS('config/ladders/' + this.formatid + '.tsv').readIfExists(); @@ -181,7 +179,7 @@ export class LadderStore { } else { row[5]++; // tie } - row[6] = '' + new Date(); + row[6] = `${new Date()}`; } /** @@ -259,13 +257,13 @@ export class LadderStore { return [p1score, null, null]; } - let reasons = '' + (Math.round(p1newElo) - Math.round(p1elo)) + ' for ' + (p1score > 0.9 ? 'winning' : (p1score < 0.1 ? 'losing' : 'tying')); + let reasons = `${Math.round(p1newElo) - Math.round(p1elo)} for ${p1score > 0.9 ? 'winning' : (p1score < 0.1 ? 'losing' : 'tying')}`; if (!reasons.startsWith('-')) reasons = '+' + reasons; room.addRaw( Utils.html`${p1name}'s rating: ${Math.round(p1elo)} → ${Math.round(p1newElo)}
    (${reasons})` ); - reasons = '' + (Math.round(p2newElo) - Math.round(p2elo)) + ' for ' + (p2score > 0.9 ? 'winning' : (p2score < 0.1 ? 'losing' : 'tying')); + reasons = `${Math.round(p2newElo) - Math.round(p2elo)} for ${p2score > 0.9 ? 'winning' : (p2score < 0.1 ? 'losing' : 'tying')}`; if (!reasons.startsWith('-')) reasons = '+' + reasons; room.addRaw( Utils.html`${p2name}'s rating: ${Math.round(p2elo)} → ${Math.round(p2newElo)}
    (${reasons})` @@ -301,7 +299,7 @@ export class LadderStore { /** * Calculates Elo based on a match result */ - calculateElo(oldElo: number, score: number, foeElo: number): number { + calculateElo(oldElo: number, score: number, foeElo: number): number { // The K factor determines how much your Elo changes when you win or // lose games. Larger K means more change. // In the "original" Elo, K is constant, but it's common for K to @@ -322,7 +320,7 @@ export class LadderStore { } // main Elo formula - const E = 1 / (1 + Math.pow(10, (foeElo - oldElo) / 400)); + const E = 1 / (1 + 10 ** ((foeElo - oldElo) / 400)); const newElo = oldElo + K * (score - E); diff --git a/server/ladders-remote.ts b/server/ladders-remote.ts index 8b618ab592..aacb5df2b3 100644 --- a/server/ladders-remote.ts +++ b/server/ladders-remote.ts @@ -11,7 +11,7 @@ * * @license MIT */ -import {Utils} from '../lib'; +import { Utils } from '../lib'; export class LadderStore { formatid: string; @@ -170,7 +170,7 @@ export class LadderStore { } // main Elo formula - const E = 1 / (1 + Math.pow(10, (foeElo - oldElo) / 400)); + const E = 1 / (1 + 10 ** ((foeElo - oldElo) / 400)); const newElo = oldElo + K * (score - E); diff --git a/server/ladders.ts b/server/ladders.ts index 2c7cb33207..5d64866a08 100644 --- a/server/ladders.ts +++ b/server/ladders.ts @@ -15,8 +15,8 @@ const LadderStore: typeof import('./ladders-remote').LadderStore = ( const SECONDS = 1000; const PERIODIC_MATCH_INTERVAL = 60 * SECONDS; -import type {ChallengeType} from './room-battle'; -import {BattleReady, BattleChallenge, GameChallenge, BattleInvite, challenges} from './ladders-challenges'; +import type { ChallengeType } from './room-battle'; +import { BattleReady, BattleChallenge, GameChallenge, BattleInvite, challenges } from './ladders-challenges'; /** * Keys are formatids @@ -33,10 +33,6 @@ const searches = new Map void][]; - requestTimer: NodeJS.Timer | null; + requestTimer: NodeJS.Timeout | null; requestLog: string; lastRequest: number; openRequests: number; disabled: false; + [key: `${string}Server`]: LoginServerInstance | undefined; constructor() { this.uri = Config.loginserver; @@ -91,10 +92,8 @@ class LoginServerInstance { // ladderupdate and mmr are the most common actions // prepreplay is also common - // @ts-ignore - if (this[action + 'Server']) { - // @ts-ignore - return this[action + 'Server'].request(action, data); + if (this[`${action}Server`]) { + return this[`${action}Server`]!.request(action, data); } const actionData = data || {}; @@ -163,7 +162,7 @@ class LoginServerInstance { } requestStart(size: number) { this.lastRequest = Date.now(); - this.requestLog += ' | ' + size + ' rqs: '; + this.requestLog += ` | ${size} rqs: `; this.openRequests++; } requestEnd(error?: Error) { @@ -171,7 +170,7 @@ class LoginServerInstance { if (error && error instanceof TimeoutError) { this.requestLog += 'TIMEOUT'; } else { - this.requestLog += '' + ((Date.now() - this.lastRequest) / 1000) + 's'; + this.requestLog += `${(Date.now() - this.lastRequest) / 1000}s`; } this.requestLog = this.requestLog.substr(-1000); this.requestTimerPoke(); diff --git a/server/modlog/index.ts b/server/modlog/index.ts index 6f43b0562b..bce338845a 100644 --- a/server/modlog/index.ts +++ b/server/modlog/index.ts @@ -8,8 +8,8 @@ * @license MIT */ -import {SQL, Utils, FS} from '../../lib'; -import {Config} from '../config-loader'; +import { SQL, Utils, FS } from '../../lib'; +import { Config } from '../config-loader'; // If a modlog query takes longer than this, it will be logged. const LONG_QUERY_DURATION = 2000; @@ -41,7 +41,7 @@ interface SQLQuery { args: (string | number)[]; } interface ModlogResults { - results: (ModlogEntry & {entryID: number})[]; + results: (ModlogEntry & { entryID: number })[]; duration: number; } @@ -52,11 +52,11 @@ interface ModlogSQLQuery { } export interface ModlogSearch { - note: {search: string, isExact?: boolean, isExclusion?: boolean}[]; - user: {search: string, isExact?: boolean, isExclusion?: boolean}[]; - ip: {search: string, isExclusion?: boolean}[]; - action: {search: string, isExclusion?: boolean}[]; - actionTaker: {search: string, isExclusion?: boolean}[]; + note: { search: string, isExact?: boolean, isExclusion?: boolean }[]; + user: { search: string, isExact?: boolean, isExclusion?: boolean }[]; + ip: { search: string, isExclusion?: boolean }[]; + action: { search: string, isExclusion?: boolean }[]; + actionTaker: { search: string, isExclusion?: boolean }[]; } export interface ModlogEntry { @@ -80,7 +80,7 @@ export interface TransactionArguments extends Record { altsInsertionStatement: string; } -export type PartialModlogEntry = Partial & {action: string}; +export type PartialModlogEntry = Partial & { action: string }; export class Modlog { readonly database: SQL.DatabaseManager; @@ -147,7 +147,7 @@ export class Modlog { await this.database.runFile(MODLOG_SCHEMA_PATH); } - const {hasDBInfo} = await this.database.get( + const { hasDBInfo } = await this.database.get( `SELECT count(*) AS hasDBInfo FROM sqlite_master WHERE type = 'table' AND name = 'db_info'` ); @@ -186,13 +186,8 @@ export class Modlog { * Methods for writing to the modlog. * **************************************/ - /** - * @deprecated Modlogs use SQLite and no longer need initialization. - */ - initialize(roomid: ModlogID) { - return; - } - + /** @deprecated Modlogs use SQLite and no longer need initialization. */ + initialize(roomid: ModlogID) {} /** * Writes to the modlog @@ -291,7 +286,7 @@ export class Modlog { */ async search( roomid: ModlogID = 'global', - search: ModlogSearch = {note: [], user: [], ip: [], action: [], actionTaker: []}, + search: ModlogSearch = { note: [], user: [], ip: [], action: [], actionTaker: [] }, maxLines = 20, onlyPunishments = false, ): Promise { @@ -319,10 +314,10 @@ export class Modlog { if (duration > LONG_QUERY_DURATION) { Monitor.slow(`[slow SQL modlog search] ${duration}ms - ${JSON.stringify(query)}`); } - return {results, duration}; + return { results, duration }; } - dbRowToModlogEntry(row: any): ModlogEntry & {entryID: number} { + dbRowToModlogEntry(row: any): ModlogEntry & { entryID: number } { return { entryID: row.modlog_id, action: row.action, @@ -396,7 +391,7 @@ export class Modlog { const select = `SELECT *, (SELECT group_concat(userid, ',') FROM alts WHERE alts.modlog_id = modlog.modlog_id) as alts FROM modlog`; const ors = []; const ands = []; - const sortAndLimit = {query: `ORDER BY timestamp DESC`, args: []} as SQLQuery; + const sortAndLimit = { query: `ORDER BY timestamp DESC`, args: [] } as SQLQuery; if (maxLines) { sortAndLimit.query += ` LIMIT ?`; sortAndLimit.args.push(maxLines); @@ -416,36 +411,36 @@ export class Modlog { args.pop(); } } - ands.push({query: roomChecker, args}); + ands.push({ query: roomChecker, args }); } for (const action of search.action) { const args = [action.search + '%']; if (action.isExclusion) { - ands.push({query: `action NOT LIKE ?`, args}); + ands.push({ query: `action NOT LIKE ?`, args }); } else { - ands.push({query: `action LIKE ?`, args}); + ands.push({ query: `action LIKE ?`, args }); } } if (onlyPunishments) { const args: (string | number)[] = []; - ands.push({query: `action IN (${Utils.formatSQLArray(PUNISHMENTS, args)})`, args}); + ands.push({ query: `action IN (${Utils.formatSQLArray(PUNISHMENTS, args)})`, args }); } for (const ip of search.ip) { const args = [ip.search + '%']; if (ip.isExclusion) { - ands.push({query: `ip NOT LIKE ?`, args}); + ands.push({ query: `ip NOT LIKE ?`, args }); } else { - ands.push({query: `ip LIKE ?`, args}); + ands.push({ query: `ip LIKE ?`, args }); } } for (const actionTaker of search.actionTaker) { const args = [actionTaker.search + '%']; if (actionTaker.isExclusion) { - ands.push({query: `action_taker_userid NOT LIKE ?`, args}); + ands.push({ query: `action_taker_userid NOT LIKE ?`, args }); } else { - ands.push({query: `action_taker_userid LIKE ?`, args}); + ands.push({ query: `action_taker_userid LIKE ?`, args }); } } @@ -453,9 +448,9 @@ export class Modlog { const tester = noteSearch.isExact ? `= ?` : `LIKE ?`; const args = [noteSearch.isExact ? noteSearch.search : `%${noteSearch.search}%`]; if (noteSearch.isExclusion) { - ands.push({query: `note ${noteSearch.isExact ? '!' : 'NOT '}${tester}`, args}); + ands.push({ query: `note ${noteSearch.isExact ? '!' : 'NOT '}${tester}`, args }); } else { - ands.push({query: `note ${tester}`, args}); + ands.push({ query: `note ${tester}`, args }); } } @@ -470,7 +465,7 @@ export class Modlog { param = user.search.toLowerCase() + '%'; } - ors.push({query: `(userid ${tester} OR autoconfirmed_userid ${tester})`, args: [param, param]}); + ors.push({ query: `(userid ${tester} OR autoconfirmed_userid ${tester})`, args: [param, param] }); ors.push({ query: `EXISTS(SELECT * FROM alts WHERE alts.modlog_id = modlog.modlog_id AND alts.userid ${tester})`, args: [param], @@ -480,4 +475,4 @@ export class Modlog { } } -export const mainModlog = new Modlog(MODLOG_DB_PATH, {sqliteOptions: Config.modlogsqliteoptions}); +export const mainModlog = new Modlog(MODLOG_DB_PATH, { sqliteOptions: Config.modlogsqliteoptions }); diff --git a/server/modlog/transactions.ts b/server/modlog/transactions.ts index 05dbae15d0..13d9184eeb 100644 --- a/server/modlog/transactions.ts +++ b/server/modlog/transactions.ts @@ -2,8 +2,8 @@ * SQL transactions for the modlog. */ -import type {TransactionEnvironment} from '../../lib/sql'; -import type {TransactionArguments} from '.'; +import type { TransactionEnvironment } from '../../lib/sql'; +import type { TransactionArguments } from '.'; export const transactions = { insertion: (args: TransactionArguments, env: TransactionEnvironment) => { diff --git a/server/monitor.ts b/server/monitor.ts index 14c69c4e9c..692f6f17f0 100644 --- a/server/monitor.ts +++ b/server/monitor.ts @@ -7,8 +7,8 @@ * @license MIT */ -import {exec, ExecException, ExecOptions} from 'child_process'; -import {crashlogger, FS} from "../lib"; +import { exec, type ExecException, type ExecOptions } from 'child_process'; +import { crashlogger, FS } from "../lib"; import * as pathModule from 'path'; const MONITOR_CLEAN_TIMEOUT = 2 * 60 * 60 * 1000; @@ -47,7 +47,7 @@ export class TimedCounter extends Map { // (4 is currently unused) // 5 = supposedly completely silent, but for now a lot of PS output doesn't respect loglevel if (('Config' in global) && - (typeof Config.loglevel !== 'number' || Config.loglevel < 0 || Config.loglevel > 5)) { + (typeof Config.loglevel !== 'number' || Config.loglevel < 0 || Config.loglevel > 5)) { Config.loglevel = 2; } @@ -60,9 +60,9 @@ export const Monitor = new class { tickets = new TimedCounter(); activeIp: string | null = null; - networkUse: {[k: string]: number} = {}; - networkCount: {[k: string]: number} = {}; - hotpatchLock: {[k: string]: {by: string, reason: string}} = {}; + networkUse: { [k: string]: number } = {}; + networkCount: { [k: string]: number } = {}; + hotpatchLock: { [k: string]: { by: string, reason: string } } = {}; TimedCounter = TimedCounter; @@ -300,7 +300,7 @@ export const Monitor = new class { * Counts roughly the size of an object to have an idea of the server load. */ sizeOfObject(object: AnyObject) { - const objectCache: Set<[] | object> = new Set(); + const objectCache = new Set<[] | object>(); const stack: any[] = [object]; let bytes = 0; @@ -333,7 +333,7 @@ export const Monitor = new class { sh(command: string, options: ExecOptions = {}): Promise<[number, string, string]> { return new Promise((resolve, reject) => { exec(command, options, (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => { - resolve([error?.code || 0, '' + stdout, '' + stderr]); + resolve([error?.code || 0, `${stdout}`, `${stderr}`]); }); }); } @@ -345,7 +345,7 @@ export const Monitor = new class { const index = Monitor.logPath('.gitindex'); const options = { cwd: __dirname, - env: {GIT_INDEX_FILE: index.path}, + env: { GIT_INDEX_FILE: index.path }, }; let [code, stdout, stderr] = await this.sh(`git add -A`, options); diff --git a/server/private-messages/database.ts b/server/private-messages/database.ts index 4473f7e981..4c48d9d350 100644 --- a/server/private-messages/database.ts +++ b/server/private-messages/database.ts @@ -3,8 +3,8 @@ * By Mia. * @author mia-pi-git */ -import {SQL, FS} from '../../lib'; -import {MAX_PENDING} from '.'; +import { type SQL, FS } from '../../lib'; +import { MAX_PENDING } from '.'; export const statements = { send: 'INSERT INTO offline_pms (sender, receiver, message, time) VALUES (?, ?, ?, ?)', @@ -50,7 +50,7 @@ export const transactions: { const [sender, receiver, message] = args; const count = statementList.get('checkSentCount', [sender, receiver])?.count; if (count && count > MAX_PENDING) { - return {error: `You have already sent the maximum ${MAX_PENDING} offline PMs to that user.`}; + return { error: `You have already sent the maximum ${MAX_PENDING} offline PMs to that user.` }; } return statementList.run('send', [sender, receiver, message, Date.now()]); }, diff --git a/server/private-messages/index.ts b/server/private-messages/index.ts index 1c48b49a34..4edea172c5 100644 --- a/server/private-messages/index.ts +++ b/server/private-messages/index.ts @@ -3,13 +3,13 @@ * By Mia. * @author mia-pi-git */ -import {SQL, Utils} from '../../lib'; -import {Config} from '../config-loader'; -import {Auth} from '../user-groups'; -import {statements} from './database'; +import { SQL, Utils } from '../../lib'; +import { Config } from '../config-loader'; +import { Auth } from '../user-groups'; +import { statements } from './database'; /** The time until a PM sent offline expires. Presently, 60 days. */ export const EXPIRY_TIME = 60 * 24 * 60 * 60 * 1000; -/** The time until a PM that has been seen by the user expires. Presently, one week.*/ +/** The time until a PM that has been seen by the user expires. Presently, one week. */ export const SEEN_EXPIRY_TIME = 7 * 24 * 60 * 60 * 1000; /** The max PMs that one user can have pending to a specific user at one time */ export const MAX_PENDING = 20; @@ -95,7 +95,7 @@ export const PrivateMessages = new class { } return PM.run(statements.setBlock, [id, val]); } - checkCanUse(user: User, options = {forceBool: false, isLogin: false}) { + checkCanUse(user: User, options = { forceBool: false, isLogin: false }) { if (!this.offlineIsEnabled) { if (options.forceBool) return false; throw new Chat.ErrorMessage(`Offline PMs are currently disabled.`); @@ -122,7 +122,7 @@ export const PrivateMessages = new class { const userid = toID(user); // we only want to send the unseen pms to them when they login - they can replay the rest at will otherwise const messages = await this.fetchUnseen(userid); - for (const {message, time, sender} of messages) { + for (const { message, time, sender } of messages) { user.send( `|pm|${this.getIdentity(sender)}|${this.getIdentity(user)}|/html ` + `${Utils.escapeHTML(message)} [sent offline, ]` @@ -136,7 +136,7 @@ export const PrivateMessages = new class { } return `${Users.globalAuth.get(toID(user))}${user}`; } - nextClear(): NodeJS.Timer { + nextClear(): NodeJS.Timeout { if (!PM.isParentProcess) return null!; const time = Date.now(); // even though we expire once a week atm, we check once a day @@ -172,7 +172,7 @@ export const PrivateMessages = new class { const all = await this.fetchAll(user); let buf = `
    `; buf += `

    PMs received offline in the last ${Chat.toDurationString(SEEN_EXPIRY_TIME)}

    `; - const sortedPMs: {[userid: string]: ReceivedPM[]} = {}; + const sortedPMs: { [userid: string]: ReceivedPM[] } = {}; for (const curPM of all) { if (!sortedPMs[curPM.sender]) sortedPMs[curPM.sender] = []; sortedPMs[curPM.sender].push(curPM); @@ -189,7 +189,7 @@ export const PrivateMessages = new class { buf += Utils.html`
    `; buf += Utils.html`

    ${group}${name}

    `; buf += `
    `; - for (const {message, time} of messages) { + for (const { message, time } of messages) { buf += `
      `; buf += `[] `; buf += Utils.html`${group}`; diff --git a/server/punishments.ts b/server/punishments.ts index d2018c9b24..978e4ae0aa 100644 --- a/server/punishments.ts +++ b/server/punishments.ts @@ -11,8 +11,8 @@ * @license MIT license */ -import {FS, Utils} from '../lib'; -import type {AddressRange} from './ip-tools'; +import { FS, Utils } from '../lib'; +import type { AddressRange } from './ip-tools'; const PUNISHMENT_FILE = 'config/punishments.tsv'; const ROOM_PUNISHMENT_FILE = 'config/room-punishments.tsv'; @@ -33,7 +33,7 @@ const BLACKLIST_DURATION = 365 * 24 * 60 * 60 * 1000; // 1 year const USERID_REGEX = /^[a-z0-9]+$/; const PUNISH_TRUSTED = false; -const PUNISHMENT_POINT_VALUES: {[k: string]: number} = {MUTE: 2, BLACKLIST: 3, ROOMBAN: 4}; +const PUNISHMENT_POINT_VALUES: { [k: string]: number } = { MUTE: 2, BLACKLIST: 3, ROOMBAN: 4 }; const AUTOLOCK_POINT_THRESHOLD = 8; const AUTOWEEKLOCK_THRESHOLD = 5; // number of global punishments to upgrade autolocks to weeklocks @@ -116,7 +116,6 @@ class PunishmentMap extends Map { this.removeExpiring(punishments); if (punishments.length) { for (const punishment of punishments) { - // eslint-disable-next-line callback-return callback(punishment, k, this); } } else { @@ -179,7 +178,7 @@ class NestedPunishmentMap extends Map { return undefined; } nestedGetByType(k1: RoomID, k2: string, type: string) { - return this.nestedGet(k1, k2)?.filter(p => p.type === type)[0]; + return this.nestedGet(k1, k2)?.find(p => p.type === type); } nestedHas(k1: RoomID, k2: string) { return !!this.nestedGet(k1, k2); @@ -196,7 +195,6 @@ class NestedPunishmentMap extends Map { subMap.removeExpiring(punishments); if (punishments.length) { for (const punishment of punishments) { - // eslint-disable-next-line callback-return callback(punishment, k1, k2); } } else { @@ -252,13 +250,13 @@ export const Punishments = new class { * Participants in groupchats whose creators were banned from using groupchats. * Object keys are roomids of groupchats; values are Sets of user IDs. */ - readonly bannedGroupchatParticipants: {[k: string]: Set} = {}; + readonly bannedGroupchatParticipants: { [k: string]: Set } = {}; /** roomid:timestamp map */ - readonly lastGroupchatMonitorTime: {[k: string]: number} = {}; + readonly lastGroupchatMonitorTime: { [k: string]: number } = {}; /** * Map */ - readonly offlineWarns: Map = new Map(); + readonly offlineWarns = new Map(); /** * punishType is an allcaps string, for global punishments they can be * anything in the punishmentTypes map. @@ -266,13 +264,13 @@ export const Punishments = new class { * This map can be extended with custom punishments by chat plugins. * * Keys in the map correspond to PunishInfo */ - readonly punishmentTypes = new Map([ + readonly punishmentTypes: Map = new Map([ ...(global.Punishments?.punishmentTypes || []), - ['LOCK', {desc: 'locked'}], - ['BAN', {desc: 'globally banned'}], - ['NAMELOCK', {desc: 'namelocked'}], - ['GROUPCHATBAN', {desc: 'banned from using groupchats'}], - ['BATTLEBAN', {desc: 'banned from battling'}], + ['LOCK', { desc: 'locked' }], + ['BAN', { desc: 'globally banned' }], + ['NAMELOCK', { desc: 'namelocked' }], + ['GROUPCHATBAN', { desc: 'banned from using groupchats' }], + ['BATTLEBAN', { desc: 'banned from battling' }], ]); /** * For room punishments, they can be anything in the roomPunishmentTypes map. @@ -287,13 +285,13 @@ export const Punishments = new class { * - 'MUTE' (used by getRoomPunishments) * */ - readonly roomPunishmentTypes = new Map([ + readonly roomPunishmentTypes: Map = new Map([ // references to global.Punishments? are here because if you hotpatch punishments without hotpatching chat, // old punishment types won't be loaded into here, which might cause issues. This guards against that. ...(global.Punishments?.roomPunishmentTypes || []), - ['ROOMBAN', {desc: 'banned', activatePunishMonitor: true}], - ['BLACKLIST', {desc: 'blacklisted', activatePunishMonitor: true}], - ['MUTE', {desc: 'muted', activatePunishMonitor: true}], + ['ROOMBAN', { desc: 'banned', activatePunishMonitor: true }], + ['BLACKLIST', { desc: 'blacklisted', activatePunishMonitor: true }], + ['MUTE', { desc: 'muted', activatePunishMonitor: true }], ]); constructor() { setImmediate(() => { @@ -320,7 +318,7 @@ export const Punishments = new class { if (type === "Punishment") continue; const keys = altKeys.split(',').concat(id); - const punishment = {type, id, expireTime, reason: reason.join('\t')} as Punishment; + const punishment = { type, id, expireTime, reason: reason.join('\t') } as Punishment; if (Date.now() >= expireTime) { continue; } @@ -347,7 +345,7 @@ export const Punishments = new class { if (!userid) continue; // invalid format const keys = altKeys.split(',').concat(userid); - const punishment = {type, id: userid, expireTime, reason: reason.join('\t')} as Punishment; + const punishment = { type, id: userid, expireTime, reason: reason.join('\t') } as Punishment; if (Date.now() >= expireTime) { continue; } @@ -369,7 +367,7 @@ export const Punishments = new class { buf += Punishments.renderEntry(entry, id); } return buf; - }, {throttle: 5000}); + }, { throttle: 5000 }); } saveRoomPunishments() { @@ -385,13 +383,13 @@ export const Punishments = new class { buf += Punishments.renderEntry(entry, id); } return buf; - }, {throttle: 5000}); + }, { throttle: 5000 }); } getEntry(entryId: string) { let entry: PunishmentEntry | null = null; Punishments.ips.each((punishment, ip) => { - const {type, id, expireTime, reason, rest} = punishment; + const { type, id, expireTime, reason, rest } = punishment; if (id !== entryId) return; if (entry) { entry.ips.push(ip); @@ -408,7 +406,7 @@ export const Punishments = new class { }; }); Punishments.userids.each((punishment, userid) => { - const {type, id, expireTime, reason, rest} = punishment; + const { type, id, expireTime, reason, rest } = punishment; if (id !== entryId) return; if (!entry) { @@ -450,7 +448,7 @@ export const Punishments = new class { if (ip.includes('/')) { rangebans.push(ip); } else if (!Punishments.ips.has(ip)) { - Punishments.ips.add(ip, {type: 'LOCK', id: '#ipban', expireTime: Infinity, reason: ''}); + Punishments.ips.add(ip, { type: 'LOCK', id: '#ipban', expireTime: Infinity, reason: '' }); } } Punishments.checkRangeBanned = IPTools.checker(rangebans); @@ -593,7 +591,7 @@ export const Punishments = new class { await this.punishInner(alt, punishment, userids, ips, mobileIps); } - const {type, id, expireTime, reason, rest} = punishment; + const { type, id, expireTime, reason, rest } = punishment; userids.delete(id as ID); void Punishments.appendPunishment({ userids: [...userids], @@ -606,7 +604,7 @@ export const Punishments = new class { if (mobileIps.size) { const mobileExpireTime = Date.now() + MOBILE_PUNISHMENT_DURATIION; - const mobilePunishment = {type, id, expireTime: mobileExpireTime, reason, rest} as Punishment; + const mobilePunishment = { type, id, expireTime: mobileExpireTime, reason, rest } as Punishment; for (const mobileIp of mobileIps) { Punishments.ips.add(mobileIp, mobilePunishment); } @@ -632,7 +630,7 @@ export const Punishments = new class { } for (const ip of user.ips) { - const {hostType} = await IPTools.lookup(ip); + const { hostType } = await IPTools.lookup(ip); if (hostType !== 'mobile') { Punishments.ips.add(ip, punishment); ips.add(ip); @@ -680,8 +678,8 @@ export const Punishments = new class { for (const ip of ips) { Punishments.ips.add(ip, punishment); } - const {type, id, expireTime, reason, rest} = punishment; - const affected = Users.findUsers([...userids], [...ips], {includeTrusted: PUNISH_TRUSTED, forPunishment: true}); + const { type, id, expireTime, reason, rest } = punishment; + const affected = Users.findUsers([...userids], [...ips], { includeTrusted: PUNISH_TRUSTED, forPunishment: true }); userids.delete(id as ID); void Punishments.appendPunishment({ userids: [...userids], @@ -707,14 +705,14 @@ export const Punishments = new class { let success: false | string = false; Punishments.ips.each((cur, key) => { - const {type: curPunishmentType, id: curId} = cur; + const { type: curPunishmentType, id: curId } = cur; if (curId === id && curPunishmentType === punishType) { Punishments.ips.deleteOne(key, cur); success = id; } }); Punishments.userids.each((cur, key) => { - const {type: curPunishmentType, id: curId} = cur; + const { type: curPunishmentType, id: curId } = cur; if (curId === id && curPunishmentType === punishType) { Punishments.userids.deleteOne(key, cur); success = id; @@ -743,7 +741,7 @@ export const Punishments = new class { this.roomPunishInner(roomid, curUser, punishment, userids, ips); } - const {type, id, expireTime, reason, rest} = punishment; + const { type, id, expireTime, reason, rest } = punishment; userids.delete(id as ID); void Punishments.appendPunishment({ userids: [...userids], @@ -822,8 +820,8 @@ export const Punishments = new class { for (const ip of ips) { Punishments.roomIps.nestedSet(roomid, ip, punishment); } - const {type, id, expireTime, reason, rest} = punishment; - const affected = Users.findUsers([...userids], [...ips], {includeTrusted: PUNISH_TRUSTED, forPunishment: true}); + const { type, id, expireTime, reason, rest } = punishment; + const affected = Users.findUsers([...userids], [...ips], { includeTrusted: PUNISH_TRUSTED, forPunishment: true }); userids.delete(id as ID); void Punishments.appendPunishment({ userids: [...userids], @@ -892,28 +890,28 @@ export const Punishments = new class { } addRoomPunishmentType( - opts: PunishInfo & {type: string} | string, + opts: PunishInfo & { type: string } | string, // backwards compat - todo make only PunishInfo & {type: string} desc?: string, callback?: PunishInfo['onActivate'] ) { if (typeof opts === 'string') { if (!desc) throw new Error('Desc argument must be provided if type is string'); - opts = {onActivate: callback, desc, type: opts}; + opts = { onActivate: callback, desc, type: opts }; } this.roomPunishmentTypes.set(opts.type, opts); if (!this.sortedRoomTypes.includes(opts.type)) this.sortedRoomTypes.unshift(opts.type); } addPunishmentType( - opts: PunishInfo & {type: string} | string, + opts: PunishInfo & { type: string } | string, // backwards compat - todo make only PunishInfo & {type: string} desc?: string, callback?: PunishInfo['onActivate'] ) { if (typeof opts === 'string') { if (!desc) throw new Error('Desc argument must be provided if type is string'); - opts = {onActivate: callback, desc, type: opts}; + opts = { onActivate: callback, desc, type: opts }; } this.punishmentTypes.set(opts.type, opts); if (!this.sortedTypes.includes(opts.type)) this.sortedTypes.unshift(opts.type); @@ -927,7 +925,7 @@ export const Punishments = new class { user: User | ID, expireTime: number | null, id: ID | PunishType | null, ignoreAlts: boolean, ...reason: string[] ) { if (!expireTime) expireTime = Date.now() + GLOBALBAN_DURATION; - const punishment = {type: 'BAN', id, expireTime, reason: reason.join(' ')} as Punishment; + const punishment = { type: 'BAN', id, expireTime, reason: reason.join(' ') } as Punishment; const affected = await Punishments.punish(user, punishment, ignoreAlts); for (const curUser of affected) { @@ -950,7 +948,7 @@ export const Punishments = new class { rest?: any[] ) { if (!expireTime) expireTime = Date.now() + LOCK_DURATION; - const punishment = {type: 'LOCK', id, expireTime, reason: reason, rest} as Punishment; + const punishment = { type: 'LOCK', id, expireTime, reason, rest } as Punishment; const userObject = Users.get(user); // This makes it easier for unit tests to tell if a user was locked @@ -999,7 +997,7 @@ export const Punishments = new class { action: `AUTO${punishment}`, visualRoomID: typeof room !== 'string' ? (room as Room).roomid : room, ip: typeof user !== 'string' ? user.latestIp : null, - userid: userid, + userid, note: reason, isGlobal: true, }; @@ -1014,7 +1012,7 @@ export const Punishments = new class { Rooms.global.modlog(logEntry); } - if (roomObject?.battle && userObject && userObject.connections[0]) { + if (roomObject?.battle && userObject?.connections[0]) { Chat.parse('/savereplay forpunishment', roomObject, userObject, userObject.connections[0]); } @@ -1070,7 +1068,7 @@ export const Punishments = new class { // Optional chaining doesn't seem to work properly in callbacks of setTimeout if (user.locked && user.locked.startsWith('#')) return; - const {id, expireTime} = punishment; + const { id, expireTime } = punishment; const timeLeft = expireTime - Date.now(); if (timeLeft <= 1) { @@ -1087,7 +1085,7 @@ export const Punishments = new class { user: User | ID, expireTime: number | null, id: ID | PunishType | null, ignoreAlts: boolean, ...reason: string[] ) { if (!expireTime) expireTime = Date.now() + LOCK_DURATION; - const punishment = {type: 'NAMELOCK', id, expireTime, reason: reason.join(' ')} as Punishment; + const punishment = { type: 'NAMELOCK', id, expireTime, reason: reason.join(' ') } as Punishment; const affected = await Punishments.punish(user, punishment, ignoreAlts); for (const curUser of affected) { @@ -1135,7 +1133,7 @@ export const Punishments = new class { } battleban(user: User, expireTime: number | null, id: ID | null, ...reason: string[]) { if (!expireTime) expireTime = Date.now() + BATTLEBAN_DURATION; - const punishment = {type: 'BATTLEBAN', id, expireTime, reason: reason.join(' ')} as Punishment; + const punishment = { type: 'BATTLEBAN', id, expireTime, reason: reason.join(' ') } as Punishment; // Handle tournaments the user was in before being battle banned for (const games of user.games.keys()) { @@ -1185,7 +1183,7 @@ export const Punishments = new class { */ async groupchatBan(user: User | ID, expireTime: number | null, id: ID | null, reason: string | null) { if (!expireTime) expireTime = Date.now() + GROUPCHATBAN_DURATION; - const punishment = {type: 'GROUPCHATBAN', id, expireTime, reason} as Punishment; + const punishment = { type: 'GROUPCHATBAN', id, expireTime, reason } as Punishment; const groupchatsCreated = []; const targetUser = Users.get(user); @@ -1299,13 +1297,13 @@ export const Punishments = new class { ) { if (!expireTime) expireTime = Date.now() + RANGELOCK_DURATION; if (!punishType) punishType = 'LOCK'; - const punishment = {type: punishType, id: '#rangelock', expireTime, reason} as Punishment; + const punishment = { type: punishType, id: '#rangelock', expireTime, reason } as Punishment; Punishments.ips.add(range, punishment); const ips = []; const parsedRange = IPTools.stringToRange(range); if (!parsedRange) throw new Error(`Invalid IP range: ${range}`); - const {minIP, maxIP} = parsedRange; + const { minIP, maxIP } = parsedRange; for (let ipNumber = minIP; ipNumber <= maxIP; ipNumber++) { ips.push(IPTools.numberToIP(ipNumber)!); // range is already validated by stringToRange @@ -1322,13 +1320,13 @@ export const Punishments = new class { } banRange(range: string, reason: string, expireTime?: number | null) { if (!expireTime) expireTime = Date.now() + RANGELOCK_DURATION; - const punishment = {type: 'BAN', id: '#rangelock', expireTime, reason} as Punishment; + const punishment = { type: 'BAN', id: '#rangelock', expireTime, reason } as Punishment; Punishments.ips.add(range, punishment); } roomBan(room: Room, user: User, expireTime: number | null, id: string | null, ...reason: string[]) { if (!expireTime) expireTime = Date.now() + ROOMBAN_DURATION; - const punishment = {type: 'ROOMBAN', id, expireTime, reason: reason.join(' ')} as Punishment; + const punishment = { type: 'ROOMBAN', id, expireTime, reason: reason.join(' ') } as Punishment; const affected = Punishments.roomPunish(room, user, punishment); for (const curUser of affected) { @@ -1350,7 +1348,7 @@ export const Punishments = new class { roomBlacklist(room: Room, user: User | ID, expireTime: number | null, id: ID | null, ...reason: string[]) { if (!expireTime) expireTime = Date.now() + BLACKLIST_DURATION; - const punishment = {type: 'BLACKLIST', id, expireTime, reason: reason.join(' ')} as Punishment; + const punishment = { type: 'BLACKLIST', id, expireTime, reason: reason.join(' ') } as Punishment; const affected = Punishments.roomPunish(room, user, punishment); @@ -1400,7 +1398,7 @@ export const Punishments = new class { const unblacklisted: string[] = []; - roombans.each(({type}, userid) => { + roombans.each(({ type }, userid) => { if (type === 'BLACKLIST') { Punishments.roomUnblacklist(room, userid, true); unblacklisted.push(userid); @@ -1503,28 +1501,28 @@ export const Punishments = new class { /** [key, roomid, punishment][] */ const results: [string, RoomID, Punishment][] = []; Punishments.ips.each((punishment, ip) => { - const {id} = punishment; + const { id } = punishment; if (searchId === id || searchId === ip) { results.push([ip, '', punishment]); } }); Punishments.userids.each((punishment, userid) => { - const {id} = punishment; + const { id } = punishment; if (searchId === id || searchId === userid) { results.push([userid, '', punishment]); } }); Punishments.roomIps.nestedEach((punishment, roomid, ip) => { - const {id: punishUserid} = punishment; + const { id: punishUserid } = punishment; if (searchId === punishUserid || searchId === ip) { results.push([ip, roomid, punishment]); } }); Punishments.roomUserids.nestedEach((punishment, roomid, userid) => { - const {id: punishUserid} = punishment; + const { id: punishUserid } = punishment; if (searchId === punishUserid || searchId === userid) { results.push([userid, roomid, punishment]); @@ -1558,7 +1556,7 @@ export const Punishments = new class { } sortedTypes = ['TICKETBAN', 'LOCK', 'NAMELOCK', 'BAN']; - sortedRoomTypes = [...(global.Punishments?.sortedRoomTypes || []), 'ROOMBAN', 'BLACKLIST']; + sortedRoomTypes: string[] = [...(global.Punishments?.sortedRoomTypes || []), 'ROOMBAN', 'BLACKLIST']; byWeight(punishments?: Punishment[], room = false) { if (!punishments) return []; return Utils.sortBy( @@ -1567,12 +1565,12 @@ export const Punishments = new class { ); } - interactions: {[k: string]: {overrides: string[]}} = { - NAMELOCK: {overrides: ['LOCK']}, + interactions: { [k: string]: { overrides: string[] } } = { + NAMELOCK: { overrides: ['LOCK'] }, }; - roomInteractions: {[k: string]: {overrides: string[]}} = { - BLACKLIST: {overrides: ['ROOMBAN']}, + roomInteractions: { [k: string]: { overrides: string[] } } = { + BLACKLIST: { overrides: ['ROOMBAN'] }, }; /** @@ -1626,12 +1624,12 @@ export const Punishments = new class { if (battleban) punishments.push(battleban); if (user.namelocked) { let punishment = Punishments.userids.get(user.namelocked)?.[0]; - if (!punishment) punishment = {type: 'NAMELOCK', id: user.namelocked, expireTime: 0, reason: ''}; + if (!punishment) punishment = { type: 'NAMELOCK', id: user.namelocked, expireTime: 0, reason: '' }; punishments.push(punishment); } if (user.locked) { let punishment = Punishments.userids.get(user.locked)?.[0]; - if (!punishment) punishment = {type: 'LOCK', id: user.locked, expireTime: 0, reason: ''}; + if (!punishment) punishment = { type: 'LOCK', id: user.locked, expireTime: 0, reason: '' }; punishments.push(punishment); } @@ -1669,7 +1667,7 @@ export const Punishments = new class { `|popup||html|You are banned from battling` + `${punishment.id !== userid ? ` because you have the same IP as banned user: ${punishUserid}` : ''}. ` + `Your battle ban will expire in a few days.` + - `${punishment.reason ? Utils.html `\n\nReason: ${punishment.reason}` : ``}` + + `${punishment.reason ? Utils.html`\n\nReason: ${punishment.reason}` : ``}` + `${appealLink ? `\n\nOr you can ${appealLink}.` : ``}` ); user.notified.punishment = true; @@ -1728,7 +1726,7 @@ export const Punishments = new class { let punishments = Punishments.ipSearch(ip); if (!punishments && Punishments.checkRangeBanned(ip)) { - punishments = [{type: 'LOCK', id: '#ipban', expireTime: Infinity, reason: ''}]; + punishments = [{ type: 'LOCK', id: '#ipban', expireTime: Infinity, reason: '' }]; } if (punishments) { @@ -1756,7 +1754,7 @@ export const Punishments = new class { if (!sharedAndHasPunishment) Punishments.checkPunishmentTime(user, Punishments.byWeight(punishments)[0]); } - return IPTools.lookup(ip).then(({dnsbl, host, hostType}) => { + return IPTools.lookup(ip).then(({ dnsbl, host, hostType }) => { user = connection.user || user; if (hostType === 'proxy' && !user.trusted && !user.locked) { @@ -1941,7 +1939,7 @@ export const Punishments = new class { * options.publicOnly will make this only return public room punishments. * options.checkIps will also check the IP of the user for IP-based punishments. */ - getRoomPunishments(user: User | string, options: Partial<{checkIps: any, publicOnly: any}> = {}) { + getRoomPunishments(user: User | string, options: Partial<{ checkIps: any, publicOnly: any }> = {}) { if (!user) return []; const userid = toID(user); @@ -1981,7 +1979,7 @@ export const Punishments = new class { if (userid === entry.userid || user.guestNum === entry.guestNum || (user.autoconfirmed && user.autoconfirmed === entry.autoconfirmed)) { - punishments.push([curRoom, {type: 'MUTE', id: entry.userid, expireTime: entry.time, reason: ''} as Punishment]); + punishments.push([curRoom, { type: 'MUTE', id: entry.userid, expireTime: entry.time, reason: '' } as Punishment]); } } } @@ -1994,7 +1992,7 @@ export const Punishments = new class { if (roomid && (!Punishments.roomIps.has(roomid) || !Punishments.roomUserids.has(roomid))) return punishmentTable; // `Punishments.roomIps.get(roomid)` guaranteed to exist above (roomid ? Punishments.roomIps.get(roomid)! : Punishments.ips).each((punishment, ip) => { - const {type, id, expireTime, reason, rest} = punishment; + const { type, id, expireTime, reason, rest } = punishment; if (id !== '#rangelock' && id.startsWith('#')) return; let entry = punishmentTable.find(e => e[0] === id && e[1].punishType === type)?.[1]; @@ -2015,7 +2013,7 @@ export const Punishments = new class { }); // `Punishments.roomIps.get(roomid)` guaranteed to exist above (roomid ? Punishments.roomUserids.get(roomid)! : Punishments.userids).each((punishment, userid) => { - const {type, id, expireTime, reason, rest} = punishment; + const { type, id, expireTime, reason, rest } = punishment; if (id.startsWith('#')) return; let entry = punishmentTable.find(([curId, cur]) => id === curId && cur.punishType === type)?.[1]; if (!entry) { @@ -2059,7 +2057,7 @@ export const Punishments = new class { for (const [userid, punishment] of punishments) { const expiresIn = new Date(punishment.expireTime).getTime() - Date.now(); if (expiresIn < 1000) continue; - const expireString = Chat.toDurationString(expiresIn, {precision: 1}); + const expireString = Chat.toDurationString(expiresIn, { precision: 1 }); buf += `
    ${userid}${punishment.punishType}
    `; this.room.add(`|fieldhtml|
    ${buf}
    `); - buf = this.games.map(({room, winner}, index) => { + buf = this.games.map(({ room, winner }, index) => { let progress = `being played`; if (winner) progress = Utils.html`won by ${winner.name}`; if (winner === null) progress = `tied`; @@ -346,7 +347,7 @@ export class BestOfGame extends RoomGame { override startTimer() { this.needsTimer = true; - for (const {room} of this.games) { + for (const { room } of this.games) { room.battle?.timer.start(); } } @@ -358,7 +359,7 @@ export class BestOfGame extends RoomGame { this.games[this.games.length - 1].winner = winner; if (winner) { winner.wins++; - const loserPlayer = room.battle!.players.filter(p => p.num !== winner.num)[0]; + const loserPlayer = room.battle!.players.find(p => p.num !== winner.num); if (loserPlayer && loserPlayer.dcSecondsLeft <= 0) { // disconnection means opp wins the set return this.forfeit(loserPlayer.name, ` lost the series due to inactivity.`); } @@ -463,7 +464,7 @@ export class BestOfGame extends RoomGame { p1score = 0; } - const {rated, room} = this.games[this.games.length - 1]; + const { rated, room } = this.games[this.games.length - 1]; if (rated) { void room.battle?.updateLadder(p1score, winnerid); } @@ -477,7 +478,7 @@ export class BestOfGame extends RoomGame { forfeitPlayer(loser: BestOfPlayer, message = '') { if (this.ended || this.winner) return false; - this.winner = this.players.filter(p => p !== loser)[0]; + this.winner = this.players.find(p => p !== loser)!; this.room.add(`||${loser.name}${message || ' forfeited.'}`); this.end(this.winner.id); @@ -487,7 +488,7 @@ export class BestOfGame extends RoomGame { } override destroy() { this.setEnded(); - for (const {room} of this.games) room.expire(); + for (const { room } of this.games) room.expire(); this.games = []; for (const p of this.players) p.destroy(); this.players = []; diff --git a/server/room-battle.ts b/server/room-battle.ts index c5c2b7e130..d2f4f4d7e7 100644 --- a/server/room-battle.ts +++ b/server/room-battle.ts @@ -11,14 +11,14 @@ * @license MIT */ -import {execSync} from "child_process"; -import {Repl, ProcessManager, type Streams} from '../lib'; -import {BattleStream} from "../sim/battle-stream"; -import {RoomGamePlayer, RoomGame} from "./room-game"; -import type {Tournament} from './tournaments/index'; -import type {RoomSettings} from './rooms'; -import type {BestOfGame} from './room-battle-bestof'; -import type {GameTimerSettings} from '../sim/dex-formats'; +import { execSync } from "child_process"; +import { Repl, ProcessManager, type Streams } from '../lib'; +import { BattleStream } from "../sim/battle-stream"; +import { RoomGamePlayer, RoomGame } from "./room-game"; +import type { Tournament } from './tournaments/index'; +import type { RoomSettings } from './rooms'; +import type { BestOfGame } from './room-battle-bestof'; +import type { GameTimerSettings } from '../sim/dex-formats'; type ChannelIndex = 0 | 1 | 2 | 3 | 4; export type PlayerIndex = 1 | 2 | 3 | 4; @@ -120,7 +120,7 @@ export class RoomBattlePlayer extends RoomGamePlayer { this.slot = `p${num}` as SideID; this.channelIndex = (game.gameType === 'multi' && num > 2 ? num - 2 : num) as ChannelIndex; - this.request = {rqid: 0, request: '', isWait: 'cantUndo', choice: ''}; + this.request = { rqid: 0, request: '', isWait: 'cantUndo', choice: '' }; this.wantsTie = false; this.wantsOpenTeamSheets = null; this.active = !!user?.connected; @@ -162,7 +162,7 @@ export class RoomBattlePlayer extends RoomGamePlayer { export class RoomBattleTimer { readonly battle: RoomBattle; readonly timerRequesters: Set; - timer: NodeJS.Timer | null; + timer: NodeJS.Timeout | null; isFirstTurn: boolean; /** * Last tick, as milliseconds since UNIX epoch. @@ -196,7 +196,7 @@ export class RoomBattleTimer { // so that Object.assign doesn't overwrite anything with `undefined` for (const k in timerSettings) { - // @ts-ignore + // @ts-expect-error prop access if (timerSettings[k] === undefined) delete timerSettings[k]; } @@ -513,13 +513,13 @@ export class RoomBattle extends RoomGame { /** * userid that requested extraction -> playerids that accepted the extraction */ - readonly allowExtraction: {[k: string]: Set} = {}; + readonly allowExtraction: { [k: string]: Set } = {}; readonly stream: Streams.ObjectReadWriteStream; override readonly timer: RoomBattleTimer; started = false; active = false; replaySaved: boolean | 'auto' = false; - forcedSettings: {modchat?: string | null, privacy?: string | null} = {}; + forcedSettings: { modchat?: string | null, privacy?: string | null } = {}; p1: RoomBattlePlayer = null!; p2: RoomBattlePlayer = null!; p3: RoomBattlePlayer = null!; @@ -625,7 +625,7 @@ export class RoomBattle extends RoomGame { } const allPlayersWait = this.players.every(p => !!p.request.isWait); if (allPlayersWait || // too late - (rqid && rqid !== '' + request.rqid)) { // WAY too late + (rqid && rqid !== `${request.rqid}`)) { // WAY too late player.sendRoom(`|error|[Invalid choice] Sorry, too late to make a different move; the next turn has already started`); return; } @@ -645,7 +645,7 @@ export class RoomBattle extends RoomGame { } const allPlayersWait = this.players.every(p => !!p.request.isWait); if (allPlayersWait || // too late - (rqid && rqid !== '' + request.rqid)) { // WAY too late + (rqid && rqid !== `${request.rqid}`)) { // WAY too late player.sendRoom(`|error|[Invalid choice] Sorry, too late to cancel; the next turn has already started`); return; } @@ -653,7 +653,7 @@ export class RoomBattle extends RoomGame { void this.stream.write(`>${player.slot} undo`); } - override joinGame(user: User, slot?: SideID, playerOpts?: {team?: string}) { + override joinGame(user: User, slot?: SideID, playerOpts?: { team?: string }) { if (user.id in this.playerTable) { user.popup(`You have already joined this battle.`); return false; @@ -691,7 +691,7 @@ export class RoomBattle extends RoomGame { // onCreateBattleRoom crashes if some users are unavailable at start of battle // what do we do??? no clue but I guess just exclude them from the array for now const users = this.players.map(player => player.getUser()).filter(Boolean) as User[]; - Rooms.global.onCreateBattleRoom(users, this.room, {rated: this.rated}); + Rooms.global.onCreateBattleRoom(users, this.room, { rated: this.rated }); this.started = true; this.room.add(`|uhtmlchange|invites|`); } else if (!this.started && this.invitesFull()) { @@ -906,7 +906,7 @@ export class RoomBattle extends RoomGame { logData.endType = this.endType; if (!p1rating) logData.ladderError = true; const date = new Date(); - logData.timestamp = '' + date; + logData.timestamp = `${date}`; logData.roomid = this.room.roomid; logData.format = this.room.format; @@ -1052,7 +1052,7 @@ export class RoomBattle extends RoomGame { if (playerOpts) { const options = { name: player.name, - avatar: user ? '' + user.avatar : '', + avatar: user ? `${user.avatar}` : '', team: playerOpts.team || undefined, rating: Math.round(playerOpts.rating || 0), }; @@ -1121,7 +1121,7 @@ export class RoomBattle extends RoomGame { delete Config.forcedpublicprefixes; } if (!Config.forcedprefixes) return null; - for (const {type, prefix} of Config.forcedprefixes) { + for (const { type, prefix } of Config.forcedprefixes) { if (user.id.startsWith(toID(prefix)) && type === key) return prefix; } return null; @@ -1132,7 +1132,7 @@ export class RoomBattle extends RoomGame { return new RoomBattlePlayer(user, this, num); } - override setPlayerUser(player: RoomBattlePlayer, user: User | null, playerOpts?: {team?: string}) { + override setPlayerUser(player: RoomBattlePlayer, user: User | null, playerOpts?: { team?: string }) { if (user === null && this.room.auth.get(player.id) === Users.PLAYER_SYMBOL) { this.room.auth.set(player.id, '+'); } @@ -1200,7 +1200,7 @@ export class RoomBattle extends RoomGame { return user; }); if (!delayStart) { - Rooms.global.onCreateBattleRoom(users as User[], this.room, {rated: this.rated}); + Rooms.global.onCreateBattleRoom(users as User[], this.room, { rated: this.rated }); this.started = true; } else if (delayStart === 'multi') { this.room.add(`|uhtml|invites|
    This is a 4-player challenge battle
    The players will need to add more players before the battle can start.
    `); @@ -1305,7 +1305,7 @@ export class RoomBattle extends RoomGame { export class RoomBattleStream extends BattleStream { override readonly battle: Battle; constructor() { - super({keepAlive: true}); + super({ keepAlive: true }); this.battle = null!; } @@ -1367,7 +1367,7 @@ if (!PM.isParentProcess) { process.send!(`CALLBACK\nSLOW\n${text}`); }, }; - global.__version = {head: ''}; + global.__version = { head: '' }; try { const head = execSync('git rev-parse HEAD', { stdio: ['ignore', 'pipe', 'ignore'], @@ -1375,8 +1375,8 @@ if (!PM.isParentProcess) { const merge = execSync('git merge-base origin/master HEAD', { stdio: ['ignore', 'pipe', 'ignore'], }); - global.__version.head = ('' + head).trim(); - const origin = ('' + merge).trim(); + global.__version.head = `${head}`.trim(); + const origin = `${merge}`.trim(); if (origin !== global.__version.head) global.__version.origin = origin; } catch {} diff --git a/server/room-game.ts b/server/room-game.ts index a0a7f30622..981e1935fb 100644 --- a/server/room-game.ts +++ b/server/room-game.ts @@ -122,7 +122,7 @@ export abstract class RoomGame p.id).map(p => [p.id, p]))` */ - playerTable: {[userid: string]: PlayerClass} = Object.create(null); + playerTable: { [userid: string]: PlayerClass } = Object.create(null); players: PlayerClass[] = []; playerCount = 0; playerCap = 0; @@ -134,7 +134,8 @@ export abstract class RoomGame, start: (force?: User) => void, stop: (force?: User) => void} | NodeJS.Timer | null; + timer?: { timerRequesters?: Set, start: (force?: User) => void, stop: (force?: User) => void } | + NodeJS.Timeout | null; constructor(room: Room, isSubGame = false) { this.roomid = room.roomid; this.room = room; @@ -154,15 +155,12 @@ export abstract class RoomGame { +export abstract class SimpleRoomGame extends RoomGame { makePlayer(user: User | string | null, ...rest: any[]): RoomGamePlayer { const num = this.players.length ? this.players[this.players.length - 1].num : 1; return new RoomGamePlayer(user, this, num); diff --git a/server/room-minor-activity.ts b/server/room-minor-activity.ts index f2c8ef5d8f..34d9976f15 100644 --- a/server/room-minor-activity.ts +++ b/server/room-minor-activity.ts @@ -26,12 +26,12 @@ export interface MinorActivityData { question: string; supportHTML: boolean; multiPoll: boolean; - pendingVotes?: {[userid: string]: number[]}; - voters?: {[k: string]: number[]}; - voterIps?: {[k: string]: number[]}; + pendingVotes?: { [userid: string]: number[] }; + voters?: { [k: string]: number[] }; + voterIps?: { [k: string]: number[] }; totalVotes?: number; isQuiz?: boolean; - answers: string[] | {name: string, votes: number, correct?: boolean}[]; + answers: string[] | { name: string, votes: number, correct?: boolean }[]; } // globally Rooms.MinorActivity @@ -39,7 +39,7 @@ export abstract class MinorActivity { abstract activityid: ID; abstract name: string; - timeout: NodeJS.Timer | null; + timeout: NodeJS.Timeout | null; timeoutMins: number; timerEnd: number; roomid: RoomID; @@ -54,7 +54,7 @@ export abstract class MinorActivity { this.supportHTML = false; } - setTimer(options: {timeoutMins?: number, timerEnd?: number}) { + setTimer(options: { timeoutMins?: number, timerEnd?: number }) { if (this.timeout) clearTimeout(this.timeout); this.timeoutMins = options.timeoutMins || 0; @@ -95,7 +95,7 @@ export abstract class MinorActivity { if (!MinorActivityClass) { if (pollData.activityid === 'poll') { - const {Poll} = require('./chat-plugins/poll'); + const { Poll } = require('./chat-plugins/poll'); room.setMinorActivity(new Poll(room, pollData)); } } else { diff --git a/server/roomlogs.ts b/server/roomlogs.ts index 5fd47f172a..5cdf745c6c 100644 --- a/server/roomlogs.ts +++ b/server/roomlogs.ts @@ -7,9 +7,9 @@ * @license MIT */ -import {FS, Utils, type Streams} from '../lib'; -import {PGDatabase, SQL, SQLStatement} from '../lib/database'; -import type {PartialModlogEntry} from './modlog'; +import { FS, Utils, type Streams } from '../lib'; +import { PGDatabase, SQL, type SQLStatement } from '../lib/database'; +import type { PartialModlogEntry } from './modlog'; interface RoomlogOptions { isMultichannel?: boolean; @@ -246,7 +246,7 @@ export class Roomlog { // const section = !this.noLogTimes ? 4 : 3; // ['', 'c' timestamp?, author, message] if (line.startsWith(messageStart)) { const parts = Utils.splitFirst(line, '|', section); - return {user: parts[section - 1], message: parts[section]}; + return { user: parts[section - 1], message: parts[section] }; } } } @@ -257,12 +257,12 @@ export class Roomlog { const chatData = this.parseChatLine(message); const type = message.split('|')[1] || ""; void this.insertLog(SQL`INSERT INTO roomlogs (${{ - type: type, + type, roomid: this.roomid, userid: toID(chatData?.user) || null, time: SQL`now()`, log: message, - }})`); + }})`); const dateStr = Chat.toTimestamp(date).split(' ')[0]; void this.insertLog(SQL`INSERT INTO roomlog_dates (${{ @@ -290,7 +290,7 @@ export class Roomlog { e.message?.includes('Connection terminated unexpectedly') ) { // delay before retrying - await new Promise(resolve => setTimeout(resolve, 2000)); + await new Promise(resolve => { setTimeout(resolve, 2000); }); return this.insertLog(query, ignoreFailure, retries - 1); } // crashlog for all other errors @@ -308,7 +308,7 @@ export class Roomlog { const roomlogStreamExisted = this.roomlogStream !== null; await this.destroy(); if (this.roomlogTable) { - await this.roomlogTable.updateAll({roomid: newID})`WHERE roomid = ${this.roomid}`; + await this.roomlogTable.updateAll({ roomid: newID })`WHERE roomid = ${this.roomid}`; } else { const roomlogPath = `chat`; const [roomlogExists, newRoomlogExists] = await Promise.all([ @@ -328,7 +328,7 @@ export class Roomlog { this.roomid = newID; return true; } - static rollLogs() { + static rollLogs(this: void) { if (Roomlogs.rollLogTimer === true) return; if (Roomlogs.rollLogTimer) { clearTimeout(Roomlogs.rollLogTimer); diff --git a/server/rooms.ts b/server/rooms.ts index abae5ca444..1d1b3ed403 100644 --- a/server/rooms.ts +++ b/server/rooms.ts @@ -28,21 +28,21 @@ const LAST_BATTLE_WRITE_THROTTLE = 10; const RETRY_AFTER_LOGIN = null; -import {FS, Utils, Streams} from '../lib'; -import {RoomSection, RoomSections} from './chat-commands/room-settings'; -import {QueuedHunt} from './chat-plugins/scavengers'; -import {ScavengerGameTemplate} from './chat-plugins/scavenger-games'; -import {RepeatedPhrase} from './chat-plugins/repeats'; +import { FS, Utils, Streams } from '../lib'; +import { type RoomSection, RoomSections } from './chat-commands/room-settings'; +import { type QueuedHunt } from './chat-plugins/scavengers'; +import { type ScavengerGameTemplate } from './chat-plugins/scavenger-games'; +import { type RepeatedPhrase } from './chat-plugins/repeats'; import { PM as RoomBattlePM, RoomBattle, RoomBattlePlayer, RoomBattleTimer, type RoomBattleOptions, } from "./room-battle"; -import {BestOfGame} from './room-battle-bestof'; -import {RoomGame, SimpleRoomGame, RoomGamePlayer} from './room-game'; -import {MinorActivity, MinorActivityData} from './room-minor-activity'; -import {Roomlogs, type Roomlog} from './roomlogs'; -import {RoomAuth} from './user-groups'; -import {PartialModlogEntry, mainModlog} from './modlog'; -import {Replays} from './replays'; +import { BestOfGame } from './room-battle-bestof'; +import { RoomGame, SimpleRoomGame, RoomGamePlayer } from './room-game'; +import { MinorActivity, type MinorActivityData } from './room-minor-activity'; +import { Roomlogs, type Roomlog } from './roomlogs'; +import { RoomAuth } from './user-groups'; +import { type PartialModlogEntry, mainModlog } from './modlog'; +import { Replays } from './replays'; import * as crypto from 'crypto'; /********************************************************* @@ -85,7 +85,7 @@ interface UserTable { export interface RoomSettings { title: string; - auth: {[userid: string]: GroupSymbol}; + auth: { [userid: string]: GroupSymbol }; creationTime: number; section?: RoomSection; @@ -98,7 +98,7 @@ export interface RoomSettings { staffRoom?: boolean; language?: ID | false; slowchat?: number | false; - events?: {[k: string]: RoomEvent | RoomEventAlias | RoomEventCategory}; + events?: { [k: string]: RoomEvent | RoomEventAlias | RoomEventCategory }; filterStretching?: boolean; filterEmojis?: boolean; filterCaps?: boolean; @@ -118,7 +118,7 @@ export interface RoomSettings { rulesLink?: string | null; dataCommandTierDisplay?: 'tiers' | 'doubles tiers' | 'National Dex tiers' | 'numbers'; requestShowEnabled?: boolean | null; - permissions?: {[k: string]: GroupSymbol}; + permissions?: { [k: string]: GroupSymbol }; minorActivity?: PollData | AnnouncementData; minorActivityQueue?: MinorActivityData[]; repeats?: RepeatedPhrase[]; @@ -148,11 +148,11 @@ export type MessageHandler = (room: BasicRoom, message: string) => void; export type Room = GameRoom | ChatRoom; export type PrivacySetting = boolean | 'hidden' | 'voice' | 'unlisted'; -import type {AnnouncementData} from './chat-plugins/announcements'; -import type {PollData} from './chat-plugins/poll'; -import type {AutoResponder} from './chat-plugins/responder'; -import type {RoomEvent, RoomEventAlias, RoomEventCategory} from './chat-plugins/room-events'; -import type {Tournament, TournamentRoomSettings} from './tournaments/index'; +import type { AnnouncementData } from './chat-plugins/announcements'; +import type { PollData } from './chat-plugins/poll'; +import type { AutoResponder } from './chat-plugins/responder'; +import type { RoomEvent, RoomEventAlias, RoomEventCategory } from './chat-plugins/room-events'; +import type { Tournament, TournamentRoomSettings } from './tournaments/index'; export abstract class BasicRoom { /** to rename use room.rename */ @@ -202,8 +202,8 @@ export abstract class BasicRoom { readonly muteQueue: MuteEntry[]; userCount: number; active: boolean; - muteTimer: NodeJS.Timer | null; - modchatTimer: NodeJS.Timer | null; + muteTimer: NodeJS.Timeout | null; + modchatTimer: NodeJS.Timeout | null; lastUpdate: number; lastBroadcast: string; lastBroadcastTime: number; @@ -219,13 +219,13 @@ export abstract class BasicRoom { reportJoins: boolean; batchJoins: number; - reportJoinsInterval: NodeJS.Timer | null; + reportJoinsInterval: NodeJS.Timeout | null; minorActivity: MinorActivity | null; minorActivityQueue: MinorActivityData[] | null; banwordRegex: RegExp | true | null; - logUserStatsInterval: NodeJS.Timer | null; - expireTimer: NodeJS.Timer | null; + logUserStatsInterval: NodeJS.Timeout | null; + expireTimer: NodeJS.Timeout | null; userList: string; pendingApprovals: Map | null; @@ -509,8 +509,6 @@ export abstract class BasicRoom { } if (this.parent) return this.parent.getMuteTime(user); } - // I think putting the `new` before the signature is confusing the linter - // eslint-disable-next-line @typescript-eslint/type-annotation-spacing getGame(constructor: new (...args: any[]) => T, subGame = false): T | null { // TODO: switch to `static readonly gameid` when all game files are TypeScripted if (subGame && this.subGame && this.subGame.constructor.name === constructor.name) return this.subGame as T; @@ -650,7 +648,7 @@ export abstract class BasicRoom { logUserStats() { let total = 0; let guests = 0; - const groups: {[k: string]: number} = {}; + const groups: { [k: string]: number } = {}; for (const group of Config.groupsranking) { groups[group] = 0; } @@ -662,9 +660,9 @@ export abstract class BasicRoom { } ++groups[this.auth.get(user.id)]; } - let entry = '|userstats|total:' + total + '|guests:' + guests; + let entry = `|userstats|total:${total}|guests:${guests}`; for (const i in groups) { - entry += '|' + i + ':' + groups[i]; + entry += `|${i}:${groups[i]}`; } this.roomlog(entry); } @@ -752,14 +750,16 @@ export abstract class BasicRoom { } message += `Comment: ${entry.comment ? entry.comment : 'None.'}
    `; message += `` + - `
    `; + `
    `; message += `
    `; } message += ``; messages.push(message); } - if (!this.settings.isPrivate && !this.settings.isPersonal && - this.settings.modchat && this.settings.modchat !== 'autoconfirmed') { + if ( + !this.settings.isPrivate && !this.settings.isPersonal && + this.settings.modchat && this.settings.modchat !== 'autoconfirmed' + ) { messages.push(`|raw|
    Modchat currently set to ${this.settings.modchat}
    `); } return messages.join('\n'); @@ -968,7 +968,7 @@ export abstract class BasicRoom { user.send(`>${oldID}\n|noinit|rename|${newID}|${newTitle}`); } - if (this.parent && this.parent.subRooms) { + if (this.parent?.subRooms) { (this as any).parent.subRooms.delete(oldID); (this as any).parent.subRooms.set(newID, this as ChatRoom); } @@ -1076,14 +1076,14 @@ export abstract class BasicRoom { // they are staff and online const staff = Object.values(this.users).filter(u => this.auth.atLeast(u, '%')); if (!staff.length) { - const {time} = this.settings.autoModchat; + const { time } = this.settings.autoModchat; if (!time || time < 5) { throw new Error(`Invalid time setting for automodchat (${Utils.visualize(this.settings.autoModchat)})`); } if (this.modchatTimer) return; this.modchatTimer = setTimeout(() => { if (!this.settings.autoModchat) return; - const {rank} = this.settings.autoModchat; + const { rank } = this.settings.autoModchat; const oldSetting = this.settings.modchat; this.settings.modchat = rank; this.add( @@ -1276,7 +1276,7 @@ export class GlobalRoomState { } else { // Prevent there from being two possible hidden classes an instance // of GlobalRoom can have. - this.ladderIpLog = new Streams.WriteStream({write() { return undefined; }}); + this.ladderIpLog = new Streams.WriteStream({ write() { return undefined; } }); } this.reportUserStatsInterval = setInterval( @@ -1323,7 +1323,7 @@ export class GlobalRoomState { }; } deserializeBattleRoom(battle: NonNullable>>) { - const {inputLog, players, roomid, title, rated, timer} = battle; + const { inputLog, players, roomid, title, rated, timer } = battle; const [, formatid] = roomid.split('-'); const room = Rooms.createBattle({ format: formatid, @@ -1334,7 +1334,7 @@ export class GlobalRoomState { players: [], delayedTimer: timer.active, }); - if (!room || !room.battle) return false; // shouldn't happen??? + if (!room?.battle) return false; // shouldn't happen??? if (timer) { // json blob of settings Object.assign(room.battle.timer.settings, timer); } @@ -1384,7 +1384,7 @@ export class GlobalRoomState { const stream = Monitor.logPath('battles.jsonl').createReadStream(); await stream.fd; input = stream.byLine(); - } catch (e) { + } catch { return; } for await (const line of input) { @@ -1420,7 +1420,7 @@ export class GlobalRoomState { JSON.stringify(this.settingsList) .replace(/\{"title":/g, '\n{"title":') .replace(/\]$/, '\n]') - ), {throttle: 5000}); + ), { throttle: 5000 }); } writeNumRooms() { @@ -1457,7 +1457,7 @@ export class GlobalRoomState { if (this.formatList) { return this.formatList; } - this.formatList = '|formats' + (Ladders.formatsListPrefix || ''); + this.formatList = `|formats${Ladders.formatsListPrefix || ''}`; let section = ''; let prevSection = ''; let curColumn = 1; @@ -1469,9 +1469,9 @@ export class GlobalRoomState { if (section !== prevSection) { prevSection = section; - this.formatList += '|,' + curColumn + '|' + section; + this.formatList += `|,${curColumn}|${section}`; } - this.formatList += '|' + format.name; + this.formatList += `|${format.name}`; let displayCode = 0; if (format.team) displayCode |= 1; if (format.searchShow) displayCode |= 2; @@ -1480,7 +1480,7 @@ export class GlobalRoomState { const ruleTable = Dex.formats.getRuleTable(format); const level = ruleTable.adjustLevel || ruleTable.adjustLevelDown || ruleTable.maxLevel; if (level === 50) displayCode |= 16; - // 32 was previously used for Multi Battles + // 32 was previously used for Multi Battles if (format.bestOfDefault) displayCode |= 64; if (format.teraPreviewDefault) displayCode |= 128; this.formatList += ',' + displayCode.toString(16); @@ -1506,7 +1506,7 @@ export class GlobalRoomState { rankList.push({ symbol: rank, name: (Config.groups[rank].name || null), - type: groupType}); // send the first character in the rank, incase they put a string several characters long + type: groupType }); // send the first character in the rank, incase they put a string several characters long } const typeOrder = ['punishment', 'normal', 'staff', 'leadership']; @@ -1515,7 +1515,7 @@ export class GlobalRoomState { // add the punishment types at the very end. for (const rank in Config.punishgroups) { - rankList.push({symbol: Config.punishgroups[rank].symbol, name: Config.punishgroups[rank].name, type: 'punishment'}); + rankList.push({ symbol: Config.punishgroups[rank].symbol, name: Config.punishgroups[rank].name, type: 'punishment' }); } Config.rankList = '|customgroups|' + JSON.stringify(rankList) + '\n'; @@ -1543,7 +1543,7 @@ export class GlobalRoomState { rooms.push(room); } - const roomTable: {[roomid: string]: BattleRoomTable} = {}; + const roomTable: { [roomid: string]: BattleRoomTable } = {}; for (let i = rooms.length - 1; i >= rooms.length - 100 && i >= 0; i--) { const room = rooms[i]; const roomData: BattleRoomTable = {}; @@ -1741,8 +1741,7 @@ export class GlobalRoomState { startLockdown(err: Error | null = null, slow = false) { if (this.lockdown && err) return; const devRoom = Rooms.get('development'); - // @ts-ignore - const stack = (err ? Utils.escapeHTML(err.stack).split(`\n`).slice(0, 2).join(`
    `) : ``); + const stack = (err ? Utils.escapeHTML(err.stack!).split(`\n`).slice(0, 2).join(`
    `) : ``); for (const [id, curRoom] of Rooms.rooms) { if (err) { if (id === 'staff' || id === 'development' || (!devRoom && id === 'lobby')) { @@ -1756,9 +1755,9 @@ export class GlobalRoomState { curRoom.addRaw(`
    The server is restarting soon.
    Please finish your battles quickly. No new battles can be started until the server resets in a few minutes.
    `).update(); } const game = curRoom.game; - // @ts-ignore TODO: revisit when game.timer is standardized - if (!slow && game && game.timer && typeof game.timer.start === 'function' && !game.ended) { - // @ts-ignore + // @ts-expect-error TODO: revisit when game.timer is standardized + if (!slow && game?.timer && typeof game.timer.start === 'function' && !game.ended) { + // @ts-expect-error see above game.timer.start(); if (curRoom.settings.modchat !== '+') { curRoom.settings.modchat = '+'; @@ -1923,7 +1922,7 @@ export class GameRoom extends BasicRoom { // console.log("NEW BATTLE"); this.tour = options.tour || null; - this.setParent((options as any).parent || (this.tour && this.tour.room) || null); + this.setParent((options as any).parent || this.tour?.room || null); this.p1 = options.players?.[0]?.user || null; this.p2 = options.players?.[1]?.user || null; @@ -1975,10 +1974,8 @@ export class GameRoom extends BasicRoom { requestModchat(user: User | null) { if (!user) { this.modchatUser = ''; - return; } else if (!this.modchatUser || this.modchatUser === user.id || this.auth.get(user.id) !== Users.PLAYER_SYMBOL) { this.modchatUser = user.id; - return; } else { return "Modchat can only be changed by the user who turned it on, or by staff"; } @@ -2047,7 +2044,7 @@ export class GameRoom extends BasicRoom { const log = this.getLog(hideDetails ? 0 : -1); let rating: number | undefined; if (battle.ended && this.rated) rating = this.rated; - let {id, password} = this.getReplayData(); + let { id, password } = this.getReplayData(); const silent = options === 'forpunishment' || options === 'silent' || options === 'auto'; if (silent) connection = undefined; const isPrivate = this.settings.isPrivate || this.hideReplay; @@ -2121,10 +2118,10 @@ export class GameRoom extends BasicRoom { } getReplayData() { - if (!this.roomid.endsWith('pw')) return {id: this.roomid.slice(7), password: null}; + if (!this.roomid.endsWith('pw')) return { id: this.roomid.slice(7), password: null }; const end = this.roomid.length - 2; const lastHyphen = this.roomid.lastIndexOf('-', end); - return {id: this.roomid.slice(7, lastHyphen), password: this.roomid.slice(lastHyphen + 1, end)}; + return { id: this.roomid.slice(7, lastHyphen), password: this.roomid.slice(lastHyphen + 1, end) }; } } diff --git a/server/sockets.ts b/server/sockets.ts index 55f7f3264a..db98702bda 100644 --- a/server/sockets.ts +++ b/server/sockets.ts @@ -15,9 +15,9 @@ import * as fs from 'fs'; import * as http from 'http'; import * as https from 'https'; import * as path from 'path'; -import {crashlogger, ProcessManager, Streams, Repl} from '../lib'; -import {IPTools} from './ip-tools'; -import {ChannelID, extractChannelMessages} from '../sim/battle'; +import { crashlogger, ProcessManager, Streams, Repl } from '../lib'; +import { IPTools } from './ip-tools'; +import { type ChannelID, extractChannelMessages } from '../sim/battle'; type StreamWorker = ProcessManager.StreamWorker; @@ -59,7 +59,7 @@ export const Sockets = new class { } } } - onUnspawn(worker: StreamWorker) { + onUnspawn(this: void, worker: StreamWorker) { Users.socketDisconnectAll(worker, worker.workerid); } @@ -87,7 +87,7 @@ export const Sockets = new class { workerCount = (Config.workers !== undefined ? Config.workers : 1); } - PM.env = {PSPORT: Config.port, PSBINDADDR: Config.bindaddress || '0.0.0.0', PSNOSSL: Config.ssl ? 0 : 1}; + PM.env = { PSPORT: Config.port, PSBINDADDR: Config.bindaddress || '0.0.0.0', PSNOSSL: Config.ssl ? 0 : 1 }; PM.subscribeSpawn(worker => void this.onSpawn(worker)); PM.subscribeUnspawn(this.onUnspawn); @@ -145,7 +145,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { isTrustedProxyIp: (ip: string) => boolean; - receivers: {[k: string]: (this: ServerStream, data: string) => void} = { + receivers: { [k: string]: (this: ServerStream, data: string) => void } = { '$'(data) { // $code // eslint-disable-next-line no-eval @@ -259,7 +259,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { for (const [curSocketid, curSocket] of room) { const channelid = roomChannel?.get(curSocketid) || 0; if (!messages[channelid]) messages[channelid] = channelMessages[channelid].join('\n'); - curSocket.write(messages[channelid]!); + curSocket.write(messages[channelid]); } }, }; @@ -317,7 +317,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { `Socket process ${process.pid}` ); } - } catch (e: any) { + } catch { console.warn('SSL certificate config values will not support HTTPS server option values in the future. Please set it to use the absolute path of its PEM file.'); cert = config.ssl.options.cert; } @@ -325,7 +325,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { if (key && cert) { try { // In case there are additional SSL config settings besides the key and cert... - this.serverSsl = https.createServer({...config.ssl.options, key, cert}); + this.serverSsl = https.createServer({ ...config.ssl.options, key, cert }); } catch (e: any) { crashlogger(new Error(`The SSL settings are misconfigured:\n${e.stack}`), `Socket process ${process.pid}`); } @@ -344,8 +344,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { // console.log(`static rq: ${req.socket.remoteAddress}:${req.socket.remotePort} -> ${req.socket.localAddress}:${req.socket.localPort} - ${req.method} ${req.url} ${req.httpVersion} - ${req.rawHeaders.join('|')}`); req.resume(); req.addListener('end', () => { - if (config.customhttpresponse && - config.customhttpresponse(req, res)) { + if (config.customhttpresponse?.(req, res)) { return; } @@ -385,7 +384,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { // and doing things on our server. const sockjs: typeof import('sockjs') = (require as any)('sockjs'); - const options: import('sockjs').ServerOptions & {faye_server_options?: {[key: string]: any}} = { + const options: import('sockjs').ServerOptions & { faye_server_options?: { [key: string]: any } } = { sockjs_url: `//play.pokemonshowdown.com/js/lib/sockjs-1.4.0-nwjsfix.min.js`, prefix: '/showdown', log(severity: string, message: string) { @@ -396,7 +395,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { if (config.wsdeflate !== null) { try { const deflate = (require as any)('permessage-deflate').configure(config.wsdeflate); - options.faye_server_options = {extensions: [deflate]}; + options.faye_server_options = { extensions: [deflate] }; } catch { crashlogger( new Error("Dependency permessage-deflate is not installed or is otherwise unaccessable. No message compression will take place until server restart."), @@ -418,9 +417,9 @@ export class ServerStream extends Streams.ObjectReadWriteStream { if (this.serverSsl) { server.installHandlers(this.serverSsl, {}); - // @ts-ignore - if appssl exists, then `config.ssl` must also exist + // @ts-expect-error if appssl exists, then `config.ssl` must also exist this.serverSsl.listen(config.ssl.port, config.bindaddress); - // @ts-ignore - if appssl exists, then `config.ssl` must also exist + // @ts-expect-error if appssl exists, then `config.ssl` must also exist console.log(`Worker ${PM.workerid} now listening for SSL on port ${config.ssl.port}`); } @@ -463,7 +462,7 @@ export class ServerStream extends Streams.ObjectReadWriteStream { return; } - const socketid = '' + (++this.socketCounter); + const socketid = `${++this.socketCounter}`; this.sockets.set(socketid, socket); let socketip = socket.remoteAddress; diff --git a/server/team-validator-async.ts b/server/team-validator-async.ts index 998e111f70..0f2a65e854 100644 --- a/server/team-validator-async.ts +++ b/server/team-validator-async.ts @@ -7,7 +7,7 @@ * @license MIT */ -import {TeamValidator} from '../sim/team-validator'; +import { TeamValidator } from '../sim/team-validator'; export class TeamValidatorAsync { format: Format; @@ -16,16 +16,16 @@ export class TeamValidatorAsync { this.format = Dex.formats.get(format); } - validateTeam(team: string, options?: {removeNicknames?: boolean, user?: ID}) { + validateTeam(team: string, options?: { removeNicknames?: boolean, user?: ID }) { let formatid = this.format.id; if (this.format.customRules) formatid += '@@@' + this.format.customRules.join(','); if (team.length > (25 * 1024 - 6)) { // don't even let it go to the child process return Promise.resolve('0Your team is over 25KB. Please use a smaller team.'); } - return PM.query({formatid, options, team}); + return PM.query({ formatid, options, team }); } - static get(format: string) { + static get(this: void, format: string) { return new TeamValidatorAsync(format); } } @@ -36,12 +36,12 @@ export const get = TeamValidatorAsync.get; * Process manager *********************************************************/ -import {QueryProcessManager} from '../lib/process-manager'; +import { QueryProcessManager } from '../lib/process-manager'; export const PM = new QueryProcessManager<{ - formatid: string, options?: {removeNicknames?: boolean}, team: string, + formatid: string, options?: { removeNicknames?: boolean }, team: string, }>(module, message => { - const {formatid, options, team} = message; + const { formatid, options, team } = message; const parsedTeam = Teams.unpack(team); if (Config.debugvalidatorprocesses && process.send) { diff --git a/server/tournaments/generator-elimination.ts b/server/tournaments/generator-elimination.ts index fa7983ba31..35920d6f89 100644 --- a/server/tournaments/generator-elimination.ts +++ b/server/tournaments/generator-elimination.ts @@ -1,4 +1,4 @@ -import {Utils} from '../../lib'; +import { Utils } from '../../lib'; interface ElimTree { root: ElimNode; @@ -6,7 +6,7 @@ interface ElimTree { nextLayerLeafNodes: ElimNode[]; } -import type {TournamentPlayer} from './index'; +import type { TournamentPlayer } from './index'; /** * There are two types of elim nodes, player nodes @@ -95,13 +95,11 @@ class ElimNode { } return undefined; } - // eslint-disable-next-line no-restricted-globals [Symbol.iterator]() { const results: ElimNode[] = [this]; for (const result of results) { if (result.children) results.push(...result.children); } - // eslint-disable-next-line no-restricted-globals return results[Symbol.iterator](); } toJSON() { @@ -193,7 +191,7 @@ export class Elimination { for (const user of Utils.shuffle(players)) { if (!tree) { tree = { - root: new ElimNode({user}), + root: new ElimNode({ user }), currentLayerLeafNodes: [], nextLayerLeafNodes: [], }; @@ -203,10 +201,10 @@ export class Elimination { const targetNode = tree.currentLayerLeafNodes.shift(); if (!targetNode) throw new Error(`TypeScript bug: no ! in checkJs`); - const newLeftChild = new ElimNode({user: targetNode.user}); + const newLeftChild = new ElimNode({ user: targetNode.user }); tree.nextLayerLeafNodes.push(newLeftChild); - const newRightChild = new ElimNode({user}); + const newRightChild = new ElimNode({ user }); tree.nextLayerLeafNodes.push(newRightChild); targetNode.setChildren([newLeftChild, newRightChild]); @@ -222,8 +220,8 @@ export class Elimination { this.maxSubtrees = Math.min(this.maxSubtrees, players.length - 1); for (let losersBracketIndex = 1; losersBracketIndex < this.maxSubtrees; losersBracketIndex++) { - const matchesByDepth: {[depth: number]: ElimNode[]} = {}; - const queue = [{node: tree.root, depth: 0}]; + const matchesByDepth: { [depth: number]: ElimNode[] } = {}; + const queue = [{ node: tree.root, depth: 0 }]; let frame; while ((frame = queue.shift())) { if (!frame.node.children || frame.node.losersBracketNode) continue; @@ -231,12 +229,12 @@ export class Elimination { if (!matchesByDepth[frame.depth]) matchesByDepth[frame.depth] = []; matchesByDepth[frame.depth].push(frame.node); - queue.push({node: frame.node.children[0], depth: frame.depth + 1}); - queue.push({node: frame.node.children[1], depth: frame.depth + 1}); + queue.push({ node: frame.node.children[0], depth: frame.depth + 1 }); + queue.push({ node: frame.node.children[1], depth: frame.depth + 1 }); } const newTree: ElimTree = { - root: new ElimNode({losersBracketIndex, fromNode: matchesByDepth[0][0]}), + root: new ElimNode({ losersBracketIndex, fromNode: matchesByDepth[0][0] }), currentLayerLeafNodes: [], nextLayerLeafNodes: [], }; @@ -258,13 +256,13 @@ export class Elimination { const oldLeafFromNode = oldLeaf.fromNode; oldLeaf.fromNode = null; - const newBranch = new ElimNode({losersBracketIndex}); - oldLeaf.setChildren([new ElimNode({losersBracketIndex, fromNode: oldLeafFromNode}), newBranch]); + const newBranch = new ElimNode({ losersBracketIndex }); + oldLeaf.setChildren([new ElimNode({ losersBracketIndex, fromNode: oldLeafFromNode }), newBranch]); - const newLeftChild = new ElimNode({losersBracketIndex, fromNode: matchesThisDepth[n]}); + const newLeftChild = new ElimNode({ losersBracketIndex, fromNode: matchesThisDepth[n] }); newTree.nextLayerLeafNodes.push(newLeftChild); - const newRightChild = new ElimNode({losersBracketIndex, fromNode: matchesThisDepth[n + 1]}); + const newRightChild = new ElimNode({ losersBracketIndex, fromNode: matchesThisDepth[n + 1] }); newTree.nextLayerLeafNodes.push(newRightChild); newBranch.setChildren([newLeftChild, newRightChild]); } @@ -278,9 +276,9 @@ export class Elimination { const oldLeafFromNode = oldLeaf.fromNode; oldLeaf.fromNode = null; - const newLeaf = new ElimNode({fromNode: matchesThisDepth[n]}); + const newLeaf = new ElimNode({ fromNode: matchesThisDepth[n] }); newTree.nextLayerLeafNodes.push(newLeaf); - oldLeaf.setChildren([new ElimNode({fromNode: oldLeafFromNode}), newLeaf]); + oldLeaf.setChildren([new ElimNode({ fromNode: oldLeafFromNode }), newLeaf]); } newTree.currentLayerLeafNodes = newTree.nextLayerLeafNodes; @@ -300,7 +298,7 @@ export class Elimination { } tree.root.traverse(node => { - if (node.children && node.children[0].user && node.children[1].user) { + if (node.children?.[0].user && node.children[1].user) { node.state = 'available'; } }); @@ -334,7 +332,7 @@ export class Elimination { return undefined; }); if (found) { - // @ts-ignore + // @ts-expect-error TODO: refactor to fix this const error = this.setMatchResult(found.match, found.result, found.score); if (error) { throw new Error(`Unexpected ${error} from setMatchResult([${found.match.join(', ')}], ${found.result})`); @@ -396,8 +394,8 @@ export class Elimination { if (loser.losses <= winner.losses && !loser.isDisqualified) { // grand subfinals rematch - const newNode = new ElimNode({state: 'available', losersBracketNode: targetNode.losersBracketNode}); - newNode.setChildren([targetNode, new ElimNode({user: loser})]); + const newNode = new ElimNode({ state: 'available', losersBracketNode: targetNode.losersBracketNode }); + newNode.setChildren([targetNode, new ElimNode({ user: loser })]); parent.setChildren([newNode, parent.children![1]]); return; } @@ -418,8 +416,8 @@ export class Elimination { } } } else if (loser.losses < this.maxSubtrees && !loser.isDisqualified) { - const newRoot = new ElimNode({state: 'available'}); - newRoot.setChildren([targetNode, new ElimNode({user: loser})]); + const newRoot = new ElimNode({ state: 'available' }); + newRoot.setChildren([targetNode, new ElimNode({ user: loser })]); this.treeRoot = newRoot; } diff --git a/server/tournaments/generator-round-robin.ts b/server/tournaments/generator-round-robin.ts index a342df1324..d9195e3279 100644 --- a/server/tournaments/generator-round-robin.ts +++ b/server/tournaments/generator-round-robin.ts @@ -4,8 +4,8 @@ interface Match { result?: string; } -import {Utils} from '../../lib/utils'; -import type {TournamentPlayer} from './index'; +import { Utils } from '../../lib/utils'; +import type { TournamentPlayer } from './index'; export class RoundRobin { readonly name: string; @@ -88,7 +88,7 @@ export class RoundRobin { if (!this.isDoubles && col >= row) return null; if (p1 === p2) return null; - return {state: 'available'}; + return { state: 'available' }; }) ); this.matchesPerPlayer = players.length - 1; diff --git a/server/tournaments/index.ts b/server/tournaments/index.ts index 554f86e1df..09e6391869 100644 --- a/server/tournaments/index.ts +++ b/server/tournaments/index.ts @@ -1,9 +1,8 @@ - -import {Elimination} from './generator-elimination'; -import {RoundRobin} from './generator-round-robin'; -import {Utils} from '../../lib'; -import {PRNG} from '../../sim/prng'; -import type {BestOfGame} from '../room-battle-bestof'; +import { Elimination } from './generator-elimination'; +import { RoundRobin } from './generator-round-robin'; +import { Utils } from '../../lib'; +import { PRNG } from '../../sim/prng'; +import type { BestOfGame } from '../room-battle-bestof'; export interface TournamentRoomSettings { allowModjoin?: boolean; @@ -16,7 +15,7 @@ export interface TournamentRoomSettings { forceTimer?: boolean; playerCap?: number; recentToursLength?: number; - recentTours?: {name: string, baseFormat: string, time: number}[]; + recentTours?: { name: string, baseFormat: string, time: number }[]; blockRecents?: boolean; } @@ -48,7 +47,7 @@ function usersToNames(users: TournamentPlayer[]) { export class TournamentPlayer extends Rooms.RoomGamePlayer { readonly availableMatches: Set; isBusy: boolean; - inProgressMatch: {to: TournamentPlayer, room: GameRoom} | null; + inProgressMatch: { to: TournamentPlayer, room: GameRoom } | null; pendingChallenge: { from?: TournamentPlayer, to?: TournamentPlayer, @@ -154,7 +153,7 @@ export class Tournament extends Rooms.RoomGame { this.bracketCache = null; this.isAvailableMatchesInvalidated = true; - this.availableMatchesCache = {challenges: new Map(), challengeBys: new Map()}; + this.availableMatchesCache = { challenges: new Map(), challengeBys: new Map() }; this.autoDisqualifyTimeout = Infinity; this.autoDisqualifyTimer = null; @@ -200,7 +199,7 @@ export class Tournament extends Rooms.RoomGame { } this.generator = generator; - this.room.send(`|tournament|update|${JSON.stringify({generator: generator.name})}`); + this.room.send(`|tournament|update|${JSON.stringify({ generator: generator.name })}`); this.isBracketInvalidated = true; this.update(); return true; @@ -231,7 +230,7 @@ export class Tournament extends Rooms.RoomGame { this.customRules = customRules; if (this.name === this.baseFormat) { this.name = this.getDefaultCustomName(); - this.room.send(`|tournament|update|${JSON.stringify({format: this.name})}`); + this.room.send(`|tournament|update|${JSON.stringify({ format: this.name })}`); this.update(); } return true; @@ -290,8 +289,8 @@ export class Tournament extends Rooms.RoomGame { (this.isTournamentStarted && this.isAvailableMatchesInvalidated)) { this.room.add( "Error: update() called with a target user when data invalidated: " + - (!this.bracketUpdateTimer && this.isBracketInvalidated) + ", " + - (this.isTournamentStarted && this.isAvailableMatchesInvalidated) + + `${!this.bracketUpdateTimer && this.isBracketInvalidated}, ` + + `${this.isTournamentStarted && this.isAvailableMatchesInvalidated}` + "; Please report this to an admin." ); return; @@ -335,9 +334,9 @@ export class Tournament extends Rooms.RoomGame { const pendingChallenge = this.playerTable[targetUser.id].pendingChallenge; if (pendingChallenge) { if (pendingChallenge.to) { - connection.sendTo(this.room, `|tournament|update|${JSON.stringify({challenging: pendingChallenge.to.name})}`); + connection.sendTo(this.room, `|tournament|update|${JSON.stringify({ challenging: pendingChallenge.to.name })}`); } else if (pendingChallenge.from) { - connection.sendTo(this.room, `|tournament|update|${JSON.stringify({challenged: pendingChallenge.from.name})}`); + connection.sendTo(this.room, `|tournament|update|${JSON.stringify({ challenged: pendingChallenge.from.name })}`); } } } @@ -358,7 +357,7 @@ export class Tournament extends Rooms.RoomGame { this.bracketCache = this.getBracketData(); this.isBracketInvalidated = false; - this.room.send(`|tournament|update|${JSON.stringify({bracketData: this.bracketCache})}`); + this.room.send(`|tournament|update|${JSON.stringify({ bracketData: this.bracketCache })}`); } } @@ -367,10 +366,10 @@ export class Tournament extends Rooms.RoomGame { this.isAvailableMatchesInvalidated = false; for (const [player, opponents] of this.availableMatchesCache.challenges) { - player.sendRoom(`|tournament|update|${JSON.stringify({challenges: usersToNames(opponents)})}`); + player.sendRoom(`|tournament|update|${JSON.stringify({ challenges: usersToNames(opponents) })}`); } for (const [player, opponents] of this.availableMatchesCache.challengeBys) { - player.sendRoom(`|tournament|update|${JSON.stringify({challengeBys: usersToNames(opponents)})}`); + player.sendRoom(`|tournament|update|${JSON.stringify({ challengeBys: usersToNames(opponents) })}`); } } this.room.send('|tournament|updateEnd'); @@ -415,8 +414,10 @@ export class Tournament extends Rooms.RoomGame { return; } - if ((this.room.settings.tournaments?.autoconfirmedOnly || this.autoconfirmedOnly) && - !user.autoconfirmed && !user.trusted) { + if ( + (this.room.settings.tournaments?.autoconfirmedOnly || this.autoconfirmedOnly) && + !user.autoconfirmed && !user.trusted + ) { user.popup("Signups for tournaments are only available for autoconfirmed users in this room."); return; } @@ -979,8 +980,8 @@ export class Tournament extends Rooms.RoomGame { to.pendingChallenge = { from, team: ready.settings.team, hidden: ready.settings.hidden, inviteOnly: ready.settings.inviteOnly, }; - from.sendRoom(`|tournament|update|${JSON.stringify({challenging: to.name})}`); - to.sendRoom(`|tournament|update|${JSON.stringify({challenged: from.name})}`); + from.sendRoom(`|tournament|update|${JSON.stringify({ challenging: to.name })}`); + to.sendRoom(`|tournament|update|${JSON.stringify({ challenged: from.name })}`); this.isBracketInvalidated = true; this.update(); @@ -1065,7 +1066,7 @@ export class Tournament extends Rooms.RoomGame { // server lockdown if (!room) return; - challenge.from.inProgressMatch = {to: player, room}; + challenge.from.inProgressMatch = { to: player, room }; this.room.add(`|tournament|battlestart|${from.name}|${user.name}|${room.roomid}`).update(); this.isBracketInvalidated = true; @@ -1187,7 +1188,7 @@ export class Tournament extends Rooms.RoomGame { if (!settings.recentTours) settings.recentTours = []; const name = Dex.formats.get(this.name).exists ? Dex.formats.get(this.name).name : `${this.name} (${Dex.formats.get(this.baseFormat).name})`; - settings.recentTours.unshift({name, baseFormat: this.baseFormat, time: Date.now()}); + settings.recentTours.unshift({ name, baseFormat: this.baseFormat, time: Date.now() }); // Use a while loop here in case the threshold gets lowered with /tour settings recenttours // to trim down multiple at once while (settings.recentTours.length > settings.recentToursLength) { @@ -1301,7 +1302,7 @@ const commands: Chat.ChatCommands = { } // Shorten array if the recentToursLength gets adjusted const array = room.settings.tournaments.recentTours; - const {name, time} = array[0]; + const { name, time } = array[0]; let buf = `The last tournament ended ${Chat.toDurationString(Date.now() - time)} ago - ${name}`; if (array.length > 1) { buf += `
    Previous tournaments: `; @@ -1465,7 +1466,7 @@ const commands: Chat.ChatCommands = { Punishments.roomUnpunish(room, targetUserid, 'TOURBAN', false); } this.privateModAction(`${targetUser ? targetUser.name : targetUserid} was unbanned from joining tournaments by ${user.name}.`); - this.modlog('TOUR UNBAN', targetUser, null, {noip: 1, noalts: 1}); + this.modlog('TOUR UNBAN', targetUser, null, { noip: 1, noalts: 1 }); }, j: 'join', in: 'join', @@ -1572,9 +1573,9 @@ const commands: Chat.ChatCommands = { tournament.playerCap = 0; room.send(`|tournament|update|{"playerCap": "${playerCap}"}`); } - const capNote = (tournament.playerCap ? ' with a player cap of ' + tournament.playerCap : ''); + const capNote = (tournament.playerCap ? ` with a player cap of ${tournament.playerCap}` : ''); this.privateModAction(`${user.name} set tournament type to ${generator.name}${capNote}.`); - this.modlog('TOUR SETTYPE', null, generator.name + capNote); + this.modlog('TOUR SETTYPE', null, `${generator.name}${capNote}`); this.sendReply(`Tournament set to ${generator.name}${capNote}.`); } }, @@ -1682,7 +1683,7 @@ const commands: Chat.ChatCommands = { tournament.fullFormat = tournament.baseFormat; if (tournament.name === tournament.getDefaultCustomName()) { tournament.name = tournament.baseFormat; - room.send(`|tournament|update|${JSON.stringify({format: tournament.name})}`); + room.send(`|tournament|update|${JSON.stringify({ format: tournament.name })}`); tournament.update(); } room.addRaw(`The tournament's custom rules were cleared.`); @@ -1707,7 +1708,7 @@ const commands: Chat.ChatCommands = { } if (name.includes('|')) return this.errorReply("The tournament's name cannot include the | symbol."); tournament.name = name; - room.send(`|tournament|update|${JSON.stringify({format: tournament.name})}`); + room.send(`|tournament|update|${JSON.stringify({ format: tournament.name })}`); this.privateModAction(`${user.name} set the tournament's name to ${tournament.name}.`); this.modlog('TOUR NAME', null, tournament.name); tournament.update(); @@ -1719,7 +1720,7 @@ const commands: Chat.ChatCommands = { const tournament = this.requireGame(Tournament); if (tournament.name === tournament.baseFormat) return this.errorReply("The tournament does not have a name."); tournament.name = tournament.baseFormat; - room.send(`|tournament|update|${JSON.stringify({format: tournament.name})}`); + room.send(`|tournament|update|${JSON.stringify({ format: tournament.name })}`); this.privateModAction(`${user.name} cleared the tournament's name.`); this.modlog('TOUR CLEARNAME'); tournament.update(); diff --git a/server/user-groups.ts b/server/user-groups.ts index 749a2d4c0d..2dc57676fd 100644 --- a/server/user-groups.ts +++ b/server/user-groups.ts @@ -1,6 +1,6 @@ -import {FS} from '../lib/fs'; -import type {RoomSection} from './chat-commands/room-settings'; -import {toID} from '../sim/dex-data'; +import { FS } from '../lib/fs'; +import type { RoomSection } from './chat-commands/room-settings'; +import { toID } from '../sim/dex-data'; export type GroupSymbol = '~' | '#' | '★' | '*' | '@' | '%' | '☆' | '§' | '+' | '^' | ' ' | '‽' | '!'; export type EffectiveGroupSymbol = GroupSymbol | 'whitelist'; @@ -174,7 +174,7 @@ export abstract class Auth extends Map { // if /permissions has granted unranked users permission to use the command, // grant jurisdiction over unranked (since unranked users don't have jurisdiction over unranked) // see https://github.com/smogon/pokemon-showdown/pull/9534#issuecomment-1565719315 - jurisdiction += Users.Auth.defaultSymbol(); + (jurisdiction as string) += Users.Auth.defaultSymbol(); } } if (!foundSpecificPermission && roomPermissions[permission]) { @@ -265,7 +265,7 @@ export class RoomAuth extends Auth { let group = Config.greatergroupscache[`${roomGroup}${parentGroup}`]; if (!group) { // unrecognized groups always trump higher global rank - const roomRank = Auth.getGroup(roomGroup, {rank: Infinity}).rank; + const roomRank = Auth.getGroup(roomGroup, { rank: Infinity }).rank; const globalRank = Auth.getGroup(parentGroup).rank; if (roomGroup === Users.PLAYER_SYMBOL || roomGroup === Users.HOST_SYMBOL || roomGroup === '#') { // Player, Host, and Room Owner always trump higher global rank diff --git a/server/users.ts b/server/users.ts index 091b0cd38d..891a6f694e 100644 --- a/server/users.ts +++ b/server/users.ts @@ -45,9 +45,9 @@ const PERMALOCK_CACHE_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days const DEFAULT_TRAINER_SPRITES = [1, 2, 101, 102, 169, 170, 265, 266]; -import {Utils, ProcessManager} from '../lib'; +import { Utils, type ProcessManager } from '../lib'; import { - Auth, GlobalAuth, PLAYER_SYMBOL, HOST_SYMBOL, RoomPermission, GlobalPermission, + Auth, GlobalAuth, PLAYER_SYMBOL, HOST_SYMBOL, type RoomPermission, type GlobalPermission, } from './user-groups'; const MINUTES = 60 * 1000; @@ -55,7 +55,6 @@ const IDLE_TIMER = 60 * MINUTES; const STAFF_IDLE_TIMER = 30 * MINUTES; const CONNECTION_EXPIRY_TIME = 24 * 60 * MINUTES; - /********************************************************* * Utility functions *********************************************************/ @@ -89,7 +88,7 @@ function add(user: User) { users.set(user.id, user); } function deleteUser(user: User) { - prevUsers.delete('guest' + user.guestNum as ID); + prevUsers.delete(`guest${user.guestNum}` as ID); users.delete(user.id); } function merge(toRemain: User, toDestroy: User) { @@ -148,7 +147,7 @@ function getExactUser(name: string | User) { * Usage: * Users.findUsers([userids], [ips]) */ -function findUsers(userids: ID[], ips: string[], options: {forPunishment?: boolean, includeTrusted?: boolean} = {}) { +function findUsers(userids: ID[], ips: string[], options: { forPunishment?: boolean, includeTrusted?: boolean } = {}) { const matches: User[] = []; if (options.forPunishment) ips = ips.filter(ip => !Punishments.isSharedIp(ip)); const ipMatcher = IPTools.checker(ips); @@ -351,7 +350,7 @@ export class User extends Chat.MessageContext { * `)` */ readonly games: Set; - mmrCache: {[format: string]: number}; + mmrCache: { [format: string]: number }; guestNum: number; name: string; named: boolean; @@ -371,7 +370,7 @@ export class User extends Chat.MessageContext { semilocked: ID | PunishType | null; namelocked: ID | PunishType | null; permalocked: ID | PunishType | null; - punishmentTimer: NodeJS.Timer | null; + punishmentTimer: NodeJS.Timeout | null; previousIDs: ID[]; lastChallenge: number; @@ -392,7 +391,7 @@ export class User extends Chat.MessageContext { isPublicBot: boolean; lastDisconnected: number; lastConnected: number; - foodfight?: {generatedTeam: string[], dish: string, ingredients: string[], timestamp: number}; + foodfight?: { generatedTeam: string[], dish: string, ingredients: string[], timestamp: number }; friends?: Set; chatQueue: ChatQueueEntry[] | null; @@ -541,20 +540,20 @@ export class User extends Chat.MessageContext { this.send(`|popup|` + message.replace(/\n/g, '||')); } getIdentity(room: BasicRoom | null = null) { - const punishgroups = Config.punishgroups || {locked: null, muted: null}; + const punishgroups = Config.punishgroups || { locked: null, muted: null }; if (this.locked || this.namelocked) { - const lockedSymbol = (punishgroups.locked && punishgroups.locked.symbol || '\u203d'); + const lockedSymbol = (punishgroups.locked?.symbol || '\u203d'); return lockedSymbol + this.name; } if (room) { if (room.isMuted(this)) { - const mutedSymbol = (punishgroups.muted && punishgroups.muted.symbol || '!'); + const mutedSymbol = (punishgroups.muted?.symbol || '!'); return mutedSymbol + this.name; } return room.auth.get(this) + this.name; } if (this.semilocked) { - const mutedSymbol = (punishgroups.muted && punishgroups.muted.symbol || '!'); + const mutedSymbol = (punishgroups.muted?.symbol || '!'); return mutedSymbol + this.name; } return this.tempGroup + this.name; @@ -626,7 +625,7 @@ export class User extends Chat.MessageContext { return whitelist.includes(connection.ip) || whitelist.includes(this.id); } resetName(isForceRenamed = false) { - return this.forceRename('Guest ' + this.guestNum, false, isForceRenamed); + return this.forceRename(`Guest ${this.guestNum}`, false, isForceRenamed); } updateIdentity(roomid: RoomID | null = null) { if (roomid) { @@ -1278,7 +1277,7 @@ export class User extends Chat.MessageContext { * alts (i.e. when forPunishment is true), they will always be the first element of that list. */ getAltUsers(includeTrusted = false, forPunishment = false) { - let alts = findUsers([this.getLastId()], this.ips, {includeTrusted, forPunishment}); + let alts = findUsers([this.getLastId()], this.ips, { includeTrusted, forPunishment }); alts = alts.filter(user => user !== this); if (forPunishment) alts.unshift(this); return alts; @@ -1376,7 +1375,6 @@ export class User extends Chat.MessageContext { let stillInRoom = false; if (connection) { - // @ts-ignore TypeScript inferring wrong type for room stillInRoom = this.connections.some(conn => conn.inRooms.has(room.roomid)); } if (!stillInRoom) { @@ -1395,9 +1393,8 @@ export class User extends Chat.MessageContext { // cancel tour challenges // no need for a popup because users can't change their name while in a tournament anyway for (const roomid of this.games) { - const room = Rooms.get(roomid); - // @ts-ignore Tournaments aren't TS'd yet - if (room.game && room.game.cancelChallenge) room.game.cancelChallenge(this); + // @ts-expect-error Tournaments aren't TS'd yet + Rooms.get(roomid)?.game?.cancelChallenge?.(this); } } updateReady(connection: Connection | null = null) { @@ -1632,7 +1629,7 @@ function socketConnect( ip: string, protocol: string ) { - const id = '' + workerid + '-' + socketid; + const id = `${workerid}-${socketid}`; const connection = new Connection(id, worker, socketid, null, ip, protocol); connections.set(id, connection); @@ -1668,7 +1665,7 @@ function socketConnect( Rooms.global.handleConnect(user, connection); } function socketDisconnect(worker: ProcessManager.StreamWorker, workerid: number, socketid: string) { - const id = '' + workerid + '-' + socketid; + const id = `${workerid}-${socketid}`; const connection = connections.get(id); if (!connection) return; @@ -1720,10 +1717,9 @@ function socketReceive(worker: ProcessManager.StreamWorker, workerid: number, so const lines = message.split('\n'); if (!lines[lines.length - 1]) lines.pop(); - // eslint-disable-next-line @typescript-eslint/prefer-optional-chain const maxLineCount = ( user.can('bypassall') ? THROTTLE_MULTILINE_WARN_ADMIN : - (user.isStaff || (room && room.auth.isStaff(user.id))) ? + (user.isStaff || room?.auth.isStaff(user.id)) ? THROTTLE_MULTILINE_WARN_STAFF : THROTTLE_MULTILINE_WARN ); if (lines.length > maxLineCount && !Config.nothrottle) { diff --git a/server/verifier.ts b/server/verifier.ts index e66a99a422..c6d18afb11 100644 --- a/server/verifier.ts +++ b/server/verifier.ts @@ -13,21 +13,23 @@ */ import * as crypto from 'crypto'; -import {QueryProcessManager} from '../lib/process-manager'; +import { QueryProcessManager } from '../lib/process-manager'; -export const PM = new QueryProcessManager<{data: string, signature: string}, boolean>(module, ({data, signature}) => { - const verifier = crypto.createVerify(Config.loginserverkeyalgo); - verifier.update(data); - let success = false; - try { - success = verifier.verify(Config.loginserverpublickey, signature, 'hex'); - } catch {} +export const PM = new QueryProcessManager<{ data: string, signature: string }, boolean>( + module, ({ data, signature }) => { + const verifier = crypto.createVerify(Config.loginserverkeyalgo); + verifier.update(data); + let success = false; + try { + success = verifier.verify(Config.loginserverpublickey, signature, 'hex'); + } catch {} - return success; -}); + return success; + } +); export function verify(data: string, signature: string): Promise { - return PM.query({data, signature}); + return PM.query({ data, signature }); } if (!PM.isParentProcess) { diff --git a/sim/battle-actions.ts b/sim/battle-actions.ts index 841639b2a7..d517f9d425 100644 --- a/sim/battle-actions.ts +++ b/sim/battle-actions.ts @@ -1,4 +1,4 @@ -import {Dex, toID} from './dex'; +import { Dex, toID } from './dex'; const CHOOSABLE_TARGETS = new Set(['normal', 'any', 'adjacentAlly', 'adjacentAllyOrSelf', 'adjacentFoe']); @@ -6,7 +6,7 @@ export class BattleActions { battle: Battle; dex: ModdedDex; - readonly MAX_MOVES: {readonly [k: string]: string} = { + readonly MAX_MOVES: { readonly [k: string]: string } = { Flying: 'Max Airstream', Dark: 'Max Darkness', Fire: 'Max Flare', @@ -28,7 +28,7 @@ export class BattleActions { Dragon: 'Max Wyrmwind', }; - readonly Z_MOVES: {readonly [k: string]: string} = { + readonly Z_MOVES: { readonly [k: string]: string } = { Poison: "Acid Downpour", Fighting: "All-Out Pummeling", Dark: "Black Hole Eclipse", @@ -139,7 +139,7 @@ export class BattleActions { pokemon.itemState.effectOrder = this.battle.effectOrder++; this.battle.runEvent('BeforeSwitchIn', pokemon); if (sourceEffect) { - this.battle.add(isDrag ? 'drag' : 'switch', pokemon, pokemon.getFullDetails, '[from] ' + sourceEffect); + this.battle.add(isDrag ? 'drag' : 'switch', pokemon, pokemon.getFullDetails, `[from] ${sourceEffect}`); } else { this.battle.add(isDrag ? 'drag' : 'switch', pokemon, pokemon.getFullDetails); } @@ -150,7 +150,7 @@ export class BattleActions { // runSwitch happens immediately so that Mold Breaker can make hazards bypass Clear Body and Levitate this.runSwitch(pokemon); } else { - this.battle.queue.insertChoice({choice: 'runSwitch', pokemon}); + this.battle.queue.insertChoice({ choice: 'runSwitch', pokemon }); } return true; @@ -176,7 +176,7 @@ export class BattleActions { } const allActive = this.battle.getAllActive(true); this.battle.speedSort(allActive); - this.battle.speedOrder = allActive.map((a) => a.side.n * a.battle.sides.length + a.position); + this.battle.speedOrder = allActive.map(a => a.side.n * a.battle.sides.length + a.position); this.battle.fieldEvent('SwitchIn', switchersIn); for (const poke of switchersIn) { @@ -303,7 +303,7 @@ export class BattleActions { const oldActiveMove = move; - const moveDidSomething = this.useMove(baseMove, pokemon, {target, sourceEffect, zMove, maxMove}); + const moveDidSomething = this.useMove(baseMove, pokemon, { target, sourceEffect, zMove, maxMove }); this.battle.lastSuccessfulMoveThisTurn = moveDidSomething ? this.battle.activeMove && this.battle.activeMove.id : null; if (this.battle.activeMove) move = this.battle.activeMove; this.battle.singleEvent('AfterMove', move, null, pokemon, target, move); @@ -338,7 +338,7 @@ export class BattleActions { targetOf1stDance : pokemon; const dancersTargetLoc = dancer.getLocOf(dancersTarget); - this.runMove(move.id, dancer, dancersTargetLoc, {sourceEffect: this.dex.abilities.get('dancer'), externalMove: true}); + this.runMove(move.id, dancer, dancersTargetLoc, { sourceEffect: this.dex.abilities.get('dancer'), externalMove: true }); } } if (noLock && pokemon.volatiles['lockedmove']) delete pokemon.volatiles['lockedmove']; @@ -410,7 +410,7 @@ export class BattleActions { if (!move.hasBounced) move.pranksterBoosted = this.battle.activeMove.pranksterBoosted; } const baseTarget = move.target; - let targetRelayVar = {target}; + let targetRelayVar = { target }; targetRelayVar = this.battle.runEvent('ModifyTarget', pokemon, target, move, targetRelayVar, true); if (targetRelayVar.target !== undefined) target = targetRelayVar.target; if (target === undefined) target = this.battle.getRandomTarget(pokemon, move); @@ -449,10 +449,10 @@ export class BattleActions { if (move.id === 'hiddenpower') movename = 'Hidden Power'; if (sourceEffect) attrs += `|[from] ${sourceEffect.fullname}`; if (zMove && move.isZ === true) { - attrs = '|[anim]' + movename + attrs; - movename = 'Z-' + movename; + attrs = `|[anim]${movename}${attrs}`; + movename = `Z-${movename}`; } - this.battle.addMove('move', pokemon, movename, target + attrs); + this.battle.addMove('move', pokemon, movename, `${target}${attrs}`); if (zMove) this.runZPower(move, pokemon); @@ -462,7 +462,7 @@ export class BattleActions { return false; } - const {targets, pressureTargets} = pokemon.getMoveTargets(move, target); + const { targets, pressureTargets } = pokemon.getMoveTargets(move, target); if (targets.length) { target = targets[targets.length - 1]; // in case of redirection } @@ -707,11 +707,11 @@ export class BattleActions { if (accuracy !== true) { let boost = 0; if (!move.ignoreAccuracy) { - const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); } if (!move.ignoreEvasion) { - const boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); boost = this.battle.clampIntRange(boost - boosts['evasion'], -6, 6); } if (boost > 0) { @@ -721,8 +721,10 @@ export class BattleActions { } } } - if (move.alwaysHit || (move.id === 'toxic' && this.battle.gen >= 8 && pokemon.hasType('Poison')) || - (move.target === 'self' && move.category === 'Status' && !target.isSemiInvulnerable())) { + if ( + move.alwaysHit || (move.id === 'toxic' && this.battle.gen >= 8 && pokemon.hasType('Poison')) || + (move.target === 'self' && move.category === 'Status' && !target.isSemiInvulnerable()) + ) { accuracy = true; // bypasses ohko accuracy modifiers } else { accuracy = this.battle.runEvent('Accuracy', target, pokemon, move, accuracy); @@ -735,7 +737,7 @@ export class BattleActions { this.battle.add('-miss', pokemon, target); } if (!move.ohko && pokemon.hasItem('blunderpolicy') && pokemon.useItem()) { - this.battle.boost({spe: 2}, pokemon); + this.battle.boost({ spe: 2 }, pokemon); } hitResults[i] = false; continue; @@ -762,7 +764,7 @@ export class BattleActions { if (move.id === 'feint') { this.battle.add('-activate', target, 'move: Feint'); } else { - this.battle.add('-activate', target, 'move: ' + move.name, '[broken]'); + this.battle.add('-activate', target, `move: ${move.name}`, '[broken]'); } if (this.battle.gen >= 6) delete target.volatiles['stall']; } @@ -905,7 +907,7 @@ export class BattleActions { const boostTable = [1, 4 / 3, 5 / 3, 2, 7 / 3, 8 / 3, 3]; if (accuracy !== true) { if (!move.ignoreAccuracy) { - const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, {...pokemon.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', pokemon, null, null, { ...pokemon.boosts }); const boost = this.battle.clampIntRange(boosts['accuracy'], -6, 6); if (boost > 0) { accuracy *= boostTable[boost]; @@ -914,7 +916,7 @@ export class BattleActions { } } if (!move.ignoreEvasion) { - const boosts = this.battle.runEvent('ModifyBoost', target, null, null, {...target.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', target, null, null, { ...target.boosts }); const boost = this.battle.clampIntRange(boosts['evasion'], -6, 6); if (boost > 0) { accuracy /= boostTable[boost]; @@ -953,7 +955,7 @@ export class BattleActions { // purposes of Counter, Metal Burst, and Mirror Coat. damage[i] = md === true || !md ? 0 : md; // Total damage dealt is accumulated for the purposes of recoil (Parental Bond). - move.totalDamage += damage[i] as number; + move.totalDamage += damage[i]; } if (move.mindBlownRecoil) { const hpBeforeRecoil = pokemon.hp; @@ -993,7 +995,7 @@ export class BattleActions { } else { recoilDamage = this.battle.clampIntRange(this.battle.trunc(pokemon.maxhp / 4), 1); } - this.battle.directDamage(recoilDamage, pokemon, pokemon, {id: 'strugglerecoil'} as Condition); + this.battle.directDamage(recoilDamage, pokemon, pokemon, { id: 'strugglerecoil' } as Condition); if (pokemon.hp <= pokemon.maxhp / 2 && hpBeforeRecoil > pokemon.maxhp / 2) { this.battle.runEvent('EmergencyExit', pokemon, pokemon); } @@ -1019,7 +1021,7 @@ export class BattleActions { this.battle.eachEvent('Update'); - this.afterMoveSecondaryEvent(targetsCopy.filter(val => !!val) as Pokemon[], pokemon, move); + this.afterMoveSecondaryEvent(targetsCopy.filter(val => !!val), pokemon, move); if (!move.negateSecondary && !(move.hasSheerForce && pokemon.hasAbility('sheerforce'))) { for (const [i, d] of damage.entries()) { @@ -1465,7 +1467,7 @@ export class BattleActions { if (zMoveName) { const zMove = this.dex.moves.get(zMoveName); if (!zMove.isZ && zMove.category === 'Status') zMoveName = "Z-" + zMoveName; - zMoves.push({move: zMoveName, target: zMove.target}); + zMoves.push({ move: zMoveName, target: zMove.target }); } else { zMoves.push(null); } @@ -1542,7 +1544,7 @@ export class BattleActions { if (pokemon.hasType('Ghost')) { this.battle.heal(pokemon.maxhp, pokemon, pokemon, zPower); } else { - this.battle.boost({atk: 1}, pokemon, pokemon, zPower); + this.battle.boost({ atk: 1 }, pokemon, pokemon, zPower); } } } @@ -1576,7 +1578,7 @@ export class BattleActions { * Normal PS return value rules apply: * undefined = success, null = silent failure, false = loud failure */ - getDamage( + getDamage( source: Pokemon, target: Pokemon, move: string | number | ActiveMove, suppressMessages = false ): number | undefined | null | false { @@ -1671,7 +1673,7 @@ export class BattleActions { let attackStat: StatIDExceptHP = move.overrideOffensiveStat || (isPhysical ? 'atk' : 'spa'); const defenseStat: StatIDExceptHP = move.overrideDefensiveStat || (isPhysical ? 'def' : 'spd'); - const statTable = {atk: 'Atk', def: 'Def', spa: 'SpA', spd: 'SpD', spe: 'Spe'}; + const statTable = { atk: 'Atk', def: 'Def', spa: 'SpA', spd: 'SpD', spe: 'Spe' }; let atkBoosts = attacker.boosts[attackStat]; let defBoosts = defender.boosts[defenseStat]; @@ -1729,7 +1731,7 @@ export class BattleActions { if (move.spreadHit) { // multi-target modifier (doubles only) const spreadModifier = move.spreadModifier || (this.battle.gameType === 'freeforall' ? 0.5 : 0.75); - this.battle.debug('Spread modifier: ' + spreadModifier); + this.battle.debug(`Spread modifier: ${spreadModifier}`); baseDamage = this.battle.modify(baseDamage, spreadModifier); } else if (move.multihitType === 'parentalbond' && move.hit > 1) { // Parental Bond modifier diff --git a/sim/battle-queue.ts b/sim/battle-queue.ts index d0085fa76e..30f1d710c4 100644 --- a/sim/battle-queue.ts +++ b/sim/battle-queue.ts @@ -13,7 +13,7 @@ * @license MIT */ -import type {Battle} from './battle'; +import type { Battle } from './battle'; /** A move action */ export interface MoveAction { @@ -146,7 +146,6 @@ export class BattleQueue { unshift(action: Action) { return this.list.unshift(action); } - // eslint-disable-next-line no-restricted-globals [Symbol.iterator]() { return this.list[Symbol.iterator](); } entries() { return this.list.entries(); @@ -166,7 +165,7 @@ export class BattleQueue { if (!action.side && action.pokemon) action.side = action.pokemon.side; if (!action.move && action.moveid) action.move = this.battle.dex.getActiveMove(action.moveid); if (!action.order) { - const orders: {[choice: string]: number} = { + const orders: { [choice: string]: number } = { team: 1, start: 2, instaswitch: 3, diff --git a/sim/battle-stream.ts b/sim/battle-stream.ts index a2098ce0cd..cf6176cbbd 100644 --- a/sim/battle-stream.ts +++ b/sim/battle-stream.ts @@ -9,9 +9,9 @@ * @license MIT */ -import {Streams, Utils} from '../lib'; -import {Teams} from './teams'; -import {Battle, extractChannelMessages} from './battle'; +import { Streams, Utils } from '../lib'; +import { Teams } from './teams'; +import { Battle, extractChannelMessages } from './battle'; /** * Like string.split(delimiter), but only recognizes the first `limit` @@ -363,7 +363,7 @@ export class BattleTextStream extends Streams.ReadWriteStream { readonly battleStream: BattleStream; currentMessage: string; - constructor(options: {debug?: boolean}) { + constructor(options: { debug?: boolean }) { super(); this.battleStream = new BattleStream(options); this.currentMessage = ''; @@ -379,7 +379,7 @@ export class BattleTextStream extends Streams.ReadWriteStream { } _write(message: string | Buffer) { - this.currentMessage += '' + message; + this.currentMessage += `${message}`; const index = this.currentMessage.lastIndexOf('\n'); if (index >= 0) { void this.battleStream.write(this.currentMessage.slice(0, index)); diff --git a/sim/battle.ts b/sim/battle.ts index faff5f5bb0..164f561fd1 100644 --- a/sim/battle.ts +++ b/sim/battle.ts @@ -14,16 +14,16 @@ * @license MIT */ -import {Dex, toID} from './dex'; -import {Teams} from './teams'; -import {Field} from './field'; -import {Pokemon, EffectState, RESTORATIVE_BERRIES} from './pokemon'; -import {PRNG, PRNGSeed} from './prng'; -import {Side} from './side'; -import {State} from './state'; -import {BattleQueue, Action} from './battle-queue'; -import {BattleActions} from './battle-actions'; -import {Utils} from '../lib/utils'; +import { Dex, toID } from './dex'; +import { Teams } from './teams'; +import { Field } from './field'; +import { Pokemon, type EffectState, RESTORATIVE_BERRIES } from './pokemon'; +import { PRNG, type PRNGSeed } from './prng'; +import { Side } from './side'; +import { State } from './state'; +import { BattleQueue, type Action } from './battle-queue'; +import { BattleActions } from './battle-actions'; +import { Utils } from '../lib/utils'; declare const __version: any; export type ChannelID = 0 | 1 | 2 | 3 | 4; @@ -58,7 +58,6 @@ export function extractChannelMessages(message: string return channelMessages; } - interface BattleOptions { format?: Format; formatid: ID; @@ -81,10 +80,8 @@ interface EventListenerWithoutPriority { effect: Effect; target?: Pokemon; index?: number; - // eslint-disable-next-line @typescript-eslint/ban-types callback?: Function; state: EffectState | null; - // eslint-disable-next-line @typescript-eslint/ban-types end: Function | null; endCallArgs?: any[]; effectHolder: Pokemon | Side | Field | Battle; @@ -216,7 +213,7 @@ export class Battle { options.forceRandomChance : null; this.deserialized = !!options.deserialized; this.strictChoices = !!options.strictChoices; - this.formatData = this.initEffectState({id: format.id}); + this.formatData = this.initEffectState({ id: format.id }); this.gameType = (format.gameType || 'singles'); this.field = new Field(this); this.sides = Array(format.playerCount).fill(null) as any; @@ -245,10 +242,10 @@ export class Battle { this.started = false; this.ended = false; - this.effect = {id: ''} as Effect; - this.effectState = this.initEffectState({id: ''}); + this.effect = { id: '' } as Effect; + this.effectState = this.initEffectState({ id: '' }); - this.event = {id: ''}; + this.event = { id: '' }; this.events = null; this.eventDepth = 0; @@ -278,7 +275,7 @@ export class Battle { this.send = options.send || (() => {}); - const inputOptions: {formatid: ID, seed: PRNGSeed, rated?: string | true} = { + const inputOptions: { formatid: ID, seed: PRNGSeed, rated?: string | true } = { formatid: options.formatid, seed: this.prngSeed, }; if (this.rated) inputOptions.rated = this.rated; @@ -312,7 +309,7 @@ export class Battle { const sides: SideID[] = ['p1', 'p2', 'p3', 'p4']; for (const side of sides) { if (options[side]) { - this.setPlayer(side, options[side]!); + this.setPlayer(side, options[side]); } } } @@ -403,7 +400,7 @@ export class Battle { * * Doesn't reference `this` so doesn't need to be bound. */ - comparePriority(a: AnyObject, b: AnyObject) { + comparePriority(this: void, a: AnyObject, b: AnyObject) { return -((b.order || 4294967296) - (a.order || 4294967296)) || ((b.priority || 0) - (a.priority || 0)) || ((b.speed || 0) - (a.speed || 0)) || @@ -412,15 +409,15 @@ export class Battle { 0; } - static compareRedirectOrder(a: AnyObject, b: AnyObject) { + static compareRedirectOrder(this: void, a: AnyObject, b: AnyObject) { return ((b.priority || 0) - (a.priority || 0)) || ((b.speed || 0) - (a.speed || 0)) || ((a.effectHolder?.abilityState && b.effectHolder?.abilityState) ? -(b.effectHolder.abilityState.effectOrder - a.effectHolder.abilityState.effectOrder) : 0) || - 0; + 0; } - static compareLeftToRightOrder(a: AnyObject, b: AnyObject) { + static compareLeftToRightOrder(this: void, a: AnyObject, b: AnyObject) { return -((b.order || 4294967296) - (a.order || 4294967296)) || ((b.priority || 0) - (a.priority || 0)) || -((b.index || 0) - (a.index || 0)) || @@ -514,7 +511,7 @@ export class Battle { if ((handler.effectHolder as Pokemon).fainted) { if (!(handler.state?.isSlotCondition)) continue; } - if (eventid === 'Residual' && handler.end && handler.state && handler.state.duration) { + if (eventid === 'Residual' && handler.end && handler.state?.duration) { handler.state.duration--; if (!handler.state.duration) { const endCallArgs = handler.endCallArgs || [handler.effectHolder, effect.id]; @@ -594,7 +591,7 @@ export class Battle { this.effect = effect; this.effectState = state as EffectState || this.initEffectState({}); - this.event = {id: eventid, target, source, effect: sourceEffect}; + this.event = { id: eventid, target, source, effect: sourceEffect }; this.eventDepth++; const args = [target, source, sourceEffect]; @@ -741,8 +738,7 @@ export class Battle { const handlers = this.findEventHandlers(target, eventid, effectSource); if (onEffect) { if (!sourceEffect) throw new Error("onEffect passed without an effect"); - // @ts-ignore - dynamic lookup - const callback = sourceEffect[`on${eventid}`]; + const callback = (sourceEffect as any)[`on${eventid}`]; if (callback !== undefined) { if (Array.isArray(target)) throw new Error(""); handlers.unshift(this.resolvePriority({ @@ -769,7 +765,7 @@ export class Battle { } const parentEvent = this.event; - this.event = {id: eventid, target, source, effect: sourceEffect, modifier: 1}; + this.event = { id: eventid, target, source, effect: sourceEffect, modifier: 1 }; this.eventDepth++; let targetRelayVars = []; @@ -842,15 +838,19 @@ export class Battle { this.debug(eventid + ' handler suppressed by Embargo, Klutz or Magic Room'); } continue; - } else if (eventid !== 'End' && effect.effectType === 'Ability' && - (effectHolder instanceof Pokemon) && effectHolder.ignoringAbility()) { + } else if ( + eventid !== 'End' && effect.effectType === 'Ability' && + (effectHolder instanceof Pokemon) && effectHolder.ignoringAbility() + ) { if (eventid !== 'Update') { this.debug(eventid + ' handler suppressed by Gastro Acid or Neutralizing Gas'); } continue; } - if ((effect.effectType === 'Weather' || eventid === 'Weather') && - eventid !== 'Residual' && eventid !== 'End' && this.field.suppressingWeather()) { + if ( + (effect.effectType === 'Weather' || eventid === 'Weather') && + eventid !== 'Residual' && eventid !== 'End' && this.field.suppressingWeather() + ) { this.debug(eventid + ' handler suppressed by Air Lock'); continue; } @@ -910,15 +910,12 @@ export class Battle { resolvePriority(h: EventListenerWithoutPriority, callbackName: string) { const handler = h as EventListener; - // @ts-ignore - handler.order = handler.effect[`${callbackName}Order`] || false; - // @ts-ignore - handler.priority = handler.effect[`${callbackName}Priority`] || 0; - // @ts-ignore - handler.subOrder = handler.effect[`${callbackName}SubOrder`] || 0; + handler.order = (handler.effect as any)[`${callbackName}Order`] || false; + handler.priority = (handler.effect as any)[`${callbackName}Priority`] || 0; + handler.subOrder = (handler.effect as any)[`${callbackName}SubOrder`] || 0; if (!handler.subOrder) { // https://www.smogon.com/forums/threads/sword-shield-battle-mechanics-research.3655528/page-59#post-8685465 - const effectTypeOrder: {[k in EffectType]?: number} = { + const effectTypeOrder: { [k in EffectType]?: number } = { // Z-Move: 1, Condition: 2, // Slot Condition: 3, @@ -963,7 +960,7 @@ export class Battle { handler.effectOrder = handler.state?.effectOrder; } if (handler.effectHolder && (handler.effectHolder as Pokemon).getStat) { - const pokemon = (handler.effectHolder as Pokemon); + const pokemon = handler.effectHolder as Pokemon; handler.speed = pokemon.speed; if (callbackName.endsWith('SwitchIn')) { // Pokemon speeds including ties are resolved before all onSwitchIn handlers and aren't re-sorted in-between @@ -1029,7 +1026,7 @@ export class Battle { const handlers: EventListener[] = []; const status = pokemon.getStatus(); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup let callback = status[callbackName]; if (callback !== undefined || (getKey && pokemon.statusState[getKey])) { handlers.push(this.resolvePriority({ @@ -1039,7 +1036,7 @@ export class Battle { for (const id in pokemon.volatiles) { const volatileState = pokemon.volatiles[id]; const volatile = this.dex.conditions.getByID(id as ID); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = volatile[callbackName]; if (callback !== undefined || (getKey && volatileState[getKey])) { handlers.push(this.resolvePriority({ @@ -1047,7 +1044,7 @@ export class Battle { }, callbackName)); } else if (['ability', 'item'].includes(volatile.id.split(':')[0])) { // Innate abilities/items; see comment below - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup if (this.gen >= 5 && callbackName === 'onSwitchIn' && !volatile.onAnySwitchIn) { callback = volatile.onStart; if (callback !== undefined || (getKey && volatileState[getKey])) { @@ -1062,15 +1059,15 @@ export class Battle { // during the SwitchIn event instead of running the Start event during switch-ins // gens 4 and before still use the old system, though const ability = pokemon.getAbility(); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = ability[callbackName]; if (callback !== undefined || (getKey && pokemon.abilityState[getKey])) { handlers.push(this.resolvePriority({ effect: ability, callback, state: pokemon.abilityState, end: pokemon.clearAbility, effectHolder: pokemon, }, callbackName)); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup } else if (this.gen >= 5 && callbackName === 'onSwitchIn' && !ability.onAnySwitchIn) { - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = ability.onStart; if (callback !== undefined || (getKey && pokemon.abilityState[getKey])) { handlers.push(this.resolvePriority({ @@ -1079,15 +1076,14 @@ export class Battle { } } const item = pokemon.getItem(); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = item[callbackName]; if (callback !== undefined || (getKey && pokemon.itemState[getKey])) { handlers.push(this.resolvePriority({ effect: item, callback, state: pokemon.itemState, end: pokemon.clearItem, effectHolder: pokemon, }, callbackName)); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup } else if (this.gen >= 5 && callbackName === 'onSwitchIn' && !item.onAnySwitchIn) { - // @ts-ignore - dynamic lookup callback = item.onStart; if (callback !== undefined || (getKey && pokemon.itemState[getKey])) { handlers.push(this.resolvePriority({ @@ -1096,7 +1092,7 @@ export class Battle { } } const species = pokemon.baseSpecies; - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = species[callbackName]; if (callback !== undefined) { handlers.push(this.resolvePriority({ @@ -1107,7 +1103,7 @@ export class Battle { for (const conditionid in side.slotConditions[pokemon.position]) { const slotConditionState = side.slotConditions[pokemon.position][conditionid]; const slotCondition = this.dex.conditions.getByID(conditionid as ID); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = slotCondition[callbackName]; if (callback !== undefined || (getKey && slotConditionState[getKey])) { handlers.push(this.resolvePriority({ @@ -1129,7 +1125,7 @@ export class Battle { let callback; const format = this.format; - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = format[callbackName]; if (callback !== undefined || (getKey && this.formatData[getKey])) { handlers.push(this.resolvePriority({ @@ -1155,7 +1151,7 @@ export class Battle { for (const id in field.pseudoWeather) { const pseudoWeatherState = field.pseudoWeather[id]; const pseudoWeather = this.dex.conditions.getByID(id as ID); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = pseudoWeather[callbackName]; if (callback !== undefined || (getKey && pseudoWeatherState[getKey])) { handlers.push(this.resolvePriority({ @@ -1165,7 +1161,7 @@ export class Battle { } } const weather = field.getWeather(); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = weather[callbackName]; if (callback !== undefined || (getKey && this.field.weatherState[getKey])) { handlers.push(this.resolvePriority({ @@ -1174,7 +1170,7 @@ export class Battle { }, callbackName)); } const terrain = field.getTerrain(); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup callback = terrain[callbackName]; if (callback !== undefined || (getKey && field.terrainState[getKey])) { handlers.push(this.resolvePriority({ @@ -1192,7 +1188,7 @@ export class Battle { for (const id in side.sideConditions) { const sideConditionData = side.sideConditions[id]; const sideCondition = this.dex.conditions.getByID(id as ID); - // @ts-ignore - dynamic lookup + // @ts-expect-error dynamic lookup const callback = sideCondition[callbackName]; if (callback !== undefined || (getKey && sideConditionData[getKey])) { handlers.push(this.resolvePriority({ @@ -1248,7 +1244,7 @@ export class Battle { } } - const eventHandler = {callback, target, priority, order, subOrder}; + const eventHandler = { callback, target, priority, order, subOrder }; if (!this.events) this.events = {}; const callbackName = `on${eventid}`; @@ -1320,7 +1316,7 @@ export class Battle { // the entire team order, unlike `pickedTeamSize = undefined` which // will only ask the user to select their lead(s). const pickedTeamSize = this.ruleTable.pickedTeamSize; - this.add('teampreview' + (pickedTeamSize ? '|' + pickedTeamSize : '')); + this.add(`teampreview${pickedTeamSize ? `|${pickedTeamSize}` : ''}`); } const requests = this.getRequests(type); @@ -1352,7 +1348,7 @@ export class Battle { if (!side.pokemonLeft) continue; const switchTable = side.active.map(pokemon => !!pokemon?.switchFlag); if (switchTable.some(Boolean)) { - requests[i] = {forceSwitch: switchTable, side: side.getRequestData()}; + requests[i] = { forceSwitch: switchTable, side: side.getRequestData() }; } } break; @@ -1361,7 +1357,7 @@ export class Battle { for (let i = 0; i < this.sides.length; i++) { const side = this.sides[i]; const maxChosenTeamSize = this.ruleTable.pickedTeamSize || undefined; - requests[i] = {teamPreview: true, maxChosenTeamSize, side: side.getRequestData()}; + requests[i] = { teamPreview: true, maxChosenTeamSize, side: side.getRequestData() }; } break; @@ -1370,7 +1366,7 @@ export class Battle { const side = this.sides[i]; if (!side.pokemonLeft) continue; const activeData = side.active.map(pokemon => pokemon?.getMoveRequestData()); - requests[i] = {active: activeData, side: side.getRequestData()}; + requests[i] = { active: activeData, side: side.getRequestData() }; if (side.allySide) { requests[i].ally = side.allySide.getRequestData(true); } @@ -1383,7 +1379,7 @@ export class Battle { if (requests[i]) { if (!this.supportCancel || !multipleRequestsExist) requests[i].noCancel = true; } else { - requests[i] = {wait: true, side: this.sides[i].getRequestData()}; + requests[i] = { wait: true, side: this.sides[i].getRequestData() }; } } @@ -1482,7 +1478,7 @@ export class Battle { side.active[0]?.faint(); this.faintMessages(false, true); if (!this.ended && side.requestState) { - side.emitRequest({wait: true, side: side.getRequestData()}); + side.emitRequest({ wait: true, side: side.getRequestData() }); side.clearChoice(); if (this.allChoicesDone()) this.commitChoices(); } @@ -1886,7 +1882,7 @@ export class Battle { subFormat.onTeamPreview?.call(this); } - this.queue.addChoice({choice: 'start'}); + this.queue.addChoice({ choice: 'start' }); this.midTurn = true; if (!this.requestState) this.turnLoop(); } @@ -1923,9 +1919,9 @@ export class Battle { if (!target?.hp) return 0; if (!target.isActive) return false; if (this.gen > 5 && !target.side.foePokemonLeft()) return false; - boost = this.runEvent('ChangeBoost', target, source, effect, {...boost}); + boost = this.runEvent('ChangeBoost', target, source, effect, { ...boost }); boost = target.getCappedBoost(boost); - boost = this.runEvent('TryBoost', target, source, effect, {...boost}); + boost = this.runEvent('TryBoost', target, source, effect, { ...boost }); let success = null; let boosted = isSecondary; let boostName: BoostID; @@ -2047,9 +2043,9 @@ export class Battle { if (effect.effectType === 'Move' || !name) { this.add('-damage', target, target.getHealth); } else if (source && (source !== target || effect.effectType === 'Ability')) { - this.add('-damage', target, target.getHealth, '[from] ' + name, '[of] ' + source); + this.add('-damage', target, target.getHealth, `[from] ${name}`, `[of] ${source}`); } else { - this.add('-damage', target, target.getHealth, '[from] ' + name); + this.add('-damage', target, target.getHealth, `[from] ${name}`); } break; } @@ -2079,7 +2075,7 @@ export class Battle { if (!retVals[i] || !target) continue; if (target.hp <= 0) { - this.debug('instafaint: ' + this.faintQueue.map(entry => entry.target.name)); + this.debug(`instafaint: ${this.faintQueue.map(entry => entry.target.name)}`); this.faintMessages(true); if (this.gen <= 2) { target.faint(); @@ -2087,7 +2083,7 @@ export class Battle { this.queue.clear(); // Fainting clears accumulated Bide damage for (const pokemon of this.getAllActive()) { - if (pokemon.volatiles['bide'] && pokemon.volatiles['bide'].damage) { + if (pokemon.volatiles['bide']?.damage) { pokemon.volatiles['bide'].damage = 0; this.hint("Desync Clause Mod activated!"); this.hint("In Gen 1, Bide's accumulated damage is reset to 0 when a Pokemon faints."); @@ -2190,7 +2186,7 @@ export class Battle { this.add('-heal', target, target.getHealth, '[silent]'); break; case 'drain': - this.add('-heal', target, target.getHealth, '[from] drain', '[of] ' + source); + this.add('-heal', target, target.getHealth, '[from] drain', `[of] ${source}`); break; case 'wish': break; @@ -2202,9 +2198,9 @@ export class Battle { if (effect.effectType === 'Move') { this.add('-heal', target, target.getHealth); } else if (source && source !== target) { - this.add('-heal', target, target.getHealth, '[from] ' + effect.fullname, '[of] ' + source); + this.add('-heal', target, target.getHealth, `[from] ${effect.fullname}`, `[of] ${source}`); } else { - this.add('-heal', target, target.getHealth, '[from] ' + effect.fullname); + this.add('-heal', target, target.getHealth, `[from] ${effect.fullname}`); } break; } @@ -2254,7 +2250,7 @@ export class Battle { /** Given a table of base stats and a pokemon set, return the actual stats. */ spreadModify(baseStats: StatsTable, set: PokemonSet): StatsTable { - const modStats: SparseStatsTable = {atk: 10, def: 10, spa: 10, spd: 10, spe: 10}; + const modStats: SparseStatsTable = { atk: 10, def: 10, spa: 10, spd: 10, spe: 10 }; const tr = this.trunc; let statName: keyof StatsTable; for (statName in modStats) { @@ -2350,7 +2346,7 @@ export class Battle { // Stalwart sets trackTarget in ModifyMove, but ModifyMove happens after getTarget, so // we need to manually check for Stalwart here if (pokemon.hasAbility(['stalwart', 'propellertail'])) tracksTarget = true; - if (tracksTarget && originalTarget && originalTarget.isActive) { + if (tracksTarget && originalTarget?.isActive) { // smart-tracking move's original target is on the field: target it return originalTarget; } @@ -2364,8 +2360,10 @@ export class Battle { // Fails if the target is the user and the move can't target its own position const selfLoc = pokemon.getLocOf(pokemon); - if (['adjacentAlly', 'any', 'normal'].includes(move.target) && targetLoc === selfLoc && - !pokemon.volatiles['twoturnmove'] && !pokemon.volatiles['iceball'] && !pokemon.volatiles['rollout']) { + if ( + ['adjacentAlly', 'any', 'normal'].includes(move.target) && targetLoc === selfLoc && + !pokemon.volatiles['twoturnmove'] && !pokemon.volatiles['iceball'] && !pokemon.volatiles['rollout'] + ) { return move.flags['futuremove'] ? pokemon : null; } if (move.target !== 'randomNormal' && this.validTargetLoc(targetLoc, pokemon, move.target)) { @@ -2455,8 +2453,7 @@ export class Battle { faintQueueLeft = this.faintQueue.length; faintData = this.faintQueue.shift()!; const pokemon: Pokemon = faintData.target; - if (!pokemon.fainted && - this.runEvent('BeforeFaint', pokemon, faintData.source, faintData.effect)) { + if (!pokemon.fainted && this.runEvent('BeforeFaint', pokemon, faintData.source, faintData.effect)) { this.add('faint', pokemon); if (pokemon.side.pokemonLeft) pokemon.side.pokemonLeft--; if (pokemon.side.totalFainted < 100) pokemon.side.totalFainted++; @@ -2490,7 +2487,7 @@ export class Battle { this.queue.clear(); // Fainting clears accumulated Bide damage for (const pokemon of this.getAllActive()) { - if (pokemon.volatiles['bide'] && pokemon.volatiles['bide'].damage) { + if (pokemon.volatiles['bide']?.damage) { pokemon.volatiles['bide'].damage = 0; this.hint("Desync Clause Mod activated!"); this.hint("In Gen 1, Bide's accumulated damage is reset to 0 when a Pokemon faints."); @@ -2601,7 +2598,7 @@ export class Battle { pokemon.setAbility(species.abilities['0'], null, true); pokemon.baseAbility = pokemon.ability; - const behemothMove: {[k: string]: string} = { + const behemothMove: { [k: string]: string } = { 'Zacian-Crowned': 'behemothblade', 'Zamazenta-Crowned': 'behemothbash', }; const ironHead = pokemon.baseMoves.indexOf('ironhead'); @@ -2610,8 +2607,8 @@ export class Battle { pokemon.baseMoveSlots[ironHead] = { move: move.name, id: move.id, - pp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, - maxpp: (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5, + pp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, + maxpp: move.noPPBoosts ? move.pp : move.pp * 8 / 5, target: move.target, disabled: false, disabledSource: '', @@ -2836,8 +2833,10 @@ export class Battle { if (!reviveSwitch) switches[i] = false; } else if (switches[i]) { for (const pokemon of this.sides[i].active) { - if (pokemon.hp && pokemon.switchFlag && pokemon.switchFlag !== 'revivalblessing' && - !pokemon.skipBeforeSwitchOutEventFlag) { + if ( + pokemon.hp && pokemon.switchFlag && pokemon.switchFlag !== 'revivalblessing' && + !pokemon.skipBeforeSwitchOutEventFlag + ) { this.runEvent('BeforeSwitchOut', pokemon); pokemon.skipBeforeSwitchOutEventFlag = true; this.faintMessages(); // Pokemon may have fainted in BeforeSwitchOut @@ -2884,8 +2883,8 @@ export class Battle { if (this.requestState) this.requestState = ''; if (!this.midTurn) { - this.queue.insertChoice({choice: 'beforeTurn'}); - this.queue.addChoice({choice: 'residual'}); + this.queue.insertChoice({ choice: 'beforeTurn' }); + this.queue.addChoice({ choice: 'residual' }); this.midTurn = true; } @@ -3020,7 +3019,7 @@ export class Battle { } } - add(...parts: (Part | (() => {side: SideID, secret: string, shared: string}))[]) { + add(...parts: (Part | (() => { side: SideID, secret: string, shared: string }))[]) { if (!parts.some(part => typeof part === 'function')) { this.log.push(`|${parts.join('|')}`); return; @@ -3044,13 +3043,12 @@ export class Battle { this.addSplit(side!, secret, shared); } - // eslint-disable-next-line @typescript-eslint/ban-types addMove(...args: (string | number | Function | AnyObject)[]) { this.lastMoveLine = this.log.length; + // eslint-disable-next-line @typescript-eslint/no-base-to-string this.log.push(`|${args.join('|')}`); } - // eslint-disable-next-line @typescript-eslint/ban-types attrLastMove(...args: (string | number | Function | AnyObject)[]) { if (this.lastMoveLine < 0) return; if (this.log[this.lastMoveLine].startsWith('|-anim|')) { @@ -3065,6 +3063,7 @@ export class Battle { parts[4] = ''; this.log[this.lastMoveLine] = parts.join('|'); } + // eslint-disable-next-line @typescript-eslint/no-base-to-string this.log[this.lastMoveLine] += `|${args.join('|')}`; } @@ -3138,7 +3137,7 @@ export class Battle { if ((toID(set.species) === 'zacian' && toID(set.item) === 'rustedsword') || (toID(set.species) === 'zamazenta' && toID(set.item) === 'rustedshield')) { newSet.species = Dex.species.get(set.species + 'crowned').name; - const crowned: {[k: string]: string} = { + const crowned: { [k: string]: string } = { 'Zacian-Crowned': 'behemothblade', 'Zamazenta-Crowned': 'behemothbash', }; const ironHead = set.moves.map(toID).indexOf('ironhead' as ID); @@ -3190,7 +3189,7 @@ export class Battle { /** @deprecated */ join(slot: SideID, name: string, avatar: string, team: PokemonSet[] | string | null) { - this.setPlayer(slot, {name, avatar, team}); + this.setPlayer(slot, { name, avatar, team }); return this.getSide(slot); } @@ -3206,12 +3205,12 @@ export class Battle { turns: this.turn, p1: this.sides[0].name, p2: this.sides[1].name, - p3: this.sides[2] && this.sides[2].name, - p4: this.sides[3] && this.sides[3].name, + p3: this.sides[2]?.name, + p4: this.sides[3]?.name, p1team: this.sides[0].team, p2team: this.sides[1].team, - p3team: this.sides[2] && this.sides[2].team, - p4team: this.sides[3] && this.sides[3].team, + p3team: this.sides[2]?.team, + p4team: this.sides[3]?.team, score: [this.sides[0].pokemonLeft, this.sides[1].pokemonLeft], inputLog: this.inputLog, }; diff --git a/sim/dex-abilities.ts b/sim/dex-abilities.ts index 645fff611b..baef6ec20e 100644 --- a/sim/dex-abilities.ts +++ b/sim/dex-abilities.ts @@ -1,6 +1,6 @@ -import type {PokemonEventMethods, ConditionData} from './dex-conditions'; -import {assignMissingFields, BasicEffect, toID} from './dex-data'; -import {Utils} from '../lib/utils'; +import type { PokemonEventMethods, ConditionData } from './dex-conditions'; +import { assignMissingFields, BasicEffect, toID } from './dex-data'; +import { Utils } from '../lib/utils'; interface AbilityEventMethods { onCheckShow?: (this: Battle, pokemon: Pokemon) => void; @@ -24,9 +24,9 @@ export interface AbilityData extends Partial, AbilityEventMethods, Poke name: string; } -export type ModdedAbilityData = AbilityData | Partial & {inherit: true}; -export interface AbilityDataTable {[abilityid: IDEntry]: AbilityData} -export interface ModdedAbilityDataTable {[abilityid: IDEntry]: ModdedAbilityData} +export type ModdedAbilityData = AbilityData | Partial & { inherit: true }; +export interface AbilityDataTable { [abilityid: IDEntry]: AbilityData } +export interface ModdedAbilityDataTable { [abilityid: IDEntry]: ModdedAbilityData } export class Ability extends BasicEffect implements Readonly { declare readonly effectType: 'Ability'; @@ -67,7 +67,7 @@ export class Ability extends BasicEffect implements Readonly { } } -const EMPTY_ABILITY = Utils.deepFreeze(new Ability({id: '', name: '', exists: false})); +const EMPTY_ABILITY = Utils.deepFreeze(new Ability({ id: '', name: '', exists: false })); export class DexAbilities { readonly dex: ModdedDex; diff --git a/sim/dex-conditions.ts b/sim/dex-conditions.ts index f8c160c980..7e0da2ecba 100644 --- a/sim/dex-conditions.ts +++ b/sim/dex-conditions.ts @@ -1,6 +1,6 @@ -import {Utils} from '../lib/utils'; -import {assignMissingFields, BasicEffect, toID} from './dex-data'; -import type {SecondaryEffect, MoveEventMethods} from './dex-moves'; +import { Utils } from '../lib/utils'; +import { assignMissingFields, BasicEffect, toID } from './dex-data'; +import type { SecondaryEffect, MoveEventMethods } from './dex-moves'; /** * Event method prefixes: @@ -616,9 +616,9 @@ export interface FieldConditionData extends export type ConditionData = PokemonConditionData | SideConditionData | FieldConditionData; -export type ModdedConditionData = ConditionData & {inherit?: true}; -export interface ConditionDataTable {[id: IDEntry]: ConditionData} -export interface ModdedConditionDataTable {[id: IDEntry]: ModdedConditionData} +export type ModdedConditionData = ConditionData & { inherit?: true }; +export interface ConditionDataTable { [id: IDEntry]: ConditionData } +export interface ModdedConditionDataTable { [id: IDEntry]: ModdedConditionData } export class Condition extends BasicEffect implements Readonly { @@ -643,7 +643,7 @@ export class Condition extends BasicEffect implements } } -const EMPTY_CONDITION: Condition = Utils.deepFreeze(new Condition({name: '', exists: false})); +const EMPTY_CONDITION: Condition = Utils.deepFreeze(new Condition({ name: '', exists: false })); export class DexConditions { readonly dex: ModdedDex; @@ -669,29 +669,29 @@ export class DexConditions { let found; if (id.startsWith('item:')) { const item = this.dex.items.getByID(id.slice(5) as ID); - condition = {...item, id: 'item:' + item.id as ID} as any as Condition; + condition = { ...item, id: 'item:' + item.id as ID } as any as Condition; } else if (id.startsWith('ability:')) { const ability = this.dex.abilities.getByID(id.slice(8) as ID); - condition = {...ability, id: 'ability:' + ability.id as ID} as any as Condition; + condition = { ...ability, id: 'ability:' + ability.id as ID } as any as Condition; } else if (this.dex.data.Rulesets.hasOwnProperty(id)) { condition = this.dex.formats.get(id) as any as Condition; // formats can't be frozen if they don't have a ruleTable this.conditionCache.set(id, condition); return condition; } else if (this.dex.data.Conditions.hasOwnProperty(id)) { - condition = new Condition({name: id, ...this.dex.data.Conditions[id]}); + condition = new Condition({ name: id, ...this.dex.data.Conditions[id] }); } else if ( (this.dex.data.Moves.hasOwnProperty(id) && (found = this.dex.data.Moves[id]).condition) || (this.dex.data.Abilities.hasOwnProperty(id) && (found = this.dex.data.Abilities[id]).condition) || (this.dex.data.Items.hasOwnProperty(id) && (found = this.dex.data.Items[id]).condition) ) { - condition = new Condition({name: found.name || id, ...found.condition}); + condition = new Condition({ name: found.name || id, ...found.condition }); } else if (id === 'recoil') { - condition = new Condition({name: 'Recoil', effectType: 'Recoil'}); + condition = new Condition({ name: 'Recoil', effectType: 'Recoil' }); } else if (id === 'drain') { - condition = new Condition({name: 'Drain', effectType: 'Drain'}); + condition = new Condition({ name: 'Drain', effectType: 'Drain' }); } else { - condition = new Condition({name: id, exists: false}); + condition = new Condition({ name: id, exists: false }); } this.conditionCache.set(id, this.dex.deepFreeze(condition)); diff --git a/sim/dex-data.ts b/sim/dex-data.ts index b89a4d39f8..392b58acf0 100644 --- a/sim/dex-data.ts +++ b/sim/dex-data.ts @@ -4,7 +4,7 @@ * * @license MIT */ -import {Utils} from '../lib/utils'; +import { Utils } from '../lib/utils'; /** * Converts anything to an ID. An ID must have only lowercase alphanumeric @@ -22,7 +22,7 @@ import {Utils} from '../lib/utils'; export function toID(text: any): ID { if (typeof text !== 'string') { if (text) text = text.id || text.userid || text.roomid || text; - if (typeof text === 'number') text = '' + text; + if (typeof text === 'number') text = `${text}`; else if (typeof text !== 'string') return ''; } return text.toLowerCase().replace(/[^a-z0-9]+/g, '') as ID; @@ -146,7 +146,7 @@ export class Nature extends BasicEffect implements Readonly> & {inherit: true}; - -export interface NatureDataTable {[natureid: IDEntry]: NatureData} +export type ModdedNatureData = NatureData | Partial> & { inherit: true }; +export interface NatureDataTable { [natureid: IDEntry]: NatureData } export class DexNatures { readonly dex: ModdedDex; @@ -189,7 +188,7 @@ export class DexNatures { nature = new Nature(natureData); if (nature.gen > this.dex.gen) nature.isNonstandard = 'Future'; } else { - nature = new Nature({name: id, exists: false}); + nature = new Nature({ name: id, exists: false }); } if (nature.exists) this.natureCache.set(id, this.dex.deepFreeze(nature)); @@ -208,15 +207,15 @@ export class DexNatures { } export interface TypeData { - damageTaken: {[attackingTypeNameOrEffectid: string]: number}; + damageTaken: { [attackingTypeNameOrEffectid: string]: number }; HPdvs?: SparseStatsTable; HPivs?: SparseStatsTable; isNonstandard?: Nonstandard | null; } -export type ModdedTypeData = TypeData | Partial> & {inherit: true}; -export interface TypeDataTable {[typeid: IDEntry]: TypeData} -export interface ModdedTypeDataTable {[typeid: IDEntry]: ModdedTypeData} +export type ModdedTypeData = TypeData | Partial> & { inherit: true }; +export interface TypeDataTable { [typeid: IDEntry]: TypeData } +export interface ModdedTypeDataTable { [typeid: IDEntry]: ModdedTypeData } type TypeInfoEffectType = 'Type' | 'EffectType'; @@ -251,7 +250,7 @@ export class TypeInfo implements Readonly { * Type chart, attackingTypeName:result, effectid:result * result is: 0 = normal, 1 = weakness, 2 = resistance, 3 = immunity */ - readonly damageTaken: {[attackingTypeNameOrEffectid: string]: number}; + readonly damageTaken: { [attackingTypeNameOrEffectid: string]: number }; /** The IVs to get this Type Hidden Power (in gen 3 and later) */ readonly HPivs: SparseStatsTable; /** The DVs to get this Type Hidden Power (in gen 2). */ @@ -275,7 +274,7 @@ export class TypeInfo implements Readonly { } } -const EMPTY_TYPE_INFO = Utils.deepFreeze(new TypeInfo({name: '', id: '', exists: false, effectType: 'EffectType'})); +const EMPTY_TYPE_INFO = Utils.deepFreeze(new TypeInfo({ name: '', id: '', exists: false, effectType: 'EffectType' })); export class DexTypes { readonly dex: ModdedDex; @@ -299,9 +298,9 @@ export class DexTypes { const typeName = id.charAt(0).toUpperCase() + id.substr(1); if (typeName && this.dex.data.TypeChart.hasOwnProperty(id)) { - type = new TypeInfo({name: typeName, id, ...this.dex.data.TypeChart[id]}); + type = new TypeInfo({ name: typeName, id, ...this.dex.data.TypeChart[id] }); } else { - type = new TypeInfo({name: typeName, id, exists: false, effectType: 'EffectType'}); + type = new TypeInfo({ name: typeName, id, exists: false, effectType: 'EffectType' }); } if (type.exists) this.typeCache.set(id, this.dex.deepFreeze(type)); @@ -334,7 +333,7 @@ export class DexTypes { } const idsCache: readonly StatID[] = ['hp', 'atk', 'def', 'spa', 'spd', 'spe']; -const reverseCache: {readonly [k: IDEntry]: StatID} = { +const reverseCache: { readonly [k: IDEntry]: StatID } = { __proto: null as any, "hitpoints": 'hp', "attack": 'atk', @@ -345,9 +344,9 @@ const reverseCache: {readonly [k: IDEntry]: StatID} = { "speed": 'spe', }; export class DexStats { - readonly shortNames: {readonly [k in StatID]: string}; - readonly mediumNames: {readonly [k in StatID]: string}; - readonly names: {readonly [k in StatID]: string}; + readonly shortNames: { readonly [k in StatID]: string }; + readonly mediumNames: { readonly [k in StatID]: string }; + readonly names: { readonly [k in StatID]: string }; constructor(dex: ModdedDex) { if (dex.gen !== 1) { this.shortNames = { diff --git a/sim/dex-formats.ts b/sim/dex-formats.ts index fb4a8430b6..93fffd755c 100644 --- a/sim/dex-formats.ts +++ b/sim/dex-formats.ts @@ -1,8 +1,8 @@ -import {Utils} from '../lib/utils'; -import {assignMissingFields, toID, BasicEffect} from './dex-data'; -import {EventMethods} from './dex-conditions'; -import {SpeciesData} from './dex-species'; -import {Tags} from '../data/tags'; +import { Utils } from '../lib/utils'; +import { assignMissingFields, toID, BasicEffect } from './dex-data'; +import type { EventMethods } from './dex-conditions'; +import type { SpeciesData } from './dex-species'; +import { Tags } from '../data/tags'; const DEFAULT_MOD = 'gen9'; @@ -10,10 +10,10 @@ export interface FormatData extends Partial, EventMethods { name: string; } -export type FormatList = (FormatData | {section: string, column?: number})[]; -export type ModdedFormatData = FormatData | Omit & {inherit: true}; -export interface FormatDataTable {[id: IDEntry]: FormatData} -export interface ModdedFormatDataTable {[id: IDEntry]: ModdedFormatData} +export type FormatList = (FormatData | { section: string, column?: number })[]; +export type ModdedFormatData = FormatData | Omit & { inherit: true }; +export interface FormatDataTable { [id: IDEntry]: FormatData } +export interface ModdedFormatDataTable { [id: IDEntry]: ModdedFormatData } type FormatEffectType = 'Format' | 'Ruleset' | 'Rule' | 'ValidatorRule'; @@ -149,7 +149,7 @@ export class RuleTable extends Map { * - '': whitelisted * - null: neither whitelisted nor banned */ - check(thing: string, setHas: {[id: string]: true} | null = null) { + check(thing: string, setHas: { [id: string]: true } | null = null) { if (this.has(`+${thing}`)) return ''; if (setHas) setHas[thing] = true; return this.getReason(`-${thing}`); @@ -431,7 +431,7 @@ export class Format extends BasicEffect implements Readonly { */ declare readonly hasValue?: boolean | 'integer' | 'positive-integer'; declare readonly onValidateRule?: ( - this: {format: Format, ruleTable: RuleTable, dex: ModdedDex}, value: string + this: { format: Format, ruleTable: RuleTable, dex: ModdedDex }, value: string ) => string | void; /** ID of rule that can't be combined with this rule */ declare readonly mutuallyExclusiveWith?: string; @@ -472,7 +472,7 @@ export class Format extends BasicEffect implements Readonly { declare readonly validateSet?: (this: TeamValidator, set: PokemonSet, teamHas: AnyObject) => string[] | null; declare readonly validateTeam?: (this: TeamValidator, team: PokemonSet[], options?: { removeNicknames?: boolean, - skipSets?: {[name: string]: {[key: string]: boolean}}, + skipSets?: { [name: string]: { [key: string]: boolean } }, }) => string[] | void; declare readonly section?: string; declare readonly column?: number; @@ -515,13 +515,13 @@ function mergeFormatLists(main: FormatList, custom: FormatList | undefined): For const build: FormatSection[] = []; // used to track current section to keep formats under their sections. - let current: FormatSection | undefined = {section: "", formats: []}; + let current: FormatSection | undefined = { section: "", formats: [] }; // populates the original sections and formats easily // there should be no repeat sections at this point. for (const element of main) { if (element.section) { - current = {section: element.section, column: element.column, formats: []}; + current = { section: element.section, column: element.column, formats: [] }; build.push(current); } else if ((element as FormatData).name) { current.formats.push((element as FormatData)); @@ -537,7 +537,7 @@ function mergeFormatLists(main: FormatList, custom: FormatList | undefined): For // if it's new it makes a new entry. if (current === undefined) { - current = {section: element.section, column: element.column, formats: []}; + current = { section: element.section, column: element.column, formats: [] }; build.push(current); } } else if ((element as FormatData).name) { // otherwise, adds the element to its section. @@ -549,7 +549,7 @@ function mergeFormatLists(main: FormatList, custom: FormatList | undefined): For // builds the final result. for (const element of build) { // adds the section to the list. - result.push({section: element.section, column: element.column}, ...element.formats); + result.push({ section: element.section, column: element.column }, ...element.formats); } return result; @@ -682,9 +682,9 @@ export class DexFormats { } let effect; if (this.dex.data.Rulesets.hasOwnProperty(id)) { - effect = new Format({name, ...this.dex.data.Rulesets[id] as any, ...supplementaryAttributes}); + effect = new Format({ name, ...this.dex.data.Rulesets[id] as any, ...supplementaryAttributes }); } else { - effect = new Format({id, name, exists: false}); + effect = new Format({ id, name, exists: false }); } return effect; } @@ -889,7 +889,9 @@ export class DexFormats { if ("+*-!".includes(rule.charAt(0))) continue; const subFormat = this.dex.formats.get(rule); if (subFormat.exists) { - const value = subFormat.onValidateRule?.call({format, ruleTable, dex: this.dex}, ruleTable.valueRules.get(rule as ID)!); + const value = subFormat.onValidateRule?.call( + { format, ruleTable, dex: this.dex }, ruleTable.valueRules.get(rule as ID)! + ); if (typeof value === 'string') ruleTable.valueRules.set(subFormat.id, value); } } diff --git a/sim/dex-items.ts b/sim/dex-items.ts index 00e6588d10..c7c199f95e 100644 --- a/sim/dex-items.ts +++ b/sim/dex-items.ts @@ -1,6 +1,6 @@ -import type {PokemonEventMethods, ConditionData} from './dex-conditions'; -import {assignMissingFields, BasicEffect, toID} from './dex-data'; -import {Utils} from '../lib/utils'; +import type { PokemonEventMethods, ConditionData } from './dex-conditions'; +import { assignMissingFields, BasicEffect, toID } from './dex-data'; +import { Utils } from '../lib/utils'; interface FlingData { basePower: number; @@ -18,8 +18,8 @@ export type ModdedItemData = ItemData | Partial> & { onCustap?: (this: Battle, pokemon: Pokemon) => void, }; -export interface ItemDataTable {[itemid: IDEntry]: ItemData} -export interface ModdedItemDataTable {[itemid: IDEntry]: ModdedItemData} +export interface ItemDataTable { [itemid: IDEntry]: ItemData } +export interface ModdedItemDataTable { [itemid: IDEntry]: ModdedItemData } export class Item extends BasicEffect implements Readonly { declare readonly effectType: 'Item'; @@ -98,7 +98,7 @@ export class Item extends BasicEffect implements Readonly { declare readonly condition?: ConditionData; declare readonly forcedForme?: string; declare readonly isChoice?: boolean; - declare readonly naturalGift?: {basePower: number, type: string}; + declare readonly naturalGift?: { basePower: number, type: string }; declare readonly spritenum?: number; declare readonly boosts?: SparseBoostsTable | false; @@ -148,17 +148,17 @@ export class Item extends BasicEffect implements Readonly { // specified manually } - if (this.isBerry) this.fling = {basePower: 10}; - if (this.id.endsWith('plate')) this.fling = {basePower: 90}; - if (this.onDrive) this.fling = {basePower: 70}; - if (this.megaStone) this.fling = {basePower: 80}; - if (this.onMemory) this.fling = {basePower: 50}; + if (this.isBerry) this.fling = { basePower: 10 }; + if (this.id.endsWith('plate')) this.fling = { basePower: 90 }; + if (this.onDrive) this.fling = { basePower: 70 }; + if (this.megaStone) this.fling = { basePower: 80 }; + if (this.onMemory) this.fling = { basePower: 50 }; assignMissingFields(this, data); } } -const EMPTY_ITEM = Utils.deepFreeze(new Item({name: '', exists: false})); +const EMPTY_ITEM = Utils.deepFreeze(new Item({ name: '', exists: false })); export class DexItems { readonly dex: ModdedDex; @@ -207,15 +207,17 @@ export class DexItems { const parent = this.dex.mod(this.dex.parentMod); if (itemData === parent.data.Items[id]) { const parentItem = parent.items.getByID(id); - if (item.isNonstandard === parentItem.isNonstandard && - item.desc === parentItem.desc && - item.shortDesc === parentItem.shortDesc) { + if ( + item.isNonstandard === parentItem.isNonstandard && + item.desc === parentItem.desc && + item.shortDesc === parentItem.shortDesc + ) { item = parentItem; } } } } else { - item = new Item({name: id, exists: false}); + item = new Item({ name: id, exists: false }); } if (item.exists) this.itemCache.set(id, this.dex.deepFreeze(item)); diff --git a/sim/dex-moves.ts b/sim/dex-moves.ts index 06786d3295..6895740e96 100644 --- a/sim/dex-moves.ts +++ b/sim/dex-moves.ts @@ -1,6 +1,6 @@ -import {Utils} from '../lib/utils'; -import type {ConditionData} from './dex-conditions'; -import {assignMissingFields, BasicEffect, toID} from './dex-data'; +import { Utils } from '../lib/utils'; +import type { ConditionData } from './dex-conditions'; +import { assignMissingFields, BasicEffect, toID } from './dex-data'; /** * Describes the acceptable target(s) of a move. @@ -134,14 +134,13 @@ export interface MoveEventMethods { onMoveFail?: CommonHandlers['VoidMove']; onModifyType?: (this: Battle, move: ActiveMove, pokemon: Pokemon, target: Pokemon) => void; onModifyTarget?: ( - this: Battle, relayVar: {target: Pokemon}, pokemon: Pokemon, target: Pokemon, move: ActiveMove + this: Battle, relayVar: { target: Pokemon }, pokemon: Pokemon, target: Pokemon, move: ActiveMove ) => void; onPrepareHit?: CommonHandlers['ResultMove']; onTry?: CommonHandlers['ResultSourceMove']; onTryHit?: CommonHandlers['ExtResultSourceMove']; onTryHitField?: CommonHandlers['ResultMove']; - onTryHitSide?: (this: Battle, side: Side, source: Pokemon, move: ActiveMove) => boolean | - null | "" | void; + onTryHitSide?: (this: Battle, side: Side, source: Pokemon, move: ActiveMove) => boolean | null | "" | void; onTryImmunity?: CommonHandlers['ResultMove']; onTryMove?: CommonHandlers['ResultSourceMove']; onUseMoveMessage?: CommonHandlers['VoidSourceMove']; @@ -198,7 +197,7 @@ export interface MoveData extends EffectData, MoveEventMethods, HitEffect { heal?: number[] | null; forceSwitch?: boolean; selfSwitch?: 'copyvolatile' | 'shedtail' | boolean; - selfBoost?: {boosts?: SparseBoostsTable}; + selfBoost?: { boosts?: SparseBoostsTable }; selfdestruct?: 'always' | 'ifHit' | boolean; breaksProtect?: boolean; /** @@ -245,7 +244,7 @@ export interface MoveData extends EffectData, MoveEventMethods, HitEffect { ignoreAccuracy?: boolean; ignoreDefensive?: boolean; ignoreEvasion?: boolean; - ignoreImmunity?: boolean | {[typeName: string]: boolean}; + ignoreImmunity?: boolean | { [typeName: string]: boolean }; ignoreNegativeOffensive?: boolean; ignoreOffensive?: boolean; ignorePositiveDefensive?: boolean; @@ -287,8 +286,8 @@ export type ModdedMoveData = MoveData | Partial> & { gen?: number, }; -export interface MoveDataTable {[moveid: IDEntry]: MoveData} -export interface ModdedMoveDataTable {[moveid: IDEntry]: ModdedMoveData} +export interface MoveDataTable { [moveid: IDEntry]: MoveData } +export interface ModdedMoveDataTable { [moveid: IDEntry]: ModdedMoveData } export interface Move extends Readonly { readonly effectType: 'Move'; @@ -403,19 +402,19 @@ export class DataMove extends BasicEffect implements Readonly { weightkg: number; } -export type ModdedSpeciesData = SpeciesData | Partial> & {inherit: true}; +export type ModdedSpeciesData = SpeciesData | Partial> & { inherit: true }; export interface SpeciesFormatsData { doublesTier?: TierTypes.Doubles | TierTypes.Other; @@ -33,30 +33,30 @@ export interface SpeciesFormatsData { tier?: TierTypes.Singles | TierTypes.Other; } -export type ModdedSpeciesFormatsData = SpeciesFormatsData & {inherit?: true}; +export type ModdedSpeciesFormatsData = SpeciesFormatsData & { inherit?: true }; export interface LearnsetData { - learnset?: {[moveid: IDEntry]: MoveSource[]}; + learnset?: { [moveid: IDEntry]: MoveSource[] }; eventData?: EventInfo[]; eventOnly?: boolean; encounters?: EventInfo[]; exists?: boolean; } -export type ModdedLearnsetData = LearnsetData & {inherit?: true}; +export type ModdedLearnsetData = LearnsetData & { inherit?: true }; export interface PokemonGoData { encounters?: string[]; - LGPERestrictiveMoves?: {[moveid: string]: number | null}; + LGPERestrictiveMoves?: { [moveid: string]: number | null }; } -export interface SpeciesDataTable {[speciesid: IDEntry]: SpeciesData} -export interface ModdedSpeciesDataTable {[speciesid: IDEntry]: ModdedSpeciesData} -export interface SpeciesFormatsDataTable {[speciesid: IDEntry]: SpeciesFormatsData} -export interface ModdedSpeciesFormatsDataTable {[speciesid: IDEntry]: ModdedSpeciesFormatsData} -export interface LearnsetDataTable {[speciesid: IDEntry]: LearnsetData} -export interface ModdedLearnsetDataTable {[speciesid: IDEntry]: ModdedLearnsetData} -export interface PokemonGoDataTable {[speciesid: IDEntry]: PokemonGoData} +export interface SpeciesDataTable { [speciesid: IDEntry]: SpeciesData } +export interface ModdedSpeciesDataTable { [speciesid: IDEntry]: ModdedSpeciesData } +export interface SpeciesFormatsDataTable { [speciesid: IDEntry]: SpeciesFormatsData } +export interface ModdedSpeciesFormatsDataTable { [speciesid: IDEntry]: ModdedSpeciesFormatsData } +export interface LearnsetDataTable { [speciesid: IDEntry]: LearnsetData } +export interface ModdedLearnsetDataTable { [speciesid: IDEntry]: ModdedLearnsetData } +export interface PokemonGoDataTable { [speciesid: IDEntry]: PokemonGoData } /** * Describes a possible way to get a move onto a pokemon. @@ -187,7 +187,7 @@ export class Species extends BasicEffect implements Readonly(); - for (const {species, learnset} of this.getFullLearnset(id)) { + for (const { species, learnset } of this.getFullLearnset(id)) { if (!eggMovesOnly) eggMovesOnly = this.eggMovesOnly(species, this.get(id)); for (const moveid in learnset) { if (species.isNonstandard !== 'CAP') { if (gen4HMMoves.includes(moveid) && this.dex.gen >= 5) { if (!learnset[moveid].some(source => parseInt(source.charAt(0)) >= 5 && parseInt(source.charAt(0)) <= this.dex.gen)) continue; - } else if (gen3HMMoves.includes(moveid) && this.dex.gen >= 4 && - !learnset[moveid].some(source => parseInt(source.charAt(0)) >= 4 && - parseInt(source.charAt(0)) <= this.dex.gen)) { + } else if ( + gen3HMMoves.includes(moveid) && this.dex.gen >= 4 && + !learnset[moveid].some( + source => parseInt(source.charAt(0)) >= 4 && parseInt(source.charAt(0)) <= this.dex.gen + ) + ) { continue; } } @@ -657,11 +660,11 @@ export class DexSpecies { return movePool; } - getFullLearnset(id: ID): (Learnset & {learnset: NonNullable})[] { + getFullLearnset(id: ID): (Learnset & { learnset: NonNullable })[] { const originalSpecies = this.get(id); let species: Species | null = originalSpecies; - const out: (Learnset & {learnset: NonNullable})[] = []; - const alreadyChecked: {[k: string]: boolean} = {}; + const out: (Learnset & { learnset: NonNullable })[] = []; + const alreadyChecked: { [k: string]: boolean } = {}; while (species?.name && !alreadyChecked[species.id]) { alreadyChecked[species.id] = true; @@ -739,7 +742,7 @@ export class DexSpecies { let learnsetData = this.learnsetCache.get(id); if (learnsetData) return learnsetData; if (!this.dex.data.Learnsets.hasOwnProperty(id)) { - return new Learnset({exists: false}, this.get(id)); + return new Learnset({ exists: false }, this.get(id)); } learnsetData = new Learnset(this.dex.data.Learnsets[id], this.get(id)); this.learnsetCache.set(id, this.dex.deepFreeze(learnsetData)); diff --git a/sim/dex.ts b/sim/dex.ts index a47b80f01b..9f13e8f9d4 100644 --- a/sim/dex.ts +++ b/sim/dex.ts @@ -30,19 +30,19 @@ import * as fs from 'fs'; import * as path from 'path'; import * as Data from './dex-data'; -import {Condition, DexConditions} from './dex-conditions'; -import {DataMove, DexMoves} from './dex-moves'; -import {Item, DexItems} from './dex-items'; -import {Ability, DexAbilities} from './dex-abilities'; -import {Species, DexSpecies} from './dex-species'; -import {Format, DexFormats} from './dex-formats'; -import {Utils} from '../lib/utils'; +import { Condition, DexConditions } from './dex-conditions'; +import { DataMove, DexMoves } from './dex-moves'; +import { Item, DexItems } from './dex-items'; +import { Ability, DexAbilities } from './dex-abilities'; +import { Species, DexSpecies } from './dex-species'; +import { Format, DexFormats } from './dex-formats'; +import { Utils } from '../lib/utils'; const BASE_MOD = 'gen9' as ID; const DATA_DIR = path.resolve(__dirname, '../data'); const MODS_DIR = path.resolve(DATA_DIR, './mods'); -const dexes: {[mod: string]: ModdedDex} = Object.create(null); +const dexes: { [mod: string]: ModdedDex } = Object.create(null); type DataType = 'Abilities' | 'Rulesets' | 'FormatsData' | 'Items' | 'Learnsets' | 'Moves' | @@ -69,8 +69,8 @@ const DATA_FILES = { }; /** Unfortunately we do for..in too much to want to deal with the casts */ -export interface DexTable {[id: string]: T} -export interface AliasesTable {[id: IDEntry]: string} +export interface DexTable { [id: string]: T } +export interface AliasesTable { [id: IDEntry]: string } interface DexTableData { Abilities: DexTable; @@ -158,7 +158,7 @@ export class ModdedDex { return this.loadData(); } - get dexes(): {[mod: string]: ModdedDex} { + get dexes(): { [mod: string]: ModdedDex } { this.includeMods(); return dexes; } @@ -212,7 +212,7 @@ export class ModdedDex { */ getName(name: any): string { if (typeof name !== 'string' && typeof name !== 'number') return ''; - name = ('' + name).replace(/[|\s[\],\u202e]+/g, ' ').trim(); + name = `${name}`.replace(/[|\s[\],\u202e]+/g, ' ').trim(); if (name.length > 18) name = name.substr(0, 18).trim(); // remove zalgo @@ -230,11 +230,11 @@ export class ModdedDex { * Also checks immunity to some statuses. */ getImmunity( - source: {type: string} | string, - target: {getTypes: () => string[]} | {types: string[]} | string[] | string + source: { type: string } | string, + target: { getTypes: () => string[] } | { types: string[] } | string[] | string ): boolean { const sourceType: string = typeof source !== 'string' ? source.type : source; - // @ts-ignore + // @ts-expect-error really wish TS would support this const targetTyping: string[] | string = target.getTypes?.() || target.types || target; if (Array.isArray(targetTyping)) { for (const type of targetTyping) { @@ -248,11 +248,11 @@ export class ModdedDex { } getEffectiveness( - source: {type: string} | string, - target: {getTypes: () => string[]} | {types: string[]} | string[] | string + source: { type: string } | string, + target: { getTypes: () => string[] } | { types: string[] } | string[] | string ): number { const sourceType: string = typeof source !== 'string' ? source.type : source; - // @ts-ignore + // @ts-expect-error really wish TS would support this const targetTyping: string[] | string = target.getTypes?.() || target.types || target; let totalTypeMod = 0; if (Array.isArray(targetTyping)) { @@ -323,7 +323,7 @@ export class ModdedDex { 'Fire', 'Water', 'Grass', 'Electric', 'Psychic', 'Ice', 'Dragon', 'Dark', ]; const tr = this.trunc; - const stats = {hp: 31, atk: 31, def: 31, spe: 31, spa: 31, spd: 31}; + const stats = { hp: 31, atk: 31, def: 31, spe: 31, spa: 31, spd: 31 }; if (this.gen <= 2) { // Gen 2 specific Hidden Power check. IVs are still treated 0-31 so we get them 0-15 const atkDV = tr(ivs.atk / 2); @@ -358,7 +358,7 @@ export class ModdedDex { * Truncate a number into an unsigned 32-bit integer, for * compatibility with the cartridge games' math systems. */ - trunc(num: number, bits = 0) { + trunc(this: void, num: number, bits = 0) { if (bits) return (num >>> 0) % (2 ** bits); return num >>> 0; } @@ -485,7 +485,7 @@ export class ModdedDex { loadData(): DexTableData { if (this.dataCache) return this.dataCache; dexes['base'].includeMods(); - const dataCache: {[k in keyof DexTableData]?: any} = {}; + const dataCache: { [k in keyof DexTableData]?: any } = {}; const basePath = this.dataDir + '/'; @@ -512,7 +512,7 @@ export class ModdedDex { dataCache[dataType] = this.loadDataFile(basePath, dataType); if (dataType === 'Rulesets' && !parentDex) { for (const format of this.formats.all()) { - dataCache.Rulesets[format.id] = {...format, ruleTable: null}; + dataCache.Rulesets[format.id] = { ...format, ruleTable: null }; } } } @@ -531,13 +531,13 @@ export class ModdedDex { } else if (!(entryId in childTypedData)) { // If it doesn't exist it's inherited from the parent data childTypedData[entryId] = parentTypedData[entryId]; - } else if (childTypedData[entryId] && childTypedData[entryId].inherit) { + } else if (childTypedData[entryId]?.inherit) { // {inherit: true} can be used to modify only parts of the parent data, // instead of overwriting entirely delete childTypedData[entryId].inherit; - // Merge parent into children entry, preserving existing childs' properties. - childTypedData[entryId] = {...parentTypedData[entryId], ...childTypedData[entryId]}; + // Merge parent and child's entry, with child overwriting parent. + childTypedData[entryId] = { ...parentTypedData[entryId], ...childTypedData[entryId] }; } } } @@ -567,7 +567,7 @@ dexes['base'] = new ModdedDex(); dexes[BASE_MOD] = dexes['base']; export const Dex = dexes['base']; -export namespace Dex { +export declare namespace Dex { export type Species = import('./dex-species').Species; export type Item = import('./dex-items').Item; export type Move = import('./dex-moves').Move; diff --git a/sim/examples/battle-stream-example.ts b/sim/examples/battle-stream-example.ts index 51eed3d05e..089d583a52 100644 --- a/sim/examples/battle-stream-example.ts +++ b/sim/examples/battle-stream-example.ts @@ -9,8 +9,8 @@ * @author Guangcong Luo */ -import {BattleStream, getPlayerStreams, Teams} from '..'; -import {RandomPlayerAI} from '../tools/random-player-ai'; +import { BattleStream, getPlayerStreams, Teams } from '..'; +import { RandomPlayerAI } from '../tools/random-player-ai'; /********************************************************************* * Run AI diff --git a/sim/field.ts b/sim/field.ts index 58862730ad..eb01c17b15 100644 --- a/sim/field.ts +++ b/sim/field.ts @@ -5,9 +5,9 @@ * @license MIT */ -import {State} from './state'; -import {EffectState} from './pokemon'; -import {toID} from './dex'; +import { State } from './state'; +import { type EffectState } from './pokemon'; +import { toID } from './dex'; export class Field { readonly battle: Battle; @@ -17,7 +17,7 @@ export class Field { weatherState: EffectState; terrain: ID; terrainState: EffectState; - pseudoWeather: {[id: string]: EffectState}; + pseudoWeather: { [id: string]: EffectState }; constructor(battle: Battle) { this.battle = battle; @@ -26,9 +26,9 @@ export class Field { this.id = ''; this.weather = ''; - this.weatherState = this.battle.initEffectState({id: ''}); + this.weatherState = this.battle.initEffectState({ id: '' }); this.terrain = ''; - this.terrainState = this.battle.initEffectState({id: ''}); + this.terrainState = this.battle.initEffectState({ id: '' }); this.pseudoWeather = {}; } @@ -39,7 +39,7 @@ export class Field { setWeather(status: string | Condition, source: Pokemon | 'debug' | null = null, sourceEffect: Effect | null = null) { status = this.battle.dex.conditions.get(status); if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect; - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; if (source === 'debug') source = this.battle.sides[0].active[0]; if (this.weather === status.id) { @@ -67,7 +67,7 @@ export class Field { const prevWeather = this.weather; const prevWeatherState = this.weatherState; this.weather = status.id; - this.weatherState = this.battle.initEffectState({id: status.id}); + this.weatherState = this.battle.initEffectState({ id: status.id }); if (source) { this.weatherState.source = source; this.weatherState.sourceSlot = source.getSlot(); @@ -130,7 +130,7 @@ export class Field { setTerrain(status: string | Effect, source: Pokemon | 'debug' | null = null, sourceEffect: Effect | null = null) { status = this.battle.dex.conditions.get(status); if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect; - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; if (source === 'debug') source = this.battle.sides[0].active[0]; if (!source) throw new Error(`setting terrain without a source`); @@ -188,7 +188,7 @@ export class Field { source: Pokemon | 'debug' | null = null, sourceEffect: Effect | null = null ): boolean { - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; if (source === 'debug') source = this.battle.sides[0].active[0]; status = this.battle.dex.conditions.get(status); diff --git a/sim/global-types.ts b/sim/global-types.ts index 6b1eff34ca..63229887f4 100644 --- a/sim/global-types.ts +++ b/sim/global-types.ts @@ -19,28 +19,28 @@ type TeamValidator = import('./team-validator').TeamValidator; type PokemonSources = import('./team-validator').PokemonSources; /** An ID must be lowercase alphanumeric. */ -type ID = '' | Lowercase & {__isID: true}; +type ID = '' | Lowercase & { __isID: true }; /** Like ID, but doesn't require you to type `as ID` to define it. For data files and object keys. */ type IDEntry = Lowercase; -type PokemonSlot = '' | IDEntry & {__isSlot: true}; -interface AnyObject {[k: string]: any} +type PokemonSlot = '' | IDEntry & { __isSlot: true }; +interface AnyObject { [k: string]: any } type GenderName = 'M' | 'F' | 'N' | ''; type StatIDExceptHP = 'atk' | 'def' | 'spa' | 'spd' | 'spe'; type StatID = 'hp' | StatIDExceptHP; -type StatsExceptHPTable = {[stat in StatIDExceptHP]: number}; -type StatsTable = {[stat in StatID]: number}; +type StatsExceptHPTable = { [stat in StatIDExceptHP]: number }; +type StatsTable = { [stat in StatID]: number }; type SparseStatsTable = Partial; type BoostID = StatIDExceptHP | 'accuracy' | 'evasion'; -type BoostsTable = {[boost in BoostID]: number }; +type BoostsTable = { [boost in BoostID]: number }; type SparseBoostsTable = Partial; type Nonstandard = 'Past' | 'Future' | 'Unobtainable' | 'CAP' | 'LGPE' | 'Custom' | 'Gigantamax'; type PokemonSet = import('./teams').PokemonSet; -namespace TierTypes { +declare namespace TierTypes { export type Singles = "AG" | "Uber" | "(Uber)" | "OU" | "(OU)" | "UUBL" | "UU" | "RUBL" | "RU" | "NUBL" | "NU" | - "(NU)" | "PUBL" | "PU" | "(PU)" | "ZUBL" | "ZU" | "NFE" | "LC"; + "(NU)" | "PUBL" | "PU" | "(PU)" | "ZUBL" | "ZU" | "NFE" | "LC"; export type Doubles = "DUber" | "(DUber)" | "DOU" | "(DOU)" | "DBL" | "DUU" | "(DUU)" | "NFE" | "LC"; export type Other = "Unreleased" | "Illegal" | "CAP" | "CAP NFE" | "CAP LC"; } @@ -107,7 +107,7 @@ interface EffectData { shortDesc?: string; } -type ModdedEffectData = EffectData | Partial & {inherit: true}; +type ModdedEffectData = EffectData | Partial & { inherit: true }; type EffectType = 'Condition' | 'Pokemon' | 'Move' | 'Item' | 'Ability' | 'Format' | @@ -144,9 +144,9 @@ type SideID = 'p1' | 'p2' | 'p3' | 'p4'; type SpreadMoveTargets = (Pokemon | false | null)[]; type SpreadMoveDamage = (number | boolean | undefined)[]; -type ZMoveOptions = ({move: string, target: MoveTarget} | null)[]; +type ZMoveOptions = ({ move: string, target: MoveTarget } | null)[]; interface DynamaxOptions { - maxMoves: ({move: string, target: MoveTarget, disabled?: boolean})[]; + maxMoves: ({ move: string, target: MoveTarget, disabled?: boolean })[]; gigantamax?: string; } @@ -265,7 +265,7 @@ interface ModdedBattleSide { canDynamaxNow?: (this: Side) => boolean; chooseSwitch?: (this: Side, slotText?: string) => any; getChoice?: (this: Side) => string; - getRequestData?: (this: Side, forAlly?: boolean) => {name: string, id: ID, pokemon: AnyObject[]}; + getRequestData?: (this: Side, forAlly?: boolean) => { name: string, id: ID, pokemon: AnyObject[] }; } interface ModdedBattlePokemon { @@ -288,7 +288,7 @@ interface ModdedBattlePokemon { getActionSpeed?: (this: Pokemon) => number; getItem?: (this: Pokemon) => Item; getMoveRequestData?: (this: Pokemon) => { - moves: {move: string, id: ID, target?: string, disabled?: boolean}[], + moves: { move: string, id: ID, target?: string, disabled?: boolean }[], maybeDisabled?: boolean, trapped?: boolean, maybeTrapped?: boolean, canMegaEvo?: boolean, canUltraBurst?: boolean, canZMove?: ZMoveOptions, }; @@ -296,7 +296,9 @@ interface ModdedBattlePokemon { move: string, id: string, disabled?: string | boolean, disabledSource?: string, target?: string, pp?: number, maxpp?: number, }[]; - getMoveTargets?: (this: Pokemon, move: ActiveMove, target: Pokemon) => {targets: Pokemon[], pressureTargets: Pokemon[]}; + getMoveTargets?: (this: Pokemon, move: ActiveMove, target: Pokemon) => { + targets: Pokemon[], pressureTargets: Pokemon[], + }; getStat?: ( this: Pokemon, statName: StatIDExceptHP, unboosted?: boolean, unmodified?: boolean, fastReturn?: boolean ) => number; @@ -446,7 +448,7 @@ type ItemText = TextFile; type PokedexText = TextFile; type DefaultText = AnyObject; -namespace RandomTeamsTypes { +declare namespace RandomTeamsTypes { export interface TeamDetails { megaStone?: number; zMove?: number; @@ -473,12 +475,12 @@ namespace RandomTeamsTypes { forceResult: boolean; weather?: string; terrain?: string[]; - typeCount: {[k: string]: number}; - typeComboCount: {[k: string]: number}; - baseFormes: {[k: string]: number}; - has: {[k: string]: number}; - weaknesses: {[k: string]: number}; - resistances: {[k: string]: number}; + typeCount: { [k: string]: number }; + typeComboCount: { [k: string]: number }; + baseFormes: { [k: string]: number }; + has: { [k: string]: number }; + weaknesses: { [k: string]: number }; + resistances: { [k: string]: number }; gigantamax?: boolean; } export interface RandomSet { @@ -547,8 +549,8 @@ namespace RandomTeamsTypes { sets: RandomSetData[]; } export type Role = '' | 'Fast Attacker' | 'Setup Sweeper' | 'Wallbreaker' | 'Tera Blast user' | - 'Bulky Attacker' | 'Bulky Setup' | 'Fast Bulky Setup' | 'Bulky Support' | 'Fast Support' | 'AV Pivot' | - 'Doubles Fast Attacker' | 'Doubles Setup Sweeper' | 'Doubles Wallbreaker' | 'Doubles Bulky Attacker' | - 'Doubles Bulky Setup' | 'Offensive Protect' | 'Bulky Protect' | 'Doubles Support' | 'Choice Item user' | - 'Z-Move user' | 'Staller' | 'Spinner' | 'Generalist' | 'Berry Sweeper' | 'Thief user'; + 'Bulky Attacker' | 'Bulky Setup' | 'Fast Bulky Setup' | 'Bulky Support' | 'Fast Support' | 'AV Pivot' | + 'Doubles Fast Attacker' | 'Doubles Setup Sweeper' | 'Doubles Wallbreaker' | 'Doubles Bulky Attacker' | + 'Doubles Bulky Setup' | 'Offensive Protect' | 'Bulky Protect' | 'Doubles Support' | 'Choice Item user' | + 'Z-Move user' | 'Staller' | 'Spinner' | 'Generalist' | 'Berry Sweeper' | 'Thief user'; } diff --git a/sim/index.ts b/sim/index.ts index 79cd8218fe..e7a0cb039f 100644 --- a/sim/index.ts +++ b/sim/index.ts @@ -10,20 +10,20 @@ // battle simulation -export {Battle} from './battle'; -export {BattleStream, getPlayerStreams} from './battle-stream'; -export {Pokemon} from './pokemon'; -export {PRNG} from './prng'; -export {Side} from './side'; +export { Battle } from './battle'; +export { BattleStream, getPlayerStreams } from './battle-stream'; +export { Pokemon } from './pokemon'; +export { PRNG } from './prng'; +export { Side } from './side'; // dex API -export {Dex, toID} from './dex'; +export { Dex, toID } from './dex'; // teams API -export {Teams} from './teams'; -export {TeamValidator} from './team-validator'; +export { Teams } from './teams'; +export { TeamValidator } from './team-validator'; // misc libraries diff --git a/sim/pokemon.ts b/sim/pokemon.ts index 931896b772..2174a5c058 100644 --- a/sim/pokemon.ts +++ b/sim/pokemon.ts @@ -5,8 +5,8 @@ * @license MIT license */ -import {State} from './state'; -import {toID} from './dex'; +import { State } from './state'; +import { toID } from './dex'; /** A Pokemon's move slot. */ interface MoveSlot { @@ -81,7 +81,7 @@ export class Pokemon { status: ID; statusState: EffectState; - volatiles: {[id: string]: EffectState}; + volatiles: { [id: string]: EffectState }; showCure?: boolean; /** @@ -300,7 +300,7 @@ export class Pokemon { const pokemonScripts = this.battle.format.pokemon || this.battle.dex.data.Scripts.pokemon; if (pokemonScripts) Object.assign(this, pokemonScripts); - if (typeof set === 'string') set = {name: set}; + if (typeof set === 'string') set = { name: set }; this.baseSpecies = this.battle.dex.species.get(set.species || set.name); if (!this.baseSpecies.exists) { @@ -312,14 +312,14 @@ export class Pokemon { if (set.name === set.species || !set.name) { set.name = this.baseSpecies.baseSpecies; } - this.speciesState = this.battle.initEffectState({id: this.species.id}); + this.speciesState = this.battle.initEffectState({ id: this.species.id }); this.name = set.name.substr(0, 20); this.fullname = this.side.id + ': ' + this.name; set.level = this.battle.clampIntRange(set.adjustLevel || set.level || 100, 1, 9999); this.level = set.level; - const genders: {[key: string]: GenderName} = {M: 'M', F: 'F', N: 'N'}; + const genders: { [key: string]: GenderName } = { M: 'M', F: 'F', N: 'N' }; this.gender = genders[set.gender] || this.species.gender || (this.battle.random(2) ? 'F' : 'M'); if (this.gender === 'N') this.gender = ''; this.happiness = typeof set.happiness === 'number' ? this.battle.clampIntRange(set.happiness, 0, 255) : 255; @@ -339,7 +339,7 @@ export class Pokemon { if (!set.hpType) set.hpType = move.type; move = this.battle.dex.moves.get('hiddenpower'); } - let basepp = (move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5; + let basepp = move.noPPBoosts ? move.pp : move.pp * 8 / 5; if (this.battle.gen < 3) basepp = Math.min(61, basepp); this.baseMoveSlots.push({ move: move.name, @@ -362,12 +362,12 @@ export class Pokemon { this.showCure = undefined; if (!this.set.evs) { - this.set.evs = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + this.set.evs = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; } if (!this.set.ivs) { - this.set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + this.set.ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; } - const stats: StatsTable = {hp: 31, atk: 31, def: 31, spe: 31, spa: 31, spd: 31}; + const stats: StatsTable = { hp: 31, atk: 31, def: 31, spe: 31, spa: 31, spd: 31 }; let stat: StatID; for (stat in stats) { if (!this.set.evs[stat]) this.set.evs[stat] = 0; @@ -395,15 +395,15 @@ export class Pokemon { // initialized in this.setSpecies(this.baseSpecies) this.baseStoredStats = null!; - this.storedStats = {atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; - this.boosts = {atk: 0, def: 0, spa: 0, spd: 0, spe: 0, accuracy: 0, evasion: 0}; + this.storedStats = { atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; + this.boosts = { atk: 0, def: 0, spa: 0, spd: 0, spe: 0, accuracy: 0, evasion: 0 }; this.baseAbility = toID(set.ability); this.ability = this.baseAbility; - this.abilityState = this.battle.initEffectState({id: this.ability, target: this}); + this.abilityState = this.battle.initEffectState({ id: this.ability, target: this }); this.item = toID(set.item); - this.itemState = this.battle.initEffectState({id: this.item, target: this}); + this.itemState = this.battle.initEffectState({ id: this.item, target: this }); this.lastItem = ''; this.usedItemThisTurn = false; this.ateBerry = false; @@ -473,7 +473,7 @@ export class Pokemon { // This is used in gen 1 only, here to avoid code repetition. // Only declared if gen 1 to avoid declaring an object we aren't going to need. - if (this.battle.gen === 1) this.modifiedStats = {atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + if (this.battle.gen === 1) this.modifiedStats = { atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; this.maxhp = 0; this.baseMaxhp = 0; @@ -509,8 +509,8 @@ export class Pokemon { let name = this.species.name; if (['Greninja-Bond', 'Rockruff-Dusk'].includes(name)) name = this.species.baseSpecies; if (!level) level = this.level; - return name + (level === 100 ? '' : ', L' + level) + - (this.gender === '' ? '' : ', ' + this.gender) + (this.set.shiny ? ', shiny' : ''); + return name + (level === 100 ? '' : `, L${level}`) + + (this.gender === '' ? '' : `, ${this.gender}`) + (this.set.shiny ? ', shiny' : ''); } getFullDetails = () => { @@ -522,7 +522,7 @@ export class Pokemon { ); } if (this.terastallized) details += `, tera:${this.terastallized}`; - return {side: health.side, secret: `${details}|${health.secret}`, shared: `${details}|${health.shared}`}; + return { side: health.side, secret: `${details}|${health.secret}`, shared: `${details}|${health.shared}` }; }; updateSpeed() { @@ -531,7 +531,7 @@ export class Pokemon { calculateStat(statName: StatIDExceptHP, boost: number, modifier?: number, statUser?: Pokemon) { statName = toID(statName) as StatIDExceptHP; - // @ts-ignore - type checking prevents 'hp' from being passed, but we're paranoid + // @ts-expect-error type checking prevents 'hp' from being passed, but we're paranoid if (statName === 'hp') throw new Error("Please read `maxhp` directly"); // base stat @@ -567,7 +567,7 @@ export class Pokemon { getStat(statName: StatIDExceptHP, unboosted?: boolean, unmodified?: boolean) { statName = toID(statName) as StatIDExceptHP; - // @ts-ignore - type checking prevents 'hp' from being passed, but we're paranoid + // @ts-expect-error type checking prevents 'hp' from being passed, but we're paranoid if (statName === 'hp') throw new Error("Please read `maxhp` directly"); // base stat @@ -585,7 +585,7 @@ export class Pokemon { // stat boosts if (!unboosted) { - const boosts = this.battle.runEvent('ModifyBoost', this, null, null, {...this.boosts}); + const boosts = this.battle.runEvent('ModifyBoost', this, null, null, { ...this.boosts }); let boost = boosts[statName]; const boostTable = [1, 1.5, 2, 2.5, 3, 3.5, 4]; if (boost > 6) boost = 6; @@ -599,7 +599,7 @@ export class Pokemon { // stat modifier effects if (!unmodified) { - const statTable: {[s in StatIDExceptHP]: string} = {atk: 'Atk', def: 'Def', spa: 'SpA', spd: 'SpD', spe: 'Spe'}; + const statTable: { [s in StatIDExceptHP]: string } = { atk: 'Atk', def: 'Def', spa: 'SpA', spd: 'SpD', spe: 'Spe' }; stat = this.battle.runEvent('Modify' + statTable[statName], this, null, null, stat); } @@ -751,7 +751,7 @@ export class Pokemon { return sameHalf ? -position : position; } - getMoveTargets(move: ActiveMove, target: Pokemon): {targets: Pokemon[], pressureTargets: Pokemon[]} { + getMoveTargets(move: ActiveMove, target: Pokemon): { targets: Pokemon[], pressureTargets: Pokemon[] } { let targets: Pokemon[] = []; switch (move.target) { @@ -786,7 +786,7 @@ export class Pokemon { if (!target || (target.fainted && !target.isAlly(this)) && this.battle.gameType !== 'freeforall') { // If a targeted foe faints, the move is retargeted const possibleTarget = this.battle.getRandomTarget(this, move); - if (!possibleTarget) return {targets: [], pressureTargets: []}; + if (!possibleTarget) return { targets: [], pressureTargets: [] }; target = possibleTarget; } if (this.battle.activePerHalf > 1 && !move.tracksTarget) { @@ -805,7 +805,7 @@ export class Pokemon { targets.push(target); } if (target.fainted && !move.flags['futuremove']) { - return {targets: [], pressureTargets: []}; + return { targets: [], pressureTargets: [] }; } if (selectedTarget !== target) { this.battle.retargetLastMove(target); @@ -821,7 +821,7 @@ export class Pokemon { pressureTargets = this.foes(); } - return {targets, pressureTargets}; + return { targets, pressureTargets }; } ignoringAbility() { @@ -946,11 +946,11 @@ export class Pokemon { for (const moveSlot of this.moveSlots) { let moveName = moveSlot.move; if (moveSlot.id === 'hiddenpower') { - moveName = 'Hidden Power ' + this.hpType; - if (this.battle.gen < 6) moveName += ' ' + this.hpPower; + moveName = `Hidden Power ${this.hpType}`; + if (this.battle.gen < 6) moveName += ` ${this.hpPower}`; } else if (moveSlot.id === 'return' || moveSlot.id === 'frustration') { const basePowerCallback = this.battle.dex.moves.get(moveSlot.id).basePowerCallback as (pokemon: Pokemon) => number; - moveName += ' ' + basePowerCallback(this); + moveName += ` ${basePowerCallback(this)}`; } let target = moveSlot.target; switch (moveSlot.id) { @@ -1021,16 +1021,16 @@ export class Pokemon { // Some pokemon species are unable to dynamax if (this.species.cannotDynamax || this.illusion?.species.cannotDynamax) return; } - const result: DynamaxOptions = {maxMoves: []}; + const result: DynamaxOptions = { maxMoves: [] }; let atLeastOne = false; for (const moveSlot of this.moveSlots) { const move = this.battle.dex.moves.get(moveSlot.id); const maxMove = this.battle.actions.getMaxMove(move, this); if (maxMove) { if (this.maxMoveDisabled(move)) { - result.maxMoves.push({move: maxMove.id, target: maxMove.target, disabled: true}); + result.maxMoves.push({ move: maxMove.id, target: maxMove.target, disabled: true }); } else { - result.maxMoves.push({move: maxMove.id, target: maxMove.target}); + result.maxMoves.push({ move: maxMove.id, target: maxMove.target }); atLeastOne = true; } } @@ -1049,12 +1049,12 @@ export class Pokemon { let moves = this.getMoves(lockedMove, isLastActive); if (!moves.length) { - moves = [{move: 'Struggle', id: 'struggle', target: 'randomNormal', disabled: false}]; + moves = [{ move: 'Struggle', id: 'struggle', target: 'randomNormal', disabled: false }]; lockedMove = 'struggle'; } const data: { - moves: {move: string, id: string, target?: string, disabled?: string | boolean}[], + moves: { move: string, id: string, target?: string, disabled?: string | boolean }[], maybeDisabled?: boolean, trapped?: boolean, maybeTrapped?: boolean, @@ -1117,11 +1117,11 @@ export class Pokemon { }, moves: this[forAlly ? 'baseMoves' : 'moves'].map(move => { if (move === 'hiddenpower') { - return move + toID(this.hpType) + (this.battle.gen < 6 ? '' : this.hpPower); + return `${move}${toID(this.hpType)}${this.battle.gen < 6 ? '' : this.hpPower}`; } if (move === 'frustration' || move === 'return') { const basePowerCallback = this.battle.dex.moves.get(move).basePowerCallback as (pokemon: Pokemon) => number; - return move + basePowerCallback(this); + return `${move}${basePowerCallback(this)}`; } return move; }), @@ -1202,7 +1202,7 @@ export class Pokemon { if (switchCause === 'shedtail' && i !== 'substitute') continue; if (this.battle.dex.conditions.getByID(i as ID).noCopy) continue; // shallow clones - this.volatiles[i] = this.battle.initEffectState({...pokemon.volatiles[i]}); + this.volatiles[i] = this.battle.initEffectState({ ...pokemon.volatiles[i] }); if (this.volatiles[i].linkedPokemon) { delete pokemon.volatiles[i].linkedPokemon; delete pokemon.volatiles[i].linkedStatus; @@ -1221,10 +1221,13 @@ export class Pokemon { transformInto(pokemon: Pokemon, effect?: Effect) { const species = pokemon.species; - if (pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) || + if ( + pokemon.fainted || this.illusion || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) || (pokemon.transformed && this.battle.gen >= 2) || (this.transformed && this.battle.gen >= 5) || - species.name === 'Eternatus-Eternamax' || (['Ogerpon', 'Terapagos'].includes(species.baseSpecies) && - (this.terastallized || pokemon.terastallized)) || this.terastallized === 'Stellar') { + species.name === 'Eternatus-Eternamax' || + (['Ogerpon', 'Terapagos'].includes(species.baseSpecies) && (this.terastallized || pokemon.terastallized)) || + this.terastallized === 'Stellar' + ) { return false; } @@ -1470,7 +1473,7 @@ export class Pokemon { } } if (this.species.name === 'Eternatus-Eternamax' && this.volatiles['dynamax']) { - this.volatiles = {dynamax: this.volatiles['dynamax']}; + this.volatiles = { dynamax: this.volatiles['dynamax'] }; } else { this.volatiles = {}; } @@ -1598,7 +1601,7 @@ export class Pokemon { d = this.battle.trunc(d); if (isNaN(d)) return; if (d < 1) d = 1; - d = d - this.hp; + d -= this.hp; this.hp += d; if (this.hp > this.maxhp) { d -= this.hp - this.maxhp; @@ -1646,8 +1649,9 @@ export class Pokemon { return false; } - if (!ignoreImmunities && status.id && - !(source?.hasAbility('corrosion') && ['tox', 'psn'].includes(status.id))) { + if ( + !ignoreImmunities && status.id && !(source?.hasAbility('corrosion') && ['tox', 'psn'].includes(status.id)) + ) { // the game currently never ignores immunities if (!this.runStatusImmunity(status.id === 'tox' ? 'psn' : status.id)) { this.battle.debug('immune to status'); @@ -1668,7 +1672,7 @@ export class Pokemon { } this.status = status.id; - this.statusState = this.battle.initEffectState({id: status.id, target: this}); + this.statusState = this.battle.initEffectState({ id: status.id, target: this }); if (source) this.statusState.source = source; if (status.duration) this.statusState.duration = status.duration; if (status.durationCallback) { @@ -1709,7 +1713,7 @@ export class Pokemon { if ((!this.hp && this.item !== 'jabocaberry' && this.item !== 'rowapberry') || !this.isActive) return false; if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect; - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; const item = this.getItem(); if (sourceEffect?.effectType === 'Item' && this.item !== sourceEffect.id && source === this) { // if an item is telling us to eat it but we aren't holding it, we probably shouldn't eat what we are holding @@ -1752,7 +1756,7 @@ export class Pokemon { if (!this.item || this.itemState.knockedOff) return false; if (!sourceEffect && this.battle.effect) sourceEffect = this.battle.effect; - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; const item = this.getItem(); if (sourceEffect?.effectType === 'Item' && this.item !== sourceEffect.id && source === this) { // if an item is telling us to eat it but we aren't holding it, we probably shouldn't eat what we are holding @@ -1761,7 +1765,7 @@ export class Pokemon { if (this.battle.runEvent('UseItem', this, null, null, item)) { switch (item.id) { case 'redcard': - this.battle.add('-enditem', this, item, '[of] ' + source); + this.battle.add('-enditem', this, item, `[of] ${source}`); break; default: if (item.isGem) { @@ -1824,7 +1828,7 @@ export class Pokemon { const oldItem = this.getItem(); const oldItemState = this.itemState; this.item = item.id; - this.itemState = this.battle.initEffectState({id: item.id, target: this}); + this.itemState = this.battle.initEffectState({ id: item.id, target: this }); if (oldItem.exists) this.battle.singleEvent('End', oldItem, oldItemState, this); if (item.id) { this.battle.singleEvent('Start', item, this.itemState, this, source, effect); @@ -1862,11 +1866,13 @@ export class Pokemon { } this.battle.singleEvent('End', this.battle.dex.abilities.get(oldAbility), this.abilityState, this, source); if (this.battle.effect && this.battle.effect.effectType === 'Move' && !isFromFormeChange) { - this.battle.add('-endability', this, this.battle.dex.abilities.get(oldAbility), '[from] move: ' + - this.battle.dex.moves.get(this.battle.effect.id)); + this.battle.add( + '-endability', this, this.battle.dex.abilities.get(oldAbility), + `[from] move: ${this.battle.dex.moves.get(this.battle.effect.id)}` + ); } this.ability = ability.id; - this.abilityState = this.battle.initEffectState({id: ability.id, target: this}); + this.abilityState = this.battle.initEffectState({ id: ability.id, target: this }); if (ability.id && this.battle.gen > 3 && (!isTransform || oldAbility !== ability.id || this.battle.gen <= 4)) { this.battle.singleEvent('Start', ability, this.abilityState, this, source); @@ -1925,7 +1931,7 @@ export class Pokemon { this.battle.debug('add volatile [' + status.id + '] interrupted'); return result; } - this.volatiles[status.id] = this.battle.initEffectState({id: status.id, name: status.name, target: this}); + this.volatiles[status.id] = this.battle.initEffectState({ id: status.id, name: status.name, target: this }); if (source) { this.volatiles[status.id].source = source; this.volatiles[status.id].sourceSlot = source.getSlot(); @@ -1988,7 +1994,7 @@ export class Pokemon { } getHealth = () => { - if (!this.hp) return {side: this.side.id, secret: '0 fnt', shared: '0 fnt'}; + if (!this.hp) return { side: this.side.id, secret: '0 fnt', shared: '0 fnt' }; let secret = `${this.hp}/${this.maxhp}`; let shared; const ratio = this.hp / this.maxhp; @@ -2015,7 +2021,7 @@ export class Pokemon { secret += ` ${this.status}`; shared += ` ${this.status}`; } - return {side: this.side.id, secret, shared}; + return { side: this.side.id, secret, shared }; }; /** diff --git a/sim/prng.ts b/sim/prng.ts index 0a8068ede1..325d7c99f4 100644 --- a/sim/prng.ts +++ b/sim/prng.ts @@ -12,8 +12,8 @@ * @license MIT license */ -import {Chacha20} from 'ts-chacha20'; -import {Utils} from '../lib/utils'; +import { Chacha20 } from 'ts-chacha20'; +import { Utils } from '../lib/utils'; import * as crypto from 'crypto'; export type PRNGSeed = `${'sodium' | 'gen5' | number},${string}`; diff --git a/sim/side.ts b/sim/side.ts index 8cfa1bb11a..bcef2bde86 100644 --- a/sim/side.ts +++ b/sim/side.ts @@ -19,15 +19,15 @@ * @license MIT */ -import {Utils} from '../lib/utils'; -import type {RequestState} from './battle'; -import {Pokemon, EffectState} from './pokemon'; -import {State} from './state'; -import {toID} from './dex'; +import { Utils } from '../lib/utils'; +import type { RequestState } from './battle'; +import { Pokemon, type EffectState } from './pokemon'; +import { State } from './state'; +import { toID } from './dex'; /** A single action that can be chosen. */ export interface ChosenAction { - choice: 'move' | 'switch' | 'instaswitch' | 'revivalblessing' | 'team' | 'shift' | 'pass'; // action type + choice: 'move' | 'switch' | 'instaswitch' | 'revivalblessing' | 'team' | 'shift' | 'pass';// action type pokemon?: Pokemon; // the pokemon doing the action targetLoc?: number; // relative location of the target to pokemon (move action only) moveid: string; // a move to use (move action only) @@ -91,8 +91,8 @@ export class Side { lastSelectedMove: ID = ''; /** these point to the same object as the ally's, in multi battles */ - sideConditions: {[id: string]: EffectState}; - slotConditions: {[id: string]: EffectState}[]; + sideConditions: { [id: string]: EffectState }; + slotConditions: { [id: string]: EffectState }[]; activeRequest: AnyObject | null; choice: Choice; @@ -285,7 +285,7 @@ export class Side { addSideCondition( status: string | Condition, source: Pokemon | 'debug' | null = null, sourceEffect: Effect | null = null ): boolean { - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + if (!source && this.battle.event?.target) source = this.battle.event.target; if (source === 'debug') source = this.active[0]; if (!source) throw new Error(`setting sidecond without a source`); if (!source.getSlot) source = (source as any as Side).active[0]; @@ -337,7 +337,7 @@ export class Side { target: Pokemon | number, status: string | Condition, source: Pokemon | 'debug' | null = null, sourceEffect: Effect | null = null ) { - if (!source && this.battle.event && this.battle.event.target) source = this.battle.event.target; + source ??= this.battle.event?.target || null; if (source === 'debug') source = this.active[0]; if (target instanceof Pokemon) target = target.position; if (!source) throw new Error(`setting sidecond without a source`); @@ -382,7 +382,6 @@ export class Side { return true; } - // eslint-disable-next-line @typescript-eslint/ban-types send(...parts: (string | number | Function | AnyObject)[]) { const sideUpdate = '|' + parts.map(part => { if (typeof part !== 'function') return part; @@ -540,7 +539,7 @@ export class Side { if (lockedMove) { let lockedMoveTargetLoc = pokemon.lastMoveTargetLoc || 0; const lockedMoveID = toID(lockedMove); - if (pokemon.volatiles[lockedMoveID] && pokemon.volatiles[lockedMoveID].targetLoc) { + if (pokemon.volatiles[lockedMoveID]?.targetLoc) { lockedMoveTargetLoc = pokemon.volatiles[lockedMoveID].targetLoc; } this.choice.actions.push({ @@ -660,8 +659,8 @@ export class Side { targetLoc, moveid, mega: mega || ultra, - megax: megax, - megay: megay, + megax, + megay, zmove: zMove, maxMove: maxMove ? maxMove.id : undefined, terastallize: terastallize ? pokemon.teraType : undefined, diff --git a/sim/state.ts b/sim/state.ts index 7a96d60243..3f5bacf320 100644 --- a/sim/state.ts +++ b/sim/state.ts @@ -9,12 +9,12 @@ * @license MIT */ -import {Battle} from './battle'; -import {Dex} from './dex'; -import {Field} from './field'; -import {Pokemon} from './pokemon'; -import {PRNG} from './prng'; -import {Choice, Side} from './side'; +import { Battle } from './battle'; +import { Dex } from './dex'; +import { Field } from './field'; +import { Pokemon } from './pokemon'; +import { PRNG } from './prng'; +import { type Choice, Side } from './side'; // The simulator supports up to 24 different Pokemon on a team. Serialization // uses letters instead of numbers to indicate indices/positions, but where @@ -56,7 +56,6 @@ export const State = new class { // due to circular module dependencies on Battle and Field instead // of simply initializing it as a const. See isReferable for where this // gets lazily created on demand. - // eslint-disable-next-line @typescript-eslint/ban-types REFERABLE?: Set; serializeBattle(battle: Battle): /* Battle */ AnyObject { @@ -103,7 +102,7 @@ export const State = new class { // encoding format used deserializeSide for where we reorder the Side's // pokemon to match their ordering at the point of serialization. const team = side.team.split(side.team.length > 9 ? ',' : ''); - // @ts-ignore - index signature + // @ts-expect-error index signature options[side.id] = { name: side.name, avatar: side.avatar, @@ -278,7 +277,7 @@ export const State = new class { // This should really be a deepEquals check to see if anything on ActiveMove was // modified from the base Move, but that ends up being expensive and mostly unnecessary // as ActiveMove currently only mutates its simple fields (eg. `type`, `target`) anyway. - // @ts-ignore - index signature + // @ts-expect-error index signature if (typeof value === 'object' || move[key] === value) skip.add(key); } const state: /* ActiveMove */ AnyObject = this.serialize(move, skip, battle); @@ -320,7 +319,7 @@ export const State = new class { // needs to be serialized as an Array/Object respectively - see how // Battle 'hints' or Choice 'switchIns' are handled (and you will likely // need to add the new field to the respective skip constant). - throw new TypeError(`Unsupported type ${obj.constructor.name}: ${obj}`); + throw new TypeError(`Unsupported type ${obj.constructor.name}: ${obj as any}`); } const o: any = {}; @@ -424,7 +423,7 @@ export const State = new class { deserialize(state: AnyObject, obj: object, skip: Set, battle: Battle) { for (const [key, value] of Object.entries(state)) { if (skip.has(key)) continue; - // @ts-ignore - index signature + // @ts-expect-error index signature obj[key] = this.deserializeWithRefs(value, battle); } } diff --git a/sim/team-validator.ts b/sim/team-validator.ts index b3f35bb863..5508ae88c6 100644 --- a/sim/team-validator.ts +++ b/sim/team-validator.ts @@ -7,12 +7,13 @@ * @license MIT */ -import {Dex, toID} from './dex'; -import type {MoveSource} from './dex-species'; -import {Utils} from '../lib/utils'; -import {Tags} from '../data/tags'; -import {Teams} from './teams'; -import {PRNG} from './prng'; +import { Dex, toID } from './dex'; +import type { MoveSource } from './dex-species'; +import { Utils } from '../lib/utils'; +import { Tags } from '../data/tags'; +import { Teams } from './teams'; +import { PRNG } from './prng'; +import { type RuleTable } from './dex-formats'; /** * Describes a possible way to get a pokemon. Is not exhaustive! @@ -317,7 +318,7 @@ export class TeamValidator { readonly format: Format; readonly dex: ModdedDex; readonly gen: number; - readonly ruleTable: import('./dex-formats').RuleTable; + readonly ruleTable: RuleTable; readonly minSourceGen: number; readonly toID: (str: any) => ID; @@ -339,7 +340,7 @@ export class TeamValidator { team: PokemonSet[] | null, options: { removeNicknames?: boolean, - skipSets?: {[name: string]: {[key: string]: boolean}}, + skipSets?: { [name: string]: { [key: string]: boolean } }, } = {} ): string[] | null { if (team && this.format.validateTeam) { @@ -352,7 +353,7 @@ export class TeamValidator { team: PokemonSet[] | null, options: { removeNicknames?: boolean, - skipSets?: {[name: string]: {[key: string]: boolean}}, + skipSets?: { [name: string]: { [key: string]: boolean } }, } = {} ): string[] | null { const format = this.format; @@ -404,14 +405,14 @@ export class TeamValidator { return problems; } - const teamHas: {[k: string]: number} = {}; + const teamHas: { [k: string]: number } = {}; let lgpeStarterCount = 0; let deoxysType; for (const set of team) { if (!set) return [`You sent invalid team data. If you're not using a custom client, please report this as a bug.`]; let setProblems: string[] | null = null; - if (options.skipSets && options.skipSets[set.name]) { + if (options.skipSets?.[set.name]) { for (const i in options.skipSets[set.name]) { teamHas[i] = (teamHas[i] || 0) + 1; } @@ -482,7 +483,7 @@ export class TeamValidator { return problems; } - getEventOnlyData(species: Species, noRecurse?: boolean): {species: Species, eventData: EventInfo[]} | null { + getEventOnlyData(species: Species, noRecurse?: boolean): { species: Species, eventData: EventInfo[] } | null { const dex = this.dex; const learnset = dex.species.getLearnsetData(species.id); if (!learnset?.eventOnly) { @@ -497,10 +498,10 @@ export class TeamValidator { throw new Error(`Event-only species ${species.name} has no eventData table`); } - return {species, eventData: learnset.eventData}; + return { species, eventData: learnset.eventData }; } - getValidationSpecies(set: PokemonSet): {outOfBattleSpecies: Species, tierSpecies: Species} { + getValidationSpecies(set: PokemonSet): { outOfBattleSpecies: Species, tierSpecies: Species } { const dex = this.dex; const ruleTable = this.ruleTable; const species = dex.species.get(set.species); @@ -531,8 +532,10 @@ export class TeamValidator { tierSpecies = dex.species.get('Groudon-Primal'); } else if (item.id === 'blueorb' && species.id === 'kyogre') { tierSpecies = dex.species.get('Kyogre-Primal'); - } else if (canMegaEvo && species.id === 'rayquaza' && set.moves.map(toID).includes('dragonascent' as ID) && - !ruleTable.has('megarayquazaclause')) { + } else if ( + canMegaEvo && species.id === 'rayquaza' && set.moves.map(toID).includes('dragonascent' as ID) && + !ruleTable.has('megarayquazaclause') + ) { tierSpecies = dex.species.get('Rayquaza-Mega'); } else if (item.id === 'rustedsword' && species.id === 'zacian') { tierSpecies = dex.species.get('Zacian-Crowned'); @@ -541,7 +544,7 @@ export class TeamValidator { } } - return {outOfBattleSpecies, tierSpecies}; + return { outOfBattleSpecies, tierSpecies }; } validateSet(set: PokemonSet, teamHas: AnyObject): string[] | null { @@ -560,7 +563,7 @@ export class TeamValidator { if (set.species.toLowerCase().endsWith('-gmax') && this.format.id !== 'gen8megamax') { set.species = set.species.slice(0, -5); species = dex.species.get(set.species); - if (set.name && set.name.endsWith('-Gmax')) set.name = species.baseSpecies; + if (set.name?.endsWith('-Gmax')) set.name = species.baseSpecies; set.gigantamax = true; } if (set.name && set.name.length > 18) { @@ -609,7 +612,7 @@ export class TeamValidator { problems.push(`${name} (level ${set.level}) is above the maximum level of ${ruleTable.maxLevel}${ruleTable.blame('maxlevel')}`); } - const setHas: {[k: string]: true} = {}; + const setHas: { [k: string]: true } = {}; if (!set.evs) set.evs = TeamValidator.fillStats(null, ruleTable.evLimit === null ? 252 : 0); if (!set.ivs) set.ivs = TeamValidator.fillStats(null, 31); @@ -636,7 +639,7 @@ export class TeamValidator { item = dex.items.get(set.item); ability = dex.abilities.get(set.ability); - const {outOfBattleSpecies, tierSpecies} = this.getValidationSpecies(set); + const { outOfBattleSpecies, tierSpecies } = this.getValidationSpecies(set); if (ability.id === 'battlebond' && toID(species.baseSpecies) === 'greninja') { if (ruleTable.has('obtainablemisc')) { if (set.gender && set.gender !== 'M') { @@ -792,7 +795,7 @@ export class TeamValidator { problems.push(...this.validateStats(set, species, setSources, pokemonGoProblems)); } - const moveLegalityWhitelist: {[k: string]: true | undefined} = {}; + const moveLegalityWhitelist: { [k: string]: true | undefined } = {}; for (const moveName of set.moves) { if (!moveName) continue; const move = dex.moves.get(Utils.getString(moveName)); @@ -868,7 +871,7 @@ export class TeamValidator { for (let eventIndex = 0; eventIndex < eventData.length; eventIndex++) { const eventLevel = eventData[eventIndex].level; if (eventLevel && set.level >= eventLevel) { - setSources.sources.push(eventData[eventIndex].generation + 'S' + eventIndex + ' ' + evoSpecies.id); + setSources.sources.push(`${eventData[eventIndex].generation}S${eventIndex} ${evoSpecies.id}`); } } } @@ -894,14 +897,14 @@ export class TeamValidator { setSources.sources = legalSources; } else if (isUnderleveled) { problems.push(`${name} must be at least level ${requiredLevel} to be evolved.`); - const firstEventSource = setSources.sources.filter(source => source.charAt(1) === 'S')[0]; + const firstEventSource = setSources.sources.find(source => source.charAt(1) === 'S'); if (firstEventSource) { const eventProblems = this.validateSource( set, firstEventSource, setSources, outOfBattleSpecies, ` to be underleveled` ); if (eventProblems) problems.push(...eventProblems); } - if (pokemonGoProblems && pokemonGoProblems.length) { + if (pokemonGoProblems?.length) { problems.push(`It failed to validate as a Pokemon from Pokemon GO because:`); for (const pokemonGoProblem of pokemonGoProblems) { problems.push(pokemonGoProblem); @@ -935,7 +938,7 @@ export class TeamValidator { set, nonEggSource, setSources, outOfBattleSpecies, ` because it has a move only available` ); if (eventProblems) problems.push(...eventProblems); - if (species.id === 'mew' && pokemonGoProblems && pokemonGoProblems.length) { + if (species.id === 'mew' && pokemonGoProblems?.length) { problems.push(`Additionally, it failed to validate as a Pokemon from Pokemon GO because:`); for (const pokemonGoProblem of pokemonGoProblems) { problems.push(pokemonGoProblem); @@ -945,7 +948,7 @@ export class TeamValidator { } } } else if (ruleTable.has('obtainablemisc') && (eventOnlyData = this.getEventOnlyData(outOfBattleSpecies))) { - const {species: eventSpecies, eventData} = eventOnlyData; + const { species: eventSpecies, eventData } = eventOnlyData; let legal = false; for (const event of eventData) { if (this.validateEvent(set, setSources, event, eventSpecies)) continue; @@ -957,7 +960,7 @@ export class TeamValidator { legal = true; } if (!legal) { - if (!pokemonGoProblems || (pokemonGoProblems && pokemonGoProblems.length)) { + if (!pokemonGoProblems || (pokemonGoProblems?.length)) { if (eventData.length === 1) { problems.push(`${species.name} is only obtainable from an event - it needs to match its event:`); } else { @@ -974,7 +977,7 @@ export class TeamValidator { if (eventProblems) problems.push(...eventProblems); } } - if (pokemonGoProblems && pokemonGoProblems.length) { + if (pokemonGoProblems?.length) { problems.push(`Additionally, it failed to validate as a Pokemon from Pokemon GO because:`); for (const pokemonGoProblem of pokemonGoProblems) { problems.push(pokemonGoProblem); @@ -990,7 +993,7 @@ export class TeamValidator { const pokemonGoOnlySpecies = ['meltan', 'melmetal', 'gimmighoulroaming']; if (ruleTable.has('obtainablemisc') && (pokemonGoOnlySpecies.includes(species.id))) { setSources.isFromPokemonGo = true; - if (pokemonGoProblems && pokemonGoProblems.length) { + if (pokemonGoProblems?.length) { problems.push(`${name} is only obtainable from Pokemon GO, and failed to validate because:`); for (const pokemonGoProblem of pokemonGoProblems) { problems.push(pokemonGoProblem); @@ -1120,7 +1123,7 @@ export class TeamValidator { if (set.hpType && maxedIVs && ruleTable.has('obtainablemisc')) { if (dex.gen <= 2) { const HPdvs = dex.types.get(set.hpType).HPdvs; - set.ivs = {hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30}; + set.ivs = { hp: 30, atk: 30, def: 30, spa: 30, spd: 30, spe: 30 }; let statName: StatID; for (statName in HPdvs) { set.ivs[statName] = HPdvs[statName]! * 2; @@ -1156,10 +1159,10 @@ export class TeamValidator { if (set.ivs[stat as 'hp'] >= 31) perfectIVs++; } if (perfectIVs < 3) { - if (!pokemonGoProblems || (pokemonGoProblems && pokemonGoProblems.length)) { + if (!pokemonGoProblems || pokemonGoProblems?.length) { const reason = (this.minSourceGen === 6 ? ` and this format requires Gen ${dex.gen} Pokémon` : ` in Gen 6 or later`); problems.push(`${name} must have at least three perfect IVs because it's a legendary${reason}.`); - if (pokemonGoProblems && pokemonGoProblems.length) { + if (pokemonGoProblems?.length) { problems.push(`Additionally, it failed to validate as a Pokemon from Pokemon GO because:`); for (const pokemonGoProblem of pokemonGoProblems) { problems.push(pokemonGoProblem); @@ -1487,7 +1490,7 @@ export class TeamValidator { allEggSources.sourcesBefore = eggGen; for (const move of moves) { const eggSources = new PokemonSources(); - for (const {learnset, species: curSpecies} of this.dex.species.getFullLearnset(species.id)) { + for (const { learnset, species: curSpecies } of this.dex.species.getFullLearnset(species.id)) { const eggPokemon = curSpecies.prevo ? curSpecies.id : ''; if (learnset[move]) { for (const moveSource of learnset[move]) { @@ -1514,7 +1517,7 @@ export class TeamValidator { if (!eggSources.sourcesBefore && !eggSources.sources.length) return false; const onlyEggSources = eggSources.sources.filter(source => source.charAt(1) === 'E'); if (eggGen >= 3 && onlyEggSources.length && eggSources.limitedEggMoves === null && eggSources.sourcesBefore) { - eggSources.possiblyLimitedEggMoves = [toID(eggSources.sourcesBefore + move)]; + eggSources.possiblyLimitedEggMoves = [toID(`${eggSources.sourcesBefore}${move}`)]; } allEggSources.intersectWith(eggSources); if (!allEggSources.size()) return false; @@ -1540,7 +1543,7 @@ export class TeamValidator { motherCanLearn(species: ID, move: ID) { if (!species) return false; const fullLearnset = this.dex.species.getFullLearnset(species); - for (const {learnset} of fullLearnset) { + for (const { learnset } of fullLearnset) { if (learnset[move]) return true; } return false; @@ -1634,7 +1637,7 @@ export class TeamValidator { } if (species.name === 'Pikachu-Cosplay') { - const cosplay: {[k: string]: string} = { + const cosplay: { [k: string]: string } = { meteormash: 'Pikachu-Rock-Star', iciclecrash: 'Pikachu-Belle', drainingkiss: 'Pikachu-Pop-Star', electricterrain: 'Pikachu-PhD', flyingpress: 'Pikachu-Libre', }; @@ -1650,7 +1653,7 @@ export class TeamValidator { set.species = 'Keldeo-Resolute'; } - const crowned: {[k: string]: string} = { + const crowned: { [k: string]: string } = { 'Zacian-Crowned': 'behemothblade', 'Zamazenta-Crowned': 'behemothbash', }; if (species.name in crowned) { @@ -1692,7 +1695,7 @@ export class TeamValidator { return problems; } - checkSpecies(set: PokemonSet, species: Species, tierSpecies: Species, setHas: {[k: string]: true}) { + checkSpecies(set: PokemonSet, species: Species, tierSpecies: Species, setHas: { [k: string]: true }) { const dex = this.dex; const ruleTable = this.ruleTable; @@ -1851,7 +1854,7 @@ export class TeamValidator { return null; } - checkItem(set: PokemonSet, item: Item, setHas: {[k: string]: true}) { + checkItem(set: PokemonSet, item: Item, setHas: { [k: string]: true }) { const dex = this.dex; const ruleTable = this.ruleTable; @@ -1899,7 +1902,7 @@ export class TeamValidator { return null; } - checkMove(set: PokemonSet, move: Move, setHas: {[k: string]: true}) { + checkMove(set: PokemonSet, move: Move, setHas: { [k: string]: true }) { const dex = this.dex; const ruleTable = this.ruleTable; @@ -1945,7 +1948,7 @@ export class TeamValidator { return null; } - checkAbility(set: PokemonSet, ability: Ability, setHas: {[k: string]: true}) { + checkAbility(set: PokemonSet, ability: Ability, setHas: { [k: string]: true }) { const dex = this.dex; const ruleTable = this.ruleTable; @@ -1996,7 +1999,7 @@ export class TeamValidator { return null; } - checkNature(set: PokemonSet, nature: Nature, setHas: {[k: string]: true}) { + checkNature(set: PokemonSet, nature: Nature, setHas: { [k: string]: true }) { const dex = this.dex; const ruleTable = this.ruleTable; @@ -2101,7 +2104,7 @@ export class TeamValidator { /** In Gen 7+, IVs can be changed to 31 */ const canBottleCap = dex.gen >= 7 && set.level >= (dex.gen < 9 ? 100 : 50); - if (!set.ivs) set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + if (!set.ivs) set.ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; let statName: StatID; for (statName in eventData.ivs) { if (canBottleCap && set.ivs[statName] === 31) continue; @@ -2143,8 +2146,10 @@ export class TeamValidator { if (dex.gen >= 3 && requiredIVs >= 3 && set.hpType === 'Fighting') { if (fastReturn) return true; problems.push(`${name} can't use Hidden Power Fighting because it must have at least three perfect IVs${etc}.`); - } else if (dex.gen >= 3 && requiredIVs >= 5 && set.hpType && - !['Dark', 'Dragon', 'Electric', 'Steel', 'Ice'].includes(set.hpType)) { + } else if ( + dex.gen >= 3 && requiredIVs >= 5 && set.hpType && + !['Dark', 'Dragon', 'Electric', 'Steel', 'Ice'].includes(set.hpType) + ) { if (fastReturn) return true; problems.push(`${name} can only use Hidden Power Dark/Dragon/Electric/Steel/Ice because it must have at least 5 perfect IVs${etc}.`); } @@ -2215,7 +2220,7 @@ export class TeamValidator { validateMoves( species: Species, moves: string[], setSources: PokemonSources, set?: Partial, - name: string = species.name, moveLegalityWhitelist: {[k: string]: true | undefined} = {} + name: string = species.name, moveLegalityWhitelist: { [k: string]: true | undefined } = {} ) { const dex = this.dex; const ruleTable = this.ruleTable; @@ -2493,7 +2498,7 @@ export class TeamValidator { return ` can't learn any moves at all.`; } - for (const {species, learnset} of fullLearnset) { + for (const { species, learnset } of fullLearnset) { if (dex.gen <= 2 && species.gen === 1) tradebackEligible = true; const checkingPrevo = species.baseSpecies !== originalSpecies.baseSpecies; if (checkingPrevo && !moveSources.size()) { @@ -2540,7 +2545,7 @@ export class TeamValidator { const learnedGen = parseInt(learned.charAt(0)); if (formeCantInherit && (learned.charAt(1) !== 'E' || learnedGen < 9)) continue; - if (setSources.learnsetDomain && !setSources.learnsetDomain.includes(learnedGen + toID(species.baseSpecies)) && + if (setSources.learnsetDomain && !setSources.learnsetDomain.includes(`${learnedGen}${toID(species.baseSpecies)}`) && (learned.charAt(1) !== 'E' || learnedGen < 8) ) { if (!cantLearnReason) { @@ -2572,7 +2577,7 @@ export class TeamValidator { const canUseAbilityPatch = dex.gen >= 8 && format.mod !== 'gen8dlc1'; if ( learnedGen < 7 && setSources.isHidden && !canUseAbilityPatch && - !dex.mod('gen' + learnedGen).species.get(baseSpecies.name).abilities['H'] + !dex.mod(`gen${learnedGen}`).species.get(baseSpecies.name).abilities['H'] ) { cantLearnReason = `can only be learned in gens without Hidden Abilities.`; continue; @@ -2611,7 +2616,7 @@ export class TeamValidator { // falls through to LMT check below } else if (level >= 5 && learnedGen === 3 && species.canHatch) { // Pomeg Glitch - learned = learnedGen + 'Epomeg' as MoveSource; + learned = `${learnedGen}Epomeg` as MoveSource; } else if (species.gender !== 'N' && learnedGen >= 2 && species.canHatch && !setSources.isFromPokemonGo) { // available as egg move @@ -2620,7 +2625,7 @@ export class TeamValidator { cantLearnReason = `is learned at level ${parseInt(learned.substr(2))}.`; continue; } - learned = learnedGen + 'Eany' as MoveSource; + learned = `${learnedGen}Eany` as MoveSource; // falls through to E check below } else { // this move is unavailable, skip it @@ -2667,10 +2672,10 @@ export class TeamValidator { } else if (learnedGen < 6 || (species.mother && !this.motherCanLearn(toID(species.mother), moveid))) { limitedEggMove = move.id; } - learned = learnedGen + 'E' + (species.prevo ? species.id : '') as MoveSource; + learned = `${learnedGen}E${species.prevo ? species.id : ''}` as MoveSource; if (tradebackEligible && learnedGen === 2 && move.gen <= 1) { // can tradeback - moveSources.add('1ET' + learned.slice(2), limitedEggMove); + moveSources.add(`1ET${learned.slice(2)}`, limitedEggMove); } moveSources.add(learned, limitedEggMove); } else if (learned.charAt(1) === 'S') { @@ -2680,17 +2685,17 @@ export class TeamValidator { // Available as long as the past gen can get the Pokémon and then trade it back. if (tradebackEligible && learnedGen === 2 && move.gen <= 1) { // can tradeback - moveSources.add('1ST' + learned.slice(2) + ' ' + species.id); + moveSources.add(`1ST${learned.slice(2)} ${species.id}`); } - moveSources.add(learned + ' ' + species.id); + moveSources.add(`${learned} ${species.id}`); const eventLearnset = dex.species.getLearnsetData(species.id); if (eventLearnset.eventData?.[parseInt(learned.charAt(2))].emeraldEventEgg && learnedGen === 3) { - moveSources.pomegEventEgg = learned + ' ' + species.id; + moveSources.pomegEventEgg = `${learned} ${species.id}`; } } else if (learned.charAt(1) === 'D') { // DW moves: // only if that was the source - moveSources.add(learned + species.id); + moveSources.add(`${learned}${species.id}`); // If a DW move can be learned through some means other than DW, // it should not be treated as a DW move if (!moveSources.sourcesBefore) moveSources.dreamWorldMoveCount++; @@ -2815,7 +2820,7 @@ export class TeamValidator { (speciesCount === canLearnSpecies.length && gen <= moveSources.sourcesBefore) ) { if (!moveSources.learnsetDomain) moveSources.learnsetDomain = []; - moveSources.learnsetDomain.push(gen + baseSpeciesID); + moveSources.learnsetDomain.push(`${gen}${baseSpeciesID}`); } } if (canLearnSpecies.includes(nextSpecies.id)) speciesCount++; @@ -2830,7 +2835,7 @@ export class TeamValidator { } const eggSources = moveSources.sources.filter(source => source.charAt(1) === 'E'); if (dex.gen >= 3 && eggSources.length && moveSources.limitedEggMoves === null && moveSources.sourcesBefore) { - moveSources.possiblyLimitedEggMoves = [toID(moveSources.sourcesBefore + move.id)]; + moveSources.possiblyLimitedEggMoves = [toID(`${moveSources.sourcesBefore}${move.id}`)]; } const backupSources = setSources.sources; const backupSourcesBefore = setSources.sourcesBefore; @@ -2849,7 +2854,7 @@ export class TeamValidator { } static fillStats(stats: SparseStatsTable | null, fillNum = 0): StatsTable { - const filledStats: StatsTable = {hp: fillNum, atk: fillNum, def: fillNum, spa: fillNum, spd: fillNum, spe: fillNum}; + const filledStats: StatsTable = { hp: fillNum, atk: fillNum, def: fillNum, spa: fillNum, spd: fillNum, spe: fillNum }; if (stats) { let statName: StatID; for (statName in filledStats) { diff --git a/sim/teams.ts b/sim/teams.ts index 67536e1ade..6cdc7b3c1e 100644 --- a/sim/teams.ts +++ b/sim/teams.ts @@ -7,8 +7,8 @@ * @license MIT */ -import {Dex, toID} from './dex'; -import type {PRNG, PRNGSeed} from './prng'; +import { Dex, toID } from './dex'; +import type { PRNG, PRNGSeed } from './prng'; export interface PokemonSet { /** @@ -127,24 +127,25 @@ export const Teams = new class Teams { // species const id = this.packName(set.species || set.name); - buf += '|' + (this.packName(set.name || set.species) === id ? '' : id); + buf += `|${this.packName(set.name || set.species) === id ? '' : id}`; // item - buf += '|' + this.packName(set.item); + buf += `|${this.packName(set.item)}`; // ability - buf += '|' + this.packName(set.ability); + buf += `|${this.packName(set.ability)}`; // moves buf += '|' + set.moves.map(this.packName).join(','); // nature - buf += '|' + (set.nature || ''); + buf += `|${set.nature || ''}`; // evs let evs = '|'; if (set.evs) { - evs = '|' + (set.evs['hp'] || '') + ',' + (set.evs['atk'] || '') + ',' + (set.evs['def'] || '') + ',' + (set.evs['spa'] || '') + ',' + (set.evs['spd'] || '') + ',' + (set.evs['spe'] || ''); + evs = `|${set.evs['hp'] || ''},${set.evs['atk'] || ''},${set.evs['def'] || ''},` + + `${set.evs['spa'] || ''},${set.evs['spd'] || ''},${set.evs['spe'] || ''}`; } if (evs === '|,,,,,') { buf += '|'; @@ -154,7 +155,7 @@ export const Teams = new class Teams { // gender if (set.gender) { - buf += '|' + set.gender; + buf += `|${set.gender}`; } else { buf += '|'; } @@ -162,8 +163,8 @@ export const Teams = new class Teams { // ivs let ivs = '|'; if (set.ivs) { - ivs = '|' + getIv(set.ivs, 'hp') + ',' + getIv(set.ivs, 'atk') + ',' + getIv(set.ivs, 'def') + - ',' + getIv(set.ivs, 'spa') + ',' + getIv(set.ivs, 'spd') + ',' + getIv(set.ivs, 'spe'); + ivs = `|${getIv(set.ivs, 'hp')},${getIv(set.ivs, 'atk')},${getIv(set.ivs, 'def')},` + + `${getIv(set.ivs, 'spa')},${getIv(set.ivs, 'spd')},${getIv(set.ivs, 'spe')}`; } if (ivs === '|,,,,,') { buf += '|'; @@ -180,25 +181,25 @@ export const Teams = new class Teams { // level if (set.level && set.level !== 100) { - buf += '|' + set.level; + buf += `|${set.level}`; } else { buf += '|'; } // happiness if (set.happiness !== undefined && set.happiness !== 255) { - buf += '|' + set.happiness; + buf += `|${set.happiness}`; } else { buf += '|'; } if (set.pokeball || set.hpType || set.gigantamax || (set.dynamaxLevel !== undefined && set.dynamaxLevel !== 10) || set.teraType) { - buf += ',' + (set.hpType || ''); - buf += ',' + this.packName(set.pokeball || ''); - buf += ',' + (set.gigantamax ? 'G' : ''); - buf += ',' + (set.dynamaxLevel !== undefined && set.dynamaxLevel !== 10 ? set.dynamaxLevel : ''); - buf += ',' + (set.teraType || ''); + buf += `,${set.hpType || ''}`; + buf += `,${this.packName(set.pokeball || '')}`; + buf += `,${set.gigantamax ? 'G' : ''}`; + buf += `,${set.dynamaxLevel !== undefined && set.dynamaxLevel !== 10 ? set.dynamaxLevel : ''}`; + buf += `,${set.teraType || ''}`; } } @@ -339,13 +340,13 @@ export const Teams = new class Teams { } /** Very similar to toID but without the lowercase conversion */ - packName(name: string | undefined | null) { + packName(this: void, name: string | undefined | null) { if (!name) return ''; return name.replace(/[^A-Za-z0-9]+/g, ''); } /** Will not entirely recover a packed name, but will be a pretty readable guess */ - unpackName(name: string, dexTable?: {get: (name: string) => AnyObject}) { + unpackName(name: string, dexTable?: { get: (name: string) => AnyObject }) { if (!name) return ''; if (dexTable) { const obj = dexTable.get(name); @@ -357,7 +358,7 @@ export const Teams = new class Teams { /** * Exports a team in human-readable PS export format */ - export(team: PokemonSet[], options?: {hideStats?: boolean}) { + export(team: PokemonSet[], options?: { hideStats?: boolean }) { let output = ''; for (const set of team) { output += this.exportSet(set, options) + `\n`; @@ -365,7 +366,7 @@ export const Teams = new class Teams { return output; } - exportSet(set: PokemonSet, {hideStats}: {hideStats?: boolean} = {}) { + exportSet(set: PokemonSet, { hideStats }: { hideStats?: boolean } = {}) { let out = ``; // core @@ -497,7 +498,7 @@ export const Teams = new class Teams { } else if (line.startsWith('EVs: ')) { line = line.slice(5); const evLines = line.split('/'); - set.evs = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + set.evs = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; for (const evLine of evLines) { const [statValue, statName] = evLine.trim().split(' '); const statid = Dex.stats.getID(statName); @@ -508,7 +509,7 @@ export const Teams = new class Teams { } else if (line.startsWith('IVs: ')) { line = line.slice(5); const ivLines = line.split('/'); - set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + set.ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; for (const ivLine of ivLines) { const [statValue, statName] = ivLine.trim().split(' '); const statid = Dex.stats.getID(statName); @@ -529,7 +530,7 @@ export const Teams = new class Teams { const hpType = line.slice(14, -1); line = 'Hidden Power ' + hpType; if (!set.ivs && Dex.types.isName(hpType)) { - set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + set.ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; const hpIVs = Dex.types.get(hpType).HPivs || {}; for (const statid in hpIVs) { set.ivs[statid as StatID] = hpIVs[statid as StatID]!; @@ -556,14 +557,14 @@ export const Teams = new class Teams { set.ability = sanitize(set.ability); set.gender = sanitize(set.gender); set.nature = sanitize(set.nature); - const evs = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; + const evs = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; if (set.evs) { for (const statid in evs) { if (typeof set.evs[statid] === 'number') evs[statid as StatID] = set.evs[statid]; } } set.evs = evs; - const ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}; + const ivs = { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }; if (set.ivs) { for (const statid in ivs) { if (typeof set.ivs[statid] === 'number') ivs[statid as StatID] = set.ivs[statid]; @@ -601,8 +602,8 @@ export const Teams = new class Teams { curSet = { name: '', species: '', item: '', ability: '', gender: '', nature: '', - evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}, - ivs: {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31}, + evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }, + ivs: { hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31 }, level: 100, moves: [], }; diff --git a/sim/tools/exhaustive-runner.ts b/sim/tools/exhaustive-runner.ts index a80e0ab45f..2e8c715dd6 100644 --- a/sim/tools/exhaustive-runner.ts +++ b/sim/tools/exhaustive-runner.ts @@ -5,11 +5,11 @@ * @license MIT */ -import {ObjectReadWriteStream} from '../../lib/streams'; -import {Dex, toID} from '../dex'; -import {PRNG, PRNGSeed} from '../prng'; -import {RandomPlayerAI} from './random-player-ai'; -import {AIOptions, Runner} from './runner'; +import type { ObjectReadWriteStream } from '../../lib/streams'; +import { Dex, toID } from '../dex'; +import { PRNG, type PRNGSeed } from '../prng'; +import { RandomPlayerAI } from './random-player-ai'; +import { type AIOptions, Runner } from './runner'; interface Pools { pokemon: Pool; @@ -85,10 +85,10 @@ export class ExhaustiveRunner { // and the AI can coordinate usage properly. await new Runner({ prng: this.prng, - p1options: {team: generator.generate(), createAI}, - p2options: {team: generator.generate(), createAI}, - p3options: is4P ? {team: generator.generate(), createAI} : undefined, - p4options: is4P ? {team: generator.generate(), createAI} : undefined, + p1options: { team: generator.generate(), createAI }, + p2options: { team: generator.generate(), createAI }, + p3options: is4P ? { team: generator.generate(), createAI } : undefined, + p4options: is4P ? { team: generator.generate(), createAI } : undefined, format: this.format, dual: this.dual, error: true, @@ -99,13 +99,13 @@ export class ExhaustiveRunner { this.failures++; console.error( `\n\nRun \`node tools/simulate exhaustive --cycles=${this.cycles} ` + - `--format=${this.format} --seed=${seed}\`:\n`, + `--format=${this.format} --seed=${seed}\`:\n`, err ); } } while ((!this.maxGames || this.games < this.maxGames) && - (!this.maxFailures || this.failures < this.maxFailures) && - generator.exhausted < this.cycles); + (!this.maxFailures || this.failures < this.maxFailures) && + generator.exhausted < this.cycles); return this.failures; } @@ -133,13 +133,13 @@ export class ExhaustiveRunner { ); } - private static getSignatures(dex: typeof Dex, pools: Pools): Map { + private static getSignatures(dex: typeof Dex, pools: Pools): Map { const signatures = new Map(); for (const id of pools.items.possible) { const item = dex.data.Items[id]; if (item.megaEvolves) { const pokemon = toID(item.megaEvolves); - const combo = {item: id}; + const combo = { item: id }; let combos = signatures.get(pokemon); if (!combos) { combos = []; @@ -149,7 +149,7 @@ export class ExhaustiveRunner { } else if (item.itemUser) { for (const user of item.itemUser) { const pokemon = toID(user); - const combo: {item: string, move?: string} = {item: id}; + const combo: { item: string, move?: string } = { item: id }; if (item.zMoveFrom) combo.move = toID(item.zMoveFrom); let combos = signatures.get(pokemon); if (!combos) { @@ -164,7 +164,7 @@ export class ExhaustiveRunner { } private static onlyValid( - gen: number, obj: {[key: string]: T}, getter: (k: string) => AnyObject, + gen: number, obj: { [key: string]: T }, getter: (k: string) => AnyObject, additional?: (k: string, v: AnyObject) => boolean, nonStandard?: boolean ) { return Object.keys(obj).filter(k => { @@ -190,12 +190,12 @@ class TeamGenerator { private readonly dex: typeof Dex; private readonly prng: PRNG; private readonly pools: Pools; - private readonly signatures: Map; + private readonly signatures: Map; private readonly natures: readonly string[]; constructor( dex: typeof Dex, prng: PRNG | PRNGSeed | null, pools: Pools, - signatures: Map + signatures: Map ) { this.dex = dex; this.prng = PRNG.get(prng); @@ -271,7 +271,7 @@ class Pool { private unused: Set; private filled: Set | undefined; private filler: string[] | undefined; - private iter: (Iterator & {done?: boolean}) | undefined; + private iter: (Iterator & { done?: boolean }) | undefined; exhausted: number; @@ -410,13 +410,13 @@ class CoordinatedPlayerAI extends RandomPlayerAI { } protected chooseTeamPreview(team: AnyObject[]): string { - return `team ${this.choosePokemon(team.map((p, i) => ({slot: i + 1, pokemon: p}))) || 1}`; + return `team ${this.choosePokemon(team.map((p, i) => ({ slot: i + 1, pokemon: p }))) || 1}`; } - protected chooseMove(active: AnyObject, moves: {choice: string, move: AnyObject}[]): string { + protected chooseMove(active: AnyObject, moves: { choice: string, move: AnyObject }[]): string { this.markUsedIfGmax(active); // Prefer to use a move which hasn't been used yet. - for (const {choice, move} of moves) { + for (const { choice, move } of moves) { const id = this.fixMove(move); if (!this.pools.moves.wasUsed(id)) { this.pools.moves.markUsed(id); @@ -426,19 +426,21 @@ class CoordinatedPlayerAI extends RandomPlayerAI { return super.chooseMove(active, moves); } - protected chooseSwitch(active: AnyObject | undefined, switches: {slot: number, pokemon: AnyObject}[]): number { + protected chooseSwitch(active: AnyObject | undefined, switches: { slot: number, pokemon: AnyObject }[]): number { this.markUsedIfGmax(active); return this.choosePokemon(switches) || super.chooseSwitch(active, switches); } - private choosePokemon(choices: {slot: number, pokemon: AnyObject}[]) { + private choosePokemon(choices: { slot: number, pokemon: AnyObject }[]) { // Prefer to choose a Pokemon that has a species/ability/item/move we haven't seen yet. - for (const {slot, pokemon} of choices) { + for (const { slot, pokemon } of choices) { const species = toID(pokemon.details.split(',')[0]); - if (!this.pools.pokemon.wasUsed(species) || - !this.pools.abilities.wasUsed(pokemon.baseAbility) || - !this.pools.items.wasUsed(pokemon.item) || - pokemon.moves.some((m: AnyObject) => !this.pools.moves.wasUsed(this.fixMove(m)))) { + if ( + !this.pools.pokemon.wasUsed(species) || + !this.pools.abilities.wasUsed(pokemon.baseAbility) || + !this.pools.items.wasUsed(pokemon.item) || + pokemon.moves.some((m: AnyObject) => !this.pools.moves.wasUsed(this.fixMove(m))) + ) { this.pools.pokemon.markUsed(species); this.pools.abilities.markUsed(pokemon.baseAbility); this.pools.items.markUsed(pokemon.item); @@ -460,7 +462,7 @@ class CoordinatedPlayerAI extends RandomPlayerAI { // Gigantamax Pokemon need to be special cased for tracking because the current // tracking only works if you can switch in a Pokemon. private markUsedIfGmax(active: AnyObject | undefined) { - if (active && !active.canDynamax && active.maxMoves && active.maxMoves.gigantamax) { + if (active && !active.canDynamax && active.maxMoves?.gigantamax) { this.pools.pokemon.markUsed(toID(active.maxMoves.gigantamax)); } } diff --git a/sim/tools/multi-random-runner.ts b/sim/tools/multi-random-runner.ts index c9eff1c87e..af943a1b32 100644 --- a/sim/tools/multi-random-runner.ts +++ b/sim/tools/multi-random-runner.ts @@ -5,11 +5,10 @@ * @license MIT */ -import {PRNG, PRNGSeed} from '../prng'; -import {Runner, RunnerOptions} from './runner'; +import { PRNG, type PRNGSeed } from '../prng'; +import { Runner, type RunnerOptions } from './runner'; -// @ts-ignore -export interface MultiRandomRunnerOptions extends RunnerOptions { +export interface MultiRandomRunnerOptions extends Partial { totalGames: number; prng?: PRNG | PRNGSeed | null; format?: string; @@ -42,7 +41,7 @@ export class MultiRandomRunner { private numGames: number; constructor(options: MultiRandomRunnerOptions) { - this.options = {...options}; + this.options = { ...options }; this.totalGames = options.totalGames; @@ -71,7 +70,7 @@ export class MultiRandomRunner { } const seed = this.prng.getSeed(); - const game = new Runner({format, ...this.options}).run().catch(err => { + const game = new Runner({ format, ...this.options }).run().catch(err => { failures++; console.error( `Run \`node tools/simulate multi 1 --format=${format} --seed=${seed}\` ` + diff --git a/sim/tools/random-player-ai.ts b/sim/tools/random-player-ai.ts index b138b30dad..9ce2bef807 100644 --- a/sim/tools/random-player-ai.ts +++ b/sim/tools/random-player-ai.ts @@ -6,9 +6,9 @@ * @license MIT */ -import {ObjectReadWriteStream} from '../../lib/streams'; -import {BattlePlayer} from '../battle-stream'; -import {PRNG, PRNGSeed} from '../prng'; +import type { ObjectReadWriteStream } from '../../lib/streams'; +import { BattlePlayer } from '../battle-stream'; +import { PRNG, type PRNGSeed } from '../prng'; export class RandomPlayerAI extends BattlePlayer { protected readonly move: number; @@ -17,7 +17,7 @@ export class RandomPlayerAI extends BattlePlayer { constructor( playerStream: ObjectReadWriteStream, - options: {move?: number, mega?: number, seed?: PRNG | PRNGSeed | null } = {}, + options: { move?: number, mega?: number, seed?: PRNG | PRNGSeed | null } = {}, debug = false ) { super(playerStream, debug); @@ -57,7 +57,7 @@ export class RandomPlayerAI extends BattlePlayer { if (!canSwitch.length) return `pass`; const target = this.chooseSwitch( request.active, - canSwitch.map(slot => ({slot, pokemon: pokemon[slot - 1]})) + canSwitch.map(slot => ({ slot, pokemon: pokemon[slot - 1] })) ); chosen.push(target); return `switch ${target}`; @@ -134,7 +134,7 @@ export class RandomPlayerAI extends BattlePlayer { } } if (m.zMove) move += ` zmove`; - return {choice: move, move: m}; + return { choice: move, move: m }; }); const canSwitch = range(1, 6).filter(j => ( @@ -151,7 +151,7 @@ export class RandomPlayerAI extends BattlePlayer { if (switches.length && (!moves.length || this.prng.random() > this.move)) { const target = this.chooseSwitch( active, - canSwitch.map(slot => ({slot, pokemon: pokemon[slot - 1]})) + canSwitch.map(slot => ({ slot, pokemon: pokemon[slot - 1] })) ); chosen.push(target); return `switch ${target}`; @@ -178,7 +178,7 @@ export class RandomPlayerAI extends BattlePlayer { return move; } } else { - throw new Error(`${this.constructor.name} unable to make choice ${i}. request='${request}',` + + throw new Error(`${this.constructor.name} unable to make choice ${i}. request='${typeof request}',` + ` chosen='${chosen}', (mega=${canMegaEvo}, ultra=${canUltraBurst}, zmove=${canZMove},` + ` dynamax='${canDynamax}', terastallize=${canTerastallize})`); } @@ -194,11 +194,11 @@ export class RandomPlayerAI extends BattlePlayer { return `default`; } - protected chooseMove(active: AnyObject, moves: {choice: string, move: AnyObject}[]): string { + protected chooseMove(active: AnyObject, moves: { choice: string, move: AnyObject }[]): string { return this.prng.sample(moves).choice; } - protected chooseSwitch(active: AnyObject | undefined, switches: {slot: number, pokemon: AnyObject}[]): number { + protected chooseSwitch(active: AnyObject | undefined, switches: { slot: number, pokemon: AnyObject }[]): number { return this.prng.sample(switches).slot; } } diff --git a/sim/tools/runner.ts b/sim/tools/runner.ts index f0069c3332..4626b1257f 100644 --- a/sim/tools/runner.ts +++ b/sim/tools/runner.ts @@ -5,16 +5,16 @@ * @license MIT */ -import {strict as assert} from 'assert'; +import { strict as assert } from 'assert'; import * as fs from 'fs'; -import {Dex} from '..'; -import {ObjectReadWriteStream} from '../../lib/streams'; -import {Battle} from '../battle'; +import { Dex } from '..'; +import { type ObjectReadWriteStream } from '../../lib/streams'; +import { Battle } from '../battle'; import * as BattleStreams from '../battle-stream'; -import {State} from '../state'; -import {PRNG, PRNGSeed} from '../prng'; -import {RandomPlayerAI} from './random-player-ai'; +import { State } from '../state'; +import { PRNG, type PRNGSeed } from '../prng'; +import { RandomPlayerAI } from './random-player-ai'; export interface AIOptions { createAI: (stream: ObjectReadWriteStream, options: AIOptions) => RandomPlayerAI; @@ -59,10 +59,10 @@ export class Runner { this.format = options.format; this.prng = PRNG.get(options.prng); - this.p1options = {...Runner.AI_OPTIONS, ...options.p1options}; - this.p2options = {...Runner.AI_OPTIONS, ...options.p2options}; - this.p3options = {...Runner.AI_OPTIONS, ...options.p3options}; - this.p4options = {...Runner.AI_OPTIONS, ...options.p4options}; + this.p1options = { ...Runner.AI_OPTIONS, ...options.p1options }; + this.p2options = { ...Runner.AI_OPTIONS, ...options.p2options }; + this.p3options = { ...Runner.AI_OPTIONS, ...options.p3options }; + this.p4options = { ...Runner.AI_OPTIONS, ...options.p4options }; this.input = !!options.input; this.output = !!options.output; @@ -83,9 +83,9 @@ export class Runner { } private async runGame(format: string, battleStream: RawBattleStream | DualStream) { - // @ts-ignore - DualStream implements everything relevant from BattleStream. + // @ts-expect-error - DualStream implements everything relevant from BattleStream. const streams = BattleStreams.getPlayerStreams(battleStream); - const spec = {formatid: format, seed: this.prng.getSeed()}; + const spec = { formatid: format, seed: this.prng.getSeed() }; const is4P = Dex.formats.get(format).playerCount > 2; const p1spec = this.getPlayerSpec("Bot 1", this.p1options); const p2spec = this.getPlayerSpec("Bot 2", this.p2options); @@ -96,18 +96,18 @@ export class Runner { } const p1 = this.p1options.createAI( - streams.p1, {seed: this.newSeed(), ...this.p1options} + streams.p1, { seed: this.newSeed(), ...this.p1options } ); const p2 = this.p2options.createAI( - streams.p2, {seed: this.newSeed(), ...this.p2options} + streams.p2, { seed: this.newSeed(), ...this.p2options } ); let p3: RandomPlayerAI, p4: RandomPlayerAI; if (is4P) { p3 = this.p4options.createAI( - streams.p3, {seed: this.newSeed(), ...this.p3options} + streams.p3, { seed: this.newSeed(), ...this.p3options } ); p4 = this.p4options.createAI( - streams.p4, {seed: this.newSeed(), ...this.p4options} + streams.p4, { seed: this.newSeed(), ...this.p4options } ); } // TODO: Use `await Promise.race([streams.omniscient.read(), p1, p2])` to avoid @@ -120,12 +120,12 @@ export class Runner { } let initMessage = `>start ${JSON.stringify(spec)}\n` + - `>player p1 ${JSON.stringify(p1spec)}\n` + - `>player p2 ${JSON.stringify(p2spec)}`; + `>player p1 ${JSON.stringify(p1spec)}\n` + + `>player p2 ${JSON.stringify(p2spec)}`; if (is4P) { initMessage += `\n` + - `>player p3 ${JSON.stringify(p3spec!)}\n` + - `>player p4 ${JSON.stringify(p4spec!)}`; + `>player p3 ${JSON.stringify(p3spec!)}\n` + + `>player p4 ${JSON.stringify(p4spec!)}`; } void streams.omniscient.write(initMessage); @@ -147,8 +147,8 @@ export class Runner { } private getPlayerSpec(name: string, options: AIOptions) { - if (options.team) return {name, team: options.team}; - return {name, seed: this.newSeed()}; + if (options.team) return { name, team: options.team }; + return { name, seed: this.newSeed() }; } } diff --git a/test/assert.js b/test/assert.js index ec30d76757..1eadcf7fc6 100644 --- a/test/assert.js +++ b/test/assert.js @@ -20,7 +20,7 @@ assert.bounded = function (value, range, message) { actual: value, expected: `[${range[0]}, ${range[1]}]`, operator: '\u2208', - message: message, + message, stackStartFunction: assert.bounded, }); }; @@ -31,7 +31,7 @@ assert.atLeast = function (value, threshold, message) { actual: value, expected: `${threshold}`, operator: '>=', - message: message, + message, stackStartFunction: assert.atLeast, }); }; @@ -42,7 +42,7 @@ assert.atMost = function (value, threshold, message) { actual: value, expected: `${threshold}`, operator: '<=', - message: message, + message, stackStartFunction: assert.atMost, }); }; @@ -123,7 +123,7 @@ assert.cantMove = function (fn, pokemon, move, unavailable, message) { } else { try { fn(); - } catch (e) { + } catch { return; } } @@ -167,7 +167,7 @@ assert.hurtsBy = function (pokemon, damage, fn, message) { const actual = prevHP - pokemon.hp; if (actual === damage) return; throw new AssertionError({ - actual: actual, + actual, expected: damage, operator: '===', message: message || `Expected ${pokemon} to be hurt by ${damage}, not by ${actual}.`, @@ -195,17 +195,16 @@ assert.sets = function (getter, value, fn, message) { actual: finalValue, expected: value, operator: '===', - message: message, + message, stackStartFunction: assert.sets, }); }; - // .throws() does not currently work with Promises. assert.throwsAsync = async function (fn, message) { try { await fn(); - } catch (e) { + } catch { return; // threw } throw new AssertionError({ @@ -257,7 +256,7 @@ assert.false = function (value, message) { actual: `!${value}`, expected: true, operator: '===', - message: message, + message, stackStartFunction: assert.false, }); }; @@ -266,7 +265,7 @@ for (const methodName of assertMethods) { assert.false[methodName] = function (...args) { try { assert[methodName].apply(null, args); - } catch (err) { + } catch { return; } throw new AssertionError({ diff --git a/test/common.js b/test/common.js index 7de77090ea..551139c9bb 100644 --- a/test/common.js +++ b/test/common.js @@ -100,8 +100,8 @@ class TestTools { const battleOptions = { debug: true, - forceRandomChance: null || options.forceRandomChance, - format: format, + forceRandomChance: options.forceRandomChance, + format, // If a seed for the pseudo-random number generator is not provided, // a default seed (guaranteed to be the same across test executions) // will be used. @@ -114,7 +114,7 @@ class TestTools { for (let i = 0; i < teams.length; i++) { assert(Array.isArray(teams[i]), `Team provided is not an array`); const playerSlot = `p${i + 1}`; - battleOptions[playerSlot] = {team: teams[i]}; + battleOptions[playerSlot] = { team: teams[i] }; } return new Sim.Battle(battleOptions); @@ -132,7 +132,7 @@ class TestTools { const battleLog = battle.getDebugLog(); if (!fileName) fileName = 'test-replay'; const filePath = path.resolve(__dirname, `./replays/${fileName}-${Date.now()}.html`); - const out = fs.createWriteStream(filePath, {flags: 'a'}); + const out = fs.createWriteStream(filePath, { flags: 'a' }); out.on('open', () => { out.write( `\n` + diff --git a/test/lib/dashycode.js b/test/lib/dashycode.js index 01dc85a43a..2d5d8247c4 100644 --- a/test/lib/dashycode.js +++ b/test/lib/dashycode.js @@ -3,29 +3,29 @@ const assert = require('assert').strict; const Dashycode = require('./../../dist/lib/dashycode'); -describe('Dashycode', function () { - const ascii = Array.from({length: 0x80}, (v, i) => i); - const iso88591 = Array.from({length: 0x80}, (v, i) => i + 0x80); - const utf16 = Array.from({length: 0xFF00}, (v, i) => i + 0x100); +describe('Dashycode', () => { + const ascii = Array.from({ length: 0x80 }, (v, i) => i); + const iso88591 = Array.from({ length: 0x80 }, (v, i) => i + 0x80); + const utf16 = Array.from({ length: 0xFF00 }, (v, i) => i + 0x100); - const latinL = Array.from({length: 26}, (v, i) => i + 0x60); - const latinU = Array.from({length: 26}, (v, i) => i + 0x41); + const latinL = Array.from({ length: 26 }, (v, i) => i + 0x60); + const latinU = Array.from({ length: 26 }, (v, i) => i + 0x41); const encoded = new Map(); - const encode = (codepoint) => { + const encode = codepoint => { const character = String.fromCodePoint(codepoint); const dashycode = Dashycode.encode(character); assert.equal(encoded.has(dashycode), false); encoded.set(dashycode, character); }; - const decode = (dashycode) => { + const decode = dashycode => { const character = Dashycode.decode(dashycode); assert.equal(encoded.get(dashycode), character); }; - const transcode = (plaintext) => function () { + const transcode = plaintext => function () { const ciphertext = Dashycode.encode(plaintext); assert.equal(Dashycode.decode(ciphertext), plaintext); }; @@ -42,13 +42,13 @@ describe('Dashycode', function () { } }; - it('should encode all codepoints uniquely', function () { + it('should encode all codepoints uniquely', () => { for (const codepoint of [...ascii, ...iso88591, ...utf16]) { encode(codepoint); } }); - it('should decode all codepoints accurately', function () { + it('should decode all codepoints accurately', () => { for (const dashycode of encoded.keys()) { decode(dashycode); } @@ -67,7 +67,7 @@ describe('Dashycode', function () { it('should transcode mixtures of ASCII and UTF-16 codepoints', transcodeWithSets(ascii, utf16)); it('should transcode mixtures of ISO-8859-1 and UTF-16 codepoints', transcodeWithSets(iso88591, utf16)); - after(function () { + after(() => { encoded.clear(); }); }); diff --git a/test/lib/postgres.js b/test/lib/postgres.js index 9ba05a92fb..5704e3872b 100644 --- a/test/lib/postgres.js +++ b/test/lib/postgres.js @@ -1,11 +1,11 @@ "use strict"; const assert = require('assert').strict; -const {PostgresDatabase} = require('../../dist/lib'); +const { PostgresDatabase } = require('../../dist/lib'); function testMod(mod) { try { require(mod); - } catch (e) { + } catch { return it.skip; } return it; @@ -21,7 +21,7 @@ describe.skip("Postgres features", () => { await this.database.query(`CREATE TABLE test (col TEXT, col2 TEXT)`); await this.database.query( `INSERT INTO test (col, col2) VALUES ($1, $2)`, - ['foo', 'bar'], + ['foo', 'bar'] ); }); }); @@ -38,7 +38,7 @@ describe.skip("Postgres features", () => { `SELECT tablename FROM pg_catalog.pg_tables ` + `WHERE tablename = 'test' LIMIT 1;` ); - for (const {tablename} of tables) { + for (const { tablename } of tables) { await worker.query(`DROP TABLE ` + tablename); } }); diff --git a/test/lib/sql.js b/test/lib/sql.js index 53fba7d0f6..1c1aabd282 100644 --- a/test/lib/sql.js +++ b/test/lib/sql.js @@ -1,9 +1,9 @@ "use strict"; -const {SQL} = require('../../dist/lib/sql'); +const { SQL } = require('../../dist/lib/sql'); const assert = require('../assert').strict; const common = require('../common'); -const database = SQL(module, {file: `:memory:`, processes: 1}); +const database = SQL(module, { file: `:memory:`, processes: 1 }); (common.hasModule('better-sqlite3') ? describe : describe.skip)(`SQLite worker wrapper`, () => { // prepare statements and set up table @@ -27,7 +27,7 @@ const database = SQL(module, {file: `:memory:`, processes: 1}); it(`should support both inline and object params`, async () => { const num = await database.prepare(`INSERT INTO test (col, col2) VALUES($col, $col2)`); await database.run(insert, ['a', 'b']); - await database.run(num, {col: 'a', col2: 'b'}); + await database.run(num, { col: 'a', col2: 'b' }); }); it(`should retrieve one line from Database.get`, async () => { const result = await database.get(select); diff --git a/test/random-battles/all-gens.js b/test/random-battles/all-gens.js index 157a2141c5..3cbd6a8da0 100644 --- a/test/random-battles/all-gens.js +++ b/test/random-battles/all-gens.js @@ -6,20 +6,20 @@ const assert = require('../assert'); const common = require('../common'); -const {Utils} = require('../../dist/lib'); -const {testTeam, assertSetValidity, validateLearnset} = require('./tools'); -const {default: Dex} = require('../../dist/sim/dex'); +const { Utils } = require('../../dist/lib'); +const { testTeam, assertSetValidity, validateLearnset } = require('./tools'); +const { default: Dex } = require('../../dist/sim/dex'); describe('value rule support (slow)', () => { it('should generate teams of the proper length for the format (i.e. support Max Team Size)', () => { - testTeam({format: 'gen9randombattle', rounds: 100}, team => assert.equal(team.length, 6)); - testTeam({format: 'gen9challengecup1v1', rounds: 100}, team => assert.equal(team.length, 6)); - testTeam({format: 'gen9hackmonscup', rounds: 100}, team => assert.equal(team.length, 6)); + testTeam({ format: 'gen9randombattle', rounds: 100 }, team => assert.equal(team.length, 6)); + testTeam({ format: 'gen9challengecup1v1', rounds: 100 }, team => assert.equal(team.length, 6)); + testTeam({ format: 'gen9hackmonscup', rounds: 100 }, team => assert.equal(team.length, 6)); - testTeam({format: 'gen8multirandombattle', rounds: 100}, team => assert.equal(team.length, 3)); - testTeam({format: 'gen8cap1v1', rounds: 100}, team => assert.equal(team.length, 3)); + testTeam({ format: 'gen8multirandombattle', rounds: 100 }, team => assert.equal(team.length, 3)); + testTeam({ format: 'gen8cap1v1', rounds: 100 }, team => assert.equal(team.length, 3)); - testTeam({format: 'gen7randombattle', rounds: 100}, team => assert.equal(team.length, 6)); + testTeam({ format: 'gen7randombattle', rounds: 100 }, team => assert.equal(team.length, 6)); }); for (let gen = 1; gen <= 9; gen++) { @@ -38,7 +38,7 @@ describe('value rule support (slow)', () => { const setsJSON = require(`../../dist/data/random-battles/gen${gen}/sets.json`); it(`${format.name} should support Max Move Count = ${count}`, () => { - testTeam({format, rounds: 50}, team => { + testTeam({ format, rounds: 50 }, team => { for (const set of team) { let species = set.species; // Formes make this test code really complicated, so we skip them @@ -70,7 +70,7 @@ describe('value rule support (slow)', () => { const dataJSON = require(`../../dist/data/random-battles/gen${gen}/data.json`); it(`${format.name} should support Max Move Count = ${count}`, () => { - testTeam({format, rounds: 50}, team => { + testTeam({ format, rounds: 50 }, team => { for (const set of team) { let species = set.species; // Formes make this test code really complicated, so we skip them @@ -104,7 +104,7 @@ describe('value rule support (slow)', () => { for (const level of [1, 99999]) { it(`${format.name} should support Adjust Level = ${level}`, () => { - testTeam({format: `${format.id}@@@Adjust Level = ${level}`, rounds: 50}, team => { + testTeam({ format: `${format.id}@@@Adjust Level = ${level}`, rounds: 50 }, team => { for (const set of team) { assert.equal(set.level, level); } @@ -161,7 +161,7 @@ describe("New set format (slow)", () => { for (const format of Object.keys(formatInfo)) { const filename = formatInfo[format].filename; const setsJSON = require(`../../dist/data/random-battles/${filename}.json`); - const dex = common.mod(common.getFormat({formatid: format}).mod).dex; // verifies format exists + const dex = common.mod(common.getFormat({ formatid: format }).mod).dex; // verifies format exists const genNum = dex.gen; const rounds = 100; it(`${filename}.json should have valid set data`, () => { @@ -181,7 +181,7 @@ describe("New set format (slow)", () => { } else { assert(move === dexMove.id || move.startsWith('hiddenpower'), `In ${format}, ${species.name} has misformatted move: ${move}`); } - assert(validateLearnset(dexMove, {species}, 'ubers', `gen${genNum}`), `In ${format}, ${species.name} can't learn ${move}`); + assert(validateLearnset(dexMove, { species }, 'ubers', `gen${genNum}`), `In ${format}, ${species.name} can't learn ${move}`); } for (let i = 0; i < set.movepool.length - 1; i++) { assert(set.movepool[i + 1] > set.movepool[i], `In ${format}, ${species.name} movepool should be sorted alphabetically`); @@ -224,12 +224,12 @@ describe("New set format (slow)", () => { } } }); - it('all Pokemon should have 4 moves, except for Ditto and Unown', function () { - testTeam({format, rounds}, team => { + it('all Pokemon should have 4 moves, except for Ditto and Unown', () => { + testTeam({ format, rounds }, team => { for (const pokemon of team) assert(pokemon.name === 'Ditto' || pokemon.name === 'Unown' || pokemon.moves.length === 4, `In ${format}, ${pokemon.name} can generate with ${pokemon.moves.length} moves`); }); }); - it('all moves on all sets should exist and be obtainable', function () { + it('all moves on all sets should exist and be obtainable', () => { const generator = Teams.getGenerator(format); for (const pokemon of Object.keys(setsJSON)) { const species = dex.species.get(pokemon); @@ -253,7 +253,7 @@ describe("New set format (slow)", () => { const stickyWeb = Math.floor(i / 4) % 2; const spikes = Math.floor(i / 8) % 2; const screens = Math.floor(i / 2) % 2; - const teamDetails = {rapidSpin, stealthRock, stickyWeb, spikes, screens}; + const teamDetails = { rapidSpin, stealthRock, stickyWeb, spikes, screens }; // randomMoveset() deletes moves from the movepool, so recreate it every time const movePool = set.movepool.map(m => (m.startsWith('hiddenpower') ? m : dex.moves.get(m).id)); let moveSet; @@ -283,7 +283,7 @@ describe('randomly generated teams should be valid (slow)', () => { this.timeout(0); const targetTeamSize = Dex.formats.getRuleTable(format).maxTeamSize; - testTeam({format: format.id}, team => { + testTeam({ format: format.id }, team => { assert.equal(team.length, targetTeamSize, `Team of incorrect size (should have ${targetTeamSize} Pokémon but actually has ${team.length} Pokémon): ${JSON.stringify(team)}`); for (const set of team) { @@ -356,7 +356,6 @@ describe('Battle Factory and BSS Factory data should be valid (slow)', () => { } } - // Check that no moves appear more than once in a set assert.equal(set.moves.flat(1).length, new Set(set.moves.flat(1)).size, `${species} has repeat moves`); diff --git a/test/random-battles/gen1.js b/test/random-battles/gen1.js index 05cf6fe3e2..dca59c8a3d 100644 --- a/test/random-battles/gen1.js +++ b/test/random-battles/gen1.js @@ -4,10 +4,10 @@ 'use strict'; const assert = require('../assert'); -const {testTeam} = require('./tools'); +const { testTeam } = require('./tools'); describe('[Gen 1] Random Battle (slow)', () => { - const options = {format: 'gen1randombattle'}; + const options = { format: 'gen1randombattle' }; const badPokemon = ['Magikarp', 'Weedle', 'Kakuna', 'Caterpie', 'Metapod']; it(`should not give bad Pokémon as leads (${badPokemon.join(', ')})`, () => { diff --git a/test/random-battles/gen5.js b/test/random-battles/gen5.js index 8d501077a9..762abe36d4 100644 --- a/test/random-battles/gen5.js +++ b/test/random-battles/gen5.js @@ -4,10 +4,10 @@ 'use strict'; const assert = require('../assert'); -const {testSet} = require('./tools'); +const { testSet } = require('./tools'); describe('[Gen 5] Random Battle (slow)', () => { - const options = {format: 'gen5randombattle'}; + const options = { format: 'gen5randombattle' }; it('should prevent unreleased HAs from being used', () => { testSet('chandelure', options, set => assert.notEqual(set.ability, 'Shadow Tag')); diff --git a/test/random-battles/gen6.js b/test/random-battles/gen6.js index e5b1fb8853..d7848f94fe 100644 --- a/test/random-battles/gen6.js +++ b/test/random-battles/gen6.js @@ -4,13 +4,13 @@ 'use strict'; const assert = require('../assert'); -const {testSet} = require('./tools'); +const { testSet } = require('./tools'); describe('[Gen 6] Random Battle (slow)', () => { - const options = {format: 'gen6randombattle'}; + const options = { format: 'gen6randombattle' }; it('should not give mega evolution abilities to base formes', () => { - testSet('manectricmega', {rounds: 1, ...options}, set => { + testSet('manectricmega', { rounds: 1, ...options }, set => { assert(set.ability !== 'Intimidate', 'Mega Manectric should not have Intimidate before it mega evolves'); }); }); diff --git a/test/random-battles/gen7.js b/test/random-battles/gen7.js index e7bbc7f112..f311fb4b85 100644 --- a/test/random-battles/gen7.js +++ b/test/random-battles/gen7.js @@ -4,13 +4,13 @@ 'use strict'; const assert = require('../assert'); -const {testSet} = require('./tools'); +const { testSet } = require('./tools'); describe('[Gen 7] Random Battle (slow)', () => { - const options = {format: 'gen7randombattle'}; + const options = { format: 'gen7randombattle' }; it('should not give mega evolution abilities to base formes', () => { - testSet('manectricmega', {rounds: 1, ...options}, set => { + testSet('manectricmega', { rounds: 1, ...options }, set => { assert(set.ability !== 'Intimidate', 'Mega Manectric should not have Intimidate before it mega evolves'); }); }); diff --git a/test/random-battles/gen8.js b/test/random-battles/gen8.js index 7b6ddd9474..0260351cd8 100644 --- a/test/random-battles/gen8.js +++ b/test/random-battles/gen8.js @@ -3,11 +3,11 @@ */ 'use strict'; -const {testSet, testNotBothMoves, testHasSTAB, testAlwaysHasMove} = require('./tools'); +const { testSet, testNotBothMoves, testHasSTAB, testAlwaysHasMove } = require('./tools'); const assert = require('../assert'); describe('[Gen 8] Random Battle (slow)', () => { - const options = {format: 'gen8randombattle'}; + const options = { format: 'gen8randombattle' }; const dataJSON = require(`../../dist/data/random-battles/gen8/data.json`); const dex = Dex.forFormat(options.format); const generator = Teams.getGenerator(options.format); @@ -193,7 +193,6 @@ describe('[Gen 8] Random Battle (slow)', () => { it('should always give Palossand Shore Up', () => testAlwaysHasMove('palossand', options, 'shoreup')); it('should always give Azumarill Aqua Jet', () => testAlwaysHasMove('azumarill', options, 'aquajet')); - it('should forbid a certain Togekiss set', () => { testSet('togekiss', options, set => { assert.notDeepEqual( @@ -206,7 +205,7 @@ describe('[Gen 8] Random Battle (slow)', () => { }); describe('[Gen 8] Random Doubles Battle (slow)', () => { - const options = {format: 'gen8randomdoublesbattle'}; + const options = { format: 'gen8randomdoublesbattle' }; it('should never generate Melmetal without Body Press', () => { testSet('melmetal', options, set => { @@ -247,7 +246,7 @@ describe('[Gen 8] Random Battle (No Dmax) (slow)', () => { }); describe('[Gen 8] Free-for-All Random Battle (slow)', () => { - const options = {format: 'gen8freeforallrandombattle', isDoubles: true}; + const options = { format: 'gen8freeforallrandombattle', isDoubles: true }; it('should enforce STAB on Pinsir, Pikachu, and Zygarde', () => { for (const pkmn of ['pinsir', 'pikachu', 'zygarde']) { @@ -257,7 +256,7 @@ describe('[Gen 8] Free-for-All Random Battle (slow)', () => { }); describe('[Gen 8 BDSP] Random Battle (slow)', () => { - const options = {format: 'gen8bdsprandombattle'}; + const options = { format: 'gen8bdsprandombattle' }; const dataJSON = require(`../../dist/data/random-battles/gen8bdsp/data.json`); const dex = Dex.forFormat(options.format); @@ -291,7 +290,7 @@ describe('[Gen 8 BDSP] Random Battle (slow)', () => { // This test is marked as slow because although each individual test is fairly fast to run, // ~500 tests are generated, so they can dramatically slow down the process of unit testing. it(`should not generate Choice items on ${species.name} sets with status moves, unless an item-switching move or Healing Wish is generated`, () => { - testSet(species.id, {...options, rounds: 500}, set => { + testSet(species.id, { ...options, rounds: 500 }, set => { if (set.item.startsWith('Choice') && !okToHaveChoiceMoves.some(okMove => set.moves.includes(okMove))) { assert(set.moves.every(m => dex.moves.get(m).category !== 'Status'), `Choice item and status moves on set ${JSON.stringify(set)}`); } diff --git a/test/random-battles/gen9.js b/test/random-battles/gen9.js index fd7f4a5f8b..12d0548d2c 100644 --- a/test/random-battles/gen9.js +++ b/test/random-battles/gen9.js @@ -3,21 +3,21 @@ */ 'use strict'; -const {testTeam, testAlwaysHasMove} = require('./tools'); +const { testTeam, testAlwaysHasMove } = require('./tools'); const assert = require('../assert'); describe('[Gen 9] Random Battle (slow)', () => { - const options = {format: 'gen9randombattle'}; + const options = { format: 'gen9randombattle' }; it("should always give Iron Bundle Freeze-Dry", () => { testAlwaysHasMove('ironbundle', options, 'freezedry'); }); }); describe('[Gen 9] Monotype Random Battle (slow)', () => { - const options = {format: 'gen9monotyperandombattle'}; + const options = { format: 'gen9monotyperandombattle' }; - it('all Pokemon should share a common type', function () { - testTeam({...options, rounds: 100}, team => { + it('all Pokemon should share a common type', () => { + testTeam({ ...options, rounds: 100 }, team => { assert.legalTeam(team, 'gen9customgame@@@sametypeclause'); }); }); diff --git a/test/random-battles/tools.js b/test/random-battles/tools.js index a880c53e17..b2f867ebed 100644 --- a/test/random-battles/tools.js +++ b/test/random-battles/tools.js @@ -8,7 +8,7 @@ const assert = require("../assert"); const Teams = require('./../../dist/sim/teams').Teams; -const {TeamValidator, PokemonSources} = require('../../dist/sim/team-validator'); +const { TeamValidator, PokemonSources } = require('../../dist/sim/team-validator'); /** * Unit test helper for Pokemon sets diff --git a/test/server/cg-teams.js b/test/server/cg-teams.js index 21d852288a..4ec36257bc 100644 --- a/test/server/cg-teams.js +++ b/test/server/cg-teams.js @@ -10,7 +10,7 @@ describe('[Gen 9] Computer-Generated Teams', () => { .all() .filter(s => s.exists && !(s.isNonstandard || s.isNonstandard === 'Unobtainable') && !s.nfe); for (const species of pool) { - const set = generator.makeSet(species, {hazardSetters: {}}); + const set = generator.makeSet(species, { hazardSetters: {} }); assert(set.moves.length <= 4, `Species ${species.name} has more than 4 moves (set=${JSON.stringify(set)})`); assert(new Set(set.moves).size === set.moves.length, `Species ${species.name} has duplicate moves (set=${JSON.stringify(set)})`); } @@ -24,14 +24,14 @@ describe('[Gen 9] Computer-Generated Teams', () => { let trials = 0; for (const choices of [ - [{choice: 'a', weight: 1}, {choice: 'b', weight: 2}], - [{choice: 'a', weight: 1}, {choice: 'b', weight: 1}], - [{choice: 'a', weight: 30}, {choice: 'b', weight: 2000}, {choice: 'c', weight: 7}], + [{ choice: 'a', weight: 1 }, { choice: 'b', weight: 2 }], + [{ choice: 'a', weight: 1 }, { choice: 'b', weight: 1 }], + [{ choice: 'a', weight: 30 }, { choice: 'b', weight: 2000 }, { choice: 'c', weight: 7 }], // a big test case with lots of different weight values [ - {choice: 'a', weight: 1345}, {choice: 'b', weight: 2013}, {choice: 'c', weight: 3411}, {choice: 'd', weight: 940}, - {choice: 'e', weight: 505}, {choice: 'f', weight: 10148}, {choice: 'g', weight: 7342}, {choice: 'h', weight: 8403}, - {choice: 'i', weight: 9859}, {choice: 'j', weight: 1042}, {choice: 'k', weight: 1132}, {choice: 'l', weight: 1200}, + { choice: 'a', weight: 1345 }, { choice: 'b', weight: 2013 }, { choice: 'c', weight: 3411 }, { choice: 'd', weight: 940 }, + { choice: 'e', weight: 505 }, { choice: 'f', weight: 10148 }, { choice: 'g', weight: 7342 }, { choice: 'h', weight: 8403 }, + { choice: 'i', weight: 9859 }, { choice: 'j', weight: 1042 }, { choice: 'k', weight: 1132 }, { choice: 'l', weight: 1200 }, ], ]) { const results = {}; diff --git a/test/server/chat-commands/moderation.js b/test/server/chat-commands/moderation.js index 0e53346806..1a91661f1e 100644 --- a/test/server/chat-commands/moderation.js +++ b/test/server/chat-commands/moderation.js @@ -8,7 +8,7 @@ const assert = require('assert').strict; const moderation = require('../../../dist/server/chat-commands/moderation'); -const {makeUser} = require('../../users-utils'); +const { makeUser } = require('../../users-utils'); describe('room promotions', function () { before(() => { diff --git a/test/server/chat-plugins/chat-monitor.js b/test/server/chat-plugins/chat-monitor.js index 0bc0469ecc..1846f4c690 100644 --- a/test/server/chat-plugins/chat-monitor.js +++ b/test/server/chat-plugins/chat-monitor.js @@ -6,9 +6,9 @@ 'use strict'; const assert = require('assert').strict; -const {makeUser} = require('../../users-utils'); +const { makeUser } = require('../../users-utils'); -const {Filters} = require('../../../dist/server/chat-plugins/chat-monitor'); +const { Filters } = require('../../../dist/server/chat-plugins/chat-monitor'); describe('Chat monitor', () => { describe('regex generator', () => { diff --git a/test/server/chat-plugins/friends.js b/test/server/chat-plugins/friends.js index 439dff85d0..ac3dfe2b54 100644 --- a/test/server/chat-plugins/friends.js +++ b/test/server/chat-plugins/friends.js @@ -7,8 +7,8 @@ const assert = require('../../assert'); describe.skip("Friends lists", () => { - const {FriendsDatabase} = require('../../../dist/server/friends'); - const {Config} = require('../../../dist/server/config-loader'); + const { FriendsDatabase } = require('../../../dist/server/friends'); + const { Config } = require('../../../dist/server/config-loader'); const test = (Config.usesqlite ? it : it.skip); test("Should properly setup database", () => { assert.doesNotThrow(() => FriendsDatabase.setupDatabase(':memory:')); diff --git a/test/server/chat-plugins/hangman.js b/test/server/chat-plugins/hangman.js index e7fd1f89a6..89da0d17c6 100644 --- a/test/server/chat-plugins/hangman.js +++ b/test/server/chat-plugins/hangman.js @@ -1,14 +1,14 @@ 'use strict'; -const {Hangman} = require('../../../dist/server/chat-plugins/hangman'); -const {makeUser, destroyUser} = require('../../users-utils'); +const { Hangman } = require('../../../dist/server/chat-plugins/hangman'); +const { makeUser, destroyUser } = require('../../users-utils'); const assert = require('../../assert'); function createHangman(creator, word, hint) { return new Hangman(Rooms.lobby, creator, word, hint); } -describe("Hangman", function () { +describe("Hangman", () => { before(function () { this.creator = makeUser('dawoblefet'); this.guesser = makeUser('mathy'); @@ -22,7 +22,7 @@ describe("Hangman", function () { it("should reject impossible guesses", function () { const game = createHangman(this.creator, "Wynaut", "Why write unit tests?"); const errorRegex = /Your guess "[A-Za-z ]+" is invalid./; - const testInvalidGuess = (guess) => { + const testInvalidGuess = guess => { assert.throws(() => { game.choose(this.guesser, guess); }, errorRegex, `Guess should have been invalid: "${guess}"`); diff --git a/test/server/chat-plugins/repeats.js b/test/server/chat-plugins/repeats.js index a2b0cdb087..e34c339142 100644 --- a/test/server/chat-plugins/repeats.js +++ b/test/server/chat-plugins/repeats.js @@ -16,7 +16,7 @@ describe("Repeats plugin", function () { it('should add repeats correctly', () => { assert(!Repeats.repeats.has(this.room)); - Repeats.addRepeat(this.room, {id: 'happyface', phrase: "^_^", interval: 1}); + Repeats.addRepeat(this.room, { id: 'happyface', phrase: "^_^", interval: 1 }); assert(Repeats.repeats.has(this.room)); @@ -29,7 +29,7 @@ describe("Repeats plugin", function () { }); it('should remove repeats correctly', () => { - Repeats.addRepeat(this.room, {id: 'weirdface', phrase: "^_-", interval: 1}); + Repeats.addRepeat(this.room, { id: 'weirdface', phrase: "^_-", interval: 1 }); assert(Repeats.repeats.get(this.room).get('weirdface').has("^_-")); assert(this.room.settings.repeats.some(repeat => repeat.phrase === "^_-")); @@ -41,7 +41,7 @@ describe("Repeats plugin", function () { it('should be able to tell if a repeat exists or not', () => { assert(!Repeats.hasRepeat(this.room, 'annoyedface')); - Repeats.addRepeat(this.room, {id: 'annoyedface', phrase: "-_-", interval: 1}); + Repeats.addRepeat(this.room, { id: 'annoyedface', phrase: "-_-", interval: 1 }); assert(Repeats.hasRepeat(this.room, 'annoyedface')); Repeats.removeRepeat(this.room, 'annoyedface'); diff --git a/test/server/chat-plugins/responder.js b/test/server/chat-plugins/responder.js index 1f575b974c..b2c173e35e 100644 --- a/test/server/chat-plugins/responder.js +++ b/test/server/chat-plugins/responder.js @@ -10,21 +10,21 @@ const Responder = require('../../../dist/server/chat-plugins/responder').AutoRes const room = Rooms.createChatRoom('etheria'); const Help = new Responder(room); -describe('Autoresponder', function () { - it('should only return true on added regexes', function () { +describe('Autoresponder', () => { + it('should only return true on added regexes', () => { Help.data.pairs.catra = []; Help.data.pairs.catra.push(Help.stringRegex(`Hey & Adora`)); assert(Help.test('Hey, Adora', 'catra')); assert(!Help.test('Hello, Adora', 'catra')); }); - it('should produce valid regexes', function () { + it('should produce valid regexes', () => { const regexString = Help.stringRegex(`uwu & awa`); assert.equal(regexString, "(?=.*?(uwu))(?=.*?(awa))"); const regex = new RegExp(regexString); assert(regex.test('uwu awa')); }); - it('should handle |, &, and ! correctly', function () { + it('should handle |, &, and ! correctly', () => { const and = new RegExp(Help.stringRegex(`Horde & Prime`)); assert(and.test('Horde Prime')); assert(!and.test('Horde')); diff --git a/test/server/chat-plugins/trivia.js b/test/server/chat-plugins/trivia.js index b77c6a4e65..64fb1e440f 100644 --- a/test/server/chat-plugins/trivia.js +++ b/test/server/chat-plugins/trivia.js @@ -2,7 +2,7 @@ const assert = require('assert').strict; -const {makeUser, destroyUser} = require('../../users-utils'); +const { makeUser, destroyUser } = require('../../users-utils'); const trivia = require('../../../dist/server/chat-plugins/trivia/trivia'); const Trivia = trivia.Trivia; const FirstModeTrivia = trivia.FirstModeTrivia; @@ -16,14 +16,14 @@ function makeTriviaUser(name, ip) { return user; } -describe('Trivia', function () { +describe('Trivia', () => { before(function () { Rooms.global.addChatRoom('Trivia'); this.room = Rooms.get('trivia'); }); beforeEach(function () { - const questions = [{question: '', answers: ['answer'], category: 'ae'}]; + const questions = [{ question: '', answers: ['answer'], category: 'ae' }]; this.user = makeTriviaUser('Morfent', '127.0.0.1'); this.tarUser = makeTriviaUser('ReallyNotMorfent', '127.0.0.2'); this.game = this.room.game = new Trivia(this.room, 'first', ['ae'], true, 'short', questions); @@ -147,9 +147,9 @@ describe('Trivia', function () { assert.equal(this.game.verifyAnswer('not the right answer'), false); }); - context('marking player absence', function () { + context('marking player absence', () => { beforeEach(async function () { - const questions = [null, null].fill({question: '', answers: ['answer'], category: 'ae'}); + const questions = [null, null].fill({ question: '', answers: ['answer'], category: 'ae' }); const game = new FirstModeTrivia(this.room, 'first', ['ae'], true, 'short', questions); this.user = makeTriviaUser('Morfent', '127.0.0.1'); @@ -191,9 +191,9 @@ describe('Trivia', function () { }); }); - context('first mode', function () { + context('first mode', () => { beforeEach(async function () { - const questions = [{question: '', answers: ['answer'], category: 'ae'}]; + const questions = [{ question: '', answers: ['answer'], category: 'ae' }]; const game = new FirstModeTrivia(this.room, 'first', ['ae'], true, 'short', questions); this.user = makeTriviaUser('Morfent', '127.0.0.1'); @@ -255,9 +255,9 @@ describe('Trivia', function () { }); }); - context('timer mode', function () { + context('timer mode', () => { beforeEach(async function () { - const questions = [{question: '', answers: ['answer'], category: 'ae'}]; + const questions = [{ question: '', answers: ['answer'], category: 'ae' }]; const game = new TimerModeTrivia(this.room, 'first', ['ae'], true, 'short', questions); this.user = makeTriviaUser('Morfent', '127.0.0.1'); @@ -330,9 +330,9 @@ describe('Trivia', function () { }); }); - context('number mode', function () { + context('number mode', () => { beforeEach(async function () { - const questions = [{question: '', answers: ['answer'], category: 'ae'}]; + const questions = [{ question: '', answers: ['answer'], category: 'ae' }]; const game = new NumberModeTrivia(this.room, 'first', ['ae'], true, 'short', questions); this.user = makeTriviaUser('Morfent', '127.0.0.1'); @@ -393,9 +393,9 @@ describe('Trivia', function () { it('should only allow merging approved alts', async () => { for (const user of ['annika', 'heartofetheria', 'somerandomreg']) { await trivia.database.updateLeaderboardForUser(user, { - alltime: {score: 0, totalCorrectAnswers: 0, totalPoints: 0}, - nonAlltime: {score: 0, totalCorrectAnswers: 0, totalPoints: 0}, - cycle: {score: 0, totalCorrectAnswers: 0, totalPoints: 0}, + alltime: { score: 0, totalCorrectAnswers: 0, totalPoints: 0 }, + nonAlltime: { score: 0, totalCorrectAnswers: 0, totalPoints: 0 }, + cycle: { score: 0, totalCorrectAnswers: 0, totalPoints: 0 }, }); } @@ -412,14 +412,14 @@ describe('Trivia', function () { it('should correctly merge alts', async () => { await trivia.database.updateLeaderboardForUser('annika', { - alltime: {score: 3, totalCorrectAnswers: 2, totalPoints: 1}, - nonAlltime: {score: 4, totalCorrectAnswers: 3, totalPoints: 2}, - cycle: {score: 1, totalCorrectAnswers: 1, totalPoints: 1}, + alltime: { score: 3, totalCorrectAnswers: 2, totalPoints: 1 }, + nonAlltime: { score: 4, totalCorrectAnswers: 3, totalPoints: 2 }, + cycle: { score: 1, totalCorrectAnswers: 1, totalPoints: 1 }, }); await trivia.database.updateLeaderboardForUser('heartofetheria', { - alltime: {score: 1, totalCorrectAnswers: 2, totalPoints: 3}, - nonAlltime: {score: 2, totalCorrectAnswers: 3, totalPoints: 4}, - cycle: {score: 1, totalCorrectAnswers: 2, totalPoints: 1}, + alltime: { score: 1, totalCorrectAnswers: 2, totalPoints: 3 }, + nonAlltime: { score: 2, totalCorrectAnswers: 3, totalPoints: 4 }, + cycle: { score: 1, totalCorrectAnswers: 2, totalPoints: 1 }, }); await trivia.requestAltMerge('heartofetheria', 'annika'); @@ -427,15 +427,15 @@ describe('Trivia', function () { assert.deepEqual( await trivia.database.getLeaderboardEntry('annika', 'alltime'), - {score: 4, totalCorrectAnswers: 4, totalPoints: 4} + { score: 4, totalCorrectAnswers: 4, totalPoints: 4 } ); assert.deepEqual( await trivia.database.getLeaderboardEntry('annika', 'nonAlltime'), - {score: 6, totalCorrectAnswers: 6, totalPoints: 6} + { score: 6, totalCorrectAnswers: 6, totalPoints: 6 } ); assert.deepEqual( await trivia.database.getLeaderboardEntry('annika', 'cycle'), - {score: 2, totalCorrectAnswers: 3, totalPoints: 2} + { score: 2, totalCorrectAnswers: 3, totalPoints: 2 } ); // make sure it got deleted diff --git a/test/server/chat-plugins/username-prefixes.js b/test/server/chat-plugins/username-prefixes.js index fc1d80d47c..cdf206ec2b 100644 --- a/test/server/chat-plugins/username-prefixes.js +++ b/test/server/chat-plugins/username-prefixes.js @@ -5,7 +5,7 @@ 'use strict'; const assert = require('assert').strict; -const {PrefixManager} = require('../../../dist/server/chat-plugins/username-prefixes'); +const { PrefixManager } = require('../../../dist/server/chat-plugins/username-prefixes'); const PREFIX_DURATION = 10 * 24 * 60 * 60 * 1000; describe('PrefixManager', function () { @@ -30,12 +30,12 @@ describe('PrefixManager', function () { it('should not overwrite manually specified prefixes', () => { const time = Date.now() + PREFIX_DURATION; - Config.forcedprefixes = [{prefix: 'manual', type: 'modchat', expireAt: time}]; + Config.forcedprefixes = [{ prefix: 'manual', type: 'modchat', expireAt: time }]; this.prefixManager.addPrefix('nomodchat', 'modchat'); assert.deepEqual(Config.forcedprefixes, [ - {prefix: 'manual', type: 'modchat', expireAt: time}, - {prefix: 'nomodchat', type: 'modchat', expireAt: Config.forcedprefixes.find(x => x.prefix === 'nomodchat').expireAt}, + { prefix: 'manual', type: 'modchat', expireAt: time }, + { prefix: 'nomodchat', type: 'modchat', expireAt: Config.forcedprefixes.find(x => x.prefix === 'nomodchat').expireAt }, ]); }); diff --git a/test/server/chat-plugins/youtube.js b/test/server/chat-plugins/youtube.js index cd45bf2638..5705074183 100644 --- a/test/server/chat-plugins/youtube.js +++ b/test/server/chat-plugins/youtube.js @@ -7,8 +7,8 @@ const YoutubeInterface = require('../../../dist/server/chat-plugins/youtube').YoutubeInterface; const assert = require('../../assert'); -describe(`Youtube features`, function () { - it.skip(`should correctly add channels to the database`, async function () { +describe(`Youtube features`, () => { + it.skip(`should correctly add channels to the database`, async () => { if (!Config.youtubeKey) return true; const Youtube = new YoutubeInterface({}); const url = 'https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw'; @@ -16,7 +16,7 @@ describe(`Youtube features`, function () { assert(Youtube.data['UCuAXFkgsw1L7xaCfnd5JJOw']); }); - it.skip(`should correctly handle PS names and channel names`, async function () { + it.skip(`should correctly handle PS names and channel names`, async () => { if (!Config.youtubeKey) return true; const Youtube = new YoutubeInterface({}); const url = 'https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw'; @@ -26,7 +26,7 @@ describe(`Youtube features`, function () { assert.equal(channelId, Youtube.channelSearch('Official Rick Astley')); }); - it.skip(`should correctly parse channel links`, function () { + it.skip(`should correctly parse channel links`, () => { if (!Config.youtubeKey) return true; const videoUrl = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'; const channelUrl = 'https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw'; diff --git a/test/server/chat.js b/test/server/chat.js index 7af45a3a31..02a1e58dfa 100644 --- a/test/server/chat.js +++ b/test/server/chat.js @@ -2,8 +2,8 @@ const assert = require('assert').strict; -describe('Chat', function () { - it('should run formatText correctly', function () { +describe('Chat', () => { + it('should run formatText correctly', () => { assert.equal( Chat.formatText(`hi **__bold italics__** ^^superscript^^ \\\\subscript\\\\ normal ~~strikethrough~~ bye`), `hi bold italics superscript subscript normal strikethrough bye` @@ -106,7 +106,7 @@ describe('Chat', function () { ); }); - it('should run toDurationString correctly', function () { + it('should run toDurationString correctly', () => { assert(Chat.toDurationString(1e50)); assert(!Chat.toDurationString(10000000 * 24 * 60 * 60 * 1000).includes(' ')); diff --git a/test/server/ip-tools.js b/test/server/ip-tools.js index 1935001c8b..d045a99635 100644 --- a/test/server/ip-tools.js +++ b/test/server/ip-tools.js @@ -79,22 +79,22 @@ describe("IP tools", () => { it('should handle wildcards in string ranges', () => { assert.deepEqual( IPTools.stringToRange('1.*'), - {minIP: IPTools.ipToNumber('1.0.0.0'), maxIP: IPTools.ipToNumber('1.255.255.255')} + { minIP: IPTools.ipToNumber('1.0.0.0'), maxIP: IPTools.ipToNumber('1.255.255.255') } ); assert.deepEqual( IPTools.stringToRange('1.1.*'), - {minIP: IPTools.ipToNumber('1.1.0.0'), maxIP: IPTools.ipToNumber('1.1.255.255')} + { minIP: IPTools.ipToNumber('1.1.0.0'), maxIP: IPTools.ipToNumber('1.1.255.255') } ); assert.deepEqual( IPTools.stringToRange('1.1.1.*'), - {minIP: IPTools.ipToNumber('1.1.1.0'), maxIP: IPTools.ipToNumber('1.1.1.255')} + { minIP: IPTools.ipToNumber('1.1.1.0'), maxIP: IPTools.ipToNumber('1.1.1.255') } ); }); it('should handle single IPs as string ranges', () => { assert.deepEqual( IPTools.stringToRange('1.1.1.1'), - {minIP: IPTools.ipToNumber('1.1.1.1'), maxIP: IPTools.ipToNumber('1.1.1.1')} + { minIP: IPTools.ipToNumber('1.1.1.1'), maxIP: IPTools.ipToNumber('1.1.1.1') } ); }); }); @@ -131,7 +131,7 @@ describe("IP tools helper functions", () => { describe('IP range conflict checker', () => { it('should not allow inserting a range where maxIP < minIP', () => { - assert.throws(() => IPTools.checkRangeConflicts({maxIP: 1000, minIP: 9999}, [])); + assert.throws(() => IPTools.checkRangeConflicts({ maxIP: 1000, minIP: 9999 }, [])); }); it('should respect the widen parameter', () => { @@ -141,19 +141,19 @@ describe('IP range conflict checker', () => { }]; // Widen the minimum IP - assert.throws(() => IPTools.checkRangeConflicts({minIP: 99, maxIP: 200}, ranges, false)); - assert.doesNotThrow(() => IPTools.checkRangeConflicts({minIP: 99, maxIP: 200}, ranges, true)); + assert.throws(() => IPTools.checkRangeConflicts({ minIP: 99, maxIP: 200 }, ranges, false)); + assert.doesNotThrow(() => IPTools.checkRangeConflicts({ minIP: 99, maxIP: 200 }, ranges, true)); // Widen the maximum IP - assert.throws(() => IPTools.checkRangeConflicts({minIP: 100, maxIP: 201}, ranges, false)); - assert.doesNotThrow(() => IPTools.checkRangeConflicts({minIP: 100, maxIP: 201}, ranges, true)); + assert.throws(() => IPTools.checkRangeConflicts({ minIP: 100, maxIP: 201 }, ranges, false)); + assert.doesNotThrow(() => IPTools.checkRangeConflicts({ minIP: 100, maxIP: 201 }, ranges, true)); // Widen both IPs - assert.throws(() => IPTools.checkRangeConflicts({minIP: 99, maxIP: 201}, ranges, false)); - assert.doesNotThrow(() => IPTools.checkRangeConflicts({minIP: 99, maxIP: 201}, ranges, true)); + assert.throws(() => IPTools.checkRangeConflicts({ minIP: 99, maxIP: 201 }, ranges, false)); + assert.doesNotThrow(() => IPTools.checkRangeConflicts({ minIP: 99, maxIP: 201 }, ranges, true)); // Don't widen at all - assert.doesNotThrow(() => IPTools.checkRangeConflicts({minIP: 98, maxIP: 99}, ranges, false)); - assert.doesNotThrow(() => IPTools.checkRangeConflicts({minIP: 98, maxIP: 99}, ranges, true)); + assert.doesNotThrow(() => IPTools.checkRangeConflicts({ minIP: 98, maxIP: 99 }, ranges, false)); + assert.doesNotThrow(() => IPTools.checkRangeConflicts({ minIP: 98, maxIP: 99 }, ranges, true)); }); }); diff --git a/test/server/ladders.js b/test/server/ladders.js index 659ec930e4..1cfff149bf 100644 --- a/test/server/ladders.js +++ b/test/server/ladders.js @@ -3,9 +3,9 @@ const assert = require('assert').strict; global.Ladders = require('../../dist/server/ladders').Ladders; -const {makeUser} = require('../users-utils'); +const { makeUser } = require('../users-utils'); -describe('Matchmaker', function () { +describe('Matchmaker', () => { const FORMATID = 'gen7ou'; const addSearch = (player, rating = 1000, formatid = FORMATID) => { const search = new Ladders.BattleReady(player.id, formatid, player.battleSettings, rating); @@ -19,7 +19,7 @@ describe('Matchmaker', function () { return null; }; - before(function () { + before(() => { clearInterval(Ladders.periodicMatchInterval); Ladders.periodicMatchInterval = null; }); @@ -108,7 +108,7 @@ describe('Matchmaker', function () { assert.equal(Ladders.searches.get(FORMATID).searches.size, 0); }); - describe('#startBattle', function () { + describe('#startBattle', () => { beforeEach(function () { this.s1 = addSearch(this.p1); this.s2 = addSearch(this.p2); @@ -126,8 +126,8 @@ describe('Matchmaker', function () { room = Rooms.createBattle({ format: FORMATID, players: [ - {user: this.p1, team: this.s1.team}, - {user: this.p1, team: this.s2.team}, + { user: this.p1, team: this.s1.team }, + { user: this.p1, team: this.s2.team }, ], rated: 1000, }); @@ -148,7 +148,7 @@ describe('Matchmaker', function () { it('should prevent battles from starting if the server is in lockdown', function () { const room = Rooms.createBattle({ format: FORMATID, - players: [{user: this.p1, team: this.s1.team}, {user: this.p2, team: this.s2.team}], + players: [{ user: this.p1, team: this.s1.team }, { user: this.p2, team: this.s2.team }], rated: 1000, }); assert.equal(room, null); diff --git a/test/server/modlog.js b/test/server/modlog.js index c368d45e4b..eb5b751a40 100644 --- a/test/server/modlog.js +++ b/test/server/modlog.js @@ -12,23 +12,23 @@ const assert = require('assert').strict; Config.usesqlitemodlog = true; const DATASET_A = [ - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'FIRST ENTRY', time: 1}, - {action: 'LOCK', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 2', time: 2}, - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 3', time: 3}, - {action: 'WEEKLOCK', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'this entry has many parts', time: 4}, - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 5', time: 5}, - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 6', time: 6}, - {action: 'MUTE', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 7', time: 7}, - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 8', time: 8}, - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'LAST ENTRY', time: 9}, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'FIRST ENTRY', time: 1 }, + { action: 'LOCK', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 2', time: 2 }, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 3', time: 3 }, + { action: 'WEEKLOCK', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'this entry has many parts', time: 4 }, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 5', time: 5 }, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 6', time: 6 }, + { action: 'MUTE', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 7', time: 7 }, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'ENTRY 8', time: 8 }, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika', note: 'LAST ENTRY', time: 9 }, ]; const DATASET_B = [ - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika'}, - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika'}, - {action: 'POLL', loggedBy: 'annika'}, - {action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika'}, - {action: 'TOUR START', loggedBy: 'annika'}, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika' }, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika' }, + { action: 'POLL', loggedBy: 'annika' }, + { action: 'ROOMBAN', userid: 'sometroll', ip: '127.0.0.1', loggedBy: 'annika' }, + { action: 'TOUR START', loggedBy: 'annika' }, ]; async function lastLine(database, roomid) { @@ -45,16 +45,16 @@ async function lastLine(database, roomid) { describe('Modlog#prepareSQLSearch', () => { it('should respect the maxLines parameter', async () => { - const query = modlog.prepareSQLSearch(['lobby'], 1337, false, {note: [], user: [], ip: [], action: [], actionTaker: []}); + const query = modlog.prepareSQLSearch(['lobby'], 1337, false, { note: [], user: [], ip: [], action: [], actionTaker: [] }); assert(query.queryText.endsWith('LIMIT ?')); assert(query.args.includes(1337)); - const noMaxLines = modlog.prepareSQLSearch(['lobby'], 0, false, {note: [], user: [], ip: [], action: [], actionTaker: []}); + const noMaxLines = modlog.prepareSQLSearch(['lobby'], 0, false, { note: [], user: [], ip: [], action: [], actionTaker: [] }); assert(!noMaxLines.queryText.includes('LIMIT')); }); it('should attempt to respect onlyPunishments', async () => { - const query = modlog.prepareSQLSearch(['lobby'], 0, true, {note: [], user: [], ip: [], action: [], actionTaker: []}); + const query = modlog.prepareSQLSearch(['lobby'], 0, true, { note: [], user: [], ip: [], action: [], actionTaker: [] }); assert(query.queryText.includes('action IN (')); assert(query.args.includes('WEEKLOCK')); }); @@ -73,8 +73,8 @@ async function lastLine(database, roomid) { describe('Modlog#write', () => { it('should write messages serially to the modlog', async () => { - await modlog.write('development', {note: 'This message is logged first', action: 'UNITTEST'}); - await modlog.write('development', {note: 'This message is logged second', action: 'UNITTEST'}); + await modlog.write('development', { note: 'This message is logged first', action: 'UNITTEST' }); + await modlog.write('development', { note: 'This message is logged second', action: 'UNITTEST' }); const lines = await modlog.database.all(await modlog.database.prepare( // Order by modlog_id since the writes most likely happen at the same second `SELECT * FROM modlog WHERE roomid = 'development' ORDER BY modlog_id DESC LIMIT 2` @@ -85,7 +85,7 @@ async function lastLine(database, roomid) { }); it('should use overrideID if specified', async () => { - await modlog.write('battle-gen8randombattle-1337', {note: "I'm testing overrideID", action: 'UNITTEST'}, 'heyadora'); + await modlog.write('battle-gen8randombattle-1337', { note: "I'm testing overrideID", action: 'UNITTEST' }, 'heyadora'); const line = await lastLine(modlog.database, 'battle-gen8randombattle-1337'); assert.equal(line.note, "I'm testing overrideID"); assert.equal(line.visual_roomid, 'heyadora'); @@ -94,7 +94,7 @@ async function lastLine(database, roomid) { describe("Modlog#rename", () => { it('should rename modlogs', async () => { - const entry = {note: 'This is in a modlog that will be renamed!', action: 'UNITTEST'}; + const entry = { note: 'This is in a modlog that will be renamed!', action: 'UNITTEST' }; await modlog.write('oldroom', entry); await modlog.rename('oldroom', 'newroom'); @@ -103,7 +103,7 @@ async function lastLine(database, roomid) { assert.equal(entry.action, line.action); assert.equal(entry.note, line.note); - const newEntry = {note: 'This modlog has been renamed!', action: 'UNITTEST'}; + const newEntry = { note: 'This modlog has been renamed!', action: 'UNITTEST' }; await modlog.write('newroom', newEntry); const newLine = await lastLine(modlog.database, 'newroom'); @@ -124,15 +124,15 @@ async function lastLine(database, roomid) { }); it('should be capable of reading the entire modlog file', async () => { - const results = await modlog.search('readingtest2', {note: [], user: [], ip: [], action: [], actionTaker: []}, 10000); + const results = await modlog.search('readingtest2', { note: [], user: [], ip: [], action: [], actionTaker: [] }, 10000); assert.equal(results.results.length, DATASET_B.length); }); it('user searches should be case-insensitive', async () => { - const notExactUpper = await modlog.search('readingtest', {user: [{search: 'sOmETRoll', isExact: false}], note: [], ip: [], action: [], actionTaker: []}); - const notExactLower = await modlog.search('readingtest', {user: [{search: 'sometroll', isExact: false}], note: [], ip: [], action: [], actionTaker: []}); - const exactUpper = await modlog.search('readingtest', {user: [{search: 'sOMEtroLL', isExact: true}], note: [], ip: [], action: [], actionTaker: []}); - const exactLower = await modlog.search('readingtest', {user: [{search: 'sometroll', isExact: true}], note: [], ip: [], action: [], actionTaker: []}); + const notExactUpper = await modlog.search('readingtest', { user: [{ search: 'sOmETRoll', isExact: false }], note: [], ip: [], action: [], actionTaker: [] }); + const notExactLower = await modlog.search('readingtest', { user: [{ search: 'sometroll', isExact: false }], note: [], ip: [], action: [], actionTaker: [] }); + const exactUpper = await modlog.search('readingtest', { user: [{ search: 'sOMEtroLL', isExact: true }], note: [], ip: [], action: [], actionTaker: [] }); + const exactLower = await modlog.search('readingtest', { user: [{ search: 'sometroll', isExact: true }], note: [], ip: [], action: [], actionTaker: [] }); assert.deepEqual(notExactUpper.results, notExactLower.results); assert.deepEqual(exactUpper.results, exactLower.results); @@ -141,16 +141,16 @@ async function lastLine(database, roomid) { // isExact is currently set up to search for the entire note equalling the search // this could be redesigned, but is what we currently test for. it('note searches should respect isExact', async () => { - const notExact = await modlog.search('readingtest', {note: [{search: 'has man', isExact: false}], user: [], ip: [], action: [], actionTaker: []}); - const exact = await modlog.search('readingtest', {note: [{search: 'has man', isExact: true}], user: [], ip: [], action: [], actionTaker: []}); + const notExact = await modlog.search('readingtest', { note: [{ search: 'has man', isExact: false }], user: [], ip: [], action: [], actionTaker: [] }); + const exact = await modlog.search('readingtest', { note: [{ search: 'has man', isExact: true }], user: [], ip: [], action: [], actionTaker: [] }); assert.equal(exact.results.length, 0); assert(notExact.results.length); }); it('should be LIFO (last-in, first-out)', async () => { - await modlog.write('lifotest', {note: 'firstwrite', action: 'UNITTEST', timestamp: 1}); - await modlog.write('lifotest', {note: 'secondwrite', action: 'UNITTEST', timestamp: 2}); + await modlog.write('lifotest', { note: 'firstwrite', action: 'UNITTEST', timestamp: 1 }); + await modlog.write('lifotest', { note: 'secondwrite', action: 'UNITTEST', timestamp: 2 }); const search = await modlog.search('lifotest'); // secondwrite was last in, so it should be first out (results[0]) @@ -164,7 +164,7 @@ async function lastLine(database, roomid) { it('should support limiting the number of responses', async () => { const unlimited = await modlog.search('readingtest'); - const limited = await modlog.search('readingtest', {note: [], user: [], ip: [], action: [], actionTaker: []}, 5); + const limited = await modlog.search('readingtest', { note: [], user: [], ip: [], action: [], actionTaker: [] }, 5); assert.equal(limited.results.length, 5); assert(unlimited.results.length > limited.results.length); @@ -180,8 +180,8 @@ async function lastLine(database, roomid) { }); it('should support filtering out non-punishment-related logs', async () => { - const all = (await modlog.search('readingtest2', {note: [], user: [], ip: [], action: [], actionTaker: []}, 20, false)).results; - const onlyPunishments = (await modlog.search('readingtest2', {note: [], user: [], ip: [], action: [], actionTaker: []}, 20, true)).results; + const all = (await modlog.search('readingtest2', { note: [], user: [], ip: [], action: [], actionTaker: [] }, 20, false)).results; + const onlyPunishments = (await modlog.search('readingtest2', { note: [], user: [], ip: [], action: [], actionTaker: [] }, 20, true)).results; assert(all.length > onlyPunishments.length); assert.equal( diff --git a/test/server/punishments.js b/test/server/punishments.js index f08a729303..b88a255434 100644 --- a/test/server/punishments.js +++ b/test/server/punishments.js @@ -6,49 +6,49 @@ * @author Annika */ const assert = require('../assert'); -const {makeUser, makeConnection} = require('../users-utils'); -const {Punishments} = require('../../dist/server/punishments'); +const { makeUser, makeConnection } = require('../users-utils'); +const { Punishments } = require('../../dist/server/punishments'); const TEST_PUNISHMENT_DURATION = 1000; // 1 second describe("Punishments", () => { it("Should properly sort punishments by weight", () => { const list = [ - {type: "LOCK", id: "User 1", expireTime: Date.now() + 1000, reason: ''}, - {type: "SEMILOCK", id: "User 2", expireTime: Date.now() + 1000, reason: ''}, - {type: "BAN", id: "", expireTime: Date.now() + 1000, reason: ''}, + { type: "LOCK", id: "User 1", expireTime: Date.now() + 1000, reason: '' }, + { type: "SEMILOCK", id: "User 2", expireTime: Date.now() + 1000, reason: '' }, + { type: "BAN", id: "", expireTime: Date.now() + 1000, reason: '' }, ]; Punishments.byWeight(list); assert.equal(list[0].type, 'BAN'); }); it("Should prevent a user from having two punishments of the same type", () => { - Punishments.userids.add('banmeplease', {type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: ''}); - Punishments.userids.add("banmeplease", {type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: 'ok'}); + Punishments.userids.add('banmeplease', { type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: '' }); + Punishments.userids.add("banmeplease", { type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: 'ok' }); assert.equal(Punishments.userids.get('banmeplease').length, 1); }); it("Should overwrite the old reason when a user receives two of the same punishment", () => { - Punishments.userids.add('banmeplease', {type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: ''}); - Punishments.userids.add("banmeplease", {type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: 'ok'}); + Punishments.userids.add('banmeplease', { type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: '' }); + Punishments.userids.add("banmeplease", { type: 'BAN', expireTime: Date.now() + 30 * 1000, id: 'banmeplease', reason: 'ok' }); assert.equal(Punishments.userids.getByType('banmeplease', 'BAN').reason, 'ok'); }); it("Should properly filter out expiring punishments", () => { - const punishments = [{type: 'BAN', expireTime: Date.now() - 1000, id: 'banmeplease', reason: ''}]; + const punishments = [{ type: 'BAN', expireTime: Date.now() - 1000, id: 'banmeplease', reason: '' }]; Punishments.userids.removeExpiring(punishments); assert.equal(punishments.length, 0); }); it("Should be able to remove only one punishment from the list by passing an object", () => { const [expireTime, reason, id] = [Date.now() + 1000, '', 'banmeplease']; - Punishments.userids.add(id, {type: 'BAN', expireTime, reason, id}); - Punishments.userids.add(id, {type: 'RICKROLL', expireTime, reason, id}); - Punishments.userids.deleteOne(id, {type: 'RICKROLL', expireTime, reason, id}); + Punishments.userids.add(id, { type: 'BAN', expireTime, reason, id }); + Punishments.userids.add(id, { type: 'RICKROLL', expireTime, reason, id }); + Punishments.userids.deleteOne(id, { type: 'RICKROLL', expireTime, reason, id }); assert.equal(Punishments.userids.get(id).length, 1); }); it('should properly search for IP punishments by type', () => { const [expireTime, reason, id] = [Date.now() + 1000, '', 'banmeplease']; - Punishments.ips.add('127.0.0.1', {type: 'BAN', expireTime, reason, id}); - Punishments.ips.add('127.0.0.1', {type: 'RICKROLL', expireTime, reason, id}); - Punishments.ips.add('127.0.*', {type: 'RANGEBAN', expireTime, reason, id}); + Punishments.ips.add('127.0.0.1', { type: 'BAN', expireTime, reason, id }); + Punishments.ips.add('127.0.0.1', { type: 'RICKROLL', expireTime, reason, id }); + Punishments.ips.add('127.0.*', { type: 'RANGEBAN', expireTime, reason, id }); const allIPPunishments = Punishments.ipSearch('127.0.0.1'); assert(Array.isArray(allIPPunishments)); diff --git a/test/server/room-battle.js b/test/server/room-battle.js index c6ca544765..773c2dd7e3 100644 --- a/test/server/room-battle.js +++ b/test/server/room-battle.js @@ -2,12 +2,12 @@ const assert = require('assert').strict; -const {makeUser} = require('../users-utils'); +const { makeUser } = require('../users-utils'); -describe('Simulator abstraction layer features', function () { - describe('Battle', function () { +describe('Simulator abstraction layer features', () => { + describe('Battle', () => { let p1, p2, room; - afterEach(function () { + afterEach(() => { if (p1) { p1.disconnectAll(); p1.destroy(); @@ -19,14 +19,14 @@ describe('Simulator abstraction layer features', function () { if (room) room.destroy(); }); - it('should not get players out of sync in rated battles on rename', function () { + it('should not get players out of sync in rated battles on rename', () => { // Regression test for 47263c8749 const packedTeam = 'Weavile||lifeorb||swordsdance,knockoff,iceshard,iciclecrash|Jolly|,252,,,4,252|||||'; p1 = makeUser("MissingNo."); p2 = makeUser(); room = Rooms.createBattle({ format: '', - players: [{user: p1, team: packedTeam}, {user: p2, team: packedTeam}], + players: [{ user: p1, team: packedTeam }, { user: p2, team: packedTeam }], allowRenames: false, }); assert(room.battle); @@ -37,8 +37,8 @@ describe('Simulator abstraction layer features', function () { }); }); - describe('BattleStream', function () { - it('should work (slow)', async function () { + describe('BattleStream', () => { + it('should work (slow)', async () => { Config.simulatorprocesses = 1; const PM = require('../../dist/server/room-battle').PM; assert.equal(PM.processes.length, 0); diff --git a/test/server/rooms.js b/test/server/rooms.js index 163ebcc011..881d05390a 100644 --- a/test/server/rooms.js +++ b/test/server/rooms.js @@ -2,25 +2,25 @@ const assert = require('assert').strict; -const {makeUser} = require('../users-utils'); +const { makeUser } = require('../users-utils'); -describe('Rooms features', function () { - describe('Rooms', function () { - describe('Rooms.get', function () { - it('should be a function', function () { +describe('Rooms features', () => { + describe('Rooms', () => { + describe('Rooms.get', () => { + it('should be a function', () => { assert.equal(typeof Rooms.get, 'function'); }); }); - describe('Rooms.rooms', function () { - it('should be a Map', function () { + describe('Rooms.rooms', () => { + it('should be a Map', () => { assert(Rooms.rooms instanceof Map); }); }); }); - describe('BasicRoom', function () { - describe('getGame', function () { - it('should return the game only when the gameids match', function () { + describe('BasicRoom', () => { + describe('getGame', () => { + it('should return the game only when the gameids match', () => { const Hangman = require('../../dist/server/chat-plugins/hangman').Hangman; const UNO = require('../../dist/server/chat-plugins/uno').UNO; const room = Rooms.createChatRoom('r/relationshipadvice'); @@ -32,12 +32,12 @@ describe('Rooms features', function () { }); }); - describe('GameRoom', function () { + describe('GameRoom', () => { const packedTeam = 'Weavile||lifeorb||swordsdance,knockoff,iceshard,iciclecrash|Jolly|,252,,,4,252|||||'; let room; let parent; - afterEach(function () { + afterEach(() => { for (const user of Users.users.values()) { user.disconnectAll(); user.destroy(); @@ -46,21 +46,21 @@ describe('Rooms features', function () { if (parent) parent.destroy(); }); - it('should allow two users to join the battle', function () { + it('should allow two users to join the battle', () => { const p1 = makeUser(); const p2 = makeUser(); const options = [ - {rated: false, tour: false}, - {rated: false, tour: {onBattleWin() {}}}, - {rated: true, tour: false}, - {rated: true, tour: {onBattleWin() {}}}, + { rated: false, tour: false }, + { rated: false, tour: { onBattleWin() {} } }, + { rated: true, tour: false }, + { rated: true, tour: { onBattleWin() {} } }, ]; for (const option of options) { room = Rooms.createBattle({ format: 'customgame', players: [ - {user: p1, team: packedTeam}, - {user: p2, team: packedTeam}, + { user: p1, team: packedTeam }, + { user: p2, team: packedTeam }, ], ...option, }); @@ -68,7 +68,7 @@ describe('Rooms features', function () { } }); - it('should copy auth from tournament', function () { + it('should copy auth from tournament', () => { parent = Rooms.createChatRoom('parentroom'); parent.auth.get = () => '%'; const p1 = makeUser(); @@ -76,8 +76,8 @@ describe('Rooms features', function () { room = Rooms.createBattle({ format: 'customgame', players: [ - {user: p1, team: packedTeam}, - {user: p2, team: packedTeam}, + { user: p1, team: packedTeam }, + { user: p2, team: packedTeam }, ], rated: false, auth: {}, @@ -89,7 +89,7 @@ describe('Rooms features', function () { assert.equal(room.auth.get(makeUser().id), '%'); }); - it('should prevent overriding tournament room auth by a tournament player', function () { + it('should prevent overriding tournament room auth by a tournament player', () => { parent = Rooms.createChatRoom('parentroom2'); parent.auth.get = () => '%'; const p1 = makeUser(); @@ -100,8 +100,8 @@ describe('Rooms features', function () { room = Rooms.createBattle({ format: 'customgame', players: [ - {user: p1, team: packedTeam}, - {user: p2, team: packedTeam}, + { user: p1, team: packedTeam }, + { user: p2, team: packedTeam }, ], rated: false, auth: {}, @@ -120,12 +120,12 @@ describe('Rooms features', function () { }); }); - describe("ChatRoom", function () { - describe("#rename", function () { + describe("ChatRoom", () => { + describe("#rename", () => { let room; let parent; let subroom; - afterEach(function () { + afterEach(() => { for (const user of Users.users.values()) { user.disconnectAll(); user.destroy(); @@ -137,21 +137,21 @@ describe('Rooms features', function () { } } }); - it("should rename its roomid and title", async function () { + it("should rename its roomid and title", async () => { room = Rooms.createChatRoom("test", "Test"); await room.rename("Test2"); assert.equal(room.roomid, "test2"); assert.equal(room.title, "Test2"); }); - it("should rename its key in Rooms.rooms", async function () { + it("should rename its key in Rooms.rooms", async () => { room = Rooms.createChatRoom("test", "Test"); await room.rename("Test2"); assert.equal(Rooms.rooms.has("test"), false); assert.equal(Rooms.rooms.has("test2"), true); }); - it("should move the users and their connections", async function () { + it("should move the users and their connections", async () => { room = Rooms.createChatRoom("test", "Test"); const user = makeUser(); user.joinRoom(room); @@ -162,17 +162,17 @@ describe('Rooms features', function () { assert.equal(user.connections[0].inRooms.has("test2"), true); }); - it("should rename their parents subroom reference", async function () { + it("should rename their parents subroom reference", async () => { parent = Rooms.createChatRoom("parent", "Parent"); - subroom = Rooms.createChatRoom("subroom", "Subroom", {parentid: "parent"}); + subroom = Rooms.createChatRoom("subroom", "Subroom", { parentid: "parent" }); await subroom.rename("TheSubroom"); assert.equal(parent.subRooms.has("subroom"), false); assert.equal(parent.subRooms.has("thesubroom"), true); }); - it("should rename their subrooms parent reference", async function () { + it("should rename their subrooms parent reference", async () => { parent = Rooms.createChatRoom("parent", "Parent"); - subroom = Rooms.createChatRoom("subroom", "Subroom", {parentid: "parent"}); + subroom = Rooms.createChatRoom("subroom", "Subroom", { parentid: "parent" }); await parent.rename("TheParent"); assert.equal(subroom.parent, parent); }); diff --git a/test/server/sockets.js b/test/server/sockets.js index a502185c2c..232c0e51ae 100644 --- a/test/server/sockets.js +++ b/test/server/sockets.js @@ -1,9 +1,9 @@ 'use strict'; const assert = require('../assert'); -const {extractChannelMessages} = require('../../dist/sim/battle'); +const { extractChannelMessages } = require('../../dist/sim/battle'); -describe('ServerStream', function () { +describe('ServerStream', () => { const omniscientPlayer = -1; const spectatorPlayer = 0; @@ -13,8 +13,8 @@ describe('ServerStream', function () { shared, ]); - describe('extractChannel', function () { - it('should return the same messages if no privileged messages are within it', function () { + describe('extractChannel', () => { + it('should return the same messages if no privileged messages are within it', () => { const messages = [ '|-start|p1a: Hellfrog|ability: Flash Fire', '|-start|p2a: Hellfrog|ability: Flash Fire', @@ -26,7 +26,7 @@ describe('ServerStream', function () { assert.equal(actualChannelMessages[omniscientPlayer].join('\n'), messages); }); - it('should return all privileged messages for an omniscient player', function () { + it('should return all privileged messages for an omniscient player', () => { const messages = [ ...createSplit(1, '|-start|p1a: Aerodactyl|ability: Pressure', ''), ...createSplit(2, '|-start|p2a: Aerodactyl|ability: Pressure', ''), @@ -45,7 +45,7 @@ describe('ServerStream', function () { assert.equal(actualChannelMessages[omniscientPlayer].join('\n'), expectedMessages); }); - it('should return player-privileged messages for each player', function () { + it('should return player-privileged messages for each player', () => { const expectedMessages = [ ...createSplit(1, '|-start|p1a: Aerodactyl|ability: Pressure', ''), ...createSplit(2, '|-start|p2a: Aerodactyl|ability: Pressure', ''), @@ -65,7 +65,7 @@ describe('ServerStream', function () { assert.equal(actualChannelMessages[spectatorPlayer].join('\n'), ''); }); - it('should return privileged messages with non-privileged messages', function () { + it('should return privileged messages with non-privileged messages', () => { const messages = [ '|-start|p2b: Hellfrog|ability: Flash Fire', ...createSplit(1, '|-start|p1a: Aerodactyl|ability: Pressure', ''), @@ -101,7 +101,7 @@ describe('ServerStream', function () { assert.equal(actualChannelMessages[spectatorPlayer].join('\n'), expectedSpectatorMessages); }); - it('should return consecutive player-privileged messages for a player', function () { + it('should return consecutive player-privileged messages for a player', () => { const messages = [ ...createSplit(1, '|-start|p1a: Aerodactyl|ability: Pressure', ''), ...createSplit(1, '|-start|p1b: Aerodactyl|ability: Pressure', ''), @@ -120,7 +120,7 @@ describe('ServerStream', function () { assert.equal(actualChannelMessages[spectatorPlayer].join('\n'), ''); }); - it('should return shared messages for non-privileged players', function () { + it('should return shared messages for non-privileged players', () => { const messages = [ ...createSplit(1, '|-heal|p1a: Rhyperior|420/420', '|-heal|p1a: Rhyperior|100/100'), ...createSplit(2, '|-heal|p2a: Rhyperior|420/420', '|-heal|p2a: Rhyperior|100/100'), @@ -158,7 +158,7 @@ describe('ServerStream', function () { assert.equal(actualChannelMessages[spectatorPlayer].join('\n'), expectedSpectatorMessages); }); - it('should return messages made up of secret and shared messages', function () { + it('should return messages made up of secret and shared messages', () => { const messages = [ ...createSplit(1, '|-heal|p1a: Rhyperior|420/420', '|-heal|p1a: Rhyperior|100/100'), ...createSplit(1, '|-start|p1a: Aerodactyl|ability: Pressure', ''), @@ -194,7 +194,7 @@ describe('ServerStream', function () { assert.equal(actualChannelMessages[spectatorPlayer].join('\n'), expectedSpectatorMessages); }); - it('should not extract channel messages for unspecified channels', function () { + it('should not extract channel messages for unspecified channels', () => { const messages = [ ...createSplit(1, '|-heal|p1a: Rhyperior|420/420', '|-heal|p1a: Rhyperior|100/100'), ...createSplit(2, '|-heal|p2a: Rhyperior|420/420', '|-heal|p2a: Rhyperior|100/100'), diff --git a/test/server/users.js b/test/server/users.js index 05dc4c019c..8bb3b3d365 100644 --- a/test/server/users.js +++ b/test/server/users.js @@ -2,27 +2,27 @@ const assert = require('assert').strict; -const {makeUser, makeConnection} = require('../users-utils'); +const { makeUser, makeConnection } = require('../users-utils'); -describe('Users features', function () { - describe('Users', function () { - describe('get', function () { - it('should be a function', function () { +describe('Users features', () => { + describe('Users', () => { + describe('get', () => { + it('should be a function', () => { assert.equal(typeof Users.get, 'function'); }); }); - describe('connections', function () { - it('should be a Map', function () { + describe('connections', () => { + it('should be a Map', () => { assert(Users.connections instanceof Map); }); }); - describe('users', function () { - it('should be a Map', function () { + describe('users', () => { + it('should be a Map', () => { assert(Users.users instanceof Map); }); }); - describe('Connection', function () { - describe('#onDisconnect', function () { + describe('Connection', () => { + describe('#onDisconnect', () => { beforeEach(function () { this.connection = makeConnection('127.0.0.1'); }); @@ -43,27 +43,27 @@ describe('Users features', function () { }); }); - describe('#joinRoom', function () { + describe('#joinRoom', () => { let room, connection; - beforeEach(function () { + beforeEach(() => { connection = makeConnection('127.0.0.1'); }); - afterEach(function () { + afterEach(() => { connection.destroy(); if (room) room.destroy(); }); - it('should join a room if not already present', function () { + it('should join a room if not already present', () => { room = Rooms.createChatRoom('test'); connection.joinRoom(Rooms.get('test')); assert(connection.inRooms.has('test')); }); }); - describe('#leaveRoom', function () { + describe('#leaveRoom', () => { let room; - afterEach(function () { + afterEach(() => { if (room) room.destroy(); }); it('should leave a room that is present', function () { @@ -75,7 +75,7 @@ describe('Users features', function () { }); }); }); - describe('User', function () { + describe('User', () => { it('should store IP addresses after disconnect', () => { const conn = makeConnection('127.0.0.1'); const user = makeUser('', conn); @@ -84,9 +84,9 @@ describe('Users features', function () { assert.deepEqual(['127.0.0.1'], user.ips); }); - describe('#disconnectAll', function () { + describe('#disconnectAll', () => { for (const totalConnections of [1, 2]) { - it('should drop all ' + totalConnections + ' connection(s) and mark as inactive', function () { + it('should drop all ' + totalConnections + ' connection(s) and mark as inactive', () => { const user = makeUser(); let iterations = totalConnections; while (--iterations) user.mergeConnection(makeConnection()); @@ -96,7 +96,7 @@ describe('Users features', function () { assert.equal(user.connected, false); }); - it('should unref all ' + totalConnections + ' connection(s)', function () { + it('should unref all ' + totalConnections + ' connection(s)', () => { const user = makeUser(); let iterations = totalConnections; while (--iterations) user.mergeConnection(makeConnection()); @@ -109,7 +109,7 @@ describe('Users features', function () { } }); - it('should clear `user` property for all ' + totalConnections + ' connection(s)', function () { + it('should clear `user` property for all ' + totalConnections + ' connection(s)', () => { const user = makeUser(); let iterations = totalConnections; while (--iterations) user.mergeConnection(makeConnection()); @@ -122,14 +122,14 @@ describe('Users features', function () { }); } }); - describe('#ban (network) (slow)', function () { - afterEach(function () { + describe('#ban (network) (slow)', () => { + afterEach(() => { for (const ip in Users.bannedIps) { delete Users.bannedIps[ip]; } }); - it('should disconnect every user at that IP', async function () { + it('should disconnect every user at that IP', async () => { Punishments.sharedIps = new Map(); const user1 = makeUser('', '192.168.1.1'); const user2 = makeUser('', '192.168.1.1'); @@ -138,7 +138,7 @@ describe('Users features', function () { assert.equal(user2.connected, false); }); - it('should not disconnect users at other IPs', async function () { + it('should not disconnect users at other IPs', async () => { const user1 = makeUser('', '192.168.1.1'); const user2 = makeUser('', '192.168.1.2'); await Punishments.ban(user1); @@ -146,9 +146,9 @@ describe('Users features', function () { }); }); - describe('#can', function () { + describe('#can', () => { let room; - afterEach(function () { + afterEach(() => { for (const user of Users.users.values()) { user.disconnectAll(); user.destroy(); @@ -157,7 +157,7 @@ describe('Users features', function () { if (room) room.destroy(); } }); - it(`should allow 'u' permissions on lower ranked users`, function () { + it(`should allow 'u' permissions on lower ranked users`, () => { const user = makeUser(); user.tempGroup = '@'; assert.equal(user.can('globalban', user), false, 'targeting self'); @@ -170,7 +170,7 @@ describe('Users features', function () { target.tempGroup = '~'; assert.equal(user.can('globalban', target), false, 'targeting higher rank'); }); - it(`should not allow users to demote themselves`, function () { + it(`should not allow users to demote themselves`, () => { room = Rooms.createChatRoom("test"); const user = makeUser("User"); user.joinRoom(room); diff --git a/test/sim/abilities/aftermath.js b/test/sim/abilities/aftermath.js index b692b11842..c55958177c 100644 --- a/test/sim/abilities/aftermath.js +++ b/test/sim/abilities/aftermath.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Aftermath', function () { - afterEach(function () { +describe('Aftermath', () => { + afterEach(() => { battle.destroy(); }); - it("should hurt attackers by 1/4 their max HP when this Pokemon is KOed by a contact move", function () { + it("should hurt attackers by 1/4 their max HP when this Pokemon is KOed by a contact move", () => { battle = common.createBattle([[ - {species: 'galvantula', moves: ['lunge']}, + { species: 'galvantula', moves: ['lunge'] }, ], [ - {species: 'shiftry', ability: 'aftermath', moves: ['sleeptalk']}, + { species: 'shiftry', ability: 'aftermath', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const attacker = battle.p1.active[0]; diff --git a/test/sim/abilities/angerpoint.js b/test/sim/abilities/angerpoint.js index 60ab928a0b..547399f83c 100644 --- a/test/sim/abilities/angerpoint.js +++ b/test/sim/abilities/angerpoint.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Anger Point', function () { - afterEach(function () { +describe('Anger Point', () => { + afterEach(() => { battle.destroy(); }); - it('should maximize Attack when hit by a critical hit', function () { + it('should maximize Attack when hit by a critical hit', () => { battle = common.createBattle([[ - {species: "Cryogonal", ability: 'noguard', moves: ['frostbreath']}, + { species: "Cryogonal", ability: 'noguard', moves: ['frostbreath'] }, ], [ - {species: "Primeape", ability: 'angerpoint', moves: ['endure']}, + { species: "Primeape", ability: 'angerpoint', moves: ['endure'] }, ]]); const angerMon = battle.p2.active[0]; @@ -22,11 +22,11 @@ describe('Anger Point', function () { assert.statStage(angerMon, 'atk', 6); }); - it('should maximize Attack when hit by a critical hit even if the foe has Mold Breaker', function () { + it('should maximize Attack when hit by a critical hit even if the foe has Mold Breaker', () => { battle = common.createBattle([[ - {species: "Haxorus", ability: 'moldbreaker', item: 'scopelens', moves: ['focusenergy', 'falseswipe']}, + { species: "Haxorus", ability: 'moldbreaker', item: 'scopelens', moves: ['focusenergy', 'falseswipe'] }, ], [ - {species: "Primeape", ability: 'angerpoint', moves: ['defensecurl']}, + { species: "Primeape", ability: 'angerpoint', moves: ['defensecurl'] }, ]]); const angerMon = battle.p2.active[0]; @@ -35,11 +35,11 @@ describe('Anger Point', function () { assert.statStage(angerMon, 'atk', 6); }); - it('should not maximize Attack when dealing a critical hit', function () { + it('should not maximize Attack when dealing a critical hit', () => { battle = common.createBattle([[ - {species: "Cryogonal", ability: 'noguard', moves: ['endure']}, + { species: "Cryogonal", ability: 'noguard', moves: ['endure'] }, ], [ - {species: "Primeape", ability: 'angerpoint', moves: ['stormthrow']}, + { species: "Primeape", ability: 'angerpoint', moves: ['stormthrow'] }, ]]); const [defender, angerMon] = [battle.p1.active[0], battle.p2.active[0]]; @@ -48,11 +48,11 @@ describe('Anger Point', function () { assert.statStage(angerMon, 'atk', 0); }); - it('should not maximize Attack when behind a substitute', function () { + it('should not maximize Attack when behind a substitute', () => { battle = common.createBattle([[ - {species: "Cryogonal", ability: 'noguard', item: 'laggingtail', moves: ['frostbreath']}, + { species: "Cryogonal", ability: 'noguard', item: 'laggingtail', moves: ['frostbreath'] }, ], [ - {species: "Primeape", ability: 'angerpoint', moves: ['substitute']}, + { species: "Primeape", ability: 'angerpoint', moves: ['substitute'] }, ]]); const angerMon = battle.p2.active[0]; diff --git a/test/sim/abilities/arenatrap.js b/test/sim/abilities/arenatrap.js index 2714923311..b4f129ce6e 100644 --- a/test/sim/abilities/arenatrap.js +++ b/test/sim/abilities/arenatrap.js @@ -5,22 +5,22 @@ const common = require('./../../common'); let battle; -describe('Arena Trap', function () { - afterEach(function () { +describe('Arena Trap', () => { + afterEach(() => { battle.destroy(); }); it('should prevent grounded Pokemon that are not immune to trapping from switching out normally', function () { this.timeout(0); battle = common.createBattle([[ - {species: "Dugtrio", ability: 'arenatrap', moves: ['snore', 'telekinesis', 'gravity']}, + { species: "Dugtrio", ability: 'arenatrap', moves: ['snore', 'telekinesis', 'gravity'] }, ], [ - {species: "Tornadus", ability: 'defiant', moves: ['tailwind']}, - {species: "Heatran", ability: 'flashfire', item: 'airballoon', moves: ['roar']}, - {species: "Claydol", ability: 'levitate', moves: ['rest']}, - {species: "Dusknoir", ability: 'frisk', moves: ['rest']}, - {species: "Magnezone", ability: 'magnetpull', moves: ['magnetrise']}, - {species: "Vaporeon", ability: 'waterabsorb', moves: ['roar']}, + { species: "Tornadus", ability: 'defiant', moves: ['tailwind'] }, + { species: "Heatran", ability: 'flashfire', item: 'airballoon', moves: ['roar'] }, + { species: "Claydol", ability: 'levitate', moves: ['rest'] }, + { species: "Dusknoir", ability: 'frisk', moves: ['rest'] }, + { species: "Magnezone", ability: 'magnetpull', moves: ['magnetrise'] }, + { species: "Vaporeon", ability: 'waterabsorb', moves: ['roar'] }, ]]); const p2active = battle.p2.active; battle.makeChoices('move snore', 'switch 2'); diff --git a/test/sim/abilities/asone.js b/test/sim/abilities/asone.js index 80d0084e85..073607f80a 100644 --- a/test/sim/abilities/asone.js +++ b/test/sim/abilities/asone.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe(`As One`, function () { - afterEach(function () { +describe(`As One`, () => { + afterEach(() => { battle.destroy(); }); - it(`should work if the user is Transformed`, function () { + it(`should work if the user is Transformed`, () => { battle = common.createBattle([[ - {species: 'ditto', ability: 'imposter', moves: ['transform']}, + { species: 'ditto', ability: 'imposter', moves: ['transform'] }, ], [ - {species: 'calyrexshadow', ability: 'asonespectrier', item: 'cheriberry', moves: ['glare', 'sleeptalk', 'astralbarrage']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'calyrexshadow', ability: 'asonespectrier', item: 'cheriberry', moves: ['glare', 'sleeptalk', 'astralbarrage'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); const ditto = battle.p1.active[0]; diff --git a/test/sim/abilities/battlearmor.js b/test/sim/abilities/battlearmor.js index 44388b0c04..1a808fa927 100644 --- a/test/sim/abilities/battlearmor.js +++ b/test/sim/abilities/battlearmor.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Battle Armor', function () { - afterEach(function () { +describe('Battle Armor', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent moves from dealing critical hits', function () { + it('should prevent moves from dealing critical hits', () => { battle = common.createBattle([ - [{species: 'Slowbro', ability: 'battlearmor', moves: ['quickattack']}], - [{species: 'Cryogonal', ability: 'noguard', moves: ['frostbreath']}], + [{ species: 'Slowbro', ability: 'battlearmor', moves: ['quickattack'] }], + [{ species: 'Cryogonal', ability: 'noguard', moves: ['frostbreath'] }], ]); let successfulEvent = false; - battle.onEvent('ModifyDamage', battle.format, function (damage, attacker, defender, move) { + battle.onEvent('ModifyDamage', battle.format, (damage, attacker, defender, move) => { if (move.id === 'frostbreath') { successfulEvent = true; assert(!defender.getMoveHitData(move).crit); @@ -26,14 +26,14 @@ describe('Battle Armor', function () { assert(successfulEvent); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle([ - [{species: 'Slowbro', ability: 'battlearmor', moves: ['quickattack']}], - [{species: 'Cryogonal', ability: 'moldbreaker', item: 'zoomlens', moves: ['frostbreath']}], + [{ species: 'Slowbro', ability: 'battlearmor', moves: ['quickattack'] }], + [{ species: 'Cryogonal', ability: 'moldbreaker', item: 'zoomlens', moves: ['frostbreath'] }], ]); battle.makeChoices('move quickattack', 'move frostbreath'); let successfulEvent = false; - battle.onEvent('ModifyDamage', battle.format, function (damage, attacker, defender, move) { + battle.onEvent('ModifyDamage', battle.format, (damage, attacker, defender, move) => { if (move.id === 'frostbreath') { successfulEvent = true; assert(defender.getMoveHitData(move).crit); diff --git a/test/sim/abilities/berserk.js b/test/sim/abilities/berserk.js index c722bc3e1c..63602544ca 100644 --- a/test/sim/abilities/berserk.js +++ b/test/sim/abilities/berserk.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Berserk', function () { - afterEach(function () { +describe('Berserk', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate prior to healing from Sitrus Berry`, function () { + it(`should activate prior to healing from Sitrus Berry`, () => { battle = common.createBattle([[ - {species: 'drampa', item: 'sitrusberry', ability: 'berserk', evs: {hp: 4}, moves: ['sleeptalk']}, + { species: 'drampa', item: 'sitrusberry', ability: 'berserk', evs: { hp: 4 }, moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'compoundeyes', moves: ['superfang']}, + { species: 'wynaut', ability: 'compoundeyes', moves: ['superfang'] }, ]]); battle.makeChoices(); @@ -23,11 +23,11 @@ describe('Berserk', function () { assert.equal(drampa.hp, Math.floor(drampa.maxhp / 2) + Math.floor(drampa.maxhp / 4)); }); - it(`should not activate prior to healing from Sitrus Berry after a multi-hit move`, function () { + it(`should not activate prior to healing from Sitrus Berry after a multi-hit move`, () => { battle = common.createBattle([[ - {species: 'drampa', item: 'sitrusberry', ability: 'berserk', evs: {hp: 4}, moves: ['sleeptalk']}, + { species: 'drampa', item: 'sitrusberry', ability: 'berserk', evs: { hp: 4 }, moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'parentalbond', moves: ['seismictoss']}, + { species: 'wynaut', ability: 'parentalbond', moves: ['seismictoss'] }, ]]); battle.makeChoices(); @@ -36,13 +36,13 @@ describe('Berserk', function () { assert.equal(drampa.hp, drampa.maxhp - 200 + Math.floor(drampa.maxhp / 4)); }); - it(`should not activate below 50% HP if it was damaged by Dragon Darts`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'drampa', ability: 'berserk', evs: {hp: 4}, moves: ['sleeptalk']}, - {species: 'togedemaru', ability: 'compoundeyes', moves: ['superfang']}, + it(`should not activate below 50% HP if it was damaged by Dragon Darts`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'drampa', ability: 'berserk', evs: { hp: 4 }, moves: ['sleeptalk'] }, + { species: 'togedemaru', ability: 'compoundeyes', moves: ['superfang'] }, ], [ - {species: 'wynaut', moves: ['dragondarts']}, - {species: 'shuckle', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['dragondarts'] }, + { species: 'shuckle', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk, move superfang -1', 'auto'); diff --git a/test/sim/abilities/cheekpouch.js b/test/sim/abilities/cheekpouch.js index c47ed6d3d5..4b769e0813 100644 --- a/test/sim/abilities/cheekpouch.js +++ b/test/sim/abilities/cheekpouch.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe(`Cheek Pouch`, function () { - afterEach(function () { +describe(`Cheek Pouch`, () => { + afterEach(() => { battle.destroy(); }); - it(`should restore 1/3 HP to the user after eating a Berry`, function () { + it(`should restore 1/3 HP to the user after eating a Berry`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'lumberry', ability: 'cheekpouch', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'lumberry', ability: 'cheekpouch', moves: ['sleeptalk'] }, ], [ - {species: 'pichu', moves: ['nuzzle']}, + { species: 'pichu', moves: ['nuzzle'] }, ]]); const wynaut = battle.p1.active[0]; battle.makeChoices(); assert.fullHP(wynaut); }); - it(`should not activate if the user was at full HP`, function () { + it(`should not activate if the user was at full HP`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'lumberry', ability: 'cheekpouch', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'lumberry', ability: 'cheekpouch', moves: ['sleeptalk'] }, ], [ - {species: 'pichu', moves: ['glare']}, + { species: 'pichu', moves: ['glare'] }, ]]); battle.makeChoices(); assert(battle.log.every(line => !line.startsWith('|-heal'))); diff --git a/test/sim/abilities/clearbody.js b/test/sim/abilities/clearbody.js index 8cc112e319..1d40449e31 100644 --- a/test/sim/abilities/clearbody.js +++ b/test/sim/abilities/clearbody.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Clear Body', function () { - afterEach(function () { +describe('Clear Body', () => { + afterEach(() => { battle.destroy(); }); - it('should negate stat drops from opposing effects', function () { + it('should negate stat drops from opposing effects', () => { battle = common.createBattle([[ - {species: 'Tentacruel', ability: 'clearbody', moves: ['recover']}, + { species: 'Tentacruel', ability: 'clearbody', moves: ['recover'] }, ], [ - {species: 'Arbok', ability: 'intimidate', moves: ['acidspray', 'leer', 'scaryface', 'charm', 'confide']}, + { species: 'Arbok', ability: 'intimidate', moves: ['acidspray', 'leer', 'scaryface', 'charm', 'confide'] }, ]]); const stats = ['spd', 'def', 'spe', 'atk', 'spa']; @@ -27,32 +27,32 @@ describe('Clear Body', function () { } }); - it('should not negate stat drops from the user\'s moves', function () { + it('should not negate stat drops from the user\'s moves', () => { battle = common.createBattle([[ - {species: 'Tentacruel', ability: 'clearbody', moves: ['superpower']}, + { species: 'Tentacruel', ability: 'clearbody', moves: ['superpower'] }, ], [ - {species: 'Arbok', ability: 'unnerve', moves: ['coil']}, + { species: 'Arbok', ability: 'unnerve', moves: ['coil'] }, ]]); battle.makeChoices('move Superpower', 'move Coil'); assert.statStage(battle.p1.active[0], 'atk', -1); assert.statStage(battle.p1.active[0], 'def', -1); }); - it('should not negate stat boosts from opposing moves', function () { + it('should not negate stat boosts from opposing moves', () => { battle = common.createBattle([[ - {species: 'Tentacruel', ability: 'clearbody', moves: ['shadowsneak']}, + { species: 'Tentacruel', ability: 'clearbody', moves: ['shadowsneak'] }, ], [ - {species: 'Arbok', ability: 'unnerve', moves: ['swagger']}, + { species: 'Arbok', ability: 'unnerve', moves: ['swagger'] }, ]]); battle.makeChoices('move Shadowsneak', 'move Swagger'); assert.statStage(battle.p1.active[0], 'atk', 2); }); - it('should not negate absolute stat changes', function () { + it('should not negate absolute stat changes', () => { battle = common.createBattle([[ - {species: 'Tentacruel', ability: 'clearbody', moves: ['coil']}, + { species: 'Tentacruel', ability: 'clearbody', moves: ['coil'] }, ], [ - {species: 'Arbok', ability: 'unnerve', moves: ['topsyturvy']}, + { species: 'Arbok', ability: 'unnerve', moves: ['topsyturvy'] }, ]]); battle.makeChoices('move Coil', 'move Topsyturvy'); assert.statStage(battle.p1.active[0], 'atk', -1); @@ -60,22 +60,22 @@ describe('Clear Body', function () { assert.statStage(battle.p1.active[0], 'accuracy', -1); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle([[ - {species: 'Tentacruel', ability: 'clearbody', moves: ['recover']}, + { species: 'Tentacruel', ability: 'clearbody', moves: ['recover'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['growl']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['growl'] }, ]]); battle.makeChoices('move Recover', 'move Growl'); assert.statStage(battle.p1.active[0], 'atk', -1); }); - it('should be suppressed by Mold Breaker if it is forced out by a move', function () { + it('should be suppressed by Mold Breaker if it is forced out by a move', () => { battle = common.createBattle([[ - {species: 'Metagross', ability: 'clearbody', moves: ['sleeptalk']}, - {species: 'Metagross', ability: 'clearbody', moves: ['sleeptalk']}, + { species: 'Metagross', ability: 'clearbody', moves: ['sleeptalk'] }, + { species: 'Metagross', ability: 'clearbody', moves: ['sleeptalk'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['roar', 'stickyweb']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['roar', 'stickyweb'] }, ]]); battle.makeChoices('move Sleeptalk', 'move Stickyweb'); battle.makeChoices('move Sleeptalk', 'move Roar'); @@ -83,11 +83,11 @@ describe('Clear Body', function () { assert.statStage(battle.p1.active[0], 'spe', -1); }); - it('should not take priority over a stat being at -6', function () { + it('should not take priority over a stat being at -6', () => { battle = common.createBattle([[ - {species: 'Dragapult', ability: 'clearbody', moves: ['bellydrum', 'sleeptalk']}, + { species: 'Dragapult', ability: 'clearbody', moves: ['bellydrum', 'sleeptalk'] }, ], [ - {species: 'Malamar', moves: ['topsyturvy', 'growl']}, + { species: 'Malamar', moves: ['topsyturvy', 'growl'] }, ]]); battle.makeChoices(); battle.makeChoices('move sleeptalk', 'move growl'); diff --git a/test/sim/abilities/cloudnine.js b/test/sim/abilities/cloudnine.js index 3c4c5d6cfa..c14c31a332 100644 --- a/test/sim/abilities/cloudnine.js +++ b/test/sim/abilities/cloudnine.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Cloud Nine', function () { - afterEach(function () { +describe('Cloud Nine', () => { + afterEach(() => { battle.destroy(); }); - it('should treat the weather as none for the purposes of formes, moves and abilities', function () { + it('should treat the weather as none for the purposes of formes, moves and abilities', () => { battle = common.createBattle([[ - {species: 'Golduck', ability: 'cloudnine', moves: ['sunnyday']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['sunnyday'] }, ], [ - {species: 'Cherrim', ability: 'flowergift', item: 'laggingtail', moves: ['solarbeam']}, + { species: 'Cherrim', ability: 'flowergift', item: 'laggingtail', moves: ['solarbeam'] }, ]]); const [weatherSuppressor, weatherUser] = [battle.p1.active[0], battle.p2.active[0]]; assert.false.hurts(weatherSuppressor, () => battle.makeChoices('move sunnyday', 'move solarbeam')); // Solar Beam must charge @@ -22,11 +22,11 @@ describe('Cloud Nine', function () { assert.species(weatherUser, 'Cherrim'); }); - it('should negate the effects of Sun on Fire-type and Water-type attacks', function () { + it('should negate the effects of Sun on Fire-type and Water-type attacks', () => { battle = common.createBattle([[ - {species: 'Groudon', ability: 'drought', moves: ['rest']}, + { species: 'Groudon', ability: 'drought', moves: ['rest'] }, ], [ - {species: 'Golduck', ability: 'cloudnine', moves: ['calmmind']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['calmmind'] }, ]]); let move, basePower; battle.makeChoices('move rest', 'move calmmind'); @@ -38,11 +38,11 @@ describe('Cloud Nine', function () { assert.equal(basePower, move.basePower); }); - it('should negate the effects of Rain on Fire-type and Water-type attacks', function () { + it('should negate the effects of Rain on Fire-type and Water-type attacks', () => { battle = common.createBattle([[ - {species: 'Kyogre', ability: 'drizzle', moves: ['rest']}, + { species: 'Kyogre', ability: 'drizzle', moves: ['rest'] }, ], [ - {species: 'Golduck', ability: 'cloudnine', moves: ['calmmind']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['calmmind'] }, ]]); let move, basePower; battle.makeChoices('move rest', 'move calmmind'); @@ -54,56 +54,56 @@ describe('Cloud Nine', function () { assert.equal(basePower, move.basePower); }); - it('should negate the damage-dealing effects of Sandstorm', function () { + it('should negate the damage-dealing effects of Sandstorm', () => { battle = common.createBattle([[ - {species: 'Tyranitar', ability: 'sandstream', moves: ['dragondance']}, + { species: 'Tyranitar', ability: 'sandstream', moves: ['dragondance'] }, ], [ - {species: 'Golduck', ability: 'cloudnine', moves: ['calmmind']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['calmmind'] }, ]]); assert.false.hurts(battle.p2.active[0], () => battle.makeChoices('move dragondance', 'move calmmind')); }); - it('should negate the damage-dealing effects of Hail', function () { + it('should negate the damage-dealing effects of Hail', () => { battle = common.createBattle([[ - {species: 'Abomasnow', ability: 'snowwarning', moves: ['rest']}, + { species: 'Abomasnow', ability: 'snowwarning', moves: ['rest'] }, ], [ - {species: 'Golduck', ability: 'cloudnine', moves: ['calmmind']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['calmmind'] }, ]]); assert.false.hurts(battle.p2.active[0], () => battle.makeChoices('move rest', 'move calmmind')); }); - it('should not negate Desolate Land\'s ability to prevent other weathers from activating', function () { + it('should not negate Desolate Land\'s ability to prevent other weathers from activating', () => { battle = common.createBattle([[ - {species: 'Golduck', ability: 'cloudnine', moves: ['raindance']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['raindance'] }, ], [ - {species: 'Groudon', ability: 'desolateland', moves: ['sunnyday']}, + { species: 'Groudon', ability: 'desolateland', moves: ['sunnyday'] }, ]]); assert.constant(() => battle.weather, () => battle.makeChoices('move raindance', 'move sunnyday')); }); - it('should not negate Primordial Sea\'s ability to prevent other weathers from activating', function () { + it('should not negate Primordial Sea\'s ability to prevent other weathers from activating', () => { battle = common.createBattle([[ - {species: 'Golduck', ability: 'cloudnine', moves: ['raindance']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['raindance'] }, ], [ - {species: 'Kyogre', ability: 'primordialsea', moves: ['sunnyday']}, + { species: 'Kyogre', ability: 'primordialsea', moves: ['sunnyday'] }, ]]); assert.constant(() => battle.weather, () => battle.makeChoices('move raindance', 'move sunnyday')); }); - it('should not negate Delta Stream\'s ability to prevent other weathers from activating', function () { + it('should not negate Delta Stream\'s ability to prevent other weathers from activating', () => { battle = common.createBattle([[ - {species: 'Golduck', ability: 'cloudnine', moves: ['raindance']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['raindance'] }, ], [ - {species: 'Rayquaza', ability: 'deltastream', moves: ['sunnyday']}, + { species: 'Rayquaza', ability: 'deltastream', moves: ['sunnyday'] }, ]]); assert.constant(() => battle.weather, () => battle.makeChoices('move raindance', 'move sunnyday')); }); - it('should still display status of the weather', function () { + it('should still display status of the weather', () => { battle = common.createBattle([[ - {species: 'Golduck', ability: 'cloudnine', moves: ['calmmind']}, + { species: 'Golduck', ability: 'cloudnine', moves: ['calmmind'] }, ], [ - {species: 'Sunkern', ability: 'solarpower', moves: ['sunnyday']}, + { species: 'Sunkern', ability: 'solarpower', moves: ['sunnyday'] }, ]]); battle.makeChoices('move calmmind', 'move sunnyday'); assert.equal(battle.log[battle.lastMoveLine + 1], '|-weather|SunnyDay'); @@ -115,12 +115,12 @@ describe('Cloud Nine', function () { assert.equal(battle.log[battle.lastMoveLine + 4], '|-weather|none'); }); - it(`should allow Hydration to trigger if the user fainted before Hydration could trigger`, function () { + it(`should allow Hydration to trigger if the user fainted before Hydration could trigger`, () => { battle = common.createBattle([[ - {species: 'Toxapex', ability: 'cloudnine', moves: ['toxic', 'raindance', 'finalgambit']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Toxapex', ability: 'cloudnine', moves: ['toxic', 'raindance', 'finalgambit'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Manaphy', ability: 'hydration', moves: ['sleeptalk']}, + { species: 'Manaphy', ability: 'hydration', moves: ['sleeptalk'] }, ]]); const manaphy = battle.p2.active[0]; diff --git a/test/sim/abilities/colorchange.js b/test/sim/abilities/colorchange.js index af2641ba17..6638be5ee6 100644 --- a/test/sim/abilities/colorchange.js +++ b/test/sim/abilities/colorchange.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe('Color Change', function () { - afterEach(function () { +describe('Color Change', () => { + afterEach(() => { battle.destroy(); }); - it('should change the user\'s type when struck by a move', function () { + it('should change the user\'s type when struck by a move', () => { battle = common.createBattle([[ - {species: "Kecleon", ability: 'colorchange', moves: ['recover']}, + { species: "Kecleon", ability: 'colorchange', moves: ['recover'] }, ], [ - {species: "Paras", ability: 'damp', moves: ['absorb']}, + { species: "Paras", ability: 'damp', moves: ['absorb'] }, ]]); const ccMon = battle.p1.active[0]; battle.makeChoices('move Recover', 'move Absorb'); assert(ccMon.hasType('Grass')); }); - it('should not change the user\'s type if it had a Substitute when hit', function () { + it('should not change the user\'s type if it had a Substitute when hit', () => { battle = common.createBattle([[ - {species: "Kecleon", ability: 'colorchange', moves: ['substitute']}, + { species: "Kecleon", ability: 'colorchange', moves: ['substitute'] }, ], [ - {species: "Machamp", ability: 'purepower', item: 'laggingtail', moves: ['closecombat']}, + { species: "Machamp", ability: 'purepower', item: 'laggingtail', moves: ['closecombat'] }, ]]); const ccMon = battle.p1.active[0]; battle.makeChoices('move Substitute', 'move Closecombat'); diff --git a/test/sim/abilities/comatose.js b/test/sim/abilities/comatose.js index 0f7422c522..a9fa92af13 100644 --- a/test/sim/abilities/comatose.js +++ b/test/sim/abilities/comatose.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Comatose', function () { - afterEach(function () { +describe('Comatose', () => { + afterEach(() => { battle.destroy(); }); - it('should make the user immune to status conditions', function () { + it('should make the user immune to status conditions', () => { battle = common.createBattle([[ - {species: "Komala", ability: 'comatose', moves: ['shadowclaw']}, + { species: "Komala", ability: 'comatose', moves: ['shadowclaw'] }, ], [ - {species: "Smeargle", ability: 'noguard', moves: ['spore', 'glare', 'willowisp', 'toxic']}, + { species: "Smeargle", ability: 'noguard', moves: ['spore', 'glare', 'willowisp', 'toxic'] }, ]]); const comatoseMon = battle.p1.active[0]; for (let i = 1; i <= 4; i++) { @@ -22,11 +22,11 @@ describe('Comatose', function () { } }); - it('should not have its status immunity bypassed by Mold Breaker', function () { + it('should not have its status immunity bypassed by Mold Breaker', () => { battle = common.createBattle([[ - {species: "Komala", ability: 'comatose', moves: ['shadowclaw']}, + { species: "Komala", ability: 'comatose', moves: ['shadowclaw'] }, ], [ - {species: "Smeargle", ability: 'moldbreaker', moves: ['spore', 'glare', 'willowisp', 'toxic']}, + { species: "Smeargle", ability: 'moldbreaker', moves: ['spore', 'glare', 'willowisp', 'toxic'] }, ]]); const comatoseMon = battle.p1.active[0]; for (let i = 1; i <= 4; i++) { @@ -34,46 +34,46 @@ describe('Comatose', function () { } }); - it('should cause Rest to fail', function () { + it('should cause Rest to fail', () => { battle = common.createBattle([[ - {species: "Komala", ability: 'comatose', moves: ['rest']}, + { species: "Komala", ability: 'comatose', moves: ['rest'] }, ], [ - {species: "Smeargle", ability: 'technician', moves: ['aquajet']}, + { species: "Smeargle", ability: 'technician', moves: ['aquajet'] }, ]]); const comatoseMon = battle.p1.active[0]; assert.hurts(comatoseMon, () => battle.makeChoices('move rest', 'move aquajet')); assert.constant(() => comatoseMon.status, () => battle.makeChoices('move rest', 'move aquajet')); }); - it('should allow the use of Snore and Sleep Talk as if the user were asleep', function () { + it('should allow the use of Snore and Sleep Talk as if the user were asleep', () => { battle = common.createBattle([[ - {species: "Komala", item: 'normaliumz', ability: 'comatose', moves: ['snore', 'sleeptalk', 'brickbreak']}, + { species: "Komala", item: 'normaliumz', ability: 'comatose', moves: ['snore', 'sleeptalk', 'brickbreak'] }, ], [ - {species: "Smeargle", moves: ['endure']}, + { species: "Smeargle", moves: ['endure'] }, ]]); const defender = battle.p2.active[0]; assert.hurts(defender, () => battle.makeChoices('move snore', 'move endure'), "Expected damage from Snore."); assert.hurts(defender, () => battle.makeChoices('move sleeptalk', 'move endure'), "Expected damage from Sleep Talk calling Brick Break."); }); - it('should cause the user to be damaged by Dream Eater as if it were asleep', function () { + it('should cause the user to be damaged by Dream Eater as if it were asleep', () => { battle = common.createBattle([[ - {species: "Komala", ability: 'comatose', moves: ['shadowclaw']}, + { species: "Komala", ability: 'comatose', moves: ['shadowclaw'] }, ], [ - {species: "Smeargle", ability: 'technician', moves: ['dreameater']}, + { species: "Smeargle", ability: 'technician', moves: ['dreameater'] }, ]]); assert.hurts(battle.p1.active[0], () => battle.makeChoices('move shadowclaw', 'move dreameater')); }); - it('should cause Wake-Up Slap and Hex to have doubled base power when used against the user', function () { + it('should cause Wake-Up Slap and Hex to have doubled base power when used against the user', () => { battle = common.createBattle([[ - {species: "Komala", ability: 'comatose', item: 'ringtarget', moves: ['endure']}, + { species: "Komala", ability: 'comatose', item: 'ringtarget', moves: ['endure'] }, ], [ - {species: "Smeargle", ability: 'technician', moves: ['hex', 'wakeupslap']}, + { species: "Smeargle", ability: 'technician', moves: ['hex', 'wakeupslap'] }, ]]); let bp = 0; - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { bp = basePower; }); diff --git a/test/sim/abilities/commander.js b/test/sim/abilities/commander.js index d8d18fc511..cd5d751262 100644 --- a/test/sim/abilities/commander.js +++ b/test/sim/abilities/commander.js @@ -5,29 +5,29 @@ const common = require('./../../common'); let battle; -describe('Commander', function () { - afterEach(function () { +describe('Commander', () => { + afterEach(() => { battle.destroy(); }); - it(`should skip Tatsugiri's action while commanding`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wobbuffet', moves: ['sleeptalk']}, + it(`should skip Tatsugiri's action while commanding`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wobbuffet', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['swordsdance']}, - {species: 'dondozo', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', moves: ['swordsdance'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, ]]); assert.cantMove(() => battle.p2.choose('move swordsdance', 'move sleeptalk')); }); - it(`should not work if another Pokemon is Transformed into Dondozo`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'dondozo', moves: ['sleeptalk']}, + it(`should not work if another Pokemon is Transformed into Dondozo`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, - {species: 'mew', moves: ['transform']}, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, + { species: 'mew', moves: ['transform'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, move transform 2'); @@ -35,14 +35,14 @@ describe('Commander', function () { assert.false(!!mewDondozo.volatiles['commanded']); }); - it(`should not work if another Pokemon is Transformed into Tatsugiri`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, + it(`should not work if another Pokemon is Transformed into Tatsugiri`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, ], [ - {species: 'roggenrola', moves: ['sleeptalk']}, - {species: 'sunkern', ability: 'commander', moves: ['transform']}, - {species: 'dondozo', moves: ['transform']}, + { species: 'roggenrola', moves: ['sleeptalk'] }, + { species: 'sunkern', ability: 'commander', moves: ['transform'] }, + { species: 'dondozo', moves: ['transform'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, move transform 2'); @@ -51,14 +51,14 @@ describe('Commander', function () { assert.false(!!dondozo.volatiles['commanded'], `Transformed Sunkern into another Tatsugiri should not trigger Commander`); }); - it(`should work if Tatsugiri is Transformed into another Pokemon with Commander`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'sunkern', ability: 'commander', moves: ['sleeptalk']}, + it(`should work if Tatsugiri is Transformed into another Pokemon with Commander`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'sunkern', ability: 'commander', moves: ['sleeptalk'] }, ], [ - {species: 'roggenrola', moves: ['sleeptalk']}, - {species: 'tatsugiri', ability: 'commander', moves: ['transform']}, - {species: 'dondozo', moves: ['transform']}, + { species: 'roggenrola', moves: ['sleeptalk'] }, + { species: 'tatsugiri', ability: 'commander', moves: ['transform'] }, + { species: 'dondozo', moves: ['transform'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, move transform 2'); @@ -67,14 +67,14 @@ describe('Commander', function () { assert(!!dondozo.volatiles['commanded']); }); - it(`should work if Dondozo is Transformed`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'diglett', moves: ['sleeptalk']}, + it(`should work if Dondozo is Transformed`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'diglett', moves: ['sleeptalk'] }, ], [ - {species: 'dondozo', moves: ['transform']}, - {species: 'roggenrola', moves: ['sleeptalk']}, - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, + { species: 'dondozo', moves: ['transform'] }, + { species: 'roggenrola', moves: ['sleeptalk'] }, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move transform 2, move sleeptalk'); @@ -83,13 +83,13 @@ describe('Commander', function () { assert(!!dondozo.volatiles['commanded']); }); - it(`should cause Tatsugiri to dodge all moves, including moves which normally bypass semi-invulnerability`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'machamp', ability: 'noguard', moves: ['closecombat']}, - {species: 'seviper', moves: ['toxic']}, + it(`should cause Tatsugiri to dodge all moves, including moves which normally bypass semi-invulnerability`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'machamp', ability: 'noguard', moves: ['closecombat'] }, + { species: 'seviper', moves: ['toxic'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, - {species: 'dondozo', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move closecombat 1, move toxic 1', 'auto'); @@ -101,14 +101,14 @@ describe('Commander', function () { assert.fullHP(battle.p2.active[1]); }); - it(`should prevent all kinds of switchouts`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', item: 'redcard', ability: 'noguard', moves: ['sleeptalk', 'tackle', 'dragontail']}, - {species: 'gyarados', item: 'ejectbutton', ability: 'intimidate', moves: ['sleeptalk', 'trick', 'roar']}, + it(`should prevent all kinds of switchouts`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', item: 'redcard', ability: 'noguard', moves: ['sleeptalk', 'tackle', 'dragontail'] }, + { species: 'gyarados', item: 'ejectbutton', ability: 'intimidate', moves: ['sleeptalk', 'trick', 'roar'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, - {species: 'dondozo', moves: ['sleeptalk', 'peck']}, - {species: 'rufflet', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, + { species: 'dondozo', moves: ['sleeptalk', 'peck'] }, + { species: 'rufflet', moves: ['sleeptalk'] }, ]]); // const tatsugiri = battle.p2.active[0]; @@ -126,14 +126,14 @@ describe('Commander', function () { assert.equal(battle.requestState, 'move', 'It should not have switched out on standard phazing moves'); }); - it.skip(`should prevent Eject Pack switchouts`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', item: 'redcard', ability: 'noguard', moves: ['sleeptalk', 'tackle', 'dragontail']}, - {species: 'gyarados', item: 'ejectbutton', ability: 'intimidate', moves: ['sleeptalk', 'trick', 'roar']}, + it.skip(`should prevent Eject Pack switchouts`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', item: 'redcard', ability: 'noguard', moves: ['sleeptalk', 'tackle', 'dragontail'] }, + { species: 'gyarados', item: 'ejectbutton', ability: 'intimidate', moves: ['sleeptalk', 'trick', 'roar'] }, ], [ - {species: 'tatsugiri', ability: 'commander', item: 'ejectpack', moves: ['sleeptalk']}, - {species: 'dondozo', item: 'ejectpack', moves: ['sleeptalk', 'peck']}, - {species: 'rufflet', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', item: 'ejectpack', moves: ['sleeptalk'] }, + { species: 'dondozo', item: 'ejectpack', moves: ['sleeptalk', 'peck'] }, + { species: 'rufflet', moves: ['sleeptalk'] }, ]]); const tatsugiri = battle.p2.active[0]; @@ -146,15 +146,15 @@ describe('Commander', function () { assert.holdsItem(dondozo); }); - it(`should cause Dondozo to stay commanded even if Tatsugiri faints`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'hypno', moves: ['sleeptalk']}, - {species: 'shuckle', moves: ['sleeptalk']}, + it(`should cause Dondozo to stay commanded even if Tatsugiri faints`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'hypno', moves: ['sleeptalk'] }, + { species: 'shuckle', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', item: 'toxicorb', moves: ['sleeptalk']}, - {species: 'dondozo', moves: ['sleeptalk', 'orderup']}, - {species: 'teddiursa', moves: ['sleeptalk']}, - {species: 'tatsugiridroopy', ability: 'commander', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', item: 'toxicorb', moves: ['sleeptalk'] }, + { species: 'dondozo', moves: ['sleeptalk', 'orderup'] }, + { species: 'teddiursa', moves: ['sleeptalk'] }, + { species: 'tatsugiridroopy', ability: 'commander', moves: ['sleeptalk'] }, ]]); // Kill turns for Toxic Orb to KO Tatsugiri @@ -165,14 +165,14 @@ describe('Commander', function () { assert.statStage(battle.p2.pokemon[1], 'atk', 3); }); - it(`should allow one Tatsugiri to occupy multiple Dondozo`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'noguard', moves: ['sheercold']}, - {species: 'shuckle', moves: ['sleeptalk']}, + it(`should allow one Tatsugiri to occupy multiple Dondozo`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'noguard', moves: ['sheercold'] }, + { species: 'shuckle', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, - {species: 'dondozo', moves: ['sleeptalk']}, - {species: 'dondozo', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sheercold 2, move sleeptalk', 'auto'); @@ -182,29 +182,29 @@ describe('Commander', function () { assert(!!secondDondozo.volatiles['commanded']); }); - it(`should not work in Multi Battles`, function () { - battle = common.createBattle({gameType: 'multi'}, [[ - {species: 'diggersby', moves: ['sleeptalk']}, + it(`should not work in Multi Battles`, () => { + battle = common.createBattle({ gameType: 'multi' }, [[ + { species: 'diggersby', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, ], [ - {species: 'cubone', moves: ['sleeptalk']}, + { species: 'cubone', moves: ['sleeptalk'] }, ], [ - {species: 'dondozo', moves: ['sleeptalk']}, + { species: 'dondozo', moves: ['sleeptalk'] }, ]]); const dondozo = battle.p4.active[0]; assert.false(!!dondozo.volatiles['commanded']); }); - it(`should prevent Dondozo and Tatsugiri from combining if Commander is suppressed`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'shuckle', moves: ['sleeptalk']}, - {species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + it(`should prevent Dondozo and Tatsugiri from combining if Commander is suppressed`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'shuckle', moves: ['sleeptalk'] }, + { species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, - {species: 'dondozo', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, ]]); const dondozo = battle.p2.active[1]; @@ -214,14 +214,14 @@ describe('Commander', function () { assert(!!dondozo.volatiles['commanded']); }); - it(`should not split apart Dondozo and Tatsugiri if Neutralizing Gas switches in`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'shuckle', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, + it(`should not split apart Dondozo and Tatsugiri if Neutralizing Gas switches in`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'shuckle', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['dazzlinggleam']}, - {species: 'dondozo', moves: ['sleeptalk']}, + { species: 'tatsugiri', ability: 'commander', moves: ['dazzlinggleam'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, ]]); battle.makeChoices('switch 3, move sleeptalk', 'auto'); @@ -234,14 +234,14 @@ describe('Commander', function () { assert.fullHP(shuckle, `Shuckle should have never taken damage from Dazzling Gleam`); }); - it(`should allow Tatsugiri to move again if Dondozo faints while Neutralizing Gas is active`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'shuckle', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, + it(`should allow Tatsugiri to move again if Dondozo faints while Neutralizing Gas is active`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'shuckle', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiri', ability: 'commander', moves: ['dazzlinggleam']}, - {species: 'dondozo', moves: ['memento']}, + { species: 'tatsugiri', ability: 'commander', moves: ['dazzlinggleam'] }, + { species: 'dondozo', moves: ['memento'] }, ]]); battle.makeChoices('switch 3, move sleeptalk', 'auto'); @@ -255,14 +255,14 @@ describe('Commander', function () { assert.false.fullHP(shuckle, `Shuckle should have taken damage from Dazzling Gleam`); }); - it(`should activate after hazards run`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'regieleki', moves: ['toxicspikes']}, - {species: 'registeel', moves: ['sleeptalk']}, + it(`should activate after hazards run`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'regieleki', moves: ['toxicspikes'] }, + { species: 'registeel', moves: ['sleeptalk'] }, ], [ - {species: 'shuckle', moves: ['uturn']}, - {species: 'dondozo', moves: ['sleeptalk']}, - {species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk']}, + { species: 'shuckle', moves: ['uturn'] }, + { species: 'dondozo', moves: ['sleeptalk'] }, + { species: 'tatsugiri', ability: 'commander', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/contrary.js b/test/sim/abilities/contrary.js index b0b801ca1a..382a2b1490 100644 --- a/test/sim/abilities/contrary.js +++ b/test/sim/abilities/contrary.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Contrary', function () { - afterEach(function () { +describe('Contrary', () => { + afterEach(() => { battle.destroy(); }); it('should invert relative stat changes', function () { this.timeout(0); battle = common.createBattle([[ - {species: "Spinda", ability: 'contrary', moves: ['superpower']}, + { species: "Spinda", ability: 'contrary', moves: ['superpower'] }, ], [ - {species: "Dragonite", ability: 'multiscale', moves: ['dragondance']}, + { species: "Dragonite", ability: 'multiscale', moves: ['dragondance'] }, ]]); const contraryMon = battle.p1.active[0]; battle.makeChoices('move superpower', 'move dragondance'); @@ -23,33 +23,33 @@ describe('Contrary', function () { assert.statStage(contraryMon, 'def', 1); }); - it('should not invert absolute stat changes', function () { + it('should not invert absolute stat changes', () => { battle = common.createBattle([[ - {species: "Serperior", ability: 'contrary', moves: ['leechseed']}, + { species: "Serperior", ability: 'contrary', moves: ['leechseed'] }, ], [ - {species: "Growlithe", ability: 'intimidate', moves: ['topsyturvy']}, + { species: "Growlithe", ability: 'intimidate', moves: ['topsyturvy'] }, ]]); const contraryMon = battle.p1.active[0]; battle.makeChoices('move leechseed', 'move topsyturvy'); assert.statStage(contraryMon, 'atk', -1); }); - it('should invert Belly Drum\'s maximizing Attack', function () { + it('should invert Belly Drum\'s maximizing Attack', () => { battle = common.createBattle([[ - {species: "Spinda", ability: 'contrary', moves: ['bellydrum']}, + { species: "Spinda", ability: 'contrary', moves: ['bellydrum'] }, ], [ - {species: "Dragonite", ability: 'multiscale', moves: ['dragondance']}, + { species: "Dragonite", ability: 'multiscale', moves: ['dragondance'] }, ]]); const contraryMon = battle.p1.active[0]; battle.makeChoices('move bellydrum', 'move dragondance'); assert.statStage(contraryMon, 'atk', -6); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle([[ - {species: "Spinda", ability: 'contrary', moves: ['tackle']}, + { species: "Spinda", ability: 'contrary', moves: ['tackle'] }, ], [ - {species: "Dragonite", ability: 'moldbreaker', moves: ['growl']}, + { species: "Dragonite", ability: 'moldbreaker', moves: ['growl'] }, ]]); const contraryMon = battle.p1.active[0]; battle.makeChoices('move tackle', 'move growl'); diff --git a/test/sim/abilities/costar.js b/test/sim/abilities/costar.js index 78fbf61f0f..e158d7f8ec 100644 --- a/test/sim/abilities/costar.js +++ b/test/sim/abilities/costar.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('Costar', function () { - afterEach(function () { +describe('Costar', () => { + afterEach(() => { battle.destroy(); }); - it('should copy the teammate\'s crit ratio on activation', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Smeargle', level: 1, moves: ['sleeptalk', 'focusenergy']}, - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - {species: 'Flamigo', level: 1, ability: 'costar', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - {species: 'pikachu', level: 1, moves: ['sleeptalk']}, - {species: 'weezinggalar', level: 1, ability: 'neutralizinggas', moves: ['sleeptalk']}, - ]}); + it('should copy the teammate\'s crit ratio on activation', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Smeargle', level: 1, moves: ['sleeptalk', 'focusenergy'] }, + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + { species: 'Flamigo', level: 1, ability: 'costar', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + { species: 'pikachu', level: 1, moves: ['sleeptalk'] }, + { species: 'weezinggalar', level: 1, ability: 'neutralizinggas', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move focusenergy, move sleeptalk', 'move sleeptalk, move sleeptalk'); battle.makeChoices('move sleeptalk, switch flamigo', 'move sleeptalk, move sleeptalk'); @@ -34,18 +34,17 @@ describe('Costar', function () { assert(!flamigo.volatiles['focusenergy'], "Costar should copy having no volatile crit modifiers when re-activated."); }); - it('should copy both positive and negative stat changes', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - {species: 'Smeargle', level: 1, moves: ['sleeptalk', 'shellsmash']}, - {species: 'Flamigo', level: 1, ability: 'costar', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - ]}); - + it('should copy both positive and negative stat changes', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + { species: 'Smeargle', level: 1, moves: ['sleeptalk', 'shellsmash'] }, + { species: 'Flamigo', level: 1, ability: 'costar', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move sleeptalk, move shellsmash', 'move sleeptalk, move sleeptalk'); battle.makeChoices('switch flamigo, move sleeptalk', 'move sleeptalk, move sleeptalk'); @@ -58,17 +57,16 @@ describe('Costar', function () { assert.statStage(flamigo, 'spd', -1, "A pokemon should copy the target's negative stat changes (spd) when switching in with Costar."); }); - it('should always activate later than Intimidate during simultaneous switch-ins', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'flamigo', ability: 'costar', moves: ['sleeptalk']}, - {species: 'registeel', ability: 'clearbody', moves: ['sleeptalk']}, + it('should always activate later than Intimidate during simultaneous switch-ins', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'flamigo', ability: 'costar', moves: ['sleeptalk'] }, + { species: 'registeel', ability: 'clearbody', moves: ['sleeptalk'] }, ], [ - {species: 'litten', ability: 'intimidate', moves: ['sleeptalk']}, - {species: 'dipplin', ability: 'supersweetsyrup', moves: ['sleeptalk']}, + { species: 'litten', ability: 'intimidate', moves: ['sleeptalk'] }, + { species: 'dipplin', ability: 'supersweetsyrup', moves: ['sleeptalk'] }, ]]); const flamigo = battle.p1.active[0]; assert.statStage(flamigo, 'atk', 0); assert.statStage(flamigo, 'evasion', 0); }); }); - diff --git a/test/sim/abilities/cursedbody.js b/test/sim/abilities/cursedbody.js index f166c6c571..21c1169692 100644 --- a/test/sim/abilities/cursedbody.js +++ b/test/sim/abilities/cursedbody.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe(`Cursed Body`, function () { - afterEach(function () { +describe(`Cursed Body`, () => { + afterEach(() => { battle.destroy(); }); - it(`should be able to disable Z-moves (not the base of Z-moves)`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'gengar', ability: 'cursedbody', item: 'focussash', moves: ['sleeptalk']}, + it(`should be able to disable Z-moves (not the base of Z-moves)`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'gengar', ability: 'cursedbody', item: 'focussash', moves: ['sleeptalk'] }, ], [ - {species: 'kommoo', item: 'kommoniumz', moves: ['clangingscales', 'sleeptalk']}, + { species: 'kommoo', item: 'kommoniumz', moves: ['clangingscales', 'sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk', 'move clangingscales zmove'); assert(battle.log.some(line => line.includes('Cursed Body'))); diff --git a/test/sim/abilities/damp.js b/test/sim/abilities/damp.js index b9633387ed..f4af14feb9 100644 --- a/test/sim/abilities/damp.js +++ b/test/sim/abilities/damp.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Damp', function () { - afterEach(function () { +describe('Damp', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent self-destruction moves from activating', function () { + it('should prevent self-destruction moves from activating', () => { battle = common.createBattle([[ - {species: 'Politoed', ability: 'damp', moves: ['calmmind']}, + { species: 'Politoed', ability: 'damp', moves: ['calmmind'] }, ], [ - {species: 'Electrode', ability: 'static', moves: ['explosion']}, + { species: 'Electrode', ability: 'static', moves: ['explosion'] }, ]]); const [dampMon, selfKOMon] = [battle.p1.active[0], battle.p2.active[0]]; battle.makeChoices('move calmmind', 'move explosion'); @@ -22,11 +22,11 @@ describe('Damp', function () { assert.fullHP(selfKOMon); }); - it('should prevent Aftermath from activating', function () { + it('should prevent Aftermath from activating', () => { battle = common.createBattle([[ - {species: 'Poliwrath', ability: 'damp', moves: ['closecombat']}, + { species: 'Poliwrath', ability: 'damp', moves: ['closecombat'] }, ], [ - {species: 'Aron', ability: 'aftermath', moves: ['leer']}, + { species: 'Aron', ability: 'aftermath', moves: ['leer'] }, ]]); const [dampMon, afterMathMon] = [battle.p1.active[0], battle.p2.active[0]]; battle.makeChoices('move closecombat', 'move leer'); @@ -34,11 +34,11 @@ describe('Damp', function () { assert.fainted(afterMathMon); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle([[ - {species: 'Politoed', ability: 'damp', moves: ['calmmind']}, + { species: 'Politoed', ability: 'damp', moves: ['calmmind'] }, ], [ - {species: 'Electrode', ability: 'moldbreaker', moves: ['explosion']}, + { species: 'Electrode', ability: 'moldbreaker', moves: ['explosion'] }, ]]); const [dampMon, mbSelfKOMon] = [battle.p1.active[0], battle.p2.active[0]]; assert.hurts(dampMon, () => battle.makeChoices('move calmmind', 'move explosion')); diff --git a/test/sim/abilities/dancer.js b/test/sim/abilities/dancer.js index 704a6b1377..591da14aa4 100644 --- a/test/sim/abilities/dancer.js +++ b/test/sim/abilities/dancer.js @@ -5,73 +5,73 @@ const common = require('./../../common'); let battle; -describe('Dancer', function () { - afterEach(function () { +describe('Dancer', () => { + afterEach(() => { battle.destroy(); }); - it('should only copy dance moves used by other Pokemon', function () { + it('should only copy dance moves used by other Pokemon', () => { battle = common.createBattle([[ - {species: 'Oricorio', ability: 'dancer', moves: ['swordsdance']}, + { species: 'Oricorio', ability: 'dancer', moves: ['swordsdance'] }, ], [ - {species: 'Oricorio', ability: 'dancer', moves: ['howl']}, + { species: 'Oricorio', ability: 'dancer', moves: ['howl'] }, ]]); battle.makeChoices('move swordsdance', 'move howl'); assert.statStage(battle.p1.active[0], 'atk', 2); assert.statStage(battle.p2.active[0], 'atk', 3); }); - it('should activate in order of lowest to highest raw speed', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Shedinja', level: 98, ability: 'dancer', item: 'focussash', moves: ['sleeptalk']}, - {species: 'Shedinja', level: 99, ability: 'dancer', moves: ['sleeptalk']}, + it('should activate in order of lowest to highest raw speed', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Shedinja', level: 98, ability: 'dancer', item: 'focussash', moves: ['sleeptalk'] }, + { species: 'Shedinja', level: 99, ability: 'dancer', moves: ['sleeptalk'] }, ], [ - {species: 'Shedinja', ability: 'wonderguard', moves: ['fierydance']}, - {species: 'Shedinja', ability: 'dancer', moves: ['sleeptalk']}, + { species: 'Shedinja', ability: 'wonderguard', moves: ['fierydance'] }, + { species: 'Shedinja', ability: 'dancer', moves: ['sleeptalk'] }, ]]); const [, fastDancer] = battle.p1.active; const [wwDanceSource, foeDancer] = battle.p2.active; - fastDancer.boostBy({spe: 6}); + fastDancer.boostBy({ spe: 6 }); battle.makeChoices('move sleeptalk, move sleeptalk', 'move fierydance 1, move sleeptalk'); assert.fainted(wwDanceSource); assert.fainted(foeDancer); }); - it('should activate in order of lowest to highest raw speed inside Trick Room', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Shedinja', level: 98, ability: 'dancer', item: 'focussash', moves: ['sleeptalk']}, - {species: 'Shedinja', level: 99, ability: 'dancer', moves: ['sleeptalk']}, + it('should activate in order of lowest to highest raw speed inside Trick Room', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Shedinja', level: 98, ability: 'dancer', item: 'focussash', moves: ['sleeptalk'] }, + { species: 'Shedinja', level: 99, ability: 'dancer', moves: ['sleeptalk'] }, ], [ - {species: 'Shedinja', ability: 'wonderguard', moves: ['fierydance', 'trickroom']}, - {species: 'Shedinja', ability: 'dancer', moves: ['sleeptalk']}, + { species: 'Shedinja', ability: 'wonderguard', moves: ['fierydance', 'trickroom'] }, + { species: 'Shedinja', ability: 'dancer', moves: ['sleeptalk'] }, ]]); const [, fastDancer] = battle.p1.active; const [wwDanceSource, foeDancer] = battle.p2.active; - fastDancer.boostBy({spe: 6}); + fastDancer.boostBy({ spe: 6 }); battle.makeChoices('move sleeptalk, move sleeptalk', 'move trickroom, move sleeptalk'); battle.makeChoices('move sleeptalk, move sleeptalk', 'move fierydance 1, move sleeptalk'); assert.fainted(wwDanceSource); assert.fainted(foeDancer); }); - it(`should not copy a move that was blocked by Protect`, function () { + it(`should not copy a move that was blocked by Protect`, () => { battle = common.createBattle([[ - {species: 'Oricorio', ability: 'dancer', moves: ['protect']}, + { species: 'Oricorio', ability: 'dancer', moves: ['protect'] }, ], [ - {species: 'Wynaut', ability: 'dancer', moves: ['fierydance']}, + { species: 'Wynaut', ability: 'dancer', moves: ['fierydance'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p2.active[0]); }); - it(`should not copy Teeter Dance when all targets are confused`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Oricorio', ability: 'dancer', moves: ['sleeptalk', 'protect']}, - {species: 'Slowbro', ability: 'owntempo', moves: ['sleeptalk']}, + it(`should not copy Teeter Dance when all targets are confused`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Oricorio', ability: 'dancer', moves: ['sleeptalk', 'protect'] }, + { species: 'Slowbro', ability: 'owntempo', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', ability: 'dancer', item: 'persimberry', moves: ['sleeptalk', 'teeterdance']}, - {species: 'Slowking', ability: 'owntempo', moves: ['sleeptalk']}, + { species: 'Wynaut', ability: 'dancer', item: 'persimberry', moves: ['sleeptalk', 'teeterdance'] }, + { species: 'Slowking', ability: 'owntempo', moves: ['sleeptalk'] }, ]]); const wynaut = battle.p2.active[0]; @@ -82,35 +82,35 @@ describe('Dancer', function () { assert(battle.log.some(line => line.includes('Dancer'))); }); - it(`should not copy a Dance move that failed for other reasons`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'mew', ability: 'dancer', moves: ['dragondance', 'protect']}, - {species: 'wynaut', ability: 'dancer', moves: ['featherdance']}, + it(`should not copy a Dance move that failed for other reasons`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'mew', ability: 'dancer', moves: ['dragondance', 'protect'] }, + { species: 'wynaut', ability: 'dancer', moves: ['featherdance'] }, ], [ - {species: 'oricoriopau', ability: 'dancer', moves: ['revelationdance', 'protect']}, - {species: 'shedinja', ability: 'wonderguard', moves: ['finalgambit']}, + { species: 'oricoriopau', ability: 'dancer', moves: ['revelationdance', 'protect'] }, + { species: 'shedinja', ability: 'wonderguard', moves: ['finalgambit'] }, ]]); const mew = battle.p1.active[0]; const wynaut = battle.p1.active[1]; const oricorio = battle.p2.active[0]; - mew.boostBy({atk: 6, spe: 6}); - oricorio.boostBy({atk: -6}); + mew.boostBy({ atk: 6, spe: 6 }); + oricorio.boostBy({ atk: -6 }); battle.makeChoices('move dragondance, move featherdance 1', 'move revelationdance -2, move finalgambit 1'); assert.fullHP(oricorio, `Nothing should target Oricorio because Revelation Dance failed from Wonder Guard`); assert.statStage(wynaut, 'atk', 0, `Wynaut's attack should not have changed from either Feather Dance or Dragon Dance, because both failed`); }); - it(`should not copy a move that missed`, function () { + it(`should not copy a move that missed`, () => { battle = common.createBattle([[ - {species: 'Oricorio', ability: 'dancer', moves: ['revelationdance']}, + { species: 'Oricorio', ability: 'dancer', moves: ['revelationdance'] }, ], [ - {species: 'Wynaut', ability: 'dancer', moves: ['dig']}, + { species: 'Wynaut', ability: 'dancer', moves: ['dig'] }, ]]); // Modding accuracy so Revelation Dance always misses if Oricorio uses it (Wynaut should in fact never use it though) - battle.onEvent('Accuracy', battle.format, function (accuracy, target, pokemon, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, pokemon, move) => { return pokemon.id === 'wynaut'; }); @@ -119,34 +119,34 @@ describe('Dancer', function () { assert.false(battle.log.some(line => line.includes('Dancer'))); }); - it('should copy a move that hit, but did 0 damage', function () { + it('should copy a move that hit, but did 0 damage', () => { battle = common.createBattle([[ - {species: 'Oricorio', ability: 'dancer', moves: ['fierydance']}, + { species: 'Oricorio', ability: 'dancer', moves: ['fierydance'] }, ], [ - {species: 'Shedinja', ability: 'dancer', item: 'focussash', moves: ['meanlook']}, + { species: 'Shedinja', ability: 'dancer', item: 'focussash', moves: ['meanlook'] }, ]]); const dancer = battle.p1.active[0]; assert.hurts(dancer, () => battle.makeChoices('move fierydance', 'move meanlook')); }); - it('should not activate if the holder fainted', function () { + it('should not activate if the holder fainted', () => { battle = common.createBattle([[ - {species: 'Oricoriopompom', ability: 'dancer', moves: ['revelationdance']}, + { species: 'Oricoriopompom', ability: 'dancer', moves: ['revelationdance'] }, ], [ - {species: 'oricorio', ability: 'dancer', level: 1, moves: ['sleeptalk']}, - {species: 'oricorio', ability: 'dancer', level: 1, moves: ['sleeptalk']}, + { species: 'oricorio', ability: 'dancer', level: 1, moves: ['sleeptalk'] }, + { species: 'oricorio', ability: 'dancer', level: 1, moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(!battle.log.includes('|-activate|p2: Oricorio|ability: Dancer')); }); - it('should target the user of a Dance move unless it was an ally attacking an opponent', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Oricorio', level: 98, ability: 'dancer', item: 'laggingtail', moves: ['sleeptalk', 'protect', 'teeterdance']}, - {species: 'Oricorio', level: 99, ability: 'heatproof', moves: ['fierydance', 'sleeptalk']}, + it('should target the user of a Dance move unless it was an ally attacking an opponent', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Oricorio', level: 98, ability: 'dancer', item: 'laggingtail', moves: ['sleeptalk', 'protect', 'teeterdance'] }, + { species: 'Oricorio', level: 99, ability: 'heatproof', moves: ['fierydance', 'sleeptalk'] }, ], [ - {species: 'Oricorio', ability: 'heatproof', moves: ['fierydance', 'sleeptalk']}, - {species: 'Suicune', ability: 'heatproof', moves: ['sleeptalk']}, + { species: 'Oricorio', ability: 'heatproof', moves: ['fierydance', 'sleeptalk'] }, + { species: 'Suicune', ability: 'heatproof', moves: ['sleeptalk'] }, ]]); const opponentTargetingAlly = battle.p2.active[0]; @@ -168,13 +168,13 @@ describe('Dancer', function () { assert.equal(opponentNotTargetedByAlly.hp, opponentHP); }); - it('should adopt the target selected by copycat', function () { - battle = common.createBattle({gameType: 'doubles', seed: [1, 2, 3, 4]}, [[ - {species: 'oricoriopau', ability: 'dancer', moves: ['featherdance']}, - {species: 'flamigo', moves: ['copycat']}, + it('should adopt the target selected by copycat', () => { + battle = common.createBattle({ gameType: 'doubles', seed: [1, 2, 3, 4] }, [[ + { species: 'oricoriopau', ability: 'dancer', moves: ['featherdance'] }, + { species: 'flamigo', moves: ['copycat'] }, ], [ - {species: 'fletchinder', level: 1, moves: ['sleeptalk']}, - {species: 'squawkabilly', level: 1, moves: ['sleeptalk']}, + { species: 'fletchinder', level: 1, moves: ['sleeptalk'] }, + { species: 'squawkabilly', level: 1, moves: ['sleeptalk'] }, ]]); battle.makeChoices('move featherdance 1, move copycat', 'auto'); const flamigo = battle.p1.active[1]; diff --git a/test/sim/abilities/dazzling.js b/test/sim/abilities/dazzling.js index 90e92c506a..8c978546b5 100644 --- a/test/sim/abilities/dazzling.js +++ b/test/sim/abilities/dazzling.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Dazzling', function () { - afterEach(function () { +describe('Dazzling', () => { + afterEach(() => { battle.destroy(); }); - it('should block moves with positive priority', function () { + it('should block moves with positive priority', () => { battle = common.createBattle([ - [{species: "Sableye", ability: 'prankster', moves: ['taunt']}], - [{species: "Bruxish", ability: 'dazzling', moves: ['swordsdance']}], + [{ species: "Sableye", ability: 'prankster', moves: ['taunt'] }], + [{ species: "Bruxish", ability: 'dazzling', moves: ['swordsdance'] }], ]); battle.makeChoices('move taunt', 'move swordsdance'); assert.equal(battle.p2.active[0].boosts.atk, 2); }); - it('should not block moves that target all Pokemon, except Perish Song, Rototiller, and Flower Shield', function () { + it('should not block moves that target all Pokemon, except Perish Song, Rototiller, and Flower Shield', () => { battle = common.createBattle([ - [{species: "Bruxish", ability: 'dazzling', moves: ['swordsdance', 'sleeptalk']}], - [{species: "Mew", ability: 'prankster', moves: ['perishsong', 'haze']}], + [{ species: "Bruxish", ability: 'dazzling', moves: ['swordsdance', 'sleeptalk'] }], + [{ species: "Mew", ability: 'prankster', moves: ['perishsong', 'haze'] }], ]); battle.makeChoices('move swordsdance', 'move perishsong'); diff --git a/test/sim/abilities/defiant.js b/test/sim/abilities/defiant.js index 0010e26094..c92ce0d1dc 100644 --- a/test/sim/abilities/defiant.js +++ b/test/sim/abilities/defiant.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe(`Defiant`, function () { - afterEach(function () { +describe(`Defiant`, () => { + afterEach(() => { battle.destroy(); }); - it(`should raise the user's attack when lowered by an opponent`, function () { + it(`should raise the user's attack when lowered by an opponent`, () => { battle = common.createBattle([[ - {species: 'pawniard', ability: 'defiant', moves: ['sleeptalk', 'tackle']}, + { species: 'pawniard', ability: 'defiant', moves: ['sleeptalk', 'tackle'] }, ], [ - {species: 'wynaut', moves: ['faketears', 'firelash', 'silktrap']}, + { species: 'wynaut', moves: ['faketears', 'firelash', 'silktrap'] }, ]]); battle.makeChoices('auto', 'move faketears'); battle.makeChoices('auto', 'move firelash'); @@ -23,13 +23,13 @@ describe(`Defiant`, function () { assert.statStage(battle.p1.active[0], 'atk', 6); }); - it(`should not raise the user's attack when lowered by itself or an ally`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'pawniard', ability: 'defiant', moves: ['closecombat', 'sleeptalk']}, - {species: 'wynaut', moves: ['faketears', 'firelash', 'silktrap']}, + it(`should not raise the user's attack when lowered by itself or an ally`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'pawniard', ability: 'defiant', moves: ['closecombat', 'sleeptalk'] }, + { species: 'wynaut', moves: ['faketears', 'firelash', 'silktrap'] }, ], [ - {species: 'screamtail', moves: ['sleeptalk']}, - {species: 'jigglypuff', moves: ['sleeptalk']}, + { species: 'screamtail', moves: ['sleeptalk'] }, + { species: 'jigglypuff', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk, move firelash -1', 'auto'); battle.makeChoices('move closecombat 1, move faketears -1', 'auto'); diff --git a/test/sim/abilities/deltastream.js b/test/sim/abilities/deltastream.js index fadd7a717a..e5cab8fbeb 100644 --- a/test/sim/abilities/deltastream.js +++ b/test/sim/abilities/deltastream.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Delta Stream', function () { - afterEach(function () { +describe('Delta Stream', () => { + afterEach(() => { battle.destroy(); }); - it('should activate the Delta Stream weather upon switch-in', function () { + it('should activate the Delta Stream weather upon switch-in', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', moves: ['roost']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['roost'] }, ], [ - {species: "Abra", ability: 'magicguard', moves: ['teleport']}, + { species: "Abra", ability: 'magicguard', moves: ['teleport'] }, ]]); assert(battle.field.isWeather('deltastream')); }); - it('should negate the type weaknesses of the Flying-type', function () { + it('should negate the type weaknesses of the Flying-type', () => { battle = common.createBattle([[ - {species: "Tornadus", ability: 'deltastream', item: 'weaknesspolicy', moves: ['recover']}, + { species: "Tornadus", ability: 'deltastream', item: 'weaknesspolicy', moves: ['recover'] }, ], [ - {species: "Smeargle", ability: 'owntempo', moves: ['thundershock', 'powdersnow', 'powergem']}, + { species: "Smeargle", ability: 'owntempo', moves: ['thundershock', 'powdersnow', 'powergem'] }, ]]); const pokemon = battle.p1.active[0]; for (let i = 1; i <= 3; i++) { @@ -34,11 +34,11 @@ describe('Delta Stream', function () { } }); - it('should not negate the type weaknesses of any other type, even if the Pokemon is Flying-type', function () { + it('should not negate the type weaknesses of any other type, even if the Pokemon is Flying-type', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', item: 'weaknesspolicy', moves: ['recover']}, + { species: "Rayquaza", ability: 'deltastream', item: 'weaknesspolicy', moves: ['recover'] }, ], [ - {species: "Smeargle", ability: 'owntempo', moves: ['dragonpulse']}, + { species: "Smeargle", ability: 'owntempo', moves: ['dragonpulse'] }, ]]); battle.makeChoices('move recover', 'move dragonpulse'); const pokemon = battle.p1.active[0]; @@ -47,27 +47,27 @@ describe('Delta Stream', function () { assert.false.holdsItem(pokemon); }); - it('should not reduce damage from Stealth Rock', function () { + it('should not reduce damage from Stealth Rock', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'pressure', moves: ['roost']}, - {species: "Ho-Oh", ability: 'pressure', moves: ['roost']}, + { species: "Rayquaza", ability: 'pressure', moves: ['roost'] }, + { species: "Ho-Oh", ability: 'pressure', moves: ['roost'] }, ], [ - {species: "Lugia", ability: 'deltastream', moves: ['stealthrock']}, + { species: "Lugia", ability: 'deltastream', moves: ['stealthrock'] }, ]]); battle.makeChoices('move roost', 'move stealthrock'); const pokemon = battle.p1.pokemon[1]; assert.hurtsBy(pokemon, Math.floor(pokemon.maxhp / 2), () => battle.makeChoices('switch 2', 'move stealthrock')); }); - it('should prevent moves and abilities from setting the weather to Sunny Day, Rain Dance, Sandstorm, or Hail', function () { + it('should prevent moves and abilities from setting the weather to Sunny Day, Rain Dance, Sandstorm, or Hail', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand'] }, ], [ - {species: "Abra", ability: 'magicguard', moves: ['teleport']}, - {species: "Kyogre", ability: 'drizzle', moves: ['raindance']}, - {species: "Groudon", ability: 'drought', moves: ['sunnyday']}, - {species: "Tyranitar", ability: 'sandstream', moves: ['sandstorm']}, - {species: "Abomasnow", ability: 'snowwarning', moves: ['hail']}, + { species: "Abra", ability: 'magicguard', moves: ['teleport'] }, + { species: "Kyogre", ability: 'drizzle', moves: ['raindance'] }, + { species: "Groudon", ability: 'drought', moves: ['sunnyday'] }, + { species: "Tyranitar", ability: 'sandstream', moves: ['sandstorm'] }, + { species: "Abomasnow", ability: 'snowwarning', moves: ['hail'] }, ]]); for (let i = 2; i <= 5; i++) { battle.makeChoices('move helpinghand', 'switch ' + i); @@ -77,49 +77,49 @@ describe('Delta Stream', function () { } }); - it('should cause the Delta Stream weather to fade if it switches out and no other Delta Stream Pokemon are active', function () { + it('should cause the Delta Stream weather to fade if it switches out and no other Delta Stream Pokemon are active', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand']}, - {species: "Ho-Oh", ability: 'pressure', moves: ['roost']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand'] }, + { species: "Ho-Oh", ability: 'pressure', moves: ['roost'] }, ], [ - {species: "Lugia", ability: 'pressure', moves: ['roost']}, + { species: "Lugia", ability: 'pressure', moves: ['roost'] }, ]]); assert.sets(() => battle.field.isWeather('deltastream'), false, () => battle.makeChoices('switch 2', 'move roost')); }); - it('should not cause the Delta Stream weather to fade if it switches out and another Delta Stream Pokemon is active', function () { + it('should not cause the Delta Stream weather to fade if it switches out and another Delta Stream Pokemon is active', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand']}, - {species: "Ho-Oh", ability: 'pressure', moves: ['roost']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand'] }, + { species: "Ho-Oh", ability: 'pressure', moves: ['roost'] }, ], [ - {species: "Rayquaza", ability: 'deltastream', moves: ['bulkup']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['bulkup'] }, ]]); assert.constant(() => battle.field.isWeather('deltastream'), () => battle.makeChoices('switch 2', 'move bulkup')); }); - it('should cause the Delta Stream weather to fade if its ability is suppressed and no other Delta Stream Pokemon are active', function () { + it('should cause the Delta Stream weather to fade if its ability is suppressed and no other Delta Stream Pokemon are active', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand'] }, ], [ - {species: "Lugia", ability: 'pressure', moves: ['gastroacid']}, + { species: "Lugia", ability: 'pressure', moves: ['gastroacid'] }, ]]); assert.sets(() => battle.field.isWeather('deltastream'), false, () => battle.makeChoices('move helpinghand', 'move gastroacid')); }); - it('should not cause the Delta Stream weather to fade if its ability is suppressed and another Delta Stream Pokemon is active', function () { + it('should not cause the Delta Stream weather to fade if its ability is suppressed and another Delta Stream Pokemon is active', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand'] }, ], [ - {species: "Rayquaza", ability: 'deltastream', moves: ['gastroacid']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['gastroacid'] }, ]]); assert.constant(() => battle.field.isWeather('deltastream'), () => battle.makeChoices('move helpinghand', 'move gastroacid')); }); - it('should cause the Delta Stream weather to fade if its ability is changed and no other Delta Stream Pokemon are active', function () { + it('should cause the Delta Stream weather to fade if its ability is changed and no other Delta Stream Pokemon are active', () => { battle = common.createBattle([[ - {species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand']}, + { species: "Rayquaza", ability: 'deltastream', moves: ['helpinghand'] }, ], [ - {species: "Lugia", ability: 'pressure', moves: ['entrainment']}, + { species: "Lugia", ability: 'pressure', moves: ['entrainment'] }, ]]); assert.sets(() => battle.field.isWeather('deltastream'), false, () => battle.makeChoices('move helpinghand', 'move entrainment')); }); diff --git a/test/sim/abilities/desolateland.js b/test/sim/abilities/desolateland.js index 4e672dfcce..87e43c5af9 100644 --- a/test/sim/abilities/desolateland.js +++ b/test/sim/abilities/desolateland.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Desolate Land', function () { - afterEach(function () { +describe('Desolate Land', () => { + afterEach(() => { battle.destroy(); }); - it('should activate the Desolate Land weather upon switch-in', function () { + it('should activate the Desolate Land weather upon switch-in', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, ], [ - {species: "Abra", ability: 'magicguard', moves: ['teleport']}, + { species: "Abra", ability: 'magicguard', moves: ['teleport'] }, ]]); assert(battle.field.isWeather('desolateland')); }); - it('should increase the damage (not the basePower) of Fire-type attacks', function () { + it('should increase the damage (not the basePower) of Fire-type attacks', () => { battle = common.createBattle([[ - {species: 'Ninetales', ability: 'desolateland', moves: ['incinerate']}, + { species: 'Ninetales', ability: 'desolateland', moves: ['incinerate'] }, ], [ - {species: 'Cryogonal', ability: 'levitate', moves: ['splash']}, + { species: 'Cryogonal', ability: 'levitate', moves: ['splash'] }, ]]); battle.randomizer = dmg => dmg; // max damage const attacker = battle.p1.active[0]; @@ -34,35 +34,35 @@ describe('Desolate Land', function () { assert.equal(basePower, move.basePower); }); - it('should cause Water-type attacks to fail', function () { + it('should cause Water-type attacks to fail', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, ], [ - {species: "Blastoise", ability: 'torrent', moves: ['surf']}, + { species: "Blastoise", ability: 'torrent', moves: ['surf'] }, ]]); battle.makeChoices('move helpinghand', 'move surf'); assert.fullHP(battle.p1.active[0]); }); - it('should not cause Water-type Status moves to fail', function () { + it('should not cause Water-type Status moves to fail', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, ], [ - {species: "Blastoise", ability: 'torrent', moves: ['soak']}, + { species: "Blastoise", ability: 'torrent', moves: ['soak'] }, ]]); const soakTarget = battle.p1.active[0]; assert.sets(() => soakTarget.getTypes().join('/'), 'Water', () => battle.makeChoices('move helpinghand', 'move soak')); }); - it('should prevent moves and abilities from setting the weather to Sunny Day, Rain Dance, Sandstorm, or Hail', function () { + it('should prevent moves and abilities from setting the weather to Sunny Day, Rain Dance, Sandstorm, or Hail', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, ], [ - {species: "Abra", ability: 'magicguard', moves: ['teleport']}, - {species: "Kyogre", ability: 'drizzle', moves: ['raindance']}, - {species: "Groudon", ability: 'drought', moves: ['sunnyday']}, - {species: "Tyranitar", ability: 'sandstream', moves: ['sandstorm']}, - {species: "Abomasnow", ability: 'snowwarning', moves: ['hail']}, + { species: "Abra", ability: 'magicguard', moves: ['teleport'] }, + { species: "Kyogre", ability: 'drizzle', moves: ['raindance'] }, + { species: "Groudon", ability: 'drought', moves: ['sunnyday'] }, + { species: "Tyranitar", ability: 'sandstream', moves: ['sandstorm'] }, + { species: "Abomasnow", ability: 'snowwarning', moves: ['hail'] }, ]]); for (let i = 2; i <= 5; i++) { battle.makeChoices('move helpinghand', 'switch ' + i); @@ -72,15 +72,15 @@ describe('Desolate Land', function () { } }); - it('should be treated as Sunny Day for any forme, move or ability that requires it', function () { + it('should be treated as Sunny Day for any forme, move or ability that requires it', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand', 'solarbeam']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand', 'solarbeam'] }, ], [ - {species: "Castform", ability: 'forecast', moves: ['weatherball']}, - {species: "Cherrim", ability: 'flowergift', moves: ['growth']}, - {species: "Charizard", ability: 'solarpower', moves: ['roost']}, - {species: "Venusaur", ability: 'chlorophyll', moves: ['growth']}, - {species: "Toxicroak", ability: 'dryskin', moves: ['bulkup']}, + { species: "Castform", ability: 'forecast', moves: ['weatherball'] }, + { species: "Cherrim", ability: 'flowergift', moves: ['growth'] }, + { species: "Charizard", ability: 'solarpower', moves: ['roost'] }, + { species: "Venusaur", ability: 'chlorophyll', moves: ['growth'] }, + { species: "Toxicroak", ability: 'dryskin', moves: ['bulkup'] }, ]]); battle.onEvent('Hit', battle.format, (target, pokemon, move) => { if (move.id === 'weatherball') { @@ -101,69 +101,69 @@ describe('Desolate Land', function () { assert.false.fullHP(myActive[0], "Toxicroak should be hurt by Dry Skin"); }); - it('should cause the Desolate Land weather to fade if it switches out and no other Desolate Land Pokemon are active', function () { + it('should cause the Desolate Land weather to fade if it switches out and no other Desolate Land Pokemon are active', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, - {species: "Ho-Oh", ability: 'pressure', moves: ['roost']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, + { species: "Ho-Oh", ability: 'pressure', moves: ['roost'] }, ], [ - {species: "Lugia", ability: 'pressure', moves: ['roost']}, + { species: "Lugia", ability: 'pressure', moves: ['roost'] }, ]]); assert.sets(() => battle.field.isWeather('desolateland'), false, () => battle.makeChoices('switch 2', 'move roost')); }); - it('should not cause the Desolate Land weather to fade if it switches out and another Desolate Land Pokemon is active', function () { + it('should not cause the Desolate Land weather to fade if it switches out and another Desolate Land Pokemon is active', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, - {species: "Ho-Oh", ability: 'pressure', moves: ['roost']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, + { species: "Ho-Oh", ability: 'pressure', moves: ['roost'] }, ], [ - {species: "Groudon", ability: 'desolateland', moves: ['bulkup']}, + { species: "Groudon", ability: 'desolateland', moves: ['bulkup'] }, ]]); assert.constant(() => battle.field.isWeather('desolateland'), () => battle.makeChoices('switch 2', 'move bulkup')); }); - it('should cause the Desolate Land weather to fade if its ability is suppressed and no other Desolate Land Pokemon are active', function () { + it('should cause the Desolate Land weather to fade if its ability is suppressed and no other Desolate Land Pokemon are active', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, ], [ - {species: "Lugia", ability: 'pressure', moves: ['gastroacid']}, + { species: "Lugia", ability: 'pressure', moves: ['gastroacid'] }, ]]); assert.sets(() => battle.field.isWeather('desolateland'), false, () => battle.makeChoices('move helpinghand', 'move gastroacid')); }); - it('should not cause the Desolate Land weather to fade if its ability is suppressed and another Desolate Land Pokemon is active', function () { + it('should not cause the Desolate Land weather to fade if its ability is suppressed and another Desolate Land Pokemon is active', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, ], [ - {species: "Groudon", ability: 'desolateland', moves: ['gastroacid']}, + { species: "Groudon", ability: 'desolateland', moves: ['gastroacid'] }, ]]); assert.constant(() => battle.field.isWeather('desolateland'), () => battle.makeChoices('move helpinghand', 'move gastroacid')); }); - it('should cause the Desolate Land weather to fade if its ability is changed and no other Desolate Land Pokemon are active', function () { + it('should cause the Desolate Land weather to fade if its ability is changed and no other Desolate Land Pokemon are active', () => { battle = common.createBattle([[ - {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, + { species: "Groudon", ability: 'desolateland', moves: ['helpinghand'] }, ], [ - {species: "Lugia", ability: 'pressure', moves: ['entrainment']}, + { species: "Lugia", ability: 'pressure', moves: ['entrainment'] }, ]]); assert.sets(() => battle.field.isWeather('desolateland'), false, () => battle.makeChoices('move helpinghand', 'move entrainment')); }); - it('should fade after being forced out via Roar', function () { + it('should fade after being forced out via Roar', () => { battle = common.createBattle([[ - {species: 'Groudon', item: "Red Orb", moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Groudon', item: "Red Orb", moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['roar']}, + { species: 'Wynaut', moves: ['roar'] }, ]]); battle.makeChoices(); assert.false(battle.field.isWeather('desolateland')); }); - it(`should cause Water-type Natural Gift to fail`, function () { + it(`should cause Water-type Natural Gift to fail`, () => { battle = common.createBattle([[ - {species: 'Groudon', item: 'Red Orb', moves: ['sleeptalk']}, + { species: 'Groudon', item: 'Red Orb', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['naturalgift']}, + { species: 'Wynaut', moves: ['naturalgift'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p1.active[0]); diff --git a/test/sim/abilities/disguise.js b/test/sim/abilities/disguise.js index 05f587d756..0a4873e822 100644 --- a/test/sim/abilities/disguise.js +++ b/test/sim/abilities/disguise.js @@ -5,64 +5,64 @@ const common = require('./../../common'); let battle; -describe('Disguise', function () { +describe('Disguise', () => { afterEach(() => battle.destroy()); - it('should block damage from one move', function () { + it('should block damage from one move', () => { battle = common.gen(7).createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'Mewtwo', ability: 'pressure', moves: ['psystrike']}, + { species: 'Mewtwo', ability: 'pressure', moves: ['psystrike'] }, ]]); assert.false.hurts(battle.p1.active[0], () => battle.makeChoices()); assert.hurts(battle.p1.active[0], () => battle.makeChoices()); }); - it('should only block damage from the first hit of a move', function () { + it('should only block damage from the first hit of a move', () => { battle = common.gen(7).createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'Beedrill', ability: 'swarm', moves: ['twineedle']}, + { species: 'Beedrill', ability: 'swarm', moves: ['twineedle'] }, ]]); assert.hurts(battle.p1.active[0], () => battle.makeChoices()); }); - it(`should bust Disguise on self-hit confusion`, function () { - battle = common.gen(7).createBattle({forceRandomChance: true}, [[ - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + it(`should bust Disguise on self-hit confusion`, () => { + battle = common.gen(7).createBattle({ forceRandomChance: true }, [[ + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'Sableye', ability: 'prankster', moves: ['confuseray']}, + { species: 'Sableye', ability: 'prankster', moves: ['confuseray'] }, ]]); battle.makeChoices(); assert(battle.p1.active[0].abilityState.busted); }); - it('should not block damage from weather effects', function () { + it('should not block damage from weather effects', () => { battle = common.createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'Tyranitar', ability: 'sandstream', moves: ['rest']}, + { species: 'Tyranitar', ability: 'sandstream', moves: ['rest'] }, ]]); assert.hurts(battle.p1.active[0], () => battle.makeChoices()); }); - it('should not block damage from entry hazards', function () { + it('should not block damage from entry hazards', () => { battle = common.createBattle([[ - {species: 'Zangoose', ability: 'toxicboost', item: 'laggingtail', moves: ['return']}, - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + { species: 'Zangoose', ability: 'toxicboost', item: 'laggingtail', moves: ['return'] }, + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'forretress', ability: 'sturdy', item: 'redcard', moves: ['spikes']}, + { species: 'forretress', ability: 'sturdy', item: 'redcard', moves: ['spikes'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p1.active[0]); }); - it('should not block status moves or damage from status', function () { + it('should not block status moves or damage from status', () => { battle = common.createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'Ariados', ability: 'swarm', moves: ['toxicthread']}, + { species: 'Ariados', ability: 'swarm', moves: ['toxicthread'] }, ]]); const pokemon = battle.p1.active[0]; assert.sets(() => pokemon.status, 'psn', () => battle.makeChoices()); @@ -70,41 +70,41 @@ describe('Disguise', function () { assert.false.fullHP(pokemon); }); - it('should not block secondary effects from damaging moves', function () { + it('should not block secondary effects from damaging moves', () => { battle = common.gen(7).createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'Pikachu', ability: 'lightningrod', moves: ['nuzzle']}, + { species: 'Pikachu', ability: 'lightningrod', moves: ['nuzzle'] }, ]]); const pokemon = battle.p1.active[0]; assert.sets(() => pokemon.status, 'par', () => battle.makeChoices()); assert.fullHP(pokemon); }); - it('should cause Counter to deal 1 damage if it blocks a move', function () { + it('should cause Counter to deal 1 damage if it blocks a move', () => { battle = common.createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['counter']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['counter'] }, ], [ - {species: 'Weavile', ability: 'pressure', moves: ['feintattack']}, + { species: 'Weavile', ability: 'pressure', moves: ['feintattack'] }, ]]); assert.hurtsBy(battle.p2.active[0], 1, () => battle.makeChoices()); }); - it('should not trigger critical hits while active', function () { + it('should not trigger critical hits while active', () => { battle = common.createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['sleeptalk']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['sleeptalk'] }, ], [ - {species: 'Cryogonal', ability: 'noguard', moves: ['frostbreath']}, + { species: 'Cryogonal', ability: 'noguard', moves: ['frostbreath'] }, ]]); battle.makeChoices(); assert(battle.log.every(line => !line.startsWith('|-crit'))); }); - it(`should not work while Transformed`, function () { + it(`should not work while Transformed`, () => { battle = common.createBattle([[ - {species: 'Mimikyu', ability: 'disguise', moves: ['transform']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['transform'] }, ], [ - {species: 'Mimikyu', ability: 'disguise', moves: ['sleeptalk', 'aerialace']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['sleeptalk', 'aerialace'] }, ]]); battle.makeChoices(); battle.makeChoices('auto', 'move aerialace'); diff --git a/test/sim/abilities/download.js b/test/sim/abilities/download.js index 4e9725208b..aa62a66f0f 100644 --- a/test/sim/abilities/download.js +++ b/test/sim/abilities/download.js @@ -10,11 +10,11 @@ describe('Download', () => { it('should boost based on which defensive stat is higher', () => { battle = common.createBattle([[ - {species: 'porygon', moves: ['sleeptalk'], ability: 'download'}, - {species: 'furret', moves: ['sleeptalk']}, + { species: 'porygon', moves: ['sleeptalk'], ability: 'download' }, + { species: 'furret', moves: ['sleeptalk'] }, ], [ - {species: 'stonjourner', moves: ['sleeptalk']}, - {species: 'chansey', moves: ['sleeptalk']}, + { species: 'stonjourner', moves: ['sleeptalk'] }, + { species: 'chansey', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'spa', 1); battle.makeChoices('switch 2', 'switch 2'); @@ -24,21 +24,21 @@ describe('Download', () => { it('should boost Special Attack if both stats are tied', () => { battle = common.createBattle([[ - {species: 'porygon', moves: ['sleeptalk'], ability: 'download'}, + { species: 'porygon', moves: ['sleeptalk'], ability: 'download' }, ], [ - {species: 'mew', moves: ['sleeptalk']}, + { species: 'mew', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'spa', 1); assert.statStage(battle.p1.active[0], 'atk', 0); }); it('should boost based on the total of both foes in a Double Battle', () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'porygon', moves: ['sleeptalk'], ability: 'download'}, - {species: 'blissey', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'porygon', moves: ['sleeptalk'], ability: 'download' }, + { species: 'blissey', moves: ['sleeptalk'] }, ], [ - {species: 'blissey', level: 1, moves: ['sleeptalk']}, - {species: 'stonjourner', moves: ['sleeptalk']}, + { species: 'blissey', level: 1, moves: ['sleeptalk'] }, + { species: 'stonjourner', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'spa', 1); assert.statStage(battle.p1.active[0], 'atk', 0); @@ -46,10 +46,10 @@ describe('Download', () => { it('should trigger even if the foe is behind a Substitute', () => { battle = common.createBattle([[ - {species: 'furret', moves: ['sleeptalk']}, - {species: 'porygon', ability: 'download', moves: ['sleeptalk']}, + { species: 'furret', moves: ['sleeptalk'] }, + { species: 'porygon', ability: 'download', moves: ['sleeptalk'] }, ], [ - {species: 'blissey', moves: ['substitute']}, + { species: 'blissey', moves: ['substitute'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'auto'); @@ -59,10 +59,10 @@ describe('Download', () => { describe('Gen 4', () => { it('should not trigger if the foe is behind a Substitute', () => { battle = common.gen(4).createBattle([[ - {species: 'furret', moves: ['sleeptalk']}, - {species: 'porygon', ability: 'download', moves: ['sleeptalk']}, + { species: 'furret', moves: ['sleeptalk'] }, + { species: 'porygon', ability: 'download', moves: ['sleeptalk'] }, ], [ - {species: 'ampharos', moves: ['substitute']}, + { species: 'ampharos', moves: ['substitute'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'auto'); @@ -71,13 +71,13 @@ describe('Download', () => { }); it('in Double Battles, should only account for foes not behind a Substitute', () => { - battle = common.gen(4).createBattle({gameType: 'doubles'}, [[ - {species: 'furret', moves: ['sleeptalk']}, - {species: 'ampharos', moves: ['sleeptalk']}, - {species: 'porygon', ability: 'download', moves: ['sleeptalk']}, + battle = common.gen(4).createBattle({ gameType: 'doubles' }, [[ + { species: 'furret', moves: ['sleeptalk'] }, + { species: 'ampharos', moves: ['sleeptalk'] }, + { species: 'porygon', ability: 'download', moves: ['sleeptalk'] }, ], [ - {species: 'blissey', moves: ['substitute']}, - {species: 'furret', moves: ['sleeptalk', 'substitute']}, + { species: 'blissey', moves: ['substitute'] }, + { species: 'furret', moves: ['sleeptalk', 'substitute'] }, ]]); battle.makeChoices(); battle.makeChoices('move 1, switch 3', 'auto'); diff --git a/test/sim/abilities/dryskin.js b/test/sim/abilities/dryskin.js index af7e99a9f8..a09b22a36d 100644 --- a/test/sim/abilities/dryskin.js +++ b/test/sim/abilities/dryskin.js @@ -5,58 +5,58 @@ const common = require('./../../common'); let battle; -describe('Dry Skin', function () { - afterEach(function () { +describe('Dry Skin', () => { + afterEach(() => { battle.destroy(); }); - it('should take 1/8 max HP every turn that Sunny Day is active', function () { + it('should take 1/8 max HP every turn that Sunny Day is active', () => { battle = common.createBattle([[ - {species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup']}, + { species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup'] }, ], [ - {species: 'Ninetales', ability: 'flashfire', moves: ['sunnyday']}, + { species: 'Ninetales', ability: 'flashfire', moves: ['sunnyday'] }, ]]); const dryMon = battle.p1.active[0]; assert.hurtsBy(dryMon, Math.floor(dryMon.maxhp / 8), () => battle.makeChoices('move bulkup', 'move sunnyday')); }); - it('should heal 1/8 max HP every turn that Rain Dance is active', function () { + it('should heal 1/8 max HP every turn that Rain Dance is active', () => { battle = common.createBattle([[ - {species: 'Toxicroak', ability: 'dryskin', moves: ['substitute']}, + { species: 'Toxicroak', ability: 'dryskin', moves: ['substitute'] }, ], [ - {species: 'Politoed', ability: 'damp', moves: ['encore', 'raindance']}, + { species: 'Politoed', ability: 'damp', moves: ['encore', 'raindance'] }, ]]); const dryMon = battle.p1.active[0]; battle.makeChoices('move substitute', 'move encore'); assert.hurtsBy(dryMon, -Math.floor(dryMon.maxhp / 8), () => battle.makeChoices('move substitute', 'move raindance')); }); - it('should grant immunity to Water-type moves and heal 1/4 max HP', function () { + it('should grant immunity to Water-type moves and heal 1/4 max HP', () => { battle = common.createBattle([[ - {species: 'Toxicroak', ability: 'dryskin', moves: ['substitute']}, + { species: 'Toxicroak', ability: 'dryskin', moves: ['substitute'] }, ], [ - {species: 'Politoed', ability: 'damp', moves: ['watergun']}, + { species: 'Politoed', ability: 'damp', moves: ['watergun'] }, ]]); battle.makeChoices('move substitute', 'move watergun'); assert.fullHP(battle.p1.active[0]); }); - it('should cause the user to take 1.25x damage from Fire-type attacks', function () { + it('should cause the user to take 1.25x damage from Fire-type attacks', () => { battle = common.createBattle([[ - {species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup']}, + { species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup'] }, ], [ - {species: 'Haxorus', ability: 'unnerve', moves: ['incinerate']}, + { species: 'Haxorus', ability: 'unnerve', moves: ['incinerate'] }, ]]); battle.makeChoices('move bulkup', 'move incinerate'); const damage = battle.p1.active[0].maxhp - battle.p1.active[0].hp; assert.bounded(damage, [51, 61]); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle([[ - {species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup']}, + { species: 'Toxicroak', ability: 'dryskin', moves: ['bulkup'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['incinerate', 'surf']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['incinerate', 'surf'] }, ]]); battle.makeChoices('move bulkup', 'move incinerate'); const target = battle.p1.active[0]; diff --git a/test/sim/abilities/emergencyexit.js b/test/sim/abilities/emergencyexit.js index c7c8da0a9d..e7527dc776 100644 --- a/test/sim/abilities/emergencyexit.js +++ b/test/sim/abilities/emergencyexit.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -const EMPTY_IVS = {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0}; +const EMPTY_IVS = { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 0 }; -describe(`Emergency Exit`, function () { +describe(`Emergency Exit`, () => { afterEach(() => battle.destroy()); - it(`should request switch-out if damaged below 50% HP`, function () { + it(`should request switch-out if damaged below 50% HP`, () => { battle = common.createBattle([[ - {species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk'], ivs: EMPTY_IVS}, - {species: "Clefable", ability: 'unaware', moves: ['sleeptalk']}, + { species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk'], ivs: EMPTY_IVS }, + { species: "Clefable", ability: 'unaware', moves: ['sleeptalk'] }, ], [ - {species: "Raticate", ability: 'noguard', moves: ['superfang']}, + { species: "Raticate", ability: 'noguard', moves: ['superfang'] }, ]]); const eePokemon = battle.p1.active[0]; const foePokemon = battle.p2.active[0]; @@ -25,71 +25,71 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it(`should request switch-out at the end of a multi-hit move`, function () { + it(`should request switch-out at the end of a multi-hit move`, () => { battle = common.createBattle([ - [{species: "Cinccino", ability: 'skilllink', moves: ['bulletseed']}], - [{species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk']}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], + [{ species: "Cinccino", ability: 'skilllink', moves: ['bulletseed'] }], + [{ species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk'] }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], ]); battle.makeChoices('move bulletseed', 'move sleeptalk'); battle.makeChoices('move bulletseed', 'move sleeptalk'); assert.equal(battle.requestState, 'switch'); }); - it(`should request switch-out if brought below half HP by residual damage`, function () { + it(`should request switch-out if brought below half HP by residual damage`, () => { battle = common.createBattle([[ - {species: 'Crobat', moves: ['toxic']}, + { species: 'Crobat', moves: ['toxic'] }, ], [ - {species: 'Mew', ability: 'emergencyexit', moves: ['splash']}, - {species: 'Shaymin', moves: ['splash']}, + { species: 'Mew', ability: 'emergencyexit', moves: ['splash'] }, + { species: 'Shaymin', moves: ['splash'] }, ]]); battle.p2.active[0].hp = Math.floor(battle.p2.active[0].maxhp / 2 + 2); battle.makeChoices(); assert.equal(battle.requestState, 'switch'); }); - it(`should request switch-out if brought below half HP by Photon Geyser`, function () { + it(`should request switch-out if brought below half HP by Photon Geyser`, () => { battle = common.createBattle([[ - {species: "Mew", moves: ['photongeyser']}, + { species: "Mew", moves: ['photongeyser'] }, ], [ - {species: "Charmeleon", ability: 'emergencyexit', moves: ['splash']}, - {species: "Shaymin", moves: ['splash']}, + { species: "Charmeleon", ability: 'emergencyexit', moves: ['splash'] }, + { species: "Shaymin", moves: ['splash'] }, ]]); battle.makeChoices(); assert.equal(battle.requestState, 'switch'); }); - it(`should not request switch-out if attacked and healed by berry`, function () { + it(`should not request switch-out if attacked and healed by berry`, () => { battle = common.createBattle([[ - {species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk'], item: 'sitrusberry', ivs: EMPTY_IVS}, - {species: "Clefable", ability: 'unaware', moves: ['metronome']}, + { species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk'], item: 'sitrusberry', ivs: EMPTY_IVS }, + { species: "Clefable", ability: 'unaware', moves: ['metronome'] }, ], [ - {species: "Raticate", ability: 'guts', moves: ['superfang']}, + { species: "Raticate", ability: 'guts', moves: ['superfang'] }, ]]); battle.makeChoices(); assert.equal(battle.requestState, 'move'); }); - it(`should not request switch-out if fainted`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Vikavolt', item: 'choicespecs', moves: ['thunderbolt']}, - {species: 'Pyukumuku', moves: ['batonpass']}, - {species: 'Magikarp', moves: ['splash']}, + it(`should not request switch-out if fainted`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Vikavolt', item: 'choicespecs', moves: ['thunderbolt'] }, + { species: 'Pyukumuku', moves: ['batonpass'] }, + { species: 'Magikarp', moves: ['splash'] }, ], [ - {species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk']}, - {species: 'Mew', moves: ['sleeptalk']}, - {species: 'Ditto', moves: ['transform']}, + { species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk'] }, + { species: 'Mew', moves: ['sleeptalk'] }, + { species: 'Ditto', moves: ['transform'] }, ]]); battle.makeChoices('move thunderbolt 1, move batonpass', 'move sleeptalk, move sleeptalk'); assert(!battle.p2.activeRequest.forceSwitch); }); - it(`should request switch-out before end-of-turn fainted Pokemon`, function () { + it(`should request switch-out before end-of-turn fainted Pokemon`, () => { battle = common.createBattle([[ - {species: "Golisopod", item: 'blacksludge', ability: 'emergencyexit', moves: ['payback']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Golisopod", item: 'blacksludge', ability: 'emergencyexit', moves: ['payback'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ], [ - {species: "Swoobat", ability: 'noguard', moves: ['superfang']}, - {species: "Stufful", moves: ['sleeptalk']}, + { species: "Swoobat", ability: 'noguard', moves: ['superfang'] }, + { species: "Stufful", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.p1.activeRequest.forceSwitch); @@ -97,10 +97,10 @@ describe(`Emergency Exit`, function () { assert(!battle.p2.activeRequest.forceSwitch); }); - it(`should request switch-out after taking hazard damage`, function () { + it(`should request switch-out after taking hazard damage`, () => { battle = common.createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', moves: ['uturn', 'sleeptalk']}, {species: "Magikarp", ability: 'swiftswim', moves: ['splash']}], - [{species: "Arceus-Flying", ability: 'ironbarbs', moves: ['stealthrock', 'spikes', 'dragonascent']}], + [{ species: "Golisopod", ability: 'emergencyexit', moves: ['uturn', 'sleeptalk'] }, { species: "Magikarp", ability: 'swiftswim', moves: ['splash'] }], + [{ species: "Arceus-Flying", ability: 'ironbarbs', moves: ['stealthrock', 'spikes', 'dragonascent'] }], ]); battle.makeChoices('move uturn', 'move stealthrock'); battle.makeChoices('switch 2', ''); @@ -112,35 +112,35 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it('should request switch-out after taking Life Orb recoil', function () { + it('should request switch-out after taking Life Orb recoil', () => { battle = common.createBattle([[ - {species: "Golisopod", item: "lifeorb", ability: 'emergencyexit', moves: ['peck']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Golisopod", item: "lifeorb", ability: 'emergencyexit', moves: ['peck'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ], [ - {species: "stufful", ability: 'compoundeyes', moves: ['superfang']}, + { species: "stufful", ability: 'compoundeyes', moves: ['superfang'] }, ]]); battle.makeChoices(); assert.equal(battle.requestState, 'switch'); }); - it('should request switch-out after taking Mind Blown self-damage', function () { + it('should request switch-out after taking Mind Blown self-damage', () => { battle = common.createBattle([[ - {species: "Golisopod", ability: 'emergencyexit', moves: ['mindblown']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Golisopod", ability: 'emergencyexit', moves: ['mindblown'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ], [ - {species: "chansey", moves: ['sleeptalk']}, + { species: "chansey", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.requestState, 'switch'); }); - it.skip('should request switch-out after taking recoil and dragging in an opponent', function () { + it.skip('should request switch-out after taking recoil and dragging in an opponent', () => { battle = common.createBattle([[ - {species: "Golisopod", ability: 'emergencyexit', moves: ['dragontail']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Golisopod", ability: 'emergencyexit', moves: ['dragontail'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ], [ - {species: "Sharpedo", item: 'rockyhelmet', ability: 'noguard', moves: ['superfang']}, - {species: "Stufful", moves: ['sleeptalk']}, + { species: "Sharpedo", item: 'rockyhelmet', ability: 'noguard', moves: ['superfang'] }, + { species: "Stufful", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const log = battle.getDebugLog(); @@ -150,10 +150,10 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it(`should not request switch-out after taking entry hazard damage and getting healed by berry`, function () { + it(`should not request switch-out after taking entry hazard damage and getting healed by berry`, () => { battle = common.createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', moves: ['uturn', 'sleeptalk'], item: 'sitrusberry'}, {species: "Magikarp", ability: 'swiftswim', moves: ['splash']}], - [{species: "Ferrothorn", ability: 'ironbarbs', moves: ['stealthrock', 'spikes', 'protect']}], + [{ species: "Golisopod", ability: 'emergencyexit', moves: ['uturn', 'sleeptalk'], item: 'sitrusberry' }, { species: "Magikarp", ability: 'swiftswim', moves: ['splash'] }], + [{ species: "Ferrothorn", ability: 'ironbarbs', moves: ['stealthrock', 'spikes', 'protect'] }], ]); battle.makeChoices('move uturn', 'move stealthrock'); battle.makeChoices('switch 2', ''); @@ -164,10 +164,10 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'move'); }); - it(`should not request switch-out after taking poison damage and getting healed by berry`, function () { + it(`should not request switch-out after taking poison damage and getting healed by berry`, () => { battle = common.createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', moves: ['substitute', 'sleeptalk'], item: 'sitrusberry'}, {species: "Magikarp", moves: ['splash']}], - [{species: "Gengar", moves: ['toxic', 'nightshade', 'protect']}], + [{ species: "Golisopod", ability: 'emergencyexit', moves: ['substitute', 'sleeptalk'], item: 'sitrusberry' }, { species: "Magikarp", moves: ['splash'] }], + [{ species: "Gengar", moves: ['toxic', 'nightshade', 'protect'] }], ]); battle.makeChoices('move substitute', 'move toxic'); battle.makeChoices('move sleeptalk', 'move nightshade'); @@ -175,10 +175,10 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'move'); }); - it(`should not request switch-out on usage of Substitute`, function () { + it(`should not request switch-out on usage of Substitute`, () => { battle = common.createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', moves: ['substitute'], ivs: EMPTY_IVS}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], - [{species: "Deoxys-Attack", ability: 'pressure', item: 'laggingtail', moves: ['thunderbolt']}], + [{ species: "Golisopod", ability: 'emergencyexit', moves: ['substitute'], ivs: EMPTY_IVS }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], + [{ species: "Deoxys-Attack", ability: 'pressure', item: 'laggingtail', moves: ['thunderbolt'] }], ]); const eePokemon = battle.p1.active[0]; battle.makeChoices('move substitute', 'move thunderbolt'); @@ -188,13 +188,13 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'move'); }); - it(`should prevent Volt Switch after switches`, function () { + it(`should prevent Volt Switch after switches`, () => { battle = common.createBattle([[ - {species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk'], ivs: EMPTY_IVS}, - {species: 'Clefable', moves: ['sleeptalk']}, + { species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk'], ivs: EMPTY_IVS }, + { species: 'Clefable', moves: ['sleeptalk'] }, ], [ - {species: 'Eelektrik', moves: ['voltswitch']}, - {species: 'Clefable', moves: ['sleeptalk']}, + { species: 'Eelektrik', moves: ['voltswitch'] }, + { species: 'Clefable', moves: ['sleeptalk'] }, ]]); const eePokemon = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'move voltswitch'); @@ -206,10 +206,10 @@ describe(`Emergency Exit`, function () { assert.species(battle.p2.active[0], 'Eelektrik'); }); - it(`should not prevent Red Card's activation`, function () { + it(`should not prevent Red Card's activation`, () => { battle = common.createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', item: 'redcard', moves: ['sleeptalk'], ivs: EMPTY_IVS}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], - [{species: "Raticate", ability: 'guts', moves: ['superfang']}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], + [{ species: "Golisopod", ability: 'emergencyexit', item: 'redcard', moves: ['sleeptalk'], ivs: EMPTY_IVS }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], + [{ species: "Raticate", ability: 'guts', moves: ['superfang'] }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], ]); const eePokemon = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'move superfang'); @@ -223,10 +223,10 @@ describe(`Emergency Exit`, function () { assert.species(battle.p2.active[0], 'Clefable'); }); - it(`should not prevent Eject Button's activation`, function () { + it(`should not prevent Eject Button's activation`, () => { battle = common.createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', item: 'ejectbutton', moves: ['sleeptalk'], ivs: EMPTY_IVS}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], - [{species: "Raticate", ability: 'guts', moves: ['superfang']}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], + [{ species: "Golisopod", ability: 'emergencyexit', item: 'ejectbutton', moves: ['sleeptalk'], ivs: EMPTY_IVS }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], + [{ species: "Raticate", ability: 'guts', moves: ['superfang'] }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], ]); const eePokemon = battle.p1.active[0]; battle.makeChoices('auto', 'auto'); @@ -239,12 +239,12 @@ describe(`Emergency Exit`, function () { assert.species(battle.p1.active[0], 'Clefable'); }); - it(`should be suppressed by Sheer Force`, function () { + it(`should be suppressed by Sheer Force`, () => { battle = common.createBattle([[ - {species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk'], ivs: EMPTY_IVS}, - {species: "Clefable", moves: ['sleeptalk']}, + { species: "Golisopod", ability: 'emergencyexit', moves: ['sleeptalk'], ivs: EMPTY_IVS }, + { species: "Clefable", moves: ['sleeptalk'] }, ], [ - {species: "Nidoking", ability: 'sheerforce', moves: ['thunderbolt']}, + { species: "Nidoking", ability: 'sheerforce', moves: ['thunderbolt'] }, ]]); const eePokemon = battle.p1.active[0]; battle.makeChoices(); @@ -252,12 +252,12 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'move'); }); - it('should not request switchout if its HP is already below 50%', function () { + it('should not request switchout if its HP is already below 50%', () => { battle = common.createBattle([[ - {species: "Golisopod", evs: {hp: 4}, ability: 'emergencyexit', moves: ['sleeptalk', 'tackle']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Golisopod", evs: { hp: 4 }, ability: 'emergencyexit', moves: ['sleeptalk', 'tackle'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ], [ - {species: "stufful", ability: 'compoundeyes', moves: ['superfang', 'sleeptalk']}, + { species: "stufful", ability: 'compoundeyes', moves: ['superfang', 'sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2'); @@ -268,12 +268,12 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'move'); }); - it('should request switchout if its HP was restored to above 50% and brought down again', function () { + it('should request switchout if its HP was restored to above 50% and brought down again', () => { battle = common.createBattle([[ - {species: "Golisopod", evs: {hp: 4}, ability: 'emergencyexit', moves: ['sleeptalk']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Golisopod", evs: { hp: 4 }, ability: 'emergencyexit', moves: ['sleeptalk'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ], [ - {species: "stufful", ability: 'compoundeyes', moves: ['superfang', 'healpulse']}, + { species: "stufful", ability: 'compoundeyes', moves: ['superfang', 'healpulse'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2'); @@ -284,22 +284,22 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it('should not request switchout if its HP is already below 50% and an effect heals it', function () { + it('should not request switchout if its HP is already below 50% and an effect heals it', () => { battle = common.createBattle([[ - {species: "Golisopod", level: 65, item: 'figyberry', ability: 'emergencyexit', moves: ['sleeptalk']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Golisopod", level: 65, item: 'figyberry', ability: 'emergencyexit', moves: ['sleeptalk'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ], [ - {species: "ursaring", ability: 'sheerforce', moves: ['falseswipe', 'crunch']}, + { species: "ursaring", ability: 'sheerforce', moves: ['falseswipe', 'crunch'] }, ]]); battle.makeChoices('auto', 'move crunch'); battle.makeChoices(); assert.equal(battle.requestState, 'move'); }); - it('should request switchout if its HP drops to below 50% while dynamaxed', function () { + it('should request switchout if its HP drops to below 50% while dynamaxed', () => { battle = common.gen(8).createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', moves: ['closecombat'], ivs: EMPTY_IVS, level: 30}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], - [{species: "Gengar", ability: 'cursedbody', moves: ['nightshade']}], + [{ species: "Golisopod", ability: 'emergencyexit', moves: ['closecombat'], ivs: EMPTY_IVS, level: 30 }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], + [{ species: "Gengar", ability: 'cursedbody', moves: ['nightshade'] }], ]); const eePokemon = battle.p1.active[0]; battle.makeChoices('move maxknuckle dynamax', 'move nightshade'); @@ -307,10 +307,10 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it('should not request switchout if its HP is below 50% when its dynamax ends', function () { + it('should not request switchout if its HP is below 50% when its dynamax ends', () => { battle = common.gen(8).createBattle([ - [{species: "Golisopod", ability: 'emergencyexit', moves: ['drillrun'], ivs: EMPTY_IVS}, {species: "Clefable", ability: 'Unaware', moves: ['metronome']}], - [{species: "Landorus", ability: 'sheerforce', moves: ['sludgewave']}], + [{ species: "Golisopod", ability: 'emergencyexit', moves: ['drillrun'], ivs: EMPTY_IVS }, { species: "Clefable", ability: 'Unaware', moves: ['metronome'] }], + [{ species: "Landorus", ability: 'sheerforce', moves: ['sludgewave'] }], ]); const eePokemon = battle.p1.active[0]; battle.makeChoices('move maxquake dynamax', 'move sludgewave'); @@ -321,12 +321,12 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'move'); }); - it.skip(`should request switchout between hazards`, function () { + it.skip(`should request switchout between hazards`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['sleeptalk', 'uturn']}, - {species: 'volcarona', ability: 'emergencyexit', evs: {hp: 4}, moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk', 'uturn'] }, + { species: 'volcarona', ability: 'emergencyexit', evs: { hp: 4 }, moves: ['sleeptalk'] }, ], [ - {species: 'landorus', moves: ['stealthrock', 'spikes']}, + { species: 'landorus', moves: ['stealthrock', 'spikes'] }, ]]); battle.makeChoices(); battle.makeChoices('move uturn', 'move spikes'); @@ -336,15 +336,15 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it.skip(`should request switchout between residual damage`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Coalossal', level: 1, item: 'Eject Button', moves: ['rockthrow', 'sleeptalk'], gigantamax: true}, - {species: 'Wynaut', level: 1, moves: ['sleeptalk', 'grasspledge']}, - {species: 'Wynaut', level: 1, moves: ['sleeptalk', 'firepledge']}, + it.skip(`should request switchout between residual damage`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Coalossal', level: 1, item: 'Eject Button', moves: ['rockthrow', 'sleeptalk'], gigantamax: true }, + { species: 'Wynaut', level: 1, moves: ['sleeptalk', 'grasspledge'] }, + { species: 'Wynaut', level: 1, moves: ['sleeptalk', 'firepledge'] }, ], [ - {species: 'Blissey', moves: ['sleeptalk']}, - {species: 'Amoonguss', ability: 'noguard', moves: ['sleeptalk', 'superfang']}, - {species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk']}, + { species: 'Blissey', moves: ['sleeptalk'] }, + { species: 'Amoonguss', ability: 'noguard', moves: ['sleeptalk', 'superfang'] }, + { species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk'] }, ]]); // Set up Volcalith and Sea of Fire @@ -368,12 +368,12 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it(`should request a switchout after taking regular recoil damage`, function () { + it(`should request a switchout after taking regular recoil damage`, () => { battle = common.createBattle([[ - {species: 'Golisopod', ability: 'Emergency Exit', moves: ['flareblitz']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Golisopod', ability: 'Emergency Exit', moves: ['flareblitz'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Chansey', moves: ['sleeptalk']}, + { species: 'Chansey', moves: ['sleeptalk'] }, ]]); const eePokemon = battle.p1.active[0]; battle.makeChoices(); @@ -381,12 +381,12 @@ describe(`Emergency Exit`, function () { assert.equal(battle.requestState, 'switch'); }); - it(`should request a switchout after taking struggle recoil damage`, function () { + it(`should request a switchout after taking struggle recoil damage`, () => { battle = common.createBattle([[ - {species: 'Golisopod', item: 'Assault Vest', ability: 'Emergency Exit', moves: ['protect']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Golisopod', item: 'Assault Vest', ability: 'Emergency Exit', moves: ['protect'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices(); diff --git a/test/sim/abilities/flashfire.js b/test/sim/abilities/flashfire.js index 12de8cf813..3811fe4c2d 100644 --- a/test/sim/abilities/flashfire.js +++ b/test/sim/abilities/flashfire.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Flash Fire', function () { - afterEach(function () { +describe('Flash Fire', () => { + afterEach(() => { battle.destroy(); }); - it('should grant immunity to Fire-type moves and increase Fire-type attacks by 50% once activated', function () { + it('should grant immunity to Fire-type moves and increase Fire-type attacks by 50% once activated', () => { battle = common.createBattle([[ - {species: 'Heatran', ability: 'flashfire', moves: ['incinerate']}, + { species: 'Heatran', ability: 'flashfire', moves: ['incinerate'] }, ], [ - {species: 'Talonflame', ability: 'galewings', moves: ['flareblitz']}, + { species: 'Talonflame', ability: 'galewings', moves: ['flareblitz'] }, ]]); const [flashMon, foePokemon] = [battle.p1.active[0], battle.p2.active[0]]; battle.makeChoices('move incinerate', 'move flareblitz'); @@ -23,31 +23,31 @@ describe('Flash Fire', function () { assert.bounded(damage, [82, 97]); }); - it('should grant Fire-type immunity even if the user is frozen', function () { + it('should grant Fire-type immunity even if the user is frozen', () => { battle = common.createBattle([[ - {species: 'Heatran', ability: 'flashfire', moves: ['sleeptalk']}, + { species: 'Heatran', ability: 'flashfire', moves: ['sleeptalk'] }, ], [ - {species: 'Talonflame', ability: 'galewings', moves: ['flareblitz']}, + { species: 'Talonflame', ability: 'galewings', moves: ['flareblitz'] }, ]]); const flashMon = battle.p1.active[0]; flashMon.setStatus('frz'); assert.false.hurts(flashMon, () => battle.makeChoices('move sleeptalk', 'move flareblitz')); }); - it('should have its Fire-type immunity suppressed by Mold Breaker', function () { + it('should have its Fire-type immunity suppressed by Mold Breaker', () => { battle = common.createBattle([[ - {species: 'Heatran', ability: 'flashfire', moves: ['incinerate']}, + { species: 'Heatran', ability: 'flashfire', moves: ['incinerate'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['firepunch']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['firepunch'] }, ]]); assert.hurts(battle.p1.active[0], () => battle.makeChoices('move incinerate', 'move firepunch')); }); - it(`should lose the Flash Fire boost if its ability is changed`, function () { + it(`should lose the Flash Fire boost if its ability is changed`, () => { battle = common.createBattle([[ - {species: 'Heatran', ability: 'flashfire', moves: ['sleeptalk', 'incinerate']}, + { species: 'Heatran', ability: 'flashfire', moves: ['sleeptalk', 'incinerate'] }, ], [ - {species: 'Talonflame', ability: 'shellarmor', moves: ['flamethrower', 'worryseed']}, + { species: 'Talonflame', ability: 'shellarmor', moves: ['flamethrower', 'worryseed'] }, ]]); battle.makeChoices('move sleeptalk', 'move flamethrower'); battle.makeChoices('move incinerate', 'move worryseed'); @@ -57,16 +57,16 @@ describe('Flash Fire', function () { }); }); -describe('Flash Fire [Gen 3-4]', function () { - afterEach(function () { +describe('Flash Fire [Gen 3-4]', () => { + afterEach(() => { battle.destroy(); }); - it('should activate and grant Fire-type immunity even if the user is frozen in Gen 3', function () { + it('should activate and grant Fire-type immunity even if the user is frozen in Gen 3', () => { battle = common.gen(3).createBattle([[ - {species: 'Arcanine', ability: 'flashfire', moves: ['sleeptalk']}, + { species: 'Arcanine', ability: 'flashfire', moves: ['sleeptalk'] }, ], [ - {species: 'Charizard', ability: 'blaze', moves: ['flamethrower']}, + { species: 'Charizard', ability: 'blaze', moves: ['flamethrower'] }, ]]); const flashFireMon = battle.p1.active[0]; flashFireMon.setStatus('frz'); @@ -74,11 +74,11 @@ describe('Flash Fire [Gen 3-4]', function () { assert.notEqual(flashFireMon.hp, flashFireMon.maxhp); }); - it('should activate and grant Fire-type immunity even if the user is frozen in Gen 4', function () { + it('should activate and grant Fire-type immunity even if the user is frozen in Gen 4', () => { battle = common.gen(4).createBattle([[ - {species: 'Heatran', ability: 'flashfire', moves: ['sleeptalk']}, + { species: 'Heatran', ability: 'flashfire', moves: ['sleeptalk'] }, ], [ - {species: 'Charizard', ability: 'blaze', moves: ['flamethrower']}, + { species: 'Charizard', ability: 'blaze', moves: ['flamethrower'] }, ]]); const flashFireMon = battle.p1.active[0]; flashFireMon.setStatus('frz'); diff --git a/test/sim/abilities/flowergift.js b/test/sim/abilities/flowergift.js index a76edbef5b..1054f84c14 100644 --- a/test/sim/abilities/flowergift.js +++ b/test/sim/abilities/flowergift.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Flower Gift', function () { - afterEach(function () { +describe('Flower Gift', () => { + afterEach(() => { battle.destroy(); }); - it(`should boost allies' Attack and Special Defense stats`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Cherrim", ability: 'flowergift', moves: ['healbell']}, - {species: "Snorlax", ability: 'immunity', moves: ['healbell']}, + it(`should boost allies' Attack and Special Defense stats`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Cherrim", ability: 'flowergift', moves: ['healbell'] }, + { species: "Snorlax", ability: 'immunity', moves: ['healbell'] }, ], [ - {species: "Blissey", ability: 'serenegrace', moves: ['healbell']}, - {species: "Blissey", ability: 'serenegrace', moves: ['healbell']}, + { species: "Blissey", ability: 'serenegrace', moves: ['healbell'] }, + { species: "Blissey", ability: 'serenegrace', moves: ['healbell'] }, ]]); const cherAtk = battle.p1.active[0].getStat('atk'); @@ -32,13 +32,13 @@ describe('Flower Gift', function () { assert.equal(battle.p1.active[1].getStat('spd'), battle.modify(baseSpd, 1.5)); }); - it(`should still work if Cherrim transforms into something with Flower Gift without originally having it`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Cherrim", ability: 'serenegrace', moves: ['transform']}, - {species: "Snorlax", ability: 'immunity', moves: ['healbell']}, + it(`should still work if Cherrim transforms into something with Flower Gift without originally having it`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Cherrim", ability: 'serenegrace', moves: ['transform'] }, + { species: "Snorlax", ability: 'immunity', moves: ['healbell'] }, ], [ - {species: "Blissey", ability: 'flowergift', moves: ['healbell']}, - {species: "Blissey", ability: 'flowergift', moves: ['healbell']}, + { species: "Blissey", ability: 'flowergift', moves: ['healbell'] }, + { species: "Blissey", ability: 'flowergift', moves: ['healbell'] }, ]]); battle.makeChoices('move transform 1, move healbell', 'move healbell, move healbell'); @@ -55,12 +55,12 @@ describe('Flower Gift', function () { assert.equal(battle.p1.active[1].getStat('spd'), battle.modify(baseSpd, 1.5)); }); - it(`should not trigger if the Pokemon was KOed`, function () { + it(`should not trigger if the Pokemon was KOed`, () => { // TODO: Is this interaction possible in Gen 9? battle = common.gen(8).createBattle([[ - {species: 'Cherrim', ability: 'flowergift', moves: ['sleeptalk']}, + { species: 'Cherrim', ability: 'flowergift', moves: ['sleeptalk'] }, ], [ - {species: 'Heatran', moves: ['blastburn']}, + { species: 'Heatran', moves: ['blastburn'] }, ]]); battle.makeChoices('auto', 'move blastburn dynamax'); assert(battle.log.every(line => !line.startsWith('|-formechange'))); diff --git a/test/sim/abilities/flowerveil.js b/test/sim/abilities/flowerveil.js index 435e0f43e2..ae0107f96d 100644 --- a/test/sim/abilities/flowerveil.js +++ b/test/sim/abilities/flowerveil.js @@ -1,4 +1,3 @@ - 'use strict'; const assert = require('./../../assert'); @@ -6,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Flower Veil', function () { - afterEach(function () { +describe('Flower Veil', () => { + afterEach(() => { battle.destroy(); }); - it(`should block status conditions and stat drops on Grass-type Pokemon and its allies`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Breloom', moves: ['sleeptalk']}, - {species: 'Venusaur', ability: 'flowerveil', moves: ['sleeptalk']}, + it(`should block status conditions and stat drops on Grass-type Pokemon and its allies`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Breloom', moves: ['sleeptalk'] }, + { species: 'Venusaur', ability: 'flowerveil', moves: ['sleeptalk'] }, ], [ - {species: 'Persian', moves: ['sandattack']}, - {species: 'Raticate', moves: ['glare']}, + { species: 'Persian', moves: ['sandattack'] }, + { species: 'Raticate', moves: ['glare'] }, ]]); battle.makeChoices('auto', 'move sandattack 1, move glare 1'); @@ -32,14 +31,14 @@ describe('Flower Veil', function () { assert.statStage(venusaur, 'accuracy', 0); }); - it(`should not stop an ally from falling asleep when Yawn was already affecting it`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Breloom', moves: ['sleeptalk']}, - {species: 'Heatran', moves: ['sleeptalk']}, - {species: 'Florges', ability: 'flowerveil', moves: ['sleeptalk']}, + it(`should not stop an ally from falling asleep when Yawn was already affecting it`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Breloom', moves: ['sleeptalk'] }, + { species: 'Heatran', moves: ['sleeptalk'] }, + { species: 'Florges', ability: 'flowerveil', moves: ['sleeptalk'] }, ], [ - {species: 'Persian', moves: ['sleeptalk', 'yawn']}, - {species: 'Raticate', moves: ['sleeptalk']}, + { species: 'Persian', moves: ['sleeptalk', 'yawn'] }, + { species: 'Raticate', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk, move sleeptalk', 'move yawn 1, move sleeptalk'); diff --git a/test/sim/abilities/frisk.js b/test/sim/abilities/frisk.js index 1eeb819dff..e4407ffb9e 100644 --- a/test/sim/abilities/frisk.js +++ b/test/sim/abilities/frisk.js @@ -5,32 +5,32 @@ const common = require('./../../common'); let battle; -describe('Frisk', function () { - afterEach(function () { +describe('Frisk', () => { + afterEach(() => { battle.destroy(); }); - it(`should reveal opposing Pokemon's items`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Dusclops', ability: 'frisk', moves: ['snore']}, - {species: 'Duskull', ability: 'levitate', moves: ['snore']}, + it(`should reveal opposing Pokemon's items`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Dusclops', ability: 'frisk', moves: ['snore'] }, + { species: 'Duskull', ability: 'levitate', moves: ['snore'] }, ], [ - {species: 'Spectrier', ability: 'grimneigh', item: 'choicespecs', moves: ['shadowball']}, - {species: 'Glastrier', ability: 'chillingneigh', item: 'choiceband', moves: ['avalanche']}, + { species: 'Spectrier', ability: 'grimneigh', item: 'choicespecs', moves: ['shadowball'] }, + { species: 'Glastrier', ability: 'chillingneigh', item: 'choiceband', moves: ['avalanche'] }, ]]); const log = battle.getDebugLog(); assert(log.indexOf('Spectrier|Choice Specs') > -1, "Frisk should have revealed Spectrier's Choice Specs"); assert(log.indexOf('Glastrier|Choice Band') > -1, "Frisk should have revealed Glastrier's Choice Band"); }); - it(`should not reveal opposing fainted Pokemon's items`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Dusclops', ability: 'frisk', moves: ['snore']}, - {species: 'Duskull', ability: 'levitate', moves: ['snore']}, + it(`should not reveal opposing fainted Pokemon's items`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Dusclops', ability: 'frisk', moves: ['snore'] }, + { species: 'Duskull', ability: 'levitate', moves: ['snore'] }, ], [ - {species: 'Pikachu', ability: 'static', item: 'lightball', moves: ['snore']}, - {species: 'Weezing', ability: 'neutralizinggas', item: 'choiceband', moves: ['explosion']}, - {species: 'Pichu', ability: 'static', moves: ['snore']}, + { species: 'Pikachu', ability: 'static', item: 'lightball', moves: ['snore'] }, + { species: 'Weezing', ability: 'neutralizinggas', item: 'choiceband', moves: ['explosion'] }, + { species: 'Pichu', ability: 'static', moves: ['snore'] }, ]]); battle.makeChoices(); assert.false(battle.log.find(line => line.startsWith('|-item|')), diff --git a/test/sim/abilities/gluttony.js b/test/sim/abilities/gluttony.js index d2e2fe7e7e..ce521045b3 100644 --- a/test/sim/abilities/gluttony.js +++ b/test/sim/abilities/gluttony.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Gluttony', function () { - afterEach(function () { +describe('Gluttony', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate Aguav Berry at 50% health`, function () { + it(`should activate Aguav Berry at 50% health`, () => { battle = common.createBattle([[ - {species: "wobbuffet", ability: 'gluttony', item: 'aguavberry', evs: {hp: 4}, moves: ['sleeptalk']}, + { species: "wobbuffet", ability: 'gluttony', item: 'aguavberry', evs: { hp: 4 }, moves: ['sleeptalk'] }, ], [ - {species: "wynaut", ability: 'compoundeyes', moves: ['superfang']}, + { species: "wynaut", ability: 'compoundeyes', moves: ['superfang'] }, ]]); battle.makeChoices(); @@ -22,11 +22,11 @@ describe('Gluttony', function () { assert.equal(wobbuffet.hp, Math.floor(wobbuffet.maxhp / 2) + Math.floor(wobbuffet.maxhp / 3)); }); - it(`should activate after Belly Drum`, function () { + it(`should activate after Belly Drum`, () => { battle = common.createBattle([[ - {species: "snorlax", ability: 'gluttony', item: 'aguavberry', evs: {hp: 4}, moves: ['bellydrum']}, + { species: "snorlax", ability: 'gluttony', item: 'aguavberry', evs: { hp: 4 }, moves: ['bellydrum'] }, ], [ - {species: "wynaut", moves: ['sleeptalk']}, + { species: "wynaut", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -34,11 +34,11 @@ describe('Gluttony', function () { assert.equal(snorlax.hp, Math.floor(snorlax.maxhp / 2) + Math.floor(snorlax.maxhp / 3)); }); - it(`should activate after poison damage`, function () { + it(`should activate after poison damage`, () => { battle = common.createBattle([[ - {species: "wobbuffet", ability: 'gluttony', item: 'aguavberry', evs: {hp: 28}, moves: ['sleeptalk']}, + { species: "wobbuffet", ability: 'gluttony', item: 'aguavberry', evs: { hp: 28 }, moves: ['sleeptalk'] }, ], [ - {species: "wynaut", ability: 'noguard', moves: ['poisonpowder']}, + { species: "wynaut", ability: 'noguard', moves: ['poisonpowder'] }, ]]); for (let i = 0; i < 4; i++) battle.makeChoices(); diff --git a/test/sim/abilities/guarddog.js b/test/sim/abilities/guarddog.js index afc149fddd..ea101db26d 100644 --- a/test/sim/abilities/guarddog.js +++ b/test/sim/abilities/guarddog.js @@ -5,7 +5,7 @@ const common = require('./../../common'); let battle; -const GUARD_DOG_MON = {species: "Mabosstiff", ability: 'guarddog', moves: ['sleeptalk']}; +const GUARD_DOG_MON = { species: "Mabosstiff", ability: 'guarddog', moves: ['sleeptalk'] }; describe("Guard Dog", () => { afterEach(() => battle.destroy()); @@ -14,7 +14,7 @@ describe("Guard Dog", () => { battle = common.createBattle([[ GUARD_DOG_MON, ], [ - {species: 'sandile', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'sandile', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'atk', 1); @@ -23,9 +23,9 @@ describe("Guard Dog", () => { it("should prevent phazing", () => { battle = common.createBattle([[ GUARD_DOG_MON, - {species: 'azumarill', ability: 'thickfat', moves: ['rollout']}, + { species: 'azumarill', ability: 'thickfat', moves: ['rollout'] }, ], [ - {species: 'shinx', ability: 'rivalry', moves: ['roar']}, + { species: 'shinx', ability: 'rivalry', moves: ['roar'] }, ]]); battle.makeChoices(); assert.species(battle.p1.active[0], GUARD_DOG_MON.species); @@ -34,9 +34,9 @@ describe("Guard Dog", () => { it("should be bypassed by Mold Breaker", () => { battle = common.createBattle([[ GUARD_DOG_MON, - {species: 'azumarill', ability: 'thickfat', moves: ['rollout']}, + { species: 'azumarill', ability: 'thickfat', moves: ['rollout'] }, ], [ - {species: 'shinx', ability: 'moldbreaker', moves: ['roar']}, + { species: 'shinx', ability: 'moldbreaker', moves: ['roar'] }, ]]); battle.makeChoices(); assert.species(battle.p1.active[0], "Azumarill"); diff --git a/test/sim/abilities/gulpmissile.js b/test/sim/abilities/gulpmissile.js index c5e6b44738..fb8b0e196c 100644 --- a/test/sim/abilities/gulpmissile.js +++ b/test/sim/abilities/gulpmissile.js @@ -5,36 +5,36 @@ const common = require('./../../common'); let battle; -describe('Gulp Missile', function () { - afterEach(function () { +describe('Gulp Missile', () => { + afterEach(() => { battle.destroy(); }); - it(`should retrieve a catch on the first turn of Dive`, function () { + it(`should retrieve a catch on the first turn of Dive`, () => { battle = common.createBattle([[ - {species: 'cramorant', ability: 'gulpmissile', moves: ['dive']}, + { species: 'cramorant', ability: 'gulpmissile', moves: ['dive'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.species(battle.p1.active[0], 'Cramorant-Gulping'); }); - it(`should retrieve a catch only if the move was successful`, function () { + it(`should retrieve a catch only if the move was successful`, () => { battle = common.createBattle([[ - {species: 'cramorant', ability: 'gulpmissile', moves: ['surf']}, + { species: 'cramorant', ability: 'gulpmissile', moves: ['surf'] }, ], [ - {species: 'lapras', ability: 'waterabsorb', moves: ['sleeptalk']}, + { species: 'lapras', ability: 'waterabsorb', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.species(battle.p1.active[0], 'Cramorant-Gulping'); }); - it(`should not spit out its catch if the Cramorant is semi-invulnerable`, function () { + it(`should not spit out its catch if the Cramorant is semi-invulnerable`, () => { battle = common.createBattle([[ - {species: 'cramorant', ability: 'gulpmissile', moves: ['dive']}, + { species: 'cramorant', ability: 'gulpmissile', moves: ['dive'] }, ], [ - {species: 'ludicolo', ability: 'noguard', moves: ['sleeptalk', 'machpunch']}, + { species: 'ludicolo', ability: 'noguard', moves: ['sleeptalk', 'machpunch'] }, ]]); battle.makeChoices(); battle.makeChoices('auto', 'move machpunch'); @@ -42,11 +42,11 @@ describe('Gulp Missile', function () { assert.statStage(battle.p2.active[0], 'def', 0); }); - it(`should change forms before damage calculation`, function () { + it(`should change forms before damage calculation`, () => { battle = common.createBattle([[ - {species: 'cramorant', ability: 'gulpmissile', moves: ['surf']}, + { species: 'cramorant', ability: 'gulpmissile', moves: ['surf'] }, ], [ - {species: 'sceptile', ability: 'shellarmor', moves: ['magicpowder']}, + { species: 'sceptile', ability: 'shellarmor', moves: ['magicpowder'] }, ]]); battle.makeChoices(); const sceptile = battle.p2.active[0]; @@ -54,13 +54,13 @@ describe('Gulp Missile', function () { assert.bounded(damage, [48, 57], `Cramorant should have received STAB in damage calculation`); }); - describe(`Hackmons Cramorant`, function () { - it(`should be sent out as the hacked form`, function () { + describe(`Hackmons Cramorant`, () => { + it(`should be sent out as the hacked form`, () => { battle = common.createBattle([[ - {species: 'cramorantgulping', ability: 'gulpmissile', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'cramorantgulping', ability: 'gulpmissile', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'togepi', moves: ['fairywind']}, + { species: 'togepi', moves: ['fairywind'] }, ]]); battle.makeChoices(); @@ -73,11 +73,11 @@ describe('Gulp Missile', function () { assert.statStage(togepi, 'def', -2); }); - it(`should not force Cramorant-Gorging or -Gulping to have Gulp Missile`, function () { + it(`should not force Cramorant-Gorging or -Gulping to have Gulp Missile`, () => { battle = common.createBattle([[ - {species: 'cramorantgorging', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'cramorantgorging', ability: 'intimidate', moves: ['sleeptalk'] }, ], [ - {species: 'togepi', moves: ['fairywind']}, + { species: 'togepi', moves: ['fairywind'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/hospitality.js b/test/sim/abilities/hospitality.js index 9b1ee2a095..a44eca0eb4 100644 --- a/test/sim/abilities/hospitality.js +++ b/test/sim/abilities/hospitality.js @@ -5,20 +5,20 @@ const common = require('./../../common'); let battle; -describe('Hospitality', function () { - afterEach(function () { +describe('Hospitality', () => { + afterEach(() => { battle.destroy(); }); - it('should activate after hazards', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'snom', level: 1, ability: 'noguard', moves: ['sleeptalk']}, - {species: 'snom', level: 1, ability: 'noguard', moves: ['sleeptalk']}, - {species: 'deerling', moves: ['sleeptalk']}, - {species: 'sinistcha', ability: 'hospitality', moves: ['sleeptalk']}, + it('should activate after hazards', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'snom', level: 1, ability: 'noguard', moves: ['sleeptalk'] }, + { species: 'snom', level: 1, ability: 'noguard', moves: ['sleeptalk'] }, + { species: 'deerling', moves: ['sleeptalk'] }, + { species: 'sinistcha', ability: 'hospitality', moves: ['sleeptalk'] }, ], [ - {species: 'kleavor', moves: ['stoneaxe']}, - {species: 'kleavor', moves: ['stoneaxe']}, + { species: 'kleavor', moves: ['stoneaxe'] }, + { species: 'kleavor', moves: ['stoneaxe'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 3, switch 4'); diff --git a/test/sim/abilities/hungerswitch.js b/test/sim/abilities/hungerswitch.js index c37c38a7b3..9ede8feee9 100644 --- a/test/sim/abilities/hungerswitch.js +++ b/test/sim/abilities/hungerswitch.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe("Hunger Switch", function () { - afterEach(function () { +describe("Hunger Switch", () => { + afterEach(() => { battle.destroy(); }); - it("should alternate forms every turn", function () { + it("should alternate forms every turn", () => { battle = common.createBattle([[ - {species: 'Morpeko', ability: 'hungerswitch', moves: ['rest']}, + { species: 'Morpeko', ability: 'hungerswitch', moves: ['rest'] }, ], [ - {species: 'Magikarp', ability: 'Swift Swim', moves: ['splash']}, + { species: 'Magikarp', ability: 'Swift Swim', moves: ['splash'] }, ]]); const peko = battle.p1.active[0]; assert.species(peko, 'Morpeko'); @@ -24,13 +24,13 @@ describe("Hunger Switch", function () { assert.species(peko, 'Morpeko'); }); - it("should revert back to the base form when switched out", function () { + it("should revert back to the base form when switched out", () => { battle = common.createBattle([[ - {species: 'Morpeko', ability: 'hungerswitch', moves: ['rest']}, - {species: 'Furret', ability: 'Run Away', moves: ['sleeptalk']}, + { species: 'Morpeko', ability: 'hungerswitch', moves: ['rest'] }, + { species: 'Furret', ability: 'Run Away', moves: ['sleeptalk'] }, ], [ - {species: 'Magikarp', ability: 'Swift Swim', moves: ['splash']}, - {species: 'Koffing', ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: 'Magikarp', ability: 'Swift Swim', moves: ['splash'] }, + { species: 'Koffing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); const peko = battle.p1.active[0]; battle.makeChoices(); @@ -40,11 +40,11 @@ describe("Hunger Switch", function () { assert.species(peko, 'Morpeko'); }); - it("should stop activating when Morpeko Terastallizes", function () { + it("should stop activating when Morpeko Terastallizes", () => { battle = common.gen(9).createBattle([[ - {species: 'Morpeko', ability: 'hungerswitch', moves: ['rest']}, + { species: 'Morpeko', ability: 'hungerswitch', moves: ['rest'] }, ], [ - {species: 'Magikarp', ability: 'Swift Swim', moves: ['splash']}, + { species: 'Magikarp', ability: 'Swift Swim', moves: ['splash'] }, ]]); const peko = battle.p1.active[0]; battle.makeChoices(); @@ -53,13 +53,13 @@ describe("Hunger Switch", function () { assert.species(peko, 'Morpeko-Hangry'); }); - it("should maintain its form when Terastallized, even when switched out", function () { + it("should maintain its form when Terastallized, even when switched out", () => { battle = common.gen(9).createBattle([[ - {species: 'Morpeko', ability: 'hungerswitch', moves: ['rest']}, - {species: 'Furret', ability: 'Run Away', moves: ['sleeptalk']}, + { species: 'Morpeko', ability: 'hungerswitch', moves: ['rest'] }, + { species: 'Furret', ability: 'Run Away', moves: ['sleeptalk'] }, ], [ - {species: 'Magikarp', ability: 'Swift Swim', moves: ['splash']}, - {species: 'Koffing', ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: 'Magikarp', ability: 'Swift Swim', moves: ['splash'] }, + { species: 'Koffing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); const peko = battle.p1.active[0]; battle.makeChoices(); diff --git a/test/sim/abilities/iceface.js b/test/sim/abilities/iceface.js index 240844730e..d08378ea7c 100644 --- a/test/sim/abilities/iceface.js +++ b/test/sim/abilities/iceface.js @@ -5,14 +5,14 @@ const common = require('./../../common'); let battle; -describe('Ice Face', function () { +describe('Ice Face', () => { afterEach(() => battle.destroy()); - it(`should block damage from one physical move per Hail`, function () { + it(`should block damage from one physical move per Hail`, () => { battle = common.createBattle([[ - {species: 'Eiscue', ability: 'iceface', moves: ['splash']}, + { species: 'Eiscue', ability: 'iceface', moves: ['splash'] }, ], [ - {species: 'Mewtwo', ability: 'pressure', moves: ['tackle', 'watergun', 'hail']}, + { species: 'Mewtwo', ability: 'pressure', moves: ['tackle', 'watergun', 'hail'] }, ]]); const eiscue = battle.p1.active[0]; @@ -24,12 +24,12 @@ describe('Ice Face', function () { assert.hurts(eiscue, () => battle.makeChoices()); }); - it(`should not work while Transformed`, function () { + it(`should not work while Transformed`, () => { battle = common.createBattle([[ - {species: 'Eiscue', ability: 'iceface', moves: ['transform']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Eiscue', ability: 'iceface', moves: ['transform'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Eiscue', ability: 'iceface', moves: ['sleeptalk', 'aerialace', 'hail']}, + { species: 'Eiscue', ability: 'iceface', moves: ['sleeptalk', 'aerialace', 'hail'] }, ]]); battle.makeChoices(); battle.makeChoices('move aerialace', 'move aerialace'); @@ -44,11 +44,11 @@ describe('Ice Face', function () { assert.species(transformedEiscue, 'Eiscue-Noice', `Transformed Eiscue should not have changed to Eiscue after hail was set`); }); - it(`should not trigger if the Pokemon was KOed by Max Hailstorm`, function () { + it(`should not trigger if the Pokemon was KOed by Max Hailstorm`, () => { battle = common.gen(8).createBattle([[ - {species: 'Eiscue', level: 1, ability: 'iceface', moves: ['sleeptalk']}, + { species: 'Eiscue', level: 1, ability: 'iceface', moves: ['sleeptalk'] }, ], [ - {species: 'Weavile', moves: ['icepunch']}, + { species: 'Weavile', moves: ['icepunch'] }, ]]); battle.makeChoices(); battle.makeChoices('auto', 'move icepunch dynamax'); @@ -59,13 +59,13 @@ describe('Ice Face', function () { assert.false(hasMultipleActivates, "Ice Face should not trigger when being KOed. Only one |-activate| should exist in this test."); }); - it(`should reform Ice Face on switchin after all entrance Abilities occur`, function () { + it(`should reform Ice Face on switchin after all entrance Abilities occur`, () => { battle = common.createBattle([[ - {species: 'Eiscue', ability: 'iceface', moves: ['sleeptalk']}, - {species: 'Abomasnow', ability: 'snowwarning', moves: ['sleeptalk']}, + { species: 'Eiscue', ability: 'iceface', moves: ['sleeptalk'] }, + { species: 'Abomasnow', ability: 'snowwarning', moves: ['sleeptalk'] }, ], [ - {species: 'Guzzlord', moves: ['tackle', 'finalgambit']}, - {species: 'Torkoal', ability: 'drought', moves: ['sleeptalk']}, + { species: 'Guzzlord', moves: ['tackle', 'finalgambit'] }, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, ]]); const eiscue = battle.p1.active[0]; battle.makeChoices(); diff --git a/test/sim/abilities/illusion.js b/test/sim/abilities/illusion.js index c5441816d4..a49e097d54 100644 --- a/test/sim/abilities/illusion.js +++ b/test/sim/abilities/illusion.js @@ -5,64 +5,64 @@ const common = require('./../../common'); let battle; -describe('Illusion', function () { - afterEach(function () { +describe('Illusion', () => { + afterEach(() => { battle.destroy(); }); - it(`should not instantly wear off before Dynamaxing`, function () { + it(`should not instantly wear off before Dynamaxing`, () => { battle = common.gen(8).createBattle([[ - {species: "Zoroark", ability: 'illusion', moves: ['sleeptalk']}, - {species: "Diglett", moves: ['sleeptalk']}, + { species: "Zoroark", ability: 'illusion', moves: ['sleeptalk'] }, + { species: "Diglett", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Wynaut", moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk dynamax', 'auto'); assert(battle.log.every(line => !line.includes('|-end|p1a: Zoroark|Illusion'))); }); - it(`should prevent the user from Dynamaxed when Illusioning as a Pokemon that cannot Dynamax`, function () { + it(`should prevent the user from Dynamaxed when Illusioning as a Pokemon that cannot Dynamax`, () => { battle = common.gen(8).createBattle([[ - {species: "Zoroark", ability: 'illusion', moves: ['sleeptalk']}, - {species: "Eternatus", moves: ['sleeptalk']}, + { species: "Zoroark", ability: 'illusion', moves: ['sleeptalk'] }, + { species: "Eternatus", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Wynaut", moves: ['sleeptalk'] }, ]]); assert.cantMove(() => battle.choose('p1', 'move sleeptalk dynamax')); }); - it(`should be able to wear off normally while Dynamaxed`, function () { + it(`should be able to wear off normally while Dynamaxed`, () => { battle = common.gen(8).createBattle([[ - {species: "Zoroark", ability: 'illusion', moves: ['machpunch']}, - {species: "Diglett", moves: ['sleeptalk']}, + { species: "Zoroark", ability: 'illusion', moves: ['machpunch'] }, + { species: "Diglett", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['thunderbolt']}, + { species: "Wynaut", moves: ['thunderbolt'] }, ]]); battle.makeChoices('move machpunch dynamax', 'auto'); assert(battle.log.some(line => line.includes('|-end|p1a: Zoroark|Illusion'))); }); - it(`should Illusion as the regular Dynamax version of G-Max Pokemon while Dynamaxed`, function () { + it(`should Illusion as the regular Dynamax version of G-Max Pokemon while Dynamaxed`, () => { battle = common.gen(8).createBattle([[ - {species: "Zoroark", ability: 'illusion', moves: ['sleeptalk']}, - {species: "Charizard", gigantamax: true, moves: ['ember', 'sleeptalk']}, + { species: "Zoroark", ability: 'illusion', moves: ['sleeptalk'] }, + { species: "Charizard", gigantamax: true, moves: ['ember', 'sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Wynaut", moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk dynamax', 'auto'); assert(battle.log.every(line => !line.includes('Gmax'))); }); - it(`should instantly wear off before using a Z-move`, function () { + it(`should instantly wear off before using a Z-move`, () => { battle = common.gen(7).createBattle([[ - {species: "Zoroark", ability: 'illusion', item: 'fightiniumz', moves: ['machpunch', 'sleeptalk']}, - {species: "Octillery", moves: ['sleeptalk']}, + { species: "Zoroark", ability: 'illusion', item: 'fightiniumz', moves: ['machpunch', 'sleeptalk'] }, + { species: "Octillery", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Wynaut", moves: ['sleeptalk'] }, ]]); battle.makeChoices('move machpunch zmove', 'auto'); diff --git a/test/sim/abilities/immunity.js b/test/sim/abilities/immunity.js index f410dfa275..881d1b03fb 100644 --- a/test/sim/abilities/immunity.js +++ b/test/sim/abilities/immunity.js @@ -5,36 +5,36 @@ const common = require('./../../common'); let battle; -describe('Immunity', function () { - afterEach(function () { +describe('Immunity', () => { + afterEach(() => { battle.destroy(); }); - it('should make the user immune to poison', function () { + it('should make the user immune to poison', () => { battle = common.createBattle([[ - {species: 'Snorlax', ability: 'immunity', moves: ['curse']}, + { species: 'Snorlax', ability: 'immunity', moves: ['curse'] }, ], [ - {species: 'Crobat', ability: 'infiltrator', moves: ['toxic']}, + { species: 'Crobat', ability: 'infiltrator', moves: ['toxic'] }, ]]); assert.constant(() => battle.p1.active[0].status, () => battle.makeChoices('move curse', 'move toxic')); }); - it('should cure poison if a Pokemon receives the ability', function () { + it('should cure poison if a Pokemon receives the ability', () => { battle = common.createBattle([[ - {species: 'Snorlax', ability: 'thickfat', moves: ['curse']}, + { species: 'Snorlax', ability: 'thickfat', moves: ['curse'] }, ], [ - {species: 'Crobat', ability: 'immunity', moves: ['toxic', 'skillswap']}, + { species: 'Crobat', ability: 'immunity', moves: ['toxic', 'skillswap'] }, ]]); const target = battle.p1.active[0]; assert.sets(() => target.status, 'tox', () => battle.makeChoices('move curse', 'move toxic')); assert.sets(() => target.status, '', () => battle.makeChoices('move curse', 'move skillswap')); }); - it('should have its immunity to poison temporarily suppressed by Mold Breaker, but should cure the status immediately afterwards', function () { + it('should have its immunity to poison temporarily suppressed by Mold Breaker, but should cure the status immediately afterwards', () => { battle = common.createBattle([[ - {species: 'Snorlax', ability: 'immunity', moves: ['curse']}, + { species: 'Snorlax', ability: 'immunity', moves: ['curse'] }, ], [ - {species: 'Crobat', ability: 'moldbreaker', moves: ['toxic']}, + { species: 'Crobat', ability: 'moldbreaker', moves: ['toxic'] }, ]]); battle.makeChoices('move curse', 'move toxic'); assert.equal(battle.log.filter(line => line.match(/-status\|.*\|tox/)).length, 1); diff --git a/test/sim/abilities/imposter.js b/test/sim/abilities/imposter.js index a1e9ae40eb..824efc1707 100644 --- a/test/sim/abilities/imposter.js +++ b/test/sim/abilities/imposter.js @@ -5,38 +5,38 @@ const common = require('./../../common'); let battle; -describe('Imposter', function () { - afterEach(function () { +describe('Imposter', () => { + afterEach(() => { battle.destroy(); }); - it('should Transform into the opposing Pokemon facing it', function () { + it('should Transform into the opposing Pokemon facing it', () => { battle = common.createBattle([[ - {species: "Ditto", ability: 'imposter', moves: ['sleeptalk']}, + { species: "Ditto", ability: 'imposter', moves: ['sleeptalk'] }, ], [ - {species: "Hoopa-Unbound", ability: 'magician', moves: ['rest']}, + { species: "Hoopa-Unbound", ability: 'magician', moves: ['rest'] }, ]]); assert.equal(battle.p1.active[0].species, battle.p2.active[0].species); }); - it('should be blocked by substitutes', function () { + it('should be blocked by substitutes', () => { battle = common.createBattle([[ - {species: "Escavalier", ability: 'shellarmor', moves: ['substitute']}, + { species: "Escavalier", ability: 'shellarmor', moves: ['substitute'] }, ], [ - {species: "Shuckle", ability: 'sturdy', moves: ['uturn']}, - {species: "Ditto", ability: 'imposter', moves: ['sleeptalk']}, + { species: "Shuckle", ability: 'sturdy', moves: ['uturn'] }, + { species: "Ditto", ability: 'imposter', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move substitute', 'move uturn'); battle.makeChoices('', 'switch ditto'); assert.notEqual(battle.p2.active[0].species, battle.p1.active[0].species); }); - it('should not activate if Skill Swapped', function () { + it('should not activate if Skill Swapped', () => { battle = common.createBattle([[ - {species: "Shuckle", ability: 'imposter', moves: ['sleeptalk', 'skillswap']}, + { species: "Shuckle", ability: 'imposter', moves: ['sleeptalk', 'skillswap'] }, ], [ - {species: "Ditto", ability: 'imposter', moves: ['sleeptalk']}, - {species: "Greninja", ability: 'torrent', moves: ['sleeptalk']}, + { species: "Ditto", ability: 'imposter', moves: ['sleeptalk'] }, + { species: "Greninja", ability: 'torrent', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move skillswap', 'switch greninja'); assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); diff --git a/test/sim/abilities/intimidate.js b/test/sim/abilities/intimidate.js index d5693b860e..43e14408d0 100644 --- a/test/sim/abilities/intimidate.js +++ b/test/sim/abilities/intimidate.js @@ -5,41 +5,41 @@ const common = require('./../../common'); let battle; -describe('Intimidate', function () { - afterEach(function () { +describe('Intimidate', () => { + afterEach(() => { battle.destroy(); }); - it('should decrease Atk by 1 level', function () { + it('should decrease Atk by 1 level', () => { battle = common.gen(7).createBattle([[ - {species: "Smeargle", ability: 'owntempo', moves: ['sketch']}, + { species: "Smeargle", ability: 'owntempo', moves: ['sketch'] }, ], [ - {species: "Gyarados", ability: 'intimidate', moves: ['splash']}, + { species: "Gyarados", ability: 'intimidate', moves: ['splash'] }, ]]); assert.statStage(battle.p1.active[0], 'atk', -1); }); - it('should be blocked by Substitute', function () { + it('should be blocked by Substitute', () => { battle = common.createBattle([[ - {species: "Escavalier", item: 'leftovers', ability: 'shellarmor', moves: ['substitute']}, + { species: "Escavalier", item: 'leftovers', ability: 'shellarmor', moves: ['substitute'] }, ], [ - {species: "Greninja", item: 'laggingtail', ability: 'protean', moves: ['uturn']}, - {species: "Gyarados", item: 'leftovers', ability: 'intimidate', moves: ['splash']}, + { species: "Greninja", item: 'laggingtail', ability: 'protean', moves: ['uturn'] }, + { species: "Gyarados", item: 'leftovers', ability: 'intimidate', moves: ['splash'] }, ]]); battle.makeChoices('move substitute', 'move uturn'); battle.makeChoices('', 'switch gyarados'); assert.statStage(battle.p1.active[0], 'atk', 0); }); - it('should not activate if U-turn breaks the Substitute in Gen 4', function () { - battle = common.gen(4).createBattle({gameType: 'doubles'}, [[ - {species: "Gengar", level: 1, item: 'leftovers', ability: 'levitate', moves: ['substitute']}, - {species: "Suicune", level: 1, item: 'leftovers', ability: 'pressure', moves: ['substitute']}, + it('should not activate if U-turn breaks the Substitute in Gen 4', () => { + battle = common.gen(4).createBattle({ gameType: 'doubles' }, [[ + { species: "Gengar", level: 1, item: 'leftovers', ability: 'levitate', moves: ['substitute'] }, + { species: "Suicune", level: 1, item: 'leftovers', ability: 'pressure', moves: ['substitute'] }, ], [ - {species: "Gliscor", item: 'laggingtail', ability: 'sandveil', moves: ['uturn']}, - {species: "Scizor", item: 'laggingtail', ability: 'technician', moves: ['batonpass']}, - {species: "Gyarados", item: 'leftovers', ability: 'intimidate', moves: ['splash']}, - {species: "Salamence", item: 'leftovers', ability: 'intimidate', moves: ['splash']}, + { species: "Gliscor", item: 'laggingtail', ability: 'sandveil', moves: ['uturn'] }, + { species: "Scizor", item: 'laggingtail', ability: 'technician', moves: ['batonpass'] }, + { species: "Gyarados", item: 'leftovers', ability: 'intimidate', moves: ['splash'] }, + { species: "Salamence", item: 'leftovers', ability: 'intimidate', moves: ['splash'] }, ]]); battle.makeChoices('move substitute, move substitute', 'move uturn 1, move batonpass'); battle.makeChoices('', 'switch 3, pass'); @@ -54,15 +54,15 @@ describe('Intimidate', function () { assert.statStage(battle.p1.active[1], 'atk', 0); }); - it('should affect adjacent foes only', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: "Bulbasaur", item: 'leftovers', ability: 'overgrow', moves: ['vinewhip']}, - {species: "Charmander", item: 'leftovers', ability: 'blaze', moves: ['ember']}, - {species: "Squirtle", item: 'leftovers', ability: 'torrent', moves: ['bubble']}, + it('should affect adjacent foes only', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: "Bulbasaur", item: 'leftovers', ability: 'overgrow', moves: ['vinewhip'] }, + { species: "Charmander", item: 'leftovers', ability: 'blaze', moves: ['ember'] }, + { species: "Squirtle", item: 'leftovers', ability: 'torrent', moves: ['bubble'] }, ], [ - {species: "Greninja", ability: 'protean', moves: ['uturn']}, - {species: "Mew", ability: 'synchronize', moves: ['softboiled']}, - {species: "Gyarados", ability: 'intimidate', moves: ['splash']}, + { species: "Greninja", ability: 'protean', moves: ['uturn'] }, + { species: "Mew", ability: 'synchronize', moves: ['softboiled'] }, + { species: "Gyarados", ability: 'intimidate', moves: ['splash'] }, ]]); const [frontPokemon, centerPokemon, farPokemon] = battle.p1.active; @@ -72,14 +72,14 @@ describe('Intimidate', function () { assert.statStage(farPokemon, 'atk', 0); }); - it('should wait until all simultaneous switch ins at the beginning of a battle have completed before activating', function () { - battle = common.createBattle({preview: true}, [[ - {species: "Arcanine", ability: 'intimidate', moves: ['morningsun']}, + it('should wait until all simultaneous switch ins at the beginning of a battle have completed before activating', () => { + battle = common.createBattle({ preview: true }, [[ + { species: "Arcanine", ability: 'intimidate', moves: ['morningsun'] }, ], [ - {species: "Gyarados", ability: 'intimidate', moves: ['dragondance']}, + { species: "Gyarados", ability: 'intimidate', moves: ['dragondance'] }, ]]); let intimidateCount = 0; - battle.onEvent('TryBoost', battle.format, function (boost, target, source) { + battle.onEvent('TryBoost', battle.format, (boost, target, source) => { assert.species(source, intimidateCount === 0 ? 'Arcanine' : 'Gyarados'); intimidateCount++; }); @@ -90,13 +90,13 @@ describe('Intimidate', function () { // Do it again with the Pokemon in reverse order battle.destroy(); - battle = common.createBattle({preview: true}, [[ - {species: "Gyarados", ability: 'intimidate', moves: ['dragondance']}, + battle = common.createBattle({ preview: true }, [[ + { species: "Gyarados", ability: 'intimidate', moves: ['dragondance'] }, ], [ - {species: "Arcanine", ability: 'intimidate', moves: ['morningsun']}, + { species: "Arcanine", ability: 'intimidate', moves: ['morningsun'] }, ]]); intimidateCount = 0; - battle.onEvent('TryBoost', battle.format, function (boost, target, source) { + battle.onEvent('TryBoost', battle.format, (boost, target, source) => { assert.species(source, intimidateCount === 0 ? 'Arcanine' : 'Gyarados'); intimidateCount++; }); @@ -106,19 +106,19 @@ describe('Intimidate', function () { assert.statStage(battle.p2.active[0], 'atk', -1); }); - it('should wait until all simultaneous switch ins after double-KOs have completed before activating', function () { - battle = common.createBattle({preview: true}, [[ - {species: "Blissey", ability: 'naturalcure', moves: ['healingwish']}, - {species: "Arcanine", ability: 'intimidate', moves: ['healingwish']}, - {species: "Gyarados", ability: 'intimidate', moves: ['healingwish']}, + it('should wait until all simultaneous switch ins after double-KOs have completed before activating', () => { + battle = common.createBattle({ preview: true }, [[ + { species: "Blissey", ability: 'naturalcure', moves: ['healingwish'] }, + { species: "Arcanine", ability: 'intimidate', moves: ['healingwish'] }, + { species: "Gyarados", ability: 'intimidate', moves: ['healingwish'] }, ], [ - {species: "Blissey", ability: 'naturalcure', moves: ['healingwish']}, - {species: "Gyarados", ability: 'intimidate', moves: ['healingwish']}, - {species: "Arcanine", ability: 'intimidate', moves: ['healingwish']}, + { species: "Blissey", ability: 'naturalcure', moves: ['healingwish'] }, + { species: "Gyarados", ability: 'intimidate', moves: ['healingwish'] }, + { species: "Arcanine", ability: 'intimidate', moves: ['healingwish'] }, ]]); const [p1active, p2active] = [battle.p1.active, battle.p2.active]; let intimidateCount = 0; - battle.onEvent('TryBoost', battle.format, function (boost, target, source) { + battle.onEvent('TryBoost', battle.format, (boost, target, source) => { assert.species(source, intimidateCount % 2 === 0 ? 'Arcanine' : 'Gyarados'); intimidateCount++; }); diff --git a/test/sim/abilities/intrepidsword.js b/test/sim/abilities/intrepidsword.js index 537ae300ac..ecc7bc9439 100644 --- a/test/sim/abilities/intrepidsword.js +++ b/test/sim/abilities/intrepidsword.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Intrepid Sword', function () { - afterEach(function () { +describe('Intrepid Sword', () => { + afterEach(() => { battle.destroy(); }); - it(`should only increase the user's Attack stat once per game`, function () { + it(`should only increase the user's Attack stat once per game`, () => { battle = common.createBattle([[ - {species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Mew', moves: ['sleeptalk']}, + { species: 'Mew', moves: ['sleeptalk'] }, ]]); const zacian = battle.p1.active[0]; @@ -25,12 +25,12 @@ describe('Intrepid Sword', function () { assert.statStage(zacian, 'atk', 0); }); - it(`should use up its once-per-game boost if it switches in with +6 Attack`, function () { + it(`should use up its once-per-game boost if it switches in with +6 Attack`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['bellydrum', 'batonpass']}, - {species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['bellydrum', 'batonpass'] }, + { species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] }, ], [ - {species: 'Mew', moves: ['sleeptalk']}, + { species: 'Mew', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move bellydrum', 'auto'); @@ -42,12 +42,12 @@ describe('Intrepid Sword', function () { assert.statStage(zacian, 'atk', 0); }); - it(`should not use up its once-per-game boost if it switches in while its Ability is suppressed`, function () { + it(`should not use up its once-per-game boost if it switches in while its Ability is suppressed`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['batonpass']}, - {species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['batonpass'] }, + { species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] }, ], [ - {species: 'Mew', moves: ['sleeptalk', 'gastroacid']}, + { species: 'Mew', moves: ['sleeptalk', 'gastroacid'] }, ]]); battle.makeChoices('move batonpass', 'move gastroacid'); @@ -60,12 +60,12 @@ describe('Intrepid Sword', function () { assert.statStage(zacian, 'atk', 1); }); - it(`should be able to increase the user's Attack stat multiple times per game [Gen 8]`, function () { + it(`should be able to increase the user's Attack stat multiple times per game [Gen 8]`, () => { battle = common.gen(8).createBattle([[ - {species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Mew', moves: ['sleeptalk']}, + { species: 'Mew', moves: ['sleeptalk'] }, ]]); const zacian = battle.p1.active[0]; diff --git a/test/sim/abilities/klutz.js b/test/sim/abilities/klutz.js index 9c95b4f435..181ef99ddb 100644 --- a/test/sim/abilities/klutz.js +++ b/test/sim/abilities/klutz.js @@ -5,67 +5,67 @@ const common = require('./../../common'); let battle; -describe('Klutz', function () { - afterEach(function () { +describe('Klutz', () => { + afterEach(() => { battle.destroy(); }); - it('should negate residual healing events', function () { + it('should negate residual healing events', () => { battle = common.createBattle([[ - {species: "Lopunny", ability: 'klutz', item: 'leftovers', moves: ['bellydrum']}, + { species: "Lopunny", ability: 'klutz', item: 'leftovers', moves: ['bellydrum'] }, ], [ - {species: "Giratina", ability: 'pressure', moves: ['shadowsneak']}, + { species: "Giratina", ability: 'pressure', moves: ['shadowsneak'] }, ]]); const klutzMon = battle.p1.active[0]; assert.hurtsBy(klutzMon, Math.floor(klutzMon.maxhp / 2), () => battle.makeChoices('move bellydrum', 'move shadowsneak'), "Leftovers healing should not apply"); }); - it('should prevent items from being consumed', function () { + it('should prevent items from being consumed', () => { battle = common.createBattle([[ - {species: "Lopunny", level: 1, ability: 'klutz', item: 'sitrusberry', moves: ['endure']}, + { species: "Lopunny", level: 1, ability: 'klutz', item: 'sitrusberry', moves: ['endure'] }, ], [ - {species: "Deoxys", ability: 'noguard', moves: ['psychic']}, + { species: "Deoxys", ability: 'noguard', moves: ['psychic'] }, ]]); const klutzMon = battle.p1.active[0]; assert.constant(() => klutzMon.item, () => battle.makeChoices('move endure', 'move psychic')); assert.equal(klutzMon.hp, 1); }); - it('should ignore the effects of items that disable moves', function () { + it('should ignore the effects of items that disable moves', () => { battle = common.createBattle([[ - {species: "Lopunny", ability: 'klutz', item: 'assaultvest', moves: ['protect']}, + { species: "Lopunny", ability: 'klutz', item: 'assaultvest', moves: ['protect'] }, ], [ - {species: "Deoxys", ability: 'noguard', moves: ['psychic']}, + { species: "Deoxys", ability: 'noguard', moves: ['psychic'] }, ]]); battle.makeChoices('move protect', 'move psychic'); assert.equal(battle.p1.active[0].lastMove.id, 'protect'); }); - it('should not ignore item effects that prevent item removal', function () { + it('should not ignore item effects that prevent item removal', () => { battle = common.createBattle([[ - {species: "Genesect", ability: 'klutz', item: 'dousedrive', moves: ['calmmind']}, + { species: "Genesect", ability: 'klutz', item: 'dousedrive', moves: ['calmmind'] }, ], [ - {species: "Deoxys", ability: 'noguard', moves: ['trick']}, + { species: "Deoxys", ability: 'noguard', moves: ['trick'] }, ]]); const klutzMon = battle.p1.active[0]; assert.constant(() => klutzMon.item, () => battle.makeChoices('move calmmind', 'move trick')); }); - it('should cause Fling to fail', function () { + it('should cause Fling to fail', () => { battle = common.createBattle([[ - {species: "Lopunny", ability: 'klutz', item: 'seaincense', moves: ['fling']}, + { species: "Lopunny", ability: 'klutz', item: 'seaincense', moves: ['fling'] }, ], [ - {species: "Deoxys", ability: 'noguard', moves: ['calmmind']}, + { species: "Deoxys", ability: 'noguard', moves: ['calmmind'] }, ]]); const klutzMon = battle.p1.active[0]; assert.constant(() => klutzMon.item, () => battle.makeChoices('move fling', 'move calmmind')); }); - it('should not prevent Pokemon from Mega Evolving', function () { + it('should not prevent Pokemon from Mega Evolving', () => { battle = common.createBattle([[ - {species: "Lopunny", ability: 'klutz', item: 'lopunnite', moves: ['protect']}, + { species: "Lopunny", ability: 'klutz', item: 'lopunnite', moves: ['protect'] }, ], [ - {species: "Deoxys", ability: 'noguard', moves: ['calmmind']}, + { species: "Deoxys", ability: 'noguard', moves: ['calmmind'] }, ]]); battle.makeChoices('move protect mega', 'move calmmind'); assert.species(battle.p1.active[0], 'Lopunny-Mega'); diff --git a/test/sim/abilities/levitate.js b/test/sim/abilities/levitate.js index 7e717764af..d834de7e51 100644 --- a/test/sim/abilities/levitate.js +++ b/test/sim/abilities/levitate.js @@ -5,82 +5,82 @@ const common = require('./../../common'); let battle; -describe('Levitate', function () { - afterEach(function () { +describe('Levitate', () => { + afterEach(() => { battle.destroy(); }); - it('should give the user an immunity to Ground-type moves', function () { + it('should give the user an immunity to Ground-type moves', () => { battle = common.createBattle([[ - {species: 'Rotom', ability: 'levitate', moves: ['sleeptalk']}, + { species: 'Rotom', ability: 'levitate', moves: ['sleeptalk'] }, ], [ - {species: 'Aggron', ability: 'sturdy', moves: ['earthquake']}, + { species: 'Aggron', ability: 'sturdy', moves: ['earthquake'] }, ]]); assert.false.hurts(battle.p1.active[0], () => battle.makeChoices('move sleeptalk', 'move earthquake')); }); - it('should make the user airborne', function () { + it('should make the user airborne', () => { battle = common.createBattle([[ - {species: 'Unown', ability: 'levitate', moves: ['spore']}, + { species: 'Unown', ability: 'levitate', moves: ['spore'] }, ], [ - {species: 'Espeon', ability: 'magicbounce', moves: ['electricterrain']}, + { species: 'Espeon', ability: 'magicbounce', moves: ['electricterrain'] }, ]]); battle.makeChoices('move spore', 'move electricterrain'); assert.equal(battle.p1.active[0].status, 'slp', "Levitate Pokémon should not be awaken by Electric Terrain"); }); - it('should have its Ground immunity suppressed by Mold Breaker', function () { + it('should have its Ground immunity suppressed by Mold Breaker', () => { battle = common.createBattle([[ - {species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk']}, + { species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['earthquake']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['earthquake'] }, ]]); assert.hurts(battle.p1.active[0], () => battle.makeChoices('move sleeptalk', 'move earthquake')); }); - it('should have its airborne property suppressed by Mold Breaker if it is forced out by a move', function () { + it('should have its airborne property suppressed by Mold Breaker if it is forced out by a move', () => { battle = common.createBattle([[ - {species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk']}, - {species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk']}, + { species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] }, + { species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['roar', 'spikes']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['roar', 'spikes'] }, ]]); battle.makeChoices('move sleeptalk', 'move spikes'); assert.hurts(battle.p1.pokemon[1], () => battle.makeChoices('move sleeptalk', 'move roar')); }); - it('should not have its airborne property suppressed by Mold Breaker if it switches out via Eject Button', function () { + it('should not have its airborne property suppressed by Mold Breaker if it switches out via Eject Button', () => { battle = common.createBattle([[ - {species: 'Cresselia', ability: 'levitate', item: 'ejectbutton', moves: ['sleeptalk']}, - {species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk']}, + { species: 'Cresselia', ability: 'levitate', item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['tackle', 'spikes']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['tackle', 'spikes'] }, ]]); battle.makeChoices('move sleeptalk', 'move spikes'); battle.makeChoices('move sleeptalk', 'move tackle'); assert.false.hurts(battle.p1.pokemon[1], () => battle.makeChoices('switch 2', 'move tackle')); }); - it('should not have its airborne property suppressed by Mold Breaker if that Pokemon is no longer active', function () { + it('should not have its airborne property suppressed by Mold Breaker if that Pokemon is no longer active', () => { battle = common.createBattle([[ - {species: 'Forretress', ability: 'levitate', item: 'redcard', moves: ['spikes']}, + { species: 'Forretress', ability: 'levitate', item: 'redcard', moves: ['spikes'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', item: 'laggingtail', moves: ['tackle']}, - {species: 'Rotom', ability: 'levitate', moves: ['rest']}, + { species: 'Haxorus', ability: 'moldbreaker', item: 'laggingtail', moves: ['tackle'] }, + { species: 'Rotom', ability: 'levitate', moves: ['rest'] }, ]]); assert.false.hurts(battle.p2.active[0], () => battle.makeChoices('move spikes', 'move tackle')); }); }); -describe('Levitate [Gen 4]', function () { - afterEach(function () { +describe('Levitate [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should not have its airborne property suppressed by Mold Breaker if it is forced out by a move', function () { + it('should not have its airborne property suppressed by Mold Breaker if it is forced out by a move', () => { battle = common.gen(4).createBattle([ - [{species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk']}, {species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk']}], - [{species: 'Rampardos', ability: 'moldbreaker', moves: ['roar', 'spikes']}], + [{ species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] }, { species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] }], + [{ species: 'Rampardos', ability: 'moldbreaker', moves: ['roar', 'spikes'] }], ]); battle.makeChoices('move sleeptalk', 'move spikes'); assert.false.hurts(battle.p1.pokemon[1], () => battle.makeChoices('move sleeptalk', 'move roar')); diff --git a/test/sim/abilities/lightningrod.js b/test/sim/abilities/lightningrod.js index 1f915f1338..e8b02dd656 100644 --- a/test/sim/abilities/lightningrod.js +++ b/test/sim/abilities/lightningrod.js @@ -5,37 +5,37 @@ const common = require('./../../common'); let battle; -describe('Lightning Rod', function () { - afterEach(function () { +describe('Lightning Rod', () => { + afterEach(() => { battle.destroy(); }); - it('should grant immunity to Electric-type moves and boost Special Attack by 1 stage', function () { + it('should grant immunity to Electric-type moves and boost Special Attack by 1 stage', () => { battle = common.gen(6).createBattle([[ - {species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']}, + { species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk'] }, ], [ - {species: 'Jolteon', ability: 'static', moves: ['thunderbolt']}, + { species: 'Jolteon', ability: 'static', moves: ['thunderbolt'] }, ]]); battle.makeChoices('move sleeptalk', 'move thunderbolt'); assert.fullHP(battle.p1.active[0]); assert.statStage(battle.p1.active[0], 'spa', 1); }); - it('should not boost Special Attack if the user is already immune to Electric-type moves in gen 6-', function () { + it('should not boost Special Attack if the user is already immune to Electric-type moves in gen 6-', () => { battle = common.gen(6).createBattle([[ - {species: 'Rhydon', ability: 'lightningrod', moves: ['sleeptalk']}, + { species: 'Rhydon', ability: 'lightningrod', moves: ['sleeptalk'] }, ], [ - {species: 'Jolteon', ability: 'static', moves: ['thunderbolt']}, + { species: 'Jolteon', ability: 'static', moves: ['thunderbolt'] }, ]]); battle.makeChoices('move sleeptalk', 'move thunderbolt'); assert.statStage(battle.p1.active[0], 'spa', 0); }); - it('should boost Special Attack if the user is already immune to Electric-type moves in gen 7+', function () { + it('should boost Special Attack if the user is already immune to Electric-type moves in gen 7+', () => { battle = common.createBattle([[ - {species: 'Rhydon', ability: 'lightningrod', moves: ['sleeptalk']}, + { species: 'Rhydon', ability: 'lightningrod', moves: ['sleeptalk'] }, ], [ - {species: 'Jolteon', ability: 'static', moves: ['thunderbolt']}, + { species: 'Jolteon', ability: 'static', moves: ['thunderbolt'] }, ]]); battle.makeChoices('move sleeptalk', 'move thunderbolt'); assert.fullHP(battle.p1.active[0]); @@ -44,14 +44,14 @@ describe('Lightning Rod', function () { it('should redirect single-target Electric-type attacks to the user if it is a valid target', function () { this.timeout(3000); - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']}, - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk'] }, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, ], [ - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, ]]); battle.makeChoices('move sleeptalk, move thunderbolt 1, move thunderbolt 1', 'move thunderbolt 3, move thunderbolt 3, move thunderbolt 2'); assert.statStage(battle.p1.active[0], 'spa', 3); @@ -59,40 +59,40 @@ describe('Lightning Rod', function () { assert.false.fullHP(battle.p2.active[0]); }); - it('should redirect to the fastest Pokemon with the ability', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']}, - {species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']}, + it('should redirect to the fastest Pokemon with the ability', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk'] }, + { species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk'] }, ], [ - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, ]]); const [fastTric, slowTric] = battle.p1.active; - fastTric.boostBy({spe: 6}); + fastTric.boostBy({ spe: 6 }); battle.makeChoices('move sleeptalk, move sleeptalk', 'move thunderbolt 1, move thunderbolt 2'); assert.statStage(fastTric, 'spa', 2); assert.statStage(slowTric, 'spa', 0); }); - it('should redirect to the Pokemon having the ability longest', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Meloetta', ability: 'serenegrace', moves: ['roleplay']}, - {species: 'Pikachu', ability: 'lightningrod', moves: ['sleeptalk']}, + it('should redirect to the Pokemon having the ability longest', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Meloetta', ability: 'serenegrace', moves: ['roleplay'] }, + { species: 'Pikachu', ability: 'lightningrod', moves: ['sleeptalk'] }, ], [ - {species: 'Pichu', ability: 'static', moves: ['thunderbolt']}, - {species: 'Pichu', ability: 'static', moves: ['thunderbolt']}, + { species: 'Pichu', ability: 'static', moves: ['thunderbolt'] }, + { species: 'Pichu', ability: 'static', moves: ['thunderbolt'] }, ]]); let [rodCopied, rodStarts] = battle.p1.active; battle.makeChoices('move roleplay -2, move sleeptalk', 'move thunderbolt 1, move thunderbolt 2'); assert.statStage(rodCopied, 'spa', 0); assert.statStage(rodStarts, 'spa', 2); - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Togedemaru', moves: ['zingzap']}, - {species: 'Ditto', ability: 'imposter', moves: ['transform']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Togedemaru', moves: ['zingzap'] }, + { species: 'Ditto', ability: 'imposter', moves: ['transform'] }, ], [ - {species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']}, - {species: 'Dratini', moves: ['thunderbolt']}, + { species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk'] }, + { species: 'Dratini', moves: ['thunderbolt'] }, ]]); rodCopied = battle.p1.active[1]; // Ditto rodStarts = battle.p2.active[0]; // Manectric @@ -101,13 +101,13 @@ describe('Lightning Rod', function () { assert.statStage(rodStarts, 'spa', 2); }); - it('should not redirect if another Pokemon has used Follow Me', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk']}, - {species: 'Manectric', ability: 'static', moves: ['followme']}, + it('should not redirect if another Pokemon has used Follow Me', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Manectric', ability: 'lightningrod', moves: ['sleeptalk'] }, + { species: 'Manectric', ability: 'static', moves: ['followme'] }, ], [ - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, - {species: 'Electrode', ability: 'static', moves: ['thunderbolt']}, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, + { species: 'Electrode', ability: 'static', moves: ['thunderbolt'] }, ]]); const [rodPokemon, defender] = battle.p1.active; battle.makeChoices('move sleeptalk, move followme', 'move thunderbolt 2, move thunderbolt 1'); @@ -115,13 +115,13 @@ describe('Lightning Rod', function () { assert.false.fullHP(defender); }); - it('should have its Electric-type immunity and its ability to redirect moves suppressed by Mold Breaker', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Manectric', ability: 'lightningrod', moves: ['endure']}, - {species: 'Manaphy', ability: 'hydration', moves: ['tailglow']}, + it('should have its Electric-type immunity and its ability to redirect moves suppressed by Mold Breaker', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Manectric', ability: 'lightningrod', moves: ['endure'] }, + { species: 'Manaphy', ability: 'hydration', moves: ['tailglow'] }, ], [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['thunderpunch']}, - {species: 'Zekrom', ability: 'teravolt', moves: ['shockwave']}, + { species: 'Haxorus', ability: 'moldbreaker', moves: ['thunderpunch'] }, + { species: 'Zekrom', ability: 'teravolt', moves: ['shockwave'] }, ]]); const [rodPokemon, ally] = battle.p1.active; battle.makeChoices('move endure, move tailglow', 'move thunderpunch 1, move shockwave 2'); diff --git a/test/sim/abilities/liquidooze.js b/test/sim/abilities/liquidooze.js index a7e8bb7ed1..91bbde65f4 100644 --- a/test/sim/abilities/liquidooze.js +++ b/test/sim/abilities/liquidooze.js @@ -5,62 +5,62 @@ const common = require('./../../common'); let battle; -describe('Liquid Ooze', function () { - afterEach(function () { +describe('Liquid Ooze', () => { + afterEach(() => { battle.destroy(); }); - it('should damage the target after it uses a draining move', function () { + it('should damage the target after it uses a draining move', () => { battle = common.createBattle([[ - {species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk']}, + { species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk'] }, ], [ - {species: 'serperior', moves: ['gigadrain']}, + { species: 'serperior', moves: ['gigadrain'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it(`should damage the target after taking damage from Leech Seed`, function () { + it(`should damage the target after taking damage from Leech Seed`, () => { battle = common.createBattle([[ - {species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk']}, + { species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk'] }, ], [ - {species: 'serperior', ability: 'noguard', moves: ['leechseed']}, + { species: 'serperior', ability: 'noguard', moves: ['leechseed'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); }); -describe('Liquid Ooze [Gen 4]', function () { - afterEach(function () { +describe('Liquid Ooze [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should damage the target after it uses a draining move', function () { + it('should damage the target after it uses a draining move', () => { battle = common.gen(4).createBattle([[ - {species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk']}, + { species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk'] }, ], [ - {species: 'roserade', moves: ['gigadrain']}, + { species: 'roserade', moves: ['gigadrain'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it(`should damage the target after taking damage from leech seed`, function () { + it(`should damage the target after taking damage from leech seed`, () => { battle = common.gen(4).createBattle([[ - {species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk']}, + { species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk'] }, ], [ - {species: 'roserade', ability: 'noguard', moves: ['leechseed']}, + { species: 'roserade', ability: 'noguard', moves: ['leechseed'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it('should not damage the target if the target used Dream Eater', function () { + it('should not damage the target if the target used Dream Eater', () => { battle = common.gen(4).createBattle([[ - {species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk']}, + { species: 'tentacruel', ability: 'liquidooze', moves: ['sleeptalk'] }, ], [ - {species: 'jolteon', moves: ['spore', 'dreameater']}, + { species: 'jolteon', moves: ['spore', 'dreameater'] }, ]]); battle.makeChoices('move sleeptalk', 'move spore'); battle.makeChoices('move sleeptalk', 'move dreameater'); diff --git a/test/sim/abilities/magicbounce.js b/test/sim/abilities/magicbounce.js index ff1e2b204a..4667035171 100644 --- a/test/sim/abilities/magicbounce.js +++ b/test/sim/abilities/magicbounce.js @@ -5,62 +5,62 @@ const common = require('./../../common'); let battle; -describe('Magic Bounce', function () { - afterEach(function () { +describe('Magic Bounce', () => { + afterEach(() => { battle.destroy(); }); - it('should bounce Growl', function () { + it('should bounce Growl', () => { // Sanity check: if this test fails, the remaining tests for Magic Bounce may not make sense. // Tests for specific moves belong to the respective moves' test suites. battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Bulbasaur", ability: 'overgrow', moves: ['growl']}]}); - battle.setPlayer('p2', {team: [{species: "Espeon", ability: 'magicbounce', moves: ['futuresight']}]}); + battle.setPlayer('p1', { team: [{ species: "Bulbasaur", ability: 'overgrow', moves: ['growl'] }] }); + battle.setPlayer('p2', { team: [{ species: "Espeon", ability: 'magicbounce', moves: ['futuresight'] }] }); battle.makeChoices('move growl', 'move futuresight'); assert.statStage(battle.p1.active[0], 'atk', -1); assert.statStage(battle.p2.active[0], 'atk', 0); }); - it('should bounce once when target and source share the ability', function () { + it('should bounce once when target and source share the ability', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Xatu", ability: 'magicbounce', moves: ['roost']}]}); - battle.setPlayer('p2', {team: [{species: "Espeon", ability: 'magicbounce', moves: ['growl']}]}); + battle.setPlayer('p1', { team: [{ species: "Xatu", ability: 'magicbounce', moves: ['roost'] }] }); + battle.setPlayer('p2', { team: [{ species: "Espeon", ability: 'magicbounce', moves: ['growl'] }] }); assert.doesNotThrow(() => battle.makeChoices('move roost', 'move growl')); assert.statStage(battle.p1.active[0], 'atk', 0); assert.statStage(battle.p2.active[0], 'atk', -1); }); - it('should not cause a choice-lock', function () { + it('should not cause a choice-lock', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Spoink", ability: 'thickfat', moves: ['bounce']}, - {species: "Xatu", item: 'choicescarf', ability: 'magicbounce', moves: ['roost', 'growl']}, - ]}); - battle.setPlayer('p2', {team: [{species: "Espeon", ability: 'magicbounce', moves: ['growl', 'recover']}]}); + battle.setPlayer('p1', { team: [ + { species: "Spoink", ability: 'thickfat', moves: ['bounce'] }, + { species: "Xatu", item: 'choicescarf', ability: 'magicbounce', moves: ['roost', 'growl'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: "Espeon", ability: 'magicbounce', moves: ['growl', 'recover'] }] }); battle.makeChoices('switch 2', 'move growl'); battle.makeChoices('move roost', 'move recover'); assert.notEqual(battle.p1.active[0].lastMove.id, 'growl'); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Bulbasaur", ability: 'moldbreaker', moves: ['growl']}]}); - battle.setPlayer('p2', {team: [{species: "Espeon", ability: 'magicbounce', moves: ['futuresight']}]}); + battle.setPlayer('p1', { team: [{ species: "Bulbasaur", ability: 'moldbreaker', moves: ['growl'] }] }); + battle.setPlayer('p2', { team: [{ species: "Espeon", ability: 'magicbounce', moves: ['futuresight'] }] }); battle.makeChoices('move growl', 'move futuresight'); assert.statStage(battle.p1.active[0], 'atk', 0); assert.statStage(battle.p2.active[0], 'atk', -1); }); - it('should not bounce moves while semi-invulnerable', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Bulbasaur", ability: 'overgrow', moves: ['growl']}, - {species: "Geodude", ability: 'rockhead', moves: ['stealthrock']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Xatu", ability: 'magicbounce', moves: ['fly']}, - {species: "Charmander", ability: 'blaze', moves: ['sleeptalk']}, - ]}); + it('should not bounce moves while semi-invulnerable', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Bulbasaur", ability: 'overgrow', moves: ['growl'] }, + { species: "Geodude", ability: 'rockhead', moves: ['stealthrock'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Xatu", ability: 'magicbounce', moves: ['fly'] }, + { species: "Charmander", ability: 'blaze', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('auto', 'auto'); assert.statStage(battle.p1.active[0], 'atk', 0); assert.statStage(battle.p2.active[0], 'atk', 0); @@ -68,16 +68,16 @@ describe('Magic Bounce', function () { assert(battle.p2.sideConditions['stealthrock']); }); - it(`[Gen 5] should bounce moves that target the foe's side while semi-invulnerable`, function () { - battle = common.gen(5).createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Bulbasaur", ability: 'overgrow', moves: ['growl']}, - {species: "Geodude", ability: 'rockhead', moves: ['stealthrock']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Xatu", ability: 'magicbounce', moves: ['fly']}, - {species: "Charmander", ability: 'blaze', moves: ['sleeptalk']}, - ]}); + it(`[Gen 5] should bounce moves that target the foe's side while semi-invulnerable`, () => { + battle = common.gen(5).createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Bulbasaur", ability: 'overgrow', moves: ['growl'] }, + { species: "Geodude", ability: 'rockhead', moves: ['stealthrock'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Xatu", ability: 'magicbounce', moves: ['fly'] }, + { species: "Charmander", ability: 'blaze', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('auto', 'auto'); assert.statStage(battle.p1.active[0], 'atk', 0); assert.statStage(battle.p2.active[0], 'atk', 0); diff --git a/test/sim/abilities/magicguard.js b/test/sim/abilities/magicguard.js index 0e38ca0d6b..2e4eccf218 100644 --- a/test/sim/abilities/magicguard.js +++ b/test/sim/abilities/magicguard.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Magic Guard', function () { - afterEach(function () { +describe('Magic Guard', () => { + afterEach(() => { battle.destroy(); }); - it(`should prevent all non-attack damage`, function () { + it(`should prevent all non-attack damage`, () => { battle = common.createBattle([[ - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, - {species: 'Clefable', ability: 'magicguard', item: 'lifeorb', moves: ['doubleedge', 'mindblown', 'highjumpkick']}, + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, + { species: 'Clefable', ability: 'magicguard', item: 'lifeorb', moves: ['doubleedge', 'mindblown', 'highjumpkick'] }, ], [ - {species: 'Crobat', ability: 'roughskin', moves: ['luckychant', 'spikes', 'toxic', 'protect']}, + { species: 'Crobat', ability: 'roughskin', moves: ['luckychant', 'spikes', 'toxic', 'protect'] }, ]]); battle.makeChoices('auto', 'move spikes'); @@ -26,26 +26,26 @@ describe('Magic Guard', function () { assert.fullHP(battle.p1.active[0]); }); - it(`should prevent Leech Seed's healing effect`, function () { + it(`should prevent Leech Seed's healing effect`, () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Clefable', ability: 'magicguard', moves: ['moonblast']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Ferrothorn', ability: 'noguard', moves: ['leechseed']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Clefable', ability: 'magicguard', moves: ['moonblast'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Ferrothorn', ability: 'noguard', moves: ['leechseed'] }, + ] }); battle.makeChoices('move moonblast', 'move leechseed'); assert.fullHP(battle.p1.active[0]); assert.false.fullHP(battle.p2.active[0]); }); - it('should not be suppressed by Mold Breaker', function () { + it('should not be suppressed by Mold Breaker', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, - {species: 'Clefable', ability: 'magicguard', moves: ['doubleedge']}, - ]}); - battle.setPlayer('p2', {team: [{species: 'Haxorus', ability: 'moldbreaker', moves: ['stealthrock', 'roar']}]}); + battle.setPlayer('p1', { team: [ + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, + { species: 'Clefable', ability: 'magicguard', moves: ['doubleedge'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: 'Haxorus', ability: 'moldbreaker', moves: ['stealthrock', 'roar'] }] }); battle.makeChoices('move splash', 'move stealthrock'); battle.makeChoices('move splash', 'move roar'); assert.fullHP(battle.p1.active[0]); diff --git a/test/sim/abilities/magician.js b/test/sim/abilities/magician.js index 88edab3cf3..9eabdb3c7b 100644 --- a/test/sim/abilities/magician.js +++ b/test/sim/abilities/magician.js @@ -5,26 +5,26 @@ const common = require('./../../common'); let battle; -describe('Magician', function () { - afterEach(function () { +describe('Magician', () => { + afterEach(() => { battle.destroy(); }); - it(`should steal the opponents item`, function () { + it(`should steal the opponents item`, () => { battle = common.createBattle([[ - {species: 'klefki', ability: 'magician', moves: ['flashcannon']}, + { species: 'klefki', ability: 'magician', moves: ['flashcannon'] }, ], [ - {species: 'wynaut', item: 'tr69', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'tr69', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].item, 'tr69'); }); - it(`should not steal Weakness Policy on super-effective hits`, function () { + it(`should not steal Weakness Policy on super-effective hits`, () => { battle = common.createBattle([[ - {species: 'klefki', ability: 'magician', moves: ['flashcannon']}, + { species: 'klefki', ability: 'magician', moves: ['flashcannon'] }, ], [ - {species: 'hatterene', item: 'weaknesspolicy', moves: ['sleeptalk']}, + { species: 'hatterene', item: 'weaknesspolicy', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.holdsItem(battle.p1.active[0], 'Klefki should not have stolen Weakness Policy.'); diff --git a/test/sim/abilities/magnetpull.js b/test/sim/abilities/magnetpull.js index a3be607f58..1f4bd95583 100644 --- a/test/sim/abilities/magnetpull.js +++ b/test/sim/abilities/magnetpull.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Magnet Pull', function () { - afterEach(function () { +describe('Magnet Pull', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent Steel-type Pokemon from switching out normally', function () { + it('should prevent Steel-type Pokemon from switching out normally', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Magnezone", ability: 'magnetpull', moves: ['soak', 'charge']}]}); - battle.setPlayer('p2', {team: [ - {species: "Heatran", ability: 'flashfire', moves: ['curse']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Magnezone", ability: 'magnetpull', moves: ['soak', 'charge'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Heatran", ability: 'flashfire', moves: ['curse'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); assert.trapped(() => battle.makeChoices('', 'switch 2'), true); battle.makeChoices('auto', 'auto'); @@ -29,25 +29,25 @@ describe('Magnet Pull', function () { assert.species(battle.p2.active[0], 'Starmie'); }); - it('should not prevent Steel-type Pokemon from switching out using moves', function () { + it('should not prevent Steel-type Pokemon from switching out using moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Magnezone", ability: 'magnetpull', moves: ['toxic']}]}); - battle.setPlayer('p2', {team: [ - {species: "Heatran", ability: 'flashfire', moves: ['batonpass']}, - {species: "Tentacruel", ability: 'clearbody', moves: ['rapidspin']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Magnezone", ability: 'magnetpull', moves: ['toxic'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Heatran", ability: 'flashfire', moves: ['batonpass'] }, + { species: "Tentacruel", ability: 'clearbody', moves: ['rapidspin'] }, + ] }); battle.makeChoices('move toxic', 'move batonpass'); battle.makeChoices('', 'switch 2'); assert.species(battle.p2.active[0], 'Tentacruel'); }); - it('should not prevent Pokemon immune to trapping from switching out', function () { + it('should not prevent Pokemon immune to trapping from switching out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Magnezone", ability: 'magnetpull', moves: ['substitute']}]}); - battle.setPlayer('p2', {team: [ - {species: "Aegislash", ability: 'stancechange', moves: ['swordsdance']}, - {species: "Arcanine", ability: 'flashfire', moves: ['roar']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Magnezone", ability: 'magnetpull', moves: ['substitute'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Aegislash", ability: 'stancechange', moves: ['swordsdance'] }, + { species: "Arcanine", ability: 'flashfire', moves: ['roar'] }, + ] }); battle.makeChoices('move substitute', 'switch 2'); assert.species(battle.p2.active[0], 'Arcanine'); }); diff --git a/test/sim/abilities/mirrorarmor.js b/test/sim/abilities/mirrorarmor.js index a0b17e2561..d2fd1b3a88 100644 --- a/test/sim/abilities/mirrorarmor.js +++ b/test/sim/abilities/mirrorarmor.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe("Mirror Armor", function () { - afterEach(function () { +describe("Mirror Armor", () => { + afterEach(() => { battle.destroy(); }); - it("should bounce boosts back to the source", function () { + it("should bounce boosts back to the source", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Corviknight', ability: 'mirrorarmor', moves: ['endure']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Machop', ability: 'noguard', moves: ['rocktomb', 'leer']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Corviknight', ability: 'mirrorarmor', moves: ['endure'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Machop', ability: 'noguard', moves: ['rocktomb', 'leer'] }, + ] }); battle.makeChoices('auto', 'move rocktomb'); const corv = battle.p1.active[0]; const machop = battle.p2.active[0]; @@ -28,12 +28,12 @@ describe("Mirror Armor", function () { assert.statStage(machop, 'def', -1); }); - it("should reflect Parting Shot's stat drops, then the Parting Shot user should switch", function () { + it("should reflect Parting Shot's stat drops, then the Parting Shot user should switch", () => { battle = common.createBattle([[ - {species: 'Corviknight', ability: 'mirrorarmor', moves: ['sleeptalk']}, + { species: 'Corviknight', ability: 'mirrorarmor', moves: ['sleeptalk'] }, ], [ - {species: 'Drapion', moves: ['partingshot']}, - {species: 'Pangoro', moves: ['sleeptalk']}, + { species: 'Drapion', moves: ['partingshot'] }, + { species: 'Pangoro', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const corv = battle.p1.active[0]; @@ -45,12 +45,12 @@ describe("Mirror Armor", function () { assert.equal(battle.requestState, 'switch'); }); - it("should activate, but silently, if the source has fainted", function () { + it("should activate, but silently, if the source has fainted", () => { battle = common.createBattle([[ - {species: 'corviknight', ability: 'mirrorarmor', moves: ['bravebird']}, + { species: 'corviknight', ability: 'mirrorarmor', moves: ['bravebird'] }, ], [ - {species: 'gossifleur', ability: 'cottondown', moves: ['sleeptalk']}, - {species: 'wynaut', ability: 'shadowtag', moves: ['sleeptalk']}, + { species: 'gossifleur', ability: 'cottondown', moves: ['sleeptalk'] }, + { species: 'wynaut', ability: 'shadowtag', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'spe', 0); diff --git a/test/sim/abilities/moxie.js b/test/sim/abilities/moxie.js index 477d1dafaa..7a1d74db8f 100644 --- a/test/sim/abilities/moxie.js +++ b/test/sim/abilities/moxie.js @@ -5,31 +5,31 @@ const common = require('./../../common'); let battle; -describe('Moxie', function () { - afterEach(function () { +describe('Moxie', () => { + afterEach(() => { battle.destroy(); }); - it('should boost Attack when its user KOs a Pokemon', function () { + it('should boost Attack when its user KOs a Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Krookodile", ability: 'moxie', moves: ['crunch']}]}); - battle.setPlayer('p2', {team: [{species: "Shedinja", moves: ['sleeptalk']}, {species: 'Magikarp', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Krookodile", ability: 'moxie', moves: ['crunch'] }] }); + battle.setPlayer('p2', { team: [{ species: "Shedinja", moves: ['sleeptalk'] }, { species: 'Magikarp', moves: ['splash'] }] }); battle.makeChoices('move crunch', 'move sleeptalk'); assert.statStage(battle.p1.active[0], 'atk', 1); }); - it('should not boost Attack when its user KOs the last Pokemon', function () { + it('should not boost Attack when its user KOs the last Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Krookodile", ability: 'moxie', moves: ['crunch']}]}); - battle.setPlayer('p2', {team: [{species: "Shedinja", moves: ['sleeptalk']}]}); + battle.setPlayer('p1', { team: [{ species: "Krookodile", ability: 'moxie', moves: ['crunch'] }] }); + battle.setPlayer('p2', { team: [{ species: "Shedinja", moves: ['sleeptalk'] }] }); battle.makeChoices('move crunch', 'move sleeptalk'); assert.statStage(battle.p1.active[0], 'atk', 0); }); - it('should not boost Attack when its user KOs several last Pokemon', function () { - battle = common.createBattle({gameType: "doubles"}); - battle.setPlayer('p1', {team: [{species: "Krookodile", ability: 'moxie', moves: ['earthquake']}, {species: "Shedinja", moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: "Shedinja", moves: ['sleeptalk']}, {species: "Shedinja", moves: ['sleeptalk']}]}); + it('should not boost Attack when its user KOs several last Pokemon', () => { + battle = common.createBattle({ gameType: "doubles" }); + battle.setPlayer('p1', { team: [{ species: "Krookodile", ability: 'moxie', moves: ['earthquake'] }, { species: "Shedinja", moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: "Shedinja", moves: ['sleeptalk'] }, { species: "Shedinja", moves: ['sleeptalk'] }] }); battle.makeChoices('move earthquake, move sleeptalk', 'move sleeptalk, move sleeptalk'); assert.statStage(battle.p1.active[0], 'atk', 0); }); diff --git a/test/sim/abilities/multiscale.js b/test/sim/abilities/multiscale.js index 7277c7e4e7..983decbabe 100644 --- a/test/sim/abilities/multiscale.js +++ b/test/sim/abilities/multiscale.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Multiscale', function () { - afterEach(function () { +describe('Multiscale', () => { + afterEach(() => { battle.destroy(); }); - it(`should halve damage when it is at full health`, function () { + it(`should halve damage when it is at full health`, () => { battle = common.createBattle([[ - {species: 'Dragonite', ability: 'multiscale', moves: ['sleeptalk']}, + { species: 'Dragonite', ability: 'multiscale', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['wickedblow']}, + { species: 'Wynaut', moves: ['wickedblow'] }, ]]); battle.makeChoices(); @@ -26,11 +26,11 @@ describe('Multiscale', function () { assert.bounded(dnite.maxhp - dnite.hp - damage, [30, 36], `Multiscale should not reduce damage, because Dragonite was damaged`); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle([[ - {species: 'Dragonite', ability: 'multiscale', moves: ['sleeptalk']}, + { species: 'Dragonite', ability: 'multiscale', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', ability: 'moldbreaker', moves: ['wickedblow']}, + { species: 'Wynaut', ability: 'moldbreaker', moves: ['wickedblow'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/mummy.js b/test/sim/abilities/mummy.js index cc90defd00..cb266cce37 100644 --- a/test/sim/abilities/mummy.js +++ b/test/sim/abilities/mummy.js @@ -5,40 +5,40 @@ const common = require('./../../common'); let battle; -describe('Mummy', function () { - afterEach(function () { +describe('Mummy', () => { + afterEach(() => { battle.destroy(); }); - it(`should set the attacker's ability to Mummy when the user is hit by a contact move`, function () { + it(`should set the attacker's ability to Mummy when the user is hit by a contact move`, () => { battle = common.createBattle([[ - {species: 'Cofagrigus', ability: 'mummy', moves: ['sleeptalk']}, + { species: 'Cofagrigus', ability: 'mummy', moves: ['sleeptalk'] }, ], [ - {species: 'Mew', ability: 'synchronize', moves: ['aerialace']}, + { species: 'Mew', ability: 'synchronize', moves: ['aerialace'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].ability, 'mummy'); }); - it(`should not change abilities that can't be suppressed`, function () { + it(`should not change abilities that can't be suppressed`, () => { battle = common.createBattle([[ - {species: 'Cofagrigus', ability: 'mummy', moves: ['sleeptalk']}, + { species: 'Cofagrigus', ability: 'mummy', moves: ['sleeptalk'] }, ], [ - {species: 'Mimikyu', ability: 'disguise', moves: ['aerialace']}, + { species: 'Mimikyu', ability: 'disguise', moves: ['aerialace'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].ability, 'disguise'); }); - it(`should not activate before all damage calculation is complete`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Sableye', ability: 'toughclaws', moves: ['brutalswing']}, - {species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk']}, + it(`should not activate before all damage calculation is complete`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Sableye', ability: 'toughclaws', moves: ['brutalswing'] }, + { species: 'Golisopod', ability: 'emergencyexit', moves: ['sleeptalk'] }, ], [ - {species: 'Cofagrigus', ability: 'mummy', moves: ['sleeptalk']}, - {species: 'Hoopa', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'Cofagrigus', ability: 'mummy', moves: ['sleeptalk'] }, + { species: 'Hoopa', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); const hoopa = battle.p2.active[1]; diff --git a/test/sim/abilities/myceliummight.js b/test/sim/abilities/myceliummight.js index 77131ddf21..64b051699c 100644 --- a/test/sim/abilities/myceliummight.js +++ b/test/sim/abilities/myceliummight.js @@ -5,34 +5,34 @@ const common = require('./../../common'); let battle; -describe("Mycelium Might", function () { - afterEach(function () { +describe("Mycelium Might", () => { + afterEach(() => { battle.destroy(); }); - it("should cause attacks called by empowered status moves to ignore abilities", function () { + it("should cause attacks called by empowered status moves to ignore abilities", () => { battle = common.createBattle([[ - {species: "Pyukumuku", ability: 'myceliummight', moves: ['sleeptalk', 'earthquake']}, + { species: "Pyukumuku", ability: 'myceliummight', moves: ['sleeptalk', 'earthquake'] }, ], [ - {species: "Orthworm", ability: 'eartheater', moves: ['spore']}, + { species: "Orthworm", ability: 'eartheater', moves: ['spore'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it("should never trigger your own quick claw if using a status move", function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: "Bonsly", ability: 'myceliummight', item: 'quickclaw', moves: ['spore']}, + it("should never trigger your own quick claw if using a status move", () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: "Bonsly", ability: 'myceliummight', item: 'quickclaw', moves: ['spore'] }, ], [ - {species: "Regieleki", moves: ['falseswipe']}, + { species: "Regieleki", moves: ['falseswipe'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p1.active[0]); }); - it("should be able to trigger your own quick claw if using a non-status move", function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: "Bonsly", ability: 'myceliummight', item: 'quickclaw', moves: ['tackle']}, + it("should be able to trigger your own quick claw if using a non-status move", () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: "Bonsly", ability: 'myceliummight', item: 'quickclaw', moves: ['tackle'] }, ], [ - {species: "Regieleki", moves: ['spore']}, + { species: "Regieleki", moves: ['spore'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); diff --git a/test/sim/abilities/naturalcure.js b/test/sim/abilities/naturalcure.js index d9bb7e1cab..29fd3bb345 100644 --- a/test/sim/abilities/naturalcure.js +++ b/test/sim/abilities/naturalcure.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Natural Cure', function () { - it('should cure even when phased out by Roar', function () { +describe('Natural Cure', () => { + it('should cure even when phased out by Roar', () => { battle = common.createBattle(); battle.setPlayer('p1', { team: [ - {species: 'Celebi', ability: 'naturalcure', moves: ['leechseed']}, - {species: 'Swampert', ability: 'torrents', moves: ['surf']}, + { species: 'Celebi', ability: 'naturalcure', moves: ['leechseed'] }, + { species: 'Swampert', ability: 'torrents', moves: ['surf'] }, ], }); battle.setPlayer('p2', { team: [ - {species: 'Zapdos', ability: 'pressure', moves: ['thunderwave', 'roar']}, + { species: 'Zapdos', ability: 'pressure', moves: ['thunderwave', 'roar'] }, ], }); battle.makeChoices('move leechseed', 'move thunderwave'); diff --git a/test/sim/abilities/neutralizinggas.js b/test/sim/abilities/neutralizinggas.js index 66a99c565d..7f15832ea6 100644 --- a/test/sim/abilities/neutralizinggas.js +++ b/test/sim/abilities/neutralizinggas.js @@ -5,56 +5,56 @@ const common = require('./../../common'); let battle; -describe('Neutralizing Gas', function () { - afterEach(function () { +describe('Neutralizing Gas', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent switch-in abilities from activating', function () { + it('should prevent switch-in abilities from activating', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gyarados", ability: 'intimidate', moves: ['splash']}]}); - battle.setPlayer('p2', {team: [{species: "Weezing", ability: 'neutralizinggas', moves: ['toxicspikes']}]}); + battle.setPlayer('p1', { team: [{ species: "Gyarados", ability: 'intimidate', moves: ['splash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Weezing", ability: 'neutralizinggas', moves: ['toxicspikes'] }] }); assert.statStage(battle.p2.active[0], 'atk', 0); }); - it('should ignore damage-reducing abilities', function () { + it('should ignore damage-reducing abilities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Weezing", ability: 'neutralizinggas', item: 'expertbelt', moves: ['sludgebomb']}]}); - battle.setPlayer('p2', {team: [{species: "Mr. Mime", ability: 'filter', item: 'laggingtail', moves: ['substitute']}]}); + battle.setPlayer('p1', { team: [{ species: "Weezing", ability: 'neutralizinggas', item: 'expertbelt', moves: ['sludgebomb'] }] }); + battle.setPlayer('p2', { team: [{ species: "Mr. Mime", ability: 'filter', item: 'laggingtail', moves: ['substitute'] }] }); battle.makeChoices('move sludgebomb', 'move substitute'); assert(!battle.p1.active[0].volatiles['substitute']); }); - it('should negate self-healing abilities', function () { + it('should negate self-healing abilities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Weezing", ability: 'neutralizinggas', moves: ['toxic']}]}); - battle.setPlayer('p2', {team: [{species: "Breloom", ability: 'poisonheal', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Weezing", ability: 'neutralizinggas', moves: ['toxic'] }] }); + battle.setPlayer('p2', { team: [{ species: "Breloom", ability: 'poisonheal', moves: ['swordsdance'] }] }); battle.makeChoices('move toxic', 'move swordsdance'); assert.false.fullHP(battle.p2.active[0]); }); - it('should negate abilities that suppress item effects', function () { + it('should negate abilities that suppress item effects', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Weezing", ability: 'neutralizinggas', moves: ['reflect']}]}); - battle.setPlayer('p2', {team: [{species: "Reuniclus", ability: 'magicguard', item: 'lifeorb', moves: ['shadowball']}]}); + battle.setPlayer('p1', { team: [{ species: "Weezing", ability: 'neutralizinggas', moves: ['reflect'] }] }); + battle.setPlayer('p2', { team: [{ species: "Reuniclus", ability: 'magicguard', item: 'lifeorb', moves: ['shadowball'] }] }); battle.makeChoices('move reflect', 'move shadowball'); assert.false.fullHP(battle.p2.active[0]); }); - it('should negate abilities that modify boosts', function () { + it('should negate abilities that modify boosts', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Weezing", ability: 'neutralizinggas', moves: ['spore']}]}); - battle.setPlayer('p2', {team: [{species: "Shuckle", ability: 'contrary', moves: ['sleeptalk', 'superpower']}]}); + battle.setPlayer('p1', { team: [{ species: "Weezing", ability: 'neutralizinggas', moves: ['spore'] }] }); + battle.setPlayer('p2', { team: [{ species: "Shuckle", ability: 'contrary', moves: ['sleeptalk', 'superpower'] }] }); battle.makeChoices('move spore', 'move sleeptalk'); assert.statStage(battle.p2.active[0], 'atk', -1); }); - it(`should negate abilites that activate on switch-out`, function () { + it(`should negate abilites that activate on switch-out`, () => { battle = common.createBattle([ - [{species: "Weezing", ability: 'neutralizinggas', moves: ['toxic']}, - {species: "Type: Null", ability: 'battlearmor', moves: ['facade']}], - [{species: "Corsola", ability: 'naturalcure', moves: ['uturn']}, - {species: "Magikarp", ability: 'rattled', moves: ['splash']}], + [{ species: "Weezing", ability: 'neutralizinggas', moves: ['toxic'] }, + { species: "Type: Null", ability: 'battlearmor', moves: ['facade'] }], + [{ species: "Corsola", ability: 'naturalcure', moves: ['uturn'] }, + { species: "Magikarp", ability: 'rattled', moves: ['splash'] }], ]); battle.makeChoices('move toxic', 'move uturn'); battle.makeChoices('', 'switch 2'); @@ -62,32 +62,32 @@ describe('Neutralizing Gas', function () { assert.equal(battle.p2.active[0].status, 'tox'); }); - it('should negate abilities that modify move type', function () { + it('should negate abilities that modify move type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gengar", ability: 'neutralizinggas', moves: ['laserfocus']}]}); - battle.setPlayer('p2', {team: [{species: "Sylveon", ability: 'pixilate', moves: ['hypervoice']}]}); + battle.setPlayer('p1', { team: [{ species: "Gengar", ability: 'neutralizinggas', moves: ['laserfocus'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sylveon", ability: 'pixilate', moves: ['hypervoice'] }] }); battle.makeChoices('move laserfocus', 'move hypervoice'); assert.fullHP(battle.p1.active[0]); }); - it("should negate abilities that damage the attacker", function () { + it("should negate abilities that damage the attacker", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Weezing-Galar', ability: 'neutralizinggas', moves: ['payback']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Ferrothorn', ability: 'ironbarbs', moves: ['rockpolish']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Weezing-Galar', ability: 'neutralizinggas', moves: ['payback'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Ferrothorn', ability: 'ironbarbs', moves: ['rockpolish'] }, + ] }); battle.makeChoices(); assert.fullHP(battle.p1.active[0]); }); - it(`should negate Primal weather Abilities`, function () { + it(`should negate Primal weather Abilities`, () => { battle = common.createBattle([[ - {species: 'Groudon', item: 'redorb', moves: ['sleeptalk']}, + { species: 'Groudon', item: 'redorb', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'switch 2'); @@ -96,27 +96,27 @@ describe('Neutralizing Gas', function () { assert(battle.field.isWeather('desolateland'), `Desolate Land should be active again`); }); - it('should not activate Imposter if Neutralizing Gas leaves the field', function () { + it('should not activate Imposter if Neutralizing Gas leaves the field', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Weezing", ability: 'neutralizinggas', moves: ['snore']}, - {species: "Greninja", ability: 'torrent', moves: ['teleport']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Ditto", ability: 'imposter', moves: ['sleeptalk']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Weezing", ability: 'neutralizinggas', moves: ['snore'] }, + { species: "Greninja", ability: 'torrent', moves: ['teleport'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Ditto", ability: 'imposter', moves: ['sleeptalk'] }, + ] }); assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); battle.makeChoices('switch greninja', 'move sleeptalk'); assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); assert.notEqual(battle.p1.pokemon[1].species, battle.p2.active[0].species); }); - it(`should prevent Unburden's activation when it is active on the field`, function () { + it(`should prevent Unburden's activation when it is active on the field`, () => { battle = common.createBattle([[ - {species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: {hp: 4}, moves: ['bellydrum']}, + { species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: { hp: 4 }, moves: ['bellydrum'] }, ], [ - {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: "Whismur", moves: ['sleeptalk']}, + { species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: "Whismur", moves: ['sleeptalk'] }, ]]); const wynaut = battle.p1.active[0]; @@ -124,17 +124,17 @@ describe('Neutralizing Gas', function () { battle.makeChoices(); assert.equal(wynaut.getStat('spe'), originalSpeed); - //The chance to trigger Unburden is gone, so it missed the timing and doesn't gain the speed post-NGas removal + // The chance to trigger Unburden is gone, so it missed the timing and doesn't gain the speed post-NGas removal battle.makeChoices('auto', 'switch 2'); assert.equal(wynaut.getStat('spe'), originalSpeed); }); - it(`should negate Unburden when Neutralizing Gas enters the field`, function () { + it(`should negate Unburden when Neutralizing Gas enters the field`, () => { battle = common.createBattle([[ - {species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: {hp: 4}, moves: ['bellydrum']}, + { species: "Wynaut", ability: 'unburden', item: 'sitrusberry', evs: { hp: 4 }, moves: ['bellydrum'] }, ], [ - {species: "Whismur", moves: ['sleeptalk']}, - {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: "Whismur", moves: ['sleeptalk'] }, + { species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); const wynaut = battle.p1.active[0]; @@ -149,26 +149,26 @@ describe('Neutralizing Gas', function () { assert.equal(wynaut.getStat('spe'), originalSpeed * 2); }); - it(`should cause Illusion to instantly wear off when Neutralizing Gas enters the field`, function () { + it(`should cause Illusion to instantly wear off when Neutralizing Gas enters the field`, () => { battle = common.createBattle([[ - {species: "Zoroark", ability: 'illusion', moves: ['sleeptalk']}, - {species: "Eternatus", moves: ['sleeptalk']}, + { species: "Zoroark", ability: 'illusion', moves: ['sleeptalk'] }, + { species: "Eternatus", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: "Wynaut", moves: ['sleeptalk'] }, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'switch 2'); assert(battle.log.some(line => line.includes('|-end|p1a: Zoroark|Illusion'))); }); - it(`should cause Slow Start to instantly wear off/restart when Neutralizing Gas leaves/enters the field`, function () { + it(`should cause Slow Start to instantly wear off/restart when Neutralizing Gas leaves/enters the field`, () => { battle = common.createBattle([[ - {species: "Regigigas", ability: 'slowstart', moves: ['sleeptalk']}, - {species: "Eternatus", moves: ['sleeptalk']}, + { species: "Regigigas", ability: 'slowstart', moves: ['sleeptalk'] }, + { species: "Eternatus", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: "Wynaut", moves: ['sleeptalk'] }, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); const regigigas = battle.p1.active[0]; @@ -183,12 +183,12 @@ describe('Neutralizing Gas', function () { assert.equal(regigigas.getStat('spe'), slowStartSpeed); }); - it(`should not cause Gluttony to instantly eat Berries when Neutralizing Gas leaves the field`, function () { + it(`should not cause Gluttony to instantly eat Berries when Neutralizing Gas leaves the field`, () => { battle = common.createBattle([[ - {species: "Wynaut", ability: 'gluttony', item: 'aguavberry', evs: {hp: 4}, moves: ['bellydrum']}, + { species: "Wynaut", ability: 'gluttony', item: 'aguavberry', evs: { hp: 4 }, moves: ['bellydrum'] }, ], [ - {species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: "Whismur", level: 1, moves: ['seismictoss']}, + { species: "Pancham", ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: "Whismur", level: 1, moves: ['seismictoss'] }, ]]); const wynaut = battle.p1.active[0]; @@ -204,11 +204,11 @@ describe('Neutralizing Gas', function () { assert.equal(wynaut.hp, Math.floor(wynaut.maxhp / 2) - 1 + Math.floor(wynaut.maxhp / 3)); }); - it(`should not trigger twice if negated then replaced`, function () { + it(`should not trigger twice if negated then replaced`, () => { battle = common.createBattle([[ - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", ability: 'intrepidsword', moves: ['gastroacid', 'simplebeam']}, + { species: "Wynaut", ability: 'intrepidsword', moves: ['gastroacid', 'simplebeam'] }, ]]); const wynaut = battle.p2.active[0]; @@ -220,14 +220,14 @@ describe('Neutralizing Gas', function () { assert.statStage(wynaut, 'atk', 1); }); - it(`should not re-trigger Unnerve if the ability was already triggered before`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Bisharp", ability: 'defiant', moves: ['sleeptalk']}, - {species: "Eternatus", ability: 'pressure', moves: ['sleeptalk']}, + it(`should not re-trigger Unnerve if the ability was already triggered before`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Bisharp", ability: 'defiant', moves: ['sleeptalk'] }, + { species: "Eternatus", ability: 'pressure', moves: ['sleeptalk'] }, ], [ - {species: "Rookidee", ability: 'unnerve', moves: ['sleeptalk']}, - {species: "Diglett", moves: ['sleeptalk']}, - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: "Rookidee", ability: 'unnerve', moves: ['sleeptalk'] }, + { species: "Diglett", moves: ['sleeptalk'] }, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); // Unnerve activates properly on lead @@ -243,12 +243,12 @@ describe('Neutralizing Gas', function () { assert.equal(firstUnnerveIndex, secondUnnerveIndex, 'Unnerve should have only activated once.'); }); - it(`should not announce Neutralizing Gas has worn off, if multiple are active simultenously`, function () { + it(`should not announce Neutralizing Gas has worn off, if multiple are active simultenously`, () => { battle = common.createBattle([[ - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, ], [ - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: "Wynaut", ability: 'intrepidsword', moves: ['sleeptalk']}, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: "Wynaut", ability: 'intrepidsword', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk', 'switch 2'); @@ -256,12 +256,12 @@ describe('Neutralizing Gas', function () { assert.statStage(battle.p2.active[0], 'atk', 0); }); - it(`should not prevent Ice Face from blocking damage nor reform Ice Face when leaving the field`, function () { + it(`should not prevent Ice Face from blocking damage nor reform Ice Face when leaving the field`, () => { battle = common.createBattle([[ - {species: 'Eiscue', ability: 'iceface', moves: ['sleeptalk', 'hail']}, + { species: 'Eiscue', ability: 'iceface', moves: ['sleeptalk', 'hail'] }, ], [ - {species: 'Mewtwo', ability: 'neutralizinggas', moves: ['tackle', 'sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Mewtwo', ability: 'neutralizinggas', moves: ['tackle', 'sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); const eiscue = battle.p1.active[0]; battle.makeChoices(); @@ -274,12 +274,12 @@ describe('Neutralizing Gas', function () { assert.species(eiscue, 'Eiscue-Noice'); }); - it(`should not work if it was obtained via Transform`, function () { + it(`should not work if it was obtained via Transform`, () => { battle = common.createBattle([[ - {species: 'Ditto', moves: ['transform']}, + { species: 'Ditto', moves: ['transform'] }, ], [ - {species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk']}, + { species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: 'Zacian', ability: 'intrepidsword', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -287,12 +287,12 @@ describe('Neutralizing Gas', function () { assert.statStage(battle.p2.active[0], 'atk', 1); }); - it(`should not reactivate abilities that were protected by Ability Shield`, function () { + it(`should not reactivate abilities that were protected by Ability Shield`, () => { battle = common.createBattle([[ - {species: 'Porygon', ability: 'download', item: 'abilityshield', moves: ['sleeptalk']}, + { species: 'Porygon', ability: 'download', item: 'abilityshield', moves: ['sleeptalk'] }, ], [ - {species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk', 'auto'); @@ -301,16 +301,16 @@ describe('Neutralizing Gas', function () { assert.statStage(porygon, 'spa', 1); }); - it(`should not reactivate instances of Embody Aspect that had previously activated`, function () { - battle = common.gen(9).createBattle({gameType: 'freeforall'}, [[ - {species: 'Ogerpon-Hearthflame', ability: 'moldbreaker', item: 'hearthflamemask', moves: ['bellydrum']}, + it(`should not reactivate instances of Embody Aspect that had previously activated`, () => { + battle = common.gen(9).createBattle({ gameType: 'freeforall' }, [[ + { species: 'Ogerpon-Hearthflame', ability: 'moldbreaker', item: 'hearthflamemask', moves: ['bellydrum'] }, ], [ - {species: 'Ogerpon-Wellspring', ability: 'waterabsorb', item: 'wellspringmask', moves: ['sleeptalk']}, + { species: 'Ogerpon-Wellspring', ability: 'waterabsorb', item: 'wellspringmask', moves: ['sleeptalk'] }, ], [ - {species: 'Ogerpon-Cornerstone', ability: 'sturdy', item: 'cornerstonemask', moves: ['sleeptalk']}, + { species: 'Ogerpon-Cornerstone', ability: 'sturdy', item: 'cornerstonemask', moves: ['sleeptalk'] }, ], [ - {species: 'Cosmog', moves: ['splash', 'teleport']}, - {species: 'Weezing', ability: 'neutralizinggas', moves: ['memento']}, + { species: 'Cosmog', moves: ['splash', 'teleport'] }, + { species: 'Weezing', ability: 'neutralizinggas', moves: ['memento'] }, ]]); // only wellspring teras this turn @@ -331,43 +331,43 @@ describe('Neutralizing Gas', function () { assert.statStage(cornerstone, 'def', 1, `Ogerpon-Cornerstone-Tera's Embody Aspect should have been activated by Neutalizing Gas ending`); }); - describe(`Ability reactivation order`, function () { - it(`should cause entrance Abilities to reactivate in order of Speed`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Pincurchin", ability: 'electricsurge', moves: ['sleeptalk']}, - {species: "Eternatus", moves: ['sleeptalk']}, + describe(`Ability reactivation order`, () => { + it(`should cause entrance Abilities to reactivate in order of Speed`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Pincurchin", ability: 'electricsurge', moves: ['sleeptalk'] }, + { species: "Eternatus", moves: ['sleeptalk'] }, ], [ - {species: "Rillaboom", ability: 'grassysurge', moves: ['sleeptalk']}, - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: "Diglett", moves: ['sleeptalk']}, + { species: "Rillaboom", ability: 'grassysurge', moves: ['sleeptalk'] }, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: "Diglett", moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, switch 3'); assert(battle.field.isTerrain('electricterrain')); }); - it(`should cause non-entrance abilities to be active immediately`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Bisharp", ability: 'defiant', moves: ['sleeptalk']}, - {species: "Eternatus", moves: ['sleeptalk']}, + it(`should cause non-entrance abilities to be active immediately`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Bisharp", ability: 'defiant', moves: ['sleeptalk'] }, + { species: "Eternatus", moves: ['sleeptalk'] }, ], [ - {species: "Salamence", ability: 'intimidate', moves: ['sleeptalk']}, - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: "Diglett", moves: ['sleeptalk']}, + { species: "Salamence", ability: 'intimidate', moves: ['sleeptalk'] }, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: "Diglett", moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, switch 3'); assert.statStage(battle.p1.active[0], 'atk', 1); }); - it(`should not give Unnerve priority in activation`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Bisharp", ability: 'defiant', moves: ['sleeptalk']}, - {species: "Eternatus", ability: 'pressure', moves: ['sleeptalk']}, + it(`should not give Unnerve priority in activation`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Bisharp", ability: 'defiant', moves: ['sleeptalk'] }, + { species: "Eternatus", ability: 'pressure', moves: ['sleeptalk'] }, ], [ - {species: "Rookidee", ability: 'unnerve', moves: ['sleeptalk']}, - {species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk']}, - {species: "Diglett", moves: ['sleeptalk']}, + { species: "Rookidee", ability: 'unnerve', moves: ['sleeptalk'] }, + { species: "Weezing", ability: 'neutralizinggas', moves: ['sleeptalk'] }, + { species: "Diglett", moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, switch 3'); diff --git a/test/sim/abilities/normalize.js b/test/sim/abilities/normalize.js index 289e3d7a12..2e4a1735d0 100644 --- a/test/sim/abilities/normalize.js +++ b/test/sim/abilities/normalize.js @@ -5,96 +5,96 @@ const common = require('./../../common'); let battle; -describe('Normalize', function () { - afterEach(function () { +describe('Normalize', () => { + afterEach(() => { battle.destroy(); }); - it('should change most of the user\'s moves to Normal-type', function () { + it('should change most of the user\'s moves to Normal-type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', moves: ['grassknot']}]}); - battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: "Delcatty", ability: 'normalize', moves: ['grassknot'] }] }); + battle.setPlayer('p2', { team: [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }] }); battle.makeChoices('move grassknot', 'move endure'); assert(battle.p2.active[0].hasType('Normal')); }); - it('should not change Hidden Power to Normal-type', function () { + it('should not change Hidden Power to Normal-type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', moves: ['hiddenpowerfighting']}]}); - battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: "Delcatty", ability: 'normalize', moves: ['hiddenpowerfighting'] }] }); + battle.setPlayer('p2', { team: [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }] }); battle.makeChoices('move hiddenpowerfighting', 'move endure'); assert(battle.p2.active[0].hasType('Fighting')); }); - it('should not change Techno Blast to Normal-type if the user is holding a Drive', function () { + it('should not change Techno Blast to Normal-type if the user is holding a Drive', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'dousedrive', moves: ['technoblast']}]}); - battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: "Delcatty", ability: 'normalize', item: 'dousedrive', moves: ['technoblast'] }] }); + battle.setPlayer('p2', { team: [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }] }); battle.makeChoices('move technoblast', 'move endure'); assert(battle.p2.active[0].hasType('Water')); }); - it('should not change Judgment to Normal-type if the user is holding a Plate', function () { + it('should not change Judgment to Normal-type if the user is holding a Plate', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'zapplate', moves: ['judgment']}]}); - battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: "Delcatty", ability: 'normalize', item: 'zapplate', moves: ['judgment'] }] }); + battle.setPlayer('p2', { team: [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }] }); battle.makeChoices('move judgment', 'move endure'); assert(battle.p2.active[0].hasType('Electric')); }); - it('should not change Weather Ball to Normal-type if sun, rain, or hail is an active weather', function () { + it('should not change Weather Ball to Normal-type if sun, rain, or hail is an active weather', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'laggingtail', moves: ['weatherball']}]}); - battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['sunnyday']}]}); + battle.setPlayer('p1', { team: [{ species: "Delcatty", ability: 'normalize', item: 'laggingtail', moves: ['weatherball'] }] }); + battle.setPlayer('p2', { team: [{ species: "Latias", ability: 'colorchange', moves: ['sunnyday'] }] }); battle.makeChoices('move weatherball', 'move sunnyday'); assert(battle.p2.active[0].hasType('Fire')); }); - it('should not change Natural Gift to Normal-type if the user is holding a Berry', function () { + it('should not change Natural Gift to Normal-type if the user is holding a Berry', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Delcatty", ability: 'normalize', item: 'chopleberry', moves: ['naturalgift']}]}); - battle.setPlayer('p2', {team: [{species: "Latias", ability: 'colorchange', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: "Delcatty", ability: 'normalize', item: 'chopleberry', moves: ['naturalgift'] }] }); + battle.setPlayer('p2', { team: [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }] }); battle.makeChoices('move naturalgift', 'move endure'); assert(battle.p2.active[0].hasType('Fighting')); }); }); -describe('Normalize [Gen 4]', function () { - afterEach(function () { +describe('Normalize [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should change most of the user\'s moves to Normal-type', function () { + it('should change most of the user\'s moves to Normal-type', () => { battle = common.gen(4).createBattle([ - [{species: "Delcatty", ability: 'normalize', moves: ['grassknot']}], - [{species: "Latias", ability: 'colorchange', moves: ['endure']}], + [{ species: "Delcatty", ability: 'normalize', moves: ['grassknot'] }], + [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }], ]); battle.makeChoices('move grassknot', 'move endure'); assert(battle.p2.active[0].hasType('Normal')); }); - it('should change Hidden Power to Normal-type', function () { + it('should change Hidden Power to Normal-type', () => { battle = common.gen(4).createBattle([ - [{species: "Delcatty", ability: 'normalize', moves: ['hiddenpowerfire']}], - [{species: "Latias", ability: 'colorchange', moves: ['endure']}], + [{ species: "Delcatty", ability: 'normalize', moves: ['hiddenpowerfire'] }], + [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }], ]); battle.makeChoices('move hiddenpowerfire', 'move endure'); assert(battle.p2.active[0].hasType('Normal')); }); - it('should change Judgment to Normal-type even if the user is holding a Plate', function () { + it('should change Judgment to Normal-type even if the user is holding a Plate', () => { battle = common.gen(4).createBattle([ - [{species: "Delcatty", ability: 'normalize', item: 'pixieplate', moves: ['judgment']}], - [{species: "Latias", ability: 'colorchange', moves: ['endure']}], + [{ species: "Delcatty", ability: 'normalize', item: 'pixieplate', moves: ['judgment'] }], + [{ species: "Latias", ability: 'colorchange', moves: ['endure'] }], ]); battle.makeChoices('move judgment', 'move endure'); assert(battle.p2.active[0].hasType('Normal')); }); - it('should change Weather Ball to Normal-type even if sun, rain, or hail is an active weather', function () { + it('should change Weather Ball to Normal-type even if sun, rain, or hail is an active weather', () => { battle = common.gen(4).createBattle([ - [{species: "Delcatty", ability: 'normalize', item: 'laggingtail', moves: ['weatherball']}], - [{species: "Latias", ability: 'colorchange', moves: ['sunnyday']}], + [{ species: "Delcatty", ability: 'normalize', item: 'laggingtail', moves: ['weatherball'] }], + [{ species: "Latias", ability: 'colorchange', moves: ['sunnyday'] }], ]); battle.makeChoices('move weatherball', 'move sunnyday'); assert(battle.p2.active[0].hasType('Normal')); diff --git a/test/sim/abilities/opportunist.js b/test/sim/abilities/opportunist.js index 313a0bab5b..08e4168826 100644 --- a/test/sim/abilities/opportunist.js +++ b/test/sim/abilities/opportunist.js @@ -10,9 +10,9 @@ describe("Opportunist", () => { it("should not cause an infinite loop with itself", () => { battle = common.createBattle([[ - {species: 'Espathra', ability: 'Opportunist', moves: ['calmmind']}, + { species: 'Espathra', ability: 'Opportunist', moves: ['calmmind'] }, ], [ - {species: 'Espathra', ability: 'Opportunist', moves: ['sleeptalk']}, + { species: 'Espathra', ability: 'Opportunist', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'spa', 1); @@ -21,21 +21,21 @@ describe("Opportunist", () => { it("should copy Anger Point", () => { battle = common.createBattle([[ - {species: 'Espathra', ability: 'Opportunist', moves: ['stormthrow']}, + { species: 'Espathra', ability: 'Opportunist', moves: ['stormthrow'] }, ], [ - {species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk']}, + { species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'atk', 6); }); it("should only copy the effective boost after the +6 cap", () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Espathra', ability: 'Opportunist', moves: ['sleeptalk']}, - {species: 'Froslass', ability: 'Snow Cloak', moves: ['frostbreath']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Espathra', ability: 'Opportunist', moves: ['sleeptalk'] }, + { species: 'Froslass', ability: 'Snow Cloak', moves: ['frostbreath'] }, ], [ - {species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk']}, - {species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk']}, + { species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk'] }, + { species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'atk', -1 + 6); diff --git a/test/sim/abilities/owntempo.js b/test/sim/abilities/owntempo.js index 5d2d760379..97962717bc 100644 --- a/test/sim/abilities/owntempo.js +++ b/test/sim/abilities/owntempo.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Own Tempo', function () { - afterEach(function () { +describe('Own Tempo', () => { + afterEach(() => { battle.destroy(); }); - it('should block Intimidate', function () { + it('should block Intimidate', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Gyarados', ability: 'intimidate', moves: ['splash']}]}); - battle.setPlayer('p2', {team: [{species: 'Smeargle', ability: 'own tempo', item: 'adrenaline orb', moves: ['sleeptalk']}]}); + battle.setPlayer('p1', { team: [{ species: 'Gyarados', ability: 'intimidate', moves: ['splash'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Smeargle', ability: 'own tempo', item: 'adrenaline orb', moves: ['sleeptalk'] }] }); assert.statStage(battle.p2.active[0], 'atk', 0); assert.statStage(battle.p2.active[0], 'spe', 1); }); diff --git a/test/sim/abilities/parentalbond.js b/test/sim/abilities/parentalbond.js index de735acc6a..f0b70a6e54 100644 --- a/test/sim/abilities/parentalbond.js +++ b/test/sim/abilities/parentalbond.js @@ -6,68 +6,68 @@ const common = require('./../../common'); let battle; let damages; -describe('Parental Bond', function () { - beforeEach(function () { +describe('Parental Bond', () => { + beforeEach(() => { battle = common.createBattle([[ - {species: 'Kangaskhan', ability: 'parentalbond', item: 'electriumz', moves: ['thunderpunch', 'doublekick']}, + { species: 'Kangaskhan', ability: 'parentalbond', item: 'electriumz', moves: ['thunderpunch', 'doublekick'] }, ], [ - {species: 'Aggron', ability: 'battlearmor', moves: ['rest']}, + { species: 'Aggron', ability: 'battlearmor', moves: ['rest'] }, ]]); damages = []; - battle.onEvent('ModifyDamage', battle.format, -9, function (damage, attacker, defender, move) { + battle.onEvent('ModifyDamage', battle.format, -9, (damage, attacker, defender, move) => { damages.push(damage); }); }); - afterEach(function () { + afterEach(() => { battle.destroy(); }); - it(`should cause single-hit attacks to strike twice, with the second hit dealing 0.25x damage`, function () { + it(`should cause single-hit attacks to strike twice, with the second hit dealing 0.25x damage`, () => { battle.makeChoices('move thunderpunch', 'move rest'); assert.bounded(damages[0], [31, 37]); assert.bounded(damages[1], [7, 9]); }); - it(`should not have any effect on moves with multiple hits`, function () { + it(`should not have any effect on moves with multiple hits`, () => { battle.makeChoices('move doublekick', 'move rest'); assert.bounded(damages[0], [52, 64]); assert.bounded(damages[1], [52, 64]); }); - it(`should not have any effect Z-Moves`, function () { + it(`should not have any effect Z-Moves`, () => { battle.makeChoices('move thunderpunch zmove', 'move rest'); assert.equal(damages.length, 1); assert.bounded(damages[0], [58, 69]); }); }); -describe('Parental Bond [Gen 6]', function () { - beforeEach(function () { +describe('Parental Bond [Gen 6]', () => { + beforeEach(() => { battle = common.gen(6).createBattle([[ - {species: 'Kangaskhan', ability: 'parentalbond', item: 'electriumz', moves: ['thunderpunch', 'doublekick']}, + { species: 'Kangaskhan', ability: 'parentalbond', item: 'electriumz', moves: ['thunderpunch', 'doublekick'] }, ], [ - {species: 'Aggron', ability: 'battlearmor', moves: ['rest']}, + { species: 'Aggron', ability: 'battlearmor', moves: ['rest'] }, ]]); damages = []; - battle.onEvent('ModifyDamage', battle.format, -9, function (damage, attacker, defender, move) { + battle.onEvent('ModifyDamage', battle.format, -9, (damage, attacker, defender, move) => { damages.push(damage); }); }); - afterEach(function () { + afterEach(() => { battle.destroy(); }); - it(`should cause single-hit attacks to strike twice, with the second hit dealing 0.5x damage`, function () { + it(`should cause single-hit attacks to strike twice, with the second hit dealing 0.5x damage`, () => { battle.makeChoices('move thunderpunch', 'move rest'); assert.bounded(damages[0], [31, 37]); assert.bounded(damages[1], [15, 18]); }); - it(`should not have any effect on moves with multiple hits`, function () { + it(`should not have any effect on moves with multiple hits`, () => { battle.makeChoices('move doublekick', 'move rest'); assert.bounded(damages[0], [52, 64]); assert.bounded(damages[1], [52, 64]); diff --git a/test/sim/abilities/pastelveil.js b/test/sim/abilities/pastelveil.js index 841010cc32..1ecd96090c 100644 --- a/test/sim/abilities/pastelveil.js +++ b/test/sim/abilities/pastelveil.js @@ -5,32 +5,32 @@ const common = require('./../../common'); let battle; -describe('Pastel Veil', function () { - afterEach(function () { +describe('Pastel Veil', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent itself and its allies from becoming poisoned', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + it('should prevent itself and its allies from becoming poisoned', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'croagunk', moves: ['toxic']}, - {species: 'wynaut', ability: 'compoundeyes', moves: ['poisongas']}, + { species: 'croagunk', moves: ['toxic'] }, + { species: 'wynaut', ability: 'compoundeyes', moves: ['poisongas'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].status, ''); assert.equal(battle.p1.pokemon[1].status, ''); }); - it('should remove poison on itself and allies when switched in', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + it('should remove poison on itself and allies when switched in', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'croagunk', moves: ['sleeptalk', 'skillswap']}, - {species: 'wynaut', ability: 'compoundeyes', moves: ['poisongas']}, + { species: 'croagunk', moves: ['sleeptalk', 'skillswap'] }, + { species: 'wynaut', ability: 'compoundeyes', moves: ['poisongas'] }, ]]); battle.makeChoices('auto', 'move skillswap 1, move poisongas'); battle.makeChoices('switch 3, move sleeptalk', 'auto'); @@ -39,13 +39,13 @@ describe('Pastel Veil', function () { assert.equal(battle.p1.pokemon[1].status, ''); }); - it('should remove poison on itself and allies when the ability is acquired via Skill Swap', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + it('should remove poison on itself and allies when the ability is acquired via Skill Swap', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'croagunk', moves: ['skillswap', 'sleeptalk']}, - {species: 'wynaut', ability: 'compoundeyes', moves: ['poisongas']}, + { species: 'croagunk', moves: ['skillswap', 'sleeptalk'] }, + { species: 'wynaut', ability: 'compoundeyes', moves: ['poisongas'] }, ]]); battle.makeChoices('auto', 'move skillswap 1, move poisongas'); battle.makeChoices('auto', 'move skillswap 2, move poisongas'); @@ -53,26 +53,26 @@ describe('Pastel Veil', function () { assert.equal(battle.p1.pokemon[1].status, ''); }); - it('should prevent a poison originating from an ally', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'ponyta', ability: 'pastelveil', moves: ['toxic']}, - {species: 'wynaut', moves: ['toxic']}, + it('should prevent a poison originating from an ally', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'ponyta', ability: 'pastelveil', moves: ['toxic'] }, + { species: 'wynaut', moves: ['toxic'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move toxic -2, move toxic -1', 'auto'); assert.equal(battle.p1.pokemon[0].status, ''); assert.equal(battle.p1.pokemon[1].status, ''); }); - it('should be bypassed by Mold Breaker and cured afterwards, but not for the ally', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + it('should be bypassed by Mold Breaker and cured afterwards, but not for the ally', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'ponyta', ability: 'pastelveil', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'croagunk', ability: 'moldbreaker', moves: ['toxic']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'croagunk', ability: 'moldbreaker', moves: ['toxic'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move toxic 1, move sleeptalk'); battle.makeChoices('auto', 'move toxic 2, move sleeptalk'); @@ -80,13 +80,13 @@ describe('Pastel Veil', function () { assert.equal(battle.p1.pokemon[1].status, 'tox'); }); - it('should only check for Pastel Veil cures after Lum/Pecha Berry', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'ponyta', ability: 'pastelveil', item: 'lumberry', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + it('should only check for Pastel Veil cures after Lum/Pecha Berry', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'ponyta', ability: 'pastelveil', item: 'lumberry', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'croagunk', ability: 'moldbreaker', moves: ['toxic']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'croagunk', ability: 'moldbreaker', moves: ['toxic'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move toxic 1, move sleeptalk'); assert.equal(battle.p1.pokemon[0].status, ''); diff --git a/test/sim/abilities/pickpocket.js b/test/sim/abilities/pickpocket.js index 188f967deb..9e94e9f215 100644 --- a/test/sim/abilities/pickpocket.js +++ b/test/sim/abilities/pickpocket.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Pickpocket', function () { - afterEach(function () { +describe('Pickpocket', () => { + afterEach(() => { battle.destroy(); }); - it(`should steal a foe's item if hit by a contact move`, function () { + it(`should steal a foe's item if hit by a contact move`, () => { battle = common.createBattle([[ - {species: 'Weavile', ability: 'pickpocket', moves: ['agility']}, + { species: 'Weavile', ability: 'pickpocket', moves: ['agility'] }, ], [ - {species: 'Sylveon', item: 'choicescarf', moves: ['quickattack']}, + { species: 'Sylveon', item: 'choicescarf', moves: ['quickattack'] }, ]]); battle.makeChoices(); @@ -22,35 +22,35 @@ describe('Pickpocket', function () { assert.false.holdsItem(battle.p2.active[0]); }); - it(`should not steal a foe's item if the Pickpocket user switched out through Eject Button`, function () { + it(`should not steal a foe's item if the Pickpocket user switched out through Eject Button`, () => { battle = common.createBattle([[ - {species: 'Weavile', ability: 'pickpocket', item: 'ejectbutton', moves: ['agility']}, - {species: 'Chansey', moves: ['softboiled']}, + { species: 'Weavile', ability: 'pickpocket', item: 'ejectbutton', moves: ['agility'] }, + { species: 'Chansey', moves: ['softboiled'] }, ], [ - {species: 'Sylveon', item: 'choicescarf', moves: ['quickattack']}, + { species: 'Sylveon', item: 'choicescarf', moves: ['quickattack'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p2.active[0]); }); - it(`should not steal a foe's item if forced to switch out`, function () { + it(`should not steal a foe's item if forced to switch out`, () => { battle = common.createBattle([[ - {species: 'Weavile', ability: 'pickpocket', moves: ['agility']}, - {species: 'Chansey', moves: ['softboiled']}, + { species: 'Weavile', ability: 'pickpocket', moves: ['agility'] }, + { species: 'Chansey', moves: ['softboiled'] }, ], [ - {species: 'Duraludon', ability: 'compoundeyes', item: 'choicescarf', moves: ['dragontail']}, + { species: 'Duraludon', ability: 'compoundeyes', item: 'choicescarf', moves: ['dragontail'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p2.active[0]); }); - it.skip(`should steal items back and forth when hit by a Magician user`, function () { + it.skip(`should steal items back and forth when hit by a Magician user`, () => { battle = common.createBattle([[ - {species: 'Weavile', ability: 'pickpocket', item: 'cheriberry', moves: ['agility']}, + { species: 'Weavile', ability: 'pickpocket', item: 'cheriberry', moves: ['agility'] }, ], [ - {species: 'Klefki', ability: 'magician', moves: ['foulplay']}, + { species: 'Klefki', ability: 'magician', moves: ['foulplay'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/pickup.js b/test/sim/abilities/pickup.js index 291f176796..105919a830 100644 --- a/test/sim/abilities/pickup.js +++ b/test/sim/abilities/pickup.js @@ -5,67 +5,67 @@ const common = require('./../../common'); let battle; -describe('Pickup', function () { - afterEach(function () { +describe('Pickup', () => { + afterEach(() => { battle.destroy(); }); - it('should pick up a consumed item', function () { + it('should pick up a consumed item', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Gourgeist', ability: 'pickup', moves: ['flamethrower']}]}); - battle.setPlayer('p2', {team: [{species: 'Paras', ability: 'dryskin', item: 'sitrusberry', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: 'Gourgeist', ability: 'pickup', moves: ['flamethrower'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Paras', ability: 'dryskin', item: 'sitrusberry', moves: ['endure'] }] }); battle.makeChoices('move flamethrower', 'move endure'); assert.holdsItem(battle.p1.active[0], "Pick Up should retrieve consumed Sitrus Berry"); }); - it('should pick up flung items', function () { + it('should pick up flung items', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Gourgeist', ability: 'pickup', moves: ['endure']}]}); - battle.setPlayer('p2', {team: [{species: 'Clefairy', ability: 'unaware', item: 'airballoon', moves: ['fling']}]}); + battle.setPlayer('p1', { team: [{ species: 'Gourgeist', ability: 'pickup', moves: ['endure'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Clefairy', ability: 'unaware', item: 'airballoon', moves: ['fling'] }] }); battle.makeChoices('move endure', 'move fling'); assert.holdsItem(battle.p1.active[0], "Pick Up should retrieve flung Air Balloon"); }); - it('should not pick up an item that was knocked off', function () { + it('should not pick up an item that was knocked off', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Ambipom', ability: 'pickup', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: 'Machamp', ability: 'noguard', item: 'choicescarf', moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ambipom', ability: 'pickup', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Machamp', ability: 'noguard', item: 'choicescarf', moves: ['bulkup'] }] }); battle.makeChoices('move knockoff', 'move bulkup'); assert.false.holdsItem(battle.p1.active[0], "Pick Up should not retrieve knocked off Choice Scarf"); }); - it('should not pick up a popped Air Balloon', function () { + it('should not pick up a popped Air Balloon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Ambipom', ability: 'pickup', moves: ['fakeout']}]}); - battle.setPlayer('p2', {team: [{species: 'Scizor', ability: 'swarm', item: 'airballoon', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ambipom', ability: 'pickup', moves: ['fakeout'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Scizor', ability: 'swarm', item: 'airballoon', moves: ['roost'] }] }); battle.makeChoices('move fakeout', 'move roost'); assert.false.holdsItem(battle.p1.active[0], "Pick Up should not retrieve popped Air Balloon"); }); - it('should not pick up items from Pokemon that have switched out and back in', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Gourgeist', ability: 'pickup', moves: ['shadowsneak']}, - {species: 'Aggron', ability: 'sturdy', moves: ['rest']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Ambipom', ability: 'swarm', moves: ['uturn']}, - {species: 'Clefable', ability: 'unaware', item: 'ejectbutton', moves: ['followme']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, - ]}); + it('should not pick up items from Pokemon that have switched out and back in', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Gourgeist', ability: 'pickup', moves: ['shadowsneak'] }, + { species: 'Aggron', ability: 'sturdy', moves: ['rest'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Ambipom', ability: 'swarm', moves: ['uturn'] }, + { species: 'Clefable', ability: 'unaware', item: 'ejectbutton', moves: ['followme'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, + ] }); battle.makeChoices('move shadowsneak 1, move rest', 'move uturn 1, move followme'); battle.makeChoices('', 'switch 3'); // Eject Button activated battle.makeChoices('', 'switch 3'); assert.false.holdsItem(battle.p1.active[0], "Pick Up should not retrieve Eject Button of returned Clefable"); }); - it('should not pick up items from Pokemon that have switched out', function () { + it('should not pick up items from Pokemon that have switched out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Gourgeist', ability: 'pickup', moves: ['shadowsneak', 'synthesis']}]}); - battle.setPlayer('p2', {team: [ - {species: 'Ambipom', ability: 'swarm', item: 'buggem', moves: ['uturn']}, - {species: 'Dusknoir', ability: 'pressure', item: 'ejectbutton', moves: ['painsplit']}, - ]}); + battle.setPlayer('p1', { team: [{ species: 'Gourgeist', ability: 'pickup', moves: ['shadowsneak', 'synthesis'] }] }); + battle.setPlayer('p2', { team: [ + { species: 'Ambipom', ability: 'swarm', item: 'buggem', moves: ['uturn'] }, + { species: 'Dusknoir', ability: 'pressure', item: 'ejectbutton', moves: ['painsplit'] }, + ] }); battle.makeChoices('move synthesis', 'move uturn'); battle.makeChoices('', 'switch 2'); assert.false.holdsItem(battle.p1.active[0]); @@ -74,35 +74,35 @@ describe('Pickup', function () { assert.false.holdsItem(battle.p1.active[0]); }); - it('should not pick up items that were already retrieved', function () { + it('should not pick up items that were already retrieved', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Ambipom', ability: 'pickup', moves: ['return']}]}); - battle.setPlayer('p2', {team: [{species: 'Aron', level: 1, ability: 'sturdy', item: 'berryjuice', moves: ['recycle']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ambipom', ability: 'pickup', moves: ['return'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Aron', level: 1, ability: 'sturdy', item: 'berryjuice', moves: ['recycle'] }] }); battle.makeChoices('move return', 'move recycle'); assert.false.holdsItem(battle.p1.active[0]); }); - it('should pick up items from adjacent allies', function () { - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: 'Ambipom', ability: 'pickup', moves: ['protect']}, {species: 'Aron', level: 1, ability: 'sturdy', item: 'berryjuice', moves: ['followme']}], - [{species: 'Ambipom', ability: 'technician', moves: ['return']}, {species: 'Arcanine', ability: 'flashfire', moves: ['protect']}], + it('should pick up items from adjacent allies', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: 'Ambipom', ability: 'pickup', moves: ['protect'] }, { species: 'Aron', level: 1, ability: 'sturdy', item: 'berryjuice', moves: ['followme'] }], + [{ species: 'Ambipom', ability: 'technician', moves: ['return'] }, { species: 'Arcanine', ability: 'flashfire', moves: ['protect'] }], ]); battle.makeChoices('move protect, move followme', 'move return 1, move protect'); assert.holdsItem(battle.p1.active[0]); }); - it('should not pick up items from non-adjacent allies and enemies', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: 'Ambipom', ability: 'pickup', moves: ['protect']}, - {species: 'Regirock', ability: 'sturdy', moves: ['curse']}, - {species: 'Arcanine', ability: 'flashfire', item: 'normalgem', moves: ['extremespeed']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Arcanine', ability: 'flashfire', item: 'firegem', moves: ['flamecharge']}, - {species: 'Aggron', ability: 'sturdy', moves: ['rest']}, - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, - ]}); + it('should not pick up items from non-adjacent allies and enemies', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: 'Ambipom', ability: 'pickup', moves: ['protect'] }, + { species: 'Regirock', ability: 'sturdy', moves: ['curse'] }, + { species: 'Arcanine', ability: 'flashfire', item: 'normalgem', moves: ['extremespeed'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Arcanine', ability: 'flashfire', item: 'firegem', moves: ['flamecharge'] }, + { species: 'Aggron', ability: 'sturdy', moves: ['rest'] }, + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, + ] }); battle.makeChoices('move protect, move curse, move extremespeed 2', 'move flamecharge 2, move rest, move splash'); assert.false.holdsItem(battle.p1.active[0]); }); diff --git a/test/sim/abilities/poisontouch.js b/test/sim/abilities/poisontouch.js index a0d9105bc3..fd9b6ea9c6 100644 --- a/test/sim/abilities/poisontouch.js +++ b/test/sim/abilities/poisontouch.js @@ -5,28 +5,28 @@ const common = require('./../../common'); let battle; -describe(`Poison Touch`, function () { - afterEach(function () { +describe(`Poison Touch`, () => { + afterEach(() => { battle.destroy(); }); - it(`should poison targets if the user damages the target with a contact move`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Wynaut', ability: 'poisontouch', moves: ['falseswipe']}, + it(`should poison targets if the user damages the target with a contact move`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Wynaut', ability: 'poisontouch', moves: ['falseswipe'] }, ], [ - {species: 'Shuckle', moves: ['falseswipe']}, + { species: 'Shuckle', moves: ['falseswipe'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].status, '', `Wynaut should not be poisoned`); assert.equal(battle.p2.active[0].status, 'psn', `Shuckle should be poisoned`); }); - it(`should not poison targets behind a Substitute or holding Covert Cloak`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Wynaut', ability: 'poisontouch', moves: ['falseswipe']}, + it(`should not poison targets behind a Substitute or holding Covert Cloak`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Wynaut', ability: 'poisontouch', moves: ['falseswipe'] }, ], [ - {species: 'Shuckle', ability: 'prankster', moves: ['substitute']}, - {species: 'Regirock', item: 'covertcloak', moves: ['sleeptalk']}, + { species: 'Shuckle', ability: 'prankster', moves: ['substitute'] }, + { species: 'Regirock', item: 'covertcloak', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].status, '', `Shuckle should not be poisoned`); @@ -35,11 +35,11 @@ describe(`Poison Touch`, function () { assert.equal(battle.p2.active[0].status, '', `Regirock should not be poisoned`); }); - it(`should poison independently of and after regular secondary status effects`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Wynaut', ability: 'poisontouch', moves: ['nuzzle']}, + it(`should poison independently of and after regular secondary status effects`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Wynaut', ability: 'poisontouch', moves: ['nuzzle'] }, ], [ - {species: 'Shuckle', item: 'lumberry', moves: ['sleeptalk']}, + { species: 'Shuckle', item: 'lumberry', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const shuckle = battle.p2.active[0]; @@ -47,22 +47,22 @@ describe(`Poison Touch`, function () { assert.false.holdsItem(shuckle); }); - it(`should poison before Mummy takes over the user's Ability`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Wynaut', ability: 'poisontouch', moves: ['falseswipe']}, + it(`should poison before Mummy takes over the user's Ability`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Wynaut', ability: 'poisontouch', moves: ['falseswipe'] }, ], [ - {species: 'Shuckle', ability: 'mummy', moves: ['sleeptalk']}, + { species: 'Shuckle', ability: 'mummy', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].ability, 'mummy'); assert.equal(battle.p2.active[0].status, 'psn'); }); - it(`should not poison itself with contact moves that aren't hitting other Pokemon`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Wynaut', ability: 'poisontouch', moves: ['bide']}, + it(`should not poison itself with contact moves that aren't hitting other Pokemon`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Wynaut', ability: 'poisontouch', moves: ['bide'] }, ], [ - {species: 'Shuckle', moves: ['sleeptalk']}, + { species: 'Shuckle', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -71,16 +71,16 @@ describe(`Poison Touch`, function () { assert.equal(battle.p1.active[0].status, ''); }); - it(`should not have a 60% chance to poison if Pledge Rainbow is active`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'poisontouch', moves: ['falseswipe', 'waterpledge']}, - {species: 'wobbuffet', moves: ['sleeptalk', 'firepledge']}, + it(`should not have a 60% chance to poison if Pledge Rainbow is active`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'poisontouch', moves: ['falseswipe', 'waterpledge'] }, + { species: 'wobbuffet', moves: ['sleeptalk', 'firepledge'] }, ], [ - {species: 'pyukumuku', moves: ['sleeptalk']}, - {species: 'feebas', moves: ['sleeptalk']}, + { species: 'pyukumuku', moves: ['sleeptalk'] }, + { species: 'feebas', moves: ['sleeptalk'] }, ]]); - battle.onEvent('ModifyMove', battle.format, -99, function (move) { + battle.onEvent('ModifyMove', battle.format, -99, move => { if (move.id === 'falseswipe') { // If False Swipe had a psn secondary, it would have a 60% chance to activate assert.equal(move.secondaries, null); diff --git a/test/sim/abilities/prankster.js b/test/sim/abilities/prankster.js index 3a4113be2f..ad48fcdf5a 100644 --- a/test/sim/abilities/prankster.js +++ b/test/sim/abilities/prankster.js @@ -5,66 +5,66 @@ const common = require('./../../common'); let battle; -describe('Prankster', function () { - afterEach(function () { +describe('Prankster', () => { + afterEach(() => { battle.destroy(); }); - it('should increase the priority of Status moves', function () { + it('should increase the priority of Status moves', () => { battle = common.createBattle([ - [{species: "Murkrow", ability: 'prankster', moves: ['taunt']}], - [{species: "Deoxys-Speed", ability: 'pressure', moves: ['calmmind']}], + [{ species: "Murkrow", ability: 'prankster', moves: ['taunt'] }], + [{ species: "Deoxys-Speed", ability: 'pressure', moves: ['calmmind'] }], ]); battle.makeChoices('move taunt', 'move calmmind'); assert.statStage(battle.p2.active[0], 'spa', 0); }); - it('should cause Status moves to fail against Dark Pokémon', function () { + it('should cause Status moves to fail against Dark Pokémon', () => { battle = common.createBattle([ - [{species: "Sableye", ability: 'prankster', moves: ['willowisp']}], - [{species: "Sableye", ability: 'keeneye', moves: ['willowisp']}], + [{ species: "Sableye", ability: 'prankster', moves: ['willowisp'] }], + [{ species: "Sableye", ability: 'keeneye', moves: ['willowisp'] }], ]); assert.constant(() => battle.p2.active[0].status, () => battle.makeChoices('move willowisp', 'move willowisp')); }); - it('should cause bounced Status moves to fail against Dark Pokémon', function () { + it('should cause bounced Status moves to fail against Dark Pokémon', () => { battle = common.createBattle([ - [{species: "Klefki", ability: 'prankster', moves: ['magiccoat']}], - [{species: "Spiritomb", ability: 'pressure', moves: ['willowisp']}], + [{ species: "Klefki", ability: 'prankster', moves: ['magiccoat'] }], + [{ species: "Spiritomb", ability: 'pressure', moves: ['willowisp'] }], ]); assert.constant(() => battle.p2.active[0].status, () => battle.makeChoices('move magiccoat', 'move willowisp')); }); - it('should not cause bounced Status moves to fail against Dark Pokémon if it is removed', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Alakazam", ability: 'synchronize', moves: ['skillswap']}, - {species: "Sableye", ability: 'prankster', moves: ['magiccoat']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Pyukumuku", ability: 'unaware', moves: ['curse']}, - {species: "Houndoom", ability: 'flashfire', moves: ['confide']}, - ]}); + it('should not cause bounced Status moves to fail against Dark Pokémon if it is removed', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Alakazam", ability: 'synchronize', moves: ['skillswap'] }, + { species: "Sableye", ability: 'prankster', moves: ['magiccoat'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Pyukumuku", ability: 'unaware', moves: ['curse'] }, + { species: "Houndoom", ability: 'flashfire', moves: ['confide'] }, + ] }); const darkPokemon = battle.p2.active[1]; battle.makeChoices('move skillswap -2, move magiccoat', 'move curse, move confide 2'); assert.statStage(darkPokemon, 'spa', -1); }); - it('should not cause Status moves forced by Encore to fail against Dark Pokémon', function () { + it('should not cause Status moves forced by Encore to fail against Dark Pokémon', () => { battle = common.createBattle([ - [{species: "Liepard", ability: 'prankster', moves: ['encore']}], - [{species: "Riolu", ability: 'prankster', moves: ['confide', 'return']}], + [{ species: "Liepard", ability: 'prankster', moves: ['encore'] }], + [{ species: "Riolu", ability: 'prankster', moves: ['confide', 'return'] }], ]); battle.makeChoices('move encore', 'move confide'); battle.makeChoices('move encore', 'move return'); assert.statStage(battle.p1.active[0], 'spa', -1); }); - it('should cause moves forced by Encore to fail against Dark Pokémon if the attacker intended to use a Status move', function () { + it('should cause moves forced by Encore to fail against Dark Pokémon if the attacker intended to use a Status move', () => { // https://www.smogon.com/forums/threads/3469932/page-396#post-7736003 - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: "Liepard", ability: 'prankster', moves: ['encore', 'nastyplot']}, {species: "Tapu Fini", ability: 'mistysurge', moves: ['calmmind']}], - [{species: "Meowstic", ability: 'prankster', moves: ['frustration', 'leer']}, {species: "Lopunny", ability: 'limber', moves: ['agility']}], + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: "Liepard", ability: 'prankster', moves: ['encore', 'nastyplot'] }, { species: "Tapu Fini", ability: 'mistysurge', moves: ['calmmind'] }], + [{ species: "Meowstic", ability: 'prankster', moves: ['frustration', 'leer'] }, { species: "Lopunny", ability: 'limber', moves: ['agility'] }], ]); battle.makeChoices('move encore 1, move calmmind', 'move frustration 2, move agility'); @@ -73,26 +73,26 @@ describe('Prankster', function () { assert.fullHP(battle.p1.active[0]); }); - it('should not leak the ability via hint if the target is immune to the Status move', function () { + it('should not leak the ability via hint if the target is immune to the Status move', () => { battle = common.createBattle([ - [{species: "Sableye", ability: 'prankster', moves: ['willowisp']}], - [{species: "Houndoom", ability: 'pressure', moves: ['willowisp']}], + [{ species: "Sableye", ability: 'prankster', moves: ['willowisp'] }], + [{ species: "Houndoom", ability: 'pressure', moves: ['willowisp'] }], ]); battle.makeChoices('move willowisp', 'move willowisp'); assert.false(battle.log.some(line => line.includes('hint')), `Prankster should not leak the ability via hint`); }); }); -describe('Prankster [Gen 6]', function () { - afterEach(function () { +describe('Prankster [Gen 6]', () => { + afterEach(() => { battle.destroy(); }); - it(`should not cause Status moves to fail against Dark Pokémon`, function () { + it(`should not cause Status moves to fail against Dark Pokémon`, () => { battle = common.gen(6).createBattle([[ - {species: 'Sableye', ability: 'prankster', moves: ['willowisp']}, + { species: 'Sableye', ability: 'prankster', moves: ['willowisp'] }, ], [ - {species: 'Sableye', ability: 'noguard', moves: ['willowisp']}, + { species: 'Sableye', ability: 'noguard', moves: ['willowisp'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].status, 'brn'); diff --git a/test/sim/abilities/pressure.js b/test/sim/abilities/pressure.js index 263636374a..4c9e13bdce 100644 --- a/test/sim/abilities/pressure.js +++ b/test/sim/abilities/pressure.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe(`Pressure`, function () { - afterEach(function () { +describe(`Pressure`, () => { + afterEach(() => { battle.destroy(); }); - it(`should deduct 1 extra PP from opposing Pokemon moves targeting the user`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Giratina', ability: 'pressure', moves: ['sleeptalk']}, - {species: 'Togepi', moves: ['peck']}, + it(`should deduct 1 extra PP from opposing Pokemon moves targeting the user`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Giratina', ability: 'pressure', moves: ['sleeptalk'] }, + { species: 'Togepi', moves: ['peck'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Ho-Oh', moves: ['peck']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Ho-Oh', moves: ['peck'] }, ]]); battle.makeChoices('move sleeptalk, move peck -1', 'move sleeptalk, move peck 1'); const togepi = battle.p1.active[1]; @@ -26,13 +26,13 @@ describe(`Pressure`, function () { assert.equal(hooh.getMoveData(move).pp, hooh.getMoveData(move).maxpp - 2); }); - it(`should deduct 1 extra PP if moves are redirected to the user`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Giratina', ability: 'pressure', moves: ['followme']}, - {species: 'Togepi', moves: ['peck']}, + it(`should deduct 1 extra PP if moves are redirected to the user`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Giratina', ability: 'pressure', moves: ['followme'] }, + { species: 'Togepi', moves: ['peck'] }, ], [ - {species: 'Clefable', moves: ['followme']}, - {species: 'Ho-Oh', ability: 'pressure', moves: ['peck']}, + { species: 'Clefable', moves: ['followme'] }, + { species: 'Ho-Oh', ability: 'pressure', moves: ['peck'] }, ]]); battle.makeChoices('move followme, move peck 2', 'move followme, move peck 2'); const togepi = battle.p1.active[1]; @@ -42,11 +42,11 @@ describe(`Pressure`, function () { assert.equal(hooh.getMoveData(move).pp, hooh.getMoveData(move).maxpp - 2); }); - it(`should deduct PP even if the move fails or misses`, function () { + it(`should deduct PP even if the move fails or misses`, () => { battle = common.createBattle([[ - {species: 'Dusknoir', ability: 'pressure', moves: ['mistyterrain', 'shadowforce']}, + { species: 'Dusknoir', ability: 'pressure', moves: ['mistyterrain', 'shadowforce'] }, ], [ - {species: 'Smeargle', ability: 'desolateland', moves: ['doubleedge', 'spore', 'moonblast', 'surf']}, + { species: 'Smeargle', ability: 'desolateland', moves: ['doubleedge', 'spore', 'moonblast', 'surf'] }, ]]); const smeargle = battle.p2.active[0]; @@ -67,15 +67,15 @@ describe(`Pressure`, function () { assert.equal(move.pp, move.maxpp - 2, `Surf should lose 1 additional PP from Pressure`); }); - it(`should deduct PP for each Pressure Pokemon targeted`, function () { - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Giratina', ability: 'pressure', moves: ['rest']}, - {species: 'Palkia', ability: 'pressure', moves: ['rest']}, - {species: 'Dialga', ability: 'pressure', moves: ['rest']}, + it(`should deduct PP for each Pressure Pokemon targeted`, () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Giratina', ability: 'pressure', moves: ['rest'] }, + { species: 'Palkia', ability: 'pressure', moves: ['rest'] }, + { species: 'Dialga', ability: 'pressure', moves: ['rest'] }, ], [ - {species: 'Kyurem', ability: 'pressure', moves: ['hail']}, - {species: 'Zekrom', ability: 'teravolt', moves: ['spikes']}, - {species: 'Reshiram', ability: 'turboblaze', moves: ['rockslide']}, + { species: 'Kyurem', ability: 'pressure', moves: ['hail'] }, + { species: 'Zekrom', ability: 'teravolt', moves: ['spikes'] }, + { species: 'Reshiram', ability: 'turboblaze', moves: ['rockslide'] }, ]]); battle.makeChoices(); let move = battle.p2.active[0].getMoveData(Dex.moves.get('hail')); @@ -86,15 +86,15 @@ describe(`Pressure`, function () { assert.equal(move.pp, move.maxpp - 3, `Rock Slide should lose 2 additional PP from Pressure`); }); - it(`should deduct PP for each opposing Pressure Pokemon when Snatch or Imprison are used`, function () { - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Giratina', ability: 'pressure', moves: ['rest']}, - {species: 'Palkia', ability: 'pressure', moves: ['rest']}, - {species: 'Dialga', ability: 'pressure', moves: ['rest']}, + it(`should deduct PP for each opposing Pressure Pokemon when Snatch or Imprison are used`, () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Giratina', ability: 'pressure', moves: ['rest'] }, + { species: 'Palkia', ability: 'pressure', moves: ['rest'] }, + { species: 'Dialga', ability: 'pressure', moves: ['rest'] }, ], [ - {species: 'Kyurem', ability: 'pressure', moves: ['snatch']}, - {species: 'Zekrom', ability: 'teravolt', moves: ['imprison']}, - {species: 'Reshiram', ability: 'turboblaze', moves: ['rest']}, + { species: 'Kyurem', ability: 'pressure', moves: ['snatch'] }, + { species: 'Zekrom', ability: 'teravolt', moves: ['imprison'] }, + { species: 'Reshiram', ability: 'turboblaze', moves: ['rest'] }, ]]); battle.makeChoices(); @@ -104,45 +104,45 @@ describe(`Pressure`, function () { assert.equal(move.pp, move.maxpp - 4, `Imprison should lose 3 additional PP from Pressure`); }); - it(`should deduct additional PP from Max Moves`, function () { + it(`should deduct additional PP from Max Moves`, () => { battle = common.gen(8).createBattle([[ - {species: 'wynaut', moves: ['darkpulse']}, + { species: 'wynaut', moves: ['darkpulse'] }, ], [ - {species: 'absol', ability: 'pressure', moves: ['sleeptalk']}, + { species: 'absol', ability: 'pressure', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move darkpulse dynamax', 'auto'); const move = battle.p1.active[0].getMoveData(Dex.moves.get('darkpulse')); assert.equal(move.pp, move.maxpp - 2); }); - it(`should deduct additional PP from Z-Moves`, function () { + it(`should deduct additional PP from Z-Moves`, () => { battle = common.gen(7).createBattle([[ - {species: 'wynaut', item: 'darkiniumz', moves: ['darkpulse']}, + { species: 'wynaut', item: 'darkiniumz', moves: ['darkpulse'] }, ], [ - {species: 'absol', ability: 'pressure', moves: ['sleeptalk']}, + { species: 'absol', ability: 'pressure', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move darkpulse zmove', 'auto'); const move = battle.p1.active[0].getMoveData(Dex.moves.get('darkpulse')); assert.equal(move.pp, move.maxpp - 2); }); - it(`should deduct additional PP from submoves that target Pressure`, function () { + it(`should deduct additional PP from submoves that target Pressure`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['assist']}, - {species: 'yveltal', moves: ['darkpulse']}, + { species: 'wynaut', moves: ['assist'] }, + { species: 'yveltal', moves: ['darkpulse'] }, ], [ - {species: 'absol', ability: 'pressure', moves: ['sleeptalk']}, + { species: 'absol', ability: 'pressure', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const move = battle.p1.active[0].getMoveData(Dex.moves.get('assist')); assert.equal(move.pp, move.maxpp - 2); }); - it(`should not deduct additional PP from Sticky Web (only entry hazard to do so)`, function () { + it(`should not deduct additional PP from Sticky Web (only entry hazard to do so)`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['stickyweb', 'stealthrock']}, + { species: 'wynaut', moves: ['stickyweb', 'stealthrock'] }, ], [ - {species: 'absol', ability: 'pressure', moves: ['sleeptalk']}, + { species: 'absol', ability: 'pressure', moves: ['sleeptalk'] }, ]]); const wynaut = battle.p1.active[0]; battle.makeChoices('move stickyweb', 'auto'); @@ -154,13 +154,13 @@ describe(`Pressure`, function () { assert.equal(move.pp, move.maxpp - 2, `Stealth Rock should lose 2 PP`); }); - it(`should deduct additional PP from Tera Blast even when not used into the Pressure target`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['terablast']}, - {species: 'magikarp', moves: ['sleeptalk']}, + it(`should deduct additional PP from Tera Blast even when not used into the Pressure target`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['terablast'] }, + { species: 'magikarp', moves: ['sleeptalk'] }, ], [ - {species: 'absol', ability: 'pressure', moves: ['sleeptalk']}, - {species: 'feebas', moves: ['sleeptalk']}, + { species: 'absol', ability: 'pressure', moves: ['sleeptalk'] }, + { species: 'feebas', moves: ['sleeptalk'] }, ]]); const wynaut = battle.p1.active[0]; battle.makeChoices('move terablast -2, auto', 'auto'); @@ -169,11 +169,11 @@ describe(`Pressure`, function () { assert.equal(move.pp, move.maxpp - 4); }); - it(`should not deduct additional PP from moves reflected by Magic Coat`, function () { + it(`should not deduct additional PP from moves reflected by Magic Coat`, () => { battle = common.createBattle([[ - {species: 'reuniclus', moves: ['magiccoat', 'confuseray']}, + { species: 'reuniclus', moves: ['magiccoat', 'confuseray'] }, ], [ - {species: 'dusclops', ability: 'pressure', moves: ['confuseray']}, + { species: 'dusclops', ability: 'pressure', moves: ['confuseray'] }, ]]); battle.makeChoices(); // Reuniclus @@ -187,18 +187,18 @@ describe(`Pressure`, function () { }); }); -describe('Pressure [Gen 4]', function () { - afterEach(function () { +describe('Pressure [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it(`should deduct 1 extra PP from any moves targeting the user`, function () { - battle = common.gen(4).createBattle({gameType: 'doubles'}, [[ - {species: 'Giratina', ability: 'pressure', moves: ['sleeptalk']}, - {species: 'Togepi', moves: ['peck']}, + it(`should deduct 1 extra PP from any moves targeting the user`, () => { + battle = common.gen(4).createBattle({ gameType: 'doubles' }, [[ + { species: 'Giratina', ability: 'pressure', moves: ['sleeptalk'] }, + { species: 'Togepi', moves: ['peck'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Ho-Oh', moves: ['peck']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Ho-Oh', moves: ['peck'] }, ]]); battle.makeChoices('move sleeptalk, move peck -1', 'move sleeptalk, move peck 1'); const togepi = battle.p1.active[1]; @@ -208,13 +208,13 @@ describe('Pressure [Gen 4]', function () { assert.equal(hooh.getMoveData(move).pp, hooh.getMoveData(move).maxpp - 2); }); - it(`should deduct 1 extra PP if moves are redirected to the user`, function () { - battle = common.gen(4).createBattle({gameType: 'doubles'}, [[ - {species: 'Giratina', ability: 'pressure', moves: ['followme']}, - {species: 'Togepi', moves: ['peck']}, + it(`should deduct 1 extra PP if moves are redirected to the user`, () => { + battle = common.gen(4).createBattle({ gameType: 'doubles' }, [[ + { species: 'Giratina', ability: 'pressure', moves: ['followme'] }, + { species: 'Togepi', moves: ['peck'] }, ], [ - {species: 'Clefable', moves: ['followme']}, - {species: 'Ho-Oh', ability: 'pressure', moves: ['peck']}, + { species: 'Clefable', moves: ['followme'] }, + { species: 'Ho-Oh', ability: 'pressure', moves: ['peck'] }, ]]); battle.makeChoices('move followme, move peck 2', 'move followme, move peck 2'); const togepi = battle.p1.active[1]; @@ -224,11 +224,11 @@ describe('Pressure [Gen 4]', function () { assert.equal(hooh.getMoveData(move).pp, hooh.getMoveData(move).maxpp - 2); }); - it(`should deduct PP even if the move fails or misses`, function () { + it(`should deduct PP even if the move fails or misses`, () => { battle = common.gen(4).createBattle([[ - {species: 'Dusknoir', ability: 'pressure', moves: ['shadowforce']}, + { species: 'Dusknoir', ability: 'pressure', moves: ['shadowforce'] }, ], [ - {species: 'Smeargle', moves: ['doubleedge', 'dragonpulse']}, + { species: 'Smeargle', moves: ['doubleedge', 'dragonpulse'] }, ]]); const smeargle = battle.p2.active[0]; battle.makeChoices(); @@ -240,13 +240,13 @@ describe('Pressure [Gen 4]', function () { assert.equal(move.pp, move.maxpp - 2, `Dragon Pulse should lose 1 additional PP from Pressure`); }); - it(`should deduct PP for each Pressure Pokemon targeted`, function () { - battle = common.gen(4).createBattle({gameType: 'doubles'}, [[ - {species: 'Palkia', ability: 'pressure', moves: ['rest']}, - {species: 'Dialga', ability: 'pressure', moves: ['rest']}, + it(`should deduct PP for each Pressure Pokemon targeted`, () => { + battle = common.gen(4).createBattle({ gameType: 'doubles' }, [[ + { species: 'Palkia', ability: 'pressure', moves: ['rest'] }, + { species: 'Dialga', ability: 'pressure', moves: ['rest'] }, ], [ - {species: 'Lugia', ability: 'pressure', moves: ['hail']}, - {species: 'Ho-Oh', ability: 'pressure', moves: ['earthquake']}, + { species: 'Lugia', ability: 'pressure', moves: ['hail'] }, + { species: 'Ho-Oh', ability: 'pressure', moves: ['earthquake'] }, ]]); battle.makeChoices(); let move = battle.p2.active[0].getMoveData(Dex.moves.get('hail')); @@ -255,11 +255,11 @@ describe('Pressure [Gen 4]', function () { assert.equal(move.pp, move.maxpp - 4, `Earthquake should lose 3 additional PP from Pressure`); }); - it(`should not deduct PP from self-targeting moves`, function () { + it(`should not deduct PP from self-targeting moves`, () => { battle = common.gen(4).createBattle([[ - {species: 'Palkia', ability: 'pressure', moves: ['calmmind']}, + { species: 'Palkia', ability: 'pressure', moves: ['calmmind'] }, ], [ - {species: 'Dialga', ability: 'pressure', moves: ['sleeptalk']}, + { species: 'Dialga', ability: 'pressure', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const move = battle.p1.active[0].getMoveData(Dex.moves.get('calmmind')); diff --git a/test/sim/abilities/primordialsea.js b/test/sim/abilities/primordialsea.js index bca4d00db0..af6abab9c1 100644 --- a/test/sim/abilities/primordialsea.js +++ b/test/sim/abilities/primordialsea.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('Primordial Sea', function () { - afterEach(function () { +describe('Primordial Sea', () => { + afterEach(() => { battle.destroy(); }); - it('should activate the Primordial Sea weather upon switch-in', function () { + it('should activate the Primordial Sea weather upon switch-in', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}]}); - battle.setPlayer('p2', {team: [{species: "Abra", ability: 'magicguard', moves: ['teleport']}]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }] }); + battle.setPlayer('p2', { team: [{ species: "Abra", ability: 'magicguard', moves: ['teleport'] }] }); assert(battle.field.isWeather('primordialsea')); }); - it('should increase the damage (not the basePower) of Water-type attacks', function () { + it('should increase the damage (not the basePower) of Water-type attacks', () => { battle = common.createBattle(); battle.randomizer = dmg => dmg; // max damage - battle.setPlayer('p1', {team: [{species: 'Kyogre', ability: 'primordialsea', moves: ['waterpledge']}]}); - battle.setPlayer('p2', {team: [{species: 'Blastoise', ability: 'torrent', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: 'Kyogre', ability: 'primordialsea', moves: ['waterpledge'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Blastoise', ability: 'torrent', moves: ['splash'] }] }); const attacker = battle.p1.active[0]; const defender = battle.p2.active[0]; assert.hurtsBy(defender, 104, () => battle.makeChoices('move waterpledge', 'move splash')); @@ -30,31 +30,31 @@ describe('Primordial Sea', function () { assert.equal(basePower, move.basePower); }); - it('should cause Fire-type attacks to fail', function () { + it('should cause Fire-type attacks to fail', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}]}); - battle.setPlayer('p2', {team: [{species: "Charizard", ability: 'blaze', moves: ['flamethrower']}]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }] }); + battle.setPlayer('p2', { team: [{ species: "Charizard", ability: 'blaze', moves: ['flamethrower'] }] }); battle.makeChoices('move helpinghand', 'move flamethrower'); assert.fullHP(battle.p1.active[0]); }); - it('should not cause Fire-type Status moves to fail', function () { + it('should not cause Fire-type Status moves to fail', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}]}); - battle.setPlayer('p2', {team: [{species: "Charizard", ability: 'noguard', moves: ['willowisp']}]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }] }); + battle.setPlayer('p2', { team: [{ species: "Charizard", ability: 'noguard', moves: ['willowisp'] }] }); assert.sets(() => battle.p1.active[0].status, 'brn', () => battle.makeChoices('move helpinghand', 'move willowisp')); }); - it('should prevent moves and abilities from setting the weather to Sunny Day, Rain Dance, Sandstorm, or Hail', function () { + it('should prevent moves and abilities from setting the weather to Sunny Day, Rain Dance, Sandstorm, or Hail', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}]}); - battle.setPlayer('p2', {team: [ - {species: "Abra", ability: 'magicguard', moves: ['teleport']}, - {species: "Kyogre", ability: 'drizzle', moves: ['raindance']}, - {species: "Groudon", ability: 'drought', moves: ['sunnyday']}, - {species: "Tyranitar", ability: 'sandstream', moves: ['sandstorm']}, - {species: "Abomasnow", ability: 'snowwarning', moves: ['hail']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Abra", ability: 'magicguard', moves: ['teleport'] }, + { species: "Kyogre", ability: 'drizzle', moves: ['raindance'] }, + { species: "Groudon", ability: 'drought', moves: ['sunnyday'] }, + { species: "Tyranitar", ability: 'sandstream', moves: ['sandstorm'] }, + { species: "Abomasnow", ability: 'snowwarning', moves: ['hail'] }, + ] }); for (let i = 2; i <= 5; i++) { battle.makeChoices('move helpinghand', 'switch ' + i); assert(battle.field.isWeather('primordialsea')); @@ -63,16 +63,16 @@ describe('Primordial Sea', function () { } }); - it('should be treated as Rain Dance for any forme, move or ability that requires it', function () { + it('should be treated as Rain Dance for any forme, move or ability that requires it', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['sonicboom']}]}); - battle.setPlayer('p2', {team: [ - {species: "Castform", ability: 'forecast', moves: ['weatherball']}, - {species: "Kingdra", ability: 'swiftswim', moves: ['focusenergy']}, - {species: "Ludicolo", ability: 'raindish', moves: ['watersport']}, - {species: "Toxicroak", ability: 'dryskin', moves: ['bulkup']}, - {species: "Manaphy", ability: 'hydration', item: 'laggingtail', moves: ['rest']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['sonicboom'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Castform", ability: 'forecast', moves: ['weatherball'] }, + { species: "Kingdra", ability: 'swiftswim', moves: ['focusenergy'] }, + { species: "Ludicolo", ability: 'raindish', moves: ['watersport'] }, + { species: "Toxicroak", ability: 'dryskin', moves: ['bulkup'] }, + { species: "Manaphy", ability: 'hydration', item: 'laggingtail', moves: ['rest'] }, + ] }); battle.onEvent('Hit', battle.format, (target, pokemon, move) => { if (move.id === 'weatherball') { assert.equal(move.type, 'Water'); @@ -92,44 +92,44 @@ describe('Primordial Sea', function () { assert.equal(myActive[0].status, ''); }); - it('should cause the Primordial Sea weather to fade if it switches out and no other Primordial Sea Pokemon are active', function () { + it('should cause the Primordial Sea weather to fade if it switches out and no other Primordial Sea Pokemon are active', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}, - {species: "Ho-Oh", ability: 'pressure', moves: ['roost']}, - ]}); - battle.setPlayer('p2', {team: [{species: "Lugia", ability: 'pressure', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [ + { species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }, + { species: "Ho-Oh", ability: 'pressure', moves: ['roost'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: "Lugia", ability: 'pressure', moves: ['roost'] }] }); assert.sets(() => battle.field.isWeather('primordialsea'), false, () => battle.makeChoices('switch 2', 'move roost')); }); - it('should not cause the Primordial Sea weather to fade if it switches out and another Primordial Sea Pokemon is active', function () { + it('should not cause the Primordial Sea weather to fade if it switches out and another Primordial Sea Pokemon is active', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}, - {species: "Ho-Oh", ability: 'pressure', moves: ['roost']}, - ]}); - battle.setPlayer('p2', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [ + { species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }, + { species: "Ho-Oh", ability: 'pressure', moves: ['roost'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['bulkup'] }] }); assert.constant(() => battle.field.isWeather('primordialsea'), () => battle.makeChoices('switch 2', 'move bulkup')); }); - it('should cause the Primordial Sea weather to fade if its ability is suppressed and no other Primordial Sea Pokemon are active', function () { + it('should cause the Primordial Sea weather to fade if its ability is suppressed and no other Primordial Sea Pokemon are active', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}]}); - battle.setPlayer('p2', {team: [{species: "Lugia", ability: 'pressure', moves: ['gastroacid']}]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }] }); + battle.setPlayer('p2', { team: [{ species: "Lugia", ability: 'pressure', moves: ['gastroacid'] }] }); assert.sets(() => battle.field.isWeather('primordialsea'), false, () => battle.makeChoices('move helpinghand', 'move gastroacid')); }); - it('should not cause the Primordial Sea weather to fade if its ability is suppressed and another Primordial Sea Pokemon is active', function () { + it('should not cause the Primordial Sea weather to fade if its ability is suppressed and another Primordial Sea Pokemon is active', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}]}); - battle.setPlayer('p2', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['gastroacid']}]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }] }); + battle.setPlayer('p2', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['gastroacid'] }] }); assert.constant(() => battle.field.isWeather('primordialsea'), () => battle.makeChoices('move helpinghand', 'move gastroacid')); }); - it('should cause the Primordial Sea weather to fade if its ability is changed and no other Primordial Sea Pokemon are active', function () { + it('should cause the Primordial Sea weather to fade if its ability is changed and no other Primordial Sea Pokemon are active', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand']}]}); - battle.setPlayer('p2', {team: [{species: "Lugia", ability: 'pressure', moves: ['entrainment']}]}); + battle.setPlayer('p1', { team: [{ species: "Kyogre", ability: 'primordialsea', moves: ['helpinghand'] }] }); + battle.setPlayer('p2', { team: [{ species: "Lugia", ability: 'pressure', moves: ['entrainment'] }] }); assert.sets(() => battle.field.isWeather('primordialsea'), false, () => battle.makeChoices('move helpinghand', 'move entrainment')); }); }); diff --git a/test/sim/abilities/protean.js b/test/sim/abilities/protean.js index 0c1f41a417..5dee747e13 100644 --- a/test/sim/abilities/protean.js +++ b/test/sim/abilities/protean.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Protean', function () { - afterEach(function () { +describe('Protean', () => { + afterEach(() => { battle.destroy(); }); - it(`should change the user's type when using a move`, function () { + it(`should change the user's type when using a move`, () => { battle = common.createBattle([[ - {species: 'Cinderace', ability: 'protean', moves: ['highjumpkick']}, + { species: 'Cinderace', ability: 'protean', moves: ['highjumpkick'] }, ], [ - {species: 'Gengar', moves: ['sleeptalk']}, + { species: 'Gengar', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -22,11 +22,11 @@ describe('Protean', function () { assert(cinder.hasType('Fighting')); }); - it(`should change the user's type for submoves to the type of that submove, not the move calling it`, function () { + it(`should change the user's type for submoves to the type of that submove, not the move calling it`, () => { battle = common.gen(6).createBattle([[ - {species: 'Wynaut', ability: 'protean', moves: ['sleeptalk', 'flamethrower']}, + { species: 'Wynaut', ability: 'protean', moves: ['sleeptalk', 'flamethrower'] }, ], [ - {species: 'Regieleki', moves: ['spore']}, + { species: 'Regieleki', moves: ['spore'] }, ]]); battle.makeChoices(); @@ -35,13 +35,13 @@ describe('Protean', function () { assert(wynaut.hasType('Fire')); }); - it(`should not change the user's type when using moves that fail earlier than Protean will activate`, function () { + it(`should not change the user's type when using moves that fail earlier than Protean will activate`, () => { battle = common.createBattle([[ - {species: 'Kecleon', ability: 'protean', moves: ['fling', 'suckerpunch', 'steelroller', 'aurawheel']}, - {species: 'Kecleon', ability: 'protean', moves: ['counter', 'metalburst']}, - {species: 'Kecleon', ability: 'protean', moves: ['magnetrise', 'ingrain', 'burnup', 'auroraveil']}, + { species: 'Kecleon', ability: 'protean', moves: ['fling', 'suckerpunch', 'steelroller', 'aurawheel'] }, + { species: 'Kecleon', ability: 'protean', moves: ['counter', 'metalburst'] }, + { species: 'Kecleon', ability: 'protean', moves: ['magnetrise', 'ingrain', 'burnup', 'auroraveil'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); let kecleon = battle.p1.active[0]; @@ -83,14 +83,14 @@ describe('Protean', function () { // More examples: https://www.smogon.com/forums/threads/sword-shield-battle-mechanics-research.3655528/post-8548957 }); - it(`should not change the user's type when abilities that activate earlier than Protean will cause the user's moves to fail`, function () { + it(`should not change the user's type when abilities that activate earlier than Protean will cause the user's moves to fail`, () => { battle = common.createBattle([[ - {species: 'Kecleon', ability: 'protean', moves: ['aquajet', 'mindblown']}, + { species: 'Kecleon', ability: 'protean', moves: ['aquajet', 'mindblown'] }, ], [ - {species: 'Kyogre', ability: 'primordialsea', moves: ['sleeptalk']}, - {species: 'Groudon', ability: 'desolateland', moves: ['powder']}, - {species: 'Tsareena', ability: 'dazzling', moves: ['sleeptalk']}, - {species: 'Golduck', ability: 'damp', moves: ['sleeptalk']}, + { species: 'Kyogre', ability: 'primordialsea', moves: ['sleeptalk'] }, + { species: 'Groudon', ability: 'desolateland', moves: ['powder'] }, + { species: 'Tsareena', ability: 'dazzling', moves: ['sleeptalk'] }, + { species: 'Golduck', ability: 'damp', moves: ['sleeptalk'] }, ]]); const kecleon = battle.p1.active[0]; @@ -113,11 +113,11 @@ describe('Protean', function () { // More examples: https://www.smogon.com/forums/threads/sword-shield-battle-mechanics-research.3655528/post-8548957 }); - it(`should not allow the user to change its typing twice`, function () { + it(`should not allow the user to change its typing twice`, () => { battle = common.createBattle([[ - {species: 'Cinderace', ability: 'protean', moves: ['tackle', 'watergun']}, + { species: 'Cinderace', ability: 'protean', moves: ['tackle', 'watergun'] }, ], [ - {species: 'Gengar', moves: ['sleeptalk']}, + { species: 'Gengar', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -128,12 +128,12 @@ describe('Protean', function () { assert.false(cinder.hasType('Water')); }); - it(`should not allow the user to change its typing twice if the Ability was suppressed`, function () { + it(`should not allow the user to change its typing twice if the Ability was suppressed`, () => { battle = common.createBattle([[ - {species: 'Cinderace', ability: 'protean', moves: ['tackle', 'watergun']}, + { species: 'Cinderace', ability: 'protean', moves: ['tackle', 'watergun'] }, ], [ - {species: 'Gengar', moves: ['sleeptalk']}, - {species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: 'Gengar', moves: ['sleeptalk'] }, + { species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move tackle', 'auto'); @@ -146,11 +146,11 @@ describe('Protean', function () { assert.false(cinder.hasType('Water')); }); - it(`should allow the user to change its typing twice if it lost and regained the Ability`, function () { + it(`should allow the user to change its typing twice if it lost and regained the Ability`, () => { battle = common.createBattle([[ - {species: 'Cinderace', ability: 'protean', moves: ['tackle', 'watergun']}, + { species: 'Cinderace', ability: 'protean', moves: ['tackle', 'watergun'] }, ], [ - {species: 'Gengar', ability: 'protean', moves: ['sleeptalk', 'skillswap']}, + { species: 'Gengar', ability: 'protean', moves: ['sleeptalk', 'skillswap'] }, ]]); battle.makeChoices('move tackle', 'move skillswap'); @@ -161,13 +161,13 @@ describe('Protean', function () { assert(cinder.hasType('Water')); }); - it(`should not be prevented from resetting its effectState by Ability suppression`, function () { + it(`should not be prevented from resetting its effectState by Ability suppression`, () => { battle = common.createBattle([[ - {species: 'Cinderace', ability: 'protean', moves: ['tackle']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Cinderace', ability: 'protean', moves: ['tackle'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Gengar', ability: 'protean', moves: ['sleeptalk']}, - {species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk']}, + { species: 'Gengar', ability: 'protean', moves: ['sleeptalk'] }, + { species: 'Weezing', ability: 'neutralizinggas', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move tackle', 'auto'); @@ -180,20 +180,20 @@ describe('Protean', function () { assert(cinder.hasType('Normal')); }); - describe('Gen 6-8', function () { - it(`should activate on both turns of a charge move`, function () { + describe('Gen 6-8', () => { + it(`should activate on both turns of a charge move`, () => { battle = common.gen(8).createBattle([[ - {species: 'Wynaut', ability: 'protean', moves: ['bounce']}, + { species: 'Wynaut', ability: 'protean', moves: ['bounce'] }, ], [ - {species: 'Helioptile', ability: 'noguard', moves: ['soak']}, + { species: 'Helioptile', ability: 'noguard', moves: ['soak'] }, ]]); const wynaut = battle.p1.active[0]; - //Turn 1 of Bounce + // Turn 1 of Bounce battle.makeChoices(); assert(wynaut.hasType('Flying')); - //Turn 2 of Bounce + // Turn 2 of Bounce battle.makeChoices(); assert(wynaut.hasType('Flying')); }); diff --git a/test/sim/abilities/protosynthesis.js b/test/sim/abilities/protosynthesis.js index 1a06ee37d7..76ef4c5d53 100644 --- a/test/sim/abilities/protosynthesis.js +++ b/test/sim/abilities/protosynthesis.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Protosynthesis', function () { - afterEach(function () { +describe('Protosynthesis', () => { + afterEach(() => { battle.destroy(); }); - it(`should boost the user's highest stat except HP while Sunny Day is active`, function () { + it(`should boost the user's highest stat except HP while Sunny Day is active`, () => { battle = common.createBattle([[ - {species: 'Scream Tail', ability: 'protosynthesis', moves: ['raindance']}, + { species: 'Scream Tail', ability: 'protosynthesis', moves: ['raindance'] }, ], [ - {species: 'Torkoal', ability: 'drought', moves: ['sleeptalk']}, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, ]]); const tail = battle.p1.active[0]; @@ -23,11 +23,11 @@ describe('Protosynthesis', function () { assert(!tail.volatiles['protosynthesis'], `Scream Tail's SpD should stop being boosted when Sun ends`); }); - it(`should take stat stages and no other modifiers into account when determining the best stat`, function () { + it(`should take stat stages and no other modifiers into account when determining the best stat`, () => { battle = common.createBattle([[ - {species: 'Roaring Moon', ability: 'protosynthesis', evs: {'atk': 252, 'spd': 252}, moves: ['tailwind']}, + { species: 'Roaring Moon', ability: 'protosynthesis', evs: { 'atk': 252, 'spd': 252 }, moves: ['tailwind'] }, ], [ - {species: 'Salamence', ability: 'intimidate', moves: ['sunnyday']}, + { species: 'Salamence', ability: 'intimidate', moves: ['sunnyday'] }, ]]); battle.makeChoices(); @@ -36,22 +36,22 @@ describe('Protosynthesis', function () { assert.equal(moon.volatiles['protosynthesis'].bestStat, 'spd'); }); - it(`should not activate while Desolate Land is active`, function () { + it(`should not activate while Desolate Land is active`, () => { battle = common.createBattle([[ - {species: 'Roaring Moon', ability: 'protosynthesis', moves: ['sleeptalk']}, + { species: 'Roaring Moon', ability: 'protosynthesis', moves: ['sleeptalk'] }, ], [ - {species: 'Groudon-Primal', ability: 'desolateland', moves: ['sleeptalk']}, + { species: 'Groudon-Primal', ability: 'desolateland', moves: ['sleeptalk'] }, ]]); const moon = battle.p1.active[0]; assert(!moon.volatiles['protosynthesis']); }); - it(`should be activated by Booster Energy when Sunny Day is not active`, function () { + it(`should be activated by Booster Energy when Sunny Day is not active`, () => { battle = common.createBattle([[ - {species: 'Scream Tail', ability: 'protosynthesis', item: 'boosterenergy', moves: ['raindance', 'sunnyday']}, + { species: 'Scream Tail', ability: 'protosynthesis', item: 'boosterenergy', moves: ['raindance', 'sunnyday'] }, ], [ - {species: 'Torkoal', ability: 'drought', moves: ['sleeptalk']}, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, ]]); const tail = battle.p1.active[0]; @@ -66,23 +66,23 @@ describe('Protosynthesis', function () { assert(!!tail.volatiles['protosynthesis'], `Scream Tail's Protosynthesis activated by Booster Energy should still be active when Sun ends`); }); - it(`should not be prevented from activating if the user holds Utility Umbrella`, function () { + it(`should not be prevented from activating if the user holds Utility Umbrella`, () => { battle = common.createBattle([[ - {species: 'Scream Tail', ability: 'protosynthesis', item: 'utilityumbrella', moves: ['trick']}, + { species: 'Scream Tail', ability: 'protosynthesis', item: 'utilityumbrella', moves: ['trick'] }, ], [ - {species: 'Torkoal', ability: 'drought', moves: ['sleeptalk']}, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, ]]); const tail = battle.p1.active[0]; assert.equal(tail.volatiles['protosynthesis'].bestStat, 'spd', `Scream Tail's SpD should have been boosted by Protosynthesis in Sun while holding Utility Umbrella`); }); - it(`should be deactiviated by weather suppressing abilities`, function () { + it(`should be deactiviated by weather suppressing abilities`, () => { battle = common.createBattle([[ - {species: 'Scream Tail', ability: 'protosynthesis', moves: ['splash']}, + { species: 'Scream Tail', ability: 'protosynthesis', moves: ['splash'] }, ], [ - {species: 'Torkoal', ability: 'drought', moves: ['splash']}, - {species: 'Psyduck', ability: 'cloudnine', moves: ['splash']}, + { species: 'Torkoal', ability: 'drought', moves: ['splash'] }, + { species: 'Psyduck', ability: 'cloudnine', moves: ['splash'] }, ]]); const tail = battle.p1.active[0]; @@ -91,11 +91,11 @@ describe('Protosynthesis', function () { assert(!tail.volatiles['protosynthesis'], `Scream Tail should not have remained boosted by Protosynthesis because a weather supressing ability started even though Sun was active`); }); - it(`should not activate if weather is suppressed`, function () { + it(`should not activate if weather is suppressed`, () => { battle = common.createBattle([[ - {species: 'Scream Tail', ability: 'protosynthesis', moves: ['splash']}, + { species: 'Scream Tail', ability: 'protosynthesis', moves: ['splash'] }, ], [ - {species: 'Psyduck', ability: 'cloudnine', moves: ['sunnyday']}, + { species: 'Psyduck', ability: 'cloudnine', moves: ['sunnyday'] }, ]]); const tail = battle.p1.active[0]; @@ -104,12 +104,12 @@ describe('Protosynthesis', function () { assert.equal(tail.volatiles['protosynthesis'], undefined, `Scream Tail should not have been boosted by Protosynthesis because a weather supressing ability was active when Sun started`); }); - it(`should activate when weather supression ends`, function () { + it(`should activate when weather supression ends`, () => { battle = common.createBattle([[ - {species: 'Scream Tail', ability: 'protosynthesis', moves: ['splash']}, + { species: 'Scream Tail', ability: 'protosynthesis', moves: ['splash'] }, ], [ - {species: 'Psyduck', ability: 'cloudnine', moves: ['sunnyday']}, - {species: 'Lotad', ability: 'swiftswim', moves: ['splash']}, + { species: 'Psyduck', ability: 'cloudnine', moves: ['sunnyday'] }, + { species: 'Lotad', ability: 'swiftswim', moves: ['splash'] }, ]]); const tail = battle.p1.active[0]; @@ -119,12 +119,12 @@ describe('Protosynthesis', function () { assert.equal(tail.volatiles['protosynthesis'].bestStat, 'spd', `Scream Tail should have been boosted by Protosynthesis because a weather supressing ability ended while Sun was active`); }); - it(`should have its boost nullified by Neutralizing Gas`, function () { + it(`should have its boost nullified by Neutralizing Gas`, () => { battle = common.createBattle([[ - {species: 'Scream Tail', ability: 'protosynthesis', item: 'boosterenergy', moves: ['luckychant', 'recover']}, + { species: 'Scream Tail', ability: 'protosynthesis', item: 'boosterenergy', moves: ['luckychant', 'recover'] }, ], [ - {species: 'Weezing', moves: ['venoshock']}, - {species: 'Weezing', ability: 'neutralizinggas', moves: ['venoshock']}, + { species: 'Weezing', moves: ['venoshock'] }, + { species: 'Weezing', ability: 'neutralizinggas', moves: ['venoshock'] }, ]]); const tail = battle.p1.active[0]; @@ -139,12 +139,12 @@ describe('Protosynthesis', function () { assert.bounded(tail.maxhp - tail.hp, [84, 102]); }); - it(`should not activate while the user is Transformed`, function () { + it(`should not activate while the user is Transformed`, () => { battle = common.createBattle([[ - {species: 'Torkoal', ability: 'drought', moves: ['sleeptalk']}, - {species: 'Ditto', ability: 'imposter', moves: ['transform']}, + { species: 'Torkoal', ability: 'drought', moves: ['sleeptalk'] }, + { species: 'Ditto', ability: 'imposter', moves: ['transform'] }, ], [ - {species: 'Roaring Moon', ability: 'protosynthesis', moves: ['sleeptalk']}, + { species: 'Roaring Moon', ability: 'protosynthesis', moves: ['sleeptalk'] }, ]]); battle.makeChoices('switch 2', 'auto'); diff --git a/test/sim/abilities/rattled.js b/test/sim/abilities/rattled.js index 011db386af..6e9eb9aa4f 100644 --- a/test/sim/abilities/rattled.js +++ b/test/sim/abilities/rattled.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe('Rattled', function () { - afterEach(function () { +describe('Rattled', () => { + afterEach(() => { battle.destroy(); }); - it(`should boost the user's Speed when Intimidated`, function () { + it(`should boost the user's Speed when Intimidated`, () => { battle = common.createBattle([[ - {species: 'Dunsparce', ability: 'rattled', moves: ['sleeptalk']}, + { species: 'Dunsparce', ability: 'rattled', moves: ['sleeptalk'] }, ], [ - {species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'atk', -1); assert.statStage(battle.p1.active[0], 'spe', 1); }); - it(`should not boost the user's Speed if Intimidate failed to lower attack`, function () { + it(`should not boost the user's Speed if Intimidate failed to lower attack`, () => { battle = common.createBattle([[ - {species: 'Dunsparce', item: 'clearamulet', ability: 'rattled', moves: ['sleeptalk']}, + { species: 'Dunsparce', item: 'clearamulet', ability: 'rattled', moves: ['sleeptalk'] }, ], [ - {species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'atk', 0); diff --git a/test/sim/abilities/receiver.js b/test/sim/abilities/receiver.js index 13caf94461..33cac2e7e3 100644 --- a/test/sim/abilities/receiver.js +++ b/test/sim/abilities/receiver.js @@ -5,31 +5,31 @@ const common = require('./../../common'); let battle; -describe(`Receiver`, function () { - afterEach(function () { +describe(`Receiver`, () => { + afterEach(() => { battle.destroy(); }); - it.skip(`should gain a boost immediately if taking over a KO boost Ability`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'whimsicott', ability: 'soulheart', moves: ['memento']}, - {species: 'passimian', ability: 'receiver', moves: ['sleeptalk']}, + it.skip(`should gain a boost immediately if taking over a KO boost Ability`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'whimsicott', ability: 'soulheart', moves: ['memento'] }, + { species: 'passimian', ability: 'receiver', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const passimian = battle.p1.active[1]; assert.statStage(passimian, 'spa', 1); }); - it.skip(`should do weird stuff with multiple Soul-Heart and multiple Receiver`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Passimian', ability: 'receiver', moves: ['earthquake']}, - {species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk']}, + it.skip(`should do weird stuff with multiple Soul-Heart and multiple Receiver`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Passimian', ability: 'receiver', moves: ['earthquake'] }, + { species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk'] }, ], [ - {species: 'Lugia', ability: 'receiver', moves: ['sleeptalk']}, - {species: 'Wynaut', ability: 'soulheart', level: 1, moves: ['sleeptalk']}, + { species: 'Lugia', ability: 'receiver', moves: ['sleeptalk'] }, + { species: 'Wynaut', ability: 'soulheart', level: 1, moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/ripen.js b/test/sim/abilities/ripen.js index f4de5bca20..2f724069d9 100644 --- a/test/sim/abilities/ripen.js +++ b/test/sim/abilities/ripen.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe("Ripen", function () { - afterEach(function () { +describe("Ripen", () => { + afterEach(() => { battle.destroy(); }); - it('should double healing from Berries', function () { + it('should double healing from Berries', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'ripen', item: 'sitrusberry', ivs: {hp: 30}, moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'ripen', item: 'sitrusberry', ivs: { hp: 30 }, moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'compoundeyes', moves: ['superfang']}, + { species: 'wynaut', ability: 'compoundeyes', moves: ['superfang'] }, ]]); battle.makeChoices(); const ripenWynaut = battle.p1.active[0]; assert.equal(ripenWynaut.hp, Math.floor(ripenWynaut.maxhp / 2) + (Math.floor(ripenWynaut.maxhp / 4) * 2)); }); - it('should double stat boosts from Berries', function () { + it('should double stat boosts from Berries', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'ripen', item: 'liechiberry', evs: {hp: 4}, moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'ripen', item: 'liechiberry', evs: { hp: 4 }, moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'compoundeyes', moves: ['superfang']}, + { species: 'wynaut', ability: 'compoundeyes', moves: ['superfang'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -33,22 +33,22 @@ describe("Ripen", function () { assert.statStage(ripenWynaut, 'atk', 2); }); - it(`should double damage done from Jaboca / Rowap Berries`, function () { + it(`should double damage done from Jaboca / Rowap Berries`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'ripen', item: 'jabocaberry', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'ripen', item: 'jabocaberry', moves: ['sleeptalk'] }, ], [ - {species: 'falinks', moves: ['tackle']}, + { species: 'falinks', moves: ['tackle'] }, ]]); battle.makeChoices(); const falinks = battle.p2.active[0]; assert.equal(falinks.hp, falinks.maxhp - Math.floor(falinks.maxhp / 4), `Falinks should have lost 1/4 of its HP`); }); - it('should allow resist Berries to quarter the damage done', function () { + it('should allow resist Berries to quarter the damage done', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'ripen', item: 'colburberry', evs: {spe: 4}, moves: ['luckychant']}, + { species: 'wynaut', ability: 'ripen', item: 'colburberry', evs: { spe: 4 }, moves: ['luckychant'] }, ], [ - {species: 'wynaut', moves: ['darkpulse']}, + { species: 'wynaut', moves: ['darkpulse'] }, ]]); battle.makeChoices(); const ripenWynaut = battle.p1.active[0]; @@ -56,11 +56,11 @@ describe("Ripen", function () { assert.bounded(damage, [18, 21]); // If it was only halved, range would be 36-43 }); - it('should allow resist Berries to quarter the damage done even on a critical hit', function () { + it('should allow resist Berries to quarter the damage done even on a critical hit', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'ripen', item: 'colburberry', evs: {spe: 4}, moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'ripen', item: 'colburberry', evs: { spe: 4 }, moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['laserfocus', 'darkpulse']}, + { species: 'wynaut', moves: ['laserfocus', 'darkpulse'] }, ]]); battle.makeChoices(); battle.makeChoices('auto', 'move dark pulse'); @@ -69,22 +69,22 @@ describe("Ripen", function () { assert.bounded(damage, [27, 32]); // If it was only halved, range would be 54-64 }); - it('should double the effects of Berries eaten by Fling', function () { + it('should double the effects of Berries eaten by Fling', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'ripen', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'ripen', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', item: "liechiberry", moves: ['fling']}, + { species: 'wynaut', item: "liechiberry", moves: ['fling'] }, ]]); battle.makeChoices(); const ripenWynaut = battle.p1.active[0]; assert.statStage(ripenWynaut, 'atk', 2); }); - it('should double the effects of Berries eaten by Bug Bite', function () { + it('should double the effects of Berries eaten by Bug Bite', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'ripen', moves: ['bugbite']}, + { species: 'wynaut', ability: 'ripen', moves: ['bugbite'] }, ], [ - {species: 'wynaut', item: "liechiberry", moves: ['sleeptalk']}, + { species: 'wynaut', item: "liechiberry", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const ripenWynaut = battle.p1.active[0]; diff --git a/test/sim/abilities/rockhead.js b/test/sim/abilities/rockhead.js index 710b5ecc59..ea4f03079d 100644 --- a/test/sim/abilities/rockhead.js +++ b/test/sim/abilities/rockhead.js @@ -5,45 +5,45 @@ const common = require('./../../common'); let battle; -describe('Rock Head', function () { - afterEach(function () { +describe('Rock Head', () => { + afterEach(() => { battle.destroy(); }); - it('should block recoil from most moves', function () { + it('should block recoil from most moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Aerodactyl', ability: 'rockhead', moves: ['doubleedge']}]}); - battle.setPlayer('p2', {team: [{species: 'Registeel', ability: 'clearbody', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: 'Aerodactyl', ability: 'rockhead', moves: ['doubleedge'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Registeel', ability: 'clearbody', moves: ['rest'] }] }); assert.false.hurts(battle.p1.active[0], () => battle.makeChoices('move doubleedge', 'move rest')); }); - it('should not block recoil if the ability is disabled/removed mid-attack', function () { + it('should not block recoil if the ability is disabled/removed mid-attack', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Aerodactyl', ability: 'rockhead', moves: ['doubleedge']}]}); - battle.setPlayer('p2', {team: [{species: 'Registeel', ability: 'mummy', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: 'Aerodactyl', ability: 'rockhead', moves: ['doubleedge'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Registeel', ability: 'mummy', moves: ['rest'] }] }); assert.hurts(battle.p1.active[0], () => battle.makeChoices('move doubleedge', 'move rest')); }); - it('should not block recoil from Struggle', function () { + it('should not block recoil from Struggle', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Aerodactyl', ability: 'rockhead', moves: ['roost']}]}); - battle.setPlayer('p2', {team: [{species: 'Sableye', ability: 'prankster', moves: ['taunt']}]}); + battle.setPlayer('p1', { team: [{ species: 'Aerodactyl', ability: 'rockhead', moves: ['roost'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['taunt'] }] }); battle.makeChoices('move roost', 'move taunt'); assert.hurts(battle.p1.active[0], () => battle.makeChoices('move 1', 'move taunt')); }); - it('should not block crash damage', function () { + it('should not block crash damage', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Rampardos', ability: 'rockhead', moves: ['jumpkick']}]}); - battle.setPlayer('p2', {team: [{species: 'Sableye', ability: 'prankster', moves: ['taunt']}]}); + battle.setPlayer('p1', { team: [{ species: 'Rampardos', ability: 'rockhead', moves: ['jumpkick'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['taunt'] }] }); assert.hurts(battle.p1.active[0], () => battle.makeChoices('move jumpkick', 'move taunt')); }); - it(`should not block indirect damage`, function () { + it(`should not block indirect damage`, () => { battle = common.createBattle([[ - {species: 'Rampardos', ability: 'rockhead', moves: ['splash']}, + { species: 'Rampardos', ability: 'rockhead', moves: ['splash'] }, ], [ - {species: 'Crobat', moves: ['toxic']}, + { species: 'Crobat', moves: ['toxic'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/roughskin.js b/test/sim/abilities/roughskin.js index 27d2072f7b..2bc02ea17b 100644 --- a/test/sim/abilities/roughskin.js +++ b/test/sim/abilities/roughskin.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Rough Skin', function () { - afterEach(function () { +describe('Rough Skin', () => { + afterEach(() => { battle.destroy(); }); // Yes, we really need a test for this - it("should not activate twice on moves with secondary effects", function () { + it("should not activate twice on moves with secondary effects", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Pachirisu', ability: 'voltabsorb', moves: ['nuzzle']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Pachirisu', ability: 'voltabsorb', moves: ['nuzzle'] }] }); battle.makeChoices('auto', 'move nuzzle'); const pachi = battle.p2.active[0]; assert.equal(pachi.hp, Math.ceil(pachi.maxhp - pachi.maxhp / 8)); diff --git a/test/sim/abilities/sapsipper.js b/test/sim/abilities/sapsipper.js index d9b78be697..5ab0076090 100644 --- a/test/sim/abilities/sapsipper.js +++ b/test/sim/abilities/sapsipper.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Sap Sipper', function () { - afterEach(function () { +describe('Sap Sipper', () => { + afterEach(() => { battle.destroy(); }); - it(`should absorb an attack boost from Aromatherapy`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Comfey", moves: ['aromatherapy']}, - {species: "Bouffalant", ability: 'sapsipper', moves: ['sleeptalk']}, + it(`should absorb an attack boost from Aromatherapy`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Comfey", moves: ['aromatherapy'] }, + { species: "Bouffalant", ability: 'sapsipper', moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, - {species: "Wynaut", moves: ['sleeptalk']}, + { species: "Wynaut", moves: ['sleeptalk'] }, + { species: "Wynaut", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/screencleaner.js b/test/sim/abilities/screencleaner.js index fc10e59848..96863585ab 100644 --- a/test/sim/abilities/screencleaner.js +++ b/test/sim/abilities/screencleaner.js @@ -5,20 +5,20 @@ const common = require('./../../common'); let battle; -describe("Screen Cleaner", function () { - afterEach(function () { +describe("Screen Cleaner", () => { + afterEach(() => { battle.destroy(); }); - it("should remove screens from both sides when sent out", function () { + it("should remove screens from both sides when sent out", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Mew', ability: 'synchronize', moves: ['reflect']}, - {species: 'Mr. Mime-Galar', ability: 'screencleaner', moves: ['psychic']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Mew', ability: 'synchronize', moves: ['lightscreen', 'reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Mew', ability: 'synchronize', moves: ['reflect'] }, + { species: 'Mr. Mime-Galar', ability: 'screencleaner', moves: ['psychic'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Mew', ability: 'synchronize', moves: ['lightscreen', 'reflecttype'] }, + ] }); battle.makeChoices('move reflect', 'move lightscreen'); battle.makeChoices('switch 2', 'move reflecttype'); assert(!battle.p1.sideConditions.reflect); diff --git a/test/sim/abilities/serenegrace.js b/test/sim/abilities/serenegrace.js index a1ff93b444..b17a901da9 100644 --- a/test/sim/abilities/serenegrace.js +++ b/test/sim/abilities/serenegrace.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe(`Serene Grace`, function () { - afterEach(function () { +describe(`Serene Grace`, () => { + afterEach(() => { battle.destroy(); }); - it(`should not stack with Pledge Rainbow for flinches`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'serenegrace', moves: ['bite', 'waterpledge']}, - {species: 'wobbuffet', moves: ['sleeptalk', 'firepledge']}, + it(`should not stack with Pledge Rainbow for flinches`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'serenegrace', moves: ['bite', 'waterpledge'] }, + { species: 'wobbuffet', moves: ['sleeptalk', 'firepledge'] }, ], [ - {species: 'pyukumuku', moves: ['sleeptalk']}, - {species: 'feebas', moves: ['sleeptalk']}, + { species: 'pyukumuku', moves: ['sleeptalk'] }, + { species: 'feebas', moves: ['sleeptalk'] }, ]]); - battle.onEvent('ModifyMove', battle.format, -99, function (move) { + battle.onEvent('ModifyMove', battle.format, -99, move => { if (move.id === 'bite') { for (const secondary of move.secondaries) { assert.equal(secondary.chance, 60, `Bite should not have a quadrupled flinch chance`); @@ -31,18 +31,18 @@ describe(`Serene Grace`, function () { battle.makeChoices('move bite 1, move sleeptalk', 'auto'); }); - it(`[Gen 8] should overflow when quadrupling a stat drop effect with Pledge Rainbow`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'serenegrace', moves: ['poweruppunch', 'waterpledge']}, - {species: 'wobbuffet', ability: 'serenegrace', moves: ['acidspray', 'firepledge']}, + it(`[Gen 8] should overflow when quadrupling a stat drop effect with Pledge Rainbow`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'serenegrace', moves: ['poweruppunch', 'waterpledge'] }, + { species: 'wobbuffet', ability: 'serenegrace', moves: ['acidspray', 'firepledge'] }, ], [ - {species: 'magikarp', moves: ['sleeptalk']}, - {species: 'feebas', moves: ['sleeptalk']}, + { species: 'magikarp', moves: ['sleeptalk'] }, + { species: 'feebas', moves: ['sleeptalk'] }, ]]); // Modding secondary chances so it will either always apply or never apply // (64 * 2 * 2) % 256 === 0 - battle.onEvent('ModifyMove', battle.format, 1, function (move) { + battle.onEvent('ModifyMove', battle.format, 1, move => { if (move.secondaries) { for (const secondary of move.secondaries) { secondary.chance = 64; @@ -59,18 +59,18 @@ describe(`Serene Grace`, function () { assert.statStage(feebas, 'spd', 0); }); - it(`should not overflow when quadrupling a status effect with Pledge Rainbow`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'serenegrace', moves: ['nuzzle', 'waterpledge']}, - {species: 'wobbuffet', ability: 'serenegrace', moves: ['flamethrower', 'firepledge']}, + it(`should not overflow when quadrupling a status effect with Pledge Rainbow`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'serenegrace', moves: ['nuzzle', 'waterpledge'] }, + { species: 'wobbuffet', ability: 'serenegrace', moves: ['flamethrower', 'firepledge'] }, ], [ - {species: 'magikarp', moves: ['sleeptalk']}, - {species: 'feebas', moves: ['sleeptalk']}, + { species: 'magikarp', moves: ['sleeptalk'] }, + { species: 'feebas', moves: ['sleeptalk'] }, ]]); // Modding secondary chances so it will either always apply or never apply // (64 * 2 * 2) % 256 === 0 - battle.onEvent('ModifyMove', battle.format, 1, function (move) { + battle.onEvent('ModifyMove', battle.format, 1, move => { if (move.secondaries) { for (const secondary of move.secondaries) { secondary.chance = 64; diff --git a/test/sim/abilities/shadowtag.js b/test/sim/abilities/shadowtag.js index 66103615e4..12f9e3a556 100644 --- a/test/sim/abilities/shadowtag.js +++ b/test/sim/abilities/shadowtag.js @@ -5,49 +5,49 @@ const common = require('./../../common'); let battle; -describe('Shadow Tag', function () { - afterEach(function () { +describe('Shadow Tag', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent most Pokemon from switching out normally', function () { + it('should prevent most Pokemon from switching out normally', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Wobbuffet", ability: 'shadowtag', moves: ['counter']}]}); - battle.setPlayer('p2', {team: [ - {species: "Tornadus", ability: 'defiant', moves: ['tailwind']}, - {species: "Heatran", ability: 'flashfire', moves: ['roar']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Wobbuffet", ability: 'shadowtag', moves: ['counter'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Tornadus", ability: 'defiant', moves: ['tailwind'] }, + { species: "Heatran", ability: 'flashfire', moves: ['roar'] }, + ] }); assert.trapped(() => battle.makeChoices('move counter', 'switch 2'), true); }); - it('should not prevent Pokemon from switching out using moves', function () { + it('should not prevent Pokemon from switching out using moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Wobbuffet", ability: 'shadowtag', moves: ['counter']}]}); - battle.setPlayer('p2', {team: [ - {species: "Tornadus", ability: 'defiant', moves: ['uturn']}, - {species: "Heatran", ability: 'flashfire', moves: ['roar']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Wobbuffet", ability: 'shadowtag', moves: ['counter'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Tornadus", ability: 'defiant', moves: ['uturn'] }, + { species: "Heatran", ability: 'flashfire', moves: ['roar'] }, + ] }); battle.makeChoices('move counter', 'move uturn'); assert.doesNotThrow(() => battle.makeChoices('', 'switch 2')); }); - it('should not prevent other Pokemon with Shadow Tag from switching out', function () { + it('should not prevent other Pokemon with Shadow Tag from switching out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Wobbuffet", ability: 'shadowtag', moves: ['counter']}]}); - battle.setPlayer('p2', {team: [ - {species: "Gothitelle", ability: 'shadowtag', moves: ['psychic']}, - {species: "Heatran", ability: 'flashfire', moves: ['roar']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Wobbuffet", ability: 'shadowtag', moves: ['counter'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Gothitelle", ability: 'shadowtag', moves: ['psychic'] }, + { species: "Heatran", ability: 'flashfire', moves: ['roar'] }, + ] }); assert.doesNotThrow(() => battle.makeChoices('move counter', 'switch 2')); }); - it('should not prevent Pokemon immune to trapping from switching out', function () { + it('should not prevent Pokemon immune to trapping from switching out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Wobbuffet", ability: 'shadowtag', moves: ['counter']}]}); - battle.setPlayer('p2', {team: [ - {species: "Gengar", ability: 'levitate', moves: ['curse']}, - {species: "Heatran", ability: 'flashfire', moves: ['roar']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Wobbuffet", ability: 'shadowtag', moves: ['counter'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Gengar", ability: 'levitate', moves: ['curse'] }, + { species: "Heatran", ability: 'flashfire', moves: ['roar'] }, + ] }); assert.doesNotThrow(() => battle.makeChoices('move counter', 'switch 2')); }); }); diff --git a/test/sim/abilities/sheerforce.js b/test/sim/abilities/sheerforce.js index cfa0f71eab..2ad5210876 100644 --- a/test/sim/abilities/sheerforce.js +++ b/test/sim/abilities/sheerforce.js @@ -5,50 +5,50 @@ const common = require('./../../common'); let battle; -describe('Sheer Force', function () { - afterEach(function () { +describe('Sheer Force', () => { + afterEach(() => { battle.destroy(); }); - it('should not eliminate Life Orb recoil in a move with no secondary effects', function () { + it('should not eliminate Life Orb recoil in a move with no secondary effects', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Tauros', ability: 'sheerforce', item: 'lifeorb', moves: ['earthquake']}]}); - battle.setPlayer('p2', {team: [{species: 'Lapras', ability: 'shellarmor', item: 'laggingtail', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: 'Tauros', ability: 'sheerforce', item: 'lifeorb', moves: ['earthquake'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Lapras', ability: 'shellarmor', item: 'laggingtail', moves: ['rest'] }] }); battle.makeChoices('move earthquake', 'move rest'); assert.equal(battle.p1.active[0].hp, 262); }); - it('should eliminate secondary effects from moves', function () { + it('should eliminate secondary effects from moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Tauros', ability: 'sheerforce', moves: ['zapcannon']}]}); - battle.setPlayer('p2', {team: [{species: 'Machamp', ability: 'noguard', moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [{ species: 'Tauros', ability: 'sheerforce', moves: ['zapcannon'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Machamp', ability: 'noguard', moves: ['bulkup'] }] }); battle.makeChoices('move zapcannon', 'move bulkup'); assert.equal(battle.p2.active[0].status, ''); }); - it('should not eliminate Life Orb recoil if the ability is disabled/removed mid-attack', function () { + it('should not eliminate Life Orb recoil if the ability is disabled/removed mid-attack', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Tauros', ability: 'sheerforce', item: 'lifeorb', moves: ['lockon', 'dynamicpunch']}]}); - battle.setPlayer('p2', {team: [{species: 'Scyther', ability: 'mummy', moves: ['irondefense']}]}); + battle.setPlayer('p1', { team: [{ species: 'Tauros', ability: 'sheerforce', item: 'lifeorb', moves: ['lockon', 'dynamicpunch'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Scyther', ability: 'mummy', moves: ['irondefense'] }] }); battle.makeChoices('move lockon', 'move irondefense'); battle.makeChoices('move dynamicpunch', 'move irondefense'); assert.false(battle.p2.active[0].volatiles['confusion']); assert.equal(battle.p1.active[0].hp, 262); }); - it('should eliminate Life Orb recoil in a move with secondary effects', function () { + it('should eliminate Life Orb recoil in a move with secondary effects', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Tauros', ability: 'sheerforce', item: 'lifeorb', moves: ['bodyslam']}]}); - battle.setPlayer('p2', {team: [{species: 'Lapras', ability: 'shellarmor', item: 'laggingtail', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: 'Tauros', ability: 'sheerforce', item: 'lifeorb', moves: ['bodyslam'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Lapras', ability: 'shellarmor', item: 'laggingtail', moves: ['rest'] }] }); battle.makeChoices('move bodyslam', 'move rest'); assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it(`should not be possible to thaw a frozen target with a Sheer Force-boosted thawsTarget move`, function () { + it(`should not be possible to thaw a frozen target with a Sheer Force-boosted thawsTarget move`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sheerforce', moves: ['sleeptalk', 'scald']}, + { species: 'wynaut', ability: 'sheerforce', moves: ['sleeptalk', 'scald'] }, ], [ - {species: 'shuckle', moves: ['meteorassault']}, + { species: 'shuckle', moves: ['meteorassault'] }, ]]); battle.makeChoices(); // Use Meteor Assault to force recharge next turn and skip potential thaw const frozenMon = battle.p2.active[0]; @@ -57,11 +57,11 @@ describe('Sheer Force', function () { assert.equal(frozenMon.status, 'frz'); }); - it(`should be possible to thaw a frozen target with a Sheer Force-boosted Fire-type move`, function () { + it(`should be possible to thaw a frozen target with a Sheer Force-boosted Fire-type move`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sheerforce', moves: ['sleeptalk', 'flamethrower']}, + { species: 'wynaut', ability: 'sheerforce', moves: ['sleeptalk', 'flamethrower'] }, ], [ - {species: 'shuckle', moves: ['meteorassault']}, + { species: 'shuckle', moves: ['meteorassault'] }, ]]); battle.makeChoices(); // Use Meteor Assault to force recharge next turn and skip potential thaw const frozenMon = battle.p2.active[0]; diff --git a/test/sim/abilities/shellarmor.js b/test/sim/abilities/shellarmor.js index 39faa462e5..27e39786ed 100644 --- a/test/sim/abilities/shellarmor.js +++ b/test/sim/abilities/shellarmor.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Shell Armor', function () { - afterEach(function () { +describe('Shell Armor', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent moves from dealing critical hits', function () { + it('should prevent moves from dealing critical hits', () => { battle = common.createBattle([ - [{species: 'Slowbro', ability: 'shellarmor', moves: ['quickattack']}], - [{species: 'Cryogonal', ability: 'noguard', moves: ['frostbreath']}], + [{ species: 'Slowbro', ability: 'shellarmor', moves: ['quickattack'] }], + [{ species: 'Cryogonal', ability: 'noguard', moves: ['frostbreath'] }], ]); let successfulEvent = false; - battle.onEvent('ModifyDamage', battle.format, function (damage, attacker, defender, move) { + battle.onEvent('ModifyDamage', battle.format, (damage, attacker, defender, move) => { if (move.id === 'frostbreath') { successfulEvent = true; assert.false(defender.getMoveHitData(move).crit); @@ -26,13 +26,13 @@ describe('Shell Armor', function () { assert(successfulEvent); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle([ - [{species: 'Slowbro', ability: 'shellarmor', moves: ['quickattack']}], - [{species: 'Cryogonal', ability: 'moldbreaker', item: 'zoomlens', moves: ['frostbreath']}], + [{ species: 'Slowbro', ability: 'shellarmor', moves: ['quickattack'] }], + [{ species: 'Cryogonal', ability: 'moldbreaker', item: 'zoomlens', moves: ['frostbreath'] }], ]); let successfulEvent = false; - battle.onEvent('ModifyDamage', battle.format, function (damage, attacker, defender, move) { + battle.onEvent('ModifyDamage', battle.format, (damage, attacker, defender, move) => { if (move.id === 'frostbreath') { successfulEvent = true; assert(defender.getMoveHitData(move).crit); diff --git a/test/sim/abilities/shielddust.js b/test/sim/abilities/shielddust.js index 809802c82f..8e4d6dfdff 100644 --- a/test/sim/abilities/shielddust.js +++ b/test/sim/abilities/shielddust.js @@ -5,35 +5,35 @@ const common = require('./../../common'); let battle; -describe('Shield Dust', function () { - afterEach(function () { +describe('Shield Dust', () => { + afterEach(() => { battle.destroy(); }); - it('should block secondary effects against the user', function () { - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: 'Latios', ability: 'noguard', moves: ['snarl']}, {species: 'Latias', ability: 'levitate', moves: ['roost']}], - [{species: 'Xerneas', ability: 'shielddust', moves: ['roost']}, {species: 'Yveltal', ability: 'pressure', moves: ['roost']}], + it('should block secondary effects against the user', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: 'Latios', ability: 'noguard', moves: ['snarl'] }, { species: 'Latias', ability: 'levitate', moves: ['roost'] }], + [{ species: 'Xerneas', ability: 'shielddust', moves: ['roost'] }, { species: 'Yveltal', ability: 'pressure', moves: ['roost'] }], ]); battle.makeChoices('move snarl, move roost', 'move roost, move roost'); assert.statStage(battle.p2.active[0], 'spa', 0); assert.statStage(battle.p2.active[1], 'spa', -1); }); - it('should not block secondary effects that affect the user of the move', function () { + it('should not block secondary effects that affect the user of the move', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Ledian', ability: 'ironfist', moves: ['poweruppunch']}]}); - battle.setPlayer('p2', {team: [{species: 'Dustox', ability: 'shielddust', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ledian', ability: 'ironfist', moves: ['poweruppunch'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Dustox', ability: 'shielddust', moves: ['roost'] }] }); battle.makeChoices('move poweruppunch', 'move roost'); assert.statStage(battle.p1.active[0], 'atk', 1); }); - it('should block added effects from items', function () { - battle = common.createBattle({preview: true}, [ - [{species: 'Talonflame', ability: 'flamebody', item: 'kingsrock', moves: ['flamecharge']}], - [{species: 'Clefable', ability: 'shielddust', moves: ['cottonguard']}], + it('should block added effects from items', () => { + battle = common.createBattle({ preview: true }, [ + [{ species: 'Talonflame', ability: 'flamebody', item: 'kingsrock', moves: ['flamecharge'] }], + [{ species: 'Clefable', ability: 'shielddust', moves: ['cottonguard'] }], ]); - battle.onEvent('ModifyMove', battle.format, function (move) { + battle.onEvent('ModifyMove', battle.format, move => { if (move.secondaries) { for (const secondary of move.secondaries) { secondary.chance = 100; @@ -46,49 +46,49 @@ describe('Shield Dust', function () { assert.statStage(battle.p2.active[0], 'def', 3); // Clefable did not flinch }); - it('should block added effects from Fling', function () { + it('should block added effects from Fling', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Ledian', ability: 'ironfist', item: 'petayaberry', moves: ['fling']}]}); - battle.setPlayer('p2', {team: [{species: 'Dustox', ability: 'shielddust', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ledian', ability: 'ironfist', item: 'petayaberry', moves: ['fling'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Dustox', ability: 'shielddust', moves: ['roost'] }] }); battle.makeChoices('move fling', 'move roost'); assert.statStage(battle.p2.active[0], 'spa', 1); }); - it('should not block secondary effects on attacks used by the Pokemon with the ability', function () { + it('should not block secondary effects on attacks used by the Pokemon with the ability', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Ledian', ability: 'shielddust', moves: ['poweruppunch', 'strugglebug']}]}); - battle.setPlayer('p2', {team: [{species: 'Clefable', ability: 'unaware', moves: ['softboiled']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ledian', ability: 'shielddust', moves: ['poweruppunch', 'strugglebug'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Clefable', ability: 'unaware', moves: ['softboiled'] }] }); battle.makeChoices('move poweruppunch', 'move softboiled'); assert.statStage(battle.p1.active[0], 'atk', 1); battle.makeChoices('move strugglebug', 'move softboiled'); assert.statStage(battle.p2.active[0], 'spa', -1); }); - it('should be negated by Mold Breaker', function () { + it('should be negated by Mold Breaker', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Pinsir', ability: 'moldbreaker', moves: ['strugglebug']}]}); - battle.setPlayer('p2', {team: [{species: 'Dustox', ability: 'shielddust', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [{ species: 'Pinsir', ability: 'moldbreaker', moves: ['strugglebug'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Dustox', ability: 'shielddust', moves: ['roost'] }] }); battle.makeChoices('move strugglebug', 'move roost'); assert.statStage(battle.p2.active[0], 'spa', -1); }); - it.skip(`should only prevent Sparkling Aria from curing burn if there is only one target`, function () { + it.skip(`should only prevent Sparkling Aria from curing burn if there is only one target`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'noguard', moves: ['willowisp', 'sparklingaria']}, + { species: 'wynaut', ability: 'noguard', moves: ['willowisp', 'sparklingaria'] }, ], [ - {species: 'dustox', ability: 'shielddust', moves: ['sleeptalk']}, + { species: 'dustox', ability: 'shielddust', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move willowisp', 'auto'); battle.makeChoices('move sparklingaria', 'auto'); assert.equal(battle.p2.active[0].status, 'brn', `Shield Dust should prevent cured burn if it's the only target`); - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'noguard', moves: ['willowisp', 'sparklingaria']}, - {species: 'diglett', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'noguard', moves: ['willowisp', 'sparklingaria'] }, + { species: 'diglett', moves: ['sleeptalk'] }, ], [ - {species: 'dustox', ability: 'shielddust', moves: ['sleeptalk']}, - {species: 'magikarp', moves: ['sleeptalk']}, + { species: 'dustox', ability: 'shielddust', moves: ['sleeptalk'] }, + { species: 'magikarp', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move willowisp 1, move sleeptalk', 'auto'); battle.makeChoices('move sparklingaria, move sleeptalk', 'auto'); diff --git a/test/sim/abilities/shieldsdown.js b/test/sim/abilities/shieldsdown.js index 1a822a1f62..9cdbaa9955 100644 --- a/test/sim/abilities/shieldsdown.js +++ b/test/sim/abilities/shieldsdown.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Shields Down', function () { - afterEach(function () { +describe('Shields Down', () => { + afterEach(() => { battle.destroy(); }); - it(`should be immune to status until below 50%`, function () { + it(`should be immune to status until below 50%`, () => { battle = common.createBattle([[ - {species: 'Minior', ability: 'shieldsdown', moves: ['splash']}, + { species: 'Minior', ability: 'shieldsdown', moves: ['splash'] }, ], [ - {species: 'Mew', ability: 'noguard', moves: ['glare', 'superfang']}, + { species: 'Mew', ability: 'noguard', moves: ['glare', 'superfang'] }, ]]); const minior = battle.p1.active[0]; battle.makeChoices(); @@ -27,11 +27,11 @@ describe('Shields Down', function () { assert.equal(minior.status, 'par'); }); - it(`should be immune to status until below 50% in all formes`, function () { + it(`should be immune to status until below 50% in all formes`, () => { battle = common.createBattle([[ - {species: 'Minior-Blue', ability: 'shieldsdown', moves: ['splash']}, + { species: 'Minior-Blue', ability: 'shieldsdown', moves: ['splash'] }, ], [ - {species: 'Mew', ability: 'noguard', moves: ['glare', 'superfang']}, + { species: 'Mew', ability: 'noguard', moves: ['glare', 'superfang'] }, ]]); const minior = battle.p1.active[0]; battle.makeChoices(); diff --git a/test/sim/abilities/simple.js b/test/sim/abilities/simple.js index 9c861a2f75..09bc0d24f4 100644 --- a/test/sim/abilities/simple.js +++ b/test/sim/abilities/simple.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Simple', function () { - afterEach(function () { +describe('Simple', () => { + afterEach(() => { battle.destroy(); }); - it('should double all stat boosts', function () { + it('should double all stat boosts', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Bibarel", ability: 'simple', moves: ['curse']}]}); - battle.setPlayer('p2', {team: [{species: "Gyarados", ability: 'moxie', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Bibarel", ability: 'simple', moves: ['curse'] }] }); + battle.setPlayer('p2', { team: [{ species: "Gyarados", ability: 'moxie', moves: ['splash'] }] }); battle.makeChoices('move curse', 'move splash'); const target = battle.p1.active[0]; assert.statStage(target, 'atk', 2); @@ -22,25 +22,25 @@ describe('Simple', function () { }); }); -describe('Simple [Gen 4]', function () { - afterEach(function () { +describe('Simple [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should double the effect of stat boosts', function () { + it('should double the effect of stat boosts', () => { battle = common.gen(4).createBattle([ - [{species: "Bibarel", ability: 'simple', moves: ['defensecurl']}], - [{species: "Gyarados", ability: 'moxie', moves: ['splash']}], + [{ species: "Bibarel", ability: 'simple', moves: ['defensecurl'] }], + [{ species: "Gyarados", ability: 'moxie', moves: ['splash'] }], ]); const target = battle.p1.active[0]; assert.sets(() => target.getStat('def'), 2 * target.getStat('def'), () => battle.makeChoices('move defensecurl', 'move splash')); assert.statStage(target, 'def', 1); }); - it('should double the effect of stat boosts passed by Baton Pass', function () { + it('should double the effect of stat boosts passed by Baton Pass', () => { battle = common.gen(4).createBattle([ - [{species: "Sableye", ability: 'prankster', moves: ['batonpass']}, {species: "Bibarel", ability: 'simple', moves: ['protect']}], - [{species: "Gyarados", ability: 'intimidate', moves: ['splash']}], + [{ species: "Sableye", ability: 'prankster', moves: ['batonpass'] }, { species: "Bibarel", ability: 'simple', moves: ['protect'] }], + [{ species: "Gyarados", ability: 'intimidate', moves: ['splash'] }], ]); battle.makeChoices('move batonpass', 'move splash'); battle.makeChoices('switch 2', ''); @@ -48,10 +48,10 @@ describe('Simple [Gen 4]', function () { assert.equal(battle.p1.active[0].getStat('atk'), Math.floor(0.5 * battle.p1.active[0].getStat('atk', true))); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.gen(4).createBattle([ - [{species: "Bibarel", ability: 'simple', moves: ['defensecurl']}], - [{species: "Haxorus", ability: 'moldbreaker', item: 'laggingtail', moves: ['earthquake']}], + [{ species: "Bibarel", ability: 'simple', moves: ['defensecurl'] }], + [{ species: "Haxorus", ability: 'moldbreaker', item: 'laggingtail', moves: ['earthquake'] }], ]); const target = battle.p1.active[0]; battle.makeChoices('move defensecurl', 'move earthquake'); diff --git a/test/sim/abilities/slowstart.js b/test/sim/abilities/slowstart.js index 81971e3ac3..a1c0557a80 100644 --- a/test/sim/abilities/slowstart.js +++ b/test/sim/abilities/slowstart.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe(`Slow Start`, function () { - afterEach(function () { +describe(`Slow Start`, () => { + afterEach(() => { battle.destroy(); }); - it(`should delay activation on switch-in, like Speed Boost`, function () { + it(`should delay activation on switch-in, like Speed Boost`, () => { battle = common.createBattle([[ - {species: 'diglett', moves: ['sleeptalk']}, - {species: 'regigigas', ability: 'slowstart', item: 'normaliumz', moves: ['sleeptalk']}, + { species: 'diglett', moves: ['sleeptalk'] }, + { species: 'regigigas', ability: 'slowstart', item: 'normaliumz', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('switch 2', 'auto'); for (let i = 0; i < 4; i++) { battle.makeChoices(); } @@ -29,11 +29,11 @@ describe(`Slow Start`, function () { assert(slowStartEnd > -1, 'Slow Start should not be in effect after 5 active turns.'); }); - it(`[Gen 7] should halve the user's Special Attack when using a special Z-move`, function () { + it(`[Gen 7] should halve the user's Special Attack when using a special Z-move`, () => { battle = common.gen(7).createBattle([[ - {species: 'regigigas', ability: 'slowstart', item: 'normaliumz', moves: ['hyperbeam']}, + { species: 'regigigas', ability: 'slowstart', item: 'normaliumz', moves: ['hyperbeam'] }, ], [ - {species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move hyperbeam zmove', 'auto'); const wynaut = battle.p2.active[0]; @@ -41,13 +41,13 @@ describe(`Slow Start`, function () { assert.bounded(damage, [160, 189]); }); - it(`[Gen 7] should not halve the user's Attack when using physical Photon Geyser`, function () { + it(`[Gen 7] should not halve the user's Attack when using physical Photon Geyser`, () => { // We are using Photon Geyser through Assist, because otherwise Photon Geyser would just ignore Slow Start battle = common.gen(7).createBattle([[ - {species: 'regigigas', ability: 'slowstart', moves: ['assist']}, - {species: 'necrozma', moves: ['photongeyser']}, + { species: 'regigigas', ability: 'slowstart', moves: ['assist'] }, + { species: 'necrozma', moves: ['photongeyser'] }, ], [ - {species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const wynaut = battle.p2.active[0]; diff --git a/test/sim/abilities/soulheart.js b/test/sim/abilities/soulheart.js index 28ca230243..e932b403f2 100644 --- a/test/sim/abilities/soulheart.js +++ b/test/sim/abilities/soulheart.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Soul-Heart', function () { - afterEach(function () { +describe('Soul-Heart', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate on each individual KO`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Toxapex', moves: ['sleeptalk']}, - {species: 'Victini', moves: ['finalgambit']}, + it(`should activate on each individual KO`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Toxapex', moves: ['sleeptalk'] }, + { species: 'Victini', moves: ['finalgambit'] }, ], [ - {species: 'Magearna', ability: 'soulheart', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Magearna', ability: 'soulheart', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); const magearna = battle.p2.active[0]; @@ -29,14 +29,14 @@ describe('Soul-Heart', function () { assert.notEqual(soulHeartFirstIndex, soulHeartSecondIndex, 'Soul-Heart should have activated twice.'); }); - it(`should not activate if two Soul-Hearts are KOed on the same side`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Gengar', moves: ['astralbarrage']}, - {species: 'Aron', moves: ['sleeptalk']}, + it(`should not activate if two Soul-Hearts are KOed on the same side`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Gengar', moves: ['astralbarrage'] }, + { species: 'Aron', moves: ['sleeptalk'] }, ], [ - {species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk']}, - {species: 'Wynaut', ability: 'soulheart', level: 1, moves: ['sleeptalk']}, - {species: 'Roggenrola', moves: ['sleeptalk']}, + { species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk'] }, + { species: 'Wynaut', ability: 'soulheart', level: 1, moves: ['sleeptalk'] }, + { species: 'Roggenrola', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -45,13 +45,13 @@ describe('Soul-Heart', function () { assert.equal(soulHeartIndex, -1, 'Soul-Heart should not have activated.'); }); - it.skip(`should activate an opposing Soul-Heart if the attacker's ally was first KOed in a spread move`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Landorus', moves: ['earthquake']}, - {species: 'Aron', moves: ['sleeptalk']}, + it.skip(`should activate an opposing Soul-Heart if the attacker's ally was first KOed in a spread move`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Landorus', moves: ['earthquake'] }, + { species: 'Aron', moves: ['sleeptalk'] }, ], [ - {species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk']}, - {species: 'Lugia', moves: ['sleeptalk']}, + { species: 'Magearna', ability: 'soulheart', level: 1, moves: ['sleeptalk'] }, + { species: 'Lugia', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/stancechange.js b/test/sim/abilities/stancechange.js index 2a1e8e4b86..69d55318e7 100644 --- a/test/sim/abilities/stancechange.js +++ b/test/sim/abilities/stancechange.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Stance change', function () { - afterEach(function () { +describe('Stance change', () => { + afterEach(() => { battle.destroy(); }); - it(`should change formes when Sleep Talk calls a move`, function () { + it(`should change formes when Sleep Talk calls a move`, () => { battle = common.createBattle([[ - {species: "Aegislash", ability: 'stancechange', moves: ['sleeptalk', 'shadowclaw']}, + { species: "Aegislash", ability: 'stancechange', moves: ['sleeptalk', 'shadowclaw'] }, ], [ - {species: "Kyurem", moves: ['spore']}, + { species: "Kyurem", moves: ['spore'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/steelyspirit.js b/test/sim/abilities/steelyspirit.js index 073384069b..ba59617834 100644 --- a/test/sim/abilities/steelyspirit.js +++ b/test/sim/abilities/steelyspirit.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Steely Spirit', function () { - afterEach(function () { +describe('Steely Spirit', () => { + afterEach(() => { battle.destroy(); }); - it('should boost Steel-type moves for its ally and itself', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'aron', ability: 'steelyspirit', moves: ['ironhead']}, - {species: 'aron', moves: ['ironhead']}, + it('should boost Steel-type moves for its ally and itself', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'aron', ability: 'steelyspirit', moves: ['ironhead'] }, + { species: 'aron', moves: ['ironhead'] }, ], [ - {species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move ironhead 1, move ironhead 2', 'auto'); @@ -29,13 +29,13 @@ describe('Steely Spirit', function () { assert.bounded(damage, [172, 204]); }); - it('should stack with itself', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'aron', ability: 'steelyspirit', moves: ['ironhead']}, - {species: 'aron', ability: 'steelyspirit', moves: ['ironhead']}, + it('should stack with itself', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'aron', ability: 'steelyspirit', moves: ['ironhead'] }, + { species: 'aron', ability: 'steelyspirit', moves: ['ironhead'] }, ], [ - {species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk']}, - {species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk'] }, + { species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move ironhead 1, move ironhead 2', 'auto'); diff --git a/test/sim/abilities/stickyhold.js b/test/sim/abilities/stickyhold.js index 1ae75d843a..bb468da0f3 100644 --- a/test/sim/abilities/stickyhold.js +++ b/test/sim/abilities/stickyhold.js @@ -7,18 +7,18 @@ let battle; const STEAL_MOVES = ['thief', 'knockoff', 'switcheroo', 'bugbite']; -describe('Sticky Hold', function () { - afterEach(function () { +describe('Sticky Hold', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent held items from being stolen by most moves or abilities', function () { + it('should prevent held items from being stolen by most moves or abilities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shuckle', ability: 'stickyhold', item: 'razzberry', moves: ['recover']}]}); - battle.setPlayer('p2', {team: [ - {species: 'Fennekin', ability: 'magician', moves: ['grassknot']}, - {species: 'Smeargle', ability: 'synchronize', moves: STEAL_MOVES}, - ]}); + battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'stickyhold', item: 'razzberry', moves: ['recover'] }] }); + battle.setPlayer('p2', { team: [ + { species: 'Fennekin', ability: 'magician', moves: ['grassknot'] }, + { species: 'Smeargle', ability: 'synchronize', moves: STEAL_MOVES }, + ] }); const itemHolder = battle.p1.active[0]; battle.makeChoices('move recover', 'move grassknot'); assert.equal(itemHolder.item, 'razzberry', "Shuckle should hold a Razz Berry"); @@ -30,10 +30,10 @@ describe('Sticky Hold', function () { } }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Pangoro', ability: 'moldbreaker', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: 'Shuckle', ability: 'stickyhold', item: 'ironball', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: 'Pangoro', ability: 'moldbreaker', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Shuckle', ability: 'stickyhold', item: 'ironball', moves: ['rest'] }] }); battle.makeChoices('move knockoff', 'move rest'); assert.false.holdsItem(battle.p2.active[0]); }); diff --git a/test/sim/abilities/stormdrain.js b/test/sim/abilities/stormdrain.js index 111608c1c6..8b769ebbbf 100644 --- a/test/sim/abilities/stormdrain.js +++ b/test/sim/abilities/stormdrain.js @@ -5,96 +5,96 @@ const common = require('./../../common'); let battle; -describe('Storm Drain', function () { - afterEach(function () { +describe('Storm Drain', () => { + afterEach(() => { battle.destroy(); }); - it('should grant immunity to Water-type moves and boost Special Attack by 1 stage', function () { + it('should grant immunity to Water-type moves and boost Special Attack by 1 stage', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}]}); + battle.setPlayer('p1', { team: [{ species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }] }); battle.makeChoices('move sleeptalk', 'move aquajet'); assert.fullHP(battle.p1.active[0]); assert.statStage(battle.p1.active[0], 'spa', 1); }); - it('should redirect Max Geyser', function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['sleep talk']}, - {species: 'Manaphy', ability: 'hydration', moves: ['scald']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Igglybuff', ability: 'cute charm', moves: ['sleep talk']}, - {species: 'Igglybuff', ability: 'cute charm', moves: ['sleep talk']}, - ]}); + it('should redirect Max Geyser', () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Gastrodon', ability: 'stormdrain', moves: ['sleep talk'] }, + { species: 'Manaphy', ability: 'hydration', moves: ['scald'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Igglybuff', ability: 'cute charm', moves: ['sleep talk'] }, + { species: 'Igglybuff', ability: 'cute charm', moves: ['sleep talk'] }, + ] }); battle.makeChoices('move sleeptalk, move scald dynamax 1', 'move sleep talk, move sleep talk'); assert.fullHP(battle.p1.active[0]); assert.statStage(battle.p1.active[0], 'spa', 1); }); - it('should redirect single-target Water-type attacks to the user if it is a valid target', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk']}, - {species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}, - {species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}, - {species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}, - {species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}, - ]}); + it('should redirect single-target Water-type attacks to the user if it is a valid target', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] }, + { species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }, + { species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }, + { species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }, + { species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }, + ] }); battle.makeChoices('move sleeptalk, move aquajet 1, move aquajet 1', 'move aquajet 3, move aquajet 3, move aquajet 2'); assert.statStage(battle.p1.active[0], 'spa', 3); assert.false.fullHP(battle.p1.active[2]); assert.false.fullHP(battle.p2.active[0]); }); - it('should redirect to the fastest Pokemon with the ability', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk']}, - {species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Azumarill', ability: 'thickfat', moves: ['waterfall']}, - {species: 'Azumarill', ability: 'thickfat', moves: ['waterfall']}, - ]}); + it('should redirect to the fastest Pokemon with the ability', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] }, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Azumarill', ability: 'thickfat', moves: ['waterfall'] }, + { species: 'Azumarill', ability: 'thickfat', moves: ['waterfall'] }, + ] }); const [fastGastrodon, slowGastrodon] = battle.p1.active; - fastGastrodon.boostBy({spe: 6}); + fastGastrodon.boostBy({ spe: 6 }); battle.makeChoices('move sleeptalk, move sleeptalk', 'move waterfall 1, move waterfall 2'); assert.statStage(fastGastrodon, 'spa', 2); assert.statStage(slowGastrodon, 'spa', 0); }); - it('should not redirect if another Pokemon has used Follow Me', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk']}, - {species: 'Azumarill', ability: 'thickfat', moves: ['followme']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}, - {species: 'Azumarill', ability: 'thickfat', moves: ['aquajet']}, - ]}); + it('should not redirect if another Pokemon has used Follow Me', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] }, + { species: 'Azumarill', ability: 'thickfat', moves: ['followme'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }, + { species: 'Azumarill', ability: 'thickfat', moves: ['aquajet'] }, + ] }); const [stormDrainMon, defender] = battle.p1.active; battle.makeChoices('move sleeptalk, move followme', 'move aquajet 2, move aquajet 1'); assert.statStage(stormDrainMon, 'spa', 0); assert.false.fullHP(defender); }); - it('should have its Water-type immunity and its ability to redirect moves suppressed by Mold Breaker', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['endure']}, - {species: 'Manaphy', ability: 'hydration', moves: ['tailglow']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Haxorus', ability: 'moldbreaker', moves: ['waterfall']}, - {species: 'Reshiram', ability: 'turboblaze', moves: ['waterpulse']}, - ]}); + it('should have its Water-type immunity and its ability to redirect moves suppressed by Mold Breaker', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Gastrodon', ability: 'stormdrain', moves: ['endure'] }, + { species: 'Manaphy', ability: 'hydration', moves: ['tailglow'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Haxorus', ability: 'moldbreaker', moves: ['waterfall'] }, + { species: 'Reshiram', ability: 'turboblaze', moves: ['waterpulse'] }, + ] }); const [stormDrainMon, ally] = battle.p1.active; battle.makeChoices('move endure, move tailglow', 'move waterfall 1, move waterpulse 2'); assert.false.fullHP(stormDrainMon); diff --git a/test/sim/abilities/sturdy.js b/test/sim/abilities/sturdy.js index 85f046aa55..5f15b46d16 100644 --- a/test/sim/abilities/sturdy.js +++ b/test/sim/abilities/sturdy.js @@ -5,74 +5,74 @@ const common = require('./../../common'); let battle; -describe('Sturdy', function () { - afterEach(function () { +describe('Sturdy', () => { + afterEach(() => { battle.destroy(); }); - it('should give the user an immunity to OHKO moves', function () { + it('should give the user an immunity to OHKO moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Aron', level: 1, ability: 'sturdy', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Kyogre', ability: 'noguard', moves: ['sheercold']}]}); + battle.setPlayer('p1', { team: [{ species: 'Aron', level: 1, ability: 'sturdy', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Kyogre', ability: 'noguard', moves: ['sheercold'] }] }); assert.false.hurts(battle.p1.active[0], () => battle.makeChoices('move sleeptalk', 'move sheercold')); }); - it('should allow its user to survive an attack from full HP', function () { + it('should allow its user to survive an attack from full HP', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Paras', ability: 'sturdy', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Charizard', ability: 'drought', moves: ['fusionflare']}]}); + battle.setPlayer('p1', { team: [{ species: 'Paras', ability: 'sturdy', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Charizard', ability: 'drought', moves: ['fusionflare'] }] }); battle.makeChoices('move sleeptalk', 'move fusionflare'); assert.equal(battle.p1.active[0].hp, 1); }); - it('should allow its user to survive a confusion damage hit from full HP', function () { + it('should allow its user to survive a confusion damage hit from full HP', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'sturdy', moves: ['absorb']}]}); - battle.setPlayer('p2', {team: [{species: 'Klefki', ability: 'prankster', moves: ['confuseray']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shedinja', ability: 'sturdy', moves: ['absorb'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Klefki', ability: 'prankster', moves: ['confuseray'] }] }); battle.makeChoices('move absorb', 'move confuseray'); assert.equal(battle.p1.active[0].hp, 1); }); - it('should not trigger on recoil damage', function () { + it('should not trigger on recoil damage', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'sturdy', moves: ['doubleedge']}]}); - battle.setPlayer('p2', {team: [{species: 'Klefki', ability: 'prankster', moves: ['reflect']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shedinja', ability: 'sturdy', moves: ['doubleedge'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Klefki', ability: 'prankster', moves: ['reflect'] }] }); battle.makeChoices('move doubleedge', 'move reflect'); assert.fainted(battle.p1.active[0]); }); - it('should not trigger on residual damage', function () { + it('should not trigger on residual damage', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'sturdy', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Crobat', ability: 'infiltrator', moves: ['toxic']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shedinja', ability: 'sturdy', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Crobat', ability: 'infiltrator', moves: ['toxic'] }] }); battle.makeChoices('move sleeptalk', 'move toxic'); assert.fainted(battle.p1.active[0]); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Paras', ability: 'sturdy', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Reshiram', ability: 'turboblaze', moves: ['fusionflare']}]}); + battle.setPlayer('p1', { team: [{ species: 'Paras', ability: 'sturdy', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Reshiram', ability: 'turboblaze', moves: ['fusionflare'] }] }); battle.makeChoices('move sleeptalk', 'move fusionflare'); assert.fainted(battle.p1.active[0]); }); - it(`should trigger before Focus Sash`, function () { + it(`should trigger before Focus Sash`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['tackle']}, + { species: "Wynaut", moves: ['tackle'] }, ], [ - {species: "Stufful", level: 1, ability: 'sturdy', item: 'focussash', moves: ['sleeptalk']}, + { species: "Stufful", level: 1, ability: 'sturdy', item: 'focussash', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p2.active[0]); }); - it(`should not trigger when the user also uses Endure`, function () { + it(`should not trigger when the user also uses Endure`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['tackle']}, + { species: "Wynaut", moves: ['tackle'] }, ], [ - {species: "Stufful", level: 1, ability: 'sturdy', moves: ['endure']}, + { species: "Stufful", level: 1, ability: 'sturdy', moves: ['endure'] }, ]]); battle.makeChoices(); @@ -80,11 +80,11 @@ describe('Sturdy', function () { assert.equal(sturdyIndex, -1, 'Sturdy should not activate.'); }); - it(`should not trigger when the user is damaged to 1 HP from False Swipe`, function () { + it(`should not trigger when the user is damaged to 1 HP from False Swipe`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['falseswipe']}, + { species: "Wynaut", moves: ['falseswipe'] }, ], [ - {species: "Stufful", level: 1, ability: 'sturdy', moves: ['sleeptalk']}, + { species: "Stufful", level: 1, ability: 'sturdy', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/suctioncups.js b/test/sim/abilities/suctioncups.js index 2e6572615a..651bcb5273 100644 --- a/test/sim/abilities/suctioncups.js +++ b/test/sim/abilities/suctioncups.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Suction Cups', function () { - afterEach(function () { +describe('Suction Cups', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent the user from being forced out', function () { + it('should prevent the user from being forced out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Shuckle', ability: 'suctioncups', moves: ['rapidspin']}, - {species: 'Forretress', ability: 'sturdy', moves: ['rapidspin']}, - ]}); - battle.setPlayer('p2', {team: [{species: 'Smeargle', ability: 'noguard', item: 'redcard', moves: ['healpulse', 'dragontail', 'circlethrow', 'roar']}]}); + battle.setPlayer('p1', { team: [ + { species: 'Shuckle', ability: 'suctioncups', moves: ['rapidspin'] }, + { species: 'Forretress', ability: 'sturdy', moves: ['rapidspin'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: 'Smeargle', ability: 'noguard', item: 'redcard', moves: ['healpulse', 'dragontail', 'circlethrow', 'roar'] }] }); const [cupsMon, redCardHolder] = [battle.p1.active[0], battle.p2.active[0]]; battle.makeChoices('move rapidspin', 'move healpulse'); assert.false.holdsItem(redCardHolder, "Red Card should activate"); @@ -27,12 +27,12 @@ describe('Suction Cups', function () { } }); - it(`should be suppressed by Mold Breaker`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Pangoro', ability: 'moldbreaker', moves: ['circlethrow']}, + it(`should be suppressed by Mold Breaker`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Pangoro', ability: 'moldbreaker', moves: ['circlethrow'] }, ], [ - {species: 'Shuckle', ability: 'suctioncups', item: 'ironball', moves: ['rest']}, - {species: 'Forretress', ability: 'sturdy', moves: ['rapidspin']}, + { species: 'Shuckle', ability: 'suctioncups', item: 'ironball', moves: ['rest'] }, + { species: 'Forretress', ability: 'sturdy', moves: ['rapidspin'] }, ]]); battle.makeChoices('move circlethrow', 'move rest'); diff --git a/test/sim/abilities/swordofruin.js b/test/sim/abilities/swordofruin.js index 4747399f35..c795977796 100644 --- a/test/sim/abilities/swordofruin.js +++ b/test/sim/abilities/swordofruin.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe(`Sword of Ruin`, function () { - afterEach(function () { +describe(`Sword of Ruin`, () => { + afterEach(() => { battle.destroy(); }); - it(`should lower the Defense of all other Pokemon`, function () { + it(`should lower the Defense of all other Pokemon`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'shellarmor', moves: ['sleeptalk'] }, ], [ - {species: 'chienpao', ability: 'swordofruin', moves: ['aerialace']}, + { species: 'chienpao', ability: 'swordofruin', moves: ['aerialace'] }, ]]); battle.makeChoices(); const wynaut = battle.p1.active[0]; @@ -22,11 +22,11 @@ describe(`Sword of Ruin`, function () { assert.bounded(damage, [120, 142]); }); - it(`should not lower the Defense of other Pokemon with the Sword of Ruin Ability`, function () { - battle = common.createBattle({forceRandomChance: false}, [[ - {species: 'wynaut', ability: 'swordofruin', moves: ['sleeptalk']}, + it(`should not lower the Defense of other Pokemon with the Sword of Ruin Ability`, () => { + battle = common.createBattle({ forceRandomChance: false }, [[ + { species: 'wynaut', ability: 'swordofruin', moves: ['sleeptalk'] }, ], [ - {species: 'chienpao', ability: 'swordofruin', moves: ['aerialace']}, + { species: 'chienpao', ability: 'swordofruin', moves: ['aerialace'] }, ]]); battle.makeChoices(); const wynaut = battle.p1.active[0]; diff --git a/test/sim/abilities/symbiosis.js b/test/sim/abilities/symbiosis.js index 67e1bf584b..8235f1656d 100644 --- a/test/sim/abilities/symbiosis.js +++ b/test/sim/abilities/symbiosis.js @@ -5,42 +5,42 @@ const common = require('./../../common'); let battle; -describe('Symbiosis', function () { - afterEach(function () { +describe('Symbiosis', () => { + afterEach(() => { battle.destroy(); }); - it(`should share its item with its ally`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Smeargle', ability: 'symbiosis', item: 'enigmaberry', moves: ['sleeptalk']}, - {species: 'Latias', ability: 'levitate', item: 'weaknesspolicy', moves: ['sleeptalk']}, + it(`should share its item with its ally`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Smeargle', ability: 'symbiosis', item: 'enigmaberry', moves: ['sleeptalk'] }, + { species: 'Latias', ability: 'levitate', item: 'weaknesspolicy', moves: ['sleeptalk'] }, ], [ - {species: 'Smeargle', moves: ['crunch']}, - {species: 'Smeargle', moves: ['sleeptalk']}, + { species: 'Smeargle', moves: ['crunch'] }, + { species: 'Smeargle', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move crunch 2, auto'); assert.false.holdsItem(battle.p1.active[0]); assert.equal(battle.p1.active[1].item, 'enigmaberry'); }); - it('should not share an item required to change forme', function () { - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: 'Smeargle', ability: 'symbiosis', item: 'latiasite', moves: ['snarl']}, {species: 'Latias', ability: 'levitate', item: 'weaknesspolicy', moves: ['snarl']}], - [{species: 'Smeargle', moves: ['snarl']}, {species: 'Smeargle', moves: ['snarl']}], + it('should not share an item required to change forme', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: 'Smeargle', ability: 'symbiosis', item: 'latiasite', moves: ['snarl'] }, { species: 'Latias', ability: 'levitate', item: 'weaknesspolicy', moves: ['snarl'] }], + [{ species: 'Smeargle', moves: ['snarl'] }, { species: 'Smeargle', moves: ['snarl'] }], ]); battle.makeChoices('move snarl, move snarl', 'move snarl, move snarl'); assert.equal(battle.p1.active[0].item, 'latiasite'); assert.equal(battle.p1.active[1].item, ''); }); - it('should not trigger on an ally losing their Eject Button in Generation 7 or later', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'oranguru', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk']}, - {species: 'wynaut', item: 'ejectbutton', moves: ['sleeptalk']}, - {species: 'corphish', moves: ['sleeptalk']}, + it('should not trigger on an ally losing their Eject Button in Generation 7 or later', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'oranguru', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk'] }, + { species: 'wynaut', item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: 'corphish', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['tackle']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['tackle'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move tackle 2, move sleeptalk'); @@ -48,14 +48,14 @@ describe('Symbiosis', function () { assert.equal(battle.p1.active[1].item, ''); }); - it('should trigger on an ally losing their Eject Button in Generation 6', function () { - battle = common.gen(6).createBattle({gameType: 'doubles'}, [[ - {species: 'oranguru', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk']}, - {species: 'wynaut', item: 'ejectbutton', moves: ['sleeptalk']}, - {species: 'corphish', moves: ['sleeptalk']}, + it('should trigger on an ally losing their Eject Button in Generation 6', () => { + battle = common.gen(6).createBattle({ gameType: 'doubles' }, [[ + { species: 'oranguru', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk'] }, + { species: 'wynaut', item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: 'corphish', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['tackle']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['tackle'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move tackle 2, move sleeptalk'); @@ -63,14 +63,14 @@ describe('Symbiosis', function () { assert.equal(battle.p1.active[1].item, 'leftovers'); }); - it.skip(`should not trigger on an ally using their Eject Pack`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'oranguru', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk']}, - {species: 'wynaut', item: 'ejectpack', moves: ['superpower']}, - {species: 'corphish', moves: ['sleeptalk']}, + it.skip(`should not trigger on an ally using their Eject Pack`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'oranguru', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk'] }, + { species: 'wynaut', item: 'ejectpack', moves: ['superpower'] }, + { species: 'corphish', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['tackle']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['tackle'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -79,15 +79,15 @@ describe('Symbiosis', function () { }); // See Marty's research for many more examples: https://www.smogon.com/forums/threads/battle-mechanics-research.3489239/post-6401506 - describe.skip('Symbiosis Eject Button Glitch (Gen 6 only)', function () { - it('should cause Leftovers to restore HP 4 times', function () { - battle = common.gen(6).createBattle({gameType: 'doubles'}, [[ - {species: 'florges', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk']}, - {species: 'roggenrola', level: 50, ability: 'sturdy', item: 'ejectbutton', moves: ['sleeptalk']}, - {species: 'corphish', moves: ['sleeptalk']}, + describe.skip('Symbiosis Eject Button Glitch (Gen 6 only)', () => { + it('should cause Leftovers to restore HP 4 times', () => { + battle = common.gen(6).createBattle({ gameType: 'doubles' }, [[ + { species: 'florges', ability: 'symbiosis', item: 'leftovers', moves: ['sleeptalk'] }, + { species: 'roggenrola', level: 50, ability: 'sturdy', item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: 'corphish', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk', 'closecombat']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk', 'closecombat'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move closecombat 2, move sleeptalk'); @@ -102,14 +102,14 @@ describe('Symbiosis', function () { assert.equal(targetHP, roggenrola.hp); }); - it('should cause Choice items to apply 2 times', function () { - battle = common.gen(6).createBattle({gameType: 'doubles'}, [[ - {species: 'florges', ability: 'symbiosis', item: 'choiceband', moves: ['sleeptalk']}, - {species: 'roggenrola', evs: {atk: 8}, item: 'ejectbutton', moves: ['smackdown']}, - {species: 'corphish', moves: ['sleeptalk']}, + it('should cause Choice items to apply 2 times', () => { + battle = common.gen(6).createBattle({ gameType: 'doubles' }, [[ + { species: 'florges', ability: 'symbiosis', item: 'choiceband', moves: ['sleeptalk'] }, + { species: 'roggenrola', evs: { atk: 8 }, item: 'ejectbutton', moves: ['smackdown'] }, + { species: 'corphish', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk', 'tackle']}, - {species: 'torkoal', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk', 'tackle'] }, + { species: 'torkoal', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move tackle 2, move sleeptalk'); diff --git a/test/sim/abilities/synchronize.js b/test/sim/abilities/synchronize.js index f847a05ea1..3e72548bbd 100644 --- a/test/sim/abilities/synchronize.js +++ b/test/sim/abilities/synchronize.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Synchronize', function () { - afterEach(function () { +describe('Synchronize', () => { + afterEach(() => { battle.destroy(); }); - it(`should complete before Lum Berry can trigger`, function () { + it(`should complete before Lum Berry can trigger`, () => { battle = common.createBattle([[ - {species: 'alakazam', ability: 'synchronize', item: 'lumberry', moves: ['sleeptalk']}, + { species: 'alakazam', ability: 'synchronize', item: 'lumberry', moves: ['sleeptalk'] }, ], [ - {species: 'ralts', ability: 'synchronize', item: 'lumberry', moves: ['glare']}, + { species: 'ralts', ability: 'synchronize', item: 'lumberry', moves: ['glare'] }, ]]); battle.makeChoices(); const alakazam = battle.p1.active[0]; diff --git a/test/sim/abilities/technician.js b/test/sim/abilities/technician.js index ab514d015d..59702e81b2 100644 --- a/test/sim/abilities/technician.js +++ b/test/sim/abilities/technician.js @@ -5,34 +5,34 @@ const common = require('./../../common'); let battle; -describe('Technician', function () { - afterEach(function () { +describe('Technician', () => { + afterEach(() => { battle.destroy(); }); - it('should not apply boost on a move boosted over 60 BP by Battery in Gen 7', function () { - battle = common.gen(7).createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Toxtricity', ability: 'technician', moves: ['shockwave']}, - {species: 'Charjabug', ability: 'battery', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Marshadow', ability: 'technician', moves: ['sleeptalk']}, - {species: 'Mew', ability: 'synchronize', moves: ['sleeptalk']}, - ]}); + it('should not apply boost on a move boosted over 60 BP by Battery in Gen 7', () => { + battle = common.gen(7).createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Toxtricity', ability: 'technician', moves: ['shockwave'] }, + { species: 'Charjabug', ability: 'battery', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Marshadow', ability: 'technician', moves: ['sleeptalk'] }, + { species: 'Mew', ability: 'synchronize', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move shockwave 2, move sleeptalk', 'move sleeptalk, move sleeptalk'); const mew = battle.p2.active[1]; const damage = mew.maxhp - mew.hp; assert.bounded(damage, [94, 112]); }); - it(`should apply boost on a move boosted over 60 BP by Steely Spirit`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Scizor', ability: 'technician', moves: ['metalclaw']}, - {species: 'Perrserker', ability: 'steelyspirit', moves: ['sleeptalk']}, + it(`should apply boost on a move boosted over 60 BP by Steely Spirit`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Scizor', ability: 'technician', moves: ['metalclaw'] }, + { species: 'Perrserker', ability: 'steelyspirit', moves: ['sleeptalk'] }, ], [ - {species: 'Marshadow', moves: ['luckychant']}, - {species: 'Mew', ability: 'noguard', moves: ['sleeptalk']}, + { species: 'Marshadow', moves: ['luckychant'] }, + { species: 'Mew', ability: 'noguard', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move metalclaw 2, auto', 'auto'); const mew = battle.p2.active[1]; @@ -40,14 +40,14 @@ describe('Technician', function () { assert.bounded(damage, [151, 178]); }); - it(`should consider the BP before Aura boosts have been applied in Gen 8`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Smeargle', ability: 'technician', moves: ['drainingkiss', 'knockoff']}, - {species: 'Scizor', ability: 'technician', moves: ['thief', 'sleeptalk']}, + it(`should consider the BP before Aura boosts have been applied in Gen 8`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Smeargle', ability: 'technician', moves: ['drainingkiss', 'knockoff'] }, + { species: 'Scizor', ability: 'technician', moves: ['thief', 'sleeptalk'] }, ], [ - {species: 'Xerneas', ability: 'fairyaura', moves: ['luckychant']}, - {species: 'Yveltal', ability: 'darkaura', moves: ['sleeptalk']}, - {species: 'Zygarde', ability: 'aurabreak', moves: ['sleeptalk']}, + { species: 'Xerneas', ability: 'fairyaura', moves: ['luckychant'] }, + { species: 'Yveltal', ability: 'darkaura', moves: ['sleeptalk'] }, + { species: 'Zygarde', ability: 'aurabreak', moves: ['sleeptalk'] }, ]]); // 1st turn: test Fairy Aura and Dark Aura // Scizor attacks Xerneas with Thief, Smeargle attacks Yveltal with Draining Kiss diff --git a/test/sim/abilities/terashell.js b/test/sim/abilities/terashell.js index a3d2c87fc1..32e6abc4cd 100644 --- a/test/sim/abilities/terashell.js +++ b/test/sim/abilities/terashell.js @@ -5,13 +5,13 @@ const common = require('../../common'); let battle; -describe('Tera Shell', function () { +describe('Tera Shell', () => { afterEach(() => battle.destroy()); - it(`should take not very effective damage when it is at full health`, function () { + it(`should take not very effective damage when it is at full health`, () => { battle = common.createBattle([ - [{species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk']}], - [{species: 'Wynaut', moves: ['wickedblow']}], + [{ species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk'] }], + [{ species: 'Wynaut', moves: ['wickedblow'] }], ]); battle.makeChoices(); @@ -24,10 +24,10 @@ describe('Tera Shell', function () { }); // confirmed here: https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9893603 - it(`should not take precedence over immunities`, function () { + it(`should not take precedence over immunities`, () => { battle = common.createBattle([ - [{species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk']}], - [{species: 'Wynaut', moves: ['shadowball']}], + [{ species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk'] }], + [{ species: 'Wynaut', moves: ['shadowball'] }], ]); battle.makeChoices(); @@ -36,11 +36,11 @@ describe('Tera Shell', function () { }); // confirmed here: https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-10398768 - it(`should not activate if Terapagos already resists the move`, function () { + it(`should not activate if Terapagos already resists the move`, () => { battle = common.createBattle([[ - {species: 'Terapagos', ability: 'terashift', moves: ['sleeptalk']}, + { species: 'Terapagos', ability: 'terashift', moves: ['sleeptalk'] }, ], [ - {species: 'Urshifu-Rapid-Strike', moves: ['surgingstrikes', 'soak', 'forestscurse']}, + { species: 'Urshifu-Rapid-Strike', moves: ['surgingstrikes', 'soak', 'forestscurse'] }, ]]); const terapagos = battle.p1.active[0]; battle.makeChoices('auto', 'move soak'); @@ -57,10 +57,10 @@ describe('Tera Shell', function () { // kinda confirmed here: https://youtu.be/-nerhfXrmCM?si=hLzfrfzVDdfNFMbv&t=314 // confirmed here: https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9893781 - it('All hits of multi-hit move should be not very effective', function () { + it('All hits of multi-hit move should be not very effective', () => { battle = common.createBattle([ - [{species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk']}], - [{species: 'Wynaut', moves: ['surgingstrikes']}], + [{ species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk'] }], + [{ species: 'Wynaut', moves: ['surgingstrikes'] }], ]); battle.makeChoices(); @@ -70,10 +70,10 @@ describe('Tera Shell', function () { }); // confirmed here: https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9893651 - it(`should be suppressed by Gastro Acid`, function () { + it(`should be suppressed by Gastro Acid`, () => { battle = common.createBattle([ - [{species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk']}], - [{species: 'Wynaut', moves: ['gastroacid', 'wickedblow']}], + [{ species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk'] }], + [{ species: 'Wynaut', moves: ['gastroacid', 'wickedblow'] }], ]); battle.makeChoices('move sleeptalk', 'move gastroacid'); @@ -83,11 +83,11 @@ describe('Tera Shell', function () { assert.bounded(damage, [28, 33], `Tera Shell should not reduce damage, because Tera Shell should be suppressed`); }); - it(`should not work if the user's species is not currently Terapagos-Terastal`, function () { + it(`should not work if the user's species is not currently Terapagos-Terastal`, () => { battle = common.createBattle([[ - {species: 'Terapagos', ability: 'terashift', moves: ['transform']}, + { species: 'Terapagos', ability: 'terashift', moves: ['transform'] }, ], [ - {species: 'Umbreon', ability: 'terashell', moves: ['flowertrick']}, + { species: 'Umbreon', ability: 'terashell', moves: ['flowertrick'] }, ]]); battle.makeChoices(); @@ -95,11 +95,10 @@ describe('Tera Shell', function () { let damage = terapagos.maxhp - terapagos.hp; assert.bounded(damage, [51, 60], `Tera Shell should not have activated because current species is not Terapagos`); - battle = common.createBattle([[ - {species: 'Espeon', moves: ['transform']}, + { species: 'Espeon', moves: ['transform'] }, ], [ - {species: 'Terapagos', ability: 'terashift', moves: ['flowertrick']}, + { species: 'Terapagos', ability: 'terashift', moves: ['flowertrick'] }, ]]); battle.makeChoices(); @@ -108,11 +107,11 @@ describe('Tera Shell', function () { assert.bounded(damage, [33, 39], `Tera Shell should have activated because current species is Terapagos`); }); - it(`should not weaken the damage from Struggle`, function () { + it(`should not weaken the damage from Struggle`, () => { battle = common.createBattle([[ - {species: 'Terapagos', ability: 'terashift', moves: ['luckychant']}, + { species: 'Terapagos', ability: 'terashift', moves: ['luckychant'] }, ], [ - {species: 'Slowking', item: 'assaultvest', moves: ['sleeptalk']}, + { species: 'Slowking', item: 'assaultvest', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -122,12 +121,12 @@ describe('Tera Shell', function () { assert.bounded(damage, [27, 32], `Tera Shell should not have reduced the damage Struggle dealt`); }); - it(`should not continue to weaken attacks after taking damage from a Future attack`, function () { + it(`should not continue to weaken attacks after taking damage from a Future attack`, () => { battle = common.createBattle([[ - {species: 'Terapagos', ability: 'terashift', moves: ['sleeptalk']}, - {species: 'Espeon', moves: ['sleeptalk']}, + { species: 'Terapagos', ability: 'terashift', moves: ['sleeptalk'] }, + { species: 'Espeon', moves: ['sleeptalk'] }, ], [ - {species: 'Slowking', moves: ['sleeptalk', 'wickedblow', 'futuresight']}, + { species: 'Slowking', moves: ['sleeptalk', 'wickedblow', 'futuresight'] }, ]]); battle.makeChoices('auto', 'move futuresight'); @@ -144,14 +143,14 @@ describe('Tera Shell', function () { assert.bounded(damage, [59, 70], `Tera Shell should not have reduced the damage Wicked Blow dealt`); }); - it.skip(`should activate, but not weaken, moves with fixed damage`, function () { + it.skip(`should activate, but not weaken, moves with fixed damage`, () => { battle = common.createBattle([[ - {species: 'Terapagos', ability: 'terashift', evs: {hp: 252}, moves: ['recover', 'seismictoss']}, - {species: 'Magikarp', moves: ['sleeptalk']}, + { species: 'Terapagos', ability: 'terashift', evs: { hp: 252 }, moves: ['recover', 'seismictoss'] }, + { species: 'Magikarp', moves: ['sleeptalk'] }, ], [ - {species: 'Slowpoke', ability: 'noguard', moves: ['seismictoss', 'superfang', 'counter']}, - {species: 'Shuckle', moves: ['finalgambit']}, - {species: 'Wynaut', ability: 'noguard', moves: ['sheercold']}, + { species: 'Slowpoke', ability: 'noguard', moves: ['seismictoss', 'superfang', 'counter'] }, + { species: 'Shuckle', moves: ['finalgambit'] }, + { species: 'Wynaut', ability: 'noguard', moves: ['sheercold'] }, ]]); const terapagos = battle.p1.active[0]; diff --git a/test/sim/abilities/thickfat.js b/test/sim/abilities/thickfat.js index f4d507fdde..7dfe489a22 100644 --- a/test/sim/abilities/thickfat.js +++ b/test/sim/abilities/thickfat.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Thick Fat', function () { - afterEach(function () { +describe('Thick Fat', () => { + afterEach(() => { battle.destroy(); }); - it(`should halve damage from Fire- or Ice-type attacks`, function () { + it(`should halve damage from Fire- or Ice-type attacks`, () => { battle = common.createBattle([[ - {species: 'Miltank', ability: 'thickfat', item: 'lumberry', moves: ['luckychant', 'recover']}, + { species: 'Miltank', ability: 'thickfat', item: 'lumberry', moves: ['luckychant', 'recover'] }, ], [ - {species: 'Wynaut', moves: ['icebeam', 'flamethrower']}, + { species: 'Wynaut', moves: ['icebeam', 'flamethrower'] }, ]]); const miltank = battle.p1.active[0]; const damageRange = [16, 19]; @@ -24,22 +24,22 @@ describe('Thick Fat', function () { assert.bounded(miltank.maxhp - miltank.hp, damageRange); }); - it(`should halve damage from Fire- or Ice-type attacks in past generations, even when holding a type-boosting item`, function () { + it(`should halve damage from Fire- or Ice-type attacks in past generations, even when holding a type-boosting item`, () => { battle = common.gen(3).createBattle([[ - {species: 'Miltank', ability: 'thickfat', moves: ['recover']}, + { species: 'Miltank', ability: 'thickfat', moves: ['recover'] }, ], [ - {species: 'Wynaut', item: 'nevermeltice', moves: ['icebeam']}, + { species: 'Wynaut', item: 'nevermeltice', moves: ['icebeam'] }, ]]); const miltank = battle.p1.active[0]; battle.makeChoices(); assert.bounded(miltank.maxhp - miltank.hp, [18, 22]); }); - it(`should be suppressed by Mold Breaker`, function () { + it(`should be suppressed by Mold Breaker`, () => { battle = common.createBattle([[ - {species: 'Miltank', ability: 'thickfat', item: 'lumberry', moves: ['luckychant', 'recover']}, + { species: 'Miltank', ability: 'thickfat', item: 'lumberry', moves: ['luckychant', 'recover'] }, ], [ - {species: 'Wynaut', ability: 'moldbreaker', moves: ['icebeam', 'flamethrower']}, + { species: 'Wynaut', ability: 'moldbreaker', moves: ['icebeam', 'flamethrower'] }, ]]); const miltank = battle.p1.active[0]; const damageRange = [31, 37]; diff --git a/test/sim/abilities/trace.js b/test/sim/abilities/trace.js index ad6586ce07..ebe557b0c0 100644 --- a/test/sim/abilities/trace.js +++ b/test/sim/abilities/trace.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Trace', function () { - afterEach(function () { +describe('Trace', () => { + afterEach(() => { battle.destroy(); }); - it(`should copy the opponent's Ability`, function () { + it(`should copy the opponent's Ability`, () => { battle = common.createBattle([[ - {species: "Ralts", ability: 'trace', moves: ['sleeptalk']}, + { species: "Ralts", ability: 'trace', moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", ability: 'shadowtag', moves: ['sleeptalk']}, + { species: "Wynaut", ability: 'shadowtag', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -22,13 +22,13 @@ describe('Trace', function () { assert.equal(ralts.ability, 'shadowtag'); }); - it(`should delay copying the opponent's Ability if the initial Abilities could not be copied by Trace`, function () { + it(`should delay copying the opponent's Ability if the initial Abilities could not be copied by Trace`, () => { battle = common.createBattle([[ - {species: "Ralts", ability: 'trace', moves: ['sleeptalk']}, + { species: "Ralts", ability: 'trace', moves: ['sleeptalk'] }, ], [ - {species: "Arceus", ability: 'multitype', moves: ['sleeptalk']}, - {species: "Aegislash", ability: 'stancechange', moves: ['sleeptalk']}, - {species: "Wynaut", ability: 'shadowtag', moves: ['sleeptalk']}, + { species: "Arceus", ability: 'multitype', moves: ['sleeptalk'] }, + { species: "Aegislash", ability: 'stancechange', moves: ['sleeptalk'] }, + { species: "Wynaut", ability: 'shadowtag', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -43,15 +43,15 @@ describe('Trace', function () { }); // see research: https://www.smogon.com/forums/threads/pokemon-sun-moon-battle-mechanics-research.3586701/post-7790209 - it(`should interact properly with Ability index 0 'No Ability'`, function () { + it(`should interact properly with Ability index 0 'No Ability'`, () => { // Trace stops working if it initially finds 'No Ability' - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ralts", ability: 'trace', moves: ['sleeptalk']}, - {species: "Bouffalant", ability: 'sapsipper', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ralts", ability: 'trace', moves: ['sleeptalk'] }, + { species: "Bouffalant", ability: 'sapsipper', moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", ability: 'noability', moves: ['sleeptalk']}, - {species: "Wynaut", ability: 'unburden', moves: ['sleeptalk']}, - {species: "Wynaut", ability: 'triage', moves: ['sleeptalk']}, + { species: "Wynaut", ability: 'noability', moves: ['sleeptalk'] }, + { species: "Wynaut", ability: 'unburden', moves: ['sleeptalk'] }, + { species: "Wynaut", ability: 'triage', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -62,14 +62,14 @@ describe('Trace', function () { assert.equal(ralts.ability, 'trace'); // Trace will continue if it checks later on if it can take 'No Ability' - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ralts", ability: 'trace', moves: ['sleeptalk']}, - {species: "Bouffalant", ability: 'sapsipper', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ralts", ability: 'trace', moves: ['sleeptalk'] }, + { species: "Bouffalant", ability: 'sapsipper', moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", ability: 'stancechange', moves: ['sleeptalk']}, - {species: "Wynaut", ability: 'stancechange', moves: ['sleeptalk']}, - {species: "Wynaut", ability: 'noability', moves: ['sleeptalk']}, - {species: "Wynaut", ability: 'unburden', moves: ['sleeptalk']}, + { species: "Wynaut", ability: 'stancechange', moves: ['sleeptalk'] }, + { species: "Wynaut", ability: 'stancechange', moves: ['sleeptalk'] }, + { species: "Wynaut", ability: 'noability', moves: ['sleeptalk'] }, + { species: "Wynaut", ability: 'unburden', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/truant.js b/test/sim/abilities/truant.js index 0a4d1814b6..cd0340480a 100644 --- a/test/sim/abilities/truant.js +++ b/test/sim/abilities/truant.js @@ -5,26 +5,26 @@ const common = require('./../../common'); let battle; -describe('Truant', function () { - afterEach(function () { +describe('Truant', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent the user from acting the turn after using a move', function () { + it('should prevent the user from acting the turn after using a move', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Slaking", ability: 'truant', moves: ['scratch']}]}); - battle.setPlayer('p2', {team: [{species: "Steelix", ability: 'sturdy', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: "Slaking", ability: 'truant', moves: ['scratch'] }] }); + battle.setPlayer('p2', { team: [{ species: "Steelix", ability: 'sturdy', moves: ['endure'] }] }); const pokemon = battle.p2.active[0]; assert.hurts(pokemon, () => battle.makeChoices()); assert.false.hurts(pokemon, () => battle.makeChoices()); }); - it(`should allow the user to act after a recharge turn`, function () { + it(`should allow the user to act after a recharge turn`, () => { battle = common.createBattle([[ - {species: 'Slaking', ability: 'truant', moves: ['hyperbeam']}, + { species: 'Slaking', ability: 'truant', moves: ['hyperbeam'] }, ], [ - {species: 'Registeel', ability: 'noguard', moves: ['endure']}, + { species: 'Registeel', ability: 'noguard', moves: ['endure'] }, ]]); const pokemon = battle.p2.active[0]; @@ -33,10 +33,10 @@ describe('Truant', function () { assert.hurts(pokemon, () => battle.makeChoices()); }); - it('should not allow the user to act the turn it wakes up, if it moved the turn it fell asleep', function () { + it('should not allow the user to act the turn it wakes up, if it moved the turn it fell asleep', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Slaking", ability: 'truant', moves: ['scratch', 'rest']}]}); - battle.setPlayer('p2', {team: [{species: "Steelix", ability: 'sturdy', moves: ['endure', 'quickattack']}]}); + battle.setPlayer('p1', { team: [{ species: "Slaking", ability: 'truant', moves: ['scratch', 'rest'] }] }); + battle.setPlayer('p2', { team: [{ species: "Steelix", ability: 'sturdy', moves: ['endure', 'quickattack'] }] }); const pokemon = battle.p2.active[0]; battle.makeChoices('move rest', 'move quickattack'); @@ -45,10 +45,10 @@ describe('Truant', function () { assert.false.hurts(pokemon, () => battle.makeChoices('move scratch', 'move endure'), 'Attacked after waking up'); }); - it('should allow the user to act the turn it wakes up, if it was loafing the turn it fell asleep', function () { + it('should allow the user to act the turn it wakes up, if it was loafing the turn it fell asleep', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Slaking", ability: 'truant', moves: ['scratch', 'irondefense']}]}); - battle.setPlayer('p2', {team: [{species: "Steelix", ability: 'sturdy', moves: ['endure', 'spore']}]}); + battle.setPlayer('p1', { team: [{ species: "Slaking", ability: 'truant', moves: ['scratch', 'irondefense'] }] }); + battle.setPlayer('p2', { team: [{ species: "Steelix", ability: 'sturdy', moves: ['endure', 'spore'] }] }); const user = battle.p1.active[0]; const pokemon = battle.p2.active[0]; @@ -61,20 +61,20 @@ describe('Truant', function () { assert.false.fullHP(pokemon); }); - it('should cause two-turn moves to fail', function () { + it('should cause two-turn moves to fail', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Slaking", ability: 'truant', moves: ['razorwind']}]}); - battle.setPlayer('p2', {team: [{species: "Steelix", ability: 'sturdy', moves: ['endure']}]}); + battle.setPlayer('p1', { team: [{ species: "Slaking", ability: 'truant', moves: ['razorwind'] }] }); + battle.setPlayer('p2', { team: [{ species: "Steelix", ability: 'sturdy', moves: ['endure'] }] }); const pokemon = battle.p2.active[0]; assert.false.hurts(pokemon, () => battle.makeChoices()); assert.false.hurts(pokemon, () => battle.makeChoices()); }); - it('should prevent a newly-Mega Evolved Pokemon from acting if given the ability', function () { + it('should prevent a newly-Mega Evolved Pokemon from acting if given the ability', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Slaking", ability: 'truant', item: 'choicescarf', moves: ['entrainment']}]}); - battle.setPlayer('p2', {team: [{species: "Steelix", ability: 'sturdy', item: 'steelixite', moves: ['heavyslam']}]}); + battle.setPlayer('p1', { team: [{ species: "Slaking", ability: 'truant', item: 'choicescarf', moves: ['entrainment'] }] }); + battle.setPlayer('p2', { team: [{ species: "Steelix", ability: 'sturdy', item: 'steelixite', moves: ['heavyslam'] }] }); assert.false.hurts(battle.p1.active[0], () => battle.makeChoices('move entrainment', 'move heavyslam mega')); }); diff --git a/test/sim/abilities/unaware.js b/test/sim/abilities/unaware.js index bc1b57db0b..df449285cb 100644 --- a/test/sim/abilities/unaware.js +++ b/test/sim/abilities/unaware.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Unaware', function () { - afterEach(function () { +describe('Unaware', () => { + afterEach(() => { battle.destroy(); }); - it(`should ignore attack stage changes when Pokemon with it are attacked`, function () { + it(`should ignore attack stage changes when Pokemon with it are attacked`, () => { battle = common.createBattle([[ - {species: 'Clefable', ability: 'unaware', moves: ['softboiled']}, + { species: 'Clefable', ability: 'unaware', moves: ['softboiled'] }, ], [ - {species: 'Wynaut', moves: ['bellydrum', 'wickedblow']}, + { species: 'Wynaut', moves: ['bellydrum', 'wickedblow'] }, ]]); battle.makeChoices('auto', 'move bellydrum'); @@ -24,11 +24,11 @@ describe('Unaware', function () { assert.bounded(damage, [19, 22]); }); - it(`should not ignore attack stage changes when Pokemon with it attack`, function () { + it(`should not ignore attack stage changes when Pokemon with it attack`, () => { battle = common.createBattle([[ - {species: 'Clefable', ability: 'unaware', moves: ['moonblast', 'nastyplot']}, + { species: 'Clefable', ability: 'unaware', moves: ['moonblast', 'nastyplot'] }, ], [ - {species: 'Registeel', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'Registeel', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move nastyplot', 'auto'); @@ -38,11 +38,11 @@ describe('Unaware', function () { assert.bounded(damage, [69, 81]); }); - it(`should ignore defense stage changes when Pokemon with it attack`, function () { + it(`should ignore defense stage changes when Pokemon with it attack`, () => { battle = common.createBattle([[ - {species: 'Clefable', ability: 'unaware', item: 'laggingtail', moves: ['moonblast']}, + { species: 'Clefable', ability: 'unaware', item: 'laggingtail', moves: ['moonblast'] }, ], [ - {species: 'Registeel', ability: 'shellarmor', moves: ['amnesia']}, + { species: 'Registeel', ability: 'shellarmor', moves: ['amnesia'] }, ]]); battle.makeChoices(); @@ -51,11 +51,11 @@ describe('Unaware', function () { assert.bounded(damage, [34, 41]); }); - it(`should not ignore defense stage changes when Pokemon with it are attacked`, function () { + it(`should not ignore defense stage changes when Pokemon with it are attacked`, () => { battle = common.createBattle([[ - {species: 'Clefable', ability: 'unaware', moves: ['luckychant', 'irondefense']}, + { species: 'Clefable', ability: 'unaware', moves: ['luckychant', 'irondefense'] }, ], [ - {species: 'Registeel', moves: ['sleeptalk', 'payday']}, + { species: 'Registeel', moves: ['sleeptalk', 'payday'] }, ]]); battle.makeChoices(); @@ -65,11 +65,11 @@ describe('Unaware', function () { assert.bounded(damage, [16, 19]); }); - it(`should be suppressed by Mold Breaker`, function () { + it(`should be suppressed by Mold Breaker`, () => { battle = common.createBattle([[ - {species: 'Clefable', ability: 'unaware', moves: ['softboiled']}, + { species: 'Clefable', ability: 'unaware', moves: ['softboiled'] }, ], [ - {species: 'Wynaut', ability: 'moldbreaker', moves: ['bellydrum', 'wickedblow']}, + { species: 'Wynaut', ability: 'moldbreaker', moves: ['bellydrum', 'wickedblow'] }, ]]); battle.makeChoices('auto', 'move bellydrum'); @@ -79,13 +79,13 @@ describe('Unaware', function () { assert.bounded(damage, [73, 86]); }); - it(`should only apply to targets with Unaware in battles with multiple Pokemon`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'manaphy', moves: ['tailglow', 'surf']}, - {species: 'slowbro', ability: 'unaware', moves: ['sleeptalk']}, + it(`should only apply to targets with Unaware in battles with multiple Pokemon`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'manaphy', moves: ['tailglow', 'surf'] }, + { species: 'slowbro', ability: 'unaware', moves: ['sleeptalk'] }, ], [ - {species: 'clobbopus', ability: 'sturdy', moves: ['sleeptalk']}, - {species: 'clobbopus', ability: 'sturdy', moves: ['sleeptalk']}, + { species: 'clobbopus', ability: 'sturdy', moves: ['sleeptalk'] }, + { species: 'clobbopus', ability: 'sturdy', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move tailglow, auto', 'auto'); battle.makeChoices('move surf, auto', 'auto'); @@ -93,11 +93,11 @@ describe('Unaware', function () { assert.equal(battle.p2.active[1].hp, 1); }); - it(`should ignore attack stage changes when Pokemon with it are attacked with Foul Play`, function () { + it(`should ignore attack stage changes when Pokemon with it are attacked with Foul Play`, () => { battle = common.createBattle([[ - {species: 'Clefable', ability: 'unaware', moves: ['bellydrum']}, + { species: 'Clefable', ability: 'unaware', moves: ['bellydrum'] }, ], [ - {species: 'Wynaut', ability: 'superluck', moves: ['focusenergy', 'foulplay']}, + { species: 'Wynaut', ability: 'superluck', moves: ['focusenergy', 'foulplay'] }, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/unburden.js b/test/sim/abilities/unburden.js index 4254cc3dba..3b6c9b8c12 100644 --- a/test/sim/abilities/unburden.js +++ b/test/sim/abilities/unburden.js @@ -5,63 +5,63 @@ const common = require('./../../common'); let battle; -describe('Unburden', function () { - afterEach(function () { +describe('Unburden', () => { + afterEach(() => { battle.destroy(); }); - it('should trigger when an item is consumed', function () { + it('should trigger when an item is consumed', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Hitmonlee', ability: 'unburden', item: 'whiteherb', moves: ['closecombat']}]}); - battle.setPlayer('p2', {team: [{species: 'Scizor', ability: 'swarm', item: 'focussash', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: 'Hitmonlee', ability: 'unburden', item: 'whiteherb', moves: ['closecombat'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Scizor', ability: 'swarm', item: 'focussash', moves: ['swordsdance'] }] }); const target = battle.p1.active[0]; assert.sets(() => target.getStat('spe'), 2 * target.getStat('spe'), () => battle.makeChoices('move closecombat', 'move swordsdance')); }); - it('should trigger when an item is destroyed', function () { + it('should trigger when an item is destroyed', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Drifblim', ability: 'unburden', item: 'airballoon', moves: ['endure']}]}); - battle.setPlayer('p2', {team: [{species: 'Machamp', ability: 'noguard', moves: ['stoneedge']}]}); + battle.setPlayer('p1', { team: [{ species: 'Drifblim', ability: 'unburden', item: 'airballoon', moves: ['endure'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Machamp', ability: 'noguard', moves: ['stoneedge'] }] }); const target = battle.p1.active[0]; assert.sets(() => target.getStat('spe'), 2 * target.getStat('spe'), () => battle.makeChoices('move endure', 'move stoneedge')); }); - it('should trigger when Natural Gift consumes a berry', function () { + it('should trigger when Natural Gift consumes a berry', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sceptile', ability: 'unburden', item: 'oranberry', moves: ['naturalgift']}]}); - battle.setPlayer('p2', {team: [{species: 'Scizor', ability: 'swarm', item: 'focussash', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sceptile', ability: 'unburden', item: 'oranberry', moves: ['naturalgift'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Scizor', ability: 'swarm', item: 'focussash', moves: ['swordsdance'] }] }); const target = battle.p1.active[0]; assert.sets(() => target.getStat('spe'), 2 * target.getStat('spe'), () => battle.makeChoices('move naturalgift', 'move swordsdance')); }); - it('should trigger when an item is flung', function () { + it('should trigger when an item is flung', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sceptile', ability: 'unburden', item: 'whiteherb', moves: ['fling']}]}); - battle.setPlayer('p2', {team: [{species: 'Scizor', ability: 'swarm', item: 'focussash', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sceptile', ability: 'unburden', item: 'whiteherb', moves: ['fling'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Scizor', ability: 'swarm', item: 'focussash', moves: ['swordsdance'] }] }); const target = battle.p1.active[0]; assert.sets(() => target.getStat('spe'), 2 * target.getStat('spe'), () => battle.makeChoices('move fling', 'move swordsdance')); }); - it('should trigger when an item is forcefully removed', function () { + it('should trigger when an item is forcefully removed', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sceptile', ability: 'unburden', item: 'whiteherb', moves: ['leechseed']}]}); - battle.setPlayer('p2', {team: [{species: 'Scizor', ability: 'swarm', moves: ['knockoff']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sceptile', ability: 'unburden', item: 'whiteherb', moves: ['leechseed'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Scizor', ability: 'swarm', moves: ['knockoff'] }] }); const target = battle.p1.active[0]; assert.sets(() => target.getStat('spe'), 2 * target.getStat('spe'), () => battle.makeChoices('move leechseed', 'move knockoff')); }); - it('should not be suppressed by Mold Breaker', function () { + it('should not be suppressed by Mold Breaker', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sceptile', ability: 'unburden', item: 'whiteherb', moves: ['leechseed']}]}); - battle.setPlayer('p2', {team: [{species: 'Scizor', ability: 'moldbreaker', moves: ['knockoff']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sceptile', ability: 'unburden', item: 'whiteherb', moves: ['leechseed'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Scizor', ability: 'moldbreaker', moves: ['knockoff'] }] }); const target = battle.p1.active[0]; assert.sets(() => target.getStat('spe'), 2 * target.getStat('spe'), () => battle.makeChoices('move leechseed', 'move knockoff')); }); - it('should lose the boost when it gains a new item', function () { + it('should lose the boost when it gains a new item', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Hitmonlee', ability: 'unburden', item: 'fightinggem', moves: ['machpunch']}]}); - battle.setPlayer('p2', {team: [{species: 'Togekiss', ability: 'serenegrace', item: 'laggingtail', moves: ['bestow', 'followme']}]}); + battle.setPlayer('p1', { team: [{ species: 'Hitmonlee', ability: 'unburden', item: 'fightinggem', moves: ['machpunch'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Togekiss', ability: 'serenegrace', item: 'laggingtail', moves: ['bestow', 'followme'] }] }); const originalSpeed = battle.p1.active[0].getStat('spe'); battle.makeChoices('move machpunch', 'move followme'); assert.equal(battle.p1.active[0].getStat('spe'), 2 * originalSpeed); diff --git a/test/sim/abilities/unnerve.js b/test/sim/abilities/unnerve.js index 61847f6868..21228769db 100644 --- a/test/sim/abilities/unnerve.js +++ b/test/sim/abilities/unnerve.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe(`Unnerve`, function () { - afterEach(function () { +describe(`Unnerve`, () => { + afterEach(() => { battle.destroy(); }); - it(`should allow Berry activation between switches of Unnerve`, function () { + it(`should allow Berry activation between switches of Unnerve`, () => { battle = common.createBattle([[ - {species: 'toxapex', ability: 'unnerve', moves: ['toxic']}, - {species: 'corviknight', ability: 'unnerve', moves: ['sleeptalk']}, + { species: 'toxapex', ability: 'unnerve', moves: ['toxic'] }, + { species: 'corviknight', ability: 'unnerve', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', item: 'lumberry', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'lumberry', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'auto'); @@ -24,28 +24,28 @@ describe(`Unnerve`, function () { // See writeup by SadisticMystic: https://glitchcity.wiki/Unnerve_desync_glitch // Tests done with Oran Berry here, but also possible with other healing Berries or Cheek Pouch - describe.skip(`Unnerve Desync Glitch`, function () { - beforeEach(function () { + describe.skip(`Unnerve Desync Glitch`, () => { + beforeEach(() => { battle = common.createBattle([[ // 18 HP on Wynaut - {species: 'Wynaut', level: 3, ivs: {hp: 0}, ability: 'dazzling', item: 'oranberry', moves: ['bellydrum', 'flamethrower']}, - {species: 'Aggron', moves: ['sleeptalk']}, + { species: 'Wynaut', level: 3, ivs: { hp: 0 }, ability: 'dazzling', item: 'oranberry', moves: ['bellydrum', 'flamethrower'] }, + { species: 'Aggron', moves: ['sleeptalk'] }, ], [ - {species: 'Mewtwo', ability: 'unnerve', item: 'laggingtail', moves: ['explosion']}, - {species: 'Celesteela', moves: ['tackle', 'poweruppunch', 'quickattack', 'roar']}, + { species: 'Mewtwo', ability: 'unnerve', item: 'laggingtail', moves: ['explosion'] }, + { species: 'Celesteela', moves: ['tackle', 'poweruppunch', 'quickattack', 'roar'] }, ]]); battle.makeChoices(); assert.false.fainted(battle.p1.active[0], `Wynaut should not have fainted.`); battle.choose('p2', 'switch celesteela'); }); - it(`should allow the undead Pokemon to switch back in after "fainting"`, function () { + it(`should allow the undead Pokemon to switch back in after "fainting"`, () => { battle.makeChoices(); // "KO" Wynaut battle.choose('p1', 'switch aggron'); assert.false.cantMove(() => battle.choose('p1', 'switch wynaut')); }); - it(`should make attacks used against the undead Pokemon fail due to lack of target`, function () { + it(`should make attacks used against the undead Pokemon fail due to lack of target`, () => { battle.makeChoices(); // "KO" Wynaut battle.choose('p1', 'switch aggron'); battle.makeChoices('switch wynaut', 'move poweruppunch'); @@ -55,7 +55,7 @@ describe(`Unnerve`, function () { assert.equal(move.pp, move.maxpp - 1); }); - it(`should allow some passive abilities on the undead Pokemon to work normally`, function () { + it(`should allow some passive abilities on the undead Pokemon to work normally`, () => { battle.makeChoices(); // "KO" Wynaut battle.choose('p1', 'switch aggron'); battle.makeChoices('switch wynaut', 'move quickattack'); @@ -63,7 +63,7 @@ describe(`Unnerve`, function () { assert(dazzlingIndex > 0, `Undead Dazzling should have still blocked Quick Attack`); }); - it(`should allow the undead Pokemon to choose to switch, but the turn will be skipped`, function () { + it(`should allow the undead Pokemon to choose to switch, but the turn will be skipped`, () => { battle.makeChoices(); // "KO" Wynaut battle.choose('p1', 'switch aggron'); battle.makeChoices('switch wynaut', 'auto'); @@ -71,7 +71,7 @@ describe(`Unnerve`, function () { assert.species(battle.p1.active[0], 'Wynaut'); }); - it(`should allow the undead Pokemon to choose moves, but the turn will be skipped`, function () { + it(`should allow the undead Pokemon to choose moves, but the turn will be skipped`, () => { battle.makeChoices(); // "KO" Wynaut battle.choose('p1', 'switch aggron'); battle.makeChoices('switch wynaut', 'auto'); @@ -80,7 +80,7 @@ describe(`Unnerve`, function () { assert.equal(move.pp, move.maxpp); }); - it(`should allow the undead Pokemon to choose to Dynamax, but the turn will be skipped`, function () { + it(`should allow the undead Pokemon to choose to Dynamax, but the turn will be skipped`, () => { battle.makeChoices(); // "KO" Wynaut battle.choose('p1', 'switch aggron'); battle.makeChoices('switch wynaut', 'auto'); diff --git a/test/sim/abilities/victorystar.js b/test/sim/abilities/victorystar.js index 85a64f34ab..5468246967 100644 --- a/test/sim/abilities/victorystar.js +++ b/test/sim/abilities/victorystar.js @@ -5,53 +5,53 @@ const common = require('./../../common'); let battle; -describe("Victory Star", function () { - afterEach(function () { +describe("Victory Star", () => { + afterEach(() => { battle.destroy(); }); - it(`can boost accuracy twice if both the user and ally have the ability`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Victini', ability: 'victorystar', moves: ['hypnosis']}, - {species: 'Wynaut', ability: 'victorystar', moves: ['poltergeist']}, + it(`can boost accuracy twice if both the user and ally have the ability`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Victini', ability: 'victorystar', moves: ['hypnosis'] }, + { species: 'Wynaut', ability: 'victorystar', moves: ['poltergeist'] }, ], [ - {species: 'Dratini', moves: ['poltergeist']}, - {species: 'Avalugg', moves: ['poltergeist']}, + { species: 'Dratini', moves: ['poltergeist'] }, + { species: 'Avalugg', moves: ['poltergeist'] }, ]]); - battle.onEvent('Accuracy', battle.format, function (accuracy) { + battle.onEvent('Accuracy', battle.format, accuracy => { assert.equal(accuracy, 73); }); battle.makeChoices(); }); - it(`should not boost the accuracy of opponents`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Victini', ability: 'victorystar', moves: ['sleeptalk']}, - {species: 'Wynaut', ability: 'victorystar', moves: ['sleeptalk']}, + it(`should not boost the accuracy of opponents`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Victini', ability: 'victorystar', moves: ['sleeptalk'] }, + { species: 'Wynaut', ability: 'victorystar', moves: ['sleeptalk'] }, ], [ - {species: 'Dratini', moves: ['hypnosis']}, - {species: 'Avalugg', moves: ['sleeptalk']}, + { species: 'Dratini', moves: ['hypnosis'] }, + { species: 'Avalugg', moves: ['sleeptalk'] }, ]]); - battle.onEvent('Accuracy', battle.format, function (accuracy) { + battle.onEvent('Accuracy', battle.format, accuracy => { assert.equal(accuracy, 60); }); battle.makeChoices(); }); - it(`should boost accuracy even when used against allies`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Victini', ability: 'victorystar', moves: ['sleeptalk']}, - {species: 'Wynaut', ability: 'victorystar', moves: ['irontail']}, + it(`should boost accuracy even when used against allies`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Victini', ability: 'victorystar', moves: ['sleeptalk'] }, + { species: 'Wynaut', ability: 'victorystar', moves: ['irontail'] }, ], [ - {species: 'Dratini', moves: ['sleeptalk']}, - {species: 'Avalugg', moves: ['sleeptalk']}, + { species: 'Dratini', moves: ['sleeptalk'] }, + { species: 'Avalugg', moves: ['sleeptalk'] }, ]]); - battle.onEvent('Accuracy', battle.format, function (accuracy) { + battle.onEvent('Accuracy', battle.format, accuracy => { assert.equal(accuracy, 91); }); diff --git a/test/sim/abilities/wanderingspirit.js b/test/sim/abilities/wanderingspirit.js index 92ef78ba92..ab43689016 100644 --- a/test/sim/abilities/wanderingspirit.js +++ b/test/sim/abilities/wanderingspirit.js @@ -5,36 +5,36 @@ const common = require('./../../common'); let battle; -describe('Wandering Spirit', function () { +describe('Wandering Spirit', () => { afterEach(() => battle.destroy()); - it(`should exchange abilities with an attacker that makes contact`, function () { + it(`should exchange abilities with an attacker that makes contact`, () => { battle = common.createBattle([[ - {species: 'Decidueye', ability: 'overgrow', moves: ['shadowsneak']}, + { species: 'Decidueye', ability: 'overgrow', moves: ['shadowsneak'] }, ], [ - {species: 'Runerigus', ability: 'wanderingspirit', moves: ['sleeptalk']}, + { species: 'Runerigus', ability: 'wanderingspirit', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.p1.active[0].hasAbility('wanderingspirit')); assert(battle.p2.active[0].hasAbility('overgrow')); }); - it(`should not activate while Dynamaxed`, function () { + it(`should not activate while Dynamaxed`, () => { battle = common.gen(8).createBattle([[ - {species: 'Decidueye', ability: 'overgrow', moves: ['shadowsneak']}, + { species: 'Decidueye', ability: 'overgrow', moves: ['shadowsneak'] }, ], [ - {species: 'Runerigus', ability: 'wanderingspirit', moves: ['bodypress']}, + { species: 'Runerigus', ability: 'wanderingspirit', moves: ['bodypress'] }, ]]); battle.makeChoices('auto', 'move bodypress dynamax'); assert(battle.p1.active[0].hasAbility('overgrow')); assert(battle.p2.active[0].hasAbility('wanderingspirit')); }); - it(`should not swap with Wonder Guard`, function () { + it(`should not swap with Wonder Guard`, () => { battle = common.createBattle([[ - {species: 'Shedinja', ability: 'wonderguard', moves: ['shadowsneak']}, + { species: 'Shedinja', ability: 'wonderguard', moves: ['shadowsneak'] }, ], [ - {species: 'Runerigus', ability: 'wanderingspirit', moves: ['sleeptalk']}, + { species: 'Runerigus', ability: 'wanderingspirit', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.p1.active[0].hasAbility('wonderguard')); diff --git a/test/sim/abilities/windrider.js b/test/sim/abilities/windrider.js index 7a3dd7f9eb..ae09eeb1ee 100644 --- a/test/sim/abilities/windrider.js +++ b/test/sim/abilities/windrider.js @@ -5,14 +5,14 @@ const common = require('./../../common'); let battle; -const WIND_RIDER_MON = {species: 'brambleghast', ability: 'windrider', moves: ['sleeptalk']}; +const WIND_RIDER_MON = { species: 'brambleghast', ability: 'windrider', moves: ['sleeptalk'] }; describe("Wind Rider", () => { afterEach(() => battle.destroy()); it("should nullify Wind attacks and boost the target's Attack by 1", () => { battle = common.createBattle([[ - {species: 'azumarill', item: 'widelens', ability: 'thickfat', moves: ['icywind']}, + { species: 'azumarill', item: 'widelens', ability: 'thickfat', moves: ['icywind'] }, ], [ WIND_RIDER_MON, ]]); @@ -25,7 +25,7 @@ describe("Wind Rider", () => { it("should be bypassed by Mold Breaker", () => { battle = common.createBattle([[ - {species: 'veluza', item: 'widelens', ability: 'moldbreaker', moves: ['icywind']}, + { species: 'veluza', item: 'widelens', ability: 'moldbreaker', moves: ['icywind'] }, ], [ WIND_RIDER_MON, ]]); @@ -36,7 +36,7 @@ describe("Wind Rider", () => { it("should not interact with Sandstorm", () => { battle = common.createBattle([[ - {species: 'flittle', ability: 'frisk', moves: ['sandstorm']}, + { species: 'flittle', ability: 'frisk', moves: ['sandstorm'] }, ], [ WIND_RIDER_MON, ]]); @@ -46,12 +46,12 @@ describe("Wind Rider", () => { }); it("should activate when Tailwind is used on the Pokemon's side", () => { - battle = common.createBattle({gameType: "doubles"}, [[ - {species: 'magikarp', ability: 'swiftswim', moves: ['splash']}, - {species: 'magikarp', ability: 'swiftswim', moves: ['splash']}, + battle = common.createBattle({ gameType: "doubles" }, [[ + { species: 'magikarp', ability: 'swiftswim', moves: ['splash'] }, + { species: 'magikarp', ability: 'swiftswim', moves: ['splash'] }, ], [ WIND_RIDER_MON, - {species: 'pelipper', ability: 'keeneye', moves: ['tailwind']}, + { species: 'pelipper', ability: 'keeneye', moves: ['tailwind'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'atk', 1); @@ -59,9 +59,9 @@ describe("Wind Rider", () => { it("should activate on switch-in if Tailwind is active on the Pokemon's side", () => { battle = common.createBattle([[ - {species: 'magikarp', ability: 'swiftswim', moves: ['splash']}, + { species: 'magikarp', ability: 'swiftswim', moves: ['splash'] }, ], [ - {species: 'pelipper', ability: 'keeneye', moves: ['tailwind']}, + { species: 'pelipper', ability: 'keeneye', moves: ['tailwind'] }, WIND_RIDER_MON, ]]); battle.makeChoices(); diff --git a/test/sim/abilities/wonderguard.js b/test/sim/abilities/wonderguard.js index f2103d36c9..1deb660b2b 100644 --- a/test/sim/abilities/wonderguard.js +++ b/test/sim/abilities/wonderguard.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Wonder Guard', function () { - afterEach(function () { +describe('Wonder Guard', () => { + afterEach(() => { battle.destroy(); }); - it('should make the user immune to damaging attacks that are not super effective', function () { + it('should make the user immune to damaging attacks that are not super effective', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Aerodactyl", ability: 'wonderguard', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['knockoff', 'flamethrower', 'thousandarrows', 'moonblast']}]}); + battle.setPlayer('p1', { team: [{ species: "Aerodactyl", ability: 'wonderguard', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['knockoff', 'flamethrower', 'thousandarrows', 'moonblast'] }] }); for (let i = 1; i <= 4; i++) { battle.makeChoices('move sleeptalk', 'move ' + i); assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); @@ -22,10 +22,10 @@ describe('Wonder Guard', function () { assert.false.hurts(battle.p1.active[0], () => battle.makeChoices('move sleeptalk', 'move thousandarrows')); }); - it('should not make the user immune to status moves', function () { + it('should not make the user immune to status moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Abra", ability: 'wonderguard', moves: ['teleport']}]}); - battle.setPlayer('p2', {team: [{species: "Smeargle", ability: 'noguard', moves: ['poisongas', 'screech', 'healpulse', 'gastroacid']}]}); + battle.setPlayer('p1', { team: [{ species: "Abra", ability: 'wonderguard', moves: ['teleport'] }] }); + battle.setPlayer('p2', { team: [{ species: "Smeargle", ability: 'noguard', moves: ['poisongas', 'screech', 'healpulse', 'gastroacid'] }] }); const wwTarget = battle.p1.active[0]; battle.makeChoices('move teleport', 'move poisongas'); assert.equal(wwTarget.status, 'psn'); @@ -37,10 +37,10 @@ describe('Wonder Guard', function () { assert.false(wwTarget.hasAbility('wonderguard')); }); - it('should be suppressed by Mold Breaker', function () { + it('should be suppressed by Mold Breaker', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Zekrom", ability: 'wonderguard', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: "Reshiram", ability: 'turboblaze', moves: ['fusionflare']}]}); + battle.setPlayer('p1', { team: [{ species: "Zekrom", ability: 'wonderguard', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: "Reshiram", ability: 'turboblaze', moves: ['fusionflare'] }] }); assert.hurts(battle.p1.active[0], () => battle.makeChoices('move sleeptalk', 'move fusionflare')); }); }); diff --git a/test/sim/abilities/zenmode.js b/test/sim/abilities/zenmode.js index 40b782b270..5d2d0bbdd7 100644 --- a/test/sim/abilities/zenmode.js +++ b/test/sim/abilities/zenmode.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Zen Mode', function () { - afterEach(function () { +describe('Zen Mode', () => { + afterEach(() => { battle.destroy(); }); - it(`can't be overriden in Gen 7 or later`, function () { + it(`can't be overriden in Gen 7 or later`, () => { battle = common.createBattle([[ - {species: "Darmanitan", ability: 'zenmode', moves: ['entrainment']}, + { species: "Darmanitan", ability: 'zenmode', moves: ['entrainment'] }, ], [ - {species: "Wynaut", ability: 'swiftswim', moves: ['skillswap', 'entrainment']}, + { species: "Wynaut", ability: 'swiftswim', moves: ['skillswap', 'entrainment'] }, ]]); const darm = battle.p1.active[0]; @@ -25,11 +25,11 @@ describe('Zen Mode', function () { assert.equal(darm.ability, 'zenmode'); }); - it(`can be overriden in Gen 6 and earlier`, function () { + it(`can be overriden in Gen 6 and earlier`, () => { battle = common.gen(6).createBattle([[ - {species: "Darmanitan", ability: 'zenmode', moves: ['entrainment', 'sleeptalk']}, + { species: "Darmanitan", ability: 'zenmode', moves: ['entrainment', 'sleeptalk'] }, ], [ - {species: "Wynaut", ability: 'swiftswim', moves: ['skillswap', 'entrainment']}, + { species: "Wynaut", ability: 'swiftswim', moves: ['skillswap', 'entrainment'] }, ]]); const darm = battle.p1.active[0]; diff --git a/test/sim/choice-parser.js b/test/sim/choice-parser.js index e5b15a1edd..8d6dfd030d 100644 --- a/test/sim/choice-parser.js +++ b/test/sim/choice-parser.js @@ -5,13 +5,13 @@ const common = require('./../common'); let battle; -describe('Choice parser', function () { +describe('Choice parser', () => { afterEach(() => battle.destroy()); - describe('Team Preview requests', function () { - it('should accept only `team` choices', function () { - battle = common.createBattle({preview: true}, [ - [{species: "Mew", ability: 'synchronize', moves: ['recover']}], - [{species: "Rhydon", ability: 'prankster', moves: ['splash']}], + describe('Team Preview requests', () => { + it('should accept only `team` choices', () => { + battle = common.createBattle({ preview: true }, [ + [{ species: "Mew", ability: 'synchronize', moves: ['recover'] }], + [{ species: "Rhydon", ability: 'prankster', moves: ['splash'] }], ]); const validChoice = 'team 1'; @@ -26,10 +26,10 @@ describe('Choice parser', function () { } }); - it('should reject non-numerical choice details', function () { - battle = common.createBattle({preview: true}, [ - [{species: "Mew", ability: 'synchronize', moves: ['recover']}], - [{species: "Rhydon", ability: 'prankster', moves: ['splash']}], + it('should reject non-numerical choice details', () => { + battle = common.createBattle({ preview: true }, [ + [{ species: "Mew", ability: 'synchronize', moves: ['recover'] }], + [{ species: "Rhydon", ability: 'prankster', moves: ['splash'] }], ]); for (const side of battle.sides) { @@ -39,31 +39,31 @@ describe('Choice parser', function () { } }); - it('should reject zero-based choice details', function () { - battle = common.createBattle({preview: true}, [ - [{species: "Mew", ability: 'synchronize', moves: ['recover']}], - [{species: "Rhydon", ability: 'prankster', moves: ['splash']}], + it('should reject zero-based choice details', () => { + battle = common.createBattle({ preview: true }, [ + [{ species: "Mew", ability: 'synchronize', moves: ['recover'] }], + [{ species: "Rhydon", ability: 'prankster', moves: ['splash'] }], ]); for (const side of battle.sides) { assert.throws( () => battle.choose(side.id, 'team 0'), - new RegExp(`\\[Invalid choice\\] Can't choose for Team Preview:`, 'i'), + /\[Invalid choice\] Can't choose for Team Preview:/i, `Input should have been rejected` ); } }); }); - describe('Switch requests', function () { - describe('Generic', function () { - it('should reject non-numerical input for `switch` choices', function () { + describe('Switch requests', () => { + describe('Generic', () => { + it('should reject non-numerical input for `switch` choices', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Mew", ability: 'synchronize', moves: ['lunardance']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl']}, - ]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", ability: 'prankster', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [ + { species: "Mew", ability: 'synchronize', moves: ['lunardance'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", ability: 'prankster', moves: ['splash'] }] }); battle.makeChoices('move lunardance', 'move splash'); @@ -72,14 +72,14 @@ describe('Choice parser', function () { }); }); - describe('Singles', function () { - it('should accept only `switch` choices', function () { + describe('Singles', () => { + it('should accept only `switch` choices', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Mew", ability: 'synchronize', moves: ['lunardance']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl']}, - ]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", ability: 'prankster', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [ + { species: "Mew", ability: 'synchronize', moves: ['lunardance'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", ability: 'prankster', moves: ['splash'] }] }); battle.makeChoices('move lunardance', 'move splash'); @@ -94,19 +94,19 @@ describe('Choice parser', function () { }); }); - describe('Doubles/Triples', function () { - it('should accept only `switch` and `pass` choices', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Ekans", ability: 'shedskin', moves: ['wrap']}, - ]}); + describe('Doubles/Triples', () => { + it('should accept only `switch` and `pass` choices', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Ekans", ability: 'shedskin', moves: ['wrap'] }, + ] }); battle.makeChoices('move selfdestruct, move selfdestruct', 'move roost, move irondefense'); // Both p1 active Pokémon faint const badChoices = ['move 1', 'move 2 mega', 'team 1', 'shift']; @@ -117,18 +117,18 @@ describe('Choice parser', function () { assert(battle.p1.choose(`pass, switch 3`), `Choice 'pass, switch 3' should be valid`); }); - it('should reject choice details for `pass` choices', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Ekans", ability: 'shedskin', moves: ['wrap']}, - ]}); + it('should reject choice details for `pass` choices', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Ekans", ability: 'shedskin', moves: ['wrap'] }, + ] }); battle.makeChoices('move selfdestruct, move selfdestruct', 'move roost, move irondefense'); // Both p1 active Pokémon faint const switchChoice = 'switch 3'; @@ -140,14 +140,14 @@ describe('Choice parser', function () { assert.throws(() => battle.choose('p1', `${passChoice} a, ${switchChoice}`)); }); - it.skip(`should only allow switching to left slots on double KOs with only one Pokemon remaining`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'tornadus', moves: ['sleeptalk']}, - {species: 'landorus', moves: ['earthquake']}, + it.skip(`should only allow switching to left slots on double KOs with only one Pokemon remaining`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'tornadus', moves: ['sleeptalk'] }, + { species: 'landorus', moves: ['earthquake'] }, ], [ - {species: 'roggenrola', level: 1, moves: ['sleeptalk']}, - {species: 'aron', level: 1, moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'roggenrola', level: 1, moves: ['sleeptalk'] }, + { species: 'aron', level: 1, moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.throws(() => battle.choose('p2', 'pass, switch 3'), 'Wynaut should only be able to switch on the left.'); @@ -155,28 +155,28 @@ describe('Choice parser', function () { }); }); - describe('Move requests', function () { - describe('Generic', function () { - it('should reject `pass` choices for non-fainted Pokémon', function () { + describe('Move requests', () => { + describe('Generic', () => { + it('should reject `pass` choices for non-fainted Pokémon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['recover']}]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", ability: 'prankster', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['recover'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", ability: 'prankster', moves: ['splash'] }] }); for (const side of battle.sides) { assert.throws(() => battle.choose(side.id, 'pass')); } }); - it('should allow mega evolving and targeting in the same move in either order', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Gengar", ability: 'cursedbody', item: 'gengarite', moves: ['shadowball']}, - {species: "Zigzagoon", ability: 'pickup', moves: ['tackle']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Blaziken", ability: 'blaze', item: 'firiumz', moves: ['blazekick']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - ]}); + it('should allow mega evolving and targeting in the same move in either order', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Gengar", ability: 'cursedbody', item: 'gengarite', moves: ['shadowball'] }, + { species: "Zigzagoon", ability: 'pickup', moves: ['tackle'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Blaziken", ability: 'blaze', item: 'firiumz', moves: ['blazekick'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + ] }); const badChoices = [`move 1 1 2`, `move 1 1 mega ultra`, `move 1 mega zmove 2`]; for (const badChoice of badChoices) { @@ -188,11 +188,11 @@ describe('Choice parser', function () { assert(battle.choose('p2', `move Blaze Kick zmove 1, move irondefense`)); }); - it('should allow Dynamax use in multiple possible formats', function () { + it('should allow Dynamax use in multiple possible formats', () => { battle = common.gen(8).createBattle([[ - {species: "Mew", moves: ['psychic']}, + { species: "Mew", moves: ['psychic'] }, ], [ - {species: "Mew", moves: ['psychic']}, + { species: "Mew", moves: ['psychic'] }, ]]); battle.makeChoices(`move max mindstorm`, `move psychic max`); @@ -200,16 +200,16 @@ describe('Choice parser', function () { assert(battle.p2.active[0].volatiles['dynamax']); }); - it('should handle Conversion 2', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Porygon-Z", ability: 'adaptability', item: 'normaliumz', moves: ['conversion', 'conversion2']}, - {species: "Porygon", ability: 'download', moves: ['conversion', 'conversion2']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Gengar", ability: 'cursedbody', moves: ['lick']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - ]}); + it('should handle Conversion 2', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Porygon-Z", ability: 'adaptability', item: 'normaliumz', moves: ['conversion', 'conversion2'] }, + { species: "Porygon", ability: 'download', moves: ['conversion', 'conversion2'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Gengar", ability: 'cursedbody', moves: ['lick'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + ] }); assert(battle.choose('p1', `move 1, move Conversion 2 2`)); assert.equal(battle.p1.getChoice(), `move conversion, move conversion2 +2`); @@ -224,17 +224,17 @@ describe('Choice parser', function () { }); }); - describe('Singles', function () { - it('should accept only `move` and `switch` choices', function () { + describe('Singles', () => { + it('should accept only `move` and `switch` choices', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Mew", ability: 'synchronize', moves: ['lunardance', 'recover']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Rhydon", ability: 'prankster', moves: ['splash', 'horndrill']}, - {species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Mew", ability: 'synchronize', moves: ['lunardance', 'recover'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Rhydon", ability: 'prankster', moves: ['splash', 'horndrill'] }, + { species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl'] }, + ] }); const validChoices = ['move 1', 'move 2', 'switch 2']; for (const action of validChoices) { @@ -249,18 +249,18 @@ describe('Choice parser', function () { }); }); - describe('Doubles', function () { - it('should enforce `pass` choices for fainted Pokémon', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - ]}); + describe('Doubles', () => { + it('should enforce `pass` choices for fainted Pokémon', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + ] }); const p1 = battle.p1; battle.makeChoices('move selfdestruct, move selfdestruct', 'move roost, move irondefense'); // Both p1 active Pokémon faint battle.makeChoices('pass, switch 3', ''); // Koffing switches in at slot #2 @@ -274,20 +274,20 @@ describe('Choice parser', function () { }); }); - describe('Triples', function () { - it('should accept only `move` and `switch` choices for a healthy Pokémon on the center', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Gastly", ability: 'levitate', moves: ['lick']}, - {species: "Forretress", ability: 'levitate', moves: ['spikes']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + describe('Triples', () => { + it('should accept only `move` and `switch` choices for a healthy Pokémon on the center', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Gastly", ability: 'levitate', moves: ['lick'] }, + { species: "Forretress", ability: 'levitate', moves: ['spikes'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); const validChoices = ['move 1', 'switch 4']; @@ -304,20 +304,20 @@ describe('Choice parser', function () { } }); - it('should accept only `move`, `switch` and `shift` choices for a healthy Pokémon on the left', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Gastly", ability: 'levitate', moves: ['lick']}, - {species: "Forretress", ability: 'levitate', moves: ['spikes']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - {species: "Magnezone", ability: 'magnetpull', moves: ['discharge']}, - ]}); + it('should accept only `move`, `switch` and `shift` choices for a healthy Pokémon on the left', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Gastly", ability: 'levitate', moves: ['lick'] }, + { species: "Forretress", ability: 'levitate', moves: ['spikes'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + { species: "Magnezone", ability: 'magnetpull', moves: ['discharge'] }, + ] }); const validChoices = ['move 1', 'switch 4', 'shift']; @@ -334,20 +334,20 @@ describe('Choice parser', function () { } }); - it('should accept only `move`, `switch` and `shift` choices for a healthy Pokémon on the right', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Gastly", ability: 'levitate', moves: ['lick']}, - {species: "Forretress", ability: 'levitate', moves: ['spikes']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - {species: "Magnezone", ability: 'magnetpull', moves: ['discharge']}, - ]}); + it('should accept only `move`, `switch` and `shift` choices for a healthy Pokémon on the right', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Gastly", ability: 'levitate', moves: ['lick'] }, + { species: "Forretress", ability: 'levitate', moves: ['spikes'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + { species: "Magnezone", ability: 'magnetpull', moves: ['discharge'] }, + ] }); const validChoices = ['move 1 1', 'switch 4', 'shift']; @@ -364,19 +364,19 @@ describe('Choice parser', function () { } }); - it('should enforce `pass` choices for fainted Pokémon', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Gastly", ability: 'levitate', moves: ['lunardance']}, - {species: "Forretress", ability: 'levitate', moves: ['spikes']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + it('should enforce `pass` choices for fainted Pokémon', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Gastly", ability: 'levitate', moves: ['lunardance'] }, + { species: "Forretress", ability: 'levitate', moves: ['spikes'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); const p1 = battle.p1; battle.makeChoices('move selfdestruct, move selfdestruct, move lunardance', 'move roost, move irondefense, move defensecurl'); // All p1 active Pokémon faint diff --git a/test/sim/data.js b/test/sim/data.js index 998ba236be..504d60a6a4 100644 --- a/test/sim/data.js +++ b/test/sim/data.js @@ -2,8 +2,8 @@ const assert = require('./../assert'); -describe('Dex data', function () { - it('should have valid Pokedex entries', function () { +describe('Dex data', () => { + it('should have valid Pokedex entries', () => { const Pokedex = Dex.data.Pokedex; for (const pokemonid in Pokedex) { const entry = Pokedex[pokemonid]; @@ -92,7 +92,7 @@ describe('Dex data', function () { if (entry.formeOrder) { for (const forme of entry.formeOrder) { if (toID(forme).includes('gmax')) continue; - // formeOrder contains other formes and 'cosmetic' formes which do not have entries in Pokedex but should have aliases + // formeOrder contains other formes and 'cosmetic' formes which do not have entries in Pokedex but should have aliases const formeEntry = Dex.species.get(toID(forme)); assert.equal(forme, formeEntry.name, `Misspelled/nonexistent forme "${forme}" of ${entry.name}`); assert(entry.formeOrder.includes(formeEntry.baseSpecies), `${entry.name}'s formeOrder does not contain its base species ${formeEntry.baseSpecies}`); @@ -117,7 +117,7 @@ describe('Dex data', function () { } }); - it('should have valid Items entries', function () { + it('should have valid Items entries', () => { const Items = Dex.data.Items; for (const itemid in Items) { const entry = Items[itemid]; @@ -126,7 +126,7 @@ describe('Dex data', function () { } }); - it('should have valid Moves entries', function () { + it('should have valid Moves entries', () => { const Moves = Dex.data.Moves; for (const moveid in Moves) { const entry = Moves[moveid]; @@ -136,7 +136,7 @@ describe('Dex data', function () { } }); - it('should have valid Abilities entries', function () { + it('should have valid Abilities entries', () => { const Abilities = Dex.data.Abilities; for (const abilityid in Abilities) { const entry = Abilities[abilityid]; @@ -146,7 +146,7 @@ describe('Dex data', function () { } }); - it('should have valid Rulesets entries', function () { + it('should have valid Rulesets entries', () => { const Rulesets = Dex.data.Rulesets; for (const formatid in Rulesets) { const entry = Rulesets[formatid]; @@ -154,7 +154,7 @@ describe('Dex data', function () { } }); - it('should have valid Formats (slow)', function () { + it('should have valid Formats (slow)', () => { for (const format of Dex.formats.all()) { try { Dex.formats.getRuleTable(format); @@ -165,7 +165,7 @@ describe('Dex data', function () { } }); - it('should have valid Natures entries', function () { + it('should have valid Natures entries', () => { const Natures = Dex.data.Natures; for (const natureid in Natures) { const entry = Natures[natureid]; @@ -249,8 +249,8 @@ describe('Dex data', function () { // Existence function takes a Pokemon and returns yes if it exists and no otherwise // can be override for testing CAPs - function countPokemon(dex, existenceFunction = (s) => s.exists && !s.isNonstandard && s.tier !== 'Illegal') { - const count = {species: 0, formes: 0}; + function countPokemon(dex, existenceFunction = s => s.exists && !s.isNonstandard && s.tier !== 'Illegal') { + const count = { species: 0, formes: 0 }; for (const pkmn of dex.species.all()) { if (!existenceFunction(pkmn)) continue; if (pkmn.name !== pkmn.baseSpecies) { @@ -307,8 +307,8 @@ describe('Dex data', function () { // Birds (3) + Slowking (1) + Calyrex (2) // {GMax} 26 + 7 formes[8] = 17 + 5 + 1 + 1 + 1 + 3 + 3 + 7 + 14 + 8 + - 1 + 1 + 1 + 2 + 1 + 2 + 2 + 2 + 1 + 1 + 2 + 2 + 1 + - (4 + 1 + 1 + 1 + 1 + 2 + (1 + 1)) + (1 + 3 + 4 + 2 + 3 + 1 + 2); + 1 + 1 + 1 + 2 + 1 + 2 + 2 + 2 + 1 + 1 + 2 + 2 + 1 + + (4 + 1 + 1 + 1 + 1 + 2 + (1 + 1)) + (1 + 3 + 4 + 2 + 3 + 1 + 2); // Pikachu (8) + Origin (3) + Therian (4) + Alola (16) + Galar (7) + Paldea (4) + Hisui (16) + // Deoxys (3) + Rotom (5) + Shaymin (1) + Arceus (17) + Basculin (2) + Kyurem (2) + Keldeo (1) + // Meloetta (1) + Greninja (1) + Vivillon (2) + Meowstic (1) + Hoopa (1) + Oricorio (3) + Rockruff (1) + @@ -318,9 +318,9 @@ describe('Dex data', function () { // Palafin (1) + Maushold (1) + Squawkabilly (3) + Gimmighoul (1) + Basculegion (1) + // Masterpiece (2) + Ogerpon (7) + Terapagos (2) formes[9] = 8 + 3 + 4 + 16 + 7 + 4 + 16 + 3 + 5 + 1 + 17 + - 2 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + 3 + 1 + 2 + 1 + 1 + 2 + - 1 + 1 + 2 + 1 + 1 + 2 + 1 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + - 1 + 1 + 3 + 1 + 1 + 2 + 7 + 2; + 2 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + 3 + 1 + 2 + 1 + 1 + 2 + + 1 + 1 + 2 + 1 + 1 + 2 + 1 + 2 + 1 + 1 + 1 + 2 + 1 + 1 + + 1 + 1 + 3 + 1 + 1 + 2 + 7 + 2; for (const gen of [1, 2, 3, 4, 5, 6, 7, 8, 9]) { it(`Gen ${gen} should have ${species[gen]} species and ${formes[gen]} formes`, () => { diff --git a/test/sim/decisions.js b/test/sim/decisions.js index 0c650e5d4c..86b59cf715 100644 --- a/test/sim/decisions.js +++ b/test/sim/decisions.js @@ -7,107 +7,107 @@ const BASE_TEAM_ORDER = [1, 2, 3, 4, 5, 6]; const SINGLES_TEAMS = { illusion: [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Charmander', ability: 'blaze', moves: ['tackle']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['tackle']}, - {species: 'Zoroark', ability: 'illusion', moves: ['tackle']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Charmander', ability: 'blaze', moves: ['tackle'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['tackle'] }, + { species: 'Zoroark', ability: 'illusion', moves: ['tackle'] }, ], [ - {species: 'Squirtle', ability: 'torrent', moves: ['tackle']}, - {species: 'Wartortle', ability: 'torrent', moves: ['tackle']}, + { species: 'Squirtle', ability: 'torrent', moves: ['tackle'] }, + { species: 'Wartortle', ability: 'torrent', moves: ['tackle'] }, ]], full: [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Charmander', ability: 'blaze', moves: ['tackle']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['tackle']}, - {species: 'Charizard', ability: 'blaze', moves: ['tackle']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Charmander', ability: 'blaze', moves: ['tackle'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['tackle'] }, + { species: 'Charizard', ability: 'blaze', moves: ['tackle'] }, ], [ - {species: 'Squirtle', ability: 'torrent', moves: ['tackle']}, - {species: 'Wartortle', ability: 'torrent', moves: ['tackle']}, + { species: 'Squirtle', ability: 'torrent', moves: ['tackle'] }, + { species: 'Wartortle', ability: 'torrent', moves: ['tackle'] }, ]], }; const DOUBLES_TEAMS = { forcePass: [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['lunardance']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'levitate', moves: ['roost']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['lunardance'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'levitate', moves: ['roost'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Clefable', ability: 'unaware', moves: ['recover']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Clefable', ability: 'unaware', moves: ['recover'] }, ]], full: [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Charmander', ability: 'blaze', moves: ['tackle']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['tackle']}, - {species: 'Charizard', ability: 'blaze', moves: ['tackle']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Charmander', ability: 'blaze', moves: ['tackle'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['tackle'] }, + { species: 'Charizard', ability: 'blaze', moves: ['tackle'] }, ], [ - {species: 'Squirtle', ability: 'torrent', moves: ['tackle']}, - {species: 'Wartortle', ability: 'torrent', moves: ['tackle']}, + { species: 'Squirtle', ability: 'torrent', moves: ['tackle'] }, + { species: 'Wartortle', ability: 'torrent', moves: ['tackle'] }, ]], default: [[ - {species: 'Latias', ability: 'overgrow', moves: ['lunardance']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Bulbasaur', ability: 'levitate', moves: ['synthesis']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + { species: 'Latias', ability: 'overgrow', moves: ['lunardance'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Bulbasaur', ability: 'levitate', moves: ['synthesis'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Clefable', ability: 'unaware', moves: ['recover']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Clefable', ability: 'unaware', moves: ['recover'] }, ]], }; const TRIPLES_TEAMS = { forcePass: [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['synthesis']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['synthesis'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Clefable', ability: 'unaware', moves: ['recover']}, - {species: 'Latias', ability: 'blaze', moves: ['roost']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Clefable', ability: 'unaware', moves: ['recover'] }, + { species: 'Latias', ability: 'blaze', moves: ['roost'] }, ]], full: [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Charmander', ability: 'blaze', moves: ['tackle']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['tackle']}, - {species: 'Charizard', ability: 'blaze', moves: ['tackle']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Charmander', ability: 'blaze', moves: ['tackle'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['tackle'] }, + { species: 'Charizard', ability: 'blaze', moves: ['tackle'] }, ], [ - {species: 'Squirtle', ability: 'torrent', moves: ['tackle']}, - {species: 'Wartortle', ability: 'torrent', moves: ['tackle']}, - {species: 'Blastoise', ability: 'torrent', moves: ['tackle']}, + { species: 'Squirtle', ability: 'torrent', moves: ['tackle'] }, + { species: 'Wartortle', ability: 'torrent', moves: ['tackle'] }, + { species: 'Blastoise', ability: 'torrent', moves: ['tackle'] }, ]], default: [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'levitate', moves: ['roost']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['synthesis']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'levitate', moves: ['roost'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['synthesis'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Clefable', ability: 'unaware', moves: ['recover']}, - {species: 'Latias', ability: 'blaze', moves: ['roost']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Clefable', ability: 'unaware', moves: ['recover'] }, + { species: 'Latias', ability: 'blaze', moves: ['roost'] }, ]], }; let battle; -describe('Choices', function () { - afterEach(function () { +describe('Choices', () => { + afterEach(() => { battle.destroy(); }); - describe('Generic', function () { - it('should wait for players to send their choices and run them as soon as they are all received', function (done) { + describe('Generic', () => { + it('should wait for players to send their choices and run them as soon as they are all received', done => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['recover']}]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", ability: 'prankster', moves: ['sketch']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['recover'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", ability: 'prankster', moves: ['sketch'] }] }); setTimeout(() => { battle.choose('p2', 'move 1'); @@ -120,12 +120,12 @@ describe('Choices', function () { }); }); - describe('Move requests', function () { - it('should allow specifying moves', function () { + describe('Move requests', () => { + it('should allow specifying moves', () => { const MOVES = [['growl', 'tackle'], ['growl', 'scratch']]; battle = common.createBattle([ - [{species: "Bulbasaur", ability: 'Overgrow', moves: MOVES[0]}], - [{species: "Charmander", ability: 'Blaze', moves: MOVES[1]}], + [{ species: "Bulbasaur", ability: 'Overgrow', moves: MOVES[0] }], + [{ species: "Charmander", ability: 'Blaze', moves: MOVES[1] }], ]); const activeMons = battle.sides.map(side => side.active[0]); @@ -155,13 +155,13 @@ describe('Choices', function () { } }); - it(`should allow specifying move targets`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Gastrodon", ability: 'stickyhold', moves: ['gastroacid']}, - {species: "Venusaur", ability: 'noguard', moves: ['leechseed']}, + it(`should allow specifying move targets`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Gastrodon", ability: 'stickyhold', moves: ['gastroacid'] }, + { species: "Venusaur", ability: 'noguard', moves: ['leechseed'] }, ], [ - {species: "Tyranitar", ability: 'unnerve', moves: ['knockoff']}, - {species: "Zapdos", ability: 'pressure', moves: ['glare']}], + { species: "Tyranitar", ability: 'unnerve', moves: ['knockoff'] }, + { species: "Zapdos", ability: 'pressure', moves: ['glare'] }], ]); const p2active = battle.p2.active; @@ -174,42 +174,42 @@ describe('Choices', function () { assert.equal(p2active[0].status, 'par'); }); - it('should disallow specifying move targets for targetless moves (randomNormal)', function () { - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: "Dragonite", ability: 'multiscale', moves: ['outrage']}, {species: "Blastoise", ability: 'torrent', moves: ['rest']}], - [{species: "Tyranitar", ability: 'unnerve', moves: ['dragondance']}, {species: "Zapdos", ability: 'pressure', moves: ['roost']}], + it('should disallow specifying move targets for targetless moves (randomNormal)', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: "Dragonite", ability: 'multiscale', moves: ['outrage'] }, { species: "Blastoise", ability: 'torrent', moves: ['rest'] }], + [{ species: "Tyranitar", ability: 'unnerve', moves: ['dragondance'] }, { species: "Zapdos", ability: 'pressure', moves: ['roost'] }], ]); assert.cantTarget(() => battle.p1.chooseMove('outrage', 1), 'outrage'); }); - it('should disallow specifying move targets for targetless moves (scripted)', function () { - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: "Dragonite", ability: 'multiscale', moves: ['counter']}, {species: "Blastoise", ability: 'torrent', moves: ['rest']}], - [{species: "Tyranitar", ability: 'unnerve', moves: ['bodyslam']}, {species: "Zapdos", ability: 'pressure', moves: ['drillpeck']}], + it('should disallow specifying move targets for targetless moves (scripted)', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: "Dragonite", ability: 'multiscale', moves: ['counter'] }, { species: "Blastoise", ability: 'torrent', moves: ['rest'] }], + [{ species: "Tyranitar", ability: 'unnerve', moves: ['bodyslam'] }, { species: "Zapdos", ability: 'pressure', moves: ['drillpeck'] }], ]); assert.cantTarget(() => battle.p1.chooseMove('counter', 2), 'counter'); }); - it('should disallow specifying move targets for targetless moves (self)', function () { - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: "Dragonite", ability: 'multiscale', moves: ['roost']}, {species: "Blastoise", ability: 'torrent', moves: ['rest']}], - [{species: "Tyranitar", ability: 'unnerve', moves: ['dragondance']}, {species: "Zapdos", ability: 'pressure', moves: ['roost']}], + it('should disallow specifying move targets for targetless moves (self)', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: "Dragonite", ability: 'multiscale', moves: ['roost'] }, { species: "Blastoise", ability: 'torrent', moves: ['rest'] }], + [{ species: "Tyranitar", ability: 'unnerve', moves: ['dragondance'] }, { species: "Zapdos", ability: 'pressure', moves: ['roost'] }], ]); assert.cantTarget(() => battle.p1.chooseMove('roost', -2), 'roost'); }); - it('should allow specifying switch targets', function () { + it('should allow specifying switch targets', () => { battle = common.createBattle([[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('switch 2', 'switch 3'); @@ -228,18 +228,18 @@ describe('Choices', function () { assert.species(battle.p2.active[0], 'Charmeleon'); }); - it('should allow shifting the Pokémon on the left to the center', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['harden']}, - {species: "Geodude", ability: 'sturdy', moves: ['defensecurl']}, - {species: "Gastly", ability: 'levitate', moves: ['spite']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + it('should allow shifting the Pokémon on the left to the center', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['harden'] }, + { species: "Geodude", ability: 'sturdy', moves: ['defensecurl'] }, + { species: "Gastly", ability: 'levitate', moves: ['spite'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); const [p1, p2] = battle.sides; battle.makeChoices('move harden, move defensecurl, shift', 'move roost, move irondefense, shift'); @@ -251,18 +251,18 @@ describe('Choices', function () { } }); - it('should allow shifting the Pokémon on the right to the center', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['harden']}, - {species: "Geodude", ability: 'sturdy', moves: ['defensecurl']}, - {species: "Gastly", ability: 'levitate', moves: ['spite']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + it('should allow shifting the Pokémon on the right to the center', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['harden'] }, + { species: "Geodude", ability: 'sturdy', moves: ['defensecurl'] }, + { species: "Gastly", ability: 'levitate', moves: ['spite'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); battle.makeChoices('shift, default, default', 'shift, default, default'); for (const [index, species] of ['Geodude', 'Pineco', 'Gastly'].entries()) { @@ -273,18 +273,18 @@ describe('Choices', function () { } }); - it('should shift the Pokémon as a standard priority move action', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['harden']}, - {species: "Geodude", ability: 'sturdy', moves: ['suckerpunch']}, - {species: "Gastly", ability: 'levitate', moves: ['spite']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['earthquake']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + it('should shift the Pokémon as a standard priority move action', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['harden'] }, + { species: "Geodude", ability: 'sturdy', moves: ['suckerpunch'] }, + { species: "Gastly", ability: 'levitate', moves: ['spite'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['earthquake'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); battle.makeChoices('shift, move suckerpunch 2, shift', 'shift, move earthquake, shift'); for (const [index, species] of ['Gastly', 'Pineco', 'Geodude'].entries()) { @@ -301,10 +301,10 @@ describe('Choices', function () { assert.equal(battle.p2.active[1].hp, battle.p2.active[1].maxhp); }); - it('should force Struggle usage on move attempt for no valid moves', function () { + it('should force Struggle usage on move attempt for no valid moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['recover']}]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", ability: 'prankster', moves: ['sketch']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['recover'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", ability: 'prankster', moves: ['sketch'] }] }); // First turn battle.makeChoices('move 1', 'move 1'); @@ -317,10 +317,10 @@ describe('Choices', function () { assert.equal(battle.p2.active[0].lastMove.id, 'struggle'); }); - it('should not force Struggle usage on move attempt for valid moves', function () { + it('should not force Struggle usage on move attempt for valid moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['recover']}]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", ability: 'prankster', moves: ['struggle', 'surf']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['recover'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", ability: 'prankster', moves: ['struggle', 'surf'] }] }); battle.makeChoices('move recover', 'move surf'); @@ -328,10 +328,10 @@ describe('Choices', function () { assert.notEqual(battle.p2.active[0].lastMove.id, 'struggle'); }); - it('should not force Struggle usage on move attempt when choosing a disabled move', function () { + it('should not force Struggle usage on move attempt when choosing a disabled move', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", item: 'assaultvest', ability: 'synchronize', moves: ['recover', 'icebeam']}]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", item: '', ability: 'prankster', moves: ['surf']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", item: 'assaultvest', ability: 'synchronize', moves: ['recover', 'icebeam'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", item: '', ability: 'prankster', moves: ['surf'] }] }); const failingAttacker = battle.p1.active[0]; battle.p2.chooseMove(1); @@ -344,10 +344,10 @@ describe('Choices', function () { assert.notEqual(failingAttacker.lastMove && failingAttacker.lastMove.id, 'struggle'); }); - it('should send meaningful feedback to players if they try to use a disabled move', function () { - battle = common.createBattle({strictChoices: false}); - battle.setPlayer('p1', {team: [{species: "Skarmory", ability: 'sturdy', moves: ['spikes', 'roost']}]}); - battle.setPlayer('p2', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['imprison', 'spikes']}]}); + it('should send meaningful feedback to players if they try to use a disabled move', () => { + battle = common.createBattle({ strictChoices: false }); + battle.setPlayer('p1', { team: [{ species: "Skarmory", ability: 'sturdy', moves: ['spikes', 'roost'] }] }); + battle.setPlayer('p2', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['imprison', 'spikes'] }] }); battle.makeChoices('move spikes', 'move imprison'); @@ -361,13 +361,13 @@ describe('Choices', function () { assert(buffer.some(message => message.startsWith('p1\n|request|') && JSON.parse(message.slice(12)).active[0].moves[0].disabled)); }); - it('should send meaningful feedback to players if they try to switch a trapped Pokémon out', function () { - battle = common.createBattle({strictChoices: false}); - battle.setPlayer('p1', {team: [ - {species: "Scizor", ability: 'swarm', moves: ['bulletpunch']}, - {species: "Azumarill", ability: 'sapsipper', moves: ['aquajet']}, - ]}); - battle.setPlayer('p2', {team: [{species: "Gothitelle", ability: 'shadowtag', moves: ['calmmind']}]}); + it('should send meaningful feedback to players if they try to switch a trapped Pokémon out', () => { + battle = common.createBattle({ strictChoices: false }); + battle.setPlayer('p1', { team: [ + { species: "Scizor", ability: 'swarm', moves: ['bulletpunch'] }, + { species: "Azumarill", ability: 'sapsipper', moves: ['aquajet'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: "Gothitelle", ability: 'shadowtag', moves: ['calmmind'] }] }); const buffer = []; battle.send = (type, data) => { @@ -380,16 +380,16 @@ describe('Choices', function () { }); }); - describe('Switch requests', function () { - it('should allow specifying switch targets', function () { + describe('Switch requests', () => { + it('should allow specifying switch targets', () => { battle = common.createBattle([[ - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Latias', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Latias', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('move lunardance', 'move lunardance'); @@ -399,15 +399,15 @@ describe('Choices', function () { assert.species(battle.p2.active[0], 'Charizard'); }); - it('should allow passing when there are not enough available switch-ins', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['lunardance']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + it('should allow passing when there are not enough available switch-ins', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['lunardance'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Latias', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Latias', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('move lunardance, move lunardance', 'move lunardance, move lunardance'); @@ -426,17 +426,17 @@ describe('Choices', function () { assert.fainted(battle.p2.active[1]); }); - it('should allow passing when there are not enough available switch-ins even if an active Pokémon is not fainted', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + it('should allow passing when there are not enough available switch-ins even if an active Pokémon is not fainted', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('move tackle 2, move healingwish, move lunardance', 'move scratch 2, move healingwish, move lunardance'); @@ -452,17 +452,17 @@ describe('Choices', function () { } }); - it('should disallow passing when there are enough available switch-ins', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Bulbasaur', ability: 'overgrow', moves: ['lunardance']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + it('should disallow passing when there are enough available switch-ins', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['lunardance'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Latias', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charmander', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Latias', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charmander', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('move lunardance, move lunardance', 'move lunardance, move lunardance'); @@ -487,23 +487,23 @@ describe('Choices', function () { }); }); - describe('Team Preview requests', function () { - it('should allow specifying the team order', function () { + describe('Team Preview requests', () => { + it('should allow specifying the team order', () => { const TEAMS = [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]; for (let i = 0; i < 10; i++) { const teamOrder = [BASE_TEAM_ORDER, BASE_TEAM_ORDER].map(teamOrder => Utils.shuffle(teamOrder.slice(0, 4))); - battle = common.createBattle({preview: true}, TEAMS); + battle = common.createBattle({ preview: true }, TEAMS); battle.makeChoices(`team ${teamOrder[0].join('')}`, `team ${teamOrder[1].join('')}`); for (const [index, pokemon] of battle.p1.pokemon.entries()) { assert.species(pokemon, TEAMS[0][teamOrder[0][index] - 1].species); @@ -516,10 +516,10 @@ describe('Choices', function () { } }); - it('should autocomplete a single-slot choice in Singles', function () { + it('should autocomplete a single-slot choice in Singles', () => { // Backwards-compatibility with the client. It should be useful for 3rd party bots/clients (Android?) for (let i = 0; i < 5; i++) { - battle = common.createBattle({preview: true}, SINGLES_TEAMS.full); + battle = common.createBattle({ preview: true }, SINGLES_TEAMS.full); const teamOrder = Utils.shuffle(BASE_TEAM_ORDER.slice()).slice(0, 1); const fullTeamOrder = teamOrder.concat(BASE_TEAM_ORDER.filter(elem => !teamOrder.includes(elem))); @@ -533,9 +533,9 @@ describe('Choices', function () { } }); - it('should allow specifying the team order in a slot-per-slot basis in Singles with Illusion', function () { + it('should allow specifying the team order in a slot-per-slot basis in Singles with Illusion', () => { for (let i = 0; i < 5; i++) { - battle = common.createBattle({preview: true}, SINGLES_TEAMS.illusion); + battle = common.createBattle({ preview: true }, SINGLES_TEAMS.illusion); const teamOrder = Utils.shuffle(BASE_TEAM_ORDER.slice()); battle.makeChoices(`team ${teamOrder.join('')}`, 'default'); @@ -548,9 +548,9 @@ describe('Choices', function () { } }); - it('should allow specifying the team order in a slot-per-slot basis in Doubles', function () { + it('should allow specifying the team order in a slot-per-slot basis in Doubles', () => { for (let i = 0; i < 5; i++) { - battle = common.createBattle({preview: true, gameType: 'doubles'}, DOUBLES_TEAMS.full); + battle = common.createBattle({ preview: true, gameType: 'doubles' }, DOUBLES_TEAMS.full); const teamOrder = Utils.shuffle(BASE_TEAM_ORDER.slice()); battle.makeChoices(`team ${teamOrder.join('')}`, 'default'); @@ -563,9 +563,9 @@ describe('Choices', function () { } }); - it('should allow specifying the team order in a slot-per-slot basis in Triples', function () { + it('should allow specifying the team order in a slot-per-slot basis in Triples', () => { for (let i = 0; i < 5; i++) { - battle = common.gen(5).createBattle({preview: true, gameType: 'triples'}, TRIPLES_TEAMS.full); + battle = common.gen(5).createBattle({ preview: true, gameType: 'triples' }, TRIPLES_TEAMS.full); const teamOrder = Utils.shuffle(BASE_TEAM_ORDER.slice()); battle.makeChoices(`team ${teamOrder.join('')}`, 'default'); @@ -578,9 +578,9 @@ describe('Choices', function () { } }); - it('should autocomplete multi-slot choices', function () { + it('should autocomplete multi-slot choices', () => { for (let i = 0; i < 5; i++) { - battle = common.createBattle({preview: true}, SINGLES_TEAMS.full); + battle = common.createBattle({ preview: true }, SINGLES_TEAMS.full); const teamOrder = Utils.shuffle(BASE_TEAM_ORDER.slice()).slice(0, 2); const fullTeamOrder = teamOrder.concat(BASE_TEAM_ORDER.filter(elem => !teamOrder.includes(elem))); @@ -595,11 +595,11 @@ describe('Choices', function () { }); }); - describe('Logging', function () { - it('should privately log the ID of chosen moves', function () { + describe('Logging', () => { + it('should privately log the ID of chosen moves', () => { battle = common.createBattle([ - [{species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl']}], - [{species: "Charmander", ability: 'blaze', moves: ['scratch', 'growl']}], + [{ species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl'] }], + [{ species: "Charmander", ability: 'blaze', moves: ['scratch', 'growl'] }], ]); battle.makeChoices('move 1', 'move growl'); @@ -608,13 +608,13 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should privately log the target of targetted chosen moves', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle']}, - {species: "Ivysaur", ability: 'overgrow', moves: ['tackle']}, + it('should privately log the target of targetted chosen moves', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle'] }, + { species: "Ivysaur", ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: "Charmander", ability: 'blaze', moves: ['scratch']}, - {species: "Charizard", ability: 'blaze', moves: ['scratch']}, + { species: "Charmander", ability: 'blaze', moves: ['scratch'] }, + { species: "Charizard", ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('move tackle +1, move tackle +2', 'move scratch +2, move scratch +1'); @@ -623,13 +623,13 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should not log the target of targetless chosen moves', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Bulbasaur", ability: 'overgrow', moves: ['magnitude']}, - {species: "Ivysaur", ability: 'overgrow', moves: ['rockslide']}, + it('should not log the target of targetless chosen moves', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Bulbasaur", ability: 'overgrow', moves: ['magnitude'] }, + { species: "Ivysaur", ability: 'overgrow', moves: ['rockslide'] }, ], [ - {species: "Charmander", ability: 'blaze', moves: ['scratch']}, - {species: "Charizard", ability: 'blaze', moves: ['scratch']}, + { species: "Charmander", ability: 'blaze', moves: ['scratch'] }, + { species: "Charizard", ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('move magnitude, move rockslide', 'move scratch +1, move scratch +1'); @@ -638,10 +638,10 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should privately log the user intention of mega evolving', function () { + it('should privately log the user intention of mega evolving', () => { battle = common.createBattle([ - [{species: "Venusaur", item: 'venusaurite', ability: 'overgrow', moves: ['tackle']}], - [{species: "Blastoise", item: 'blastoisinite', ability: 'blaze', moves: ['tailwhip']}], + [{ species: "Venusaur", item: 'venusaurite', ability: 'overgrow', moves: ['tackle'] }], + [{ species: "Blastoise", item: 'blastoisinite', ability: 'blaze', moves: ['tailwhip'] }], ]); battle.makeChoices('move tackle mega', 'move tailwhip mega'); @@ -650,10 +650,10 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should privately log the user intention of mega evolving for Mega-X and Mega-Y', function () { + it('should privately log the user intention of mega evolving for Mega-X and Mega-Y', () => { battle = common.createBattle([ - [{species: "Charizard", item: 'charizarditex', ability: 'blaze', moves: ['scratch']}], - [{species: "Charizard", item: 'charizarditey', ability: 'blaze', moves: ['ember']}], + [{ species: "Charizard", item: 'charizarditex', ability: 'blaze', moves: ['scratch'] }], + [{ species: "Charizard", item: 'charizarditey', ability: 'blaze', moves: ['ember'] }], ]); battle.makeChoices('move scratch mega', 'move ember mega'); @@ -662,15 +662,15 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should privately log the target of switches', function () { + it('should privately log the target of switches', () => { battle = common.createBattle([[ - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle']}, - {species: "Ivysaur", ability: 'overgrow', moves: ['tackle']}, - {species: "Venusaur", ability: 'overgrow', moves: ['tackle']}, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle'] }, + { species: "Ivysaur", ability: 'overgrow', moves: ['tackle'] }, + { species: "Venusaur", ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: "Charmander", ability: 'blaze', moves: ['scratch']}, - {species: "Charmeleon", ability: 'blaze', moves: ['scratch']}, - {species: "Charizard", ability: 'blaze', moves: ['scratch']}, + { species: "Charmander", ability: 'blaze', moves: ['scratch'] }, + { species: "Charmeleon", ability: 'blaze', moves: ['scratch'] }, + { species: "Charizard", ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('switch 2', 'switch 3'); @@ -680,17 +680,17 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should privately log the team order chosen', function () { - battle = common.createBattle({preview: true}, [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + it('should privately log the team order chosen', () => { + battle = common.createBattle({ preview: true }, [[ + { species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Latias', ability: 'blaze', moves: ['lunardance']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Latias', ability: 'blaze', moves: ['lunardance'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]); battle.makeChoices('team 1342', 'team 1234'); @@ -700,18 +700,18 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should privately log shifting decisions for the Pokémon on the left', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['harden']}, - {species: "Geodude", ability: 'sturdy', moves: ['defensecurl']}, - {species: "Gastly", ability: 'levitate', moves: ['haze']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + it('should privately log shifting decisions for the Pokémon on the left', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['harden'] }, + { species: "Geodude", ability: 'sturdy', moves: ['defensecurl'] }, + { species: "Gastly", ability: 'levitate', moves: ['haze'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); battle.makeChoices('shift, move defensecurl, move haze', 'move roost, move irondefense, move defensecurl'); const logText = battle.inputLog.join('\n'); @@ -719,18 +719,18 @@ describe('Choices', function () { assert(logText.includes(subString), `${logText} does not include ${subString}`); }); - it('should privately log shifting decisions for the Pokémon on the right', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['harden']}, - {species: "Geodude", ability: 'sturdy', moves: ['defensecurl']}, - {species: "Gastly", ability: 'levitate', moves: ['haze']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + it('should privately log shifting decisions for the Pokémon on the right', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['harden'] }, + { species: "Geodude", ability: 'sturdy', moves: ['defensecurl'] }, + { species: "Gastly", ability: 'levitate', moves: ['haze'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); battle.makeChoices('move harden, move defensecurl, shift', 'move roost, move irondefense, move defensecurl'); @@ -741,14 +741,14 @@ describe('Choices', function () { }); }); -describe('Choice extensions', function () { - describe('Undo', function () { +describe('Choice extensions', () => { + describe('Undo', () => { const MODES = ['revoke', 'override']; for (const mode of MODES) { - it(`should disallow to ${mode} decisions after every player has sent an unrevoked action`, function () { - battle = common.createBattle({cancel: true}); - battle.setPlayer('p1', {team: [{species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl']}]}); - battle.setPlayer('p2', {team: [{species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl']}]}); + it(`should disallow to ${mode} decisions after every player has sent an unrevoked action`, () => { + battle = common.createBattle({ cancel: true }); + battle.setPlayer('p1', { team: [{ species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl'] }] }); + battle.setPlayer('p2', { team: [{ species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl'] }] }); battle.choose('p1', 'move tackle'); battle.choose('p2', 'move growl'); @@ -762,10 +762,10 @@ describe('Choice extensions', function () { assert.equal(battle.p2.active[0].lastMove.id, 'growl'); }); - it(`should support to ${mode} move decisions`, function () { - battle = common.createBattle({cancel: true}); - battle.setPlayer('p1', {team: [{species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl']}]}); - battle.setPlayer('p2', {team: [{species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl']}]}); + it(`should support to ${mode} move decisions`, () => { + battle = common.createBattle({ cancel: true }); + battle.setPlayer('p1', { team: [{ species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl'] }] }); + battle.setPlayer('p2', { team: [{ species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl'] }] }); battle.choose('p1', 'move tackle'); assert(!battle.p1.activeRequest.noCancel); @@ -776,10 +776,10 @@ describe('Choice extensions', function () { assert.equal(battle.p1.active[0].lastMove.id, 'growl'); }); - it(`should disallow to ${mode} move decisions for maybe-disabled Pokémon`, function () { - battle = common.createBattle({cancel: true}); - battle.setPlayer('p1', {team: [{species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl', 'synthesis']}]}); - battle.setPlayer('p2', {team: [{species: "Charmander", ability: 'blaze', moves: ['scratch']}]}); + it(`should disallow to ${mode} move decisions for maybe-disabled Pokémon`, () => { + battle = common.createBattle({ cancel: true }); + battle.setPlayer('p1', { team: [{ species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl', 'synthesis'] }] }); + battle.setPlayer('p2', { team: [{ species: "Charmander", ability: 'blaze', moves: ['scratch'] }] }); const target = battle.p1.active[0]; target.maybeDisabled = true; @@ -795,10 +795,10 @@ describe('Choice extensions', function () { assert.equal(target.lastMove.id, 'tackle'); }); - it(`should disallow to ${mode} move decisions by default`, function () { + it(`should disallow to ${mode} move decisions by default`, () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl']}]}); - battle.setPlayer('p2', {team: [{species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl']}]}); + battle.setPlayer('p1', { team: [{ species: "Bulbasaur", ability: 'overgrow', moves: ['tackle', 'growl'] }] }); + battle.setPlayer('p2', { team: [{ species: "Charmander", ability: 'blaze', moves: ['tackle', 'growl'] }] }); battle.choose('p1', 'move tackle'); assert(battle.p1.activeRequest.noCancel); @@ -811,15 +811,15 @@ describe('Choice extensions', function () { assert.equal(battle.p2.active[0].lastMove.id, 'growl'); }); - it(`should support to ${mode} switch decisions on move requests`, function () { + it(`should support to ${mode} switch decisions on move requests`, () => { const TEAMS = [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['synthesis']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['synthesis'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, ]]; - battle = common.createBattle({cancel: true}, TEAMS); + battle = common.createBattle({ cancel: true }, TEAMS); battle.choose('p1', 'switch 2'); assert(!battle.p1.activeRequest.noCancel); @@ -832,7 +832,7 @@ describe('Choice extensions', function () { assert.equal(battle.p1.active[0].lastMove.id, 'synthesis'); battle.destroy(); - battle = common.createBattle({cancel: true}, TEAMS); + battle = common.createBattle({ cancel: true }, TEAMS); battle.choose('p1', 'switch 2'); assert(!battle.p1.activeRequest.noCancel); @@ -844,14 +844,14 @@ describe('Choice extensions', function () { } }); - it(`should disallow to ${mode} switch decisions on move requests for maybe-trapped Pokémon`, function () { + it(`should disallow to ${mode} switch decisions on move requests for maybe-trapped Pokémon`, () => { const TEAMS = [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, ]]; - battle = common.createBattle({cancel: true}, TEAMS); + battle = common.createBattle({ cancel: true }, TEAMS); battle.p1.active[0].maybeTrapped = true; battle.makeRequest(); @@ -866,15 +866,15 @@ describe('Choice extensions', function () { assert.species(battle.p1.active[0], 'Ivysaur'); }); - it(`should disallow to ${mode} switch decisions on move requests for unconfirmed trapping-immune Pokémon that would otherwise be trapped`, function () { - battle = common.createBattle({cancel: true, pokemon: true, legality: true}, [ + it(`should disallow to ${mode} switch decisions on move requests for unconfirmed trapping-immune Pokémon that would otherwise be trapped`, () => { + battle = common.createBattle({ cancel: true, pokemon: true, legality: true }, [ [ - {species: 'Starmie', ability: 'naturalcure', moves: ['reflecttype', 'recover']}, - {species: 'Mandibuzz', ability: 'overcoat', moves: ['knockoff']}, - ], [ - {species: 'Zoroark', ability: 'illusion', moves: ['shadowball, focusblast']}, - {species: 'Gothitelle', ability: 'competitive', moves: ['calmmind']}, - {species: 'Gengar', ability: 'levitate', moves: ['shadowball, focusblast']}, + { species: 'Starmie', ability: 'naturalcure', moves: ['reflecttype', 'recover'] }, + { species: 'Mandibuzz', ability: 'overcoat', moves: ['knockoff'] }, + ], [ + { species: 'Zoroark', ability: 'illusion', moves: ['shadowball, focusblast'] }, + { species: 'Gothitelle', ability: 'competitive', moves: ['calmmind'] }, + { species: 'Gengar', ability: 'levitate', moves: ['shadowball, focusblast'] }, ], ]); const target = battle.p1.active[0]; @@ -901,13 +901,13 @@ describe('Choice extensions', function () { assert.species(battle.p1.active[0], 'Mandibuzz'); }); - it(`should disallow to ${mode} switch decisions on move requests by default`, function () { + it(`should disallow to ${mode} switch decisions on move requests by default`, () => { const TEAMS = [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['synthesis']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['synthesis'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, ]]; battle = common.createBattle(TEAMS); @@ -935,17 +935,17 @@ describe('Choice extensions', function () { } }); - it(`should support to ${mode} shift decisions on move requests`, function () { + it(`should support to ${mode} shift decisions on move requests`, () => { const TEAMS = [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['synthesis']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['synthesis'] }, ], [ - {species: 'Aggron', ability: 'sturdy', moves: ['irondefense']}, - {species: 'Aggron', ability: 'sturdy', moves: ['irondefense']}, - {species: 'Aggron', ability: 'sturdy', moves: ['irondefense']}, + { species: 'Aggron', ability: 'sturdy', moves: ['irondefense'] }, + { species: 'Aggron', ability: 'sturdy', moves: ['irondefense'] }, + { species: 'Aggron', ability: 'sturdy', moves: ['irondefense'] }, ]]; - battle = common.gen(5).createBattle({gameType: 'triples', cancel: true}, TEAMS); + battle = common.gen(5).createBattle({ gameType: 'triples', cancel: true }, TEAMS); battle.choose('p1', 'shift, move 1, move 1'); assert(!battle.p1.activeRequest.noCancel); @@ -958,7 +958,7 @@ describe('Choice extensions', function () { assert.equal(battle.p1.active[0].lastMove.id, 'synthesis'); battle.destroy(); - battle = common.gen(5).createBattle({gameType: 'triples', cancel: true}, TEAMS); + battle = common.gen(5).createBattle({ gameType: 'triples', cancel: true }, TEAMS); battle.choose('p1', 'move 1, move 1, shift'); assert(!battle.p1.activeRequest.noCancel); @@ -971,17 +971,17 @@ describe('Choice extensions', function () { assert.equal(battle.p1.active[2].lastMove.id, 'synthesis'); }); - it(`should disallow to ${mode} shift decisions by default`, function () { + it(`should disallow to ${mode} shift decisions by default`, () => { const TEAMS = [[ - {species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['growth']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['synthesis']}, + { species: 'Bulbasaur', ability: 'overgrow', moves: ['synthesis'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['growth'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['synthesis'] }, ], [ - {species: 'Aggron', ability: 'sturdy', moves: ['irondefense']}, - {species: 'Aggron', ability: 'sturdy', moves: ['irondefense']}, - {species: 'Aggron', ability: 'sturdy', moves: ['irondefense']}, + { species: 'Aggron', ability: 'sturdy', moves: ['irondefense'] }, + { species: 'Aggron', ability: 'sturdy', moves: ['irondefense'] }, + { species: 'Aggron', ability: 'sturdy', moves: ['irondefense'] }, ]]; - battle = common.gen(5).createBattle({gameType: 'triples'}, TEAMS); + battle = common.gen(5).createBattle({ gameType: 'triples' }, TEAMS); battle.choose('p1', 'shift, move 1, move 1'); assert(battle.p1.activeRequest.noCancel); @@ -995,7 +995,7 @@ describe('Choice extensions', function () { assert.equal(battle.p1.active[0].lastMove.id, 'growth'); battle.destroy(); - battle = common.gen(5).createBattle({gameType: 'triples'}, TEAMS); + battle = common.gen(5).createBattle({ gameType: 'triples' }, TEAMS); battle.choose('p1', 'move 1, move 1, shift'); assert(battle.p1.activeRequest.noCancel); @@ -1009,17 +1009,17 @@ describe('Choice extensions', function () { assert.equal(battle.p1.active[2].lastMove.id, 'growth'); }); - it(`should support to ${mode} switch decisions on double switch requests`, function () { - battle = common.createBattle({cancel: true}); - battle.setPlayer('p1', {team: [ - {species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle']}, - {species: "Chikorita", ability: 'overgrow', moves: ['tackle']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Caterpie", ability: 'shielddust', moves: ['tackle']}, - {species: "Charmander", ability: 'blaze', moves: ['tackle']}, - ]}); + it(`should support to ${mode} switch decisions on double switch requests`, () => { + battle = common.createBattle({ cancel: true }); + battle.setPlayer('p1', { team: [ + { species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle'] }, + { species: "Chikorita", ability: 'overgrow', moves: ['tackle'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Caterpie", ability: 'shielddust', moves: ['tackle'] }, + { species: "Charmander", ability: 'blaze', moves: ['tackle'] }, + ] }); battle.makeChoices('move explosion', 'move tackle'); @@ -1033,18 +1033,18 @@ describe('Choice extensions', function () { assert.equal(battle.p2.active[0].species.name, 'Charmander'); }); - it(`should support to ${mode} pass decisions on double switch requests`, function () { - battle = common.createBattle({cancel: true, gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle']}, - {species: "Chikorita", ability: 'overgrow', moves: ['tackle']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Caterpie", ability: 'shielddust', moves: ['tackle']}, - {species: "Charmander", ability: 'blaze', moves: ['tackle']}, - {species: "Cyndaquil", ability: 'blaze', moves: ['tackle']}, - ]}); + it(`should support to ${mode} pass decisions on double switch requests`, () => { + battle = common.createBattle({ cancel: true, gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle'] }, + { species: "Chikorita", ability: 'overgrow', moves: ['tackle'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Caterpie", ability: 'shielddust', moves: ['tackle'] }, + { species: "Charmander", ability: 'blaze', moves: ['tackle'] }, + { species: "Cyndaquil", ability: 'blaze', moves: ['tackle'] }, + ] }); battle.makeChoices('move explosion, move tackle 1', 'move tackle 1, move tackle 1'); @@ -1058,19 +1058,19 @@ describe('Choice extensions', function () { } }); - it(`should disallow to ${mode} switch decisions on switch requests by default`, function () { + it(`should disallow to ${mode} switch decisions on switch requests by default`, () => { const TEAMS = [[ - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Clefable', ability: 'unaware', moves: ['healingwish']}, - {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Clefable', ability: 'unaware', moves: ['healingwish'] }, + { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]; - battle = common.createBattle({gameType: 'doubles', cancel: true}, TEAMS); + battle = common.createBattle({ gameType: 'doubles', cancel: true }, TEAMS); battle.makeChoices('move lunardance, move healingwish', 'move scratch 1, move scratch 1'); battle.choose('p1', 'switch 3, switch 4'); @@ -1087,18 +1087,18 @@ describe('Choice extensions', function () { } }); - it(`should disallow to ${mode} pass decisions on switch requests by default`, function () { + it(`should disallow to ${mode} pass decisions on switch requests by default`, () => { const TEAMS = [[ - {species: 'Latias', ability: 'levitate', moves: ['lunardance']}, - {species: 'Clefable', ability: 'overgrow', moves: ['healingwish']}, - {species: 'Venusaur', ability: 'overgrow', moves: ['tackle']}, + { species: 'Latias', ability: 'levitate', moves: ['lunardance'] }, + { species: 'Clefable', ability: 'overgrow', moves: ['healingwish'] }, + { species: 'Venusaur', ability: 'overgrow', moves: ['tackle'] }, ], [ - {species: 'Charmander', ability: 'blaze', moves: ['scratch']}, - {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}, - {species: 'Charizard', ability: 'blaze', moves: ['scratch']}, + { species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }, + { species: 'Charizard', ability: 'blaze', moves: ['scratch'] }, ]]; - battle = common.createBattle({gameType: 'doubles'}, TEAMS); + battle = common.createBattle({ gameType: 'doubles' }, TEAMS); battle.makeChoices('move lunardance, move healingwish', 'move scratch 1, move scratch 1'); battle.choose('p1', 'pass, switch 3'); @@ -1115,17 +1115,17 @@ describe('Choice extensions', function () { } }); - it(`should disallow to ${mode} switch decisions on double switch requests by default`, function () { + it(`should disallow to ${mode} switch decisions on double switch requests by default`, () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle']}, - {species: "Chikorita", ability: 'overgrow', moves: ['tackle']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Caterpie", ability: 'shielddust', moves: ['tackle']}, - {species: "Charmander", ability: 'blaze', moves: ['tackle']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle'] }, + { species: "Chikorita", ability: 'overgrow', moves: ['tackle'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Caterpie", ability: 'shielddust', moves: ['tackle'] }, + { species: "Charmander", ability: 'blaze', moves: ['tackle'] }, + ] }); battle.makeChoices('move explosion', 'move tackle'); @@ -1139,18 +1139,18 @@ describe('Choice extensions', function () { assert.species(battle.p2.active[0], 'Charmander'); }); - it(`should disallow to ${mode} pass decisions on double switch requests by default`, function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['tackle']}, - {species: "Chikorita", ability: 'overgrow', moves: ['tackle']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Caterpie", ability: 'shielddust', moves: ['tackle']}, - {species: "Charmander", ability: 'blaze', moves: ['tackle']}, - {species: "Cyndaquil", ability: 'blaze', moves: ['tackle']}, - ]}); + it(`should disallow to ${mode} pass decisions on double switch requests by default`, () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Deoxys-Attack", ability: 'pressure', moves: ['explosion'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['tackle'] }, + { species: "Chikorita", ability: 'overgrow', moves: ['tackle'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Caterpie", ability: 'shielddust', moves: ['tackle'] }, + { species: "Charmander", ability: 'blaze', moves: ['tackle'] }, + { species: "Cyndaquil", ability: 'blaze', moves: ['tackle'] }, + ] }); battle.makeChoices('move explosion, move tackle 1', 'move tackle 1, move tackle 1'); @@ -1165,10 +1165,10 @@ describe('Choice extensions', function () { } }); - it(`should support to ${mode} team order action on team preview requests`, function () { - battle = common.createBattle({preview: true, cancel: true}, [ - [{species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}], - [{species: 'Charmander', ability: 'blaze', moves: ['scratch']}, {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}], + it(`should support to ${mode} team order action on team preview requests`, () => { + battle = common.createBattle({ preview: true, cancel: true }, [ + [{ species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }], + [{ species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }], ]); battle.choose('p1', 'team 12'); @@ -1181,9 +1181,9 @@ describe('Choice extensions', function () { } battle.destroy(); - battle = common.createBattle({preview: true, cancel: true}, [ - [{species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}], - [{species: 'Charmander', ability: 'blaze', moves: ['scratch']}, {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}], + battle = common.createBattle({ preview: true, cancel: true }, [ + [{ species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }], + [{ species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }], ]); battle.choose('p1', 'team 21'); @@ -1196,10 +1196,10 @@ describe('Choice extensions', function () { } }); - it(`should disallow to ${mode} team order action on team preview requests by default`, function () { - battle = common.createBattle({preview: true}, [ - [{species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle']}, {species: 'Ivysaur', ability: 'overgrow', moves: ['tackle']}], - [{species: 'Charmander', ability: 'blaze', moves: ['scratch']}, {species: 'Charmeleon', ability: 'blaze', moves: ['scratch']}], + it(`should disallow to ${mode} team order action on team preview requests by default`, () => { + battle = common.createBattle({ preview: true }, [ + [{ species: 'Bulbasaur', ability: 'overgrow', moves: ['tackle'] }, { species: 'Ivysaur', ability: 'overgrow', moves: ['tackle'] }], + [{ species: 'Charmander', ability: 'blaze', moves: ['scratch'] }, { species: 'Charmeleon', ability: 'blaze', moves: ['scratch'] }], ]); battle.choose('p1', 'team 12'); @@ -1216,21 +1216,21 @@ describe('Choice extensions', function () { }); }); -describe('Choice internals', function () { - afterEach(function () { +describe('Choice internals', () => { + afterEach(() => { battle.destroy(); }); - it('should allow input of move commands in a per Pokémon basis', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Mew", ability: 'synchronize', moves: ['recover']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['growl', 'synthesis']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Pupitar", ability: 'shedskin', moves: ['surf']}, // faster than Bulbasaur - {species: "Arceus", ability: 'multitype', moves: ['calmmind']}, - ]}); + it('should allow input of move commands in a per Pokémon basis', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Mew", ability: 'synchronize', moves: ['recover'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['growl', 'synthesis'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Pupitar", ability: 'shedskin', moves: ['surf'] }, // faster than Bulbasaur + { species: "Arceus", ability: 'multitype', moves: ['calmmind'] }, + ] }); const [p1, p2] = battle.sides; assert.equal(battle.turn, 1); @@ -1263,18 +1263,18 @@ describe('Choice internals', function () { assert.fullHP(p1.active[1]); }); - it('should allow input of switch commands in a per Pokémon basis', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Mew", ability: 'synchronize', moves: ['selfdestruct']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['selfdestruct']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - {species: "Ekans", ability: 'shedskin', moves: ['leer']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Deoxys-Defense", ability: 'pressure', moves: ['recover']}, - {species: "Arceus", ability: 'multitype', moves: ['recover']}, - ]}); + it('should allow input of switch commands in a per Pokémon basis', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Mew", ability: 'synchronize', moves: ['selfdestruct'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['selfdestruct'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + { species: "Ekans", ability: 'shedskin', moves: ['leer'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Deoxys-Defense", ability: 'pressure', moves: ['recover'] }, + { species: "Arceus", ability: 'multitype', moves: ['recover'] }, + ] }); const [p1, p2] = battle.sides; assert.equal(battle.turn, 1); @@ -1294,18 +1294,18 @@ describe('Choice internals', function () { assert.equal(p1.active[1].name, 'Koffing'); }); - it('should allow input of move and switch commands in a per Pokémon basis', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Mew", ability: 'synchronize', moves: ['recover']}, - {species: "Bulbasaur", ability: 'overgrow', moves: ['growl', 'synthesis']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - {species: "Ekans", ability: 'shedskin', moves: ['leer']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Deoxys-Defense", ability: 'pressure', moves: ['recover']}, - {species: "Arceus", ability: 'multitype', moves: ['recover']}, - ]}); + it('should allow input of move and switch commands in a per Pokémon basis', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Mew", ability: 'synchronize', moves: ['recover'] }, + { species: "Bulbasaur", ability: 'overgrow', moves: ['growl', 'synthesis'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + { species: "Ekans", ability: 'shedskin', moves: ['leer'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Deoxys-Defense", ability: 'pressure', moves: ['recover'] }, + { species: "Arceus", ability: 'multitype', moves: ['recover'] }, + ] }); const [p1, p2] = battle.sides; assert.equal(battle.turn, 1); @@ -1336,17 +1336,17 @@ describe('Choice internals', function () { assert.equal(p1.active[1].name, 'Ekans'); }); - it('should empty the actions list when undoing a move', function () { - battle = common.createBattle({gameType: 'doubles', cancel: true}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - ]}); + it('should empty the actions list when undoing a move', () => { + battle = common.createBattle({ gameType: 'doubles', cancel: true }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + ] }); const p1 = battle.p1; p1.chooseMove(1); @@ -1360,17 +1360,17 @@ describe('Choice internals', function () { assert.fainted(p1.active[1]); }); - it('should empty the actions list when undoing a switch', function () { - battle = common.createBattle({gameType: 'doubles', cancel: true}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - ]}); + it('should empty the actions list when undoing a switch', () => { + battle = common.createBattle({ gameType: 'doubles', cancel: true }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + ] }); const p1 = battle.p1; battle.makeChoices('move selfdestruct, move selfdestruct', 'move roost, move irondefense'); @@ -1385,17 +1385,17 @@ describe('Choice internals', function () { assert.species(p1.active[1], 'Koffing'); }); - it('should empty the actions list when undoing a pass', function () { - battle = common.createBattle({gameType: 'doubles', cancel: true}); - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Koffing", ability: 'levitate', moves: ['smog']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - ]}); + it('should empty the actions list when undoing a pass', () => { + battle = common.createBattle({ gameType: 'doubles', cancel: true }); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Koffing", ability: 'levitate', moves: ['smog'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + ] }); const p1 = battle.p1; battle.makeChoices('move selfdestruct, move selfdestruct', 'move roost, move irondefense'); @@ -1410,19 +1410,19 @@ describe('Choice internals', function () { assert.species(p1.active[1], 'Koffing'); }); - it('should empty the actions list when undoing a shift', function () { - battle = common.gen(5).createBattle({gameType: 'triples', cancel: true}); + it('should empty the actions list when undoing a shift', () => { + battle = common.gen(5).createBattle({ gameType: 'triples', cancel: true }); battle.supportCancel = true; - battle.setPlayer('p1', {team: [ - {species: "Pineco", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Geodude", ability: 'sturdy', moves: ['selfdestruct']}, - {species: "Gastly", ability: 'levitate', moves: ['lick']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Skarmory", ability: 'sturdy', moves: ['roost']}, - {species: "Aggron", ability: 'sturdy', moves: ['irondefense']}, - {species: "Golem", ability: 'sturdy', moves: ['defensecurl']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Pineco", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Geodude", ability: 'sturdy', moves: ['selfdestruct'] }, + { species: "Gastly", ability: 'levitate', moves: ['lick'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Skarmory", ability: 'sturdy', moves: ['roost'] }, + { species: "Aggron", ability: 'sturdy', moves: ['irondefense'] }, + { species: "Golem", ability: 'sturdy', moves: ['defensecurl'] }, + ] }); const p1 = battle.p1; p1.chooseShift(); @@ -1437,4 +1437,3 @@ describe('Choice internals', function () { assert.false.fainted(p1.active[1]); }); }); - diff --git a/test/sim/dex.js b/test/sim/dex.js index a23e736869..e08e63ce01 100644 --- a/test/sim/dex.js +++ b/test/sim/dex.js @@ -2,8 +2,8 @@ const assert = require('./../assert'); -describe('Mod loader', function () { - it('should always provide accurate gen information', function () { +describe('Mod loader', () => { + it('should always provide accurate gen information', () => { { const Dex = require('./../../dist/sim/dex').Dex; assert.equal(Dex.mod('gen2').gen, 2); @@ -11,7 +11,7 @@ describe('Mod loader', function () { } }); - it('should work fine in any order', function () { + it('should work fine in any order', () => { { const Dex = require('./../../dist/sim/dex').Dex; assert.equal(Dex.mod('gen2').species.getLearnsetData('nidoking').learnset.bubblebeam.join(','), '1M'); @@ -27,33 +27,33 @@ describe('Mod loader', function () { }); }); -describe('Dex#getEffect', function () { - it('returns the same object for the same id', function () { +describe('Dex#getEffect', () => { + it('returns the same object for the same id', () => { assert.equal(Dex.conditions.get('Stealth Rock'), Dex.conditions.get('stealthrock')); assert.notEqual(Dex.conditions.get('move: Stealth Rock'), Dex.conditions.get('stealthrock')); }); - it('does not return elements from the Object prototype', function () { + it('does not return elements from the Object prototype', () => { assert.false(Dex.conditions.get('constructor').exists); }); }); -describe('Dex#getSpecies', function () { - it('should handle cosmetic Flabébé formes', function () { +describe('Dex#getSpecies', () => { + it('should handle cosmetic Flabébé formes', () => { assert.equal(Dex.species.get('Flabébé-yellow').name, 'Flabébé-Yellow'); }); - it('should handle Minior-Meteor formes', function () { + it('should handle Minior-Meteor formes', () => { assert(!Dex.species.get('Minior-Meteor').isNonstandard); assert(Dex.forGen(8).species.get('Minior-Meteor').isNonstandard); assert(!Dex.forGen(7).species.get('Minior-Meteor').isNonstandard); }); - it('should handle Rockruff-Dusk', function () { + it('should handle Rockruff-Dusk', () => { assert.equal(Dex.species.get('rockruffdusk').name, 'Rockruff-Dusk'); }); - it('should handle Pikachu forme numbering', function () { + it('should handle Pikachu forme numbering', () => { assert.deepEqual( Dex.forGen(6).species.get('Pikachu').formeOrder.slice(0, 7), ["Pikachu", "Pikachu-Rock-Star", "Pikachu-Belle", "Pikachu-Pop-Star", "Pikachu-PhD", "Pikachu-Libre", "Pikachu-Cosplay"] @@ -65,8 +65,8 @@ describe('Dex#getSpecies', function () { }); }); -describe('Dex#getItem', function () { - it(`should correctly mark Gem legality`, function () { +describe('Dex#getItem', () => { + it(`should correctly mark Gem legality`, () => { assert.false(Dex.forGen(5).items.get('Normal Gem').isNonstandard); assert.false(Dex.forGen(5).items.get('Rock Gem').isNonstandard); @@ -81,8 +81,8 @@ describe('Dex#getItem', function () { }); }); -describe('Dex#getMove', function () { - it(`should correctly handle G-Max moves`, function () { +describe('Dex#getMove', () => { + it(`should correctly handle G-Max moves`, () => { assert.equal(Dex.forGen(8).moves.get('G-Max Befuddle').name, "G-Max Befuddle"); assert.equal(Dex.forGen(8).moves.get('G-Max Befuddle').gen, 8); assert.equal(Dex.forGen(8).moves.get('G-Max Befuddle').isNonstandard, "Gigantamax"); diff --git a/test/sim/events.js b/test/sim/events.js index 1877a00be9..7450a1b462 100644 --- a/test/sim/events.js +++ b/test/sim/events.js @@ -5,26 +5,26 @@ const common = require('./../common'); let battle; -describe('Battle#on', function () { - afterEach(function () { +describe('Battle#on', () => { + afterEach(() => { battle.destroy(); }); - it('should allow the addition of one or more event handlers to the battle engine', function () { + it('should allow the addition of one or more event handlers to the battle engine', () => { battle = common.createBattle([ - [{species: 'Pidgeot', ability: 'keeneye', moves: ['bulkup']}], - [{species: 'Talonflame', ability: 'galewings', moves: ['peck']}], + [{ species: 'Pidgeot', ability: 'keeneye', moves: ['bulkup'] }], + [{ species: 'Talonflame', ability: 'galewings', moves: ['peck'] }], ]); let eventCount = 0; let eventCount2 = 0; - battle.onEvent('Hit', battle.format, function () { + battle.onEvent('Hit', battle.format, () => { eventCount++; }); - battle.onEvent('Hit', battle.format, function () { + battle.onEvent('Hit', battle.format, () => { eventCount++; eventCount2++; }); - battle.onEvent('ModifyDamage', battle.format, function () { + battle.onEvent('ModifyDamage', battle.format, () => { return 5; }); battle.makeChoices('move bulkup', 'move peck'); @@ -33,10 +33,10 @@ describe('Battle#on', function () { assert.equal(battle.p1.active[0].maxhp - battle.p1.active[0].hp, 5); }); - it('should support and resolve priorities correctly', function () { + it('should support and resolve priorities correctly', () => { battle = common.createBattle([ - [{species: 'Pidgeot', ability: 'keeneye', moves: ['bulkup']}], - [{species: 'Talonflame', ability: 'galewings', moves: ['peck']}], + [{ species: 'Pidgeot', ability: 'keeneye', moves: ['bulkup'] }], + [{ species: 'Talonflame', ability: 'galewings', moves: ['peck'] }], ]); let eventCount = 0; const modHandler = function (count) { @@ -52,10 +52,10 @@ describe('Battle#on', function () { assert.equal(eventCount, 9); }); - it('should throw if a callback is not given for the event handler', function () { + it('should throw if a callback is not given for the event handler', () => { battle = common.createBattle([ - [{species: 'Pidgeot', ability: 'keeneye', moves: ['bulkup']}], - [{species: 'Talonflame', ability: 'galewings', moves: ['peck']}], + [{ species: 'Pidgeot', ability: 'keeneye', moves: ['bulkup'] }], + [{ species: 'Talonflame', ability: 'galewings', moves: ['peck'] }], ]); assert.throws(battle.onEvent, TypeError); assert.throws(() => { battle.onEvent('Hit'); }, TypeError); diff --git a/test/sim/items/abilityshield.js b/test/sim/items/abilityshield.js index 13ba509080..8e34535481 100644 --- a/test/sim/items/abilityshield.js +++ b/test/sim/items/abilityshield.js @@ -5,16 +5,16 @@ const common = require('../../common'); let battle; -describe('Ability Shield', function () { - afterEach(function () { +describe('Ability Shield', () => { + afterEach(() => { battle.destroy(); }); - it(`should protect the holder's ability against ability-changing moves`, function () { + it(`should protect the holder's ability against ability-changing moves`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['splash']}, + { species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['splash'] }, ], [ - {species: 'weezinggalar', ability: 'levitate', moves: ['worryseed']}, + { species: 'weezinggalar', ability: 'levitate', moves: ['worryseed'] }, ]]); battle.makeChoices(); @@ -22,11 +22,11 @@ describe('Ability Shield', function () { assert.equal(battle.p1.active[0].ability, 'shadowtag', `Holder should retain ability`); }); - it(`should protect the holder's ability against ability-changing abilities`, function () { + it(`should protect the holder's ability against ability-changing abilities`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['tackle']}, + { species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['tackle'] }, ], [ - {species: 'weezinggalar', ability: 'mummy', moves: ['splash']}, + { species: 'weezinggalar', ability: 'mummy', moves: ['splash'] }, ]]); battle.makeChoices(); @@ -34,11 +34,11 @@ describe('Ability Shield', function () { assert.equal(battle.p1.active[0].ability, 'shadowtag', `Holder should retain ability`); }); - it(`should only protect the holder`, function () { + it(`should only protect the holder`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'mummy', item: 'abilityshield', moves: ['splash']}, + { species: 'wynaut', ability: 'mummy', item: 'abilityshield', moves: ['splash'] }, ], [ - {species: 'weezinggalar', ability: 'levitate', moves: ['tackle']}, + { species: 'weezinggalar', ability: 'levitate', moves: ['tackle'] }, ]]); battle.makeChoices(); @@ -47,11 +47,11 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9411146 - it(`should protect the holder's ability against Neutralizing Gas`, function () { + it(`should protect the holder's ability against Neutralizing Gas`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sturdy', item: 'abilityshield', moves: ['splash'], level: 5}, + { species: 'wynaut', ability: 'sturdy', item: 'abilityshield', moves: ['splash'], level: 5 }, ], [ - {species: 'weezinggalar', ability: 'neutralizinggas', moves: ['shadowball']}, + { species: 'weezinggalar', ability: 'neutralizinggas', moves: ['shadowball'] }, ]]); assert(battle.log.some(line => line.includes('Neutralizing Gas')), `Neutralizing Gas should trigger`); @@ -62,12 +62,12 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9412194 - it(`should protect the holder's ability against Mold Breaker`, function () { + it(`should protect the holder's ability against Mold Breaker`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sturdy', item: 'abilityshield', moves: ['splash'], level: 5}, - {species: 'gastly', ability: 'levitate', item: 'abilityshield', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'sturdy', item: 'abilityshield', moves: ['splash'], level: 5 }, + { species: 'gastly', ability: 'levitate', item: 'abilityshield', moves: ['sleeptalk'] }, ], [ - {species: 'weezinggalar', ability: 'moldbreaker', moves: ['shadowball', 'earthpower']}, + { species: 'weezinggalar', ability: 'moldbreaker', moves: ['shadowball', 'earthpower'] }, ]]); assert(battle.log.every(line => !line.includes('Ability Shield')), `Ability Shield should not trigger a block message`); @@ -79,11 +79,11 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9403448 - it(`should protect the holder's ability against Gastro Acid`, function () { + it(`should protect the holder's ability against Gastro Acid`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sturdy', item: 'abilityshield', moves: ['splash'], level: 5}, + { species: 'wynaut', ability: 'sturdy', item: 'abilityshield', moves: ['splash'], level: 5 }, ], [ - {species: 'weezinggalar', ability: 'levitate', moves: ['gastroacid', 'shadowball']}, + { species: 'weezinggalar', ability: 'levitate', moves: ['gastroacid', 'shadowball'] }, ]]); battle.makeChoices('move splash', 'move gastroacid'); @@ -94,11 +94,11 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9412999 - it(`should not unsuppress the holder's ability if Ability Shield is acquired after Gastro Acid has been used`, function () { + it(`should not unsuppress the holder's ability if Ability Shield is acquired after Gastro Acid has been used`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sturdy', moves: ['splash'], level: 5}, + { species: 'wynaut', ability: 'sturdy', moves: ['splash'], level: 5 }, ], [ - {species: 'weezinggalar', ability: 'levitate', item: 'abilityshield', moves: ['gastroacid', 'trick', 'shadowball']}, + { species: 'weezinggalar', ability: 'levitate', item: 'abilityshield', moves: ['gastroacid', 'trick', 'shadowball'] }, ]]); battle.makeChoices('move splash', 'move gastroacid'); @@ -108,11 +108,11 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9412999 - it(`should unsuppress the holder's ability if Ability Shield is acquired after Neutralizing Gas has come into effect`, function () { + it(`should unsuppress the holder's ability if Ability Shield is acquired after Neutralizing Gas has come into effect`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sturdy', moves: ['splash'], level: 5}, + { species: 'wynaut', ability: 'sturdy', moves: ['splash'], level: 5 }, ], [ - {species: 'weezinggalar', ability: 'neutralizinggas', item: 'abilityshield', moves: ['trick', 'shadowball']}, + { species: 'weezinggalar', ability: 'neutralizinggas', item: 'abilityshield', moves: ['trick', 'shadowball'] }, ]]); battle.makeChoices('move splash', 'move trick'); @@ -122,11 +122,11 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9412999 - it(`should not be suppressed by Klutz`, function () { + it(`should not be suppressed by Klutz`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'klutz', item: 'abilityshield', moves: ['tackle']}, + { species: 'wynaut', ability: 'klutz', item: 'abilityshield', moves: ['tackle'] }, ], [ - {species: 'weezinggalar', ability: 'mummy', moves: ['splash']}, + { species: 'weezinggalar', ability: 'mummy', moves: ['splash'] }, ]]); battle.makeChoices(); @@ -134,11 +134,11 @@ describe('Ability Shield', function () { assert.equal(battle.p1.active[0].ability, 'klutz', `Holder should retain ability`); }); - it(`should protect the holder's ability against Skill Swap`, function () { + it(`should protect the holder's ability against Skill Swap`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['splash']}, + { species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['splash'] }, ], [ - {species: 'weezinggalar', ability: 'levitate', moves: ['skillswap']}, + { species: 'weezinggalar', ability: 'levitate', moves: ['skillswap'] }, ]]); battle.makeChoices(); @@ -149,11 +149,11 @@ describe('Ability Shield', function () { assert.equal(battle.p2.active[0].ability, 'levitate', `Opponent should retain ability`); }); - it(`should protect the holder's ability against Skill Swap, even if used by the holder`, function () { + it(`should protect the holder's ability against Skill Swap, even if used by the holder`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['skillswap']}, + { species: 'wynaut', ability: 'shadowtag', item: 'abilityshield', moves: ['skillswap'] }, ], [ - {species: 'weezinggalar', ability: 'levitate', moves: ['splash']}, + { species: 'weezinggalar', ability: 'levitate', moves: ['splash'] }, ]]); battle.makeChoices(); @@ -165,11 +165,11 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9413916 - it(`should not trigger holder's Intimidate if Ability Shield is acquired after entrance, while Neutralizing Gas is in effect`, function () { + it(`should not trigger holder's Intimidate if Ability Shield is acquired after entrance, while Neutralizing Gas is in effect`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'intimidate', moves: ['splash']}, + { species: 'wynaut', ability: 'intimidate', moves: ['splash'] }, ], [ - {species: 'weezinggalar', ability: 'neutralizinggas', item: 'abilityshield', moves: ['trick']}, + { species: 'weezinggalar', ability: 'neutralizinggas', item: 'abilityshield', moves: ['trick'] }, ]]); battle.makeChoices(); @@ -177,22 +177,22 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9414273 - it(`should not trigger holder's Trace`, function () { + it(`should not trigger holder's Trace`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'trace', item: 'abilityshield', moves: ['splash']}, + { species: 'wynaut', ability: 'trace', item: 'abilityshield', moves: ['splash'] }, ], [ - {species: 'weezinggalar', ability: 'levitate', moves: ['splash']}, + { species: 'weezinggalar', ability: 'levitate', moves: ['splash'] }, ]]); assert.notEqual(battle.p1.active[0].ability, 'levitate', `Holder should not trace ability`); }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9414273 - it(`should not trigger holder's Trace even after losing the item`, function () { + it(`should not trigger holder's Trace even after losing the item`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'trace', item: 'abilityshield', moves: ['splash']}, + { species: 'wynaut', ability: 'trace', item: 'abilityshield', moves: ['splash'] }, ], [ - {species: 'weezinggalar', ability: 'levitate', moves: ['trick']}, + { species: 'weezinggalar', ability: 'levitate', moves: ['trick'] }, ]]); battle.makeChoices(); @@ -200,22 +200,22 @@ describe('Ability Shield', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9635572 - it(`should not prevent Imposter from changing the holder's ability`, function () { + it(`should not prevent Imposter from changing the holder's ability`, () => { battle = common.createBattle([[ - {species: 'ditto', ability: 'imposter', item: 'abilityshield', moves: ['transform']}, + { species: 'ditto', ability: 'imposter', item: 'abilityshield', moves: ['transform'] }, ], [ - {species: 'scorbunny', ability: 'libero', moves: ['agility']}, + { species: 'scorbunny', ability: 'libero', moves: ['agility'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].ability, 'libero', `Ditto should copy Libero`); }); - it(`should not prevent forme changes from changing the holder's ability`, function () { + it(`should not prevent forme changes from changing the holder's ability`, () => { battle = common.gen(9).createBattle([[ - {species: 'ogerpon', ability: 'defiant', item: 'abilityshield', moves: ['sleeptalk']}, + { species: 'ogerpon', ability: 'defiant', item: 'abilityshield', moves: ['sleeptalk'] }, ], [ - {species: 'scorbunny', ability: 'libero', moves: ['agility']}, + { species: 'scorbunny', ability: 'libero', moves: ['agility'] }, ]]); battle.makeChoices('move sleeptalk terastallize', 'auto'); diff --git a/test/sim/items/adrenalineorb.js b/test/sim/items/adrenalineorb.js index b3574576eb..85701d935a 100644 --- a/test/sim/items/adrenalineorb.js +++ b/test/sim/items/adrenalineorb.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe('Adrenaline Orb', function () { - afterEach(function () { +describe('Adrenaline Orb', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate even if an Ability stopped Intimidate`, function () { + it(`should activate even if an Ability stopped Intimidate`, () => { battle = common.createBattle([[ - {species: "Mamoswine", ability: 'oblivious', item: 'adrenalineorb', moves: ['sleeptalk']}, + { species: "Mamoswine", ability: 'oblivious', item: 'adrenalineorb', moves: ['sleeptalk'] }, ], [ - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'spe', 1); }); - it(`should activate even if Mist stopped Intimidate`, function () { + it(`should activate even if Mist stopped Intimidate`, () => { battle = common.createBattle([[ - {species: "Wynaut", item: 'adrenalineorb', moves: ['mist']}, + { species: "Wynaut", item: 'adrenalineorb', moves: ['mist'] }, ], [ - {species: "Shedinja", moves: ['finalgambit']}, - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Shedinja", moves: ['finalgambit'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -33,12 +33,12 @@ describe('Adrenaline Orb', function () { assert.statStage(battle.p1.active[0], 'spe', 1); }); - it(`should not activate if Substitute stopped Intimidate`, function () { + it(`should not activate if Substitute stopped Intimidate`, () => { battle = common.createBattle([[ - {species: "Wynaut", item: 'adrenalineorb', moves: ['substitute']}, + { species: "Wynaut", item: 'adrenalineorb', moves: ['substitute'] }, ], [ - {species: "Shedinja", moves: ['finalgambit']}, - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Shedinja", moves: ['finalgambit'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -46,12 +46,12 @@ describe('Adrenaline Orb', function () { assert.statStage(battle.p1.active[0], 'spe', 0); }); - it(`should not activate if the holder is at -6 Attack`, function () { + it(`should not activate if the holder is at -6 Attack`, () => { battle = common.createBattle([[ - {species: "Dugtrio", item: 'adrenalineorb', moves: ['bellydrum']}, + { species: "Dugtrio", item: 'adrenalineorb', moves: ['bellydrum'] }, ], [ - {species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy']}, - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -60,16 +60,16 @@ describe('Adrenaline Orb', function () { assert.holdsItem(battle.p1.active[0]); }); - it(`should activate if the holder is at -5 Attack`, function () { + it(`should activate if the holder is at -5 Attack`, () => { battle = common.createBattle([[ - {species: "Dugtrio", item: 'adrenalineorb', moves: ['bellydrum', 'curse', 'splash']}, + { species: "Dugtrio", item: 'adrenalineorb', moves: ['bellydrum', 'curse', 'splash'] }, ], [ - {species: "Shedinja", moves: ['splash', 'topsyturvy']}, - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Shedinja", moves: ['splash', 'topsyturvy'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); - battle.makeChoices(); //dugtrio +6 atk - battle.makeChoices('move splash', 'move topsyturvy'); //dugtrio -6 atk + battle.makeChoices(); // dugtrio +6 atk + battle.makeChoices('move splash', 'move topsyturvy'); // dugtrio -6 atk battle.makeChoices('move curse', 'move splash'); // dugtrio -5 atk and -1 speed assert.statStage(battle.p1.active[0], 'spe', -1); battle.makeChoices('move splash', 'switch 2'); // now dugtrio is at -6 and should use orb to be back at 0 speed @@ -77,12 +77,12 @@ describe('Adrenaline Orb', function () { assert.false.holdsItem(battle.p1.active[0]); }); - it(`should not activate if the holder is at +6 Speed`, function () { + it(`should not activate if the holder is at +6 Speed`, () => { battle = common.createBattle([[ - {species: "Dugtrio", item: 'adrenalineorb', ability: 'steamengine', moves: ['sleeptalk']}, + { species: "Dugtrio", item: 'adrenalineorb', ability: 'steamengine', moves: ['sleeptalk'] }, ], [ - {species: "Shedinja", item: 'stickybarb', moves: ['ember']}, - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Shedinja", item: 'stickybarb', moves: ['ember'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -90,28 +90,28 @@ describe('Adrenaline Orb', function () { assert.holdsItem(battle.p1.active[0]); }); - it(`should not activate if the Contrary holder is at +6 Attack`, function () { + it(`should not activate if the Contrary holder is at +6 Attack`, () => { battle = common.createBattle([[ - {species: "Dugtrio", item: 'adrenalineorb', ability: 'contrary', moves: ['bellydrum']}, + { species: "Dugtrio", item: 'adrenalineorb', ability: 'contrary', moves: ['bellydrum'] }, ], [ - {species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy']}, - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); - //Set Contrary Belly Drum (-6) and Topsy-Turvy to +6 + // Set Contrary Belly Drum (-6) and Topsy-Turvy to +6 battle.makeChoices(); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'spe', 0); assert.holdsItem(battle.p1.active[0]); }); - it(`should not activate if the Contrary holder is at -6 Speed`, function () { + it(`should not activate if the Contrary holder is at -6 Speed`, () => { battle = common.createBattle([[ - {species: "Dugtrio", item: 'adrenalineorb', moves: ['sleeptalk']}, + { species: "Dugtrio", item: 'adrenalineorb', moves: ['sleeptalk'] }, ], [ - {species: "Shedinja", item: 'stickybarb', moves: ['ember']}, - {species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy']}, - {species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk']}, + { species: "Shedinja", item: 'stickybarb', moves: ['ember'] }, + { species: "Shedinja", item: 'stickybarb', moves: ['topsyturvy'] }, + { species: "Incineroar", ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/items/assaultvest.js b/test/sim/items/assaultvest.js index e93fb1982d..60c1e80ac8 100644 --- a/test/sim/items/assaultvest.js +++ b/test/sim/items/assaultvest.js @@ -5,22 +5,22 @@ const common = require('./../../common'); let battle; -describe('Assault Vest', function () { - afterEach(function () { +describe('Assault Vest', () => { + afterEach(() => { battle.destroy(); }); - it('should disable the use of Status moves', function () { + it('should disable the use of Status moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Abra', ability: 'synchronize', moves: ['teleport']}]}); - battle.setPlayer('p2', {team: [{species: 'Abra', ability: 'synchronize', item: 'assaultvest', moves: ['teleport']}]}); + battle.setPlayer('p1', { team: [{ species: 'Abra', ability: 'synchronize', moves: ['teleport'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Abra', ability: 'synchronize', item: 'assaultvest', moves: ['teleport'] }] }); assert.cantMove(() => battle.makeChoices('move teleport', 'move teleport'), 'Abra', 'Teleport'); }); - it('should not prevent the use of Status moves', function () { + it('should not prevent the use of Status moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Lopunny', ability: 'klutz', item: 'assaultvest', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: 'Abra', ability: 'synchronize', item: 'ironball', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Lopunny', ability: 'klutz', item: 'assaultvest', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Abra', ability: 'synchronize', item: 'ironball', moves: ['calmmind'] }] }); battle.makeChoices('move trick', 'move calmmind'); assert.statStage(battle.p2.active[0], 'spa', 1); assert.statStage(battle.p2.active[0], 'spd', 1); diff --git a/test/sim/items/boosterenergy.js b/test/sim/items/boosterenergy.js index 742f18a29d..4c6c445c59 100644 --- a/test/sim/items/boosterenergy.js +++ b/test/sim/items/boosterenergy.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Booster Energy', function () { - afterEach(function () { +describe('Booster Energy', () => { + afterEach(() => { battle.destroy(); }); - it(`should not activate before Sticky Web when switching in`, function () { + it(`should not activate before Sticky Web when switching in`, () => { battle = common.createBattle([[ - {species: 'Abra', ability: 'synchronize', moves: ['teleport']}, - {species: 'Iron Bundle', ability: 'quarkdrive', item: 'boosterenergy', moves: ['sleeptalk']}, + { species: 'Abra', ability: 'synchronize', moves: ['teleport'] }, + { species: 'Iron Bundle', ability: 'quarkdrive', item: 'boosterenergy', moves: ['sleeptalk'] }, ], [ - {species: 'Ribombee', ability: 'shielddust', moves: ['stickyweb']}, + { species: 'Ribombee', ability: 'shielddust', moves: ['stickyweb'] }, ]]); battle.makeChoices(); diff --git a/test/sim/items/choiceitem.js b/test/sim/items/choiceitem.js index 0b1bebfae6..80e24ce311 100644 --- a/test/sim/items/choiceitem.js +++ b/test/sim/items/choiceitem.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe("Choice Items", function () { - afterEach(function () { +describe("Choice Items", () => { + afterEach(() => { battle.destroy(); }); - it("should restore the same Choice lock after dynamax ends", function () { + it("should restore the same Choice lock after dynamax ends", () => { battle = common.gen(8).createBattle([[ - {species: 'gyarados', moves: ['sleeptalk', 'splash'], item: 'choicescarf'}, + { species: 'gyarados', moves: ['sleeptalk', 'splash'], item: 'choicescarf' }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move 1', 'auto'); battle.makeChoices('move 1 dynamax', 'auto'); diff --git a/test/sim/items/drives.js b/test/sim/items/drives.js index 0180a8f542..c7984e0588 100644 --- a/test/sim/items/drives.js +++ b/test/sim/items/drives.js @@ -7,22 +7,22 @@ const drives = ['Burn Drive', 'Chill Drive', 'Douse Drive', 'Shock Drive']; let battle; -describe('Drives', function () { +describe('Drives', () => { for (const drive of drives) { - describe(drive, function () { + describe(drive, () => { const id = drive.replace(/\W+/g, '').toLowerCase(); - afterEach(function () { + afterEach(() => { battle.destroy(); }); - it('should not be stolen or removed if held by a Genesect', function () { + it('should not be stolen or removed if held by a Genesect', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Genesect', ability: 'frisk', item: id, moves: ['recover']}]}); - battle.setPlayer('p2', {team: [ - {species: 'Fennekin', ability: 'magician', moves: ['thief', 'mysticalfire']}, - {species: 'Abra', ability: 'synchronize', moves: ['thief', 'trick', 'knockoff']}, - ]}); + battle.setPlayer('p1', { team: [{ species: 'Genesect', ability: 'frisk', item: id, moves: ['recover'] }] }); + battle.setPlayer('p2', { team: [ + { species: 'Fennekin', ability: 'magician', moves: ['thief', 'mysticalfire'] }, + { species: 'Abra', ability: 'synchronize', moves: ['thief', 'trick', 'knockoff'] }, + ] }); const holder = battle.p1.active[0]; battle.makeChoices('move recover', 'move thief'); // Fennekin's Magician assert.holdsItem(holder); @@ -34,26 +34,26 @@ describe('Drives', function () { } }); - it('should not be removed by Fling if held by a Genesect', function () { + it('should not be removed by Fling if held by a Genesect', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mawile', ability: 'intimidate', moves: ['swordsdance']}]}); - battle.setPlayer('p2', {team: [{species: 'Genesect', ability: 'frisk', item: id, moves: ['fling']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mawile', ability: 'intimidate', moves: ['swordsdance'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Genesect', ability: 'frisk', item: id, moves: ['fling'] }] }); battle.makeChoices('move swordsdance', 'move fling'); assert.holdsItem(battle.p2.active[0]); }); - it('should not be given to a Genesect', function () { + it('should not be given to a Genesect', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Genesect', ability: 'frisk', moves: ['thief']}]}); - battle.setPlayer('p2', {team: [{species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bestow']}]}); + battle.setPlayer('p1', { team: [{ species: 'Genesect', ability: 'frisk', moves: ['thief'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bestow'] }] }); battle.makeChoices('move thief', 'move bestow'); assert.false.holdsItem(battle.p1.active[0]); }); - it('should be removed if not held by a Genesect', function () { + it('should be removed if not held by a Genesect', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Genesect', ability: 'frisk', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [{ species: 'Genesect', ability: 'frisk', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bulkup'] }] }); battle.makeChoices('move knockoff', 'move bulkup'); assert.false.holdsItem(battle.p2.active[0]); }); diff --git a/test/sim/items/ejectpack.js b/test/sim/items/ejectpack.js index 0b052ad806..3744c7a9fd 100644 --- a/test/sim/items/ejectpack.js +++ b/test/sim/items/ejectpack.js @@ -5,87 +5,87 @@ const common = require('./../../common'); let battle; -describe(`Eject Pack`, function () { - afterEach(function () { +describe(`Eject Pack`, () => { + afterEach(() => { battle.destroy(); }); - it(`should switch out the holder when its stats are lowered`, function () { + it(`should switch out the holder when its stats are lowered`, () => { battle = common.createBattle([[ - {species: 'Magikarp', item: 'ejectpack', moves: ['splash']}, - {species: 'Mew', moves: ['splash']}, + { species: 'Magikarp', item: 'ejectpack', moves: ['splash'] }, + { species: 'Mew', moves: ['splash'] }, ], [ - {species: 'Machop', moves: ['leer']}, + { species: 'Machop', moves: ['leer'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.requestState, 'switch'); }); - it(`should switch out the holder after Moody's stat drop`, function () { + it(`should switch out the holder after Moody's stat drop`, () => { battle = common.createBattle([[ - {species: 'Glalie', ability: 'moody', item: 'ejectpack', moves: ['protect']}, - {species: 'Mew', moves: ['protect']}, + { species: 'Glalie', ability: 'moody', item: 'ejectpack', moves: ['protect'] }, + { species: 'Mew', moves: ['protect'] }, ], [ - {species: 'Mew', moves: ['protect']}, + { species: 'Mew', moves: ['protect'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.requestState, 'switch'); }); - it(`should not switch the holder out if the move was Parting Shot and the opponent could switch`, function () { + it(`should not switch the holder out if the move was Parting Shot and the opponent could switch`, () => { battle = common.createBattle([[ - {species: 'Wynaut', item: 'ejectpack', moves: ['sleeptalk']}, - {species: 'Mew', moves: ['sleeptalk']}, + { species: 'Wynaut', item: 'ejectpack', moves: ['sleeptalk'] }, + { species: 'Mew', moves: ['sleeptalk'] }, ], [ - {species: 'Mew', moves: ['partingshot']}, - {species: 'Muk', moves: ['sleeptalk']}, + { species: 'Mew', moves: ['partingshot'] }, + { species: 'Muk', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.equal(battle.p1.requestState, 'switch'); assert.equal(battle.p2.requestState, 'switch'); }); - it(`should switch out the holder if its stats are lowered during the semi-invulnerable state`, function () { + it(`should switch out the holder if its stats are lowered during the semi-invulnerable state`, () => { battle = common.createBattle([[ - {species: 'Charmeleon', item: 'ejectpack', moves: ['phantomforce']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Charmeleon', item: 'ejectpack', moves: ['phantomforce'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', ability: 'noguard', moves: ['growl']}, + { species: 'Wynaut', ability: 'noguard', moves: ['growl'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.requestState, 'switch'); }); - it(`should switch out the holder if its stats are lowered after using Swallow`, function () { + it(`should switch out the holder if its stats are lowered after using Swallow`, () => { battle = common.createBattle([[ - {species: 'Charmeleon', item: 'ejectpack', moves: ['stockpile', 'swallow']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Charmeleon', item: 'ejectpack', moves: ['stockpile', 'swallow'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['tackle']}, + { species: 'Wynaut', moves: ['tackle'] }, ]]); battle.makeChoices(); battle.makeChoices('move swallow', 'auto'); assert.equal(battle.p1.requestState, 'switch'); }); - it(`should not switch out the user if the user acquired the Eject Pack after the stat drop occurred`, function () { + it(`should not switch out the user if the user acquired the Eject Pack after the stat drop occurred`, () => { battle = common.createBattle([[ - {species: 'Klefki', ability: 'magician', moves: ['lowsweep']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Klefki', ability: 'magician', moves: ['lowsweep'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Grimmsnarl', ability: 'pickpocket', item: 'cheriberry', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Grimmsnarl', ability: 'pickpocket', item: 'cheriberry', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.equal(battle.requestState, 'switch'); }); - it.skip(`should wait until after all other end-turn effects have resolved before switching out the holder`, function () { + it.skip(`should wait until after all other end-turn effects have resolved before switching out the holder`, () => { battle = common.createBattle([[ - {species: 'Glalie', item: 'ejectpack', ability: 'moody', moves: ['icebeam']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Glalie', item: 'ejectpack', ability: 'moody', moves: ['icebeam'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Zygarde', item: 'focussash', ability: 'powerconstruct', moves: ['octolock']}, + { species: 'Zygarde', item: 'focussash', ability: 'powerconstruct', moves: ['octolock'] }, ]]); battle.makeChoices(); const log = battle.getDebugLog(); @@ -96,15 +96,15 @@ describe(`Eject Pack`, function () { assert(powerConstructIndex < ejectPackIndex, 'Eject Pack should not activate before Power Construct'); }); - it.skip(`should not activate when another switching effect was triggered as part of the move`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Hydreigon', moves: ['breakingswipe']}, - {species: 'Horsea', moves: ['sleeptalk']}, + it.skip(`should not activate when another switching effect was triggered as part of the move`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Hydreigon', moves: ['breakingswipe'] }, + { species: 'Horsea', moves: ['sleeptalk'] }, ], [ - {species: 'Zeraora', item: 'ejectpack', moves: ['sleeptalk']}, - {species: 'Mew', item: 'ejectbutton', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Zeraora', item: 'ejectpack', moves: ['sleeptalk'] }, + { species: 'Mew', item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -112,15 +112,15 @@ describe(`Eject Pack`, function () { assert.species(battle.p2.active[1], 'Wynaut', `Mew should have switched out with its Eject Button.`); }); - it.skip(`should only trigger the fastest Eject Pack when multiple targets with Eject Pack have stats lowered`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Hydreigon', moves: ['leer']}, - {species: 'Horsea', moves: ['sleeptalk']}, + it.skip(`should only trigger the fastest Eject Pack when multiple targets with Eject Pack have stats lowered`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Hydreigon', moves: ['leer'] }, + { species: 'Horsea', moves: ['sleeptalk'] }, ], [ - {species: 'Morelull', item: 'ejectpack', moves: ['sleeptalk']}, - {species: 'Mew', item: 'ejectpack', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Morelull', item: 'ejectpack', moves: ['sleeptalk'] }, + { species: 'Mew', item: 'ejectpack', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -128,29 +128,29 @@ describe(`Eject Pack`, function () { assert.species(battle.p2.active[1], 'Wynaut'); }); - it(`should not prevent entrance Abilities from resolving during simultaneous switches`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Hydreigon', ability: 'intimidate', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should not prevent entrance Abilities from resolving during simultaneous switches`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Hydreigon', ability: 'intimidate', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Morelull', ability: 'drought', item: 'ejectpack', moves: ['sleeptalk']}, - {species: 'Mew', level: 1, ability: 'electricsurge', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Morelull', ability: 'drought', item: 'ejectpack', moves: ['sleeptalk'] }, + { species: 'Mew', level: 1, ability: 'electricsurge', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); assert(battle.field.isWeather('sunnyday')); assert(battle.field.isTerrain('electricterrain')); assert.equal(battle.p2.requestState, 'switch'); }); - it.skip(`should not prohibit switchins if a switch has already resolved to a slot replaced by Eject Pack`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Pheromosa', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk']}, + it.skip(`should not prohibit switchins if a switch has already resolved to a slot replaced by Eject Pack`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Pheromosa', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk'] }, ], [ - {species: 'Morelull', item: 'ejectpack', moves: ['sleeptalk']}, - {species: 'Mew', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Morelull', item: 'ejectpack', moves: ['sleeptalk'] }, + { species: 'Mew', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('switch 3, move sleeptalk', 'move sleeptalk, switch 3'); battle.makeChoices(); diff --git a/test/sim/items/eviolite.js b/test/sim/items/eviolite.js index d3b8259552..cb1028911c 100644 --- a/test/sim/items/eviolite.js +++ b/test/sim/items/eviolite.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Eviolite', function () { - afterEach(function () { +describe('Eviolite', () => { + afterEach(() => { battle.destroy(); }); - it(`should multiply the defenses of a Pokemon that can evolve by 1.5`, function () { + it(`should multiply the defenses of a Pokemon that can evolve by 1.5`, () => { battle = common.createBattle([[ - {species: 'Omanyte', ability: 'shellarmor', item: 'eviolite', moves: ['rest']}, + { species: 'Omanyte', ability: 'shellarmor', item: 'eviolite', moves: ['rest'] }, ], [ - {species: 'Cherrim', moves: ['seedbomb', 'megadrain']}, + { species: 'Cherrim', moves: ['seedbomb', 'megadrain'] }, ]]); battle.makeChoices(); assert.false.fainted(battle.p1.active[0]); @@ -22,12 +22,12 @@ describe('Eviolite', function () { assert.false.fainted(battle.p1.active[0]); }); - it(`should not multiply the defenses of a Pokemon that cannot evolve by 1.5`, function () { + it(`should not multiply the defenses of a Pokemon that cannot evolve by 1.5`, () => { battle = common.createBattle([[ - {species: 'Omastar', ability: 'shellarmor', item: 'eviolite', moves: ['rest']}, - {species: 'Omastar', ability: 'shellarmor', item: 'eviolite', moves: ['rest']}, + { species: 'Omastar', ability: 'shellarmor', item: 'eviolite', moves: ['rest'] }, + { species: 'Omastar', ability: 'shellarmor', item: 'eviolite', moves: ['rest'] }, ], [ - {species: 'Sceptile', item: 'meadowplate', moves: ['leafblade', 'megadrain']}, + { species: 'Sceptile', item: 'meadowplate', moves: ['leafblade', 'megadrain'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -36,11 +36,11 @@ describe('Eviolite', function () { assert.fainted(battle.p1.active[0]); }); - it(`should multiply the defenses of a National Dex Pokemon that can evolve by 1.5`, function () { + it(`should multiply the defenses of a National Dex Pokemon that can evolve by 1.5`, () => { battle = common.createBattle([[ - {species: 'Geodude', ability: 'shellarmor', item: 'eviolite', moves: ['rest']}, + { species: 'Geodude', ability: 'shellarmor', item: 'eviolite', moves: ['rest'] }, ], [ - {species: 'Roserade', moves: ['seedbomb', 'absorb']}, + { species: 'Roserade', moves: ['seedbomb', 'absorb'] }, ]]); battle.makeChoices(); assert.false.fainted(battle.p1.active[0]); diff --git a/test/sim/items/flameorb.js b/test/sim/items/flameorb.js index 2678a9d92e..638d7eabcd 100644 --- a/test/sim/items/flameorb.js +++ b/test/sim/items/flameorb.js @@ -5,29 +5,29 @@ const common = require('./../../common'); let battle; -describe('Flame Orb', function () { - afterEach(function () { +describe('Flame Orb', () => { + afterEach(() => { battle.destroy(); }); - it('should not trigger when entering battle', function () { + it('should not trigger when entering battle', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Magikarp', ability: 'swiftswim', item: 'focussash', moves: ['splash']}, - {species: 'Ursaring', ability: 'guts', item: 'flameorb', moves: ['protect']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Breloom', ability: 'technician', moves: ['bulletseed']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Magikarp', ability: 'swiftswim', item: 'focussash', moves: ['splash'] }, + { species: 'Ursaring', ability: 'guts', item: 'flameorb', moves: ['protect'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Breloom', ability: 'technician', moves: ['bulletseed'] }, + ] }); battle.makeChoices('move splash', 'move bulletseed'); battle.makeChoices('switch 2', ''); assert.notEqual(battle.p1.active[0].status, 'brn'); }); - it('should trigger after one turn', function () { + it('should trigger after one turn', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Ursaring', ability: 'guts', item: 'flameorb', moves: ['protect']}]}); - battle.setPlayer('p2', {team: [{species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ursaring', ability: 'guts', item: 'flameorb', moves: ['protect'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }] }); const target = battle.p1.active[0]; assert.sets(() => target.status, 'brn', () => battle.makeChoices('move protect', 'move splash')); }); diff --git a/test/sim/items/focussash.js b/test/sim/items/focussash.js index a81b259624..e0ef93be9d 100644 --- a/test/sim/items/focussash.js +++ b/test/sim/items/focussash.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Focus Sash', function () { - afterEach(function () { +describe('Focus Sash', () => { + afterEach(() => { battle.destroy(); }); - it('should be consumed and allow its user to survive an attack from full HP', function () { + it('should be consumed and allow its user to survive an attack from full HP', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Paras', ability: 'dryskin', item: 'focussash', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Delphox', ability: 'magician', moves: ['incinerate']}]}); + battle.setPlayer('p1', { team: [{ species: 'Paras', ability: 'dryskin', item: 'focussash', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Delphox', ability: 'magician', moves: ['incinerate'] }] }); const holder = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'move incinerate'); assert.false.holdsItem(holder); @@ -21,11 +21,11 @@ describe('Focus Sash', function () { assert.equal(holder.hp, 1); }); - it(`should be consumed and allow its user to survive a confusion damage hit from full HP`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Shedinja', ability: 'wonderguard', item: 'focussash', moves: ['absorb']}, + it(`should be consumed and allow its user to survive a confusion damage hit from full HP`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Shedinja', ability: 'wonderguard', item: 'focussash', moves: ['absorb'] }, ], [ - {species: 'Klefki', ability: 'prankster', moves: ['confuseray']}, + { species: 'Klefki', ability: 'prankster', moves: ['confuseray'] }, ]]); const shedinja = battle.p1.active[0]; @@ -34,20 +34,20 @@ describe('Focus Sash', function () { assert.false.fainted(shedinja); }); - it('should not trigger on recoil damage', function () { + it('should not trigger on recoil damage', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'wonderguard', item: 'focussash', moves: ['doubleedge']}]}); - battle.setPlayer('p2', {team: [{species: 'Klefki', ability: 'prankster', moves: ['reflect']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shedinja', ability: 'wonderguard', item: 'focussash', moves: ['doubleedge'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Klefki', ability: 'prankster', moves: ['reflect'] }] }); const holder = battle.p1.active[0]; battle.makeChoices('move doubleedge', 'move reflect'); assert.holdsItem(holder); assert.fainted(holder); }); - it('should not trigger on residual damage', function () { + it('should not trigger on residual damage', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'wonderguard', item: 'focussash', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Crobat', ability: 'infiltrator', moves: ['toxic']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shedinja', ability: 'wonderguard', item: 'focussash', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Crobat', ability: 'infiltrator', moves: ['toxic'] }] }); const holder = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'move toxic'); assert.holdsItem(holder); diff --git a/test/sim/items/heavydutyboots.js b/test/sim/items/heavydutyboots.js index 2ca731ca19..b281aaa220 100644 --- a/test/sim/items/heavydutyboots.js +++ b/test/sim/items/heavydutyboots.js @@ -5,20 +5,20 @@ const common = require('./../../common'); let battle; -describe("Heavy Duty Boots", function () { - afterEach(function () { +describe("Heavy Duty Boots", () => { + afterEach(() => { battle.destroy(); }); - it("should prevent entry hazards from affecting the holder", function () { + it("should prevent entry hazards from affecting the holder", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, - {species: 'Magikarp', ability: 'swiftswim', item: 'heavydutyboots', moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Cloyster', ability: 'shellarmor', moves: ['spikes', 'toxicspikes']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, + { species: 'Magikarp', ability: 'swiftswim', item: 'heavydutyboots', moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Cloyster', ability: 'shellarmor', moves: ['spikes', 'toxicspikes'] }, + ] }); battle.makeChoices('auto', 'move spikes'); battle.makeChoices('auto', 'move toxicspikes'); battle.makeChoices('switch 2', 'auto'); diff --git a/test/sim/items/ironball.js b/test/sim/items/ironball.js index 6e54c37255..91af1a7343 100644 --- a/test/sim/items/ironball.js +++ b/test/sim/items/ironball.js @@ -5,26 +5,26 @@ const common = require('./../../common'); let battle; -describe('Iron Ball', function () { - afterEach(function () { +describe('Iron Ball', () => { + afterEach(() => { battle.destroy(); }); - it('should reduce halve the holder\'s speed', function () { + it('should reduce halve the holder\'s speed', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', item: 'ironball', moves: ['bestow']}]}); - battle.setPlayer('p2', {team: [{species: "Aerodactyl", ability: 'pressure', moves: ['stealthrock']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', item: 'ironball', moves: ['bestow'] }] }); + battle.setPlayer('p2', { team: [{ species: "Aerodactyl", ability: 'pressure', moves: ['stealthrock'] }] }); const target = battle.p2.active[0]; assert.sets(() => target.getStat('spe'), battle.modify(target.getStat('spe'), 0.5), () => battle.makeChoices('move bestow', 'move stealthrock')); }); - it('should negate Ground immunities and deal neutral type effectiveness to Flying-type Pokemon', function () { + it('should negate Ground immunities and deal neutral type effectiveness to Flying-type Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake']}]}); - battle.setPlayer('p2', {team: [ - {species: "Aerodactyl", ability: 'pressure', item: 'ironball', moves: ['stealthrock']}, - {species: "Tropius", ability: 'harvest', item: 'ironball', moves: ['leechseed']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Aerodactyl", ability: 'pressure', item: 'ironball', moves: ['stealthrock'] }, + { species: "Tropius", ability: 'harvest', item: 'ironball', moves: ['leechseed'] }, + ] }); battle.makeChoices('move earthquake', 'move stealthrock'); // Earthquake neutral on Aerodactyl assert(!battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); @@ -35,13 +35,13 @@ describe('Iron Ball', function () { assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should not deal neutral type effectiveness to Flying-type Pokemon in Gravity', function () { + it('should not deal neutral type effectiveness to Flying-type Pokemon in Gravity', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake', 'gravity']}]}); - battle.setPlayer('p2', {team: [ - {species: "Aerodactyl", ability: 'shellarmor', item: 'ironball', moves: ['stealthrock']}, - {species: "Tropius", ability: 'shellarmor', item: 'ironball', moves: ['leechseed']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake', 'gravity'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Aerodactyl", ability: 'shellarmor', item: 'ironball', moves: ['stealthrock'] }, + { species: "Tropius", ability: 'shellarmor', item: 'ironball', moves: ['leechseed'] }, + ] }); // Set up Gravity battle.makeChoices('move gravity', 'move stealthrock'); @@ -55,13 +55,13 @@ describe('Iron Ball', function () { assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should negate artificial Ground immunities and deal normal type effectiveness', function () { + it('should negate artificial Ground immunities and deal normal type effectiveness', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake']}]}); - battle.setPlayer('p2', {team: [ - {species: "Rotom", ability: 'levitate', item: 'ironball', moves: ['rest']}, - {species: "Parasect", ability: 'levitate', item: 'ironball', moves: ['rest']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['earthquake'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Rotom", ability: 'levitate', item: 'ironball', moves: ['rest'] }, + { species: "Parasect", ability: 'levitate', item: 'ironball', moves: ['rest'] }, + ] }); battle.makeChoices('move earthquake', 'move rest'); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); @@ -70,10 +70,10 @@ describe('Iron Ball', function () { assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should ground Pokemon that are airborne', function () { + it('should ground Pokemon that are airborne', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['spore']}]}); - battle.setPlayer('p2', {team: [{species: "Thundurus", ability: 'prankster', item: 'ironball', moves: ['electricterrain']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['spore'] }] }); + battle.setPlayer('p2', { team: [{ species: "Thundurus", ability: 'prankster', item: 'ironball', moves: ['electricterrain'] }] }); battle.makeChoices('move spore', 'move electricterrain'); assert.equal(battle.p2.active[0].status, ''); }); diff --git a/test/sim/items/jabocaberry.js b/test/sim/items/jabocaberry.js index 428d232b7e..5e20823062 100644 --- a/test/sim/items/jabocaberry.js +++ b/test/sim/items/jabocaberry.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Jaboca Berry', function () { - afterEach(function () { +describe('Jaboca Berry', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate after a physical move`, function () { + it(`should activate after a physical move`, () => { battle = common.createBattle([[ - {species: "Charizard", evs: {hp: 252}, moves: ['scratch', 'ember']}, + { species: "Charizard", evs: { hp: 252 }, moves: ['scratch', 'ember'] }, ], [ - {species: "Cramorant", item: 'jabocaberry', moves: ['sleeptalk']}, + { species: "Cramorant", item: 'jabocaberry', moves: ['sleeptalk'] }, ]]); const charizard = battle.p1.active[0]; @@ -23,22 +23,22 @@ describe('Jaboca Berry', function () { assert.hurtsBy(charizard, charizard.maxhp / 8, () => battle.makeChoices()); }); - it(`should activate even if the holder has 0 HP`, function () { + it(`should activate even if the holder has 0 HP`, () => { battle = common.createBattle([[ - {species: "Morpeko", evs: {hp: 252}, moves: ['aurawheel']}, + { species: "Morpeko", evs: { hp: 252 }, moves: ['aurawheel'] }, ], [ - {species: "Cramorant", item: 'jabocaberry', moves: ['sleeptalk']}, + { species: "Cramorant", item: 'jabocaberry', moves: ['sleeptalk'] }, ]]); const morpeko = battle.p1.active[0]; assert.hurtsBy(morpeko, morpeko.maxhp / 8, () => battle.makeChoices()); }); - it(`should not activate after a physical move used by a Pokemon with Magic Guard`, function () { + it(`should not activate after a physical move used by a Pokemon with Magic Guard`, () => { battle = common.createBattle([[ - {species: "Clefable", ability: 'magicguard', moves: ['pound']}, + { species: "Clefable", ability: 'magicguard', moves: ['pound'] }, ], [ - {species: "Cramorant", item: 'jabocaberry', moves: ['sleeptalk']}, + { species: "Cramorant", item: 'jabocaberry', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/items/keeberry.js b/test/sim/items/keeberry.js index b4a6ddcaf5..60e9dfeceb 100644 --- a/test/sim/items/keeberry.js +++ b/test/sim/items/keeberry.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Kee Berry', function () { - afterEach(function () { +describe('Kee Berry', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate after a multi-hit physical move`, function () { + it(`should activate after a multi-hit physical move`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['doubleironbash']}, + { species: "Wynaut", moves: ['doubleironbash'] }, ], [ - {species: "Alakazam", item: 'keeberry', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: "Alakazam", item: 'keeberry', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); const alakazam = battle.p2.active[0]; diff --git a/test/sim/items/lansatberry.js b/test/sim/items/lansatberry.js index b5512d7abd..f36055d9fa 100644 --- a/test/sim/items/lansatberry.js +++ b/test/sim/items/lansatberry.js @@ -5,31 +5,31 @@ const common = require('./../../common'); let battle; -describe('Lansat Berry', function () { - afterEach(function () { +describe('Lansat Berry', () => { + afterEach(() => { battle.destroy(); }); - it('should apply a Focus Energy effect when consumed', function () { + it('should apply a Focus Energy effect when consumed', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Aggron', ability: 'sturdy', item: 'lansatberry', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Lucario', ability: 'adaptability', moves: ['aurasphere']}]}); + battle.setPlayer('p1', { team: [{ species: 'Aggron', ability: 'sturdy', item: 'lansatberry', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Lucario', ability: 'adaptability', moves: ['aurasphere'] }] }); const holder = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'move aurasphere'); assert.false.holdsItem(holder); assert('focusenergy' in holder.volatiles); }); - it('should start to apply the effect even in middle of an attack', function () { + it('should start to apply the effect even in middle of an attack', () => { battle = common.createBattle([ - [{species: 'Makuhita', ability: 'guts', item: 'lansatberry', moves: ['triplekick']}], - [{species: 'Muk', ability: 'noguard', item: 'rockyhelmet', moves: ['acidarmor']}], + [{ species: 'Makuhita', ability: 'guts', item: 'lansatberry', moves: ['triplekick'] }], + [{ species: 'Muk', ability: 'noguard', item: 'rockyhelmet', moves: ['acidarmor'] }], ]); const holder = battle.p1.active[0]; let i = 0; const expectedRatio = [1, 1, 1, 1, 1, 3]; - battle.onEvent('ModifyCritRatio', battle.format, -99, function (critRatio, pokemon) { + battle.onEvent('ModifyCritRatio', battle.format, -99, (critRatio, pokemon) => { assert.equal(critRatio, expectedRatio[i++]); }); diff --git a/test/sim/items/leftovers.js b/test/sim/items/leftovers.js index b2d6cc178c..0ac7005e29 100644 --- a/test/sim/items/leftovers.js +++ b/test/sim/items/leftovers.js @@ -5,20 +5,20 @@ const common = require('./../../common'); let battle; -describe('Leftovers [Gen 2]', function () { - afterEach(function () { +describe('Leftovers [Gen 2]', () => { + afterEach(() => { battle.destroy(); }); - it('should heal after switch', function () { + it('should heal after switch', () => { battle = common.gen(2).createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Blissey', item: 'leftovers', moves: ['healbell']}, - {species: 'Magikarp', level: 1, moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Miltank", moves: ['seismictoss']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Blissey', item: 'leftovers', moves: ['healbell'] }, + { species: 'Magikarp', level: 1, moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Miltank", moves: ['seismictoss'] }, + ] }); const holder = battle.p1.active[0]; battle.makeChoices('move healbell', 'move seismictoss'); assert.equal(holder.hp, 590); diff --git a/test/sim/items/leppaberry.js b/test/sim/items/leppaberry.js index 3a74b4aa0a..37dd19e145 100644 --- a/test/sim/items/leppaberry.js +++ b/test/sim/items/leppaberry.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Leppa Berry', function () { - afterEach(function () { +describe('Leppa Berry', () => { + afterEach(() => { battle.destroy(); }); - it('should restore PP to the first move with any PP missing when eaten forcibly', function () { + it('should restore PP to the first move with any PP missing when eaten forcibly', () => { battle = common.createBattle([ - [{species: 'Gyarados', ability: 'moxie', item: '', moves: ['sleeptalk', 'splash']}], - [{species: 'Geodude', ability: 'sturdy', item: 'leppaberry', moves: ['sleeptalk', 'fling']}], + [{ species: 'Gyarados', ability: 'moxie', item: '', moves: ['sleeptalk', 'splash'] }], + [{ species: 'Geodude', ability: 'sturdy', item: 'leppaberry', moves: ['sleeptalk', 'fling'] }], ]); const pokemon = battle.p1.active[0]; diff --git a/test/sim/items/lifeorb.js b/test/sim/items/lifeorb.js index 043481ef42..6a2a980796 100644 --- a/test/sim/items/lifeorb.js +++ b/test/sim/items/lifeorb.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Life Orb', function () { - afterEach(function () { +describe('Life Orb', () => { + afterEach(() => { battle.destroy(); }); - it('should hurt the user by 1/10 of their max HP after a successful attack', function () { + it('should hurt the user by 1/10 of their max HP after a successful attack', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Scizor', ability: 'technician', item: 'lifeorb', moves: ['uturn']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Primarina', ability: 'torrent', moves: ['sleeptalk']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Scizor', ability: 'technician', item: 'lifeorb', moves: ['uturn'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Primarina', ability: 'torrent', moves: ['sleeptalk'] }, + ] }); assert.hurtsBy(battle.p1.active[0], Math.floor(battle.p1.active[0].maxhp / 10), () => battle.makeChoices('move uturn', 'move sleeptalk')); }); }); diff --git a/test/sim/items/lumberry.js b/test/sim/items/lumberry.js index a4d917f39c..7e926d53ad 100644 --- a/test/sim/items/lumberry.js +++ b/test/sim/items/lumberry.js @@ -5,31 +5,31 @@ const common = require('./../../common'); let battle; -describe('Lum Berry', function () { - afterEach(function () { +describe('Lum Berry', () => { + afterEach(() => { battle.destroy(); }); - it('should heal a non-volatile status condition', function () { + it('should heal a non-volatile status condition', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Rapidash', moves: ['inferno']}]}); - battle.setPlayer('p2', {team: [{species: 'Machamp', ability: 'noguard', item: 'lumberry', moves: ['sleeptalk']}]}); + battle.setPlayer('p1', { team: [{ species: 'Rapidash', moves: ['inferno'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Machamp', ability: 'noguard', item: 'lumberry', moves: ['sleeptalk'] }] }); battle.makeChoices('move inferno', 'move sleeptalk'); assert.equal(battle.p2.active[0].status, ''); }); - it('should cure confusion', function () { + it('should cure confusion', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Golurk', ability: 'noguard', moves: ['dynamicpunch']}]}); - battle.setPlayer('p2', {team: [{species: 'Shuckle', item: 'lumberry', moves: ['sleeptalk']}]}); + battle.setPlayer('p1', { team: [{ species: 'Golurk', ability: 'noguard', moves: ['dynamicpunch'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Shuckle', item: 'lumberry', moves: ['sleeptalk'] }] }); battle.makeChoices('move dynamicpunch', 'move sleeptalk'); assert(!battle.p2.active[0].volatiles['confusion']); }); - it('should be eaten immediately when the holder gains a status condition', function () { + it('should be eaten immediately when the holder gains a status condition', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Charizard', item: 'lumberry', moves: ['outrage']}]}); - battle.setPlayer('p2', {team: [{species: 'Toxapex', moves: ['recover', 'banefulbunker']}]}); + battle.setPlayer('p1', { team: [{ species: 'Charizard', item: 'lumberry', moves: ['outrage'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Toxapex', moves: ['recover', 'banefulbunker'] }] }); const attacker = battle.p1.active[0]; battle.makeChoices('move outrage', 'move recover'); attacker.volatiles['lockedmove'].duration = 2; diff --git a/test/sim/items/mail.js b/test/sim/items/mail.js index 7a503c1699..9099c98a01 100644 --- a/test/sim/items/mail.js +++ b/test/sim/items/mail.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Mail', function () { - afterEach(function () { +describe('Mail', () => { + afterEach(() => { battle.destroy(); }); - it('should not be stolen by most moves or abilities', function () { + it('should not be stolen by most moves or abilities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Blissey', ability: 'naturalcure', item: 'mail', moves: ['softboiled']}]}); - battle.setPlayer('p2', {team: [ - {species: 'Fennekin', ability: 'magician', moves: ['grassknot']}, - {species: 'Abra', ability: 'synchronize', moves: ['trick']}, - {species: 'Lopunny', ability: 'klutz', moves: ['switcheroo']}, - ]}); + battle.setPlayer('p1', { team: [{ species: 'Blissey', ability: 'naturalcure', item: 'mail', moves: ['softboiled'] }] }); + battle.setPlayer('p2', { team: [ + { species: 'Fennekin', ability: 'magician', moves: ['grassknot'] }, + { species: 'Abra', ability: 'synchronize', moves: ['trick'] }, + { species: 'Lopunny', ability: 'klutz', moves: ['switcheroo'] }, + ] }); const holder = battle.p1.active[0]; assert.constant(() => holder.item, () => battle.makeChoices('move softboiled', 'move grassknot')); battle.makeChoices('move softboiled', 'switch 2'); @@ -26,26 +26,26 @@ describe('Mail', function () { assert.constant(() => holder.item, () => battle.makeChoices('move softboiled', 'move switcheroo')); }); - it('should not be removed by Fling', function () { + it('should not be removed by Fling', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Pangoro', ability: 'ironfist', moves: ['swordsdance']}]}); - battle.setPlayer('p2', {team: [{species: 'Abra', ability: 'synchronize', item: 'mail', moves: ['fling']}]}); + battle.setPlayer('p1', { team: [{ species: 'Pangoro', ability: 'ironfist', moves: ['swordsdance'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Abra', ability: 'synchronize', item: 'mail', moves: ['fling'] }] }); const holder = battle.p2.active[0]; assert.constant(() => holder.item, () => battle.makeChoices('move swordsdance', 'move fling')); }); - it('should be removed by Knock Off', function () { + it('should be removed by Knock Off', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Pangoro', ability: 'ironfist', item: 'mail', moves: ['swordsdance']}]}); - battle.setPlayer('p2', {team: [{species: 'Abra', ability: 'synchronize', moves: ['knockoff']}]}); + battle.setPlayer('p1', { team: [{ species: 'Pangoro', ability: 'ironfist', item: 'mail', moves: ['swordsdance'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Abra', ability: 'synchronize', moves: ['knockoff'] }] }); const holder = battle.p1.active[0]; assert.false.constant(() => holder.item, () => battle.makeChoices('move swordsdance', 'move knockoff')); }); - it('should be stolen by Thief', function () { + it('should be stolen by Thief', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Pangoro', ability: 'ironfist', item: 'mail', moves: ['swordsdance']}]}); - battle.setPlayer('p2', {team: [{species: 'Abra', ability: 'synchronize', moves: ['thief']}]}); + battle.setPlayer('p1', { team: [{ species: 'Pangoro', ability: 'ironfist', item: 'mail', moves: ['swordsdance'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Abra', ability: 'synchronize', moves: ['thief'] }] }); const holder = battle.p1.active[0]; assert.false.constant(() => holder.item, () => battle.makeChoices('move swordsdance', 'move thief')); }); diff --git a/test/sim/items/metronome.js b/test/sim/items/metronome.js index 893233c433..0ed9193060 100644 --- a/test/sim/items/metronome.js +++ b/test/sim/items/metronome.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Metronome (item)', function () { - afterEach(function () { +describe('Metronome (item)', () => { + afterEach(() => { battle.destroy(); }); - it(`should increase the damage of moves that have been used successfully and consecutively`, function () { + it(`should increase the damage of moves that have been used successfully and consecutively`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'metronome', moves: ['psystrike']}, + { species: 'wynaut', item: 'metronome', moves: ['psystrike'] }, ], [ - {species: 'cleffa', evs: {hp: 252}, ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'cleffa', evs: { hp: 252 }, ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const cleffa = battle.p2.active[0]; @@ -24,11 +24,11 @@ describe('Metronome (item)', function () { assert.bounded(damage, [115, 137]); }); - it(`should reset the multiplier after switching moves`, function () { + it(`should reset the multiplier after switching moves`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'metronome', moves: ['psystrike', 'sleeptalk']}, + { species: 'wynaut', item: 'metronome', moves: ['psystrike', 'sleeptalk'] }, ], [ - {species: 'cleffa', evs: {hp: 252}, ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'cleffa', evs: { hp: 252 }, ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const cleffa = battle.p2.active[0]; @@ -39,11 +39,11 @@ describe('Metronome (item)', function () { assert.bounded(damage, [96, 114]); }); - it(`should reset the multiplier after hitting Protect`, function () { + it(`should reset the multiplier after hitting Protect`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'metronome', moves: ['psystrike']}, + { species: 'wynaut', item: 'metronome', moves: ['psystrike'] }, ], [ - {species: 'cleffa', evs: {hp: 252}, ability: 'shellarmor', moves: ['sleeptalk', 'protect']}, + { species: 'cleffa', evs: { hp: 252 }, ability: 'shellarmor', moves: ['sleeptalk', 'protect'] }, ]]); battle.makeChoices(); const cleffa = battle.p2.active[0]; @@ -54,11 +54,11 @@ describe('Metronome (item)', function () { assert.bounded(damage, [96, 114]); }); - it(`should instantly start moves that use a charging turn at Metronome 1 boost level, then increase linearly`, function () { + it(`should instantly start moves that use a charging turn at Metronome 1 boost level, then increase linearly`, () => { battle = common.createBattle([[ - {species: 'dusknoir', item: 'metronome', moves: ['dig']}, + { species: 'dusknoir', item: 'metronome', moves: ['dig'] }, ], [ - {species: 'blissey', ability: 'shellarmor', moves: ['softboiled']}, + { species: 'blissey', ability: 'shellarmor', moves: ['softboiled'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -78,12 +78,12 @@ describe('Metronome (item)', function () { assert(damageWasMetronome2Boosted, `Dig should be Metronome 2 boosted`); }); - it(`should not instantly start moves that skip a charging turn at Metronome 1 boost level`, function () { + it(`should not instantly start moves that skip a charging turn at Metronome 1 boost level`, () => { battle = common.createBattle([[ - {species: 'slowbro', item: 'metronome', moves: ['solarbeam']}, + { species: 'slowbro', item: 'metronome', moves: ['solarbeam'] }, ], [ - {species: 'blissey', ability: 'shellarmor', moves: ['sunnyday']}, - {species: 'blissey', ability: 'cloudnine', moves: ['luckychant']}, + { species: 'blissey', ability: 'shellarmor', moves: ['sunnyday'] }, + { species: 'blissey', ability: 'cloudnine', moves: ['luckychant'] }, ]]); battle.makeChoices(); const blissey = battle.p2.active[0]; @@ -97,11 +97,11 @@ describe('Metronome (item)', function () { assert.bounded(damage, [80, 95], `Solar Beam should be Metronome 1 boosted`); }); - it(`should use called moves to determine the Metronome multiplier`, function () { + it(`should use called moves to determine the Metronome multiplier`, () => { battle = common.createBattle([[ - {species: 'goomy', item: 'metronome', moves: ['copycat', 'surf']}, + { species: 'goomy', item: 'metronome', moves: ['copycat', 'surf'] }, ], [ - {species: 'clefable', evs: {hp: 252}, ability: 'shellarmor', moves: ['softboiled', 'surf']}, + { species: 'clefable', evs: { hp: 252 }, ability: 'shellarmor', moves: ['softboiled', 'surf'] }, ]]); battle.makeChoices('move copycat', 'move surf'); const clefable = battle.p2.active[0]; diff --git a/test/sim/items/mirrorherb.js b/test/sim/items/mirrorherb.js index eb05ea886e..b14e3d2f27 100644 --- a/test/sim/items/mirrorherb.js +++ b/test/sim/items/mirrorherb.js @@ -10,21 +10,21 @@ describe("Mirror Herb", () => { it("should copy Anger Point", () => { battle = common.createBattle([[ - {species: 'Snorlax', item: 'Mirror Herb', moves: ['stormthrow']}, + { species: 'Snorlax', item: 'Mirror Herb', moves: ['stormthrow'] }, ], [ - {species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk']}, + { species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'atk', 6); }); it("should only copy the effective boost after the +6 cap", () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Snorlax', item: 'Mirror Herb', moves: ['sleeptalk']}, - {species: 'Froslass', ability: 'Snow Cloak', moves: ['frostbreath']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Snorlax', item: 'Mirror Herb', moves: ['sleeptalk'] }, + { species: 'Froslass', ability: 'Snow Cloak', moves: ['frostbreath'] }, ], [ - {species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk']}, - {species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk']}, + { species: 'Primeape', ability: 'Anger Point', moves: ['sleeptalk'] }, + { species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'atk', -1); battle.makeChoices(); @@ -32,12 +32,12 @@ describe("Mirror Herb", () => { }); it("should copy all 'simultaneous' boosts from multiple opponents", () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Electrode', ability: 'No Guard', item: 'Mirror Herb', moves: ['recycle']}, - {species: 'Gyarados', ability: 'Intimidate', item: 'Wide Lens', moves: ['sleeptalk', 'air cutter']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Electrode', ability: 'No Guard', item: 'Mirror Herb', moves: ['recycle'] }, + { species: 'Gyarados', ability: 'Intimidate', item: 'Wide Lens', moves: ['sleeptalk', 'air cutter'] }, ], [ - {species: 'Primeape', ability: 'Defiant', item: 'Weakness Policy', moves: ['sleeptalk', 'haze']}, - {species: 'Annihilape', ability: 'Defiant', item: 'Weakness Policy', moves: ['sleeptalk', 'howl']}, + { species: 'Primeape', ability: 'Defiant', item: 'Weakness Policy', moves: ['sleeptalk', 'haze'] }, + { species: 'Annihilape', ability: 'Defiant', item: 'Weakness Policy', moves: ['sleeptalk', 'howl'] }, ]]); const electrode = battle.p1.active[0]; assert.statStage(electrode, 'atk', 4, `Mirror Herb should have copied both Defiant boosts but only boosted atk by ${electrode.boosts.atk}`); @@ -48,12 +48,12 @@ describe("Mirror Herb", () => { }); it("should wait for most entrance abilities before copying all their (opposing) boosts", () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Electrode', item: 'Mirror Herb', moves: ['recycle']}, - {species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Electrode', item: 'Mirror Herb', moves: ['recycle'] }, + { species: 'Gyarados', ability: 'Intimidate', moves: ['sleeptalk'] }, ], [ - {species: 'Zacian', ability: 'Intrepid Sword', moves: ['sleeptalk']}, - {species: 'Annihilape', ability: 'Defiant', moves: ['sleeptalk']}, + { species: 'Zacian', ability: 'Intrepid Sword', moves: ['sleeptalk'] }, + { species: 'Annihilape', ability: 'Defiant', moves: ['sleeptalk'] }, ]]); assert.statStage(battle.p1.active[0], 'atk', 3); }); diff --git a/test/sim/items/plates.js b/test/sim/items/plates.js index 6238ca319f..8c9af2e31f 100644 --- a/test/sim/items/plates.js +++ b/test/sim/items/plates.js @@ -10,22 +10,22 @@ const plates = [ 'Splash Plate', 'Spooky Plate', 'Stone Plate', 'Toxic Plate', 'Zap Plate', ]; -describe('Plates', function () { +describe('Plates', () => { for (const plate of plates) { - describe(plate, function () { + describe(plate, () => { const id = plate.replace(/\W+/g, '').toLowerCase(); - afterEach(function () { + afterEach(() => { battle.destroy(); }); - it('should not be stolen or removed if held by an Arceus', function () { + it('should not be stolen or removed if held by an Arceus', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Arceus', ability: 'frisk', item: id, moves: ['recover']}]}); - battle.setPlayer('p2', {team: [ - {species: 'Fennekin', ability: 'magician', moves: ['mysticalfire']}, - {species: 'Abra', ability: 'synchronize', moves: ['thief', 'trick', 'knockoff']}, - ]}); + battle.setPlayer('p1', { team: [{ species: 'Arceus', ability: 'frisk', item: id, moves: ['recover'] }] }); + battle.setPlayer('p2', { team: [ + { species: 'Fennekin', ability: 'magician', moves: ['mysticalfire'] }, + { species: 'Abra', ability: 'synchronize', moves: ['thief', 'trick', 'knockoff'] }, + ] }); const holder = battle.p1.active[0]; battle.makeChoices('move recover', 'move mysticalfire'); // Fennekin's Magician assert.holdsItem(holder); @@ -37,26 +37,26 @@ describe('Plates', function () { } }); - it('should not be removed by Fling if held by an Arceus', function () { + it('should not be removed by Fling if held by an Arceus', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mawile', ability: 'intimidate', moves: ['swordsdance']}]}); - battle.setPlayer('p2', {team: [{species: 'Arceus', ability: 'frisk', item: id, moves: ['fling']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mawile', ability: 'intimidate', moves: ['swordsdance'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Arceus', ability: 'frisk', item: id, moves: ['fling'] }] }); battle.makeChoices('move swordsdance', 'move fling'); assert.holdsItem(battle.p2.active[0]); }); - it('should not be given to an Arceus', function () { + it('should not be given to an Arceus', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Arceus', ability: 'multitype', moves: ['thief']}]}); - battle.setPlayer('p2', {team: [{species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bestow']}]}); + battle.setPlayer('p1', { team: [{ species: 'Arceus', ability: 'multitype', moves: ['thief'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bestow'] }] }); battle.makeChoices('move thief', 'move bestow'); assert.false.holdsItem(battle.p1.active[0]); }); - it('should be removed if not held by an Arceus', function () { + it('should be removed if not held by an Arceus', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Arceus', ability: 'multitype', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [{ species: 'Arceus', ability: 'multitype', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Azumarill', ability: 'thickfat', item: id, moves: ['bulkup'] }] }); battle.makeChoices('move knockoff', 'move bulkup'); assert.false.holdsItem(battle.p2.active[0]); }); diff --git a/test/sim/items/protectivepads.js b/test/sim/items/protectivepads.js index 73eae7ac5b..963b4d2e52 100644 --- a/test/sim/items/protectivepads.js +++ b/test/sim/items/protectivepads.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Protective Pads', function () { - afterEach(function () { +describe('Protective Pads', () => { + afterEach(() => { battle.destroy(); }); - it(`should prevent ability-changing abilities triggered by contact from acting`, function () { + it(`should prevent ability-changing abilities triggered by contact from acting`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'sturdy', item: 'protectivepads', moves: ['bulletpunch']}, + { species: 'wynaut', ability: 'sturdy', item: 'protectivepads', moves: ['bulletpunch'] }, ], [ - {species: 'cofagrigus', ability: 'mummy', moves: ['sleeptalk']}, + { species: 'cofagrigus', ability: 'mummy', moves: ['sleeptalk'] }, ]]); const wynaut = battle.p1.active[0]; @@ -26,11 +26,11 @@ describe('Protective Pads', function () { assert.false(mummyActivationMessages[0].includes('Sturdy'), `Attacker's ability should not be revealed`); }); - it(`should prevent damaging abilities triggered by contact from acting`, function () { + it(`should prevent damaging abilities triggered by contact from acting`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch'] }, ], [ - {species: 'ferrothorn', ability: 'ironbarbs', moves: ['sleeptalk']}, + { species: 'ferrothorn', ability: 'ironbarbs', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p1.active[0], `Attacker should not be damaged`); @@ -38,11 +38,11 @@ describe('Protective Pads', function () { assert(battle.log.some(line => line.includes('Protective Pads'))); }); - it(`should prevent stat stage-changing abilities triggered by contact from acting`, function () { + it(`should prevent stat stage-changing abilities triggered by contact from acting`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch'] }, ], [ - {species: 'goodra', ability: 'gooey', moves: ['sleeptalk']}, + { species: 'goodra', ability: 'gooey', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'spe', 0, `Speed should not be lowered`); @@ -50,22 +50,22 @@ describe('Protective Pads', function () { assert(battle.log.some(line => line.includes('Protective Pads'))); }); - it(`should not stop Pickpocket`, function () { + it(`should not stop Pickpocket`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch'] }, ], [ - {species: 'weavile', ability: 'pickpocket', moves: ['sleeptalk']}, + { species: 'weavile', ability: 'pickpocket', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.holdsItem(battle.p1.active[0], `Attacker should lose their item`); assert.equal(battle.p2.active[0].item, 'protectivepads', `Target should receive stolen Protective Pads`); }); - it(`should prevent item effects triggered by contact from acting`, function () { + it(`should prevent item effects triggered by contact from acting`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch'] }, ], [ - {species: 'miltank', item: 'rockyhelmet', moves: ['sleeptalk']}, + { species: 'miltank', item: 'rockyhelmet', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p1.active[0], `Attacker should not be hurt`); @@ -73,21 +73,21 @@ describe('Protective Pads', function () { assert(battle.log.every(line => !line.includes('Protective Pads'))); }); - it(`should not activate on the opponent's moves`, function () { + it(`should not activate on the opponent's moves`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'protectivepads', moves: ['sleeptalk'] }, ], [ - {species: 'happiny', moves: ['lunge']}, + { species: 'happiny', moves: ['lunge'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'atk', -1, `Attack should be lowered`); }); - it(`should not start Perish Body on either Pokemon`, function () { + it(`should not start Perish Body on either Pokemon`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch'] }, ], [ - {species: 'cursola', ability: 'perishbody', moves: ['sleeptalk']}, + { species: 'cursola', ability: 'perishbody', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false(battle.p1.active[0].volatiles['perishsong'], 'Perish Body should not have activated on Wynaut due to Protective Pads.'); @@ -96,11 +96,11 @@ describe('Protective Pads', function () { assert(battle.log.every(line => !line.includes('Protective Pads'))); }); - it(`should block against Protecting effects with a contact side effect`, function () { + it(`should block against Protecting effects with a contact side effect`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['sleeptalk', 'tackle']}, + { species: 'wynaut', item: 'protectivepads', moves: ['sleeptalk', 'tackle'] }, ], [ - {species: 'aggron', moves: ['sleeptalk', 'banefulbunker', 'obstruct', 'spikyshield']}, + { species: 'aggron', moves: ['sleeptalk', 'banefulbunker', 'obstruct', 'spikyshield'] }, ]]); battle.makeChoices('move tackle', 'move banefulbunker'); battle.makeChoices(); @@ -115,11 +115,11 @@ describe('Protective Pads', function () { assert(battle.log.every(line => !line.includes('Protective Pads'))); }); - it(`should not protect against Gulp Missile when using a contact move`, function () { + it(`should not protect against Gulp Missile when using a contact move`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'protectivepads', moves: ['bulletpunch'] }, ], [ - {species: 'cramorantgorging', ability: 'gulpmissile', item: 'rockyhelmet', moves: ['sleeptalk']}, + { species: 'cramorantgorging', ability: 'gulpmissile', item: 'rockyhelmet', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const wynaut = battle.p1.active[0]; diff --git a/test/sim/items/punchingglove.js b/test/sim/items/punchingglove.js index e6766ee0cf..5617f9c76d 100644 --- a/test/sim/items/punchingglove.js +++ b/test/sim/items/punchingglove.js @@ -5,47 +5,47 @@ const common = require('../../common'); let battle; -describe('Punching Glove', function () { - afterEach(function () { +describe('Punching Glove', () => { + afterEach(() => { battle.destroy(); }); - it(`should prevent item effects triggered by contact from acting`, function () { + it(`should prevent item effects triggered by contact from acting`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'punchingglove', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'punchingglove', moves: ['bulletpunch'] }, ], [ - {species: 'miltank', item: 'rockyhelmet', moves: ['sleeptalk']}, + { species: 'miltank', item: 'rockyhelmet', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p1.active[0], `Attacker should not be hurt`); }); - it(`should not prevent item effects triggered by contact from acting if using non-punching contact move`, function () { + it(`should not prevent item effects triggered by contact from acting if using non-punching contact move`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'punchingglove', moves: ['tackle']}, + { species: 'wynaut', item: 'punchingglove', moves: ['tackle'] }, ], [ - {species: 'miltank', item: 'rockyhelmet', moves: ['sleeptalk']}, + { species: 'miltank', item: 'rockyhelmet', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p1.active[0], `Attacker should be hurt`); }); - it(`should not activate on the opponent's moves`, function () { + it(`should not activate on the opponent's moves`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'punchingglove', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'punchingglove', moves: ['sleeptalk'] }, ], [ - {species: 'happiny', moves: ['lunge']}, + { species: 'happiny', moves: ['lunge'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'atk', -1, `Attack should be lowered`); }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9406865 - it(`should stop Pickpocket`, function () { + it(`should stop Pickpocket`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'punchingglove', moves: ['bulletpunch']}, + { species: 'wynaut', item: 'punchingglove', moves: ['bulletpunch'] }, ], [ - {species: 'weavile', ability: 'pickpocket', moves: ['sleeptalk']}, + { species: 'weavile', ability: 'pickpocket', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].item, 'punchingglove', `Attacker should not lose their item`); @@ -53,11 +53,11 @@ describe('Punching Glove', function () { }); // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9406865 - it(`should block against Protecting effects with a contact side effect`, function () { + it(`should block against Protecting effects with a contact side effect`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'punchingglove', moves: ['sleeptalk', 'bulletpunch']}, + { species: 'wynaut', item: 'punchingglove', moves: ['sleeptalk', 'bulletpunch'] }, ], [ - {species: 'aggron', moves: ['sleeptalk', 'banefulbunker', 'obstruct', 'spikyshield']}, + { species: 'aggron', moves: ['sleeptalk', 'banefulbunker', 'obstruct', 'spikyshield'] }, ]]); battle.makeChoices('move bulletpunch', 'move banefulbunker'); battle.makeChoices(); diff --git a/test/sim/items/quickclaw.js b/test/sim/items/quickclaw.js index a2ee83c045..ab2041c242 100644 --- a/test/sim/items/quickclaw.js +++ b/test/sim/items/quickclaw.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Quick Claw', function () { - afterEach(function () { +describe('Quick Claw', () => { + afterEach(() => { battle.destroy(); }); - it(`[Gen 2] shares its activation roll with every holder on any given turn`, function () { - battle = common.gen(2).createBattle({seed: [1, 2, 3, 27]}, [[ - {species: 'snorlax', item: 'quickclaw', moves: ['sleeptalk']}, + it(`[Gen 2] shares its activation roll with every holder on any given turn`, () => { + battle = common.gen(2).createBattle({ seed: [1, 2, 3, 27] }, [[ + { species: 'snorlax', item: 'quickclaw', moves: ['sleeptalk'] }, ], [ - {species: 'mewtwo', item: 'quickclaw', moves: ['sleeptalk']}, + { species: 'mewtwo', item: 'quickclaw', moves: ['sleeptalk'] }, ]]); const snorlax = battle.p1.active[0]; @@ -27,11 +27,11 @@ describe('Quick Claw', function () { assert.notEqual(snorlax.speed, mewtwo.speed); }); - it(`[Gen 3] causes Speed ties with every holder when activated`, function () { - battle = common.gen(3).createBattle({seed: [163, 106, 112, 542]}, [[ - {species: 'snorlax', item: 'quickclaw', moves: ['spore']}, + it(`[Gen 3] causes Speed ties with every holder when activated`, () => { + battle = common.gen(3).createBattle({ seed: [163, 106, 112, 542] }, [[ + { species: 'snorlax', item: 'quickclaw', moves: ['spore'] }, ], [ - {species: 'deoxys', item: 'quickclaw', moves: ['seismictoss']}, + { species: 'deoxys', item: 'quickclaw', moves: ['seismictoss'] }, ]]); const snorlax = battle.p1.active[0]; diff --git a/test/sim/items/redcard.js b/test/sim/items/redcard.js index b0a4f9d4e2..4972571f08 100644 --- a/test/sim/items/redcard.js +++ b/test/sim/items/redcard.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Red Card', function () { - afterEach(function () { +describe('Red Card', () => { + afterEach(() => { battle.destroy(); }); - it(`should not trigger if the target should be KOed from Destiny Bond and also not crash the client`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Aggron", item: 'redcard', moves: ['rockslide']}, - {species: "Wynaut", ability: 'prankster', level: 1, moves: ['destinybond']}, + it(`should not trigger if the target should be KOed from Destiny Bond and also not crash the client`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Aggron", item: 'redcard', moves: ['rockslide'] }, + { species: "Wynaut", ability: 'prankster', level: 1, moves: ['destinybond'] }, ], [ - {species: "Conkeldurr", moves: ['sleeptalk']}, - {species: "Gardevoir", moves: ['strugglebug']}, - {species: "Corsola", moves: ['sleeptalk']}, + { species: "Conkeldurr", moves: ['sleeptalk'] }, + { species: "Gardevoir", moves: ['strugglebug'] }, + { species: "Corsola", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -25,14 +25,14 @@ describe('Red Card', function () { assert.fainted(battle.p1.pokemon[1], "Gardevoir should faint from Aggron's Destiny Bond"); }); - it(`should trigger if the target is still in battle`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Aggron", item: 'redcard', moves: ['rockslide']}, - {species: "Wynaut", ability: 'prankster', level: 1, moves: ['sleeptalk']}, + it(`should trigger if the target is still in battle`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Aggron", item: 'redcard', moves: ['rockslide'] }, + { species: "Wynaut", ability: 'prankster', level: 1, moves: ['sleeptalk'] }, ], [ - {species: "Conkeldurr", moves: ['sleeptalk']}, - {species: "Gardevoir", moves: ['strugglebug']}, - {species: "Corsola", moves: ['sleeptalk']}, + { species: "Conkeldurr", moves: ['sleeptalk'] }, + { species: "Gardevoir", moves: ['strugglebug'] }, + { species: "Corsola", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/items/ringtarget.js b/test/sim/items/ringtarget.js index 8841b3cd38..1d35be3912 100644 --- a/test/sim/items/ringtarget.js +++ b/test/sim/items/ringtarget.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Ring Target', function () { - afterEach(function () { +describe('Ring Target', () => { + afterEach(() => { battle.destroy(); }); - it(`should negate natural immunities and deal normal type effectiveness with the other type(s)`, function () { + it(`should negate natural immunities and deal normal type effectiveness with the other type(s)`, () => { battle = common.createBattle([[ - {species: "Smeargle", ability: 'owntempo', moves: ['earthquake', 'vitalthrow', 'shadowball', 'psychic']}, + { species: "Smeargle", ability: 'owntempo', moves: ['earthquake', 'vitalthrow', 'shadowball', 'psychic'] }, ], [ - {species: "Thundurus", ability: 'prankster', item: 'ringtarget', moves: ['rest']}, - {species: "Drifblim", ability: 'unburden', item: 'ringtarget', moves: ['rest']}, - {species: "Girafarig", ability: 'innerfocus', item: 'ringtarget', moves: ['rest']}, - {species: "Absol", ability: 'superluck', item: 'ringtarget', moves: ['rest']}, + { species: "Thundurus", ability: 'prankster', item: 'ringtarget', moves: ['rest'] }, + { species: "Drifblim", ability: 'unburden', item: 'ringtarget', moves: ['rest'] }, + { species: "Girafarig", ability: 'innerfocus', item: 'ringtarget', moves: ['rest'] }, + { species: "Absol", ability: 'superluck', item: 'ringtarget', moves: ['rest'] }, ]]); battle.makeChoices('move earthquake', 'move rest'); @@ -36,12 +36,12 @@ describe('Ring Target', function () { assert.false.fullHP(battle.p2.active[0]); }); - it(`should not affect ability-based immunities`, function () { + it(`should not affect ability-based immunities`, () => { battle = common.createBattle([[ - {species: 'Hariyama', moves: ['earthquake']}, + { species: 'Hariyama', moves: ['earthquake'] }, ], [ - {species: 'Mismagius', ability: 'levitate', item: 'ringtarget', moves: ['sleeptalk']}, - {species: 'Rotom-Fan', ability: 'levitate', item: 'ringtarget', moves: ['sleeptalk']}, + { species: 'Mismagius', ability: 'levitate', item: 'ringtarget', moves: ['sleeptalk'] }, + { species: 'Rotom-Fan', ability: 'levitate', item: 'ringtarget', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -52,11 +52,11 @@ describe('Ring Target', function () { assert.fullHP(battle.p2.active[0]); }); - it(`should not affect Magnet Rise`, function () { + it(`should not affect Magnet Rise`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['earthquake']}, + { species: 'Wynaut', moves: ['earthquake'] }, ], [ - {species: 'Klefki', item: 'ringtarget', moves: ['magnetrise']}, + { species: 'Klefki', item: 'ringtarget', moves: ['magnetrise'] }, ]]); battle.makeChoices(); diff --git a/test/sim/items/rockyhelmet.js b/test/sim/items/rockyhelmet.js index 613530dd63..4b4ed41592 100644 --- a/test/sim/items/rockyhelmet.js +++ b/test/sim/items/rockyhelmet.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Rocky Helmet', function () { - afterEach(function () { +describe('Rocky Helmet', () => { + afterEach(() => { battle.destroy(); }); - it("should hurt attackers by 1/6 their max HP when this Pokemon is hit by a contact move", function () { + it("should hurt attackers by 1/6 their max HP when this Pokemon is hit by a contact move", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Haxorus", moves: ['outrage']}]}); - battle.setPlayer('p2', {team: [{species: "Drampa", item: 'rockyhelmet', moves: ['sleeptalk']}]}); + battle.setPlayer('p1', { team: [{ species: "Haxorus", moves: ['outrage'] }] }); + battle.setPlayer('p2', { team: [{ species: "Drampa", item: 'rockyhelmet', moves: ['sleeptalk'] }] }); battle.makeChoices('move outrage', 'move sleeptalk'); const attacker = battle.p1.active[0]; assert.equal(attacker.hp, attacker.maxhp - Math.floor(attacker.maxhp / 6)); diff --git a/test/sim/items/roomservice.js b/test/sim/items/roomservice.js index ce2e12adb7..8b7804d1d9 100644 --- a/test/sim/items/roomservice.js +++ b/test/sim/items/roomservice.js @@ -5,39 +5,39 @@ const common = require('./../../common'); let battle; -describe('Room Service', function () { - afterEach(function () { +describe('Room Service', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate when Trick Room is set`, function () { + it(`should activate when Trick Room is set`, () => { battle = common.createBattle([[ - {species: 'slowpoke', item: 'roomservice', moves: ['sleeptalk']}, + { species: 'slowpoke', item: 'roomservice', moves: ['sleeptalk'] }, ], [ - {species: 'whimsicott', item: 'roomservice', moves: ['trickroom']}, + { species: 'whimsicott', item: 'roomservice', moves: ['trickroom'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'spe', -1); assert.statStage(battle.p2.active[0], 'spe', -1); }); - it(`should activate after entrance Abilities`, function () { + it(`should activate after entrance Abilities`, () => { battle = common.createBattle([[ - {species: 'slowpoke', moves: ['teleport']}, - {species: 'ditto', ability: 'imposter', item: 'roomservice', moves: ['transform']}, + { species: 'slowpoke', moves: ['teleport'] }, + { species: 'ditto', ability: 'imposter', item: 'roomservice', moves: ['transform'] }, ], [ - {species: 'whimsicott', ability: 'prankster', moves: ['trickroom']}, + { species: 'whimsicott', ability: 'prankster', moves: ['trickroom'] }, ]]); battle.makeChoices(); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'spe', -1, `Ditto-Whimsicott should be at -1 Speed after transforming`); }); - it(`should not trigger Defiant`, function () { + it(`should not trigger Defiant`, () => { battle = common.createBattle([[ - {species: 'slowpoke', ability: 'defiant', item: 'roomservice', moves: ['sleeptalk']}, + { species: 'slowpoke', ability: 'defiant', item: 'roomservice', moves: ['sleeptalk'] }, ], [ - {species: 'whimsicott', moves: ['trickroom']}, + { species: 'whimsicott', moves: ['trickroom'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[0], 'atk', 0); diff --git a/test/sim/items/safetygoggles.js b/test/sim/items/safetygoggles.js index 24fd720012..5568727f9a 100644 --- a/test/sim/items/safetygoggles.js +++ b/test/sim/items/safetygoggles.js @@ -5,26 +5,26 @@ const common = require('./../../common'); let battle; -describe('Safety Goggles', function () { - afterEach(function () { +describe('Safety Goggles', () => { + afterEach(() => { battle.destroy(); }); - it(`should be revealed if Terrain is also active`, function () { + it(`should be revealed if Terrain is also active`, () => { battle = common.createBattle([[ - {species: 'tapukoko', ability: 'electricsurge', item: 'safetygoggles', moves: ['sleeptalk']}, + { species: 'tapukoko', ability: 'electricsurge', item: 'safetygoggles', moves: ['sleeptalk'] }, ], [ - {species: 'amoonguss', moves: ['spore']}, + { species: 'amoonguss', moves: ['spore'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.includes('|item: Safety Goggles|'))); }); - it(`should be revealed if the move would have missed`, function () { - battle = common.createBattle({forceRandomChance: false}, [[ - {species: 'yveltal', item: 'safetygoggles', moves: ['sleeptalk']}, + it(`should be revealed if the move would have missed`, () => { + battle = common.createBattle({ forceRandomChance: false }, [[ + { species: 'yveltal', item: 'safetygoggles', moves: ['sleeptalk'] }, ], [ - {species: 'venusaur', moves: ['sleeppowder']}, + { species: 'venusaur', moves: ['sleeppowder'] }, ]]); battle.makeChoices(); diff --git a/test/sim/items/seeds.js b/test/sim/items/seeds.js index c2e0d3e1cc..b5167e21c9 100644 --- a/test/sim/items/seeds.js +++ b/test/sim/items/seeds.js @@ -5,40 +5,40 @@ const common = require('./../../common'); let battle; -describe('Seeds', function () { - afterEach(function () { +describe('Seeds', () => { + afterEach(() => { battle.destroy(); }); - it(`should activate even on a double-switch-in`, function () { + it(`should activate even on a double-switch-in`, () => { battle = common.createBattle([[ - {species: 'Tapu Koko', ability: 'electricsurge', item: 'grassyseed', moves: ['protect']}, + { species: 'Tapu Koko', ability: 'electricsurge', item: 'grassyseed', moves: ['protect'] }, ], [ - {species: 'Tapu Bulu', ability: 'grassysurge', item: 'electricseed', moves: ['protect']}, + { species: 'Tapu Bulu', ability: 'grassysurge', item: 'electricseed', moves: ['protect'] }, ]]); assert.false.holdsItem(battle.p1.active[0]); assert.false.holdsItem(battle.p2.active[0]); }); - it(`should not activate when Magic Room ends`, function () { + it(`should not activate when Magic Room ends`, () => { battle = common.createBattle([[ - {species: 'Tapu Koko', ability: 'electricsurge', moves: ['protect']}, - {species: 'Hawlucha', item: 'electricseed', moves: ['protect']}, + { species: 'Tapu Koko', ability: 'electricsurge', moves: ['protect'] }, + { species: 'Hawlucha', item: 'electricseed', moves: ['protect'] }, ], [ - {species: 'Alakazam', moves: ['magicroom']}, + { species: 'Alakazam', moves: ['magicroom'] }, ]]); battle.makeChoices('move protect', 'move magicroom'); battle.makeChoices('switch 2', 'move magicroom'); assert.holdsItem(battle.p1.active[0]); }); - it(`should activate on switching in after other entrance Abilities, at the same time as Primal reversion`, function () { + it(`should activate on switching in after other entrance Abilities, at the same time as Primal reversion`, () => { battle = common.createBattle([[ - {species: 'Tapu Koko', ability: 'electricsurge', moves: ['finalgambit']}, - {species: 'Groudon', ability: 'drought', item: 'redorb', moves: ['sleeptalk']}, + { species: 'Tapu Koko', ability: 'electricsurge', moves: ['finalgambit'] }, + { species: 'Groudon', ability: 'drought', item: 'redorb', moves: ['sleeptalk'] }, ], [ - {species: 'Bounsweet', moves: ['sleeptalk']}, - {species: 'Shuckle', item: 'electricseed', moves: ['sleeptalk']}, + { species: 'Bounsweet', moves: ['sleeptalk'] }, + { species: 'Shuckle', item: 'electricseed', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -50,13 +50,13 @@ describe('Seeds', function () { assert(redOrbIndex < electricSeedIndex, 'Groudon should undergo Primal Reversion before Electric Seed activates, because Groudon is faster.'); }); - it(`should not cause items passed by Symbiosis to be consumed arbitrarily`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Miraidon', ability: 'hadronengine', item: 'electricseed', moves: ['protect']}, - {species: 'Oranguru', ability: 'symbiosis', item: 'covertcloak', moves: ['protect']}, + it(`should not cause items passed by Symbiosis to be consumed arbitrarily`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Miraidon', ability: 'hadronengine', item: 'electricseed', moves: ['protect'] }, + { species: 'Oranguru', ability: 'symbiosis', item: 'covertcloak', moves: ['protect'] }, ], [ - {species: 'Alakazam', moves: ['sleeptalk']}, - {species: 'Alakazam', moves: ['sleeptalk']}, + { species: 'Alakazam', moves: ['sleeptalk'] }, + { species: 'Alakazam', moves: ['sleeptalk'] }, ]]); assert.equal(battle.p1.active[0].item, 'covertcloak', "Miraidon should hold Covert Cloak"); assert.false.holdsItem(battle.p1.active[1]); diff --git a/test/sim/items/shedshell.js b/test/sim/items/shedshell.js index a21f7c7032..8a981712ef 100644 --- a/test/sim/items/shedshell.js +++ b/test/sim/items/shedshell.js @@ -5,41 +5,41 @@ const common = require('./../../common'); let battle; -describe('Shed Shell', function () { - afterEach(function () { +describe('Shed Shell', () => { + afterEach(() => { battle.destroy(); }); - it('should allow Pokemon to escape trapping abilities', function () { + it('should allow Pokemon to escape trapping abilities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gothitelle", ability: 'shadowtag', moves: ['calmmind']}]}); - battle.setPlayer('p2', {team: [ - {species: "Starmie", ability: 'naturalcure', item: 'shedshell', moves: ['recover']}, - {species: "Heatran", ability: 'flashfire', moves: ['rest']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Gothitelle", ability: 'shadowtag', moves: ['calmmind'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Starmie", ability: 'naturalcure', item: 'shedshell', moves: ['recover'] }, + { species: "Heatran", ability: 'flashfire', moves: ['rest'] }, + ] }); battle.makeChoices('move calmmind', 'switch 2'); assert.species(battle.p2.active[0], 'Heatran'); }); - it('should allow Pokemon to escape from most moves that would trap them', function () { + it('should allow Pokemon to escape from most moves that would trap them', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gengar", ability: 'levitate', moves: ['meanlook']}]}); - battle.setPlayer('p2', {team: [ - {species: "Venusaur", ability: 'overgrow', item: 'shedshell', moves: ['ingrain']}, - {species: "Heatran", ability: 'flashfire', moves: ['rest']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Gengar", ability: 'levitate', moves: ['meanlook'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Venusaur", ability: 'overgrow', item: 'shedshell', moves: ['ingrain'] }, + { species: "Heatran", ability: 'flashfire', moves: ['rest'] }, + ] }); battle.makeChoices('move meanlook', 'move ingrain'); battle.makeChoices('move meanlook', 'switch 2'); assert.species(battle.p2.active[0], 'Heatran'); }); - it('should not allow Pokemon to escape from Sky Drop', function () { + it('should not allow Pokemon to escape from Sky Drop', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Dragonite", ability: 'multiscale', moves: ['skydrop']}]}); - battle.setPlayer('p2', {team: [ - {species: "Magnezone", ability: 'sturdy', item: 'shedshell', moves: ['sleeptalk']}, - {species: "Heatran", ability: 'flashfire', moves: ['rest']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Dragonite", ability: 'multiscale', moves: ['skydrop'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Magnezone", ability: 'sturdy', item: 'shedshell', moves: ['sleeptalk'] }, + { species: "Heatran", ability: 'flashfire', moves: ['rest'] }, + ] }); battle.makeChoices('move skydrop', 'move sleeptalk'); assert.trapped(() => battle.makeChoices('move skydrop', 'switch 2')); assert.species(battle.p2.active[0], 'Magnezone'); diff --git a/test/sim/items/shellbell.js b/test/sim/items/shellbell.js index ea17374cfe..164e4aa81c 100644 --- a/test/sim/items/shellbell.js +++ b/test/sim/items/shellbell.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Shell Bell', function () { - afterEach(function () { +describe('Shell Bell', () => { + afterEach(() => { battle.destroy(); }); - it(`should heal from the damage against all targets of the move`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'tornadus', ability: 'compoundeyes', moves: ['superfang']}, - {species: 'landorus', item: 'shellbell', moves: ['earthquake']}, + it(`should heal from the damage against all targets of the move`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'tornadus', ability: 'compoundeyes', moves: ['superfang'] }, + { species: 'landorus', item: 'shellbell', moves: ['earthquake'] }, ], [ - {species: 'roggenrola', ability: 'sturdy', level: 1, moves: ['sleeptalk']}, - {species: 'aron', ability: 'sturdy', level: 1, moves: ['sleeptalk']}, + { species: 'roggenrola', ability: 'sturdy', level: 1, moves: ['sleeptalk'] }, + { species: 'aron', ability: 'sturdy', level: 1, moves: ['sleeptalk'] }, ]]); battle.makeChoices('move superfang -2, move earthquake', 'auto'); const landorus = battle.p1.active[1]; @@ -24,13 +24,13 @@ describe('Shell Bell', function () { }); // Also applies to Parental Bond - it(`should heal from the damage from all hits of multi-hit moves`, function () { + it(`should heal from the damage from all hits of multi-hit moves`, () => { battle = common.createBattle([[ - {species: 'shelmet', moves: ['finalgambit']}, - {species: 'landorus', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'shelmet', moves: ['finalgambit'] }, + { species: 'landorus', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'cloyster', ability: 'skilllink', item: 'shellbell', evs: {hp: 4}, moves: ['sleeptalk', 'iciclespear']}, + { species: 'cloyster', ability: 'skilllink', item: 'shellbell', evs: { hp: 4 }, moves: ['sleeptalk', 'iciclespear'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2'); diff --git a/test/sim/items/sitrusberry.js b/test/sim/items/sitrusberry.js index 1e9f162cb6..50dec19d5a 100644 --- a/test/sim/items/sitrusberry.js +++ b/test/sim/items/sitrusberry.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Sitrus Berry', function () { - afterEach(function () { +describe('Sitrus Berry', () => { + afterEach(() => { battle.destroy(); }); - it('should heal 25% hp when consumed', function () { + it('should heal 25% hp when consumed', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Aggron', ability: 'sturdy', item: 'sitrusberry', moves: ['sleeptalk']}]}); - battle.setPlayer('p2', {team: [{species: 'Lucario', ability: 'adaptability', moves: ['aurasphere']}]}); + battle.setPlayer('p1', { team: [{ species: 'Aggron', ability: 'sturdy', item: 'sitrusberry', moves: ['sleeptalk'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Lucario', ability: 'adaptability', moves: ['aurasphere'] }] }); const holder = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'move aurasphere'); assert.false.holdsItem(holder); assert.equal(holder.hp, Math.floor(holder.maxhp / 4) + 1); }); - it('should be eaten immediately if (re)gained on low hp', function () { + it('should be eaten immediately if (re)gained on low hp', () => { battle = common.createBattle([ - [{species: 'Magnemite', ability: 'sturdy', item: 'sitrusberry', moves: ['recycle']}], - [{species: 'Garchomp', ability: 'roughskin', moves: ['earthquake']}], + [{ species: 'Magnemite', ability: 'sturdy', item: 'sitrusberry', moves: ['recycle'] }], + [{ species: 'Garchomp', ability: 'roughskin', moves: ['earthquake'] }], ]); const holder = battle.p1.active[0]; const hpgain = Math.floor(holder.maxhp / 4); @@ -32,20 +32,20 @@ describe('Sitrus Berry', function () { assert.equal(holder.hp, hpgain + hpgain + 1); }); - it('should not heal if Knocked Off', function () { + it('should not heal if Knocked Off', () => { battle = common.createBattle([ - [{species: 'Deoxys-Attack', ability: 'sturdy', item: 'sitrusberry', moves: ['sleeptalk']}], - [{species: 'Krookodile', ability: 'intimidate', moves: ['knockoff']}], + [{ species: 'Deoxys-Attack', ability: 'sturdy', item: 'sitrusberry', moves: ['sleeptalk'] }], + [{ species: 'Krookodile', ability: 'intimidate', moves: ['knockoff'] }], ]); battle.makeChoices('move sleeptalk', 'move knockoff'); assert.equal(battle.p1.active[0].hp, 1); }); - it.skip(`should not heal 25% HP if a confusion self-hit would bring the user into Berry trigger range`, function () { + it.skip(`should not heal 25% HP if a confusion self-hit would bring the user into Berry trigger range`, () => { battle = common.createBattle([[ - {species: 'Deoxys-Attack', item: 'sitrusberry', moves: ['sleeptalk']}, + { species: 'Deoxys-Attack', item: 'sitrusberry', moves: ['sleeptalk'] }, ], [ - {species: 'Sableye', ability: 'prankster', moves: ['confuseray']}, + { species: 'Sableye', ability: 'prankster', moves: ['confuseray'] }, ]]); const holder = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'move confuseray'); @@ -53,11 +53,11 @@ describe('Sitrus Berry', function () { assert.false.fullHP(holder); }); - it.skip(`should heal 25% HP immediately after any end-of-turn effect`, function () { + it.skip(`should heal 25% HP immediately after any end-of-turn effect`, () => { battle = common.createBattle([[ - {species: 'mimikyu', moves: ['curse']}, + { species: 'mimikyu', moves: ['curse'] }, ], [ - {species: 'darmanitan', ability: 'zenmode', item: 'sitrusberry', moves: ['sleeptalk'], evs: {hp: 4}}, + { species: 'darmanitan', ability: 'zenmode', item: 'sitrusberry', moves: ['sleeptalk'], evs: { hp: 4 } }, ]]); const darm = battle.p2.active[0]; battle.makeChoices(); diff --git a/test/sim/items/weaknesspolicy.js b/test/sim/items/weaknesspolicy.js index 1583209c46..7cca485407 100644 --- a/test/sim/items/weaknesspolicy.js +++ b/test/sim/items/weaknesspolicy.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Weakness Policy', function () { - afterEach(function () { +describe('Weakness Policy', () => { + afterEach(() => { battle.destroy(); }); - it('should be triggered by super effective hits', function () { + it('should be triggered by super effective hits', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Lucario", ability: 'justified', moves: ['aurasphere']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Blissey", ability: 'naturalcure', item: 'weaknesspolicy', moves: ['softboiled']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Lucario", ability: 'justified', moves: ['aurasphere'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Blissey", ability: 'naturalcure', item: 'weaknesspolicy', moves: ['softboiled'] }, + ] }); const holder = battle.p2.active[0]; battle.makeChoices('move aurasphere', 'move softboiled'); assert.false.holdsItem(holder); @@ -25,16 +25,16 @@ describe('Weakness Policy', function () { assert.statStage(holder, 'spa', 2); }); - it('should respect individual type effectivenesses in doubles', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Stunfisk", ability: 'limber', moves: ['earthquake', 'surf', 'discharge']}, - {species: "Volcarona", ability: 'swarm', item: 'weaknesspolicy', moves: ['roost']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Zekrom", ability: 'teravolt', item: 'weaknesspolicy', moves: ['roost']}, - {species: "Pyukumuku", ability: 'unaware', item: 'weaknesspolicy', moves: ['recover']}, - ]}); + it('should respect individual type effectivenesses in doubles', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Stunfisk", ability: 'limber', moves: ['earthquake', 'surf', 'discharge'] }, + { species: "Volcarona", ability: 'swarm', item: 'weaknesspolicy', moves: ['roost'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Zekrom", ability: 'teravolt', item: 'weaknesspolicy', moves: ['roost'] }, + { species: "Pyukumuku", ability: 'unaware', item: 'weaknesspolicy', moves: ['recover'] }, + ] }); const zekrom = battle.p2.active[0]; const pyuk = battle.p2.active[1]; const volc = battle.p1.active[1]; @@ -79,14 +79,14 @@ describe('Weakness Policy', function () { assert.statStage(volc, 'spa', 2); }); - it('should not be triggered by fixed damage moves', function () { + it('should not be triggered by fixed damage moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Lucario", ability: 'justified', moves: ['seismictoss']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Blissey", ability: 'naturalcure', item: 'weaknesspolicy', moves: ['softboiled']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Lucario", ability: 'justified', moves: ['seismictoss'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Blissey", ability: 'naturalcure', item: 'weaknesspolicy', moves: ['softboiled'] }, + ] }); const holder = battle.p2.active[0]; battle.makeChoices('move seismictoss', 'move softboiled'); assert.holdsItem(holder); @@ -94,12 +94,12 @@ describe('Weakness Policy', function () { assert.statStage(holder, 'spa', 0); }); - it(`should trigger before forced switching moves`, function () { + it(`should trigger before forced switching moves`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'compoundeyes', moves: ['dragontail']}, + { species: 'wynaut', ability: 'compoundeyes', moves: ['dragontail'] }, ], [ - {species: 'zygarde', item: 'weaknesspolicy', moves: ['sleeptalk']}, - {species: 'aron', moves: ['sleeptalk']}, + { species: 'zygarde', item: 'weaknesspolicy', moves: ['sleeptalk'] }, + { species: 'aron', moves: ['sleeptalk'] }, ]]); const zygarde = battle.p2.active[0]; battle.makeChoices(); diff --git a/test/sim/items/whiteherb.js b/test/sim/items/whiteherb.js index 73229dbe49..1d367d5826 100644 --- a/test/sim/items/whiteherb.js +++ b/test/sim/items/whiteherb.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe("White Herb", function () { - afterEach(function () { +describe("White Herb", () => { + afterEach(() => { battle.destroy(); }); - it('should activate after Parting Shot drops both stats, but before the switch is resolved', function () { + it('should activate after Parting Shot drops both stats, but before the switch is resolved', () => { battle = common.createBattle([[ - {species: 'torracat', moves: ['partingshot']}, - {species: 'litten', moves: ['sleeptalk']}, + { species: 'torracat', moves: ['partingshot'] }, + { species: 'litten', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', item: 'whiteherb', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'whiteherb', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const wynaut = battle.p2.active[0]; @@ -24,12 +24,12 @@ describe("White Herb", function () { assert.statStage(wynaut, 'spa', 0); }); - it.skip('should activate after Abilities that boost stats on KOs', function () { + it.skip('should activate after Abilities that boost stats on KOs', () => { battle = common.createBattle([[ - {species: 'litten', level: 1, ability: 'noguard', moves: ['sleeptalk']}, - {species: 'torracat', moves: ['partingshot']}, + { species: 'litten', level: 1, ability: 'noguard', moves: ['sleeptalk'] }, + { species: 'torracat', moves: ['partingshot'] }, ], [ - {species: 'wynaut', item: 'whiteherb', ability: 'grimneigh', moves: ['dracometeor']}, + { species: 'wynaut', item: 'whiteherb', ability: 'grimneigh', moves: ['dracometeor'] }, ]]); battle.makeChoices(); const wynaut = battle.p2.active[0]; @@ -37,15 +37,15 @@ describe("White Herb", function () { assert.statStage(wynaut, 'spa', 0); }); - it('should activate after two Intimidate switch in at the same time', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'litten', ability: 'intimidate', moves: ['sleeptalk']}, - {species: 'torracat', ability: 'intimidate', moves: ['sleeptalk', 'finalgambit']}, - {species: 'litten', ability: 'intimidate', moves: ['sleeptalk']}, - {species: 'landorustherian', ability: 'intimidate', moves: ['sleeptalk']}, + it('should activate after two Intimidate switch in at the same time', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'litten', ability: 'intimidate', moves: ['sleeptalk'] }, + { species: 'torracat', ability: 'intimidate', moves: ['sleeptalk', 'finalgambit'] }, + { species: 'litten', ability: 'intimidate', moves: ['sleeptalk'] }, + { species: 'landorustherian', ability: 'intimidate', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', item: 'whiteherb', moves: ['sleeptalk', 'recycle']}, - {species: 'fraxure', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'whiteherb', moves: ['sleeptalk', 'recycle'] }, + { species: 'fraxure', moves: ['sleeptalk'] }, ]]); // Leads @@ -61,15 +61,15 @@ describe("White Herb", function () { assert.statStage(wynaut, 'atk', 0); }); - it('should activate before Opportunist during switch-ins', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'axew', moves: ['sleeptalk']}, - {species: 'fraxure', moves: ['finalgambit']}, - {species: 'zacian', ability: 'intrepidsword', moves: ['sleeptalk']}, - {species: 'torracat', ability: 'intimidate', moves: ['sleeptalk']}, + it('should activate before Opportunist during switch-ins', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'axew', moves: ['sleeptalk'] }, + { species: 'fraxure', moves: ['finalgambit'] }, + { species: 'zacian', ability: 'intrepidsword', moves: ['sleeptalk'] }, + { species: 'torracat', ability: 'intimidate', moves: ['sleeptalk'] }, ], [ - {species: 'flittle', item: 'whiteherb', ability: 'opportunist', moves: ['sleeptalk']}, - {species: 'haxorus', moves: ['sleeptalk']}, + { species: 'flittle', item: 'whiteherb', ability: 'opportunist', moves: ['sleeptalk'] }, + { species: 'haxorus', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk, move finalgambit -1', 'auto'); battle.makeChoices('switch 3, switch 4'); diff --git a/test/sim/misc/accuracy.js b/test/sim/misc/accuracy.js index c52e5dd1a8..6d0a619c92 100644 --- a/test/sim/misc/accuracy.js +++ b/test/sim/misc/accuracy.js @@ -5,59 +5,59 @@ const common = require('./../../common'); let battle; -describe("Accuracy", function () { - afterEach(function () { +describe("Accuracy", () => { + afterEach(() => { battle.destroy(); }); - it(`should round half down when applying a modifier`, function () { + it(`should round half down when applying a modifier`, () => { battle = common.createBattle([ - [{species: 'Butterfree', ability: 'compoundeyes', moves: ['sleeppowder']}], - [{species: 'Beldum', moves: ['poltergeist']}], + [{ species: 'Butterfree', ability: 'compoundeyes', moves: ['sleeppowder'] }], + [{ species: 'Beldum', moves: ['poltergeist'] }], ]); - battle.onEvent('Accuracy', battle.format, function (accuracy) { + battle.onEvent('Accuracy', battle.format, accuracy => { assert.equal(accuracy, 98, 'CompoundEyes Sleep Powder should be 98% accurate'); }); battle.makeChoices(); battle = common.createBattle([ - [{species: 'Butterfree', ability: 'victorystar', moves: ['fireblast']}], - [{species: 'Regirock', moves: ['sleeptalk']}], + [{ species: 'Butterfree', ability: 'victorystar', moves: ['fireblast'] }], + [{ species: 'Regirock', moves: ['sleeptalk'] }], ]); - battle.onEvent('Accuracy', battle.format, function (accuracy) { + battle.onEvent('Accuracy', battle.format, accuracy => { assert.equal(accuracy, 94, 'Victory Star Fire Blast should be 94% accurate'); }); battle.makeChoices(); battle = common.createBattle([ - [{species: 'Butterfree', item: 'widelens', moves: ['fireblast']}], - [{species: 'Regirock', moves: ['sleeptalk']}], + [{ species: 'Butterfree', item: 'widelens', moves: ['fireblast'] }], + [{ species: 'Regirock', moves: ['sleeptalk'] }], ]); - battle.onEvent('Accuracy', battle.format, function (accuracy) { + battle.onEvent('Accuracy', battle.format, accuracy => { assert.equal(accuracy, 93, 'Wide Lens Fire Blast should be 93% accurate'); }); battle.makeChoices(); }); - it(`should chain modifiers in order of the Pokemon's raw speed`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Mewtwo', ability: 'victorystar', moves: ['gravity', 'sleeptalk', 'sandattack']}, - {species: 'Charizard', ability: 'compoundeyes', moves: ['sleeptalk', 'fireblast']}, + it(`should chain modifiers in order of the Pokemon's raw speed`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Mewtwo', ability: 'victorystar', moves: ['gravity', 'sleeptalk', 'sandattack'] }, + { species: 'Charizard', ability: 'compoundeyes', moves: ['sleeptalk', 'fireblast'] }, ], [ - {species: 'Bonsly', ability: 'tangledfeet', moves: ['doubleteam', 'sleeptalk']}, - {species: 'Pyukumuku', ability: 'noguard', moves: ['confuseray', 'sandattack', 'sleeptalk']}, + { species: 'Bonsly', ability: 'tangledfeet', moves: ['doubleteam', 'sleeptalk'] }, + { species: 'Pyukumuku', ability: 'noguard', moves: ['confuseray', 'sandattack', 'sleeptalk'] }, ]]); battle.makeChoices('move sandattack -2, move sleeptalk', 'move doubleteam, move sandattack 2'); battle.makeChoices('auto', 'move sleeptalk, move confuseray -1'); - battle.onEvent('Accuracy', battle.format, function (accuracy, target, source, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, source, move) => { if (move.id !== 'fireblast') return; assert.equal(accuracy, 51); }); @@ -65,18 +65,18 @@ describe("Accuracy", function () { battle.makeChoices('move gravity, move fire blast 1', 'move sleeptalk, move sleeptalk'); // Changing the Pokemon's Speeds around changes the chaining order, which affects the result - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Bonsly', ability: 'victorystar', moves: ['gravity', 'sleeptalk', 'sandattack']}, - {species: 'Charizard', ability: 'compoundeyes', moves: ['sleeptalk', 'fireblast']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Bonsly', ability: 'victorystar', moves: ['gravity', 'sleeptalk', 'sandattack'] }, + { species: 'Charizard', ability: 'compoundeyes', moves: ['sleeptalk', 'fireblast'] }, ], [ - {species: 'Mewtwo', ability: 'tangledfeet', moves: ['doubleteam', 'sleeptalk']}, - {species: 'Pyukumuku', ability: 'noguard', moves: ['confuseray', 'sandattack', 'sleeptalk']}, + { species: 'Mewtwo', ability: 'tangledfeet', moves: ['doubleteam', 'sleeptalk'] }, + { species: 'Pyukumuku', ability: 'noguard', moves: ['confuseray', 'sandattack', 'sleeptalk'] }, ]]); battle.makeChoices('move sandattack -2, move sleeptalk', 'move doubleteam, move sandattack 2'); battle.makeChoices('auto', 'move sleeptalk, move confuseray -1'); - battle.onEvent('Accuracy', battle.format, function (accuracy, target, source, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, source, move) => { if (move.id !== 'fireblast') return; assert.equal(accuracy, 50); }); diff --git a/test/sim/misc/arceus.js b/test/sim/misc/arceus.js index d1c0b53fe4..04a52e40c9 100644 --- a/test/sim/misc/arceus.js +++ b/test/sim/misc/arceus.js @@ -4,12 +4,12 @@ const assert = require('assert').strict; const common = require('./../../common'); let battle; -const unimportantPokemon = {species: 'magikarp', moves: ['splash']}; +const unimportantPokemon = { species: 'magikarp', moves: ['splash'] }; -describe(`[Hackmons] Arceus`, function () { - it(`in untyped forme should change its type to match the plate held`, function () { +describe(`[Hackmons] Arceus`, () => { + it(`in untyped forme should change its type to match the plate held`, () => { battle = common.gen(4).createBattle([[ - {species: 'arceus', ability: 'multitype', item: 'flameplate', moves: ['rest']}, + { species: 'arceus', ability: 'multitype', item: 'flameplate', moves: ['rest'] }, ], [ unimportantPokemon, ]]); @@ -17,9 +17,9 @@ describe(`[Hackmons] Arceus`, function () { assert(arceus.hasType('Fire')); }); - it(`in Steel forme should should be Water-typed to match the held Splash Plate`, function () { + it(`in Steel forme should should be Water-typed to match the held Splash Plate`, () => { battle = common.gen(4).createBattle([[ - {species: 'arceussteel', ability: 'multitype', item: 'splashplate', moves: ['rest']}, + { species: 'arceussteel', ability: 'multitype', item: 'splashplate', moves: ['rest'] }, ], [ unimportantPokemon, ]]); @@ -27,9 +27,9 @@ describe(`[Hackmons] Arceus`, function () { assert(arceus.hasType('Water')); }); - it(`in a typed forme should be Normal-typed if no plate is held`, function () { + it(`in a typed forme should be Normal-typed if no plate is held`, () => { battle = common.gen(4).createBattle([[ - {species: 'arceusfire', ability: 'multitype', item: 'leftovers', moves: ['rest']}, + { species: 'arceusfire', ability: 'multitype', item: 'leftovers', moves: ['rest'] }, ], [ unimportantPokemon, ]]); @@ -37,9 +37,9 @@ describe(`[Hackmons] Arceus`, function () { assert(arceus.hasType('Normal')); }); - it(`in a typed forme should be Normal-typed despite holding a plate if Arceus does not have the Multitype ability`, function () { + it(`in a typed forme should be Normal-typed despite holding a plate if Arceus does not have the Multitype ability`, () => { battle = common.gen(4).createBattle([[ - {species: 'arceusfire', ability: 'truant', item: 'flameplate', moves: ['rest']}, + { species: 'arceusfire', ability: 'truant', item: 'flameplate', moves: ['rest'] }, ], [ unimportantPokemon, ]]); @@ -47,22 +47,22 @@ describe(`[Hackmons] Arceus`, function () { assert(arceus.hasType('Normal')); }); - it(`should not be able to lose its typing`, function () { + it(`should not be able to lose its typing`, () => { battle = common.createBattle([[ - {species: 'arceus', ability: 'multitype', item: 'flameplate', moves: ['burnup']}, + { species: 'arceus', ability: 'multitype', item: 'flameplate', moves: ['burnup'] }, ], [ - {species: 'reuniclus', moves: ['soak']}, + { species: 'reuniclus', moves: ['soak'] }, ]]); battle.makeChoices(); const arceus = battle.p1.active[0]; assert(arceus.hasType('Fire'), 'Arceus should not change type.'); }); - it(`should use Arceus's real type for Revelation Dance`, function () { + it(`should use Arceus's real type for Revelation Dance`, () => { battle = common.gen(7).createBattle([[ - {species: 'arceusfire', ability: 'sandrush', moves: ['revelationdance']}, + { species: 'arceusfire', ability: 'sandrush', moves: ['revelationdance'] }, ], [ - {species: 'aggron', ability: 'colorchange', moves: ['sleeptalk']}, + { species: 'aggron', ability: 'colorchange', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const aggron = battle.p2.active[0]; diff --git a/test/sim/misc/ateabilities.js b/test/sim/misc/ateabilities.js index 0d767b791e..01187ff9ba 100644 --- a/test/sim/misc/ateabilities.js +++ b/test/sim/misc/ateabilities.js @@ -5,29 +5,29 @@ const common = require('../../common'); let battle; -const ates = {Refrigerate: 'Ice', Pixilate: 'Fairy', Aerilate: 'Flying', Galvanize: 'Electric'}; +const ates = { Refrigerate: 'Ice', Pixilate: 'Fairy', Aerilate: 'Flying', Galvanize: 'Electric' }; for (const ate in ates) { - describe(ate, function () { - afterEach(function () { + describe(ate, () => { + afterEach(() => { battle.destroy(); }); - it(`should make most Normal type moves become ${ates[ate]} type`, function () { + it(`should make most Normal type moves become ${ates[ate]} type`, () => { battle = common.createBattle([[ - {species: 'Genesect', ability: ate, moves: ['hypervoice']}, + { species: 'Genesect', ability: ate, moves: ['hypervoice'] }, ], [ - {species: 'Gengar', moves: ['sleeptalk']}, + { species: 'Gengar', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it('should boost the power of Normal type attacks by 20% when changing their type', function () { + it('should boost the power of Normal type attacks by 20% when changing their type', () => { battle = common.createBattle([[ - {species: 'Genesect', ability: ate, moves: ['hypervoice']}, + { species: 'Genesect', ability: ate, moves: ['hypervoice'] }, ], [ - {species: 'Blissey', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'Blissey', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.bounded(battle.p2.active[0].hp, [651 - 83, 651 - 70]); diff --git a/test/sim/misc/confusion.js b/test/sim/misc/confusion.js index 30be0208e3..dbf57f24e7 100644 --- a/test/sim/misc/confusion.js +++ b/test/sim/misc/confusion.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Confusion', function () { - afterEach(function () { +describe('Confusion', () => { + afterEach(() => { battle.destroy(); }); - it(`should not be affected by modifiers like Huge Power or Life Orb`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Deoxys-Attack', ability: 'hugepower', item: 'lifeorb', moves: ['sleeptalk']}, + it(`should not be affected by modifiers like Huge Power or Life Orb`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Deoxys-Attack', ability: 'hugepower', item: 'lifeorb', moves: ['sleeptalk'] }, ], [ - {species: 'Sableye', ability: 'prankster', moves: ['confuseray']}, + { species: 'Sableye', ability: 'prankster', moves: ['confuseray'] }, ]]); battle.makeChoices(); const deoxys = battle.p1.active[0]; diff --git a/test/sim/misc/critical.js b/test/sim/misc/critical.js index 6be37762f9..27c5722ad6 100644 --- a/test/sim/misc/critical.js +++ b/test/sim/misc/critical.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Critical hits', function () { - afterEach(function () { +describe('Critical hits', () => { + afterEach(() => { battle.destroy(); }); - it(`should not happen on self-hits`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Zubat', moves: ['confuseray']}, + it(`should not happen on self-hits`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Zubat', moves: ['confuseray'] }, ], [ - {species: 'Chansey', item: 'luckypunch', ability: 'superluck', moves: ['softboiled']}, + { species: 'Chansey', item: 'luckypunch', ability: 'superluck', moves: ['softboiled'] }, ]]); battle.makeChoices('move confuseray', 'move softboiled'); diff --git a/test/sim/misc/dynamax.js b/test/sim/misc/dynamax.js index 9d3d70632f..1446a4a0c4 100644 --- a/test/sim/misc/dynamax.js +++ b/test/sim/misc/dynamax.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe("Dynamax", function () { - afterEach(function () { +describe("Dynamax", () => { + afterEach(() => { battle.destroy(); }); - it('Max Move effects should not be suppressed by Sheer Force', function () { + it('Max Move effects should not be suppressed by Sheer Force', () => { battle = common.gen(8).createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Braviary', ability: 'sheerforce', moves: ['heatwave', 'facade', 'superpower']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Shedinja', ability: 'sturdy', item: 'ringtarget', moves: ['splash']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Braviary', ability: 'sheerforce', moves: ['heatwave', 'facade', 'superpower'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Shedinja', ability: 'sturdy', item: 'ringtarget', moves: ['splash'] }, + ] }); battle.makeChoices('move heatwave dynamax', 'auto'); assert.equal(battle.field.weather, 'sunnyday'); battle.makeChoices('move facade', 'auto'); @@ -26,11 +26,11 @@ describe("Dynamax", function () { assert.statStage(battle.p1.active[0], 'atk', 1); }); - it('Max Move versions of disabled moves should not be disabled, except by Assault Vest', function () { + it('Max Move versions of disabled moves should not be disabled, except by Assault Vest', () => { battle = common.gen(8).createBattle([[ - {species: 'Mew', item: 'assaultvest', moves: ['watergun', 'protect']}, + { species: 'Mew', item: 'assaultvest', moves: ['watergun', 'protect'] }, ], [ - {species: 'Mew', item: 'choiceband', moves: ['watergun', 'protect']}, + { species: 'Mew', item: 'choiceband', moves: ['watergun', 'protect'] }, ]]); battle.makeChoices('move 1 dynamax', 'move 1 dynamax'); assert.throws(() => { @@ -39,44 +39,44 @@ describe("Dynamax", function () { battle.makeChoices('move 1', 'move 2'); }); - it('Max Move weather activates even if foe faints', function () { + it('Max Move weather activates even if foe faints', () => { battle = common.gen(8).createBattle([[ - {species: 'Shedinja', moves: ['splash']}, + { species: 'Shedinja', moves: ['splash'] }, ], [ - {species: 'Mew', moves: ['watergun']}, + { species: 'Mew', moves: ['watergun'] }, ]]); battle.makeChoices('move 1', 'move 1 dynamax'); assert.equal(battle.field.weather, 'raindance'); }); - it('Max Move weather activates before Sand Spit', function () { + it('Max Move weather activates before Sand Spit', () => { battle = common.gen(8).createBattle([[ - {species: 'Shedinja', ability: 'sandspit', moves: ['splash']}, + { species: 'Shedinja', ability: 'sandspit', moves: ['splash'] }, ], [ - {species: 'Mew', moves: ['watergun']}, + { species: 'Mew', moves: ['watergun'] }, ]]); battle.makeChoices('move 1', 'move 1 dynamax'); assert.equal(battle.field.weather, 'sandstorm'); }); - it('makes Liquid Voice stop working', function () { + it('makes Liquid Voice stop working', () => { battle = common.gen(8).createBattle([[ - {species: 'Primarina', ability: 'liquidvoice', moves: ['hypervoice']}, + { species: 'Primarina', ability: 'liquidvoice', moves: ['hypervoice'] }, ], [ - {species: 'Rhyhorn', ability: 'wonderguard', moves: ['splash']}, + { species: 'Rhyhorn', ability: 'wonderguard', moves: ['splash'] }, ]]); battle.makeChoices('move 1 dynamax', 'move 1'); assert.equal(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should execute in order of updated speed when 2 or more Pokemon are Dynamaxing', function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'kingdra', ability: 'swiftswim', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'groudon', ability: 'drought', moves: ['sleeptalk']}, + it('should execute in order of updated speed when 2 or more Pokemon are Dynamaxing', () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'kingdra', ability: 'swiftswim', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'groudon', ability: 'drought', moves: ['sleeptalk'] }, ], [ - {species: 'kyogre', ability: 'drizzle', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'kyogre', ability: 'drizzle', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk dynamax, switch 3', 'move sleeptalk dynamax, auto'); const log = battle.getDebugLog(); @@ -85,12 +85,12 @@ describe("Dynamax", function () { assert(kyogreMaxIndex < kingdraMaxIndex, 'Kyogre should have Dynamaxed before Kingdra.'); }); - it('should revert before the start of the 4th turn, not as an end-of-turn effect on the 3rd turn', function () { + it('should revert before the start of the 4th turn, not as an end-of-turn effect on the 3rd turn', () => { battle = common.gen(8).createBattle([[ - {species: 'wynaut', moves: ['sleeptalk', 'psychic']}, + { species: 'wynaut', moves: ['sleeptalk', 'psychic'] }, ], [ - {species: 'weedle', level: 1, moves: ['sleeptalk']}, - {species: 'weedle', moves: ['sleeptalk']}, + { species: 'weedle', level: 1, moves: ['sleeptalk'] }, + { species: 'weedle', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk dynamax', 'auto'); battle.makeChoices(); @@ -101,20 +101,20 @@ describe("Dynamax", function () { assert.false(wynaut.volatiles['dynamax'], 'Start of 4th turn, Wynaut should not be Dynamaxed.'); }); - it('should be impossible to Dynamax when all the base moves are disabled', function () { + it('should be impossible to Dynamax when all the base moves are disabled', () => { battle = common.gen(8).createBattle([[ - {species: "Feebas", moves: ['splash']}, + { species: "Feebas", moves: ['splash'] }, ], [ - {species: "Wynaut", moves: ['taunt', 'splash']}, + { species: "Wynaut", moves: ['taunt', 'splash'] }, ]]); battle.makeChoices(); assert.cantMove(() => battle.choose('p1', 'move splash dynamax')); assert.cantMove(() => battle.choose('p1', 'move struggle dynamax')); battle = common.gen(8).createBattle([[ - {species: "Feebas", moves: ['splash']}, + { species: "Feebas", moves: ['splash'] }, ], [ - {species: "Wynaut", moves: ['imprison', 'splash']}, + { species: "Wynaut", moves: ['imprison', 'splash'] }, ]]); battle.makeChoices(); battle.makeChoices('move 1', 'auto'); @@ -122,13 +122,13 @@ describe("Dynamax", function () { assert.cantMove(() => battle.choose('p1', 'move struggle dynamax')); }); - it(`should not allow the user to select max moves with 0 base PP remaining`, function () { + it(`should not allow the user to select max moves with 0 base PP remaining`, () => { battle = common.gen(8).createBattle([[ - {species: 'pichu', ability: 'prankster', level: 1, moves: ['grudge']}, - {species: 'noibat', ability: 'prankster', level: 1, moves: ['grudge']}, - {species: 'azurill', moves: ['sleeptalk']}, + { species: 'pichu', ability: 'prankster', level: 1, moves: ['grudge'] }, + { species: 'noibat', ability: 'prankster', level: 1, moves: ['grudge'] }, + { species: 'azurill', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['earthquake', 'icebeam']}, + { species: 'wynaut', moves: ['earthquake', 'icebeam'] }, ]]); battle.makeChoices('auto', 'move earthquake dynamax'); @@ -141,11 +141,11 @@ describe("Dynamax", function () { battle.makeChoices('auto', 'move struggle'); // will throw an error if Wynaut isn't forced to use Struggle }); - it(`should force the user to use Struggle if certain effects are disabling all of its base moves`, function () { + it(`should force the user to use Struggle if certain effects are disabling all of its base moves`, () => { battle = common.gen(8).createBattle([[ - {species: "Skwovet", item: 'oranberry', moves: ['sleeptalk', 'belch', 'stuffcheeks']}, + { species: "Skwovet", item: 'oranberry', moves: ['sleeptalk', 'belch', 'stuffcheeks'] }, ], [ - {species: "Calyrex-Shadow", moves: ['disable', 'trick']}, + { species: "Calyrex-Shadow", moves: ['disable', 'trick'] }, ]]); battle.makeChoices(); // Skwovet's Sleep Talk and Belch are disabled, but Stuff Cheeks isn't so Skwovet can still use Max Ooze @@ -157,22 +157,22 @@ describe("Dynamax", function () { battle.makeChoices('move struggle', 'auto'); // will throw an error if Skwovet isn't forced to use Struggle battle = common.gen(8).createBattle([[ - {species: "Feebas", moves: ['splash']}, + { species: "Feebas", moves: ['splash'] }, ], [ - {species: "Clefairy", moves: ['imprison', 'gravity', 'splash']}, + { species: "Clefairy", moves: ['imprison', 'gravity', 'splash'] }, ]]); battle.makeChoices('move splash dynamax', 'auto'); battle.makeChoices('move splash', 'move gravity'); // will throw an error if Feebas is forced to use Struggle by Imprison battle.makeChoices('move splash', 'auto'); // will throw an error if Feebas is forced to use Struggle by Gravity }); - it.skip(`should not remove the variable to Dynamax on forced switches`, function () { + it.skip(`should not remove the variable to Dynamax on forced switches`, () => { battle = common.gen(8).createBattle([[ - {species: 'wynaut', item: 'ejectpack', moves: ['ironhead']}, - {species: 'audino', item: 'ejectpack', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'ejectpack', moves: ['ironhead'] }, + { species: 'audino', item: 'ejectpack', moves: ['sleeptalk'] }, ], [ - {species: 'vikavolt', moves: ['stickyweb']}, - {species: 'incineroar', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'vikavolt', moves: ['stickyweb'] }, + { species: 'incineroar', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices('move ironhead dynamax', 'switch 2'); @@ -183,12 +183,12 @@ describe("Dynamax", function () { assert(wynaut.volatiles['dynamax'], 'Wynaut should be currently Dynamaxed.'); }); - describe(`Hacked Max Moves`, function () { - it(`should not activate Max Move side effects when used without Dynamaxing`, function () { + describe(`Hacked Max Moves`, () => { + it(`should not activate Max Move side effects when used without Dynamaxing`, () => { battle = common.gen(8).createBattle([[ - {species: 'wynaut', moves: ['maxflare', 'maxairstream']}, + { species: 'wynaut', moves: ['maxflare', 'maxairstream'] }, ], [ - {species: 'shuckle', moves: ['sleeptalk']}, + { species: 'shuckle', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move maxflare', 'auto'); assert.equal(battle.field.weather, ''); @@ -197,11 +197,11 @@ describe("Dynamax", function () { assert.statStage(battle.p1.active[0], 'spe', 0); }); - it(`should treat Max Moves as 0 BP when used without Dynamaxing`, function () { + it(`should treat Max Moves as 0 BP when used without Dynamaxing`, () => { battle = common.gen(8).createBattle([[ - {species: 'wynaut', moves: ['maxflare', 'maxairstream']}, + { species: 'wynaut', moves: ['maxflare', 'maxairstream'] }, ], [ - {species: 'shuckle', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'shuckle', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move maxflare', 'auto'); battle.makeChoices('move maxairstream', 'auto'); @@ -210,21 +210,21 @@ describe("Dynamax", function () { assert.bounded(shuckle.maxhp - shuckle.hp, [2, 4], `0 BP should cause the move's damage to only be 2 after base damage calculation, resulting in 1-2 final damage for each Max Move.`); }); - it(`should treat Max Moves as physical moves when used without Dynamaxing`, function () { + it(`should treat Max Moves as physical moves when used without Dynamaxing`, () => { battle = common.gen(8).createBattle([[ - {species: 'wynaut', moves: ['maxflare']}, + { species: 'wynaut', moves: ['maxflare'] }, ], [ - {species: 'shuckle', item: 'keeberry', moves: ['sleeptalk']}, + { species: 'shuckle', item: 'keeberry', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'def', 1); }); - it(`should prevent effects that affect regular Max Moves, like Sleep Talk and Instruct`, function () { + it(`should prevent effects that affect regular Max Moves, like Sleep Talk and Instruct`, () => { battle = common.gen(8).createBattle([[ - {species: 'wynaut', moves: ['maxflare', 'sleeptalk']}, + { species: 'wynaut', moves: ['maxflare', 'sleeptalk'] }, ], [ - {species: 'shuckle', moves: ['instruct', 'spore', 'roost']}, + { species: 'shuckle', moves: ['instruct', 'spore', 'roost'] }, ]]); battle.makeChoices(); const wynaut = battle.p1.active[0]; diff --git a/test/sim/misc/endlessbattleclause.js b/test/sim/misc/endlessbattleclause.js index 10cb747a14..eb2cc3437d 100644 --- a/test/sim/misc/endlessbattleclause.js +++ b/test/sim/misc/endlessbattleclause.js @@ -9,9 +9,9 @@ describe('Endless Battle Clause (slow)', () => { afterEach(() => battle.destroy()); it('should trigger on an infinite loop', () => { - battle = common.createBattle({endlessBattleClause: true}); - battle.setPlayer('p1', {team: [{species: "Caterpie", moves: ['tackle']}]}); - battle.setPlayer('p2', {team: [{species: "Slowbro", item: 'leppaberry', moves: ['slackoff', 'healpulse', 'recycle']}]}); + battle = common.createBattle({ endlessBattleClause: true }); + battle.setPlayer('p1', { team: [{ species: "Caterpie", moves: ['tackle'] }] }); + battle.setPlayer('p2', { team: [{ species: "Slowbro", item: 'leppaberry', moves: ['slackoff', 'healpulse', 'recycle'] }] }); const [victim, memeSlowbro] = [battle.p1.active[0], battle.p2.active[0]]; skipTurns(battle, 100); for (let i = 0; i < 100; i++) { @@ -33,9 +33,9 @@ describe('Endless Battle Clause (slow)', () => { }); it('should not trigger by both Pokemon eating a Leppa Berry they started with', () => { - battle = common.createBattle({endlessBattleClause: true}); - battle.setPlayer('p1', {team: [{species: "Sunkern", item: 'leppaberry', moves: ['synthesis']}]}); - battle.setPlayer('p2', {team: [{species: "Sunkern", item: 'leppaberry', moves: ['synthesis']}]}); + battle = common.createBattle({ endlessBattleClause: true }); + battle.setPlayer('p1', { team: [{ species: "Sunkern", item: 'leppaberry', moves: ['synthesis'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sunkern", item: 'leppaberry', moves: ['synthesis'] }] }); skipTurns(battle, 100); for (let i = 0; i < 10; i++) { battle.makeChoices('move synthesis', 'move synthesis'); @@ -44,15 +44,15 @@ describe('Endless Battle Clause (slow)', () => { }); it('should only cause the battle to end if either side cannot switch to a non-stale Pokemon and at least one staleness is externally inflicted', () => { - battle = common.createBattle({endlessBattleClause: true}); - battle.setPlayer('p1', {team: [ - {species: "Blissey", level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'floralhealing', 'block']}, - {species: "Magikarp", moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Magikarp", moves: ['splash']}, - {species: "Sunkern", item: 'leppaberry', moves: ['synthesis']}, - ]}); + battle = common.createBattle({ endlessBattleClause: true }); + battle.setPlayer('p1', { team: [ + { species: "Blissey", level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'floralhealing', 'block'] }, + { species: "Magikarp", moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Magikarp", moves: ['splash'] }, + { species: "Sunkern", item: 'leppaberry', moves: ['synthesis'] }, + ] }); skipTurns(battle, 100); for (let i = 0; i < 8; i++) { battle.makeChoices('move extremespeed', 'move splash'); @@ -77,15 +77,15 @@ describe('Endless Battle Clause (slow)', () => { }); it('Fling should cause externally inflicted staleness', () => { - battle = common.createBattle({endlessBattleClause: true}); - battle.setPlayer('p1', {team: [ - {species: "Blissey", level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'fling', 'block']}, - {species: "Magikarp", moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Magikarp", moves: ['splash']}, - {species: "Sunkern", item: 'leppaberry', moves: ['synthesis']}, - ]}); + battle = common.createBattle({ endlessBattleClause: true }); + battle.setPlayer('p1', { team: [ + { species: "Blissey", level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'fling', 'block'] }, + { species: "Magikarp", moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Magikarp", moves: ['splash'] }, + { species: "Sunkern", item: 'leppaberry', moves: ['synthesis'] }, + ] }); skipTurns(battle, 100); // Blissey inflicts external staleness on Magikarp. battle.makeChoices('move fling', 'move splash'); @@ -104,15 +104,15 @@ describe('Endless Battle Clause (slow)', () => { }); it('Entrainment should cause externally inflicted staleness', () => { - battle = common.createBattle({endlessBattleClause: true}); - battle.setPlayer('p1', {team: [ - {species: "Blissey", ability: 'Levitate', level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'entrainment', 'block']}, - {species: "Magikarp", moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Magikarp", ability: 'Illuminate', moves: ['splash']}, - {species: "Sunkern", item: 'leppaberry', moves: ['synthesis']}, - ]}); + battle = common.createBattle({ endlessBattleClause: true }); + battle.setPlayer('p1', { team: [ + { species: "Blissey", ability: 'Levitate', level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'entrainment', 'block'] }, + { species: "Magikarp", moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Magikarp", ability: 'Illuminate', moves: ['splash'] }, + { species: "Sunkern", item: 'leppaberry', moves: ['synthesis'] }, + ] }); skipTurns(battle, 100); // Blissey inflicts external staleness on Magikarp. battle.makeChoices('move entrainment', 'move splash'); @@ -137,17 +137,16 @@ describe('Endless Battle Clause (slow)', () => { assert.equal(battle.winner, 'Player 2'); }); - it('Entrainment\'s externally inflicted staleness should go away on switch', () => { - battle = common.createBattle({endlessBattleClause: true}); - battle.setPlayer('p1', {team: [ - {species: "Blissey", ability: 'Levitate', level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'entrainment', 'block']}, - {species: "Magikarp", moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Magikarp", ability: 'Illuminate', moves: ['splash']}, - {species: "Sunkern", item: 'leppaberry', moves: ['synthesis']}, - ]}); + battle = common.createBattle({ endlessBattleClause: true }); + battle.setPlayer('p1', { team: [ + { species: "Blissey", ability: 'Levitate', level: 1, item: 'leppaberry', moves: ['recycle', 'extremespeed', 'entrainment', 'block'] }, + { species: "Magikarp", moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Magikarp", ability: 'Illuminate', moves: ['splash'] }, + { species: "Sunkern", item: 'leppaberry', moves: ['synthesis'] }, + ] }); skipTurns(battle, 100); // Blissey inflicts external staleness on Magikarp. battle.makeChoices('move entrainment', 'move splash'); @@ -174,15 +173,15 @@ describe('Endless Battle Clause (slow)', () => { it('should allow for a maximum of 1000 turns', function () { this.timeout(0); - battle = common.createBattle({endlessBattleClause: true}); - battle.setPlayer('p1', {team: [ - {species: "Gengar", moves: ['splash']}, - {species: "Clefable", moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Blissey", moves: ['splash']}, - {species: "Vaporeon", moves: ['splash']}, - ]}); + battle = common.createBattle({ endlessBattleClause: true }); + battle.setPlayer('p1', { team: [ + { species: "Gengar", moves: ['splash'] }, + { species: "Clefable", moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Blissey", moves: ['splash'] }, + { species: "Vaporeon", moves: ['splash'] }, + ] }); for (let i = 0; i < 998; i++) { battle.makeChoices('switch 2', 'switch 2'); } @@ -192,10 +191,10 @@ describe('Endless Battle Clause (slow)', () => { }); it('Skill Swap should remove the user\'s staleness', () => { - battle = common.createBattle({endlessBattleClause: true}, [[ - {species: "Furret", moves: ['skillswap']}, + battle = common.createBattle({ endlessBattleClause: true }, [[ + { species: "Furret", moves: ['skillswap'] }, ], [ - {species: "Ampharos", moves: ['skillswap']}, + { species: "Ampharos", moves: ['skillswap'] }, ]]); skipTurns(battle, 100); for (let i = 0; i < 8; i++) battle.makeChoices(); diff --git a/test/sim/misc/faint-order.js b/test/sim/misc/faint-order.js index 96ec0dacd3..703a62ace2 100644 --- a/test/sim/misc/faint-order.js +++ b/test/sim/misc/faint-order.js @@ -5,53 +5,53 @@ const common = require('./../../common'); let battle; -describe('Fainting', function () { - afterEach(function () { +describe('Fainting', () => { + afterEach(() => { battle.destroy(); }); - it(`should end the turn in Gen 1`, function () { + it(`should end the turn in Gen 1`, () => { // Gen 1 has no end-of-turn effects battle = common.gen(1).createBattle([[ - {species: 'Electrode', moves: ['explosion']}, - {species: 'Pikachu', moves: ['growl']}, + { species: 'Electrode', moves: ['explosion'] }, + { species: 'Pikachu', moves: ['growl'] }, ], [ - {species: 'Haunter', moves: ['substitute']}, + { species: 'Haunter', moves: ['substitute'] }, ]]); battle.makeChoices(); battle.makeChoices('switch Pikachu', ''); assert.fullHP(battle.p2.active[0]); }); - it(`should end the turn in Gen 3`, function () { + it(`should end the turn in Gen 3`, () => { battle = common.gen(3).createBattle([[ - {species: 'Electrode', moves: ['explosion']}, - {species: 'Pikachu', moves: ['growl']}, + { species: 'Electrode', moves: ['explosion'] }, + { species: 'Pikachu', moves: ['growl'] }, ], [ - {species: 'Haunter', moves: ['substitute']}, + { species: 'Haunter', moves: ['substitute'] }, ]]); battle.makeChoices('move Explosion', 'move Substitute'); battle.makeChoices('switch Pikachu', ''); assert.fullHP(battle.p2.active[0]); }); - it(`should not end the turn in Gen 4`, function () { + it(`should not end the turn in Gen 4`, () => { battle = common.gen(4).createBattle([[ - {species: 'Electrode', moves: ['explosion']}, - {species: 'Pikachu', moves: ['growl']}, + { species: 'Electrode', moves: ['explosion'] }, + { species: 'Pikachu', moves: ['growl'] }, ], [ - {species: 'Haunter', moves: ['substitute']}, + { species: 'Haunter', moves: ['substitute'] }, ]]); battle.makeChoices('move Explosion', 'move Substitute'); battle.makeChoices('switch Pikachu', ''); assert.false.fullHP(battle.p2.active[0]); }); - it(`should check for a winner after an attack`, function () { + it(`should check for a winner after an attack`, () => { battle = common.gen(4).createBattle([[ - {species: 'Shedinja', moves: ['shadowsneak']}, + { species: 'Shedinja', moves: ['shadowsneak'] }, ], [ - {species: 'Shedinja', moves: ['sleeptalk']}, + { species: 'Shedinja', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fainted(battle.p2.active[0]); @@ -59,20 +59,20 @@ describe('Fainting', function () { battle.destroy(); battle = common.gen(5).createBattle([[ - {species: 'Shedinja', moves: ['sleeptalk', 'shadowsneak']}, + { species: 'Shedinja', moves: ['sleeptalk', 'shadowsneak'] }, ], [ - {species: 'Shedinja', ability: 'prankster', moves: ['spore']}, + { species: 'Shedinja', ability: 'prankster', moves: ['spore'] }, ]]); battle.makeChoices(); assert.fainted(battle.p2.active[0]); assert.equal(battle.winner, 'Player 1'); }); - it(`should check for a winner after recoil`, function () { + it(`should check for a winner after recoil`, () => { battle = common.gen(4).createBattle([[ - {species: 'Shedinja', moves: ['flareblitz']}, + { species: 'Shedinja', moves: ['flareblitz'] }, ], [ - {species: 'Shedinja', moves: ['flareblitz']}, + { species: 'Shedinja', moves: ['flareblitz'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -81,9 +81,9 @@ describe('Fainting', function () { battle.destroy(); battle = common.gen(5).createBattle([[ - {species: 'Shedinja', moves: ['flareblitz']}, + { species: 'Shedinja', moves: ['flareblitz'] }, ], [ - {species: 'Shedinja', moves: ['sleeptalk']}, + { species: 'Shedinja', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -91,11 +91,11 @@ describe('Fainting', function () { assert.equal(battle.winner, 'Player 1'); }); - it(`should check for a winner after Rough Skin`, function () { + it(`should check for a winner after Rough Skin`, () => { battle = common.gen(4).createBattle([[ - {species: 'Shedinja', moves: ['shadowsneak']}, + { species: 'Shedinja', moves: ['shadowsneak'] }, ], [ - {species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk']}, + { species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -104,9 +104,9 @@ describe('Fainting', function () { battle.destroy(); battle = common.gen(6).createBattle([[ - {species: 'Shedinja', moves: ['shadowsneak']}, + { species: 'Shedinja', moves: ['shadowsneak'] }, ], [ - {species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk']}, + { species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -115,9 +115,9 @@ describe('Fainting', function () { battle.destroy(); battle = common.gen(7).createBattle([[ - {species: 'Shedinja', moves: ['shadowsneak']}, + { species: 'Shedinja', moves: ['shadowsneak'] }, ], [ - {species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk']}, + { species: 'Shedinja', ability: 'roughskin', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -125,22 +125,22 @@ describe('Fainting', function () { assert.equal(battle.winner, 'Player 1'); }); - it(`should check for a winner after future moves`, function () { + it(`should check for a winner after future moves`, () => { battle = common.gen(7).createBattle([[ - {species: 'Shedinja', moves: ['futuresight']}, + { species: 'Shedinja', moves: ['futuresight'] }, ], [ - {species: 'Shedinja', moves: ['sleeptalk']}, + { species: 'Shedinja', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 3; i++) battle.makeChoices(); assert.fainted(battle.p2.active[0]); assert.equal(battle.winner, 'Player 1'); }); - it(`should check for a winner after Rocky Helmet`, function () { + it(`should check for a winner after Rocky Helmet`, () => { battle = common.gen(5).createBattle([[ - {species: 'Shedinja', moves: ['shadowsneak']}, + { species: 'Shedinja', moves: ['shadowsneak'] }, ], [ - {species: 'Shedinja', item: 'rockyhelmet', moves: ['sleeptalk']}, + { species: 'Shedinja', item: 'rockyhelmet', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -149,9 +149,9 @@ describe('Fainting', function () { battle.destroy(); battle = common.gen(7).createBattle([[ - {species: 'Shedinja', moves: ['shadowsneak']}, + { species: 'Shedinja', moves: ['shadowsneak'] }, ], [ - {species: 'Shedinja', item: 'rockyhelmet', moves: ['sleeptalk']}, + { species: 'Shedinja', item: 'rockyhelmet', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -159,11 +159,11 @@ describe('Fainting', function () { assert.equal(battle.winner, 'Player 1'); }); - it(`should check for a winner after Destiny Bond`, function () { + it(`should check for a winner after Destiny Bond`, () => { battle = common.gen(4).createBattle([[ - {species: 'Shedinja', moves: ['destinybond']}, + { species: 'Shedinja', moves: ['destinybond'] }, ], [ - {species: 'Shedinja', ability: 'scrappy', moves: ['vitalthrow']}, + { species: 'Shedinja', ability: 'scrappy', moves: ['vitalthrow'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -172,9 +172,9 @@ describe('Fainting', function () { battle.destroy(); battle = common.gen(5).createBattle([[ - {species: 'Shedinja', moves: ['destinybond']}, + { species: 'Shedinja', moves: ['destinybond'] }, ], [ - {species: 'Shedinja', ability: 'scrappy', moves: ['vitalthrow']}, + { species: 'Shedinja', ability: 'scrappy', moves: ['vitalthrow'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); @@ -182,11 +182,11 @@ describe('Fainting', function () { assert.equal(battle.winner, 'Player 2'); }); - it(`should check for a winner after Final Gambit`, function () { + it(`should check for a winner after Final Gambit`, () => { battle = common.gen(5).createBattle([[ - {species: 'Shedinja', moves: ['sleeptalk']}, + { species: 'Shedinja', moves: ['sleeptalk'] }, ], [ - {species: 'Shedinja', ability: 'scrappy', moves: ['finalgambit']}, + { species: 'Shedinja', ability: 'scrappy', moves: ['finalgambit'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); diff --git a/test/sim/misc/fainted-forme-regression.js b/test/sim/misc/fainted-forme-regression.js index 6ffb2a1fd7..d4247e15db 100644 --- a/test/sim/misc/fainted-forme-regression.js +++ b/test/sim/misc/fainted-forme-regression.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe(`Fainted forme regression`, function () { - afterEach(function () { +describe(`Fainted forme regression`, () => { + afterEach(() => { battle.destroy(); }); - it('[Hackmons] should be able to revert between different mega evolutions', function () { + it('[Hackmons] should be able to revert between different mega evolutions', () => { battle = common.createBattle([[ - {species: 'charizardmegay', ability: 'drought', item: 'charizarditex', moves: ['memento']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'charizardmegay', ability: 'drought', item: 'charizarditex', moves: ['memento'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices('move memento mega', 'auto'); @@ -23,12 +23,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Drought'); }); - it(`should revert Mega Evolutions`, function () { + it(`should revert Mega Evolutions`, () => { battle = common.createBattle([[ - {species: 'alakazam', ability: 'synchronize', item: 'alakazite', moves: ['memento']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'alakazam', ability: 'synchronize', item: 'alakazite', moves: ['memento'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices('move memento mega', 'auto'); @@ -36,12 +36,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Synchronize'); }); - it(`should revert Rayquaza-Mega`, function () { + it(`should revert Rayquaza-Mega`, () => { battle = common.gen(7).createBattle([[ - {species: 'rayquaza', ability: 'airlock', moves: ['memento', 'dragonascent']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'rayquaza', ability: 'airlock', moves: ['memento', 'dragonascent'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices('move memento mega', 'auto'); @@ -49,12 +49,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Air Lock'); }); - it(`should revert Primal forms`, function () { + it(`should revert Primal forms`, () => { battle = common.createBattle([[ - {species: 'kyogre', ability: 'drizzle', moves: ['memento']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'kyogre', ability: 'drizzle', moves: ['memento'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices(); @@ -62,12 +62,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Drizzle'); }); - it(`shouldn't revert Arceus-forms to base Arceus`, function () { + it(`shouldn't revert Arceus-forms to base Arceus`, () => { battle = common.createBattle([[ - {species: 'arceusfire', ability: 'multitype', item: 'flameplate', moves: ['memento']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'arceusfire', ability: 'multitype', item: 'flameplate', moves: ['memento'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices(); @@ -75,12 +75,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Multitype'); }); - it("should revert Terastallized Morpeko-Hangry to base Morpeko", function () { + it("should revert Terastallized Morpeko-Hangry to base Morpeko", () => { battle = common.gen(9).createBattle([[ - {species: 'Morpeko', ability: 'hungerswitch', moves: ['memento', 'sleeptalk']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'Morpeko', ability: 'hungerswitch', moves: ['memento', 'sleeptalk'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices('move sleeptalk', 'auto'); @@ -90,12 +90,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Hunger Switch'); }); - it(`shouldn't revert Palafin-Hero to base Palafin`, function () { + it(`shouldn't revert Palafin-Hero to base Palafin`, () => { battle = common.createBattle([[ - {species: 'palafin', ability: 'zerotohero', moves: ['memento']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'palafin', ability: 'zerotohero', moves: ['memento'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices('switch 2', 'auto'); @@ -106,15 +106,15 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Zero to Hero'); }); - it(`should revert Ogerpon-Tera to base Ogerpon`, function () { + it(`should revert Ogerpon-Tera to base Ogerpon`, () => { battle = common.gen(9).createBattle([[ { species: 'ogerponwellspring', ability: 'waterabsorb', item: 'wellspring mask', moves: ['memento'], teraType: 'Water', }, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices('move memento terastallize', 'auto'); @@ -122,12 +122,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Water Absorb'); }); - it(`shouldn't revert Terapagos-Terastal to base Terapagos`, function () { + it(`shouldn't revert Terapagos-Terastal to base Terapagos`, () => { battle = common.createBattle([[ - {species: 'terapagos', ability: 'terashift', moves: ['memento']}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'terapagos', ability: 'terashift', moves: ['memento'] }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices(); @@ -135,12 +135,12 @@ describe(`Fainted forme regression`, function () { assert.hasAbility(pokemon, 'Tera Shell'); }); - it(`should revert Terapagos-Stellar to base Terapagos`, function () { + it(`should revert Terapagos-Stellar to base Terapagos`, () => { battle = common.gen(9).createBattle([[ - {species: 'terapagos', ability: 'terashift', moves: ['memento'], teraType: 'Stellar'}, - {species: 'darkrai', moves: ['darkpulse']}, + { species: 'terapagos', ability: 'terashift', moves: ['memento'], teraType: 'Stellar' }, + { species: 'darkrai', moves: ['darkpulse'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, ]]); const pokemon = battle.p1.active[0]; battle.makeChoices('move memento terastallize', 'auto'); diff --git a/test/sim/misc/fusion-combo.js b/test/sim/misc/fusion-combo.js index 76868ed3d1..3333d7def5 100644 --- a/test/sim/misc/fusion-combo.js +++ b/test/sim/misc/fusion-combo.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Fusion Bolt + Fusion Flare', function () { - afterEach(function () { +describe('Fusion Bolt + Fusion Flare', () => { + afterEach(() => { battle.destroy(); }); - it(`should boost the second move if the first was used immediately before it`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['fusionbolt']}, - {species: 'Wobbuffet', moves: ['fusionflare']}, + it(`should boost the second move if the first was used immediately before it`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['fusionbolt'] }, + { species: 'Wobbuffet', moves: ['fusionflare'] }, ], [ - {species: 'Dragonite', item: 'laggingtail', moves: ['roost']}, - {species: 'Lugia', moves: ['fusionbolt']}, + { species: 'Dragonite', item: 'laggingtail', moves: ['roost'] }, + { species: 'Lugia', moves: ['fusionbolt'] }, ]]); const bpModifiers = new Map(); @@ -28,13 +28,13 @@ describe('Fusion Bolt + Fusion Flare', function () { assert.equal(bpModifiers.get('fusionflare'), 2); }); - it(`should boost the second move if the first was used by the same Pokemon`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Magikarp', item: 'laggingtail', moves: ['fusionbolt', 'fusionflare']}, - {species: 'Oranguru', moves: ['sleeptalk', 'instruct']}, + it(`should boost the second move if the first was used by the same Pokemon`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Magikarp', item: 'laggingtail', moves: ['fusionbolt', 'fusionflare'] }, + { species: 'Oranguru', moves: ['sleeptalk', 'instruct'] }, ], [ - {species: 'Dragonite', moves: ['roost']}, - {species: 'Lugia', moves: ['roost']}, + { species: 'Dragonite', moves: ['roost'] }, + { species: 'Lugia', moves: ['roost'] }, ]]); battle.makeChoices(); @@ -49,13 +49,13 @@ describe('Fusion Bolt + Fusion Flare', function () { assert.equal(bpModifiers.get('fusionflare'), 2); }); - it(`should not boost the second move if another move was used between them`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Zekrom', moves: ['fusionbolt']}, - {species: 'Reshiram', item: 'laggingtail', moves: ['fusionflare']}, + it(`should not boost the second move if another move was used between them`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Zekrom', moves: ['fusionbolt'] }, + { species: 'Reshiram', item: 'laggingtail', moves: ['fusionflare'] }, ], [ - {species: 'Dragonite', ability: 'shellarmor', moves: ['roost']}, - {species: 'Lugia', moves: ['roost']}, + { species: 'Dragonite', ability: 'shellarmor', moves: ['roost'] }, + { species: 'Lugia', moves: ['roost'] }, ]]); battle.makeChoices(); @@ -69,13 +69,13 @@ describe('Fusion Bolt + Fusion Flare', function () { assert.equal(bpModifiers.get('fusionflare'), 1); }); - it(`should not boost the second move if the first move failed`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Regieleki', moves: ['fusionbolt']}, - {species: 'Reshiram', moves: ['fusionflare']}, + it(`should not boost the second move if the first move failed`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Regieleki', moves: ['fusionbolt'] }, + { species: 'Reshiram', moves: ['fusionflare'] }, ], [ - {species: 'Stunfisk', moves: ['roost']}, - {species: 'Stunfisk', moves: ['roost']}, + { species: 'Stunfisk', moves: ['roost'] }, + { species: 'Stunfisk', moves: ['roost'] }, ]]); const bpModifiers = new Map(); diff --git a/test/sim/misc/hazards.js b/test/sim/misc/hazards.js index c6f6c2f0a5..321df8eff9 100644 --- a/test/sim/misc/hazards.js +++ b/test/sim/misc/hazards.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Hazards', function () { - afterEach(function () { +describe('Hazards', () => { + afterEach(() => { battle.destroy(); }); - it(`should damage Pokemon before regular entrance Abilities`, function () { + it(`should damage Pokemon before regular entrance Abilities`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['uturn']}, - {species: 'shedinja', ability: 'electricsurge', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['uturn'] }, + { species: 'shedinja', ability: 'electricsurge', moves: ['sleeptalk'] }, ], [ - {species: 'landorus', moves: ['stealthrock']}, + { species: 'landorus', moves: ['stealthrock'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2'); assert.false(battle.field.isTerrain('electricterrain')); }); - it(`should damage multiple Pokemon switching in simulatenously by Speed order`, function () { + it(`should damage multiple Pokemon switching in simulatenously by Speed order`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['stealthrock', 'sleeptalk']}, - {species: 'kyogre', ability: 'drizzle', item: 'choicescarf', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['stealthrock', 'sleeptalk'] }, + { species: 'kyogre', ability: 'drizzle', item: 'choicescarf', moves: ['sleeptalk'] }, ], [ - {species: 'miltank', moves: ['stealthrock', 'finalgambit']}, - {species: 'landorus-therian', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'miltank', moves: ['stealthrock', 'finalgambit'] }, + { species: 'landorus-therian', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices('move sleeptalk', 'move finalgambit'); @@ -44,14 +44,14 @@ describe('Hazards', function () { assert(rocksLandorusIndex < abilityLandorusIndex, 'Stealth Rock should damage Landorus before Intimidate activates.'); }); - it(`should set up hazards even if there is no target`, function () { + it(`should set up hazards even if there is no target`, () => { battle = common.createBattle([[ - {species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit']}, - {species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit']}, - {species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit']}, - {species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit']}, + { species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit'] }, + { species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit'] }, + { species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit'] }, + { species: 'diglett', level: 1, moves: ['sleeptalk', 'finalgambit'] }, ], [ - {species: 'wynaut', item: 'laggingtail', moves: ['stealthrock', 'spikes', 'stickyweb', 'defog']}, + { species: 'wynaut', item: 'laggingtail', moves: ['stealthrock', 'spikes', 'stickyweb', 'defog'] }, ]]); battle.makeChoices('move finalgambit', 'move stealthrock'); @@ -67,12 +67,12 @@ describe('Hazards', function () { assert.statStage(battle.p1.active[0], 'spe', -1); }); - it(`should apply hazards in the order they were set up`, function () { + it(`should apply hazards in the order they were set up`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['sleeptalk', 'uturn']}, - {species: 'whismur', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk', 'uturn'] }, + { species: 'whismur', moves: ['sleeptalk'] }, ], [ - {species: 'landorus', moves: ['stealthrock', 'spikes', 'stickyweb', 'toxicspikes']}, + { species: 'landorus', moves: ['stealthrock', 'spikes', 'stickyweb', 'toxicspikes'] }, ]]); battle.makeChoices('move sleeptalk', 'move toxicspikes'); battle.makeChoices('move sleeptalk', 'move stickyweb'); @@ -92,12 +92,12 @@ describe('Hazards', function () { assert(spikesIndex < rocksIndex, 'Spikes should have damaged before Stealth Rock.'); }); - it(`should allow Berries to trigger between hazards`, function () { + it(`should allow Berries to trigger between hazards`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['sleeptalk', 'uturn']}, - {species: 'shedinja', item: 'lumberry', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk', 'uturn'] }, + { species: 'shedinja', item: 'lumberry', moves: ['sleeptalk'] }, ], [ - {species: 'landorus', moves: ['toxicspikes', 'stealthrock']}, + { species: 'landorus', moves: ['toxicspikes', 'stealthrock'] }, ]]); battle.makeChoices(); battle.makeChoices('move uturn', 'move stealthrock'); @@ -106,15 +106,15 @@ describe('Hazards', function () { assert.false.holdsItem(shedinja, 'Shedinja should have lost Lum Berry before fainting to rocks.'); }); - it(`should set up hazards to every opponents' side in a Free-for-all battle`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'Bronzong', moves: ['sleeptalk', 'stealthrock']}, + it(`should set up hazards to every opponents' side in a Free-for-all battle`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'Bronzong', moves: ['sleeptalk', 'stealthrock'] }, ], [ - {species: 'Cufant', moves: ['sleeptalk']}, + { species: 'Cufant', moves: ['sleeptalk'] }, ], [ - {species: 'Qwilfish', moves: ['sleeptalk']}, + { species: 'Qwilfish', moves: ['sleeptalk'] }, ], [ - {species: 'Marowak', moves: ['stealthrock']}, + { species: 'Marowak', moves: ['stealthrock'] }, ]]); battle.makeChoices(); @@ -123,18 +123,18 @@ describe('Hazards', function () { assert.deepEqual(battle.sides.map(side => !!side.sideConditions.stealthrock), [true, true, true, true]); }); - it(`should set up hazards even if there is no target in a Free-for-all battle`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'Bronzong', item: 'laggingtail', moves: ['sleeptalk', 'stealthrock']}, + it(`should set up hazards even if there is no target in a Free-for-all battle`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'Bronzong', item: 'laggingtail', moves: ['sleeptalk', 'stealthrock'] }, ], [ - {species: 'Wynaut', level: 1, moves: ['finalgambit']}, - {species: 'Cufant', moves: ['sleeptalk']}, + { species: 'Wynaut', level: 1, moves: ['finalgambit'] }, + { species: 'Cufant', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', level: 1, moves: ['finalgambit']}, - {species: 'Qwilfish', moves: ['sleeptalk']}, + { species: 'Wynaut', level: 1, moves: ['finalgambit'] }, + { species: 'Qwilfish', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', level: 1, moves: ['finalgambit']}, - {species: 'Marowak', moves: ['stealthrock']}, + { species: 'Wynaut', level: 1, moves: ['finalgambit'] }, + { species: 'Marowak', moves: ['stealthrock'] }, ]]); battle.makeChoices('move stealthrock', 'move finalgambit 1', 'move finalgambit 1', 'move finalgambit 1'); diff --git a/test/sim/misc/inversebattle.js b/test/sim/misc/inversebattle.js index 76f5f6a32f..de2c6a33d2 100644 --- a/test/sim/misc/inversebattle.js +++ b/test/sim/misc/inversebattle.js @@ -5,52 +5,52 @@ const common = require('./../../common'); let battle; -describe('Inverse Battle', function () { - afterEach(function () { +describe('Inverse Battle', () => { + afterEach(() => { battle.destroy(); }); - it(`should change natural resistances into weaknesses`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['vitalthrow']}, + it(`should change natural resistances into weaknesses`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['vitalthrow'] }, ], [ - {species: 'scyther', moves: ['sleeptalk']}, + { species: 'scyther', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); }); - it(`should change natural weaknesses into resistances`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['vitalthrow']}, + it(`should change natural weaknesses into resistances`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['vitalthrow'] }, ], [ - {species: 'absol', moves: ['sleeptalk']}, + { species: 'absol', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-resisted|')); }); - it(`should negate natural immunities and make them weaknesses`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['vitalthrow']}, + it(`should negate natural immunities and make them weaknesses`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['vitalthrow'] }, ], [ - {species: 'dusknoir', moves: ['sleeptalk']}, + { species: 'dusknoir', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); assert.false.fullHP(battle.p2.active[0]); }); - it(`should affect Stealth Rock damage`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['stealthrock', 'snore']}, + it(`should affect Stealth Rock damage`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['stealthrock', 'snore'] }, ], [ - {species: 'ninjask', moves: ['sleeptalk']}, - {species: 'steelix', moves: ['sleeptalk']}, - {species: 'hitmonchan', moves: ['sleeptalk']}, - {species: 'chansey', moves: ['sleeptalk']}, - {species: 'staraptor', moves: ['sleeptalk']}, - {species: 'volcarona', moves: ['sleeptalk']}, + { species: 'ninjask', moves: ['sleeptalk'] }, + { species: 'steelix', moves: ['sleeptalk'] }, + { species: 'hitmonchan', moves: ['sleeptalk'] }, + { species: 'chansey', moves: ['sleeptalk'] }, + { species: 'staraptor', moves: ['sleeptalk'] }, + { species: 'volcarona', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); let pokemon; @@ -58,78 +58,78 @@ describe('Inverse Battle', function () { for (let i = 2; i <= 6; i++) { battle.makeChoices('move snore', 'switch ' + i); pokemon = battle.p2.active[0]; - expectedDamage = Math.floor(pokemon.maxhp * Math.pow(0.5, i - 1)); + expectedDamage = Math.floor(pokemon.maxhp * 0.5 ** (i - 1)); assert.equal(pokemon.maxhp - pokemon.hp, expectedDamage, `${pokemon.name} should take ${expectedDamage} damage`); } }); - it(`should affect the resistance of Delta Stream`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['hiddenpowerbug']}, + it(`should affect the resistance of Delta Stream`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['hiddenpowerbug'] }, ], [ - {species: 'rayquazamega', ability: 'deltastream', moves: ['sleeptalk']}, + { species: 'rayquazamega', ability: 'deltastream', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(!battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); }); - it(`should make Ghost/Grass types take neutral damage from Flying Press`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'hawlucha', moves: ['flyingpress']}, + it(`should make Ghost/Grass types take neutral damage from Flying Press`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'hawlucha', moves: ['flyingpress'] }, ], [ - {species: 'gourgeist', moves: ['sleeptalk']}, + { species: 'gourgeist', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(!battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); }); - it(`should not affect ability-based immunities`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['earthquake']}, + it(`should not affect ability-based immunities`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['earthquake'] }, ], [ - {species: 'mismagius', ability: 'levitate', moves: ['sleeptalk']}, + { species: 'mismagius', ability: 'levitate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-immune|')); assert.fullHP(battle.p2.active[0]); }); - it(`should not affect move-based immunities`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['earthquake']}, + it(`should not affect move-based immunities`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['earthquake'] }, ], [ - {species: 'klefki', moves: ['magnetrise']}, + { species: 'klefki', moves: ['magnetrise'] }, ]]); battle.makeChoices(); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-immune|')); assert.fullHP(battle.p2.active[0]); }); - it(`should not affect the type effectiveness of Freeze Dry on Water-type Pokemon`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['freezedry']}, + it(`should not affect the type effectiveness of Freeze Dry on Water-type Pokemon`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['freezedry'] }, ], [ - {species: 'floatzel', moves: ['sleeptalk']}, + { species: 'floatzel', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); }); - it(`should not affect the "ungrounded" state of Flying-type Pokemon`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['spore']}, + it(`should not affect the "ungrounded" state of Flying-type Pokemon`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['spore'] }, ], [ - {species: 'talonflame', moves: ['mistyterrain']}, + { species: 'talonflame', moves: ['mistyterrain'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].status, 'slp'); }); - it(`should let Tera Shell take not very effective damage`, function () { - battle = common.createBattle({inverseMod: true}, [[ - {species: 'wynaut', moves: ['wickedblow']}, + it(`should let Tera Shell take not very effective damage`, () => { + battle = common.createBattle({ inverseMod: true }, [[ + { species: 'wynaut', moves: ['wickedblow'] }, ], [ - {species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk']}, + { species: 'Terapagos-Terastal', ability: 'terashell', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const terapagos = battle.p2.active[0]; diff --git a/test/sim/misc/megaevolution.js b/test/sim/misc/megaevolution.js index 677b84dce0..b9476544af 100644 --- a/test/sim/misc/megaevolution.js +++ b/test/sim/misc/megaevolution.js @@ -5,29 +5,29 @@ const common = require('./../../common'); let battle; -describe('Mega Evolution', function () { - afterEach(function () { +describe('Mega Evolution', () => { + afterEach(() => { battle.destroy(); }); - it('should overwrite normally immutable abilities', function () { + it('should overwrite normally immutable abilities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Metagross", ability: 'comatose', item: 'metagrossite', moves: ['metalclaw']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Wishiwashi", ability: 'schooling', moves: ['uturn']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Metagross", ability: 'comatose', item: 'metagrossite', moves: ['metalclaw'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Wishiwashi", ability: 'schooling', moves: ['uturn'] }, + ] }); const megaMon = battle.p1.active[0]; battle.makeChoices('move metalclaw mega', 'move uturn'); assert.equal(megaMon.ability, 'toughclaws'); }); - it('[Hackmons] should be able to override different formes but not same forme', function () { + it('[Hackmons] should be able to override different formes but not same forme', () => { battle = common.createBattle([[ - {species: "Charizard-Mega-Y", item: 'charizarditex', moves: ['protect']}, + { species: "Charizard-Mega-Y", item: 'charizarditex', moves: ['protect'] }, ], [ - {species: "Kangaskhan-Mega", item: 'kangaskhanite', moves: ['protect']}, + { species: "Kangaskhan-Mega", item: 'kangaskhanite', moves: ['protect'] }, ]]); assert.equal(battle.p1.active[0].species.name, 'Charizard-Mega-Y'); assert.throws(() => { @@ -37,11 +37,11 @@ describe('Mega Evolution', function () { assert.equal(battle.p1.active[0].species.name, 'Charizard-Mega-X'); }); - it('should happen once', function () { + it('should happen once', () => { battle = common.gen(7).createBattle([[ - {species: "Rayquaza", moves: ['dragondance', 'dragonascent']}, + { species: "Rayquaza", moves: ['dragondance', 'dragonascent'] }, ], [ - {species: "Steelix", moves: ['splash']}, + { species: "Steelix", moves: ['splash'] }, ]]); battle.makeChoices('move dragondance mega', 'move splash'); assert.throws(() => { @@ -49,11 +49,11 @@ describe('Mega Evolution', function () { }); }); - it('should modify speed/priority in gen 7+', function () { + it('should modify speed/priority in gen 7+', () => { battle = common.createBattle([[ - {species: 'Metagross', ability: 'prankster', item: 'metagrossite', moves: ['taunt']}, + { species: 'Metagross', ability: 'prankster', item: 'metagrossite', moves: ['taunt'] }, ], [ - {species: 'Wishiwashi', ability: 'prankster', moves: ['glare']}, + { species: 'Wishiwashi', ability: 'prankster', moves: ['glare'] }, ]]); battle.makeChoices('move taunt mega', 'auto'); @@ -61,9 +61,9 @@ describe('Mega Evolution', function () { assert.equal(megaMon.status, 'par'); battle = common.createBattle([[ - {species: 'Garchomp', item: 'garchompite', moves: ['taunt']}, + { species: 'Garchomp', item: 'garchompite', moves: ['taunt'] }, ], [ - {species: 'Jirachi', moves: ['glare']}, + { species: 'Jirachi', moves: ['glare'] }, ]]); battle.makeChoices('move taunt mega', 'auto'); @@ -71,9 +71,9 @@ describe('Mega Evolution', function () { assert.equal(megaMon.status, 'par'); battle = common.createBattle([[ - {species: 'Metagross', item: 'metagrossite', moves: ['taunt']}, + { species: 'Metagross', item: 'metagrossite', moves: ['taunt'] }, ], [ - {species: 'Jirachi', moves: ['glare']}, + { species: 'Jirachi', moves: ['glare'] }, ]]); battle.makeChoices('move taunt mega', 'auto'); @@ -81,9 +81,9 @@ describe('Mega Evolution', function () { assert.equal(megaMon.status, ''); battle = common.gen(6).createBattle([[ - {species: 'Metagross', ability: 'prankster', item: 'metagrossite', moves: ['taunt']}, + { species: 'Metagross', ability: 'prankster', item: 'metagrossite', moves: ['taunt'] }, ], [ - {species: 'Wishiwashi', ability: 'prankster', moves: ['glare']}, + { species: 'Wishiwashi', ability: 'prankster', moves: ['glare'] }, ]]); battle.makeChoices('move taunt mega', 'auto'); @@ -91,9 +91,9 @@ describe('Mega Evolution', function () { assert.equal(megaMon.status, ''); battle = common.gen(6).createBattle([[ - {species: 'Garchomp', item: 'garchompite', moves: ['taunt']}, + { species: 'Garchomp', item: 'garchompite', moves: ['taunt'] }, ], [ - {species: 'Jirachi', moves: ['glare']}, + { species: 'Jirachi', moves: ['glare'] }, ]]); battle.makeChoices('move taunt mega', 'auto'); @@ -101,14 +101,14 @@ describe('Mega Evolution', function () { assert.equal(megaMon.status, ''); }); - it('should not break priority', function () { + it('should not break priority', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Metagross", ability: 'quickfeet', item: 'metagrossite', moves: ['protect']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Ninjask", ability: 'quickfeet', moves: ['thunderwave']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Metagross", ability: 'quickfeet', item: 'metagrossite', moves: ['protect'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Ninjask", ability: 'quickfeet', moves: ['thunderwave'] }, + ] }); const megaMon = battle.p1.active[0]; battle.makeChoices('move protect mega', 'auto'); assert.equal(megaMon.status, ''); @@ -116,13 +116,13 @@ describe('Mega Evolution', function () { describe("Mega Rayquaza", () => { const TEAMS = [[ - {species: "Rayquaza", ability: 'airlock', moves: ['dragonascent'], evs: {hp: 1}}, + { species: "Rayquaza", ability: 'airlock', moves: ['dragonascent'], evs: { hp: 1 } }, ], [ - {species: "Rayquaza", ability: 'airlock', moves: ['protect'], evs: {hp: 1}}, + { species: "Rayquaza", ability: 'airlock', moves: ['protect'], evs: { hp: 1 } }, ]]; function assertCanMega(formatid) { - battle = common.createBattle({formatid}, TEAMS); + battle = common.createBattle({ formatid }, TEAMS); battle.makeChoices(); // team preview battle.makeChoices('move 1 mega', 'auto'); assert.equal(battle.p1.active[0].species.name, "Rayquaza-Mega"); @@ -130,7 +130,7 @@ describe('Mega Evolution', function () { function assertLegalButCantMega(formatid) { assert.legalTeam(TEAMS[0], formatid); - battle = common.createBattle({formatid}, TEAMS); + battle = common.createBattle({ formatid }, TEAMS); battle.makeChoices(); // team preview assert.throws(() => battle.choose('p1', 'move 1 mega')); } @@ -163,7 +163,7 @@ describe('Mega Evolution', function () { assertLegalButCantMega('gen9nationaldexag@@@-ndag'); // don't add it where unnecessary - const format = common.getFormat({formatid: 'gen4anythinggoes'}); + const format = common.getFormat({ formatid: 'gen4anythinggoes' }); assert.false(Dex.formats.getRuleTable(format).has('megarayquazaclause')); }); }); diff --git a/test/sim/misc/mixandmega.js b/test/sim/misc/mixandmega.js index 62a7981eaa..2300cff499 100644 --- a/test/sim/misc/mixandmega.js +++ b/test/sim/misc/mixandmega.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Mix and Mega', function () { - beforeEach(function () { - battle = common.createBattle({formatid: 'gen9mixandmega'}); +describe('Mix and Mega', () => { + beforeEach(() => { + battle = common.createBattle({ formatid: 'gen9mixandmega' }); }); afterEach(() => battle.destroy()); - it('should overwrite forme-change abilities on Mega Evolution', function () { - battle.setPlayer('p1', {team: [{species: "Mimikyu", ability: 'disguise', item: 'metagrossite', moves: ['shadowclaw']}]}); - battle.setPlayer('p2', {team: [{species: "Palafin", ability: 'zerotohero', item: 'leftovers', moves: ['jetpunch']}]}); + it('should overwrite forme-change abilities on Mega Evolution', () => { + battle.setPlayer('p1', { team: [{ species: "Mimikyu", ability: 'disguise', item: 'metagrossite', moves: ['shadowclaw'] }] }); + battle.setPlayer('p2', { team: [{ species: "Palafin", ability: 'zerotohero', item: 'leftovers', moves: ['jetpunch'] }] }); battle.makeChoices('default', 'default'); // Switch in battle.makeChoices('move shadowclaw mega', 'move jetpunch'); assert.equal(battle.p1.active[0].ability, 'toughclaws'); diff --git a/test/sim/misc/multi-battle.js b/test/sim/misc/multi-battle.js index ee8c9a43af..9edbd389e5 100644 --- a/test/sim/misc/multi-battle.js +++ b/test/sim/misc/multi-battle.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('Free-for-all', function () { - afterEach(function () { +describe('Free-for-all', () => { + afterEach(() => { battle.destroy(); }); - it(`should support forfeiting`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'wynaut', moves: ['vitalthrow']}, + it(`should support forfeiting`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'wynaut', moves: ['vitalthrow'] }, ], [ - {species: 'scyther', moves: ['sleeptalk']}, + { species: 'scyther', moves: ['sleeptalk'] }, ], [ - {species: 'scyther', moves: ['sleeptalk', 'uturn']}, - {species: 'wynaut', moves: ['vitalthrow']}, + { species: 'scyther', moves: ['sleeptalk', 'uturn'] }, + { species: 'wynaut', moves: ['vitalthrow'] }, ], [ - {species: 'scyther', moves: ['sleeptalk']}, + { species: 'scyther', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.lose('p2'); diff --git a/test/sim/misc/ogerpon.js b/test/sim/misc/ogerpon.js index 21b7deeaeb..842ae66296 100644 --- a/test/sim/misc/ogerpon.js +++ b/test/sim/misc/ogerpon.js @@ -5,14 +5,14 @@ const common = require('./../../common'); let battle; -describe(`[Hackmons] Ogerpon`, function () { +describe(`[Hackmons] Ogerpon`, () => { // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9838633 - it(`should keep permanent abilites after Terastallizing until it switches out`, function () { + it(`should keep permanent abilites after Terastallizing until it switches out`, () => { battle = common.gen(9).createBattle([[ - {species: 'ogerpon', ability: 'multitype', moves: ['sleeptalk']}, - {species: 'shedinja', moves: ['splash']}, + { species: 'ogerpon', ability: 'multitype', moves: ['sleeptalk'] }, + { species: 'shedinja', moves: ['splash'] }, ], [ - {species: 'silicobra', moves: ['stealthrock']}, + { species: 'silicobra', moves: ['stealthrock'] }, ]]); const ogerpon = battle.p1.active[0]; battle.makeChoices('move sleeptalk terastallize', 'auto'); diff --git a/test/sim/misc/overflowstatmod.js b/test/sim/misc/overflowstatmod.js index d6c65c4665..8dc8a2fe19 100644 --- a/test/sim/misc/overflowstatmod.js +++ b/test/sim/misc/overflowstatmod.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Overflow Stat Mod', function () { - afterEach(function () { +describe('Overflow Stat Mod', () => { + afterEach(() => { battle.destroy(); }); - it('should cap stats at 654 after a positive nature', function () { - battle = common.createBattle({overflowStatMod: true}); - battle.setPlayer('p1', {team: [ - {species: 'Eternatus-Eternamax', ability: 'Neutralizing Gas', moves: ['tackle'], nature: 'bold', evs: {def: 252}}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Magikarp', ability: 'Damp', moves: ['tackle'], nature: 'bold', evs: {def: 1}}, - ]}); + it('should cap stats at 654 after a positive nature', () => { + battle = common.createBattle({ overflowStatMod: true }); + battle.setPlayer('p1', { team: [ + { species: 'Eternatus-Eternamax', ability: 'Neutralizing Gas', moves: ['tackle'], nature: 'bold', evs: { def: 252 } }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Magikarp', ability: 'Damp', moves: ['tackle'], nature: 'bold', evs: { def: 1 } }, + ] }); const eternamax = battle.p1.active[0]; const def = eternamax.getStat('def'); diff --git a/test/sim/misc/partnersincrime.js b/test/sim/misc/partnersincrime.js index 5cd2ca7c2a..4c8c781207 100644 --- a/test/sim/misc/partnersincrime.js +++ b/test/sim/misc/partnersincrime.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Partners in Crime', function () { +describe('Partners in Crime', () => { afterEach(() => battle.destroy()); - it('should activate shared abilities at the same time as other abilities', function () { - battle = common.createBattle({formatid: 'gen9partnersincrime'}, [[ - {species: 'Incineroar', ability: 'intimidate', item: 'whiteherb', moves: ['sleeptalk']}, - {species: 'Pincurchin', ability: 'electricsurge', moves: ['sleeptalk']}, + it('should activate shared abilities at the same time as other abilities', () => { + battle = common.createBattle({ formatid: 'gen9partnersincrime' }, [[ + { species: 'Incineroar', ability: 'intimidate', item: 'whiteherb', moves: ['sleeptalk'] }, + { species: 'Pincurchin', ability: 'electricsurge', moves: ['sleeptalk'] }, ], [ - {species: 'Rampardos', ability: 'sheerforce', moves: ['sleeptalk']}, - {species: 'Iron Valiant', ability: 'quarkdrive', moves: ['sleeptalk']}, - {species: 'Litten', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'Rampardos', ability: 'sheerforce', moves: ['sleeptalk'] }, + { species: 'Iron Valiant', ability: 'quarkdrive', moves: ['sleeptalk'] }, + { species: 'Litten', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); // team preview battle.makeChoices(); @@ -35,14 +35,14 @@ describe('Partners in Crime', function () { assert.statStage(incineroar, 'atk', 0, `Incineroar's White Herb should have activated after both Litten and Rampardos's Intimidates`); }); - it('should activate shared abilities for each ally when only the original holder switches in', function () { - battle = common.createBattle({formatid: 'gen9partnersincrime'}, [[ - {species: 'Pyukumuku', ability: 'innardsout', moves: ['sleeptalk']}, - {species: 'Pincurchin', ability: 'electricsurge', moves: ['sleeptalk']}, - {species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk']}, + it('should activate shared abilities for each ally when only the original holder switches in', () => { + battle = common.createBattle({ formatid: 'gen9partnersincrime' }, [[ + { species: 'Pyukumuku', ability: 'innardsout', moves: ['sleeptalk'] }, + { species: 'Pincurchin', ability: 'electricsurge', moves: ['sleeptalk'] }, + { species: 'Incineroar', ability: 'intimidate', moves: ['sleeptalk'] }, ], [ - {species: 'Corviknight', ability: 'mirrorarmor', moves: ['sleeptalk']}, - {species: 'Iron Valiant', ability: 'quarkdrive', moves: ['sleeptalk']}, + { species: 'Corviknight', ability: 'mirrorarmor', moves: ['sleeptalk'] }, + { species: 'Iron Valiant', ability: 'quarkdrive', moves: ['sleeptalk'] }, ]]); // team preview battle.makeChoices(); @@ -52,14 +52,14 @@ describe('Partners in Crime', function () { assert.statStage(pincurchin, 'atk', -2, 'Pincurchin should have had its innate Intimidate activate, triggering Mirror Armor'); }); - it('should not activate ally\'s innates if the partner faints on switch-in', function () { - battle = common.createBattle({formatid: 'gen9partnersincrime'}, [[ - {species: 'Shedinja', ability: 'download', moves: ['sleeptalk']}, - {species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk']}, - {species: 'Chansey', ability: 'healer', moves: ['sleeptalk']}, + it('should not activate ally\'s innates if the partner faints on switch-in', () => { + battle = common.createBattle({ formatid: 'gen9partnersincrime' }, [[ + { species: 'Shedinja', ability: 'download', moves: ['sleeptalk'] }, + { species: 'Cresselia', ability: 'levitate', moves: ['sleeptalk'] }, + { species: 'Chansey', ability: 'healer', moves: ['sleeptalk'] }, ], [ - {species: 'Stonjourner', ability: 'powerspot', moves: ['stealthrock']}, - {species: 'Iron Hands', ability: 'quarkdrive', moves: ['sleeptalk']}, + { species: 'Stonjourner', ability: 'powerspot', moves: ['stealthrock'] }, + { species: 'Iron Hands', ability: 'quarkdrive', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const cresselia = battle.p1.active[1]; diff --git a/test/sim/misc/pledgemoves.js b/test/sim/misc/pledgemoves.js index 1c2ee1fb85..3c61f9d5e8 100644 --- a/test/sim/misc/pledgemoves.js +++ b/test/sim/misc/pledgemoves.js @@ -5,22 +5,22 @@ const common = require('./../../common'); let battle; -describe('Pledge Moves', function () { - beforeEach(function () { - battle = common.createBattle({gameType: 'doubles'}); +describe('Pledge Moves', () => { + beforeEach(() => { + battle = common.createBattle({ gameType: 'doubles' }); }); afterEach(() => battle.destroy()); - it('should not combine if one of the users is forced to use a non-pledge move on its turn', function () { - battle.setPlayer('p1', {team: [ - {species: 'Venusaur', level: 90, moves: ['sludge', 'grasspledge']}, - {species: 'Charizard', level: 99, moves: ['sleeptalk', 'firepledge']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Whimsicott', ability: 'prankster', moves: ['encore']}, - {species: 'Blastoise', moves: ['sleeptalk']}, - ]}); + it('should not combine if one of the users is forced to use a non-pledge move on its turn', () => { + battle.setPlayer('p1', { team: [ + { species: 'Venusaur', level: 90, moves: ['sludge', 'grasspledge'] }, + { species: 'Charizard', level: 99, moves: ['sleeptalk', 'firepledge'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Whimsicott', ability: 'prankster', moves: ['encore'] }, + { species: 'Blastoise', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move sludge 2, move sleeptalk', 'move encore 1, move sleeptalk'); battle.makeChoices('move grasspledge 2, move firepledge 2', 'move encore 1, move sleeptalk'); @@ -28,26 +28,26 @@ describe('Pledge Moves', function () { assert(!battle.p1.active[1].moveThisTurn, "Charizard should not have moved this turn."); }); - it("should not start a Pledge combo for Z-moves", function () { - battle = common.gen(7).createBattle({gameType: 'doubles'}, [[ - {species: 'Weedle', ability: 'sapsipper', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it("should not start a Pledge combo for Z-moves", () => { + battle = common.gen(7).createBattle({ gameType: 'doubles' }, [[ + { species: 'Weedle', ability: 'sapsipper', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Venusaur', moves: ['grasspledge']}, - {species: 'Charizard', level: 1, item: 'firiumz', moves: ['firepledge']}, + { species: 'Venusaur', moves: ['grasspledge'] }, + { species: 'Charizard', level: 1, item: 'firiumz', moves: ['firepledge'] }, ]]); battle.makeChoices('auto', 'move grasspledge +1, move firepledge +1 zmove'); const weedle = battle.p1.active[0]; assert.statStage(weedle, 'atk', +1); }); - it("should not start a Pledge combo for Max Moves", function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Weedle', ability: 'sapsipper', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it("should not start a Pledge combo for Max Moves", () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Weedle', ability: 'sapsipper', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Venusaur', moves: ['grasspledge']}, - {species: 'Charizard', level: 1, moves: ['firepledge'], gigantamax: true}, + { species: 'Venusaur', moves: ['grasspledge'] }, + { species: 'Charizard', level: 1, moves: ['firepledge'], gigantamax: true }, ]]); battle.makeChoices('auto', 'move grasspledge +1, move firepledge +1 dynamax'); const weedle = battle.p1.active[0]; diff --git a/test/sim/misc/prng.js b/test/sim/misc/prng.js index 7adfc5bcb0..b8941def18 100644 --- a/test/sim/misc/prng.js +++ b/test/sim/misc/prng.js @@ -5,8 +5,8 @@ const assert = require('../../assert'); const testSeed = 'sodium,00000001000000020000000300000004'; -describe(`PRNG`, function () { - it("should always generate the same results off the same seed", function () { +describe(`PRNG`, () => { + it("should always generate the same results off the same seed", () => { const results = []; const testAgainst = new PRNG(testSeed); for (let i = 0; i < 100; i++) { @@ -21,32 +21,32 @@ describe(`PRNG`, function () { } }); - describe(`randomChance(numerator=0, denominator=1)`, function () { - it(`should always return false`, function () { + describe(`randomChance(numerator=0, denominator=1)`, () => { + it(`should always return false`, () => { const prng = new PRNG(testSeed); for (let i = 0; i < 100; ++i) { assert.equal(prng.randomChance(0, 1), false); } }); }); - describe(`randomChance(numerator=1, denominator=1)`, function () { - it(`should always return true`, function () { + describe(`randomChance(numerator=1, denominator=1)`, () => { + it(`should always return true`, () => { const prng = new PRNG(testSeed); for (let i = 0; i < 100; ++i) { assert.equal(prng.randomChance(1, 1), true); } }); }); - describe(`randomChance(numerator=256, denominator=256)`, function () { - it(`should always return true`, function () { + describe(`randomChance(numerator=256, denominator=256)`, () => { + it(`should always return true`, () => { const prng = new PRNG(testSeed); for (let i = 0; i < 100; ++i) { assert.equal(prng.randomChance(256, 256), true); } }); }); - describe(`randomChance(numerator=1, denominator=2)`, function () { - it(`should return true 45-55% of the time`, function () { + describe(`randomChance(numerator=1, denominator=2)`, () => { + it(`should return true 45-55% of the time`, () => { const prng = new PRNG(testSeed); let trueCount = 0; for (let i = 0; i < 100; ++i) { @@ -56,7 +56,7 @@ describe(`PRNG`, function () { } assert.bounded(trueCount, [45, 55]); }); - it(`should be identical to (random(2) == 0)`, function () { + it(`should be identical to (random(2) == 0)`, () => { // This invariant is important for battle logs. const coinPRNG = new PRNG(testSeed); const numberPRNG = new PRNG(testSeed); @@ -65,8 +65,8 @@ describe(`PRNG`, function () { } }); }); - describe(`randomChance(numerator=217, denominator=256)`, function () { - it(`should return true 80%-90% of the time`, function () { + describe(`randomChance(numerator=217, denominator=256)`, () => { + it(`should return true 80%-90% of the time`, () => { const prng = new PRNG(testSeed); let trueCount = 0; for (let i = 0; i < 100; ++i) { @@ -76,7 +76,7 @@ describe(`PRNG`, function () { } assert.bounded(trueCount, [80, 90]); }); - it(`should be identical to (random(256) < 217)`, function () { + it(`should be identical to (random(256) < 217)`, () => { // This invariant is important for battle logs. const coinPRNG = new PRNG(testSeed); const numberPRNG = new PRNG(testSeed); @@ -85,13 +85,13 @@ describe(`PRNG`, function () { } }); }); - describe(`sample`, function () { - it(`should throw for a zero-item array`, function () { + describe(`sample`, () => { + it(`should throw for a zero-item array`, () => { const prng = new PRNG(testSeed); const items = []; assert.throws(() => prng.sample(items), RangeError); }); - it(`should eventually throw for a very sparse array`, function () { + it(`should eventually throw for a very sparse array`, () => { const prng = new PRNG(testSeed); const items = []; items[30] = 'hello!'; @@ -101,7 +101,7 @@ describe(`PRNG`, function () { } }); }); - it(`should eventually throw for a somewhat sparse array`, function () { + it(`should eventually throw for a somewhat sparse array`, () => { const prng = new PRNG(testSeed); const items = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K']; delete items[9]; @@ -111,7 +111,7 @@ describe(`PRNG`, function () { } }); }); - it(`should return the only item in a single-item array`, function () { + it(`should return the only item in a single-item array`, () => { const item = {}; const prng = new PRNG(testSeed); for (let i = 0; i < 10; ++i) { @@ -119,9 +119,9 @@ describe(`PRNG`, function () { assert.equal(sample, item); } }); - it(`should return items with equal probability for a five-item array`, function () { + it(`should return items with equal probability for a five-item array`, () => { const items = ['a', 'b', 'c', 'd', 'e']; - const occurences = {a: 0, b: 0, c: 0, d: 0, e: 0}; + const occurences = { a: 0, b: 0, c: 0, d: 0, e: 0 }; const prng = new PRNG(testSeed); for (let i = 0; i < 1000; ++i) { const sample = prng.sample(items); @@ -133,9 +133,9 @@ describe(`PRNG`, function () { assert.bounded(occurences.d, [170, 230]); assert.bounded(occurences.e, [170, 230]); }); - it(`should return items with weighted probability for a three-item array with duplicates`, function () { + it(`should return items with weighted probability for a three-item array with duplicates`, () => { const items = ['x', 'x', 'y']; - const occurences = {x: 0, y: 0}; + const occurences = { x: 0, y: 0 }; const prng = new PRNG(testSeed); for (let i = 0; i < 100; ++i) { const sample = prng.sample(items); @@ -144,7 +144,7 @@ describe(`PRNG`, function () { assert.bounded(occurences.x, [63, 71]); assert.bounded(occurences.y, [29, 37]); }); - it(`should be identical to array[random(array.length)]`, function () { + it(`should be identical to array[random(array.length)]`, () => { // This invariant is important for battle logs. const items = [{}, {}, {}, {}, {}, {}, {}, {}]; const samplePRNG = new PRNG(testSeed); diff --git a/test/sim/misc/recoil.js b/test/sim/misc/recoil.js index 18ab30e507..759533bffe 100644 --- a/test/sim/misc/recoil.js +++ b/test/sim/misc/recoil.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Recoil', function () { - afterEach(function () { +describe('Recoil', () => { + afterEach(() => { battle.destroy(); }); - it('should deal damage to the user after an attack depending on the damage dealt', function () { + it('should deal damage to the user after an attack depending on the damage dealt', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Kartana", ability: 'compoundeyes', moves: ['headcharge', 'doubleedge', 'headsmash']}]}); - battle.setPlayer('p2', {team: [{species: "Happiny", level: 50, ability: 'sturdy', moves: ['strengthsap']}]}); + battle.setPlayer('p1', { team: [{ species: "Kartana", ability: 'compoundeyes', moves: ['headcharge', 'doubleedge', 'headsmash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Happiny", level: 50, ability: 'sturdy', moves: ['strengthsap'] }] }); const recoilFactors = [0.25, 0.33, 0.5]; for (let i = 0; i < 3; i++) { assert.hurtsBy(battle.p1.active[0], Math.round((battle.p2.active[0].maxhp - 1) * recoilFactors[i]), () => battle.makeChoices(`move ${i + 1}`, `move strengthsap`)); diff --git a/test/sim/misc/silvally.js b/test/sim/misc/silvally.js index df86f1e865..3499463e42 100644 --- a/test/sim/misc/silvally.js +++ b/test/sim/misc/silvally.js @@ -3,36 +3,36 @@ const assert = require('assert').strict; const common = require('./../../common'); -const unimportantPokemon = {species: 'magikarp', moves: ['splash']}; +const unimportantPokemon = { species: 'magikarp', moves: ['splash'] }; -describe(`[Hackmons] Silvally`, function () { - it(`in untyped forme should change its type to match the memory held`, function () { +describe(`[Hackmons] Silvally`, () => { + it(`in untyped forme should change its type to match the memory held`, () => { const battle = common.createBattle([ - [{species: 'silvally', ability: 'rkssystem', item: 'firememory', moves: ['rest']}], + [{ species: 'silvally', ability: 'rkssystem', item: 'firememory', moves: ['rest'] }], [unimportantPokemon], ]); assert.deepEqual(battle.p1.active[0].getTypes(), ["Fire"]); }); - it(`in Steel forme should should be Water-typed to match the held Water Memory`, function () { + it(`in Steel forme should should be Water-typed to match the held Water Memory`, () => { const battle = common.createBattle([ - [{species: 'silvallysteel', ability: 'rkssystem', item: 'watermemory', moves: ['rest']}], + [{ species: 'silvallysteel', ability: 'rkssystem', item: 'watermemory', moves: ['rest'] }], [unimportantPokemon], ]); assert.deepEqual(battle.p1.active[0].getTypes(), ["Water"]); }); - it(`in a typed forme should be Normal-typed if no memory is held`, function () { + it(`in a typed forme should be Normal-typed if no memory is held`, () => { const battle = common.createBattle([ - [{species: 'silvallyfire', ability: 'rkssystem', item: 'leftovers', moves: ['rest']}], + [{ species: 'silvallyfire', ability: 'rkssystem', item: 'leftovers', moves: ['rest'] }], [unimportantPokemon], ]); assert.deepEqual(battle.p1.active[0].getTypes(), ["Normal"]); }); - it(`[Gen 7] in a typed forme should be Normal-typed despite holding a memory if Silvally does not have the RKS System ability`, function () { + it(`[Gen 7] in a typed forme should be Normal-typed despite holding a memory if Silvally does not have the RKS System ability`, () => { const battle = common.gen(7).createBattle([ - [{species: 'silvallyfire', ability: 'truant', item: 'firememory', moves: ['rest']}], + [{ species: 'silvallyfire', ability: 'truant', item: 'firememory', moves: ['rest'] }], [unimportantPokemon], ]); assert.deepEqual(battle.p1.active[0].getTypes(), ["Normal"]); diff --git a/test/sim/misc/sleepclausemod.js b/test/sim/misc/sleepclausemod.js index 6ab74c4baa..50ea4a6c42 100644 --- a/test/sim/misc/sleepclausemod.js +++ b/test/sim/misc/sleepclausemod.js @@ -9,9 +9,9 @@ describe('Sleep Clause Mod', () => { afterEach(() => battle.destroy()); it('should prevent players from putting more than one of foe\'s Pokemon to sleep', () => { - battle = common.createBattle({sleepClause: true}); - battle.setPlayer('p1', {team: [{species: "Paras", moves: ['spore']}]}); - battle.setPlayer('p2', {team: [{species: "Magikarp", moves: ['splash']}, {species: "Feebas", moves: ['splash']}]}); + battle = common.createBattle({ sleepClause: true }); + battle.setPlayer('p1', { team: [{ species: "Paras", moves: ['spore'] }] }); + battle.setPlayer('p2', { team: [{ species: "Magikarp", moves: ['splash'] }, { species: "Feebas", moves: ['splash'] }] }); battle.makeChoices('move spore', 'switch 2'); assert.equal(battle.p2.active[0].status, 'slp'); battle.makeChoices('move spore', 'switch 2'); @@ -19,9 +19,9 @@ describe('Sleep Clause Mod', () => { }); it('should not prevent Rest', () => { - battle = common.createBattle({sleepClause: true}); - battle.setPlayer('p1', {team: [{species: "Paras", moves: ['spore', 'tackle']}]}); - battle.setPlayer('p2', {team: [{species: "Feebas", moves: ['rest']}, {species: "Magikarp", moves: ['splash']}]}); + battle = common.createBattle({ sleepClause: true }); + battle.setPlayer('p1', { team: [{ species: "Paras", moves: ['spore', 'tackle'] }] }); + battle.setPlayer('p2', { team: [{ species: "Feebas", moves: ['rest'] }, { species: "Magikarp", moves: ['splash'] }] }); battle.makeChoices('move spore', 'switch 2'); assert.equal(battle.p2.active[0].status, 'slp'); battle.makeChoices('move tackle', 'switch 2'); diff --git a/test/sim/misc/speed.js b/test/sim/misc/speed.js index 058a62f27a..ad53a434ae 100644 --- a/test/sim/misc/speed.js +++ b/test/sim/misc/speed.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe(`Speed`, function () { - afterEach(function () { +describe(`Speed`, () => { + afterEach(() => { battle.destroy(); }); - it.skip(`should cap chained Speed modifiers at 410 as a lower bound`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'regigigas', ability: 'slowstart', item: 'ironball', moves: ['waterpledge']}, - {species: 'ivysaur', moves: ['grasspledge']}, + it.skip(`should cap chained Speed modifiers at 410 as a lower bound`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'regigigas', ability: 'slowstart', item: 'ironball', moves: ['waterpledge'] }, + { species: 'ivysaur', moves: ['grasspledge'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move waterpledge -2, move grasspledge -1', 'auto'); const regigigas = battle.p1.active[0]; diff --git a/test/sim/misc/statdownoverflow.js b/test/sim/misc/statdownoverflow.js index 136b43597b..5c85259410 100644 --- a/test/sim/misc/statdownoverflow.js +++ b/test/sim/misc/statdownoverflow.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('[Gen 1] Stat Drop Overflow', function () { - afterEach(function () { +describe('[Gen 1] Stat Drop Overflow', () => { + afterEach(() => { battle.destroy(); }); - it(`SafeTwo`, function () { + it(`SafeTwo`, () => { battle = common.gen(1).createBattle([[ - {species: 'Mewtwo', moves: ['amnesia', 'psychic'], ivs: {'spa': 28, 'spd': 28}}, + { species: 'Mewtwo', moves: ['amnesia', 'psychic'], ivs: { 'spa': 28, 'spd': 28 } }, ], [ - {species: 'Slowbro', moves: ['amnesia', 'surf'], evs: {'spa': 255, 'spd': 255}}, + { species: 'Slowbro', moves: ['amnesia', 'surf'], evs: { 'spa': 255, 'spd': 255 } }, ]]); const mewtwo = battle.p1.active[0]; @@ -23,18 +23,18 @@ describe('[Gen 1] Stat Drop Overflow', function () { battle.makeChoices(); assert.equal(mewtwo.modifiedStats['spa'], 999); battle.makeChoices(); - mewtwo.boostBy({spa: -1, spd: -1}); // Drop Special to +5 + mewtwo.boostBy({ spa: -1, spd: -1 }); // Drop Special to +5 assert.equal(mewtwo.modifiedStats['spa'], 1023); // Mewtwo's Special has not overflowed battle.makeChoices('move psychic', 'move surf'); assert.false.fainted(mewtwo); }); - it(`Not SafeTwo`, function () { + it(`Not SafeTwo`, () => { battle = common.gen(1).createBattle([[ - {species: 'Mewtwo', moves: ['amnesia', 'luckychant'], evs: {'spa': 255, 'spd': 255}}, + { species: 'Mewtwo', moves: ['amnesia', 'luckychant'], evs: { 'spa': 255, 'spd': 255 } }, ], [ - {species: 'Slowbro', moves: ['amnesia', 'surf'], evs: {'spa': 255, 'spd': 255}}, + { species: 'Slowbro', moves: ['amnesia', 'surf'], evs: { 'spa': 255, 'spd': 255 } }, ]]); const mewtwo = battle.p1.active[0]; @@ -43,7 +43,7 @@ describe('[Gen 1] Stat Drop Overflow', function () { battle.makeChoices(); assert.equal(mewtwo.modifiedStats['spa'], 999); battle.makeChoices(); - mewtwo.boostBy({spa: -1, spd: -1}); // Drop Special to +5 + mewtwo.boostBy({ spa: -1, spd: -1 }); // Drop Special to +5 assert.equal(mewtwo.modifiedStats['spa'], 1218); // Mewtwo's Special has overflowed battle.makeChoices('move luckychant', 'move surf'); diff --git a/test/sim/misc/state.js b/test/sim/misc/state.js index 7e9a24e5ff..eeff86d346 100644 --- a/test/sim/misc/state.js +++ b/test/sim/misc/state.js @@ -6,27 +6,27 @@ const Battle = require('./../../../dist/sim/battle').Battle; const State = require('./../../../dist/sim/state').State; const TEAMS = [[ - {species: 'Mew', ability: 'synchronize', item: 'assaultvest', moves: ['psychic']}, - {species: 'Ditto', ability: 'imposter', item: 'choicescarf', moves: ['transform']}, - {species: 'Amoonguss', ability: 'effectspore', item: 'blacksludge', moves: ['toxic']}, - {species: 'Gliscor', ability: 'poisonheal', item: 'toxicorb', moves: ['curse']}, - {species: 'Zoroark', ability: 'illusion', item: 'leftovers', moves: ['knockoff']}, - {species: 'Gengar', ability: 'cursedbody', item: 'brightpowder', moves: ['disable']}, + { species: 'Mew', ability: 'synchronize', item: 'assaultvest', moves: ['psychic'] }, + { species: 'Ditto', ability: 'imposter', item: 'choicescarf', moves: ['transform'] }, + { species: 'Amoonguss', ability: 'effectspore', item: 'blacksludge', moves: ['toxic'] }, + { species: 'Gliscor', ability: 'poisonheal', item: 'toxicorb', moves: ['curse'] }, + { species: 'Zoroark', ability: 'illusion', item: 'leftovers', moves: ['knockoff'] }, + { species: 'Gengar', ability: 'cursedbody', item: 'brightpowder', moves: ['disable'] }, ], [ - {species: 'Ninjask', ability: 'speedboost', item: 'rockyhelmet', moves: ['batonpass']}, - {species: 'Hippowdon', ability: 'sandstream', item: 'choiceband', moves: ['earthquake']}, - {species: 'Jirachi', ability: 'serenegrace', item: 'choicescarf', moves: ['ironhead']}, - {species: 'Chansey', ability: 'naturalcure', item: 'eviolite', moves: ['seismictoss']}, - {species: 'Vaporeon', ability: 'waterabsorb', item: 'wacanberry', moves: ['surf']}, - {species: 'Snorlax', ability: 'thickfat', item: 'leftovers', moves: ['rest']}, + { species: 'Ninjask', ability: 'speedboost', item: 'rockyhelmet', moves: ['batonpass'] }, + { species: 'Hippowdon', ability: 'sandstream', item: 'choiceband', moves: ['earthquake'] }, + { species: 'Jirachi', ability: 'serenegrace', item: 'choicescarf', moves: ['ironhead'] }, + { species: 'Chansey', ability: 'naturalcure', item: 'eviolite', moves: ['seismictoss'] }, + { species: 'Vaporeon', ability: 'waterabsorb', item: 'wacanberry', moves: ['surf'] }, + { species: 'Snorlax', ability: 'thickfat', item: 'leftovers', moves: ['rest'] }, ]]; -describe('State', function () { - describe('Battles', function () { +describe('State', () => { + describe('Battles', () => { it('should be able to be serialized and deserialized without affecting functionality (slow)', function () { this.timeout(5000); - const control = common.createBattle({seed: 'sodium,00000001000000020000000300000004'}, TEAMS); - let test = common.createBattle({seed: 'sodium,00000001000000020000000300000004'}, TEAMS); + const control = common.createBattle({ seed: 'sodium,00000001000000020000000300000004' }, TEAMS); + let test = common.createBattle({ seed: 'sodium,00000001000000020000000300000004' }, TEAMS); while (!(control.ended || test.ended)) { control.makeChoices(); @@ -43,7 +43,7 @@ describe('State', function () { control.destroy(); test.destroy(); }); - it('should require special treatment for complex objects', function () { + it('should require special treatment for complex objects', () => { const battle = common.createBattle(TEAMS); battle.foo = new Map(); assert.throws(() => battle.toJSON(), /Unsupported type Map/); diff --git a/test/sim/misc/statuses.js b/test/sim/misc/statuses.js index 5caaaa61a5..384f710fc9 100644 --- a/test/sim/misc/statuses.js +++ b/test/sim/misc/statuses.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Burn', function () { - afterEach(function () { +describe('Burn', () => { + afterEach(() => { battle.destroy(); }); - it('should inflict 1/16 of max HP at the end of the turn, rounded down', function () { + it('should inflict 1/16 of max HP at the end of the turn, rounded down', () => { battle = common.createBattle([ - [{species: 'Machamp', ability: 'noguard', moves: ['bulkup']}], - [{species: 'Sableye', ability: 'prankster', moves: ['willowisp']}], + [{ species: 'Machamp', ability: 'noguard', moves: ['bulkup'] }], + [{ species: 'Sableye', ability: 'prankster', moves: ['willowisp'] }], ]); const target = battle.p1.active[0]; assert.hurtsBy(target, Math.floor(target.maxhp / 16), () => battle.makeChoices('move bulkup', 'move willowisp')); }); - it(`should halve damage from most Physical attacks`, function () { + it(`should halve damage from most Physical attacks`, () => { battle = common.createBattle([[ - {species: 'Machamp', ability: 'noguard', moves: ['boneclub']}, + { species: 'Machamp', ability: 'noguard', moves: ['boneclub'] }, ], [ - {species: 'Sableye', ability: 'prankster', moves: ['willowisp']}, + { species: 'Sableye', ability: 'prankster', moves: ['willowisp'] }, ]]); battle.makeChoices(); const sableye = battle.p2.active[0]; @@ -31,37 +31,37 @@ describe('Burn', function () { assert.bounded(damage, [37, 44]); }); - it('should reduce atk to 50% of its original value in Stadium', function () { + it('should reduce atk to 50% of its original value in Stadium', () => { // I know WoW doesn't exist in Stadium, but the engine supports future gen moves // and this is easier than digging for a seed that makes Flamethrower burn - battle = common.createBattle({formatid: 'gen1stadiumou@@@!teampreview'}, [ - [{species: 'Vaporeon', moves: ['growl']}], - [{species: 'Jolteon', moves: ['willowisp']}], + battle = common.createBattle({ formatid: 'gen1stadiumou@@@!teampreview' }, [ + [{ species: 'Vaporeon', moves: ['growl'] }], + [{ species: 'Jolteon', moves: ['willowisp'] }], ]); const attack = battle.p1.active[0].getStat('atk'); battle.makeChoices('move growl', 'move willowisp'); assert.equal(battle.p1.active[0].getStat('atk'), Math.floor(attack * 0.5)); }); - it('should not halve damage from moves with set damage', function () { + it('should not halve damage from moves with set damage', () => { battle = common.createBattle([ - [{species: 'Machamp', ability: 'noguard', moves: ['seismictoss']}], - [{species: 'Talonflame', ability: 'galewings', moves: ['willowisp']}], + [{ species: 'Machamp', ability: 'noguard', moves: ['seismictoss'] }], + [{ species: 'Talonflame', ability: 'galewings', moves: ['willowisp'] }], ]); assert.hurtsBy(battle.p2.active[0], 100, () => battle.makeChoices('move seismictoss', 'move willowisp')); }); }); -describe('Paralysis', function () { - afterEach(function () { +describe('Paralysis', () => { + afterEach(() => { battle.destroy(); }); - it(`should reduce speed to 50% of its original value`, function () { + it(`should reduce speed to 50% of its original value`, () => { battle = common.createBattle([[ - {species: 'Vaporeon', moves: ['sleeptalk']}, + { species: 'Vaporeon', moves: ['sleeptalk'] }, ], [ - {species: 'Jolteon', moves: ['glare']}, + { species: 'Jolteon', moves: ['glare'] }, ]]); const vaporeon = battle.p1.active[0]; @@ -70,58 +70,58 @@ describe('Paralysis', function () { assert.equal(vaporeon.getStat('spe'), battle.modify(speed, 0.5)); }); - it(`should apply its Speed reduction after all other Speed modifiers`, function () { + it(`should apply its Speed reduction after all other Speed modifiers`, () => { battle = common.createBattle([[ - {species: 'goldeen', item: 'choicescarf', evs: {spe: 252}, moves: ['sleeptalk']}, // 225 Speed + { species: 'goldeen', item: 'choicescarf', evs: { spe: 252 }, moves: ['sleeptalk'] }, // 225 Speed ], [ - {species: 'wynaut', moves: ['glare']}, + { species: 'wynaut', moves: ['glare'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].getStat('spe'), 168); // would be 169 if both Choice Scarf and paralysis were chained battle = common.createBattle([[ - {species: 'hawlucha', item: 'whiteherb', ability: 'unburden', evs: {spe: 4}, moves: ['closecombat']}, // 273 Speed + { species: 'hawlucha', item: 'whiteherb', ability: 'unburden', evs: { spe: 4 }, moves: ['closecombat'] }, // 273 Speed ], [ - {species: 'wynaut', moves: ['glare']}, + { species: 'wynaut', moves: ['glare'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].getStat('spe'), 273); // would be 272 if paralysis was applied first }); - it('should reduce speed to 25% of its original value in Gen 6', function () { + it('should reduce speed to 25% of its original value in Gen 6', () => { battle = common.gen(6).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Vaporeon', ability: 'waterabsorb', moves: ['aquaring']}]}); - battle.setPlayer('p2', {team: [{species: 'Jolteon', ability: 'voltabsorb', moves: ['thunderwave']}]}); + battle.setPlayer('p1', { team: [{ species: 'Vaporeon', ability: 'waterabsorb', moves: ['aquaring'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Jolteon', ability: 'voltabsorb', moves: ['thunderwave'] }] }); const speed = battle.p1.active[0].getStat('spe'); battle.makeChoices('move aquaring', 'move thunderwave'); assert.equal(battle.p1.active[0].getStat('spe'), battle.modify(speed, 0.25)); }); - it('should reduce speed to 25% of its original value in Gen 2', function () { + it('should reduce speed to 25% of its original value in Gen 2', () => { battle = common.gen(2).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Vaporeon', ability: 'waterabsorb', moves: ['aquaring']}]}); - battle.setPlayer('p2', {team: [{species: 'Jolteon', ability: 'voltabsorb', moves: ['thunderwave']}]}); + battle.setPlayer('p1', { team: [{ species: 'Vaporeon', ability: 'waterabsorb', moves: ['aquaring'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Jolteon', ability: 'voltabsorb', moves: ['thunderwave'] }] }); const speed = battle.p1.active[0].getStat('spe'); battle.makeChoices('move aquaring', 'move thunderwave'); assert.equal(battle.p1.active[0].getStat('spe'), battle.modify(speed, 0.25)); }); - it('should reduce speed to 25% of its original value in Stadium', function () { - battle = common.createBattle({formatid: 'gen1stadiumou@@@!teampreview'}, [ - [{species: 'Vaporeon', moves: ['growl']}], - [{species: 'Jolteon', moves: ['thunderwave']}], + it('should reduce speed to 25% of its original value in Stadium', () => { + battle = common.createBattle({ formatid: 'gen1stadiumou@@@!teampreview' }, [ + [{ species: 'Vaporeon', moves: ['growl'] }], + [{ species: 'Jolteon', moves: ['thunderwave'] }], ]); const speed = battle.p1.active[0].getStat('spe'); battle.makeChoices('move growl', 'move thunderwave'); assert.equal(battle.p1.active[0].getStat('spe'), Math.floor(speed * 0.25)); }); - it('should reapply its speed drop when an opponent uses a stat-altering move in Gen 1', function () { + it('should reapply its speed drop when an opponent uses a stat-altering move in Gen 1', () => { battle = common.gen(1).createBattle([ - [{species: 'Electrode', moves: ['rest']}], - [{species: 'Slowpoke', moves: ['amnesia', 'thunderwave']}], + [{ species: 'Electrode', moves: ['rest'] }], + [{ species: 'Slowpoke', moves: ['amnesia', 'thunderwave'] }], ]); battle.makeChoices('move rest', 'move thunderwave'); const speed = battle.p1.active[0].getStat('spe'); @@ -129,10 +129,10 @@ describe('Paralysis', function () { assert.equal(battle.p1.active[0].getStat('spe'), battle.modify(speed, 0.25)); }); - it('should not reapply its speed drop when an opponent uses a failed stat-altering move in Gen 1', function () { + it('should not reapply its speed drop when an opponent uses a failed stat-altering move in Gen 1', () => { battle = common.gen(1).createBattle([ - [{species: 'Electrode', moves: ['rest']}], - [{species: 'Slowpoke', moves: ['amnesia', 'thunderwave']}], + [{ species: 'Electrode', moves: ['rest'] }], + [{ species: 'Slowpoke', moves: ['amnesia', 'thunderwave'] }], ]); battle.makeChoices('move rest', 'move amnesia'); battle.makeChoices('move rest', 'move amnesia'); @@ -144,15 +144,15 @@ describe('Paralysis', function () { }); }); -describe('Toxic Poison', function () { - afterEach(function () { +describe('Toxic Poison', () => { + afterEach(() => { battle.destroy(); }); - it('should inflict 1/16 of max HP rounded down, times the number of active turns with the status, at the end of the turn', function () { + it('should inflict 1/16 of max HP rounded down, times the number of active turns with the status, at the end of the turn', () => { battle = common.createBattle([ - [{species: 'Chansey', ability: 'naturalcure', moves: ['softboiled']}], - [{species: 'Gengar', ability: 'levitate', moves: ['toxic']}], + [{ species: 'Chansey', ability: 'naturalcure', moves: ['softboiled'] }], + [{ species: 'Gengar', ability: 'levitate', moves: ['toxic'] }], ]); const target = battle.p1.active[0]; for (let i = 1; i <= 8; i++) { @@ -161,10 +161,10 @@ describe('Toxic Poison', function () { } }); - it('should reset the damage counter when the Pokemon switches out', function () { + it('should reset the damage counter when the Pokemon switches out', () => { battle = common.createBattle([ - [{species: 'Chansey', ability: 'serenegrace', moves: ['counter']}, {species: 'Snorlax', ability: 'immunity', moves: ['curse']}], - [{species: 'Crobat', ability: 'infiltrator', moves: ['toxic', 'whirlwind']}], + [{ species: 'Chansey', ability: 'serenegrace', moves: ['counter'] }, { species: 'Snorlax', ability: 'immunity', moves: ['curse'] }], + [{ species: 'Crobat', ability: 'infiltrator', moves: ['toxic', 'whirlwind'] }], ]); for (let i = 0; i < 4; i++) { battle.makeChoices('move counter', 'move toxic'); @@ -176,15 +176,15 @@ describe('Toxic Poison', function () { }); }); -describe('Freeze', function () { - afterEach(function () { +describe('Freeze', () => { + afterEach(() => { battle.destroy(); }); - it('should cause an afflicted Shaymin-Sky to revert to its base forme', function () { + it('should cause an afflicted Shaymin-Sky to revert to its base forme', () => { battle = common.createBattle([ - [{species: 'Chansey', ability: 'serenegrace', moves: ['icebeam']}], - [{species: 'Shaymin-Sky', ability: 'sturdy', moves: ['sleeptalk']}], + [{ species: 'Chansey', ability: 'serenegrace', moves: ['icebeam'] }], + [{ species: 'Shaymin-Sky', ability: 'sturdy', moves: ['sleeptalk'] }], ]); // I didn't feel like manually testing seed after seed. Sue me. battle.onEvent('ModifyMove', battle.format, function (move) { @@ -200,10 +200,10 @@ describe('Freeze', function () { assert.equal(battle.p2.active[0].species.name, 'Shaymin'); }); - it('should not cause an afflicted Pokemon transformed into Shaymin-Sky to change to Shaymin', function () { + it('should not cause an afflicted Pokemon transformed into Shaymin-Sky to change to Shaymin', () => { battle = common.createBattle([ - [{species: 'Ditto', ability: 'imposter', moves: ['transform']}], - [{species: 'Shaymin-Sky', ability: 'sturdy', moves: ['icebeam', 'sleeptalk']}], + [{ species: 'Ditto', ability: 'imposter', moves: ['transform'] }], + [{ species: 'Shaymin-Sky', ability: 'sturdy', moves: ['icebeam', 'sleeptalk'] }], ]); battle.onEvent('ModifyMove', battle.format, function (move) { if (move.secondaries) { @@ -218,11 +218,11 @@ describe('Freeze', function () { assert.equal(battle.p1.active[0].species.name, 'Shaymin-Sky'); }); - it(`should not be possible to burn a frozen target when using a move that thaws that target`, function () { + it(`should not be possible to burn a frozen target when using a move that thaws that target`, () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'serenegrace', item: 'widelens', moves: ['sleeptalk', 'sacredfire']}, + { species: 'wynaut', ability: 'serenegrace', item: 'widelens', moves: ['sleeptalk', 'sacredfire'] }, ], [ - {species: 'shuckle', moves: ['meteorassault']}, + { species: 'shuckle', moves: ['meteorassault'] }, ]]); battle.makeChoices(); // Use Meteor Assault to force recharge next turn and skip potential thaw const frozenMon = battle.p2.active[0]; @@ -232,31 +232,31 @@ describe('Freeze', function () { }); }); -describe('Burn [Gen 6]', function () { - afterEach(function () { +describe('Burn [Gen 6]', () => { + afterEach(() => { battle.destroy(); }); - it('should inflict 1/8 of max HP at the end of the turn, rounded down', function () { + it('should inflict 1/8 of max HP at the end of the turn, rounded down', () => { battle = common.gen(6).createBattle([ - [{species: 'Machamp', ability: 'noguard', moves: ['bulkup']}], - [{species: 'Sableye', ability: 'prankster', moves: ['willowisp']}], + [{ species: 'Machamp', ability: 'noguard', moves: ['bulkup'] }], + [{ species: 'Sableye', ability: 'prankster', moves: ['willowisp'] }], ]); const target = battle.p1.active[0]; assert.hurtsBy(target, Math.floor(target.maxhp / 8), () => battle.makeChoices('move bulkup', 'move willowisp')); }); }); -describe('Toxic Poison [Gen 1]', function () { - afterEach(function () { +describe('Toxic Poison [Gen 1]', () => { + afterEach(() => { battle.destroy(); }); - it(`should affect Leech Seed damage counter`, function () { + it(`should affect Leech Seed damage counter`, () => { battle = common.gen(1).createBattle([[ - {species: 'Venusaur', moves: ['toxic', 'leechseed']}, + { species: 'Venusaur', moves: ['toxic', 'leechseed'] }, ], [ - {species: 'Chansey', moves: ['splash']}, + { species: 'Chansey', moves: ['splash'] }, ]]); // Modding accuracy so the status moves always hit @@ -271,17 +271,16 @@ describe('Toxic Poison [Gen 1]', function () { }); }); - -describe('Toxic Poison [Gen 2]', function () { - afterEach(function () { +describe('Toxic Poison [Gen 2]', () => { + afterEach(() => { battle.destroy(); }); - it(`should not affect Leech Seed damage counter`, function () { - battle = common.gen(2).createBattle({forceRandomChance: true}, [[ - {species: 'Venusaur', moves: ['toxic', 'leechseed']}, + it(`should not affect Leech Seed damage counter`, () => { + battle = common.gen(2).createBattle({ forceRandomChance: true }, [[ + { species: 'Venusaur', moves: ['toxic', 'leechseed'] }, ], [ - {species: 'Chansey', moves: ['splash']}, + { species: 'Chansey', moves: ['splash'] }, ]]); battle.makeChoices('move toxic', 'move splash'); const pokemon = battle.p2.active[0]; @@ -291,12 +290,12 @@ describe('Toxic Poison [Gen 2]', function () { assert.equal(pokemon.maxhp - pokemon.hp, Math.floor(pokemon.maxhp / 16) * 5); }); - it(`should pass the damage counter to Pokemon with Baton Pass`, function () { + it(`should pass the damage counter to Pokemon with Baton Pass`, () => { battle = common.gen(2).createBattle([[ - {species: 'Smeargle', moves: ['toxic', 'willowisp', 'splash']}, + { species: 'Smeargle', moves: ['toxic', 'willowisp', 'splash'] }, ], [ - {species: 'Chansey', moves: ['splash']}, - {species: 'Celebi', moves: ['batonpass', 'splash']}, + { species: 'Chansey', moves: ['splash'] }, + { species: 'Celebi', moves: ['batonpass', 'splash'] }, ]]); // Modding accuracy so the status moves always hit @@ -323,12 +322,12 @@ describe('Toxic Poison [Gen 2]', function () { assert.equal(hp - chansey.hp, Math.floor(chansey.maxhp / 8), `Chansey should have taken normal damage from burn`); }); - it('should revert to regular poison on switch in, even for Poison types', function () { + it('should revert to regular poison on switch in, even for Poison types', () => { battle = common.gen(2).createBattle([ - [{species: 'Smeargle', moves: ['toxic', 'splash']}], + [{ species: 'Smeargle', moves: ['toxic', 'splash'] }], [ - {species: 'Qwilfish', moves: ['transform', 'splash']}, - {species: 'Gengar', moves: ['nightshade']}, + { species: 'Qwilfish', moves: ['transform', 'splash'] }, + { species: 'Gengar', moves: ['nightshade'] }, ], ]); battle.makeChoices('move toxic', 'move transform'); @@ -340,11 +339,11 @@ describe('Toxic Poison [Gen 2]', function () { assert.equal(battle.p2.active[0].status, 'psn'); }); - it('should not have its damage counter affected by Heal Bell', function () { + it('should not have its damage counter affected by Heal Bell', () => { battle = common.gen(2).createBattle([[ - {species: 'Smeargle', moves: ['toxic', 'willowisp', 'splash']}, + { species: 'Smeargle', moves: ['toxic', 'willowisp', 'splash'] }, ], [ - {species: 'Chansey', moves: ['splash', 'healbell']}, + { species: 'Chansey', moves: ['splash', 'healbell'] }, ]]); // Modding accuracy so the status moves always hit diff --git a/test/sim/misc/statusmoves.js b/test/sim/misc/statusmoves.js index c723eee5b9..b1702ed184 100644 --- a/test/sim/misc/statusmoves.js +++ b/test/sim/misc/statusmoves.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('Most status moves', function () { - afterEach(function () { +describe('Most status moves', () => { + afterEach(() => { battle.destroy(); }); - it('should ignore natural type immunities', function () { + it('should ignore natural type immunities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'prankster', item: 'leftovers', moves: ['gastroacid', 'glare', 'confuseray', 'sandattack']}]}); - battle.setPlayer('p2', {team: [ - {species: "Klefki", ability: 'magician', happiness: 0, moves: ['return']}, - {species: "Dusknoir", ability: 'frisk', moves: ['shadowpunch']}, - {species: "Slaking", ability: 'truant', moves: ['shadowclaw']}, - {species: "Tornadus", ability: 'prankster', moves: ['tailwind']}, - {species: "Unown", ability: 'levitate', moves: ['hiddenpower']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'prankster', item: 'leftovers', moves: ['gastroacid', 'glare', 'confuseray', 'sandattack'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Klefki", ability: 'magician', happiness: 0, moves: ['return'] }, + { species: "Dusknoir", ability: 'frisk', moves: ['shadowpunch'] }, + { species: "Slaking", ability: 'truant', moves: ['shadowclaw'] }, + { species: "Tornadus", ability: 'prankster', moves: ['tailwind'] }, + { species: "Unown", ability: 'levitate', moves: ['hiddenpower'] }, + ] }); battle.makeChoices('move gastroacid', 'move return'); assert.false.holdsItem(battle.p2.active[0]); // Klefki's Magician suppressed by Gastro Acid. battle.makeChoices('move glare', 'switch 2'); // Dusknoir @@ -32,14 +32,14 @@ describe('Most status moves', function () { assert.statStage(battle.p2.active[0], 'accuracy', -1); }); - it(`should fail when the opposing Pokemon is immune to the status effect it sets`, function () { + it(`should fail when the opposing Pokemon is immune to the status effect it sets`, () => { battle = common.createBattle([[ - {species: 'Smeargle', ability: 'noguard', item: 'laggingtail', moves: ['thunderwave', 'willowisp', 'poisongas', 'toxic']}, + { species: 'Smeargle', ability: 'noguard', item: 'laggingtail', moves: ['thunderwave', 'willowisp', 'poisongas', 'toxic'] }, ], [ - {species: 'Zapdos', moves: ['charge']}, - {species: 'Emboar', moves: ['sleeptalk']}, - {species: 'Muk', moves: ['shadowsneak']}, - {species: 'Aron', moves: ['magnetrise']}, + { species: 'Zapdos', moves: ['charge'] }, + { species: 'Emboar', moves: ['sleeptalk'] }, + { species: 'Muk', moves: ['shadowsneak'] }, + { species: 'Aron', moves: ['magnetrise'] }, ]]); battle.makeChoices('move thunderwave', 'move charge'); @@ -68,17 +68,17 @@ describe('Most status moves', function () { }); }); -describe('Poison-inflicting status moves [Gen 2]', function () { +describe('Poison-inflicting status moves [Gen 2]', () => { const POISON_STATUS_MOVES = ['poisonpowder', 'poisongas', 'toxic']; - afterEach(function () { + afterEach(() => { battle.destroy(); }); - it('should not ignore type immunities', function () { + it('should not ignore type immunities', () => { battle = common.gen(2).createBattle([ - [{species: "Smeargle", moves: POISON_STATUS_MOVES}], - [{species: "Magneton", moves: ['sleeptalk']}], + [{ species: "Smeargle", moves: POISON_STATUS_MOVES }], + [{ species: "Magneton", moves: ['sleeptalk'] }], ]); // Set all moves to perfect accuracy battle.onEvent('Accuracy', battle.format, true); diff --git a/test/sim/misc/target-resolution.js b/test/sim/misc/target-resolution.js index 9898c2df41..c37b41bceb 100644 --- a/test/sim/misc/target-resolution.js +++ b/test/sim/misc/target-resolution.js @@ -5,33 +5,33 @@ const common = require('./../../common'); let battle; -describe('Target Resolution', function () { - afterEach(function () { +describe('Target Resolution', () => { + afterEach(() => { battle.destroy(); }); - describe(`Targetted Pokémon fainted in-turn`, function () { - it(`should redirect 'any' from a fainted foe to a targettable foe`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun']}, - {species: 'Metapod', ability: 'shedskin', moves: ['harden']}, + describe(`Targetted Pokémon fainted in-turn`, () => { + it(`should redirect 'any' from a fainted foe to a targettable foe`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun'] }, + { species: 'Metapod', ability: 'shedskin', moves: ['harden'] }, ], [ - {species: 'Chansey', ability: 'naturalcure', moves: ['curse']}, - {species: 'Latias', ability: 'levitate', moves: ['healingwish']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, + { species: 'Chansey', ability: 'naturalcure', moves: ['curse'] }, + { species: 'Latias', ability: 'levitate', moves: ['healingwish'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, ]]); const defender = battle.p2.active[0]; assert.hurts(defender, () => battle.makeChoices('move watergun 2, auto', 'auto')); }); - it(`should not redirect 'any' from a fainted ally to another Pokémon by default`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun']}, - {species: 'Latias', ability: 'levitate', moves: ['healingwish']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, + it(`should not redirect 'any' from a fainted ally to another Pokémon by default`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun'] }, + { species: 'Latias', ability: 'levitate', moves: ['healingwish'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, ], [ - {species: 'Chansey', ability: 'naturalcure', moves: ['curse']}, - {species: 'Metapod', ability: 'shedskin', moves: ['harden']}, + { species: 'Chansey', ability: 'naturalcure', moves: ['curse'] }, + { species: 'Metapod', ability: 'shedskin', moves: ['harden'] }, ]]); const activePokemonList = [battle.p1.active[0], ...battle.p2.active]; const prevHps = activePokemonList.map(pokemon => pokemon.hp); @@ -43,16 +43,16 @@ describe('Target Resolution', function () { assert(battle.log.includes('|-fail|p1a: Wailord')); }); - it(`should support RedirectTarget event for a fainted foe and type 'any' `, function () { - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['waterpulse']}, // Water Pulse over Water Gun due to targeting in triples - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, + it(`should support RedirectTarget event for a fainted foe and type 'any' `, () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['waterpulse'] }, // Water Pulse over Water Gun due to targeting in triples + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, ], [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['curse']}, - {species: 'Latias', ability: 'levitate', moves: ['healingwish']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['curse'] }, + { species: 'Latias', ability: 'levitate', moves: ['healingwish'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, ]]); let redirector = battle.p2.active[0]; battle.makeChoices('move waterpulse 2, auto', 'auto'); @@ -60,15 +60,15 @@ describe('Target Resolution', function () { // Do it again with swapped positions battle.destroy(); - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, ], [ - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, - {species: 'Latias', ability: 'levitate', moves: ['healingwish']}, - {species: 'Gastrodon', ability: 'stormdrain', moves: ['curse']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, + { species: 'Latias', ability: 'levitate', moves: ['healingwish'] }, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['curse'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, ]]); redirector = battle.p2.active[2]; battle.makeChoices('move watergun 2, auto', 'auto'); @@ -76,57 +76,57 @@ describe('Target Resolution', function () { // Test Storm Drain on the user's side battle.destroy(); - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Shuckle', moves: ['watergun']}, - {species: 'Gastrodon', ability: 'stormdrain', moves: ['swordsdance']}, - {species: 'Magikarp', moves: ['swordsdance']}, + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Shuckle', moves: ['watergun'] }, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['swordsdance'] }, + { species: 'Magikarp', moves: ['swordsdance'] }, ], [ - {species: 'Beartic', moves: ['swordsdance']}, - {species: 'Magikarp', moves: ['swordsdance']}, - {species: 'Victini', moves: ['finalgambit']}, + { species: 'Beartic', moves: ['swordsdance'] }, + { species: 'Magikarp', moves: ['swordsdance'] }, + { species: 'Victini', moves: ['finalgambit'] }, ]]); redirector = battle.p1.active[1]; battle.makeChoices('move watergun 3, auto', 'move swordsdance, move swordsdance, move finalgambit -2'); assert.statStage(redirector, 'spa', 1); }); - it(`should not redirect non-pulse/flying moves in Triples if the Pokemon is out of range`, function () { - battle = common.gen(6).createBattle({gameType: 'triples'}, [[ - {species: 'Shuckle', moves: ['watergun']}, - {species: 'Magikarp', moves: ['swordsdance']}, - {species: 'Magikarp', moves: ['swordsdance']}, + it(`should not redirect non-pulse/flying moves in Triples if the Pokemon is out of range`, () => { + battle = common.gen(6).createBattle({ gameType: 'triples' }, [[ + { species: 'Shuckle', moves: ['watergun'] }, + { species: 'Magikarp', moves: ['swordsdance'] }, + { species: 'Magikarp', moves: ['swordsdance'] }, ], [ - {species: 'Beartic', moves: ['swordsdance']}, - {species: 'Magikarp', moves: ['swordsdance']}, - {species: 'Victini', moves: ['finalgambit']}, + { species: 'Beartic', moves: ['swordsdance'] }, + { species: 'Magikarp', moves: ['swordsdance'] }, + { species: 'Victini', moves: ['finalgambit'] }, ]]); battle.makeChoices('move watergun 3, auto', 'move swordsdance, move swordsdance, move finalgambit -2'); assert.fullHP(battle.p2.active[0], `Beartic should not be damaged by a Water Gun because it is out of range`); }); - it(`should support RedirectTarget event for a fainted ally and type 'any'`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun']}, - {species: 'Latias', ability: 'levitate', moves: ['healingwish']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, + it(`should support RedirectTarget event for a fainted ally and type 'any'`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wailord', item: 'laggingtail', ability: 'pressure', moves: ['watergun'] }, + { species: 'Latias', ability: 'levitate', moves: ['healingwish'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, ], [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['curse']}, - {species: 'Metapod', ability: 'shedskin', moves: ['harden']}, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['curse'] }, + { species: 'Metapod', ability: 'shedskin', moves: ['harden'] }, ]]); const redirector = battle.p2.active[0]; battle.makeChoices('move watergun -2, auto', 'auto'); assert.statStage(redirector, 'spa', 1); }); - it(`should not redirect to another random target if the intended one is fainted in FFA`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'Calyrex', moves: ['sleeptalk']}, + it(`should not redirect to another random target if the intended one is fainted in FFA`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'Calyrex', moves: ['sleeptalk'] }, ], [ - {species: 'Victini', ability: 'Victory Star', moves: ['vcreate']}, + { species: 'Victini', ability: 'Victory Star', moves: ['vcreate'] }, ], [ - {species: 'Chansey', moves: ['sleeptalk']}, + { species: 'Chansey', moves: ['sleeptalk'] }, ], [ - {species: 'Tyrunt', moves: ['crunch']}, + { species: 'Tyrunt', moves: ['crunch'] }, ]]); battle.makeChoices('auto', 'move vcreate 1', 'auto', 'move crunch 1'); assert.fainted(battle.sides[0].active[0]); @@ -135,14 +135,14 @@ describe('Target Resolution', function () { }); }); - describe(`Targetted slot is empty`, function () { - it(`should redirect 'any' from a fainted foe to a targettable foe`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wailord', ability: 'pressure', moves: ['watergun']}, - {species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility']}, + describe(`Targetted slot is empty`, () => { + it(`should redirect 'any' from a fainted foe to a targettable foe`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wailord', ability: 'pressure', moves: ['watergun'] }, + { species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility'] }, ], [ - {species: 'Wailord', ability: 'pressure', moves: ['watergun']}, - {species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility']}, + { species: 'Wailord', ability: 'pressure', moves: ['watergun'] }, + { species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility'] }, ]]); const attackers = battle.sides.map(side => side.active[0]); @@ -159,13 +159,13 @@ describe('Target Resolution', function () { ); }); - it(`should not redirect 'any' from a fainted ally to another Pokémon by default`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wailord', ability: 'pressure', moves: ['watergun']}, - {species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility']}, + it(`should not redirect 'any' from a fainted ally to another Pokémon by default`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wailord', ability: 'pressure', moves: ['watergun'] }, + { species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility'] }, ], [ - {species: 'Wailord', ability: 'pressure', moves: ['watergun']}, - {species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility']}, + { species: 'Wailord', ability: 'pressure', moves: ['watergun'] }, + { species: 'Shedinja', item: 'flameorb', ability: 'wonderguard', moves: ['agility'] }, ]]); const attackers = battle.sides.map(side => side.active[0]); @@ -187,13 +187,13 @@ describe('Target Resolution', function () { assert(battle.log.includes('|-fail|p2a: Wailord')); }); - it(`should support RedirectTarget event for a fainted foe and type 'any'`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Hippowdon', ability: 'sandstream', moves: ['waterpulse']}, - {species: 'Shedinja', ability: 'wonderguard', moves: ['agility']}, + it(`should support RedirectTarget event for a fainted foe and type 'any'`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Hippowdon', ability: 'sandstream', moves: ['waterpulse'] }, + { species: 'Shedinja', ability: 'wonderguard', moves: ['agility'] }, ], [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['curse']}, - {species: 'Shedinja', ability: 'wonderguard', moves: ['agility']}, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['curse'] }, + { species: 'Shedinja', ability: 'wonderguard', moves: ['agility'] }, ]]); const redirector = battle.p2.active[0]; @@ -202,13 +202,13 @@ describe('Target Resolution', function () { assert.statStage(redirector, 'spa', 2); }); - it(`should support RedirectTarget event for a fainted ally and type 'any'`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Hippowdon', ability: 'sandstream', moves: ['waterpulse']}, - {species: 'Shedinja', ability: 'wonderguard', moves: ['agility']}, + it(`should support RedirectTarget event for a fainted ally and type 'any'`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Hippowdon', ability: 'sandstream', moves: ['waterpulse'] }, + { species: 'Shedinja', ability: 'wonderguard', moves: ['agility'] }, ], [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['curse']}, - {species: 'Shedinja', ability: 'wonderguard', moves: ['agility']}, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['curse'] }, + { species: 'Shedinja', ability: 'wonderguard', moves: ['agility'] }, ]]); const redirector = battle.p2.active[0]; @@ -218,14 +218,14 @@ describe('Target Resolution', function () { }); }); - describe(`Smart-tracking targeting effects`, function () { - it(`should allow Stalwart to follow its target after an opposing Ally Switch`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Duraludon', ability: 'stalwart', moves: ['watergun']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + describe(`Smart-tracking targeting effects`, () => { + it(`should allow Stalwart to follow its target after an opposing Ally Switch`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Duraludon', ability: 'stalwart', moves: ['watergun'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Gastrodon', moves: ['sleeptalk']}, - {species: 'Ninjask', moves: ['allyswitch']}, + { species: 'Gastrodon', moves: ['sleeptalk'] }, + { species: 'Ninjask', moves: ['allyswitch'] }, ]]); const ninjask = battle.p2.active[1]; @@ -233,13 +233,13 @@ describe('Target Resolution', function () { assert.false.fullHP(ninjask, `Duraludon should have followed Ninjask's Ally Switch.`); }); - it(`should allow Stalwart to bypass Storm Drain redirection`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Duraludon', ability: 'stalwart', moves: ['watergun']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should allow Stalwart to bypass Storm Drain redirection`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Duraludon', ability: 'stalwart', moves: ['watergun'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk']}, - {species: 'Ninjask', moves: ['sleeptalk']}, + { species: 'Gastrodon', ability: 'stormdrain', moves: ['sleeptalk'] }, + { species: 'Ninjask', moves: ['sleeptalk'] }, ]]); const ninjask = battle.p2.active[1]; @@ -247,13 +247,13 @@ describe('Target Resolution', function () { assert.false.fullHP(ninjask, `Duraludon should have ignored Gastrodon's Storm Drain.`); }); - it(`should allow Stalwart to bypass Follow Me redirection`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Duraludon', ability: 'stalwart', moves: ['watergun']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should allow Stalwart to bypass Follow Me redirection`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Duraludon', ability: 'stalwart', moves: ['watergun'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Clefable', moves: ['followme']}, - {species: 'Ninjask', moves: ['sleeptalk']}, + { species: 'Clefable', moves: ['followme'] }, + { species: 'Ninjask', moves: ['sleeptalk'] }, ]]); const ninjask = battle.p2.active[1]; @@ -261,14 +261,14 @@ describe('Target Resolution', function () { assert.false.fullHP(ninjask, `Duraludon should have ignored Clefable's Follow Me.`); }); - it(`should allow Stalwart to correctly target a Pokemon which switched out and back in another slot`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Duraludon', ability: 'stalwart', moves: ['watergun']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should allow Stalwart to correctly target a Pokemon which switched out and back in another slot`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Duraludon', ability: 'stalwart', moves: ['watergun'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Ninjask', moves: ['uturn']}, - {species: 'Regieleki', moves: ['uturn']}, - {species: 'Octillery', moves: ['sleeptalk']}, + { species: 'Ninjask', moves: ['uturn'] }, + { species: 'Regieleki', moves: ['uturn'] }, + { species: 'Octillery', moves: ['sleeptalk'] }, ]]); const regieleki = battle.p2.active[1]; @@ -278,13 +278,13 @@ describe('Target Resolution', function () { assert.false.fullHP(regieleki, `Duraludon should have followed Regieleki through its switch-out.`); }); - it(`should allow Snipe Shot to follow its target after an opposing Ally Switch`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Inteleon', moves: ['snipeshot']}, - {species: 'Ninjask', moves: ['sleeptalk']}, + it(`should allow Snipe Shot to follow its target after an opposing Ally Switch`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Inteleon', moves: ['snipeshot'] }, + { species: 'Ninjask', moves: ['sleeptalk'] }, ], [ - {species: 'Gastrodon', moves: ['sleeptalk']}, - {species: 'Ninjask', moves: ['allyswitch']}, + { species: 'Gastrodon', moves: ['sleeptalk'] }, + { species: 'Ninjask', moves: ['allyswitch'] }, ]]); const ninjask = battle.p2.active[1]; @@ -293,13 +293,13 @@ describe('Target Resolution', function () { }); }); - it('should not force charge moves called by another move to target an ally after Ally Switch', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'purrloin', ability: 'no guard', moves: ['copycat', 'sleeptalk']}, - {species: 'wynaut', moves: ['allyswitch', 'fly', 'skullbash']}, + it('should not force charge moves called by another move to target an ally after Ally Switch', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'purrloin', ability: 'no guard', moves: ['copycat', 'sleeptalk'] }, + { species: 'wynaut', moves: ['allyswitch', 'fly', 'skullbash'] }, ], [ - {species: 'aron', moves: ['sleeptalk']}, - {species: 'lairon', moves: ['sleeptalk']}, + { species: 'aron', moves: ['sleeptalk'] }, + { species: 'lairon', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk, move fly 1', 'auto'); @@ -312,13 +312,13 @@ describe('Target Resolution', function () { assert.fullHP(battle.p1.active[1]); }); - it(`Ally Switch should cause single-target moves to fail if targeting an ally`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'purrloin', moves: ['thunder', 'ironhead']}, - {species: 'wynaut', moves: ['allyswitch']}, + it(`Ally Switch should cause single-target moves to fail if targeting an ally`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'purrloin', moves: ['thunder', 'ironhead'] }, + { species: 'wynaut', moves: ['allyswitch'] }, ], [ - {species: 'swablu', moves: ['sleeptalk']}, - {species: 'swablu', moves: ['sleeptalk']}, + { species: 'swablu', moves: ['sleeptalk'] }, + { species: 'swablu', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move ironhead -2, move allyswitch', 'auto'); @@ -326,14 +326,14 @@ describe('Target Resolution', function () { assert.fullHP(battle.p1.active[0]); }); - it(`charge moves like Phantom Force should target slots turn 1 and Pokemon turn 2`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'houndour', level: 1, moves: ['sleeptalk']}, - {species: 'altaria', moves: ['sleeptalk']}, - {species: 'aggron', moves: ['sleeptalk']}, + it(`charge moves like Phantom Force should target slots turn 1 and Pokemon turn 2`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'houndour', level: 1, moves: ['sleeptalk'] }, + { species: 'altaria', moves: ['sleeptalk'] }, + { species: 'aggron', moves: ['sleeptalk'] }, ], [ - {species: 'dragapult', moves: ['phantomforce']}, - {species: 'regieleki', moves: ['sleeptalk', 'sheercold']}, + { species: 'dragapult', moves: ['phantomforce'] }, + { species: 'regieleki', moves: ['sleeptalk', 'sheercold'] }, ]]); // Phantom Force should still target slot 1, despite Houndour fainting @@ -343,13 +343,13 @@ describe('Target Resolution', function () { assert.fullHP(battle.p1.active[1], 'Altaria should be at full HP, because it was not targeted.'); assert.false.fullHP(battle.p1.active[0], 'Aggron should not be at full HP, because it was targeted.'); - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'houndour', level: 1, moves: ['sleeptalk']}, - {species: 'altaria', moves: ['sleeptalk']}, - {species: 'aggron', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'houndour', level: 1, moves: ['sleeptalk'] }, + { species: 'altaria', moves: ['sleeptalk'] }, + { species: 'aggron', moves: ['sleeptalk'] }, ], [ - {species: 'dragapult', moves: ['phantomforce']}, - {species: 'regieleki', moves: ['sleeptalk', 'sheercold']}, + { species: 'dragapult', moves: ['phantomforce'] }, + { species: 'regieleki', moves: ['sleeptalk', 'sheercold'] }, ]]); battle.makeChoices('auto', 'move phantomforce 1, move sleeptalk'); @@ -357,14 +357,14 @@ describe('Target Resolution', function () { assert.false.fullHP(battle.p1.active[1], 'Altaria should not be at full HP, because Phantom Force was redirected and targeted it.'); }); - it(`should cause Rollout to target the same slot after being called as a submove`, function () { + it(`should cause Rollout to target the same slot after being called as a submove`, () => { // hardcoded RNG seed to show the erroneous targeting behavior - battle = common.createBattle({gameType: 'doubles', seed: [1, 2, 3, 4]}, [[ - {species: 'shuckle', ability: 'compoundeyes', moves: ['copycat']}, - {species: 'foongus', item: 'laggingtail', moves: ['spore']}, + battle = common.createBattle({ gameType: 'doubles', seed: [1, 2, 3, 4] }, [[ + { species: 'shuckle', ability: 'compoundeyes', moves: ['copycat'] }, + { species: 'foongus', item: 'laggingtail', moves: ['spore'] }, ], [ - {species: 'aggron', moves: ['splash']}, - {species: 'slowbro', moves: ['splash', 'rollout']}, + { species: 'aggron', moves: ['splash'] }, + { species: 'slowbro', moves: ['splash', 'rollout'] }, ]]); battle.makeChoices('move copycat, move spore 2', 'move splash, move rollout 1'); diff --git a/test/sim/misc/teampreview.js b/test/sim/misc/teampreview.js index ff567565ac..78aeef17e5 100644 --- a/test/sim/misc/teampreview.js +++ b/test/sim/misc/teampreview.js @@ -5,20 +5,20 @@ const common = require('../../common'); let battle; -describe('Team Preview', function () { - afterEach(function () { +describe('Team Preview', () => { + afterEach(() => { battle.destroy(); }); - it('should hide formes of certain Pokemon', function () { + it('should hide formes of certain Pokemon', () => { battle = common.createBattle([[ - {species: 'Pumpkaboo-Super', ability: 'pickup', moves: ['sleeptalk']}, - {species: 'Gourgeist-Small', ability: 'pickup', moves: ['sleeptalk']}, - {species: 'Dudunsparce-Three-Segment', ability: 'runaway', moves: ['sleeptalk']}, + { species: 'Pumpkaboo-Super', ability: 'pickup', moves: ['sleeptalk'] }, + { species: 'Gourgeist-Small', ability: 'pickup', moves: ['sleeptalk'] }, + { species: 'Dudunsparce-Three-Segment', ability: 'runaway', moves: ['sleeptalk'] }, ], [ - {species: 'Silvally', ability: 'rkssystem', moves: ['sleeptalk']}, - {species: 'Urshifu-Rapid-Strike', ability: 'unseenfist', moves: ['sleeptalk']}, - {species: 'Zacian', ability: 'intrepidsword', item: 'rustedsword', moves: ['sleeptalk']}, + { species: 'Silvally', ability: 'rkssystem', moves: ['sleeptalk'] }, + { species: 'Urshifu-Rapid-Strike', ability: 'unseenfist', moves: ['sleeptalk'] }, + { species: 'Zacian', ability: 'intrepidsword', item: 'rustedsword', moves: ['sleeptalk'] }, ]]); for (const line of battle.log) { if (line.startsWith('|poke|')) { @@ -28,11 +28,11 @@ describe('Team Preview', function () { } }); - it('should hide Arceus formes [Gen 8]', function () { - battle = common.createBattle({formatid: 'gen8anythinggoes'}, [[ - {species: 'Arceus-Steel', ability: 'multitype', item: 'steelplate', moves: ['sleeptalk']}, + it('should hide Arceus formes [Gen 8]', () => { + battle = common.createBattle({ formatid: 'gen8anythinggoes' }, [[ + { species: 'Arceus-Steel', ability: 'multitype', item: 'steelplate', moves: ['sleeptalk'] }, ], [ - {species: 'Arceus-Fire', ability: 'multitype', item: 'flameplate', moves: ['sleeptalk']}, + { species: 'Arceus-Fire', ability: 'multitype', item: 'flameplate', moves: ['sleeptalk'] }, ]]); for (const line of battle.log) { if (line.startsWith('|poke|')) { @@ -42,11 +42,11 @@ describe('Team Preview', function () { } }); - it('should not hide formes of hacked Zacian/Zamazenta formes', function () { + it('should not hide formes of hacked Zacian/Zamazenta formes', () => { battle = common.createBattle([[ - {species: 'Zacian-Crowned', moves: ['sleeptalk']}, + { species: 'Zacian-Crowned', moves: ['sleeptalk'] }, ], [ - {species: 'Zamazenta-Crowned', moves: ['sleeptalk']}, + { species: 'Zamazenta-Crowned', moves: ['sleeptalk'] }, ]]); for (const line of battle.log) { if (line.startsWith('|poke|')) { diff --git a/test/sim/misc/terapagos.js b/test/sim/misc/terapagos.js index 6e6274c666..d7be7485f3 100644 --- a/test/sim/misc/terapagos.js +++ b/test/sim/misc/terapagos.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe(`Terapagos`, function () { - afterEach(function () { +describe(`Terapagos`, () => { + afterEach(() => { battle.destroy(); }); - it.skip(`should accept the Terastallization choice, but not Terastallize while Transformed into Terapagos-Terastal`, function () { + it.skip(`should accept the Terastallization choice, but not Terastallize while Transformed into Terapagos-Terastal`, () => { battle = common.gen(9).createBattle([[ - {species: 'ditto', ability: 'imposter', moves: ['sleeptalk']}, + { species: 'ditto', ability: 'imposter', moves: ['sleeptalk'] }, ], [ - {species: 'terapagos', ability: 'terashift', moves: ['sleeptalk'], teraType: 'Stellar'}, + { species: 'terapagos', ability: 'terashift', moves: ['sleeptalk'], teraType: 'Stellar' }, ]]); // Currently throws a choice error @@ -24,12 +24,12 @@ describe(`Terapagos`, function () { assert.false(!!ditto.terastallized); }); - it(`[Hackmons] should not cause Terapagos-Terastal to become Terapagos-Stellar if the user is Transformed`, function () { + it(`[Hackmons] should not cause Terapagos-Terastal to become Terapagos-Stellar if the user is Transformed`, () => { battle = common.gen(9).createBattle([[ - {species: 'terapagos', ability: 'terashift', moves: ['transform'], teraType: 'Stellar'}, - {species: 'pikachu', moves: ['sleeptalk']}, + { species: 'terapagos', ability: 'terashift', moves: ['transform'], teraType: 'Stellar' }, + { species: 'pikachu', moves: ['sleeptalk'] }, ], [ - {species: 'silicobra', moves: ['sleeptalk']}, + { species: 'silicobra', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/misc/terastal.js b/test/sim/misc/terastal.js index 34c17bf1fa..aeb1a2ff0d 100644 --- a/test/sim/misc/terastal.js +++ b/test/sim/misc/terastal.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe("Terastallization", function () { - afterEach(function () { +describe("Terastallization", () => { + afterEach(() => { battle.destroy(); }); - it('should change the user\'s type to its Tera type after terastallizing', function () { + it('should change the user\'s type to its Tera type after terastallizing', () => { battle = common.gen(9).createBattle([[ - {species: 'Ampharos', ability: 'static', moves: ['voltswitch', 'dragonpulse'], teraType: 'Dragon'}, + { species: 'Ampharos', ability: 'static', moves: ['voltswitch', 'dragonpulse'], teraType: 'Dragon' }, ], [ - {species: 'Ampharos', ability: 'static', moves: ['voltswitch'], teraType: 'Dragon'}, + { species: 'Ampharos', ability: 'static', moves: ['voltswitch'], teraType: 'Dragon' }, ]]); battle.makeChoices('move dragonpulse terastallize', 'auto'); assert.equal(battle.p1.active[0].getTypes().join('/'), 'Dragon'); }); - it('should persist the user\'s changed type after switching', function () { + it('should persist the user\'s changed type after switching', () => { battle = common.gen(9).createBattle([[ - {species: 'Ampharos', ability: 'static', moves: ['voltswitch', 'dragonpulse'], teraType: 'Dragon'}, - {species: 'Flaaffy', ability: 'static', moves: ['voltswitch', 'dragonpulse'], teraType: 'Electric'}, + { species: 'Ampharos', ability: 'static', moves: ['voltswitch', 'dragonpulse'], teraType: 'Dragon' }, + { species: 'Flaaffy', ability: 'static', moves: ['voltswitch', 'dragonpulse'], teraType: 'Electric' }, ], [ - {species: 'Ampharos', ability: 'static', moves: ['voltswitch'], teraType: 'Dragon'}, + { species: 'Ampharos', ability: 'static', moves: ['voltswitch'], teraType: 'Dragon' }, ]]); battle.makeChoices('move dragonpulse terastallize', 'move voltswitch'); assert.equal(battle.p1.active[0].getTypes().join('/'), 'Dragon'); @@ -33,11 +33,11 @@ describe("Terastallization", function () { assert.equal(battle.p1.pokemon[1].getTypes().join('/'), 'Dragon'); }); - it('should give STAB correctly to the user\'s old types', function () { + it('should give STAB correctly to the user\'s old types', () => { battle = common.gen(9).createBattle([[ - {species: 'Ampharos', ability: 'shellarmor', moves: ['shockwave', 'swift'], teraType: 'Electric'}, + { species: 'Ampharos', ability: 'shellarmor', moves: ['shockwave', 'swift'], teraType: 'Electric' }, ], [ - {species: 'Ampharos', ability: 'shellarmor', moves: ['shockwave', 'swift'], teraType: 'Normal'}, + { species: 'Ampharos', ability: 'shellarmor', moves: ['shockwave', 'swift'], teraType: 'Normal' }, ]]); battle.makeChoices('move shockwave terastallize', 'move shockwave terastallize'); const teraDamage = battle.p2.active[0].maxhp - battle.p2.active[0].hp; @@ -50,9 +50,9 @@ describe("Terastallization", function () { "Terastallizing did not keep old type's STAB; actual damage: " + nonTeraDamage); battle = common.gen(9).createBattle([[ - {species: 'Mimikyu', ability: 'disguise', item: 'laggingtail', moves: ['shadowclaw', 'waterfall', 'sleeptalk'], teraType: 'Water'}, + { species: 'Mimikyu', ability: 'disguise', item: 'laggingtail', moves: ['shadowclaw', 'waterfall', 'sleeptalk'], teraType: 'Water' }, ], [ - {species: 'Alomomola', ability: 'battlearmor', moves: ['soak'], teraType: 'Normal'}, + { species: 'Alomomola', ability: 'battlearmor', moves: ['soak'], teraType: 'Normal' }, ]]); // Mimikyu is made water type before terastallizing battle.makeChoices('move sleeptalk', 'auto'); @@ -72,11 +72,11 @@ describe("Terastallization", function () { "Terastallizing did not keep old changed type's STAB; actual damage: " + damage); }); - it('should give STAB correctly to the user\'s underlying types after changing forme', function () { + it('should give STAB correctly to the user\'s underlying types after changing forme', () => { battle = common.gen(9).createBattle([[ - {species: 'Mimikyu', ability: 'disguise', item: 'laggingtail', moves: ['shadowclaw', 'waterfall', 'sleeptalk'], teraType: 'Water'}, + { species: 'Mimikyu', ability: 'disguise', item: 'laggingtail', moves: ['shadowclaw', 'waterfall', 'sleeptalk'], teraType: 'Water' }, ], [ - {species: 'Alomomola', ability: 'battlearmor', moves: ['watergun', 'soak'], teraType: 'Normal'}, + { species: 'Alomomola', ability: 'battlearmor', moves: ['watergun', 'soak'], teraType: 'Normal' }, ]]); // Mimikyu is made water type before terastallizing battle.makeChoices('move sleeptalk', 'move soak'); @@ -97,12 +97,12 @@ describe("Terastallization", function () { "Terastallizing did not keep old changed type's STAB; actual damage: " + damage); }); - describe('Buffing low BP move behavior', function () { - it(`should boost the base power of weaker moves with the same Tera Type to 60 BP`, function () { + describe('Buffing low BP move behavior', () => { + it(`should boost the base power of weaker moves with the same Tera Type to 60 BP`, () => { battle = common.gen(9).createBattle([[ - {species: 'magnemite', moves: ['nuzzle']}, + { species: 'magnemite', moves: ['nuzzle'] }, ], [ - {species: 'mew', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'mew', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move nuzzle terastallize', 'auto'); @@ -111,11 +111,11 @@ describe("Terastallization", function () { assert.bounded(mew.maxhp - mew.hp, damageRange, `Should be a 60 BP Nuzzle`); }); - it(`should only boost base power 60 BP after all other base power modifiers are applied`, function () { + it(`should only boost base power 60 BP after all other base power modifiers are applied`, () => { battle = common.gen(9).createBattle([[ - {species: 'cufant', ability: 'technician', moves: ['bulletpunch']}, + { species: 'cufant', ability: 'technician', moves: ['bulletpunch'] }, ], [ - {species: 'mew', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'mew', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move bulletpunch terastallize', 'auto'); @@ -124,11 +124,11 @@ describe("Terastallization", function () { assert.bounded(mew.maxhp - mew.hp, damageRange, `Should be a 60 BP Bullet Punch`); }); - it(`should not boost the base power of moves with variable base power under 60 BP`, function () { + it(`should not boost the base power of moves with variable base power under 60 BP`, () => { battle = common.gen(9).createBattle([[ - {species: 'wiglett', ivs: {hp: 0}, moves: ['waterspout']}, + { species: 'wiglett', ivs: { hp: 0 }, moves: ['waterspout'] }, ], [ - {species: 'mew', ability: 'shellarmor', moves: ['seismictoss']}, + { species: 'mew', ability: 'shellarmor', moves: ['seismictoss'] }, ]]); battle.makeChoices('move waterspout terastallize', 'auto'); @@ -137,11 +137,11 @@ describe("Terastallization", function () { assert.bounded(mew.maxhp - mew.hp, damageRange, `Should be a 34 BP Water Spout`); }); - it(`should boost STAB moves that weren't STAB moves prior to terastallizing`, function () { + it(`should boost STAB moves that weren't STAB moves prior to terastallizing`, () => { battle = common.gen(9).createBattle([[ - {species: 'espathra', evs: {atk: 252}, moves: ['peck', 'aerialace'], teraType: 'Flying'}, + { species: 'espathra', evs: { atk: 252 }, moves: ['peck', 'aerialace'], teraType: 'Flying' }, ], [ - {species: 'arceus', ability: 'shellarmor', moves: ['haze']}, + { species: 'arceus', ability: 'shellarmor', moves: ['haze'] }, ]]); battle.makeChoices('move peck', 'auto'); @@ -152,11 +152,11 @@ describe("Terastallization", function () { assert.bounded(arceus.maxhp - arceus.hp, [51, 61], `Should be a 60 BP STAB Peck`); }); - it(`shouldn't boost non-STAB moves with <60 Base Power`, function () { + it(`shouldn't boost non-STAB moves with <60 Base Power`, () => { battle = common.gen(9).createBattle([[ - {species: 'palafinhero', moves: ['leafage'], teraType: 'Electric'}, + { species: 'palafinhero', moves: ['leafage'], teraType: 'Electric' }, ], [ - {species: 'arceus', ability: 'shellarmor', moves: ['haze']}, + { species: 'arceus', ability: 'shellarmor', moves: ['haze'] }, ]]); battle.makeChoices('move leafage', 'auto'); @@ -167,11 +167,11 @@ describe("Terastallization", function () { assert.bounded(arceus.maxhp - arceus.hp, [38, 45], `Should be a 40 BP no-STAB Leafage`); }); - it(`shouldn't boost <60 Base Power priority moves forced via Encore`, function () { + it(`shouldn't boost <60 Base Power priority moves forced via Encore`, () => { battle = common.gen(9).createBattle([[ - {species: 'hariyama', moves: ['bulletpunch', 'sleeptalk'], teraType: 'Steel'}, + { species: 'hariyama', moves: ['bulletpunch', 'sleeptalk'], teraType: 'Steel' }, ], [ - {species: 'salazzle ', moves: ['encore', 'sleeptalk']}, + { species: 'salazzle ', moves: ['encore', 'sleeptalk'] }, ]]); battle.makeChoices('move bulletpunch terastallize', 'move sleeptalk'); @@ -185,9 +185,9 @@ describe("Terastallization", function () { it("should combine with Adaptability for an overall STAB of x2.25", () => { battle = common.gen(9).createBattle([[ - {species: "Dragalge", ability: 'adaptability', moves: ['venoshock'], teraType: "Poison"}, + { species: "Dragalge", ability: 'adaptability', moves: ['venoshock'], teraType: "Poison" }, ], [ - {species: "Mareep", ability: 'static', moves: ['sleeptalk']}, + { species: "Mareep", ability: 'static', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move venoshock terastallize', 'auto'); const damage = battle.p2.active[0].maxhp - battle.p2.active[0].hp; @@ -196,20 +196,20 @@ describe("Terastallization", function () { it("should not give the Adaptability boost on the user's old types", () => { battle = common.gen(9).createBattle([[ - {species: "Dragalge", ability: 'adaptability', moves: ['venoshock'], teraType: "Dragon"}, + { species: "Dragalge", ability: 'adaptability', moves: ['venoshock'], teraType: "Dragon" }, ], [ - {species: "Mareep", ability: 'static', moves: ['sleeptalk']}, + { species: "Mareep", ability: 'static', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move venoshock terastallize', 'auto'); const damage = battle.p2.active[0].maxhp - battle.p2.active[0].hp; assert.bounded(damage, [127, 151], "Actual damage: " + damage); }); - it(`should allow hacked Megas to Terastallize in Hackmons play`, function () { - battle = common.gen(9).createBattle({formatid: 'gen9purehackmons@@@!teampreview'}, [[ - {species: 'Mewtwo-Mega-X', moves: ['sleeptalk'], teraType: 'Fairy'}, + it(`should allow hacked Megas to Terastallize in Hackmons play`, () => { + battle = common.gen(9).createBattle({ formatid: 'gen9purehackmons@@@!teampreview' }, [[ + { species: 'Mewtwo-Mega-X', moves: ['sleeptalk'], teraType: 'Fairy' }, ], [ - {species: 'Necrozma-Ultra', moves: ['sleeptalk'], teraType: 'Normal'}, + { species: 'Necrozma-Ultra', moves: ['sleeptalk'], teraType: 'Normal' }, ]]); const mewtwo = battle.p1.active[0]; diff --git a/test/sim/misc/terastellar.js b/test/sim/misc/terastellar.js index c998563100..ee210d6fa9 100644 --- a/test/sim/misc/terastellar.js +++ b/test/sim/misc/terastellar.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe("Tera Stellar", function () { - afterEach(function () { +describe("Tera Stellar", () => { + afterEach(() => { battle.destroy(); }); - it(`should increase the damage of non-STAB moves by 1.2x on the first use of that move type`, function () { + it(`should increase the damage of non-STAB moves by 1.2x on the first use of that move type`, () => { battle = common.gen(9).createBattle([[ - {species: 'Wynaut', ability: 'noguard', moves: ['surf', 'hydropump', 'extrasensory', 'hyperspacehole'], teraType: 'Stellar'}, + { species: 'Wynaut', ability: 'noguard', moves: ['surf', 'hydropump', 'extrasensory', 'hyperspacehole'], teraType: 'Stellar' }, ], [ - {species: 'Happiny', ability: 'shellarmor', moves: ['softboiled']}, + { species: 'Happiny', ability: 'shellarmor', moves: ['softboiled'] }, ]]); const happiny = battle.p2.active[0]; @@ -44,11 +44,11 @@ describe("Tera Stellar", function () { assert.bounded(damage, [43, 52], `Hyperspace Hole should have 1.5x damage on its first use, because Psychic-type was already used`); }); - it(`should not have the once-per-type restriction when used by Terapagos`, function () { + it(`should not have the once-per-type restriction when used by Terapagos`, () => { battle = common.gen(9).createBattle([[ - {species: 'Terapagos', ability: 'terashift', moves: ['surf', 'hypervoice'], item: 'laggingtail', teraType: 'Stellar'}, + { species: 'Terapagos', ability: 'terashift', moves: ['surf', 'hypervoice'], item: 'laggingtail', teraType: 'Stellar' }, ], [ - {species: 'Chansey', ability: 'shellarmor', moves: ['softboiled']}, + { species: 'Chansey', ability: 'shellarmor', moves: ['softboiled'] }, ]]); const chansey = battle.p2.active[0]; @@ -70,11 +70,11 @@ describe("Tera Stellar", function () { assert.bounded(damage, [156, 184], `Hyper Voice should have 2x damage on its second use`); }); - it(`should not modify the Pokemon's base type for defensive purposes`, function () { + it(`should not modify the Pokemon's base type for defensive purposes`, () => { battle = common.gen(9).createBattle([[ - {species: 'Krookodile', moves: ['sleeptalk'], teraType: 'Stellar'}, + { species: 'Krookodile', moves: ['sleeptalk'], teraType: 'Stellar' }, ], [ - {species: 'Tornadus', ability: 'prankster', moves: ['psychic', 'thunderwave', 'leer']}, + { species: 'Tornadus', ability: 'prankster', moves: ['psychic', 'thunderwave', 'leer'] }, ]]); const krookodile = battle.p1.active[0]; @@ -91,11 +91,11 @@ describe("Tera Stellar", function () { assert.statStage(krookodile, 'def', 0); }); - it(`should only be super-effective against opposing Terastallized targets`, function () { + it(`should only be super-effective against opposing Terastallized targets`, () => { battle = common.gen(9).createBattle([[ - {species: 'Krookodile', moves: ['terablast'], teraType: 'Stellar'}, + { species: 'Krookodile', moves: ['terablast'], teraType: 'Stellar' }, ], [ - {species: 'Steelix', item: 'weaknesspolicy', moves: ['sleeptalk'], teraType: 'Stellar'}, + { species: 'Steelix', item: 'weaknesspolicy', moves: ['sleeptalk'], teraType: 'Stellar' }, ]]); const steelix = battle.p2.active[0]; @@ -103,11 +103,11 @@ describe("Tera Stellar", function () { assert.statStage(steelix, 'atk', 2); }); - it(`should increase the user's stats with Tera Blast if the user has Contrary`, function () { + it(`should increase the user's stats with Tera Blast if the user has Contrary`, () => { battle = common.gen(9).createBattle([[ - {species: 'inkay', ability: 'contrary', moves: ['terablast'], teraType: 'Stellar'}, + { species: 'inkay', ability: 'contrary', moves: ['terablast'], teraType: 'Stellar' }, ], [ - {species: 'chansey', moves: ['sleeptalk']}, + { species: 'chansey', moves: ['sleeptalk'] }, ]]); const inkay = battle.p1.active[0]; @@ -117,11 +117,11 @@ describe("Tera Stellar", function () { assert.statStage(inkay, 'spa', 1); }); - it(`should not work with Adapatability`, function () { + it(`should not work with Adapatability`, () => { battle = common.gen(9).createBattle([[ - {species: 'Wynaut', ability: 'adaptability', moves: ['hyperspacehole', 'terablast'], teraType: 'Stellar'}, + { species: 'Wynaut', ability: 'adaptability', moves: ['hyperspacehole', 'terablast'], teraType: 'Stellar' }, ], [ - {species: 'Happiny', ability: 'shellarmor', moves: ['softboiled']}, + { species: 'Happiny', ability: 'shellarmor', moves: ['softboiled'] }, ]]); const happiny = battle.p2.active[0]; @@ -143,11 +143,11 @@ describe("Tera Stellar", function () { assert.bounded(damage, [24, 29], `Tera Blast should not have any boosted damage on its second use`); }); - it(`should increase the damage of all hits of a multi-hit move`, function () { + it(`should increase the damage of all hits of a multi-hit move`, () => { battle = common.gen(9).createBattle([[ - {species: 'Wynaut', moves: ['surgingstrikes', 'flipturn'], teraType: 'Stellar'}, + { species: 'Wynaut', moves: ['surgingstrikes', 'flipturn'], teraType: 'Stellar' }, ], [ - {species: 'Blissey', moves: ['softboiled']}, + { species: 'Blissey', moves: ['softboiled'] }, ]]); const blissey = battle.p2.active[0]; diff --git a/test/sim/misc/trapmoves.js b/test/sim/misc/trapmoves.js index 6e0a98e1d9..6307b3b9f6 100644 --- a/test/sim/misc/trapmoves.js +++ b/test/sim/misc/trapmoves.js @@ -7,75 +7,75 @@ let battle; const trappers = ['Block', 'Mean Look', 'Spider Web', 'Thousand Waves', 'Anchor Shot', 'Spirit Shackle']; const partialtrappers = ['Bind', 'Clamp', 'Fire Spin', 'Infestation', 'Magma Storm', 'Sand Tomb', 'Whirlpool', 'Wrap']; -describe('Trapping Moves', function () { - afterEach(function () { +describe('Trapping Moves', () => { + afterEach(() => { battle.destroy(); }); for (const move of trappers) { - it('should prevent Pokemon from switching out normally', function () { + it('should prevent Pokemon from switching out normally', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'prankster', moves: [toID(move)]}]}); - battle.setPlayer('p2', {team: [ - {species: "Tangrowth", ability: 'leafguard', moves: ['swordsdance']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'prankster', moves: [toID(move)] }] }); + battle.setPlayer('p2', { team: [ + { species: "Tangrowth", ability: 'leafguard', moves: ['swordsdance'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move swordsdance'); assert.trapped(() => battle.makeChoices('move ' + toID(move), 'switch 2')); assert.equal(battle.p2.active[0].species.id, 'tangrowth'); }); - it('should not prevent Pokemon from switching out using moves', function () { + it('should not prevent Pokemon from switching out using moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'prankster', moves: [toID(move)]}]}); - battle.setPlayer('p2', {team: [ - {species: "Tangrowth", ability: 'leafguard', moves: ['batonpass']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'prankster', moves: [toID(move)] }] }); + battle.setPlayer('p2', { team: [ + { species: "Tangrowth", ability: 'leafguard', moves: ['batonpass'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move batonpass'); battle.makeChoices('', 'switch 2'); assert.equal(battle.p2.active[0].species.id, 'starmie'); }); - it('should not prevent Pokemon immune to trapping from switching out', function () { + it('should not prevent Pokemon immune to trapping from switching out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'prankster', moves: [toID(move)]}]}); - battle.setPlayer('p2', {team: [ - {species: "Gourgeist", ability: 'insomnia', moves: ['synthesis']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'prankster', moves: [toID(move)] }] }); + battle.setPlayer('p2', { team: [ + { species: "Gourgeist", ability: 'insomnia', moves: ['synthesis'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move synthesis'); battle.makeChoices('move ' + toID(move), 'switch 2'); assert.equal(battle.p2.active[0].species.id, 'starmie'); }); - it('should stop trapping the Pokemon if the user is no longer active', function () { + it('should stop trapping the Pokemon if the user is no longer active', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Smeargle", ability: 'prankster', moves: [toID(move)]}, - {species: "Kyurem", ability: 'pressure', moves: ['rest']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Tangrowth", ability: 'leafguard', moves: ['roar']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Smeargle", ability: 'prankster', moves: [toID(move)] }, + { species: "Kyurem", ability: 'pressure', moves: ['rest'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Tangrowth", ability: 'leafguard', moves: ['roar'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move roar'); battle.makeChoices('move rest', 'switch 2'); assert.equal(battle.p2.active[0].species.id, 'starmie'); }); - it('should free all trapped Pokemon if the user is no longer active', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Smeargle", ability: 'prankster', moves: [toID(move)]}, - {species: "Cobalion", ability: 'justified', item: 'laggingtail', moves: ['swordsdance', 'closecombat']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Tangrowth", ability: 'leafguard', moves: ['synthesis']}, - {species: "Starmie", ability: 'illuminate', moves: ['recover']}, - {species: "Cradily", ability: 'suctioncups', moves: ['recover']}, - {species: "Hippowdon", ability: 'sandstream', moves: ['slackoff']}, - ]}); + it('should free all trapped Pokemon if the user is no longer active', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Smeargle", ability: 'prankster', moves: [toID(move)] }, + { species: "Cobalion", ability: 'justified', item: 'laggingtail', moves: ['swordsdance', 'closecombat'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Tangrowth", ability: 'leafguard', moves: ['synthesis'] }, + { species: "Starmie", ability: 'illuminate', moves: ['recover'] }, + { species: "Cradily", ability: 'suctioncups', moves: ['recover'] }, + { species: "Hippowdon", ability: 'sandstream', moves: ['slackoff'] }, + ] }); if (move !== 'Thousand Waves') { battle.makeChoices('move ' + toID(move) + ' 1, move swordsdance', 'move synthesis, move recover'); battle.makeChoices('move ' + toID(move) + ' 2, move closecombat -1', 'move synthesis, move recover'); @@ -89,16 +89,16 @@ describe('Trapping Moves', function () { if (trappers.indexOf(move) < 3) { // Only test on moves that existed in gen 4 - it('should be passed when the user uses Baton Pass in Gen 4', function () { + it('should be passed when the user uses Baton Pass in Gen 4', () => { battle = common.gen(4).createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Smeargle", ability: 'prankster', moves: [toID(move), 'batonpass']}, - {species: "Shedinja", ability: 'wonderguard', moves: ['rest']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Tangrowth", ability: 'leafguard', moves: ['synthesis', 'roar']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Smeargle", ability: 'prankster', moves: [toID(move), 'batonpass'] }, + { species: "Shedinja", ability: 'wonderguard', moves: ['rest'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Tangrowth", ability: 'leafguard', moves: ['synthesis', 'roar'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move synthesis'); battle.makeChoices('move batonpass', 'move synthesis'); battle.makeChoices('switch 2', ''); @@ -111,16 +111,16 @@ describe('Trapping Moves', function () { } }); -describe('Partial Trapping Moves', function () { - afterEach(function () { +describe('Partial Trapping Moves', () => { + afterEach(() => { battle.destroy(); }); for (const move of partialtrappers) { - it('should deal 1/8 HP per turn', function () { + it('should deal 1/8 HP per turn', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'noguard', moves: [toID(move), 'rest']}]}); - battle.setPlayer('p2', {team: [{species: "Blissey", ability: 'naturalcure', moves: ['healbell']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'noguard', moves: [toID(move), 'rest'] }] }); + battle.setPlayer('p2', { team: [{ species: "Blissey", ability: 'naturalcure', moves: ['healbell'] }] }); battle.makeChoices('move ' + toID(move), 'move healbell'); const pokemon = battle.p2.active[0]; pokemon.heal(pokemon.maxhp); @@ -128,67 +128,67 @@ describe('Partial Trapping Moves', function () { assert.equal(pokemon.maxhp - pokemon.hp, battle.modify(pokemon.maxhp, 1 / 8)); }); - it('should prevent Pokemon from switching out normally', function () { + it('should prevent Pokemon from switching out normally', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'noguard', moves: [toID(move)]}]}); - battle.setPlayer('p2', {team: [ - {species: "Blissey", ability: 'naturalcure', moves: ['healbell']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'noguard', moves: [toID(move)] }] }); + battle.setPlayer('p2', { team: [ + { species: "Blissey", ability: 'naturalcure', moves: ['healbell'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move healbell'); assert.trapped(() => battle.makeChoices('move ' + toID(move), 'switch 2')); assert.equal(battle.p2.active[0].species.id, 'blissey'); }); - it('should not prevent Pokemon from switching out using moves', function () { + it('should not prevent Pokemon from switching out using moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'noguard', moves: [toID(move)]}]}); - battle.setPlayer('p2', {team: [ - {species: "Blissey", ability: 'naturalcure', moves: ['batonpass']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'noguard', moves: [toID(move)] }] }); + battle.setPlayer('p2', { team: [ + { species: "Blissey", ability: 'naturalcure', moves: ['batonpass'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move batonpass'); battle.makeChoices('', 'switch 2'); assert.equal(battle.p2.active[0].species.id, 'starmie'); }); - it('should not prevent Pokemon immune to trapping from switching out', function () { + it('should not prevent Pokemon immune to trapping from switching out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'noguard', moves: [toID(move)]}]}); - battle.setPlayer('p2', {team: [ - {species: "Dusknoir", ability: 'frisk', moves: ['sleeptalk']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'noguard', moves: [toID(move)] }] }); + battle.setPlayer('p2', { team: [ + { species: "Dusknoir", ability: 'frisk', moves: ['sleeptalk'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move sleeptalk'); battle.makeChoices('move ' + toID(move), 'switch 2'); assert.equal(battle.p2.active[0].species.id, 'starmie'); }); - it('should stop trapping the Pokemon if the user is no longer active', function () { + it('should stop trapping the Pokemon if the user is no longer active', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Smeargle", ability: 'noguard', moves: [toID(move)]}, - {species: "Kyurem", ability: 'pressure', moves: ['rest']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Blissey", ability: 'naturalcure', moves: ['roar']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Smeargle", ability: 'noguard', moves: [toID(move)] }, + { species: "Kyurem", ability: 'pressure', moves: ['rest'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Blissey", ability: 'naturalcure', moves: ['roar'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move roar'); battle.makeChoices('move rest', 'switch 2'); assert.equal(battle.p2.active[0].species.id, 'starmie'); }); - it('should stop trapping the Pokemon if the target uses Rapid Spin', function () { + it('should stop trapping the Pokemon if the target uses Rapid Spin', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Smeargle", ability: 'noguard', moves: [toID(move)]}, - {species: "Kyurem", ability: 'pressure', moves: ['rest']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Blissey", ability: 'naturalcure', moves: ['rapidspin']}, - {species: "Starmie", ability: 'illuminate', moves: ['reflecttype']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Smeargle", ability: 'noguard', moves: [toID(move)] }, + { species: "Kyurem", ability: 'pressure', moves: ['rest'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Blissey", ability: 'naturalcure', moves: ['rapidspin'] }, + { species: "Starmie", ability: 'illuminate', moves: ['reflecttype'] }, + ] }); battle.makeChoices('move ' + toID(move), 'move rapidspin'); battle.makeChoices('move ' + toID(move), 'switch 2'); assert.equal(battle.p2.active[0].species.id, 'starmie'); @@ -196,15 +196,15 @@ describe('Partial Trapping Moves', function () { } }); -describe('Partial Trapping Moves [Gen 1]', function () { - afterEach(function () { +describe('Partial Trapping Moves [Gen 1]', () => { + afterEach(() => { battle.destroy(); }); - it('Wrap ends when wrapped Pokemon dies of residual damage', function () { + it('Wrap ends when wrapped Pokemon dies of residual damage', () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Arbok", moves: ['wrap', 'toxic']}]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", moves: ['splash']}, {species: "Exeggutor", moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Arbok", moves: ['wrap', 'toxic'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", moves: ['splash'] }, { species: "Exeggutor", moves: ['splash'] }] }); battle.makeChoices('move toxic', 'move splash'); for (let i = 0; i < 6; i++) { battle.makeChoices(); @@ -212,10 +212,10 @@ describe('Partial Trapping Moves [Gen 1]', function () { assert(!battle.p1.active[0].volatiles['partialtrappinglock']); }); - it('Wrap ends when wrapped Pokemon switches to a Pokemon that dies of residual damage', function () { + it('Wrap ends when wrapped Pokemon switches to a Pokemon that dies of residual damage', () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Dragonite", moves: ['wrap', 'seismictoss', 'toxic'], evs: {hp: 255}}]}); - battle.setPlayer('p2', {team: [{species: "Mewtwo", moves: ['splash'], evs: {hp: 255}}, {species: "Exeggutor", moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Dragonite", moves: ['wrap', 'seismictoss', 'toxic'], evs: { hp: 255 } }] }); + battle.setPlayer('p2', { team: [{ species: "Mewtwo", moves: ['splash'], evs: { hp: 255 } }, { species: "Exeggutor", moves: ['splash'] }] }); for (let i = 0; i < 4; i++) { battle.makeChoices('move seismictoss', 'auto'); } @@ -226,10 +226,10 @@ describe('Partial Trapping Moves [Gen 1]', function () { assert(!battle.p1.active[0].volatiles['partialtrappinglock']); }); - it('Wrap ends when wrapper dies to residual damage', function () { + it('Wrap ends when wrapper dies to residual damage', () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Dragonite", moves: ['wrap', 'splash']}, {species: "Exeggutor", moves: ['splash']}]}); - battle.setPlayer('p2', {team: [{species: "Rhydon", moves: ['toxic']}]}); + battle.setPlayer('p1', { team: [{ species: "Dragonite", moves: ['wrap', 'splash'] }, { species: "Exeggutor", moves: ['splash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rhydon", moves: ['toxic'] }] }); battle.makeChoices('move splash', 'move toxic'); for (let i = 0; i < 7; i++) { battle.makeChoices(); @@ -237,10 +237,10 @@ describe('Partial Trapping Moves [Gen 1]', function () { assert(!battle.p2.active[0].volatiles['partiallytrapped']); }); - it('Wrap ends when wrapper switches to a Pokemon that dies of residual damage', function () { + it('Wrap ends when wrapper switches to a Pokemon that dies of residual damage', () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Rhydon", moves: ['splash'], evs: {hp: 255}}, {species: "Dragonite", moves: ['wrap']}]}); - battle.setPlayer('p2', {team: [{species: "Slowbro", moves: ['seismictoss', 'toxic']}]}); + battle.setPlayer('p1', { team: [{ species: "Rhydon", moves: ['splash'], evs: { hp: 255 } }, { species: "Dragonite", moves: ['wrap'] }] }); + battle.setPlayer('p2', { team: [{ species: "Slowbro", moves: ['seismictoss', 'toxic'] }] }); for (let i = 0; i < 4; i++) { battle.makeChoices(); } diff --git a/test/sim/misc/turn-order.js b/test/sim/misc/turn-order.js index 06a6ec7637..72516c77d2 100644 --- a/test/sim/misc/turn-order.js +++ b/test/sim/misc/turn-order.js @@ -5,24 +5,24 @@ const common = require('./../../common'); let battle; -describe('Mega Evolution', function () { - afterEach(function () { +describe('Mega Evolution', () => { + afterEach(() => { battle.destroy(); }); - it('should cause mega ability to affect the order of the turn in which it happens', function () { + it('should cause mega ability to affect the order of the turn in which it happens', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Banette', ability: 'frisk', item: 'banettite', moves: ['psychup']}]}); - battle.setPlayer('p2', {team: [{species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Banette', ability: 'frisk', item: 'banettite', moves: ['psychup'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind'] }] }); const pranksterMega = battle.p1.active[0]; battle.makeChoices('move psychup mega', 'move calmmind'); assert.statStage(pranksterMega, 'spa', 0); }); - it('should cause an ability copied with Trace by a mega to affect the order of the turn in which it happens', function () { + it('should cause an ability copied with Trace by a mega to affect the order of the turn in which it happens', () => { battle = common.createBattle([ - [{species: "Politoed", ability: 'drizzle', item: '', moves: ['scald']}, {species: "Kingdra", ability: 'swiftswim', item: '', moves: ['dragondance']}], - [{species: "Marowak", ability: 'rockhead', item: '', moves: ['earthquake']}, {species: "Alakazam", ability: 'magicguard', item: 'alakazite', moves: ['psychup']}], + [{ species: "Politoed", ability: 'drizzle', item: '', moves: ['scald'] }, { species: "Kingdra", ability: 'swiftswim', item: '', moves: ['dragondance'] }], + [{ species: "Marowak", ability: 'rockhead', item: '', moves: ['earthquake'] }, { species: "Alakazam", ability: 'magicguard', item: 'alakazite', moves: ['psychup'] }], ]); battle.makeChoices('switch 2', 'switch 2'); battle.makeChoices('move dragondance', 'move psychup mega'); @@ -31,52 +31,52 @@ describe('Mega Evolution', function () { assert.species(battle.p2.active[0], 'Alakazam-Mega'); }); - it('should cause base ability to not affect the order of the turn in which it happens', function () { + it('should cause base ability to not affect the order of the turn in which it happens', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', item: 'sablenite', moves: ['psychup']}]}); - battle.setPlayer('p2', {team: [{species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', item: 'sablenite', moves: ['psychup'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind'] }] }); const noPranksterMega = battle.p1.active[0]; battle.makeChoices('move psychup mega', 'move calmmind'); assert.statStage(noPranksterMega, 'spa', 1); }); - it('should cause mega forme speed to decide turn order', function () { + it('should cause mega forme speed to decide turn order', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Beedrill', ability: 'swarm', item: 'beedrillite', moves: ['xscissor']}]}); - battle.setPlayer('p2', {team: [{species: 'Hoopa-Unbound', ability: 'magician', moves: ['psyshock']}]}); + battle.setPlayer('p1', { team: [{ species: 'Beedrill', ability: 'swarm', item: 'beedrillite', moves: ['xscissor'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Hoopa-Unbound', ability: 'magician', moves: ['psyshock'] }] }); const fastBase = battle.p2.active[0]; battle.makeChoices('move xscissor mega', 'move psyshock'); assert.fainted(fastBase); }); - it('should cause ultra forme speed to decide turn order', function () { + it('should cause ultra forme speed to decide turn order', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Necrozma-Dusk-Mane', ability: 'swarm', item: 'ultranecroziumz', moves: ['xscissor']}]}); - battle.setPlayer('p2', {team: [{species: 'Hoopa-Unbound', ability: 'magician', moves: ['darkpulse']}]}); + battle.setPlayer('p1', { team: [{ species: 'Necrozma-Dusk-Mane', ability: 'swarm', item: 'ultranecroziumz', moves: ['xscissor'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Hoopa-Unbound', ability: 'magician', moves: ['darkpulse'] }] }); const fastBase = battle.p2.active[0]; battle.makeChoices('move xscissor ultra', 'move darkpulse'); assert.equal(fastBase.hp, 0); }); }); -describe('Mega Evolution [Gen 6]', function () { - afterEach(function () { +describe('Mega Evolution [Gen 6]', () => { + afterEach(() => { battle.destroy(); }); - it('should not cause mega ability to affect the order of the turn in which it happens', function () { + it('should not cause mega ability to affect the order of the turn in which it happens', () => { battle = common.gen(6).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Banette', ability: 'frisk', item: 'banettite', moves: ['psychup']}]}); - battle.setPlayer('p2', {team: [{species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Banette', ability: 'frisk', item: 'banettite', moves: ['psychup'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind'] }] }); const pranksterMega = battle.p1.active[0]; battle.makeChoices('move psychup mega', 'move calmmind'); assert.statStage(pranksterMega, 'spa', 1); }); - it('should not cause an ability copied with Trace by a mega to affect the order of the turn in which it happens', function () { + it('should not cause an ability copied with Trace by a mega to affect the order of the turn in which it happens', () => { battle = common.gen(6).createBattle([ - [{species: "Politoed", ability: 'drizzle', item: '', moves: ['scald']}, {species: "Kingdra", ability: 'swiftswim', item: '', moves: ['dragondance']}], - [{species: "Marowak", ability: 'rockhead', item: '', moves: ['earthquake']}, {species: "Alakazam", ability: 'magicguard', item: 'alakazite', moves: ['psychup']}], + [{ species: "Politoed", ability: 'drizzle', item: '', moves: ['scald'] }, { species: "Kingdra", ability: 'swiftswim', item: '', moves: ['dragondance'] }], + [{ species: "Marowak", ability: 'rockhead', item: '', moves: ['earthquake'] }, { species: "Alakazam", ability: 'magicguard', item: 'alakazite', moves: ['psychup'] }], ]); battle.makeChoices('switch 2', 'switch 2'); battle.makeChoices('move dragondance', 'move psychup mega'); @@ -85,43 +85,43 @@ describe('Mega Evolution [Gen 6]', function () { assert.species(battle.p2.active[0], 'Alakazam-Mega'); }); - it('should cause base ability to affect the order of the turn in which it happens', function () { + it('should cause base ability to affect the order of the turn in which it happens', () => { battle = common.gen(6).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', item: 'sablenite', moves: ['psychup']}]}); - battle.setPlayer('p2', {team: [{species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', item: 'sablenite', moves: ['psychup'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Deoxys-Speed', ability: 'pressure', moves: ['calmmind'] }] }); const noPranksterMega = battle.p1.active[0]; battle.makeChoices('move psychup mega', 'move calmmind'); assert.statStage(noPranksterMega, 'spa', 0); }); - it('should cause base forme speed to decide turn order', function () { + it('should cause base forme speed to decide turn order', () => { battle = common.gen(6).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Beedrill', ability: 'swarm', item: 'beedrillite', moves: ['xscissor']}]}); - battle.setPlayer('p2', {team: [{species: 'Hoopa-Unbound', ability: 'magician', moves: ['psyshock']}]}); + battle.setPlayer('p1', { team: [{ species: 'Beedrill', ability: 'swarm', item: 'beedrillite', moves: ['xscissor'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Hoopa-Unbound', ability: 'magician', moves: ['psyshock'] }] }); const fastMega = battle.p1.active[0]; battle.makeChoices('move xscissor mega', 'move psyshock'); assert.fainted(fastMega); }); }); -describe('Pokemon Speed', function () { - afterEach(function () { +describe('Pokemon Speed', () => { + afterEach(() => { battle.destroy(); }); - it('should update dynamically in Gen 8', function () { - battle = common.createBattle({gameType: 'doubles'}); + it('should update dynamically in Gen 8', () => { + battle = common.createBattle({ gameType: 'doubles' }); const p1team = [ - {species: 'Ludicolo', ability: 'swiftswim', moves: ['scald'], evs: {spe: 100}}, // 201 Speed - {species: 'Appletun', ability: 'ripen', moves: ['sleeptalk']}, // To be switched out - {species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk']}, // Will set rain on switch in + { species: 'Ludicolo', ability: 'swiftswim', moves: ['scald'], evs: { spe: 100 } }, // 201 Speed + { species: 'Appletun', ability: 'ripen', moves: ['sleeptalk'] }, // To be switched out + { species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk'] }, // Will set rain on switch in ]; const p2team = [ - {species: 'Accelgor', ability: 'hydration', moves: ['bugbuzz'], evs: {spe: 156}, nature: 'Timid'}, // 401 Speed - {species: 'Aegislash', ability: 'stancechange', moves: ['sleeptalk']}, // Does nothing but fill a slot + { species: 'Accelgor', ability: 'hydration', moves: ['bugbuzz'], evs: { spe: 156 }, nature: 'Timid' }, // 401 Speed + { species: 'Aegislash', ability: 'stancechange', moves: ['sleeptalk'] }, // Does nothing but fill a slot ]; - battle.setPlayer('p1', {team: p1team}); - battle.setPlayer('p2', {team: p2team}); + battle.setPlayer('p1', { team: p1team }); + battle.setPlayer('p2', { team: p2team }); // Set ludicolo's and accelgor's HP to 1. battle.p1.pokemon[0].sethp(1); // Ludicolo @@ -131,19 +131,19 @@ describe('Pokemon Speed', function () { assert.fainted(battle.p2.pokemon[0]); // Accelgor should be fainted }); - it('should NOT update dynamically in Gen 7', function () { - battle = common.gen(7).createBattle({gameType: 'doubles'}); + it('should NOT update dynamically in Gen 7', () => { + battle = common.gen(7).createBattle({ gameType: 'doubles' }); const p1team = [ - {species: 'Ludicolo', ability: 'swiftswim', moves: ['scald'], evs: {spe: 100}}, // 201 Speed - {species: 'Appletun', ability: 'ripen', moves: ['sleeptalk']}, // To be switched out - {species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk']}, // Will set rain on switch in + { species: 'Ludicolo', ability: 'swiftswim', moves: ['scald'], evs: { spe: 100 } }, // 201 Speed + { species: 'Appletun', ability: 'ripen', moves: ['sleeptalk'] }, // To be switched out + { species: 'Pelipper', ability: 'drizzle', moves: ['sleeptalk'] }, // Will set rain on switch in ]; const p2team = [ - {species: 'Accelgor', ability: 'hydration', moves: ['bugbuzz'], evs: {spe: 156}, nature: 'Timid'}, // 401 Speed - {species: 'Aegislash', ability: 'stancechange', moves: ['sleeptalk']}, // Does nothing but fill a slot + { species: 'Accelgor', ability: 'hydration', moves: ['bugbuzz'], evs: { spe: 156 }, nature: 'Timid' }, // 401 Speed + { species: 'Aegislash', ability: 'stancechange', moves: ['sleeptalk'] }, // Does nothing but fill a slot ]; - battle.setPlayer('p1', {team: p1team}); - battle.setPlayer('p2', {team: p2team}); + battle.setPlayer('p1', { team: p1team }); + battle.setPlayer('p2', { team: p2team }); // Set ludicolo's and accelgor's HP to 1. battle.p1.pokemon[0].sethp(1); // Ludicolo @@ -154,33 +154,33 @@ describe('Pokemon Speed', function () { }); }); -describe('Switching out', function () { - it('should happen in order of switch-out\'s Speed stat', function () { +describe('Switching out', () => { + it('should happen in order of switch-out\'s Speed stat', () => { battle = common.createBattle(); const p1team = [ - {species: 'Accelgor', ability: 'runaway', moves: ['sleeptalk']}, - {species: 'Shuckle', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'Accelgor', ability: 'runaway', moves: ['sleeptalk'] }, + { species: 'Shuckle', ability: 'intimidate', moves: ['sleeptalk'] }, ]; const p2team = [ - {species: 'Durant', ability: 'runaway', moves: ['sleeptalk']}, - {species: 'Barraskewda', ability: 'runaway', moves: ['sleeptalk']}, + { species: 'Durant', ability: 'runaway', moves: ['sleeptalk'] }, + { species: 'Barraskewda', ability: 'runaway', moves: ['sleeptalk'] }, ]; - battle.setPlayer('p1', {team: p1team}); - battle.setPlayer('p2', {team: p2team}); + battle.setPlayer('p1', { team: p1team }); + battle.setPlayer('p2', { team: p2team }); battle.makeChoices('switch 2', 'switch 2'); assert.equal(battle.p2.pokemon[0].boosts.atk, 0); }); }); -describe('Switching in', function () { - it(`should trigger events in an order determined by what each Pokemon's speed was when they switched in`, function () { +describe('Switching in', () => { + it(`should trigger events in an order determined by what each Pokemon's speed was when they switched in`, () => { battle = common.gen(7).createBattle([[ - {species: "ribombee", moves: ['stickyweb']}, - {species: "groudon", item: 'redorb', moves: ['sleeptalk'], evs: {spe: 0}}, + { species: "ribombee", moves: ['stickyweb'] }, + { species: "groudon", item: 'redorb', moves: ['sleeptalk'], evs: { spe: 0 } }, ], [ - {species: "golemalola", ability: 'galvanize', moves: ['explosion']}, - {species: "kyogre", item: 'blueorb', moves: ['sleeptalk'], evs: {spe: 252}}, + { species: "golemalola", ability: 'galvanize', moves: ['explosion'] }, + { species: "kyogre", item: 'blueorb', moves: ['sleeptalk'], evs: { spe: 252 } }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'switch 2'); @@ -190,16 +190,16 @@ describe('Switching in', function () { }); }); -describe('Speed ties', function () { - it('(slow) Perish Song faint order should be random', function () { - const wins = {p1: 0, p2: 0}; +describe('Speed ties', () => { + it('(slow) Perish Song faint order should be random', () => { + const wins = { p1: 0, p2: 0 }; for (let i = 0; i < 20; i++) { battle = common.createBattle({ seed: [i, 2, 3, 4], }, [[ - {species: "Politoed", moves: ['perishsong']}, + { species: "Politoed", moves: ['perishsong'] }, ], [ - {species: "Politoed", moves: ['perishsong']}, + { species: "Politoed", moves: ['perishsong'] }, ]]); battle.makeChoices('auto', 'auto'); battle.makeChoices('auto', 'auto'); diff --git a/test/sim/misc/twoturnmoves.js b/test/sim/misc/twoturnmoves.js index aa527c663c..8adaa0d44f 100644 --- a/test/sim/misc/twoturnmoves.js +++ b/test/sim/misc/twoturnmoves.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Two Turn Moves [Gen 1]', function () { - afterEach(function () { +describe('Two Turn Moves [Gen 1]', () => { + afterEach(() => { battle.destroy(); }); - it(`charges the first turn, does damage and uses PP the second turn`, function () { + it(`charges the first turn, does damage and uses PP the second turn`, () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Venusaur", moves: ['solarbeam']}]}); - battle.setPlayer('p2', {team: [{species: "Parasect", moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Venusaur", moves: ['solarbeam'] }] }); + battle.setPlayer('p2', { team: [{ species: "Parasect", moves: ['swordsdance'] }] }); const venusaur = battle.p1.active[0]; const parasect = battle.p2.active[0]; assert.equal(venusaur.moveSlots[0].pp, 16); @@ -27,10 +27,10 @@ describe('Two Turn Moves [Gen 1]', function () { assert.false.fullHP(parasect); }); - it(`move is paused when asleep or frozen`, function () { + it(`move is paused when asleep or frozen`, () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Aerodactyl", moves: ['skyattack']}]}); - battle.setPlayer('p2', {team: [{species: "Parasect", moves: ['spore']}]}); + battle.setPlayer('p1', { team: [{ species: "Aerodactyl", moves: ['skyattack'] }] }); + battle.setPlayer('p2', { team: [{ species: "Parasect", moves: ['spore'] }] }); const aerodactyl = battle.p1.active[0]; for (let i = 0; i < 10; i++) { battle.makeChoices(); @@ -39,11 +39,11 @@ describe('Two Turn Moves [Gen 1]', function () { } }); - it(`two-turn move ends if it fails due to Disable, does not use PP`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Aerodactyl', moves: ['skyattack']}, + it(`two-turn move ends if it fails due to Disable, does not use PP`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Aerodactyl', moves: ['skyattack'] }, ], [ - {species: 'Drowzee', moves: ['disable']}, + { species: 'Drowzee', moves: ['disable'] }, ]]); const aerodactyl = battle.p1.active[0]; @@ -56,10 +56,10 @@ describe('Two Turn Moves [Gen 1]', function () { assert(!aerodactyl.volatiles['twoturnmove']); }); - it(`[Gen 1] if called by Metronome or Mirror Move, the calling move uses PP in the attacking turn`, function () { - battle = common.gen(1).createBattle({seed: [0, 1, 0, 1]}); - battle.setPlayer('p1', {team: [{species: 'blastoise', moves: ['metronome', 'skullbash']}]}); - battle.setPlayer('p2', {team: [{species: 'golem', moves: ['defensecurl']}]}); + it(`[Gen 1] if called by Metronome or Mirror Move, the calling move uses PP in the attacking turn`, () => { + battle = common.gen(1).createBattle({ seed: [0, 1, 0, 1] }); + battle.setPlayer('p1', { team: [{ species: 'blastoise', moves: ['metronome', 'skullbash'] }] }); + battle.setPlayer('p2', { team: [{ species: 'golem', moves: ['defensecurl'] }] }); const blastoise = battle.p1.active[0]; battle.makeChoices(); assert(battle.log.some(line => line.includes('|move|p1a: Blastoise|Skull Bash||[from]Metronome|[still]'))); @@ -70,10 +70,10 @@ describe('Two Turn Moves [Gen 1]', function () { assert.equal(blastoise.moveSlots[1].pp, 24); }); - it(`Dig/Fly dodges all attacks except for Swift, Transform, and Bide`, function () { + it(`Dig/Fly dodges all attacks except for Swift, Transform, and Bide`, () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Aerodactyl", moves: ['fly']}]}); - battle.setPlayer('p2', {team: [{species: "Pidgeot", moves: ['gust']}]}); + battle.setPlayer('p1', { team: [{ species: "Aerodactyl", moves: ['fly'] }] }); + battle.setPlayer('p2', { team: [{ species: "Pidgeot", moves: ['gust'] }] }); battle.makeChoices(); assert(battle.log.some(line => line.includes("Aerodactyl can't be hit"))); assert.fullHP(battle.p1.active[0]); @@ -81,10 +81,10 @@ describe('Two Turn Moves [Gen 1]', function () { assert.false.fullHP(battle.p1.active[0]); }); - it(`Dig/Fly invulnerability glitch`, function () { - battle = common.gen(1).createBattle({seed: [0, 0, 0, 1]}); - battle.setPlayer('p1', {team: [{species: "Electrode", moves: ['thunderwave', 'swift', 'thunderbolt']}]}); - battle.setPlayer('p2', {team: [{species: "Pidgeot", moves: ['fly', 'gust']}]}); + it(`Dig/Fly invulnerability glitch`, () => { + battle = common.gen(1).createBattle({ seed: [0, 0, 0, 1] }); + battle.setPlayer('p1', { team: [{ species: "Electrode", moves: ['thunderwave', 'swift', 'thunderbolt'] }] }); + battle.setPlayer('p2', { team: [{ species: "Pidgeot", moves: ['fly', 'gust'] }] }); const pidgeot = battle.p2.active[0]; battle.makeChoices(); assert(pidgeot.volatiles['twoturnmove']); diff --git a/test/sim/misc/typechange.js b/test/sim/misc/typechange.js index 8f86c4496c..5ee37903a6 100644 --- a/test/sim/misc/typechange.js +++ b/test/sim/misc/typechange.js @@ -6,57 +6,57 @@ const common = require('./../../common'); let battle; const adderMoves = [ - {name: 'Trick-or-Treat', type: 'Ghost'}, - {name: 'Forest\'s Curse', type: 'Grass'}, + { name: 'Trick-or-Treat', type: 'Ghost' }, + { name: 'Forest\'s Curse', type: 'Grass' }, ]; -describe('Type addition', function () { - afterEach(function () { +describe('Type addition', () => { + afterEach(() => { battle.destroy(); }); for (const moveData of adderMoves) { - describe(moveData.name, function () { - it('should add ' + moveData.type + ' type to its target', function () { + describe(moveData.name, () => { + it('should add ' + moveData.type + ' type to its target', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gourgeist", ability: 'frisk', moves: [moveData.name]}]}); - battle.setPlayer('p2', {team: [{species: "Machamp", ability: 'guts', moves: ['crosschop']}]}); + battle.setPlayer('p1', { team: [{ species: "Gourgeist", ability: 'frisk', moves: [moveData.name] }] }); + battle.setPlayer('p2', { team: [{ species: "Machamp", ability: 'guts', moves: ['crosschop'] }] }); const target = battle.p2.active[0]; assert.sets(() => target.getTypes().join('/'), `Fighting/${moveData.type}`, () => battle.makeChoices('move ' + moveData.name, 'move crosschop')); }); - it('should not add ' + moveData.type + ' type to ' + moveData.type + ' targets', function () { + it('should not add ' + moveData.type + ' type to ' + moveData.type + ' targets', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gourgeist", ability: 'frisk', moves: [moveData.name]}]}); - battle.setPlayer('p2', {team: [{species: "Trevenant", ability: 'harvest', moves: ['ingrain']}]}); + battle.setPlayer('p1', { team: [{ species: "Gourgeist", ability: 'frisk', moves: [moveData.name] }] }); + battle.setPlayer('p2', { team: [{ species: "Trevenant", ability: 'harvest', moves: ['ingrain'] }] }); const target = battle.p2.active[0]; assert.constant(() => target.getTypes().join('/'), () => battle.makeChoices('move ' + moveData.name, 'move ingrain')); }); - it('should be able to add ' + moveData.type + ' type to Arceus', function () { + it('should be able to add ' + moveData.type + ' type to Arceus', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gourgeist", ability: 'frisk', moves: [moveData.name]}]}); - battle.setPlayer('p2', {team: [{species: "Arceus", ability: 'multitype', moves: ['extremespeed']}]}); + battle.setPlayer('p1', { team: [{ species: "Gourgeist", ability: 'frisk', moves: [moveData.name] }] }); + battle.setPlayer('p2', { team: [{ species: "Arceus", ability: 'multitype', moves: ['extremespeed'] }] }); const target = battle.p2.active[0]; assert.sets(() => target.getTypes().join('/'), `Normal/${moveData.type}`, () => battle.makeChoices('move ' + moveData.name, 'move extremespeed')); }); for (const moveData2 of adderMoves) { if (moveData.name === moveData2.name) { - it('should fail on repeated use', function () { + it('should fail on repeated use', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gourgeist", ability: 'frisk', moves: [moveData.name]}]}); - battle.setPlayer('p2', {team: [{species: "Deoxys-Speed", ability: 'pressure', moves: ['spikes']}]}); + battle.setPlayer('p1', { team: [{ species: "Gourgeist", ability: 'frisk', moves: [moveData.name] }] }); + battle.setPlayer('p2', { team: [{ species: "Deoxys-Speed", ability: 'pressure', moves: ['spikes'] }] }); const target = battle.p2.active[0]; battle.makeChoices('move ' + moveData.name, 'move spikes'); assert.constant(() => target.getTypes().join('/'), () => battle.makeChoices('move ' + moveData.name, 'move spikes')); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-fail|')); }); } else { - it('should override ' + moveData2.name, function () { + it('should override ' + moveData2.name, () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Gourgeist", ability: 'frisk', moves: [moveData.name, moveData2.name]}]}); - battle.setPlayer('p2', {team: [{species: "Deoxys-Speed", ability: 'pressure', moves: ['spikes']}]}); + battle.setPlayer('p1', { team: [{ species: "Gourgeist", ability: 'frisk', moves: [moveData.name, moveData2.name] }] }); + battle.setPlayer('p2', { team: [{ species: "Deoxys-Speed", ability: 'pressure', moves: ['spikes'] }] }); const target = battle.p2.active[0]; battle.makeChoices('move ' + moveData2.name, 'move spikes'); assert.sets(() => target.getTypes().join('/'), `Psychic/${moveData.type}`, () => battle.makeChoices('move ' + moveData.name, 'move spikes')); diff --git a/test/sim/misc/weather.js b/test/sim/misc/weather.js index c58b40b141..5f21996e98 100644 --- a/test/sim/misc/weather.js +++ b/test/sim/misc/weather.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Weather damage calculation', function () { - afterEach(function () { +describe('Weather damage calculation', () => { + afterEach(() => { battle.destroy(); }); - it('should multiply the damage (not the basePower) in favorable weather', function () { + it('should multiply the damage (not the basePower) in favorable weather', () => { battle = common.createBattle(); battle.randomizer = dmg => dmg; // max damage - battle.setPlayer('p1', {team: [{species: 'Ninetales', ability: 'drought', moves: ['incinerate']}]}); - battle.setPlayer('p2', {team: [{species: 'Cryogonal', ability: 'levitate', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ninetales', ability: 'drought', moves: ['incinerate'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Cryogonal', ability: 'levitate', moves: ['splash'] }] }); const attacker = battle.p1.active[0]; const defender = battle.p2.active[0]; assert.hurtsBy(defender, 152, () => battle.makeChoices('move incinerate', 'move splash')); @@ -23,11 +23,11 @@ describe('Weather damage calculation', function () { assert.equal(basePower, move.basePower); }); - it('should reduce the damage (not the basePower) in unfavorable weather', function () { + it('should reduce the damage (not the basePower) in unfavorable weather', () => { battle = common.createBattle(); battle.randomizer = dmg => dmg; // max damage - battle.setPlayer('p1', {team: [{species: 'Ninetales', ability: 'drizzle', moves: ['incinerate']}]}); - battle.setPlayer('p2', {team: [{species: 'Cryogonal', ability: 'levitate', moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: 'Ninetales', ability: 'drizzle', moves: ['incinerate'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Cryogonal', ability: 'levitate', moves: ['splash'] }] }); const attacker = battle.p1.active[0]; const defender = battle.p2.active[0]; assert.hurtsBy(defender, 50, () => battle.makeChoices('move incinerate', 'move splash')); @@ -36,11 +36,11 @@ describe('Weather damage calculation', function () { assert.equal(basePower, move.basePower); }); - it('should make Hail/Sandstorm damage some pokemon but not others', function () { + it('should make Hail/Sandstorm damage some pokemon but not others', () => { battle = common.gen(8).createBattle(); battle.randomizer = dmg => dmg; // max damage - battle.setPlayer('p1', {team: [{species: 'Abomasnow', ability: 'snowwarning', moves: ['protect']}]}); - battle.setPlayer('p2', {team: [{species: 'Sandslash', ability: 'sandveil', moves: ['protect']}]}); + battle.setPlayer('p1', { team: [{ species: 'Abomasnow', ability: 'snowwarning', moves: ['protect'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Sandslash', ability: 'sandveil', moves: ['protect'] }] }); battle.makeChoices('move protect', 'move protect'); const p1active = battle.p1.active[0]; const p2active = battle.p2.active[0]; @@ -48,11 +48,11 @@ describe('Weather damage calculation', function () { assert.notEqual(p2active.hp, p2active.maxhp); }); - it(`should wear off on the final turn before weather effects are applied`, function () { + it(`should wear off on the final turn before weather effects are applied`, () => { battle = common.createBattle([[ - {species: 'Tyranitar', ability: 'sandstream', moves: ['sleeptalk']}, + { species: 'Tyranitar', ability: 'sandstream', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 5; i++) battle.makeChoices(); @@ -60,11 +60,11 @@ describe('Weather damage calculation', function () { assert.equal(wynaut.hp, wynaut.maxhp - (Math.floor(wynaut.maxhp / 16) * 4)); }); - it(`should wear off before future attacks`, function () { + it(`should wear off before future attacks`, () => { battle = common.createBattle([[ - {species: 'Tyranitar', ability: 'sandstream', moves: ['doomdesire', 'soak']}, + { species: 'Tyranitar', ability: 'sandstream', moves: ['doomdesire', 'soak'] }, ], [ - {species: 'Roggenrola', moves: ['sleeptalk']}, + { species: 'Roggenrola', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -76,11 +76,11 @@ describe('Weather damage calculation', function () { assert(sandDamageIndex < futureDamageIndex, `Sandstorm should have dealt damage before Doom Desire`); }); - it(`should run residual weather effects in order of Speed`, function () { + it(`should run residual weather effects in order of Speed`, () => { battle = common.createBattle([[ - {species: 'Sunkern', ability: 'solarpower', moves: ['sunnyday']}, + { species: 'Sunkern', ability: 'solarpower', moves: ['sunnyday'] }, ], [ - {species: 'Charizard', ability: 'dryskin', moves: ['sleeptalk']}, + { species: 'Charizard', ability: 'dryskin', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/misc/weight.js b/test/sim/misc/weight.js index 6bfbf9111b..2cb128ffa9 100644 --- a/test/sim/misc/weight.js +++ b/test/sim/misc/weight.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Heavy Metal', function () { - afterEach(function () { +describe('Heavy Metal', () => { + afterEach(() => { battle.destroy(); }); - it('should double the weight of a Pokemon', function () { + it('should double the weight of a Pokemon', () => { battle = common.createBattle([ - [{species: "Simisear", ability: 'heavymetal', moves: ['nastyplot']}], - [{species: "Simisage", ability: 'gluttony', moves: ['grassknot']}], + [{ species: "Simisear", ability: 'heavymetal', moves: ['nastyplot'] }], + [{ species: "Simisage", ability: 'gluttony', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } @@ -25,13 +25,13 @@ describe('Heavy Metal', function () { assert.equal(basePower, 80); }); - it('should be negated by Mold Breaker', function () { + it('should be negated by Mold Breaker', () => { battle = common.createBattle([ - [{species: "Simisear", ability: 'heavymetal', moves: ['nastyplot']}], - [{species: "Simisage", ability: 'moldbreaker', moves: ['grassknot']}], + [{ species: "Simisear", ability: 'heavymetal', moves: ['nastyplot'] }], + [{ species: "Simisage", ability: 'moldbreaker', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } @@ -41,18 +41,18 @@ describe('Heavy Metal', function () { }); }); -describe('Light Metal', function () { - afterEach(function () { +describe('Light Metal', () => { + afterEach(() => { battle.destroy(); }); - it('should halve the weight of a Pokemon', function () { + it('should halve the weight of a Pokemon', () => { battle = common.createBattle([ - [{species: "Registeel", ability: 'lightmetal', moves: ['curse']}], - [{species: "Simisage", ability: 'gluttony', moves: ['grassknot']}], + [{ species: "Registeel", ability: 'lightmetal', moves: ['curse'] }], + [{ species: "Simisage", ability: 'gluttony', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } @@ -61,13 +61,13 @@ describe('Light Metal', function () { assert.equal(basePower, 100); }); - it('should be negated by Mold Breaker', function () { + it('should be negated by Mold Breaker', () => { battle = common.createBattle([ - [{species: "Registeel", ability: 'lightmetal', moves: ['splash']}], - [{species: "Simisage", ability: 'moldbreaker', moves: ['grassknot']}], + [{ species: "Registeel", ability: 'lightmetal', moves: ['splash'] }], + [{ species: "Simisage", ability: 'moldbreaker', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } @@ -77,18 +77,18 @@ describe('Light Metal', function () { }); }); -describe('Float Stone', function () { - afterEach(function () { +describe('Float Stone', () => { + afterEach(() => { battle.destroy(); }); - it('should halve the weight of a Pokemon', function () { + it('should halve the weight of a Pokemon', () => { battle = common.createBattle([ - [{species: "Registeel", ability: 'clearbody', item: 'floatstone', moves: ['curse']}], - [{species: "Simisage", ability: 'gluttony', moves: ['grassknot']}], + [{ species: "Registeel", ability: 'clearbody', item: 'floatstone', moves: ['curse'] }], + [{ species: "Simisage", ability: 'gluttony', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } @@ -98,18 +98,18 @@ describe('Float Stone', function () { }); }); -describe('Autotomize', function () { - afterEach(function () { +describe('Autotomize', () => { + afterEach(() => { battle.destroy(); }); - it('should reduce the weight of a Pokemon by 100 kg with each use', function () { + it('should reduce the weight of a Pokemon by 100 kg with each use', () => { battle = common.createBattle([ - [{species: "Registeel", ability: 'clearbody', moves: ['autotomize']}], - [{species: "Simisage", ability: 'gluttony', item: 'laggingtail', moves: ['grassknot']}], + [{ species: "Registeel", ability: 'clearbody', moves: ['autotomize'] }], + [{ species: "Simisage", ability: 'gluttony', item: 'laggingtail', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } @@ -120,13 +120,13 @@ describe('Autotomize', function () { assert.equal(basePower, 20); }); - it('should factor into weight before Heavy Metal does', function () { + it('should factor into weight before Heavy Metal does', () => { battle = common.createBattle([ - [{species: "Lairon", ability: 'heavymetal', moves: ['autotomize']}], - [{species: "Simisage", ability: 'gluttony', item: 'laggingtail', moves: ['grassknot']}], + [{ species: "Lairon", ability: 'heavymetal', moves: ['autotomize'] }], + [{ species: "Simisage", ability: 'gluttony', item: 'laggingtail', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } @@ -135,13 +135,13 @@ describe('Autotomize', function () { assert.equal(basePower, 60); }); - it('should reset after a forme change', function () { + it('should reset after a forme change', () => { battle = common.createBattle([ - [{species: "Aegislash", ability: 'stancechange', moves: ['autotomize', 'shadowsneak']}], - [{species: "Simisage", ability: 'gluttony', item: 'laggingtail', moves: ['grassknot']}], + [{ species: "Aegislash", ability: 'stancechange', moves: ['autotomize', 'shadowsneak'] }], + [{ species: "Simisage", ability: 'gluttony', item: 'laggingtail', moves: ['grassknot'] }], ]); let basePower = 0; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'grassknot') { basePower = bp; } diff --git a/test/sim/misc/zmoves.js b/test/sim/misc/zmoves.js index a3d8d0f809..c11583eb1a 100644 --- a/test/sim/misc/zmoves.js +++ b/test/sim/misc/zmoves.js @@ -5,36 +5,36 @@ const common = require('./../../common'); let battle; -describe('Z Moves', function () { - afterEach(function () { +describe('Z Moves', () => { + afterEach(() => { battle.destroy(); }); - it(`should use the base move's type if it is a damaging move`, function () { + it(`should use the base move's type if it is a damaging move`, () => { battle = common.createBattle([[ - {species: 'Kecleon', item: 'normaliumz', moves: ['hiddenpower']}, + { species: 'Kecleon', item: 'normaliumz', moves: ['hiddenpower'] }, ], [ - {species: 'Gengar', moves: ['sleeptalk']}, + { species: 'Gengar', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move hiddenpower zmove', 'auto'); assert.fullHP(battle.p2.active[0]); }); - it(`should not use the base move's priority if it is a damaging move`, function () { + it(`should not use the base move's priority if it is a damaging move`, () => { battle = common.createBattle([[ - {species: 'Kecleon', item: 'ghostiumz', moves: ['shadowsneak']}, + { species: 'Kecleon', item: 'ghostiumz', moves: ['shadowsneak'] }, ], [ - {species: 'Starmie', moves: ['reflecttype']}, + { species: 'Starmie', moves: ['reflecttype'] }, ]]); battle.makeChoices('move shadowsneak zmove', 'auto'); assert.fullHP(battle.p2.active[0]); }); - it(`should be possible to activate them when the base move is disabled`, function () { + it(`should be possible to activate them when the base move is disabled`, () => { battle = common.createBattle([[ - {species: 'Chansey', item: 'normaliumz', ability: 'naturalcure', moves: ['doubleteam', 'fireblast']}, + { species: 'Chansey', item: 'normaliumz', ability: 'naturalcure', moves: ['doubleteam', 'fireblast'] }, ], [ - {species: 'Mightyena', ability: 'intimidate', moves: ['taunt']}, + { species: 'Mightyena', ability: 'intimidate', moves: ['taunt'] }, ]]); const chansey = battle.p1.active[0]; assert.statStage(chansey, 'atk', -1); @@ -45,11 +45,11 @@ describe('Z Moves', function () { assert.statStage(chansey, 'atk', 0); }); - it(`should be impossible to activate them when all the base moves are disabled`, function () { + it(`should be impossible to activate them when all the base moves are disabled`, () => { battle = common.createBattle([[ - {species: 'Chansey', item: 'normaliumz', ability: 'naturalcure', moves: ['doubleteam', 'minimize']}, + { species: 'Chansey', item: 'normaliumz', ability: 'naturalcure', moves: ['doubleteam', 'minimize'] }, ], [ - {species: 'Mightyena', ability: 'intimidate', moves: ['taunt']}, + { species: 'Mightyena', ability: 'intimidate', moves: ['taunt'] }, ]]); const chansey = battle.p1.active[0]; diff --git a/test/sim/moves/acupressure.js b/test/sim/moves/acupressure.js index 234dac4750..9e6f38bfe0 100644 --- a/test/sim/moves/acupressure.js +++ b/test/sim/moves/acupressure.js @@ -5,32 +5,32 @@ const common = require('./../../common'); let battle; -describe('Acupressure', function () { - afterEach(function () { +describe('Acupressure', () => { + afterEach(() => { battle.destroy(); }); - it(`should be able to target an ally in doubles`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['acupressure']}, - {species: 'Smoochum', moves: ['sleeptalk']}, + it(`should be able to target an ally in doubles`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['acupressure'] }, + { species: 'Smoochum', moves: ['sleeptalk'] }, ], [ - {species: 'Clamperl', moves: ['sleeptalk']}, - {species: 'Whismur', moves: ['sleeptalk']}, + { species: 'Clamperl', moves: ['sleeptalk'] }, + { species: 'Whismur', moves: ['sleeptalk'] }, ]]); assert.false.cantMove(() => battle.choose('p1', 'move acupressure -2, move sleeptalk')); }); - it(`should be unable to target any opponent in free-for-alls`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'Wynaut', moves: ['acupressure']}, + it(`should be unable to target any opponent in free-for-alls`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'Wynaut', moves: ['acupressure'] }, ], [ - {species: 'Cufant', moves: ['sleeptalk']}, + { species: 'Cufant', moves: ['sleeptalk'] }, ], [ - {species: 'Qwilfish', moves: ['sleeptalk']}, + { species: 'Qwilfish', moves: ['sleeptalk'] }, ], [ - {species: 'Marowak', moves: ['sleeptalk']}, + { species: 'Marowak', moves: ['sleeptalk'] }, ]]); assert.cantMove(() => battle.choose('p1', 'move acupressure 1')); @@ -40,12 +40,12 @@ describe('Acupressure', function () { // https://www.smogon.com/forums/threads/acupressure-targeting.3733779/post-9920405 it(`should redirect to the user if a targetted ally faints`, () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Pincurchin', moves: ['acupressure']}, - {species: 'Flutter Mane', moves: ['memento']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Pincurchin', moves: ['acupressure'] }, + { species: 'Flutter Mane', moves: ['memento'] }, ], [ - {species: 'Furret', moves: ['sleeptalk']}, - {species: 'Chien-Pao', moves: ['haze']}, + { species: 'Furret', moves: ['sleeptalk'] }, + { species: 'Chien-Pao', moves: ['haze'] }, ]]); battle.makeChoices('move acupressure -2, move memento 1', 'auto'); @@ -55,12 +55,12 @@ describe('Acupressure', function () { }); it(`in Gen 5, should not redirect to the uesr if a targetted ally faints`, () => { - battle = common.gen(5).createBattle({gameType: 'doubles'}, [[ - {species: 'Shuckle', moves: ['acupressure']}, - {species: 'Dugtrio', moves: ['memento']}, + battle = common.gen(5).createBattle({ gameType: 'doubles' }, [[ + { species: 'Shuckle', moves: ['acupressure'] }, + { species: 'Dugtrio', moves: ['memento'] }, ], [ - {species: 'Marshtomp', moves: ['sleeptalk']}, - {species: 'Nincada', moves: ['sleeptalk']}, + { species: 'Marshtomp', moves: ['sleeptalk'] }, + { species: 'Nincada', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move acupressure -2, move memento 1', 'auto'); diff --git a/test/sim/moves/afteryou.js b/test/sim/moves/afteryou.js index c3ad5e5f94..342504e080 100644 --- a/test/sim/moves/afteryou.js +++ b/test/sim/moves/afteryou.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('After You', function () { - afterEach(function () { +describe('After You', () => { + afterEach(() => { battle.destroy(); }); - it(`should cause the targeted Pokemon to immediately move next`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', ability: 'prankster', moves: ['afteryou']}, - {species: 'Magnemite', level: 1, moves: ['magnetrise']}, + it(`should cause the targeted Pokemon to immediately move next`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', ability: 'prankster', moves: ['afteryou'] }, + { species: 'Magnemite', level: 1, moves: ['magnetrise'] }, ], [ - {species: 'Great Tusk', moves: ['headlongrush']}, - {species: "Magikarp", moves: ['sleeptalk']}, + { species: 'Great Tusk', moves: ['headlongrush'] }, + { species: "Magikarp", moves: ['sleeptalk'] }, ]]); battle.makeChoices('move afteryou -2, move magnetrise', 'move headlongrush 2, auto'); @@ -24,13 +24,13 @@ describe('After You', function () { assert.false.fainted(magnemite); }); - it(`should only cause the target to move next, not run a submove`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', ability: 'prankster', moves: ['afteryou']}, - {species: 'Necrozma', level: 50, ability: 'prankster', moves: ['photongeyser']}, + it(`should only cause the target to move next, not run a submove`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', ability: 'prankster', moves: ['afteryou'] }, + { species: 'Necrozma', level: 50, ability: 'prankster', moves: ['photongeyser'] }, ], [ - {species: 'Dugtrio', moves: ['sleeptalk']}, - {species: 'Roggenrola', level: 1, ability: 'sturdy', moves: ['sleeptalk']}, + { species: 'Dugtrio', moves: ['sleeptalk'] }, + { species: 'Roggenrola', level: 1, ability: 'sturdy', moves: ['sleeptalk'] }, ]]); // Photon Geyser has a mechanic where it ignores abilities with Mold Breaker, @@ -41,15 +41,15 @@ describe('After You', function () { assert.fainted(roggenrola); }); - it(`should work in a free-for-all`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'Wynaut', ability: 'prankster', moves: ['afteryou']}, + it(`should work in a free-for-all`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'Wynaut', ability: 'prankster', moves: ['afteryou'] }, ], [ - {species: 'Magnemite', level: 1, moves: ['magnetrise']}, + { species: 'Magnemite', level: 1, moves: ['magnetrise'] }, ], [ - {species: 'Great Tusk', moves: ['headlongrush']}, + { species: 'Great Tusk', moves: ['headlongrush'] }, ], [ - {species: 'Magikarp', moves: ['sleeptalk']}, + { species: 'Magikarp', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move afteryou 1', 'move magnetrise', 'move headlongrush 1', 'auto'); @@ -57,11 +57,11 @@ describe('After You', function () { assert.false.fainted(magnemite); }); - it(`should fail in singles whether the user is faster or slower than its target`, function () { + it(`should fail in singles whether the user is faster or slower than its target`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['afteryou', 'ember']}, + { species: 'Wynaut', moves: ['afteryou', 'ember'] }, ], [ - {species: 'Tyrogue', moves: ['afteryou', 'seismictoss']}, + { species: 'Tyrogue', moves: ['afteryou', 'seismictoss'] }, ]]); battle.makeChoices('move afteryou', 'move seismictoss'); diff --git a/test/sim/moves/allyswitch.js b/test/sim/moves/allyswitch.js index eb65f50800..8b0d9be0ae 100644 --- a/test/sim/moves/allyswitch.js +++ b/test/sim/moves/allyswitch.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe(`Ally Switch`, function () { - afterEach(function () { +describe(`Ally Switch`, () => { + afterEach(() => { battle.destroy(); }); - it(`should cause the Pokemon to switch sides in a double battle`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Primeape', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['allyswitch']}, + it(`should cause the Pokemon to switch sides in a double battle`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Primeape', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['allyswitch'] }, ], [ - {species: 'Dreepy', moves: ['sleeptalk']}, - {species: 'Pichu', moves: ['sleeptalk']}, + { species: 'Dreepy', moves: ['sleeptalk'] }, + { species: 'Pichu', moves: ['sleeptalk'] }, ]]); let wynaut = battle.p1.active[1]; @@ -27,15 +27,15 @@ describe(`Ally Switch`, function () { assert.species(wynaut, 'Wynaut'); }); - it(`should not work if the user is in the center of a Triple Battle`, function () { - battle = common.gen(6).createBattle({gameType: 'triples'}, [[ - {species: 'Primeape', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['allyswitch']}, - {species: 'Shaymin', moves: ['sleeptalk']}, + it(`should not work if the user is in the center of a Triple Battle`, () => { + battle = common.gen(6).createBattle({ gameType: 'triples' }, [[ + { species: 'Primeape', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['allyswitch'] }, + { species: 'Shaymin', moves: ['sleeptalk'] }, ], [ - {species: 'Murkrow', moves: ['sleeptalk']}, - {species: 'Pichu', moves: ['sleeptalk']}, - {species: 'Skrelp', moves: ['sleeptalk']}, + { species: 'Murkrow', moves: ['sleeptalk'] }, + { species: 'Pichu', moves: ['sleeptalk'] }, + { species: 'Skrelp', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -43,15 +43,15 @@ describe(`Ally Switch`, function () { assert.species(wynaut, 'Wynaut'); }); - it(`should swap Pokemon on the edges of a Triple Battle`, function () { - battle = common.gen(6).createBattle({gameType: 'triples'}, [[ - {species: 'Wynaut', moves: ['allyswitch']}, - {species: 'Primeape', moves: ['sleeptalk']}, - {species: 'Shaymin', moves: ['sleeptalk']}, + it(`should swap Pokemon on the edges of a Triple Battle`, () => { + battle = common.gen(6).createBattle({ gameType: 'triples' }, [[ + { species: 'Wynaut', moves: ['allyswitch'] }, + { species: 'Primeape', moves: ['sleeptalk'] }, + { species: 'Shaymin', moves: ['sleeptalk'] }, ], [ - {species: 'Murkrow', moves: ['sleeptalk']}, - {species: 'Pichu', moves: ['sleeptalk']}, - {species: 'Skrelp', moves: ['sleeptalk']}, + { species: 'Murkrow', moves: ['sleeptalk'] }, + { species: 'Pichu', moves: ['sleeptalk'] }, + { species: 'Skrelp', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -59,50 +59,50 @@ describe(`Ally Switch`, function () { assert.species(wynaut, 'Wynaut'); }); - it(`should not work in formats where you do not control allies`, function () { + it(`should not work in formats where you do not control allies`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['allyswitch']}, + { species: 'Wynaut', moves: ['allyswitch'] }, ], [ - {species: 'Pichu', moves: ['swordsdance']}, + { species: 'Pichu', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.includes('|-fail|')), `It should fail in singles`); - battle = common.createBattle({gameType: 'multi'}, [[ - {species: 'Wynaut', moves: ['allyswitch']}, + battle = common.createBattle({ gameType: 'multi' }, [[ + { species: 'Wynaut', moves: ['allyswitch'] }, ], [ - {species: 'Cubone', moves: ['swordsdance']}, + { species: 'Cubone', moves: ['swordsdance'] }, ], [ - {species: 'Marowak', moves: ['swordsdance']}, + { species: 'Marowak', moves: ['swordsdance'] }, ], [ - {species: 'Shaymin', moves: ['swordsdance']}, + { species: 'Shaymin', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.includes('|-fail|')), `It should fail in multis`); - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'wynaut', moves: ['allyswitch']}, + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'wynaut', moves: ['allyswitch'] }, ], [ - {species: 'scyther', moves: ['swordsdance']}, + { species: 'scyther', moves: ['swordsdance'] }, ], [ - {species: 'scizor', moves: ['swordsdance']}, + { species: 'scizor', moves: ['swordsdance'] }, ], [ - {species: 'shaymin', moves: ['swordsdance']}, + { species: 'shaymin', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.includes('|-fail|')), `It should fail in FFAs`); }); - it(`should have a chance to fail when used successively`, function () { - battle = common.createBattle({gameType: 'doubles', forceRandomChance: false}, [[ - {species: 'Primeape', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['allyswitch']}, + it(`should have a chance to fail when used successively`, () => { + battle = common.createBattle({ gameType: 'doubles', forceRandomChance: false }, [[ + { species: 'Primeape', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['allyswitch'] }, ], [ - {species: 'Dreepy', moves: ['sleeptalk']}, - {species: 'Pichu', moves: ['sleeptalk']}, + { species: 'Dreepy', moves: ['sleeptalk'] }, + { species: 'Pichu', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -112,13 +112,13 @@ describe(`Ally Switch`, function () { assert.species(wynaut, 'Wynaut'); }); - it(`[Gen 8] should not have a chance to fail when used successively`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles', forceRandomChance: false}, [[ - {species: 'Primeape', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['allyswitch']}, + it(`[Gen 8] should not have a chance to fail when used successively`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles', forceRandomChance: false }, [[ + { species: 'Primeape', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['allyswitch'] }, ], [ - {species: 'Dreepy', moves: ['sleeptalk']}, - {species: 'Pichu', moves: ['sleeptalk']}, + { species: 'Dreepy', moves: ['sleeptalk'] }, + { species: 'Pichu', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -128,13 +128,13 @@ describe(`Ally Switch`, function () { assert.species(wynaut, 'Wynaut'); }); - it(`should not use the protection counter when determining if the move should fail`, function () { - battle = common.createBattle({gameType: 'doubles', forceRandomChance: false}, [[ - {species: 'Primeape', moves: ['calmmind']}, - {species: 'Wynaut', moves: ['allyswitch', 'protect']}, + it(`should not use the protection counter when determining if the move should fail`, () => { + battle = common.createBattle({ gameType: 'doubles', forceRandomChance: false }, [[ + { species: 'Primeape', moves: ['calmmind'] }, + { species: 'Wynaut', moves: ['allyswitch', 'protect'] }, ], [ - {species: 'Dreepy', moves: ['calmmind']}, - {species: 'Pichu', moves: ['calmmind']}, + { species: 'Dreepy', moves: ['calmmind'] }, + { species: 'Pichu', moves: ['calmmind'] }, ]]); battle.makeChoices('move calmmind, move allyswitch', 'auto'); diff --git a/test/sim/moves/assist.js b/test/sim/moves/assist.js index 42c63fb5dd..f8609ae4a2 100644 --- a/test/sim/moves/assist.js +++ b/test/sim/moves/assist.js @@ -5,36 +5,36 @@ const common = require('./../../common'); let battle; -describe(`[Gen 4] Assist`, function () { - afterEach(function () { +describe(`[Gen 4] Assist`, () => { + afterEach(() => { battle.destroy(); }); - it(`should never call moves that would fail under Gravity`, function () { + it(`should never call moves that would fail under Gravity`, () => { battle = common.gen(4).createBattle([[ - {species: 'furret', moves: ['assist']}, - {species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash']}, - {species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash']}, - {species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash']}, - {species: 'smeargle', moves: ['doubleteam', 'fly', 'highjumpkick', 'splash']}, - {species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash']}, + { species: 'furret', moves: ['assist'] }, + { species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash'] }, + { species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash'] }, + { species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash'] }, + { species: 'smeargle', moves: ['doubleteam', 'fly', 'highjumpkick', 'splash'] }, + { species: 'smeargle', moves: ['bounce', 'fly', 'highjumpkick', 'splash'] }, ], [ - {species: 'deoxys', moves: ['gravity']}, + { species: 'deoxys', moves: ['gravity'] }, ]]); for (let i = 0; i < 5; i++) battle.makeChoices(); assert.statStage(battle.p1.active[0], 'evasion', 5); }); - it(`should never call moves that would fail under Heal Block`, function () { + it(`should never call moves that would fail under Heal Block`, () => { battle = common.gen(4).createBattle([[ - {species: 'furret', moves: ['assist']}, - {species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish']}, - {species: 'smeargle', moves: ['recover', 'rest', 'doubleteam', 'wish']}, - {species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish']}, - {species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish']}, - {species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish']}, + { species: 'furret', moves: ['assist'] }, + { species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish'] }, + { species: 'smeargle', moves: ['recover', 'rest', 'doubleteam', 'wish'] }, + { species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish'] }, + { species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish'] }, + { species: 'smeargle', moves: ['recover', 'rest', 'roost', 'wish'] }, ], [ - {species: 'latios', moves: ['healblock']}, + { species: 'latios', moves: ['healblock'] }, ]]); for (let i = 0; i < 5; i++) battle.makeChoices(); assert.statStage(battle.p1.active[0], 'evasion', 5); diff --git a/test/sim/moves/assurance.js b/test/sim/moves/assurance.js index 2ec2562f19..fb04655c79 100644 --- a/test/sim/moves/assurance.js +++ b/test/sim/moves/assurance.js @@ -5,33 +5,33 @@ const common = require('./../../common'); let battle; -describe('Assurance', function () { - afterEach(function () { +describe('Assurance', () => { + afterEach(() => { battle.destroy(); }); - it(`should double its base power if the target already took damage this turn`, function () { + it(`should double its base power if the target already took damage this turn`, () => { battle = common.createBattle([[ - {species: 'Sneasel', ability: 'sturdy', moves: ['assurance']}, + { species: 'Sneasel', ability: 'sturdy', moves: ['assurance'] }, ], [ - {species: 'Regieleki', ability: 'shellarmor', moves: ['wildcharge']}, + { species: 'Regieleki', ability: 'shellarmor', moves: ['wildcharge'] }, ]]); const sneasel = battle.p1.active[0]; const regi = battle.p2.active[0]; - regi.boostBy({atk: 6}); + regi.boostBy({ atk: 6 }); battle.makeChoices(); const recoil = Math.floor((sneasel.maxhp - 1) / 4); const assuRange = [214, 253]; assert.bounded(regi.hp, [regi.maxhp - recoil - assuRange[1], regi.maxhp - recoil - assuRange[0]]); }); - it(`should double the power against damaged Pokemon, not damaged slots`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'bulbasaur', level: 1, moves: ['sleeptalk']}, - {species: 'landorus', moves: ['sleeptalk']}, + it(`should double the power against damaged Pokemon, not damaged slots`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'bulbasaur', level: 1, moves: ['sleeptalk'] }, + { species: 'landorus', moves: ['sleeptalk'] }, ], [ - {species: 'alakazam', moves: ['psychic']}, - {species: 'pawniard', moves: ['assurance']}, + { species: 'alakazam', moves: ['psychic'] }, + { species: 'pawniard', moves: ['assurance'] }, ]]); battle.makeChoices('auto', 'move psychic 1, move assurance 1'); const landorus = battle.p1.active[1]; @@ -39,11 +39,11 @@ describe('Assurance', function () { assert.bounded(damage, [63, 75]); // 60 BP; if it was 120 BP, it would be 124-147 damage }); - it(`should not double its base power if the target lost HP due to Pain Split`, function () { + it(`should not double its base power if the target lost HP due to Pain Split`, () => { battle = common.createBattle([[ - {species: 'Greedent', moves: ['assurance']}, + { species: 'Greedent', moves: ['assurance'] }, ], [ - {species: 'Wailord', moves: ['painsplit']}, + { species: 'Wailord', moves: ['painsplit'] }, ]]); battle.makeChoices(); const greedent = battle.p1.active[0]; diff --git a/test/sim/moves/aurawheel.js b/test/sim/moves/aurawheel.js index 38b68ab8b7..fd31ab09ac 100644 --- a/test/sim/moves/aurawheel.js +++ b/test/sim/moves/aurawheel.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Aura Wheel', function () { - afterEach(function () { +describe('Aura Wheel', () => { + afterEach(() => { battle.destroy(); }); - it('should change types based on Morpeko forme', function () { + it('should change types based on Morpeko forme', () => { battle = common.createBattle([ - [{species: 'Morpeko', ability: 'hungerswitch', moves: ['aurawheel']}], - [{species: 'Rhyperior', ability: 'solidrock', moves: ['stealthrock']}], + [{ species: 'Morpeko', ability: 'hungerswitch', moves: ['aurawheel'] }], + [{ species: 'Rhyperior', ability: 'solidrock', moves: ['stealthrock'] }], ]); battle.makeChoices('move aurawheel', 'move stealthrock'); assert.fullHP(battle.p2.active[0]); diff --git a/test/sim/moves/batonpass.js b/test/sim/moves/batonpass.js index e439401bfe..d66a5f802b 100644 --- a/test/sim/moves/batonpass.js +++ b/test/sim/moves/batonpass.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe(`Baton Pass`, function () { - afterEach(function () { +describe(`Baton Pass`, () => { + afterEach(() => { battle.destroy(); }); - it(`should switch the user out, passing with it a variety of effects`, function () { + it(`should switch the user out, passing with it a variety of effects`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['focusenergy', 'substitute', 'swordsdance', 'batonpass']}, - {species: 'wingull', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['focusenergy', 'substitute', 'swordsdance', 'batonpass'] }, + { species: 'wingull', moves: ['sleeptalk'] }, ], [ - {species: 'pichu', ability: 'noguard', moves: ['leechseed']}, + { species: 'pichu', ability: 'noguard', moves: ['leechseed'] }, ]]); for (let i = 1; i < 5; i++) battle.makeChoices('move ' + i, 'auto'); battle.makeChoices('switch wingull'); @@ -27,21 +27,21 @@ describe(`Baton Pass`, function () { assert('leechseed' in wingull.volatiles); }); - it(`should fail to switch the user out if no Pokemon can be switched in`, function () { + it(`should fail to switch the user out if no Pokemon can be switched in`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['batonpass']}, + { species: 'wynaut', moves: ['batonpass'] }, ], [ - {species: 'pichu', moves: ['swordsdance']}, + { species: 'pichu', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-fail'))); - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['batonpass']}, - {species: 'pichu', moves: ['swordsdance']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['batonpass'] }, + { species: 'pichu', moves: ['swordsdance'] }, ], [ - {species: 'pichu', moves: ['swordsdance']}, - {species: 'pichu', moves: ['swordsdance']}, + { species: 'pichu', moves: ['swordsdance'] }, + { species: 'pichu', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-fail'))); diff --git a/test/sim/moves/belch.js b/test/sim/moves/belch.js index 5b802d8b74..229dc87f82 100644 --- a/test/sim/moves/belch.js +++ b/test/sim/moves/belch.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Belch', function () { - afterEach(function () { +describe('Belch', () => { + afterEach(() => { battle.destroy(); }); - it(`should be disabled if the user has not consumed a berry`, function () { + it(`should be disabled if the user has not consumed a berry`, () => { battle = common.createBattle([[ - {species: 'Swalot', item: 'lumberry', moves: ['belch', 'stockpile']}, + { species: 'Swalot', item: 'lumberry', moves: ['belch', 'stockpile'] }, ], [ - {species: 'Registeel', item: 'laggingtail', moves: ['glare']}, + { species: 'Registeel', item: 'laggingtail', moves: ['glare'] }, ]]); const swalot = battle.p1.active[0]; @@ -24,34 +24,34 @@ describe('Belch', function () { assert.equal(swalot.lastMove.id, 'belch'); }); - it('should count berries as consumed with Bug Bite or Pluck', function () { + it('should count berries as consumed with Bug Bite or Pluck', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Swalot', ability: 'gluttony', item: 'salacberry', moves: ['belch', 'bugbite']}]}); - battle.setPlayer('p2', {team: [{species: 'Swalot', ability: 'gluttony', item: 'salacberry', moves: ['belch', 'pluck']}]}); + battle.setPlayer('p1', { team: [{ species: 'Swalot', ability: 'gluttony', item: 'salacberry', moves: ['belch', 'bugbite'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Swalot', ability: 'gluttony', item: 'salacberry', moves: ['belch', 'pluck'] }] }); battle.makeChoices('move Bugbite', 'move Pluck'); battle.makeChoices('move Belch', 'move Belch'); assert.equal(battle.p1.active[0].lastMove.id, 'belch'); assert.equal(battle.p2.active[0].lastMove.id, 'belch'); }); - it('should count berries as consumed when they are Flung', function () { + it('should count berries as consumed when they are Flung', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Swalot', ability: 'gluttony', moves: ['belch', 'stockpile']}]}); - battle.setPlayer('p2', {team: [{species: 'Machamp', ability: 'noguard', item: 'salacberry', moves: ['fling']}]}); + battle.setPlayer('p1', { team: [{ species: 'Swalot', ability: 'gluttony', moves: ['belch', 'stockpile'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Machamp', ability: 'noguard', item: 'salacberry', moves: ['fling'] }] }); battle.makeChoices('move Stockpile', 'move Fling'); battle.makeChoices('move Belch', 'move Fling'); assert.equal(battle.p1.active[0].lastMove.id, 'belch'); }); - it('should still count berries as consumed after switch out', function () { + it('should still count berries as consumed after switch out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Swalot', item: 'lumberry', moves: ['belch', 'uturn']}, - {species: 'Swalot', moves: ['toxic']}, - ]}); - battle.setPlayer('p2', {team: [{ + battle.setPlayer('p1', { team: [ + { species: 'Swalot', item: 'lumberry', moves: ['belch', 'uturn'] }, + { species: 'Swalot', moves: ['toxic'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: 'Rotom', moves: ['rest', 'willowisp'], - }]}); + }] }); battle.makeChoices('move Uturn', 'move Will-o-Wisp'); battle.makeChoices('switch 2', ''); // For U-Turn battle.makeChoices('switch 2', 'move Will-o-Wisp'); diff --git a/test/sim/moves/bellydrum.js b/test/sim/moves/bellydrum.js index 20c05a4f01..6eacacf440 100644 --- a/test/sim/moves/bellydrum.js +++ b/test/sim/moves/bellydrum.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('Belly Drum', function () { +describe('Belly Drum', () => { afterEach(() => battle.destroy()); - it("should reduce the user's HP by half of their maximum HP, then boost their Attack to maximum", function () { + it("should reduce the user's HP by half of their maximum HP, then boost their Attack to maximum", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Linoone", ability: 'limber', moves: ['bellydrum']}]}); - battle.setPlayer('p2', {team: [{species: "Terrakion", ability: 'justified', moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [{ species: "Linoone", ability: 'limber', moves: ['bellydrum'] }] }); + battle.setPlayer('p2', { team: [{ species: "Terrakion", ability: 'justified', moves: ['bulkup'] }] }); const user = battle.p1.active[0]; battle.makeChoices('move bellydrum', 'move bulkup'); assert.equal(user.hp, Math.ceil(user.maxhp / 2)); assert.statStage(user, 'atk', 6); }); - it("should fail if the user's HP is less than half of their maximum HP", function () { + it("should fail if the user's HP is less than half of their maximum HP", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Linoone", ability: 'sturdy', moves: ['bellydrum']}]}); - battle.setPlayer('p2', {team: [{species: "Terrakion", ability: 'justified', moves: ['closecombat']}]}); + battle.setPlayer('p1', { team: [{ species: "Linoone", ability: 'sturdy', moves: ['bellydrum'] }] }); + battle.setPlayer('p2', { team: [{ species: "Terrakion", ability: 'justified', moves: ['closecombat'] }] }); const user = battle.p1.active[0]; battle.makeChoices('move bellydrum', 'move closecombat'); assert.equal(user.hp, 1); @@ -29,23 +29,23 @@ describe('Belly Drum', function () { }); }); -describe('Z-Belly Drum', function () { +describe('Z-Belly Drum', () => { afterEach(() => battle.destroy()); - it("should heal the user, then reduce their HP by half their max HP and boost the user's Attack to maximum", function () { + it("should heal the user, then reduce their HP by half their max HP and boost the user's Attack to maximum", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Linoone", ability: 'limber', item: 'normaliumz', moves: ['bellydrum']}]}); - battle.setPlayer('p2', {team: [{species: "Rattata", ability: 'guts', moves: ['quickattack']}]}); + battle.setPlayer('p1', { team: [{ species: "Linoone", ability: 'limber', item: 'normaliumz', moves: ['bellydrum'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rattata", ability: 'guts', moves: ['quickattack'] }] }); const user = battle.p1.active[0]; battle.makeChoices('move bellydrum zmove', 'move quickattack'); assert.equal(user.hp, Math.ceil(user.maxhp / 2)); assert.statStage(user, 'atk', 6); }); - it("should not fail even if the user's HP is less than half of their maximum HP", function () { + it("should not fail even if the user's HP is less than half of their maximum HP", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Linoone", ability: 'sturdy', item: 'normaliumz', moves: ['bellydrum']}]}); - battle.setPlayer('p2', {team: [{species: "Terrakion", ability: 'justified', moves: ['closecombat']}]}); + battle.setPlayer('p1', { team: [{ species: "Linoone", ability: 'sturdy', item: 'normaliumz', moves: ['bellydrum'] }] }); + battle.setPlayer('p2', { team: [{ species: "Terrakion", ability: 'justified', moves: ['closecombat'] }] }); const user = battle.p1.active[0]; battle.makeChoices('move bellydrum zmove', 'move closecombat'); assert.equal(user.hp, Math.ceil(user.maxhp / 2)); diff --git a/test/sim/moves/bide.js b/test/sim/moves/bide.js index f9102a2150..cdff20e1ad 100644 --- a/test/sim/moves/bide.js +++ b/test/sim/moves/bide.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('[Gen 1] Bide', function () { - afterEach(function () { +describe('[Gen 1] Bide', () => { + afterEach(() => { battle.destroy(); }); - it(`should be possible to roll two-turn Bide`, function () { - battle = common.gen(1).createBattle({seed: [0, 1, 1, 1]}, [[ - {species: 'Aerodactyl', moves: ['bide', 'whirlwind']}, + it(`should be possible to roll two-turn Bide`, () => { + battle = common.gen(1).createBattle({ seed: [0, 1, 1, 1] }, [[ + { species: 'Aerodactyl', moves: ['bide', 'whirlwind'] }, ], [ - {species: 'Gyarados', moves: ['dragonrage']}, + { species: 'Gyarados', moves: ['dragonrage'] }, ]]); const aerodactyl = battle.p1.active[0]; const gyarados = battle.p2.active[0]; @@ -32,11 +32,11 @@ describe('[Gen 1] Bide', function () { assert.equal(gyarados.maxhp - gyarados.hp, 160); }); - it(`should be possible to roll three-turn Bide`, function () { - battle = common.gen(1).createBattle({seed: [1, 1, 1, 1]}, [[ - {species: 'Aerodactyl', moves: ['bide']}, + it(`should be possible to roll three-turn Bide`, () => { + battle = common.gen(1).createBattle({ seed: [1, 1, 1, 1] }, [[ + { species: 'Aerodactyl', moves: ['bide'] }, ], [ - {species: 'Gyarados', moves: ['dragonrage']}, + { species: 'Gyarados', moves: ['dragonrage'] }, ]]); const aerodactyl = battle.p1.active[0]; const gyarados = battle.p2.active[0]; @@ -49,11 +49,11 @@ describe('[Gen 1] Bide', function () { assert.equal(gyarados.maxhp - gyarados.hp, 240); }); - it(`should damage Substitute with Bide damage`, function () { + it(`should damage Substitute with Bide damage`, () => { battle = common.gen(1).createBattle([[ - {species: 'Aerodactyl', moves: ['bide', 'whirlwind']}, + { species: 'Aerodactyl', moves: ['bide', 'whirlwind'] }, ], [ - {species: 'Gyarados', moves: ['dragonrage', 'substitute']}, + { species: 'Gyarados', moves: ['dragonrage', 'substitute'] }, ]]); const aerodactyl = battle.p1.active[0]; @@ -67,12 +67,12 @@ describe('[Gen 1] Bide', function () { assert.false(gyarados.volatiles['substitute']); }); - it(`should accumulate damage as the opponent switches or uses moves that don't reset lastDamage`, function () { + it(`should accumulate damage as the opponent switches or uses moves that don't reset lastDamage`, () => { battle = common.gen(1).createBattle([[ - {species: 'Aerodactyl', moves: ['bide']}, + { species: 'Aerodactyl', moves: ['bide'] }, ], [ - {species: 'Gyarados', moves: ['dragonrage', 'splash']}, - {species: 'Exeggutor', moves: ['barrage']}, + { species: 'Gyarados', moves: ['dragonrage', 'splash'] }, + { species: 'Exeggutor', moves: ['barrage'] }, ]]); const aerodactyl = battle.p1.active[0]; @@ -86,12 +86,12 @@ describe('[Gen 1] Bide', function () { assert.equal(exeggutor.maxhp - exeggutor.hp, 240); }); - it(`should zero out accumulated damage when an enemy faints (Desync Clause Mod)`, function () { + it(`should zero out accumulated damage when an enemy faints (Desync Clause Mod)`, () => { battle = common.gen(1).createBattle([[ - {species: 'Aerodactyl', moves: ['bide']}, + { species: 'Aerodactyl', moves: ['bide'] }, ], [ - {species: 'Gyarados', moves: ['dragonrage', 'leer']}, - {species: 'Exeggutor', moves: ['barrage']}, + { species: 'Gyarados', moves: ['dragonrage', 'leer'] }, + { species: 'Exeggutor', moves: ['barrage'] }, ]]); const aerodactyl = battle.p1.active[0]; @@ -112,11 +112,11 @@ describe('[Gen 1] Bide', function () { assert(battle.log.some(line => line.includes('Desync Clause Mod activated'))); }); - it(`should pause Bide's duration when asleep or frozen`, function () { + it(`should pause Bide's duration when asleep or frozen`, () => { battle = common.gen(1).createBattle([[ - {species: 'Aerodactyl', moves: ['bide']}, + { species: 'Aerodactyl', moves: ['bide'] }, ], [ - {species: 'Parasect', moves: ['spore']}, + { species: 'Parasect', moves: ['spore'] }, ]]); const aerodactyl = battle.p1.active[0]; @@ -128,11 +128,11 @@ describe('[Gen 1] Bide', function () { } }); - it(`should pause Bide's duration when disabled`, function () { - battle = common.gen(1).createBattle({seed: [1, 1, 1, 0]}, [[ - {species: 'Aerodactyl', moves: ['bide', 'whirlwind']}, + it(`should pause Bide's duration when disabled`, () => { + battle = common.gen(1).createBattle({ seed: [1, 1, 1, 0] }, [[ + { species: 'Aerodactyl', moves: ['bide', 'whirlwind'] }, ], [ - {species: 'Voltorb', moves: ['disable']}, + { species: 'Voltorb', moves: ['disable'] }, ]]); const aerodactyl = battle.p1.active[0]; diff --git a/test/sim/moves/boomburst.js b/test/sim/moves/boomburst.js index a07bccedae..ef8e935e74 100644 --- a/test/sim/moves/boomburst.js +++ b/test/sim/moves/boomburst.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Boomburst', function () { - afterEach(function () { +describe('Boomburst', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'boomburst']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'boomburst'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move boomburst', 'move rest'); assert.equal(battle.p2.active[0].item, ''); diff --git a/test/sim/moves/brickbreak.js b/test/sim/moves/brickbreak.js index d47cd6fbc8..000ced2dc8 100644 --- a/test/sim/moves/brickbreak.js +++ b/test/sim/moves/brickbreak.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Brick Break', function () { - afterEach(function () { +describe('Brick Break', () => { + afterEach(() => { battle.destroy(); }); - it('should break Reflect', function () { + it('should break Reflect', () => { battle = common.createBattle([[ - {species: "mew", moves: ['brickbreak', 'splash']}, + { species: "mew", moves: ['brickbreak', 'splash'] }, ], [ - {species: "ninjask", moves: ['reflect', 'splash']}, + { species: "ninjask", moves: ['reflect', 'splash'] }, ]]); battle.makeChoices('move splash', 'move reflect'); @@ -24,11 +24,11 @@ describe('Brick Break', function () { assert.false(battle.p2.sideConditions['reflect']); }); - it('should not break Reflect when used against a Ghost-type', function () { + it('should not break Reflect when used against a Ghost-type', () => { battle = common.createBattle([[ - {species: "mew", moves: ['brickbreak', 'splash']}, + { species: "mew", moves: ['brickbreak', 'splash'] }, ], [ - {species: "gengar", moves: ['reflect', 'splash']}, + { species: "gengar", moves: ['reflect', 'splash'] }, ]]); battle.makeChoices('move splash', 'move reflect'); @@ -38,11 +38,11 @@ describe('Brick Break', function () { assert(battle.p2.sideConditions['reflect']); }); - it.skip('should break Reflect when used against a Ghost-type in Gen 4 or earlier', function () { + it.skip('should break Reflect when used against a Ghost-type in Gen 4 or earlier', () => { battle = common.gen(4).createBattle([[ - {species: "mew", moves: ['brickbreak', 'splash']}, + { species: "mew", moves: ['brickbreak', 'splash'] }, ], [ - {species: "gengar", moves: ['reflect', 'splash']}, + { species: "gengar", moves: ['reflect', 'splash'] }, ]]); battle.makeChoices('move splash', 'move reflect'); @@ -52,11 +52,11 @@ describe('Brick Break', function () { assert.false(battle.p2.sideConditions['reflect']); }); - it('should break Reflect against a Ghost type whose type immunity is being ignored', function () { + it('should break Reflect against a Ghost type whose type immunity is being ignored', () => { battle = common.createBattle([[ - {species: "mew", moves: ['brickbreak', 'splash']}, + { species: "mew", moves: ['brickbreak', 'splash'] }, ], [ - {species: "gengar", item: "ringtarget", moves: ['reflect', 'splash']}, + { species: "gengar", item: "ringtarget", moves: ['reflect', 'splash'] }, ]]); battle.makeChoices('move splash', 'move reflect'); @@ -66,11 +66,11 @@ describe('Brick Break', function () { assert.false(battle.p2.sideConditions['reflect']); }); - it('should break Reflect against a Ghost type whose type immunity is being ignored', function () { + it('should break Reflect against a Ghost type whose type immunity is being ignored', () => { battle = common.createBattle([[ - {species: "mew", ability: "scrappy", moves: ['brickbreak', 'splash']}, + { species: "mew", ability: "scrappy", moves: ['brickbreak', 'splash'] }, ], [ - {species: "gengar", moves: ['reflect', 'splash']}, + { species: "gengar", moves: ['reflect', 'splash'] }, ]]); battle.makeChoices('move splash', 'move reflect'); @@ -80,11 +80,11 @@ describe('Brick Break', function () { assert.false(battle.p2.sideConditions['reflect']); }); - it('should break Reflect against a Ghost type if it has been electrified', function () { + it('should break Reflect against a Ghost type if it has been electrified', () => { battle = common.createBattle([[ - {species: "mew", moves: ['brickbreak', 'splash']}, + { species: "mew", moves: ['brickbreak', 'splash'] }, ], [ - {species: "gengar", moves: ['reflect', 'electrify']}, + { species: "gengar", moves: ['reflect', 'electrify'] }, ]]); battle.makeChoices('move splash', 'move reflect'); @@ -94,13 +94,13 @@ describe('Brick Break', function () { assert.false(battle.p2.sideConditions['reflect']); }); - it(`should break the foe's Reflect when used against an ally in Gen 3`, function () { - battle = common.gen(3).createBattle({gameType: 'doubles'}, [[ - {species: "mew", moves: ['brickbreak', 'splash']}, - {species: "mew", moves: ['splash']}, + it(`should break the foe's Reflect when used against an ally in Gen 3`, () => { + battle = common.gen(3).createBattle({ gameType: 'doubles' }, [[ + { species: "mew", moves: ['brickbreak', 'splash'] }, + { species: "mew", moves: ['splash'] }, ], [ - {species: "gengar", moves: ['reflect', 'splash']}, - {species: "gengar", moves: ['splash']}, + { species: "gengar", moves: ['reflect', 'splash'] }, + { species: "gengar", moves: ['splash'] }, ]]); battle.makeChoices('move splash, move splash', 'move reflect, move splash'); diff --git a/test/sim/moves/bugbuzz.js b/test/sim/moves/bugbuzz.js index a014eebd84..0f58bf88ad 100644 --- a/test/sim/moves/bugbuzz.js +++ b/test/sim/moves/bugbuzz.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Bug Buzz', function () { - afterEach(function () { +describe('Bug Buzz', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'bugbuzz']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'bugbuzz'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move bugbuzz', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); }); -describe('Bug Buzz [Gen 5]', function () { - afterEach(function () { +describe('Bug Buzz [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'bugbuzz']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'bugbuzz'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move bugbuzz', 'move rest'); diff --git a/test/sim/moves/burningbulwark.js b/test/sim/moves/burningbulwark.js index c6e46609e9..4207360230 100644 --- a/test/sim/moves/burningbulwark.js +++ b/test/sim/moves/burningbulwark.js @@ -5,31 +5,31 @@ const common = require('../../common'); let battle; -describe('Burning Bulwark', function () { +describe('Burning Bulwark', () => { afterEach(() => battle.destroy()); - it(`should burn the user of a contact move`, function () { + it(`should burn the user of a contact move`, () => { battle = common.createBattle([ - [{species: "Gallade", ability: 'justified', moves: ['tackle']}], - [{species: "Entei", ability: 'innerfocus', moves: ['burningbulwark']}], + [{ species: "Gallade", ability: 'justified', moves: ['tackle'] }], + [{ species: "Entei", ability: 'innerfocus', moves: ['burningbulwark'] }], ]); battle.makeChoices(); assert.equal(battle.p1.active[0].status, 'brn', 'Gallade should be burned when using contact move'); }); - it(`should not burn the user of a contact move if user has protective pads`, function () { + it(`should not burn the user of a contact move if user has protective pads`, () => { battle = common.createBattle([ - [{species: "Gallade", item: 'protectivepads', ability: 'justified', moves: ['tackle']}], - [{species: "Entei", ability: 'innerfocus', moves: ['burningbulwark']}], + [{ species: "Gallade", item: 'protectivepads', ability: 'justified', moves: ['tackle'] }], + [{ species: "Entei", ability: 'innerfocus', moves: ['burningbulwark'] }], ]); battle.makeChoices(); assert.equal(battle.p1.active[0].status, '', 'Gallade should not be burned when using contact move due to protective pads'); }); - it(`should not burn the user of a non-contact move`, function () { + it(`should not burn the user of a non-contact move`, () => { battle = common.createBattle([ - [{species: "Ogerpon-Wellspring", ability: 'Water Absorb', moves: ['ivycudgel']}], - [{species: "Entei", ability: 'innerfocus', moves: ['burningbulwark']}], + [{ species: "Ogerpon-Wellspring", ability: 'Water Absorb', moves: ['ivycudgel'] }], + [{ species: "Entei", ability: 'innerfocus', moves: ['burningbulwark'] }], ]); battle.makeChoices(); assert.equal(battle.p1.active[0].status, '', 'Ogerpon-Wellspring should not be burned when using non-contact move'); diff --git a/test/sim/moves/burningjealousy.js b/test/sim/moves/burningjealousy.js index baf0dfd5b6..6b3613d7a3 100644 --- a/test/sim/moves/burningjealousy.js +++ b/test/sim/moves/burningjealousy.js @@ -5,47 +5,47 @@ const common = require('./../../common'); let battle; -describe('Burning Jealousy', function () { - afterEach(function () { +describe('Burning Jealousy', () => { + afterEach(() => { battle.destroy(); }); - it(`should burn a target whose stats were raised this turn`, function () { + it(`should burn a target whose stats were raised this turn`, () => { battle = common.createBattle([[ - {species: 'Mew', moves: ['dragondance']}, + { species: 'Mew', moves: ['dragondance'] }, ], [ - {species: 'Torkoal', moves: ['burningjealousy']}, + { species: 'Torkoal', moves: ['burningjealousy'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].status, 'brn'); }); - it(`should not burn a target whose stats were raised after the attack`, function () { + it(`should not burn a target whose stats were raised after the attack`, () => { battle = common.createBattle([[ - {species: 'Ninetales', moves: ['burningjealousy']}, + { species: 'Ninetales', moves: ['burningjealousy'] }, ], [ - {species: 'Magearna', item: 'weaknesspolicy', moves: ['imprison']}, + { species: 'Magearna', item: 'weaknesspolicy', moves: ['imprison'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].status, ''); }); - it(`should burn a target whose stats were boosted at the start of the match`, function () { + it(`should burn a target whose stats were boosted at the start of the match`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['burningjealousy']}, + { species: 'Wynaut', moves: ['burningjealousy'] }, ], [ - {species: 'Porygon', ability: 'download', moves: ['sleeptalk']}, + { species: 'Porygon', ability: 'download', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].status, 'brn'); }); - it(`should not burn a target whose stats were boosted at a switch after a KO`, function () { + it(`should not burn a target whose stats were boosted at a switch after a KO`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['burningjealousy']}, + { species: 'Wynaut', moves: ['burningjealousy'] }, ], [ - {species: 'Porygon', ability: 'download', moves: ['memento']}, - {species: 'Porygon2', ability: 'download', moves: ['sleeptalk']}, + { species: 'Porygon', ability: 'download', moves: ['memento'] }, + { species: 'Porygon2', ability: 'download', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -53,11 +53,11 @@ describe('Burning Jealousy', function () { assert.equal(battle.p2.active[0].status, ''); }); - it(`should be affected by Sheer Force`, function () { + it(`should be affected by Sheer Force`, () => { battle = common.createBattle([[ - {species: 'Cobalion', moves: ['swordsdance']}, + { species: 'Cobalion', moves: ['swordsdance'] }, ], [ - {species: 'Darmanitan', ability: 'sheerforce', item: 'kingsrock', moves: ['burningjealousy']}, + { species: 'Darmanitan', ability: 'sheerforce', item: 'kingsrock', moves: ['burningjealousy'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].status, ''); diff --git a/test/sim/moves/camouflage.js b/test/sim/moves/camouflage.js index 29fd783919..37abc3f5d7 100644 --- a/test/sim/moves/camouflage.js +++ b/test/sim/moves/camouflage.js @@ -5,47 +5,47 @@ const common = require('./../../common'); let battle; -describe('Camouflage', function () { - afterEach(function () { +describe('Camouflage', () => { + afterEach(() => { battle.destroy(); }); - it('should change the user to Normal-type (except in Generation V, to Ground-type)', function () { + it('should change the user to Normal-type (except in Generation V, to Ground-type)', () => { battle = common.gen(7).createBattle([[ - {species: 'wynaut', moves: ['camouflage']}, + { species: 'wynaut', moves: ['camouflage'] }, ], [ - {species: 'ralts', moves: ['sleeptalk']}, + { species: 'ralts', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].types[0], 'Normal'); battle = common.gen(4).createBattle([[ - {species: 'wynaut', moves: ['camouflage']}, + { species: 'wynaut', moves: ['camouflage'] }, ], [ - {species: 'ralts', moves: ['sleeptalk']}, + { species: 'ralts', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].types[0], 'Normal'); battle = common.gen(5).createBattle([[ - {species: 'wynaut', moves: ['camouflage']}, + { species: 'wynaut', moves: ['camouflage'] }, ], [ - {species: 'ralts', moves: ['sleeptalk']}, + { species: 'ralts', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].types[0], 'Ground'); }); - it('should fail on Multitype in Gen 4 and Arceus itself in Gen 5+', function () { + it('should fail on Multitype in Gen 4 and Arceus itself in Gen 5+', () => { // Gen 4 battle = common.gen(4).createBattle([[ - {species: 'arceus', ability: 'flashfire', moves: ['ember', 'conversion', 'camouflage']}, - {species: 'goldeen', ability: 'multitype', moves: ['camouflage']}, + { species: 'arceus', ability: 'flashfire', moves: ['ember', 'conversion', 'camouflage'] }, + { species: 'goldeen', ability: 'multitype', moves: ['camouflage'] }, ], [ - {species: 'feebas', moves: ['sleeptalk']}, + { species: 'feebas', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move conversion', 'auto'); @@ -58,10 +58,10 @@ describe('Camouflage', function () { // Gen 5 battle = common.gen(5).createBattle([[ - {species: 'arceus', ability: 'flashfire', moves: ['camouflage']}, - {species: 'goldeen', ability: 'multitype', moves: ['camouflage']}, + { species: 'arceus', ability: 'flashfire', moves: ['camouflage'] }, + { species: 'goldeen', ability: 'multitype', moves: ['camouflage'] }, ], [ - {species: 'ralts', moves: ['sleeptalk']}, + { species: 'ralts', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -72,12 +72,12 @@ describe('Camouflage', function () { assert.equal(battle.p1.active[0].types[0], 'Ground'); }); - it('should fail in Gen 3-4 if the user already has what Camouflage would change to as either of its types', function () { + it('should fail in Gen 3-4 if the user already has what Camouflage would change to as either of its types', () => { // Gen 4 battle = common.gen(4).createBattle([[ - {species: 'pidgey', moves: ['camouflage']}, + { species: 'pidgey', moves: ['camouflage'] }, ], [ - {species: 'ralts', moves: ['sleeptalk']}, + { species: 'ralts', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -85,9 +85,9 @@ describe('Camouflage', function () { // Gen 5 battle = common.gen(5).createBattle([[ - {species: 'gligar', moves: ['camouflage']}, + { species: 'gligar', moves: ['camouflage'] }, ], [ - {species: 'ralts', moves: ['sleeptalk']}, + { species: 'ralts', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/ceaselessedge.js b/test/sim/moves/ceaselessedge.js index 31d6d78c88..beb49d5543 100644 --- a/test/sim/moves/ceaselessedge.js +++ b/test/sim/moves/ceaselessedge.js @@ -7,29 +7,29 @@ let battle; // tests are derived from the following post and related quotes: // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9417627 -describe('Ceaseless Edge', function () { - afterEach(function () { +describe('Ceaseless Edge', () => { + afterEach(() => { battle.destroy(); }); - it(`should set up Spikes on the side of the opponent`, function () { + it(`should set up Spikes on the side of the opponent`, () => { battle = common.createBattle([[ - {species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge']}, + { species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge'] }, ], [ - {species: 'registeel', moves: ['splash']}, + { species: 'registeel', moves: ['splash'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.sideConditions.spikes?.layers, 1); }); - it(`should set up Spikes on the side of the opponent, not necessarily the target, in a double battle`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge']}, - {species: 'pikachu', moves: ['splash']}, + it(`should set up Spikes on the side of the opponent, not necessarily the target, in a double battle`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge'] }, + { species: 'pikachu', moves: ['splash'] }, ], [ - {species: 'squirtle', moves: ['splash']}, - {species: 'bulbasaur', moves: ['splash']}, + { species: 'squirtle', moves: ['splash'] }, + { species: 'bulbasaur', moves: ['splash'] }, ]]); battle.makeChoices('move ceaselessedge -2, move splash', 'move splash, move splash'); @@ -38,33 +38,33 @@ describe('Ceaseless Edge', function () { assert.equal(battle.p2.sideConditions.spikes?.layers, 1); }); - it(`should still set up Spikes on the side of the opponent that is behind a Substitute`, function () { + it(`should still set up Spikes on the side of the opponent that is behind a Substitute`, () => { battle = common.createBattle([[ - {species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge']}, + { species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge'] }, ], [ - {species: 'regieleki', moves: ['substitute']}, + { species: 'regieleki', moves: ['substitute'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.sideConditions.spikes?.layers, 1); }); - it(`should not set up Spikes if the move does not hit opponent or its Substitute`, function () { + it(`should not set up Spikes if the move does not hit opponent or its Substitute`, () => { battle = common.createBattle([[ - {species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge']}, + { species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge'] }, ], [ - {species: 'regieleki', moves: ['protect']}, + { species: 'regieleki', moves: ['protect'] }, ]]); battle.makeChoices(); assert.equal(!!(battle.p2.sideConditions.spikes), false); }); - it(`should not be bounced back by Magic Bounce`, function () { + it(`should not be bounced back by Magic Bounce`, () => { battle = common.createBattle([[ - {species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge']}, + { species: 'samurotthisui', ability: 'noguard', moves: ['ceaselessedge'] }, ], [ - {species: 'registeel', ability: 'magicbounce', moves: ['splash']}, + { species: 'registeel', ability: 'magicbounce', moves: ['splash'] }, ]]); battle.makeChoices(); @@ -72,23 +72,23 @@ describe('Ceaseless Edge', function () { assert.equal(battle.p2.sideConditions.spikes?.layers, 1); }); - it(`should have its Spikes prevented by Sheer Force`, function () { + it(`should have its Spikes prevented by Sheer Force`, () => { battle = common.createBattle([[ - {species: 'samurotthisui', ability: 'sheerforce', moves: ['ceaselessedge']}, + { species: 'samurotthisui', ability: 'sheerforce', moves: ['ceaselessedge'] }, ], [ - {species: 'registeel', ability: 'noguard', moves: ['splash']}, + { species: 'registeel', ability: 'noguard', moves: ['splash'] }, ]]); battle.makeChoices(); assert.equal(!!(battle.p2.sideConditions.spikes), false); }); - it(`should not set Spikes when the user faints from Rocky Helmet`, function () { + it(`should not set Spikes when the user faints from Rocky Helmet`, () => { battle = common.createBattle([[ - {species: 'samurotthisui', ability: 'noguard', item: 'focussash', moves: ['ceaselessedge']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'samurotthisui', ability: 'noguard', item: 'focussash', moves: ['ceaselessedge'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'regieleki', item: 'rockyhelmet', moves: ['sheercold']}, + { species: 'regieleki', item: 'rockyhelmet', moves: ['sheercold'] }, ]]); battle.makeChoices(); // Samurott will faint to the Rocky Helmet diff --git a/test/sim/moves/charge.js b/test/sim/moves/charge.js index 064f9d91aa..78fc361364 100644 --- a/test/sim/moves/charge.js +++ b/test/sim/moves/charge.js @@ -5,16 +5,16 @@ const common = require('../../common'); let battle; -describe('Charge', function () { - afterEach(function () { +describe('Charge', () => { + afterEach(() => { battle.destroy(); }); - it('should double the base power of the next Electric attack', function () { + it('should double the base power of the next Electric attack', () => { battle = common.createBattle([[ - {species: 'Kilowattrel', moves: ['charge', 'thunderbolt']}, + { species: 'Kilowattrel', moves: ['charge', 'thunderbolt'] }, ], [ - {species: 'Dondozo', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'Dondozo', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -22,11 +22,11 @@ describe('Charge', function () { assert.fainted(battle.p2.active[0]); }); - it('should remain active until an Electric-type attack is used', function () { + it('should remain active until an Electric-type attack is used', () => { battle = common.createBattle([[ - {species: 'Kilowattrel', moves: ['charge', 'agility', 'airslash', 'thunderbolt', 'naturepower']}, + { species: 'Kilowattrel', moves: ['charge', 'agility', 'airslash', 'thunderbolt', 'naturepower'] }, ], [ - {species: 'Baxcalibur', moves: ['sleeptalk', 'electricterrain']}, + { species: 'Baxcalibur', moves: ['sleeptalk', 'electricterrain'] }, ]]); battle.makeChoices(); @@ -41,11 +41,11 @@ describe('Charge', function () { assert.false(battle.p1.active[0].volatiles['charge']); }); - it('should wear off after an Electric-type status move that is not Charge is used', function () { + it('should wear off after an Electric-type status move that is not Charge is used', () => { battle = common.createBattle([[ - {species: 'Kilowattrel', moves: ['charge', 'thunderwave']}, + { species: 'Kilowattrel', moves: ['charge', 'thunderwave'] }, ], [ - {species: 'Baxcalibur', moves: ['sleeptalk']}, + { species: 'Baxcalibur', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -56,16 +56,16 @@ describe('Charge', function () { }); }); -describe('Charge [Gen 8]', function () { - afterEach(function () { +describe('Charge [Gen 8]', () => { + afterEach(() => { battle.destroy(); }); - it('should wear off after a move of any type is used', function () { + it('should wear off after a move of any type is used', () => { battle = common.gen(8).createBattle([[ - {species: 'Pikachu', moves: ['charge', 'tackle', 'thundershock']}, + { species: 'Pikachu', moves: ['charge', 'tackle', 'thundershock'] }, ], [ - {species: 'Dragapult', moves: ['sleeptalk']}, + { species: 'Dragapult', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/chatter.js b/test/sim/moves/chatter.js index 0e1a270f02..f9992d8189 100644 --- a/test/sim/moves/chatter.js +++ b/test/sim/moves/chatter.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Chatter', function () { - afterEach(function () { +describe('Chatter', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'chatter']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'chatter'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move chatter', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); }); -describe('Chatter [Gen 5]', function () { - afterEach(function () { +describe('Chatter [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'chatter']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'chatter'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move chatter', 'move rest'); diff --git a/test/sim/moves/chloroblast.js b/test/sim/moves/chloroblast.js index aeaaa453dc..1f7f119916 100644 --- a/test/sim/moves/chloroblast.js +++ b/test/sim/moves/chloroblast.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Chloroblast', function () { - afterEach(function () { +describe('Chloroblast', () => { + afterEach(() => { battle.destroy(); }); - it('should deal recoil damage to the user equal to half its max HP, rounded up', function () { + it('should deal recoil damage to the user equal to half its max HP, rounded up', () => { battle = common.createBattle([[ - {species: "Electrode-Hisui", item: 'widelens', moves: ['chloroblast']}, + { species: "Electrode-Hisui", item: 'widelens', moves: ['chloroblast'] }, ], [ - {species: "Blissey", moves: ['sleeptalk']}, + { species: "Blissey", moves: ['sleeptalk'] }, ]]); assert.hurtsBy(battle.p1.active[0], Math.round(battle.p1.active[0].maxhp / 2), () => battle.makeChoices()); }); - it('should not deal recoil damage to the user if it misses or is blocked by Protect', function () { + it('should not deal recoil damage to the user if it misses or is blocked by Protect', () => { battle = common.createBattle([[ - {species: "Electrode-Hisui", item: 'widelens', moves: ['chloroblast', 'protect']}, + { species: "Electrode-Hisui", item: 'widelens', moves: ['chloroblast', 'protect'] }, ], [ - {species: "Talonflame", ability: 'galewings', moves: ['fly', 'protect']}, + { species: "Talonflame", ability: 'galewings', moves: ['fly', 'protect'] }, ]]); battle.makeChoices('move chloroblast', 'move fly'); battle.makeChoices('move protect', 'auto'); @@ -31,21 +31,21 @@ describe('Chloroblast', function () { assert.fullHP(battle.p1.active[0]); }); - it('should have its recoil damage negated by Rock Head', function () { + it('should have its recoil damage negated by Rock Head', () => { battle = common.createBattle([[ - {species: "Electrode-Hisui", ability: 'rockhead', item: 'widelens', moves: ['chloroblast']}, + { species: "Electrode-Hisui", ability: 'rockhead', item: 'widelens', moves: ['chloroblast'] }, ], [ - {species: "Blissey", moves: ['sleeptalk']}, + { species: "Blissey", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p1.active[0]); }); - it('should not have its base power boosted by Reckless', function () { + it('should not have its base power boosted by Reckless', () => { battle = common.createBattle([[ - {species: "Electrode-Hisui", ability: 'reckless', item: 'widelens', moves: ['chloroblast']}, + { species: "Electrode-Hisui", ability: 'reckless', item: 'widelens', moves: ['chloroblast'] }, ], [ - {species: "Blissey", ability: 'shellarmor', moves: ['sleeptalk']}, + { species: "Blissey", ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const damage = battle.p2.active[0].maxhp - battle.p2.active[0].hp; diff --git a/test/sim/moves/clangoroussoulblaze.js b/test/sim/moves/clangoroussoulblaze.js index 482ed55849..a4dde0a99c 100644 --- a/test/sim/moves/clangoroussoulblaze.js +++ b/test/sim/moves/clangoroussoulblaze.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('Z-Moves', function () { - afterEach(function () { +describe('Z-Moves', () => { + afterEach(() => { battle.destroy(); }); - it(`should deal reduced damage to only protected targets`, function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Kommo-o', ability: 'overcoat', item: 'kommoniumz', moves: ['clangingscales']}, - {species: 'Pachirisu', ability: 'voltabsorb', moves: ['protect']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Turtonator', ability: 'shellarmor', moves: ['protect']}, - {species: 'Turtonator', ability: 'shellarmor', moves: ['sleeptalk']}, - ]}); + it(`should deal reduced damage to only protected targets`, () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Kommo-o', ability: 'overcoat', item: 'kommoniumz', moves: ['clangingscales'] }, + { species: 'Pachirisu', ability: 'voltabsorb', moves: ['protect'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Turtonator', ability: 'shellarmor', moves: ['protect'] }, + { species: 'Turtonator', ability: 'shellarmor', moves: ['sleeptalk'] }, + ] }); battle.makeChoices("move clangingscales zmove, move protect", "move protect, move sleeptalk"); assert.false.fullHP(battle.p2.active[0]); assert.false.fainted(battle.p2.active[0]); diff --git a/test/sim/moves/clearsmog.js b/test/sim/moves/clearsmog.js index 5b5382b5c6..6c3c9af189 100644 --- a/test/sim/moves/clearsmog.js +++ b/test/sim/moves/clearsmog.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Clear Smog', function () { - afterEach(function () { +describe('Clear Smog', () => { + afterEach(() => { battle.destroy(); }); - it('should remove all stat boosts from the target', function () { + it('should remove all stat boosts from the target', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Amoonguss", ability: 'regenerator', moves: ['clearsmog']}]}); - battle.setPlayer('p2', {team: [{species: "Sableye", ability: 'prankster', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: "Amoonguss", ability: 'regenerator', moves: ['clearsmog'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sableye", ability: 'prankster', moves: ['calmmind'] }] }); battle.makeChoices('move clearsmog', 'move calmmind'); @@ -21,10 +21,10 @@ describe('Clear Smog', function () { assert.equal(battle.p2.pokemon[0].boosts['spd'], 0); }); - it('should not remove stat boosts from a target behind a substitute', function () { + it('should not remove stat boosts from a target behind a substitute', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Amoonguss", ability: 'regenerator', moves: ['clearsmog', 'toxic']}]}); - battle.setPlayer('p2', {team: [{species: "Sableye", ability: 'prankster', moves: ['substitute', 'calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: "Amoonguss", ability: 'regenerator', moves: ['clearsmog', 'toxic'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sableye", ability: 'prankster', moves: ['substitute', 'calmmind'] }] }); battle.makeChoices('move toxic', 'move substitute'); battle.makeChoices('move clearsmog', 'move calmmind'); @@ -33,30 +33,30 @@ describe('Clear Smog', function () { assert.equal(battle.p2.pokemon[0].boosts['spd'], 1); }); - it('should not remove stat boosts if the target is immune to its attack type', function () { + it('should not remove stat boosts if the target is immune to its attack type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Amoonguss", ability: 'regenerator', item: 'laggingtail', moves: ['clearsmog']}]}); - battle.setPlayer('p2', {team: [{species: "Steelix", ability: 'prankster', moves: ['irondefense']}]}); + battle.setPlayer('p1', { team: [{ species: "Amoonguss", ability: 'regenerator', item: 'laggingtail', moves: ['clearsmog'] }] }); + battle.setPlayer('p2', { team: [{ species: "Steelix", ability: 'prankster', moves: ['irondefense'] }] }); battle.makeChoices('move clearsmog', 'move irondefense'); assert.equal(battle.p2.pokemon[0].boosts['def'], 2); }); - it('should not remove stat boosts from the user', function () { + it('should not remove stat boosts from the user', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Amoonguss", ability: 'regenerator', moves: ['clearsmog']}]}); - battle.setPlayer('p2', {team: [{species: "Arcanine", ability: 'intimidate', moves: ['morningsun']}]}); + battle.setPlayer('p1', { team: [{ species: "Amoonguss", ability: 'regenerator', moves: ['clearsmog'] }] }); + battle.setPlayer('p2', { team: [{ species: "Arcanine", ability: 'intimidate', moves: ['morningsun'] }] }); battle.makeChoices('move clearsmog', 'move morningsun'); assert.equal(battle.p1.pokemon[0].boosts['atk'], -1); }); - it('should trigger before Anger Point activates during critical hits', function () { + it('should trigger before Anger Point activates during critical hits', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Amoonguss", ability: 'regenerator', item: 'scopelens', moves: ['focusenergy', 'clearsmog']}]}); - battle.setPlayer('p2', {team: [{species: "Primeape", ability: 'angerpoint', moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [{ species: "Amoonguss", ability: 'regenerator', item: 'scopelens', moves: ['focusenergy', 'clearsmog'] }] }); + battle.setPlayer('p2', { team: [{ species: "Primeape", ability: 'angerpoint', moves: ['bulkup'] }] }); battle.makeChoices('move focusenergy', 'move bulkup'); assert.equal(battle.p2.pokemon[0].boosts['atk'], 1); diff --git a/test/sim/moves/conversion2.js b/test/sim/moves/conversion2.js index 1d7b24a1ff..08e5c78563 100644 --- a/test/sim/moves/conversion2.js +++ b/test/sim/moves/conversion2.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Conversion2', function () { - afterEach(function () { +describe('Conversion2', () => { + afterEach(() => { battle.destroy(); }); - it('should change users type to resist', function () { + it('should change users type to resist', () => { battle = common.createBattle([ - [{species: 'porygon2', moves: ['sleeptalk', 'conversion2', 'spore']}], - [{species: 'raticate', moves: ['tackle']}, - {species: 'zapdos', moves: ['thundershock', 'sleeptalk']}], + [{ species: 'porygon2', moves: ['sleeptalk', 'conversion2', 'spore'] }], + [{ species: 'raticate', moves: ['tackle'] }, + { species: 'zapdos', moves: ['thundershock', 'sleeptalk'] }], ]); battle.makeChoices('move conversion2', 'move tackle'); @@ -24,10 +24,10 @@ describe('Conversion2', function () { assert(['Electric', 'Grass', 'Ground', 'Dragon'].includes(battle.p1.active[0].getTypes()[0]), 'should change type based on submove'); }); - it('should respect the determined type of the last move', function () { + it('should respect the determined type of the last move', () => { battle = common.createBattle([ - [{species: 'porygon2', moves: ['electrify', 'conversion2']}], - [{species: 'shuckle', moves: ['tackle']}], + [{ species: 'porygon2', moves: ['electrify', 'conversion2'] }], + [{ species: 'shuckle', moves: ['tackle'] }], ]); battle.makeChoices('move electrify', 'move tackle'); diff --git a/test/sim/moves/copycat.js b/test/sim/moves/copycat.js index 00105ab834..aab9c5b149 100644 --- a/test/sim/moves/copycat.js +++ b/test/sim/moves/copycat.js @@ -5,16 +5,16 @@ const common = require('../../common'); let battle; -describe('Copycat', function () { - afterEach(function () { +describe('Copycat', () => { + afterEach(() => { battle.destroy(); }); - it('should be able to copy called moves', function () { + it('should be able to copy called moves', () => { battle = common.createBattle([[ - {species: 'riolu', ability: 'steadfast', moves: ['copycat']}, + { species: 'riolu', ability: 'steadfast', moves: ['copycat'] }, ], [ - {species: 'luxray', moves: ['eerieimpulse', 'roar']}, + { species: 'luxray', moves: ['eerieimpulse', 'roar'] }, ]]); battle.makeChoices(); @@ -22,11 +22,11 @@ describe('Copycat', function () { assert.statStage(battle.p2.active[0], 'spa', -4); }); - it('[Gen 4] should not be able to copy called moves', function () { + it('[Gen 4] should not be able to copy called moves', () => { battle = common.gen(4).createBattle([[ - {species: 'bonsly', ability: 'sturdy', moves: ['copycat']}, + { species: 'bonsly', ability: 'sturdy', moves: ['copycat'] }, ], [ - {species: 'ampharos', ability: 'static', moves: ['growl', 'counter']}, + { species: 'ampharos', ability: 'static', moves: ['growl', 'counter'] }, ]]); battle.makeChoices(); battle.makeChoices('auto', 'move counter'); diff --git a/test/sim/moves/counter.js b/test/sim/moves/counter.js index b61dad58c0..787db4d952 100644 --- a/test/sim/moves/counter.js +++ b/test/sim/moves/counter.js @@ -5,24 +5,24 @@ const common = require('./../../common'); let battle; -describe('Counter', function () { - afterEach(function () { +describe('Counter', () => { + afterEach(() => { battle.destroy(); }); - it('should deal damage equal to twice the damage taken from the last Physical attack', function () { + it('should deal damage equal to twice the damage taken from the last Physical attack', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sawk', ability: 'sturdy', moves: ['seismictoss']}]}); - battle.setPlayer('p2', {team: [{species: 'Throh', ability: 'guts', moves: ['counter']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sawk', ability: 'sturdy', moves: ['seismictoss'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Throh', ability: 'guts', moves: ['counter'] }] }); assert.hurtsBy(battle.p1.active[0], 200, () => battle.makeChoices()); }); - it('should deal damage based on the last hit from the last Physical attack', function () { + it('should deal damage based on the last hit from the last Physical attack', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sawk', ability: 'sturdy', moves: ['doublekick']}]}); - battle.setPlayer('p2', {team: [{species: 'Throh', ability: 'guts', moves: ['counter']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sawk', ability: 'sturdy', moves: ['doublekick'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Throh', ability: 'guts', moves: ['counter'] }] }); let lastDamage = 0; - battle.onEvent('Damage', battle.format, function (damage, attacker, defender, move) { + battle.onEvent('Damage', battle.format, (damage, attacker, defender, move) => { if (move.id === 'doublekick') { lastDamage = damage; } @@ -32,53 +32,53 @@ describe('Counter', function () { assert.equal(battle.p1.active[0].maxhp - battle.p1.active[0].hp, 2 * lastDamage); }); - it('should fail if user is not damaged by Physical attacks this turn', function () { + it('should fail if user is not damaged by Physical attacks this turn', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sawk', ability: 'sturdy', moves: ['aurasphere']}]}); - battle.setPlayer('p2', {team: [{species: 'Throh', ability: 'guts', moves: ['counter']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sawk', ability: 'sturdy', moves: ['aurasphere'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Throh', ability: 'guts', moves: ['counter'] }] }); assert.false.hurts(battle.p1.active[0], () => battle.makeChoices()); }); - it('should target the opposing Pokemon that hit the user with a Physical attack most recently that turn', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: 'Bastiodon', ability: 'sturdy', moves: ['counter']}, - {species: 'Toucannon', ability: 'keeneye', moves: ['beakblast']}, - {species: 'Kingdra', ability: 'sniper', moves: ['dragonpulse']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Crobat', ability: 'innerfocus', moves: ['acrobatics']}, - {species: 'Avalugg', ability: 'sturdy', moves: ['avalanche']}, - {species: 'Castform', ability: 'forecast', moves: ['weatherball']}, - ]}); + it('should target the opposing Pokemon that hit the user with a Physical attack most recently that turn', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: 'Bastiodon', ability: 'sturdy', moves: ['counter'] }, + { species: 'Toucannon', ability: 'keeneye', moves: ['beakblast'] }, + { species: 'Kingdra', ability: 'sniper', moves: ['dragonpulse'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Crobat', ability: 'innerfocus', moves: ['acrobatics'] }, + { species: 'Avalugg', ability: 'sturdy', moves: ['avalanche'] }, + { species: 'Castform', ability: 'forecast', moves: ['weatherball'] }, + ] }); battle.makeChoices('move counter, move beakblast -1, move dragonpulse -1', 'move acrobatics 1, move avalanche 1, move weatherball 1'); assert.fullHP(battle.p1.active[1]); assert.fullHP(battle.p2.active[0]); assert.false.fullHP(battle.p2.active[1]); }); - it('should respect Follow Me', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Bastiodon', ability: 'sturdy', moves: ['counter']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Crobat', ability: 'innerfocus', moves: ['acrobatics']}, - {species: 'Clefable', ability: 'unaware', moves: ['followme']}, - ]}); + it('should respect Follow Me', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Bastiodon', ability: 'sturdy', moves: ['counter'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Crobat', ability: 'innerfocus', moves: ['acrobatics'] }, + { species: 'Clefable', ability: 'unaware', moves: ['followme'] }, + ] }); battle.makeChoices('move counter, move splash', 'move acrobatics 1, move followme'); assert.false.fullHP(battle.p2.active[1]); assert.fullHP(battle.p2.active[0]); }); - it(`should not have its target changed by Stalwart`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Duraludon", ability: 'stalwart', moves: ['counter']}, - {species: "Diglett", moves: ['sleeptalk']}, + it(`should not have its target changed by Stalwart`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Duraludon", ability: 'stalwart', moves: ['counter'] }, + { species: "Diglett", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, - {species: "Noivern", moves: ['dragonclaw']}, + { species: "Wynaut", moves: ['sleeptalk'] }, + { species: "Noivern", moves: ['dragonclaw'] }, ]]); const wynaut = battle.p2.active[0]; @@ -87,26 +87,26 @@ describe('Counter', function () { }); }); -describe('Mirror Coat', function () { - afterEach(function () { +describe('Mirror Coat', () => { + afterEach(() => { battle.destroy(); }); - it(`should deal damage equal to twice the damage taken from the last Special attack`, function () { + it(`should deal damage equal to twice the damage taken from the last Special attack`, () => { battle = common.createBattle([[ - {species: 'Espeon', ability: 'noguard', moves: ['sonicboom']}, + { species: 'Espeon', ability: 'noguard', moves: ['sonicboom'] }, ], [ - {species: 'Umbreon', moves: ['mirrorcoat']}, + { species: 'Umbreon', moves: ['mirrorcoat'] }, ]]); assert.hurtsBy(battle.p1.active[0], 40, () => battle.makeChoices()); }); - it('should deal damage based on the last hit from the last Special attack', function () { + it('should deal damage based on the last hit from the last Special attack', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Espeon', ability: 'synchronize', moves: ['watershuriken']}]}); - battle.setPlayer('p2', {team: [{species: 'Umbreon', ability: 'synchronize', moves: ['mirrorcoat']}]}); + battle.setPlayer('p1', { team: [{ species: 'Espeon', ability: 'synchronize', moves: ['watershuriken'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Umbreon', ability: 'synchronize', moves: ['mirrorcoat'] }] }); let lastDamage = 0; - battle.onEvent('Damage', battle.format, function (damage, attacker, defender, move) { + battle.onEvent('Damage', battle.format, (damage, attacker, defender, move) => { if (move.id === 'watershuriken') { lastDamage = damage; } @@ -116,51 +116,51 @@ describe('Mirror Coat', function () { assert.equal(battle.p1.active[0].maxhp - battle.p1.active[0].hp, 2 * lastDamage); }); - it('should fail if user is not damaged by Special attacks this turn', function () { + it('should fail if user is not damaged by Special attacks this turn', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Espeon', ability: 'synchronize', moves: ['tackle']}]}); - battle.setPlayer('p2', {team: [{species: 'Umbreon', ability: 'synchronize', moves: ['mirrorcoat']}]}); + battle.setPlayer('p1', { team: [{ species: 'Espeon', ability: 'synchronize', moves: ['tackle'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Umbreon', ability: 'synchronize', moves: ['mirrorcoat'] }] }); assert.false.hurts(battle.p1.active[0], () => battle.makeChoices()); }); - it('should target the opposing Pokemon that hit the user with a Special attack most recently that turn', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Mew', ability: 'synchronize', moves: ['mirrorcoat']}, - {species: 'Lucario', ability: 'justified', item: 'laggingtail', moves: ['aurasphere']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Crobat', ability: 'innerfocus', moves: ['venoshock']}, - {species: 'Avalugg', ability: 'sturdy', moves: ['flashcannon']}, - ]}); + it('should target the opposing Pokemon that hit the user with a Special attack most recently that turn', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Mew', ability: 'synchronize', moves: ['mirrorcoat'] }, + { species: 'Lucario', ability: 'justified', item: 'laggingtail', moves: ['aurasphere'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Crobat', ability: 'innerfocus', moves: ['venoshock'] }, + { species: 'Avalugg', ability: 'sturdy', moves: ['flashcannon'] }, + ] }); battle.makeChoices('move mirrorcoat, move aurasphere -1', 'move venoshock 1, move flashcannon 1'); assert.fullHP(battle.p1.active[1]); assert.fullHP(battle.p2.active[0]); assert.false.fullHP(battle.p2.active[1]); }); - it('should respect Follow Me', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Mew', ability: 'synchronize', moves: ['mirrorcoat']}, - {species: 'Magikarp', ability: 'rattled', moves: ['splash']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Crobat', ability: 'innerfocus', moves: ['venoshock']}, - {species: 'Clefable', ability: 'unaware', moves: ['followme']}, - ]}); + it('should respect Follow Me', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Mew', ability: 'synchronize', moves: ['mirrorcoat'] }, + { species: 'Magikarp', ability: 'rattled', moves: ['splash'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Crobat', ability: 'innerfocus', moves: ['venoshock'] }, + { species: 'Clefable', ability: 'unaware', moves: ['followme'] }, + ] }); battle.makeChoices('move mirrorcoat, move splash', 'move venoshock 1, move followme'); assert.false.fullHP(battle.p2.active[1]); assert.fullHP(battle.p2.active[0]); }); - it(`should not have its target changed by Stalwart`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Duraludon", ability: 'stalwart', moves: ['mirrorcoat']}, - {species: "Diglett", moves: ['sleeptalk']}, + it(`should not have its target changed by Stalwart`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Duraludon", ability: 'stalwart', moves: ['mirrorcoat'] }, + { species: "Diglett", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['sleeptalk']}, - {species: "Noivern", moves: ['dragonpulse']}, + { species: "Wynaut", moves: ['sleeptalk'] }, + { species: "Noivern", moves: ['dragonpulse'] }, ]]); const wynaut = battle.p2.active[0]; @@ -169,36 +169,36 @@ describe('Mirror Coat', function () { }); }); -describe('Counter', function () { - afterEach(function () { +describe('Counter', () => { + afterEach(() => { battle.destroy(); }); - it(`[Gen 1] Counter Desync Clause`, function () { + it(`[Gen 1] Counter Desync Clause`, () => { // seed chosen so Water Gun succeeds and Pound full paras - battle = common.gen(1).createBattle({seed: [1, 2, 3, 3]}, [[ - {species: 'Mew', moves: ['pound', 'watergun', 'counter', 'thunderwave']}, + battle = common.gen(1).createBattle({ seed: [1, 2, 3, 3] }, [[ + { species: 'Mew', moves: ['pound', 'watergun', 'counter', 'thunderwave'] }, ], [ - {species: 'Persian', moves: ['pound', 'watergun', 'counter', 'thunderwave']}, + { species: 'Persian', moves: ['pound', 'watergun', 'counter', 'thunderwave'] }, ]]); battle.makeChoices('move watergun', 'move thunderwave'); battle.makeChoices('move pound', 'move counter'); assert(battle.log.some(line => line.includes('Desync Clause Mod activated'))); // seed chosen so Pound succeeds and Water Gun full paras - battle = common.gen(1).createBattle({seed: [1, 2, 3, 3]}, [[ - {species: 'Mew', moves: ['pound', 'watergun', 'counter', 'thunderwave']}, + battle = common.gen(1).createBattle({ seed: [1, 2, 3, 3] }, [[ + { species: 'Mew', moves: ['pound', 'watergun', 'counter', 'thunderwave'] }, ], [ - {species: 'Persian', moves: ['pound', 'watergun', 'counter', 'thunderwave']}, + { species: 'Persian', moves: ['pound', 'watergun', 'counter', 'thunderwave'] }, ]]); battle.makeChoices('move pound', 'move thunderwave'); battle.makeChoices('move watergun', 'move counter'); assert(battle.log.some(line => line.includes('Desync Clause Mod activated'))); battle = common.gen(1).createBattle([[ - {species: 'Mew', moves: ['pound', 'watergun', 'counter', 'splash']}, + { species: 'Mew', moves: ['pound', 'watergun', 'counter', 'splash'] }, ], [ - {species: 'Persian', moves: ['pound', 'watergun', 'counter', 'splash']}, + { species: 'Persian', moves: ['pound', 'watergun', 'counter', 'splash'] }, ]]); battle.makeChoices('move watergun', 'move splash'); battle.makeChoices('move pound', 'move counter'); @@ -206,9 +206,9 @@ describe('Counter', function () { assert.false.fullHP(battle.p1.active[0]); battle = common.gen(1).createBattle([[ - {species: 'Mew', moves: ['pound', 'watergun', 'counter', 'splash']}, + { species: 'Mew', moves: ['pound', 'watergun', 'counter', 'splash'] }, ], [ - {species: 'Persian', moves: ['pound', 'watergun', 'counter', 'splash']}, + { species: 'Persian', moves: ['pound', 'watergun', 'counter', 'splash'] }, ]]); battle.makeChoices('move pound', 'move splash'); battle.makeChoices('move watergun', 'move counter'); @@ -216,34 +216,34 @@ describe('Counter', function () { assert.fullHP(battle.p1.active[0]); }); - it(`[Gen 1] should counter attacks made against substitutes`, function () { + it(`[Gen 1] should counter attacks made against substitutes`, () => { battle = common.gen(1).createBattle([[ - {species: 'Chansey', moves: ['substitute', 'counter']}, + { species: 'Chansey', moves: ['substitute', 'counter'] }, ], [ - {species: 'Snorlax', moves: ['bodyslam']}, - {species: 'Chansey', moves: ['softboiled']}, + { species: 'Snorlax', moves: ['bodyslam'] }, + { species: 'Chansey', moves: ['softboiled'] }, ]]); battle.makeChoices('move substitute', 'move bodyslam'); battle.makeChoices('move counter', 'switch 2'); assert.fainted(battle.p2.active[0]); battle = common.gen(1).createBattle([[ - {species: 'Chansey', moves: ['substitute', 'counter']}, + { species: 'Chansey', moves: ['substitute', 'counter'] }, ], [ - {species: 'Snorlax', moves: ['bodyslam', 'splash']}, + { species: 'Snorlax', moves: ['bodyslam', 'splash'] }, ]]); battle.makeChoices('move substitute', 'move splash'); battle.makeChoices('move counter', 'move bodyslam'); assert.fainted(battle.p2.active[0]); }); - it(`[Gen 1] simultaneous counters should both fail`, function () { + it(`[Gen 1] simultaneous counters should both fail`, () => { battle = common.gen(1).createBattle([[ - {species: 'Golem', moves: ['bodyslam']}, - {species: 'Chansey', moves: ['counter']}, + { species: 'Golem', moves: ['bodyslam'] }, + { species: 'Chansey', moves: ['counter'] }, ], [ - {species: 'Tauros', moves: ['bodyslam']}, - {species: 'Chansey', moves: ['counter']}, + { species: 'Tauros', moves: ['bodyslam'] }, + { species: 'Chansey', moves: ['counter'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'switch 2'); @@ -252,12 +252,12 @@ describe('Counter', function () { assert.fullHP(battle.p2.active[0]); }); - it(`[Gen 1 Stadium] should counter Normal/Fighting moves only`, function () { + it(`[Gen 1 Stadium] should counter Normal/Fighting moves only`, () => { // should counter Normal/Fighting moves battle = common.mod('gen1stadium').createBattle([[ - {species: 'Mew', moves: ['pound', 'watergun', 'counter', 'thunderwave']}, + { species: 'Mew', moves: ['pound', 'watergun', 'counter', 'thunderwave'] }, ], [ - {species: 'Persian', moves: ['pound', 'watergun', 'counter', 'thunderwave']}, + { species: 'Persian', moves: ['pound', 'watergun', 'counter', 'thunderwave'] }, ]]); battle.makeChoices('move watergun', 'move counter'); assert.fullHP(battle.p1.active[0]); @@ -265,33 +265,33 @@ describe('Counter', function () { assert.false.fullHP(battle.p1.active[0]); }); - it(`[Gen 1 Stadium] should counter attacks made against substitutes`, function () { + it(`[Gen 1 Stadium] should counter attacks made against substitutes`, () => { battle = common.mod('gen1stadium').createBattle([[ - {species: 'Chansey', moves: ['substitute', 'counter']}, + { species: 'Chansey', moves: ['substitute', 'counter'] }, ], [ - {species: 'Snorlax', moves: ['bodyslam', 'splash']}, + { species: 'Snorlax', moves: ['bodyslam', 'splash'] }, ]]); battle.makeChoices('move substitute', 'move splash'); battle.makeChoices('move counter', 'move bodyslam'); assert.false.fullHP(battle.p2.active[0]); }); - it(`[Gen 1] (High) Jump Kick recoil can be countered`, function () { + it(`[Gen 1] (High) Jump Kick recoil can be countered`, () => { battle = common.gen(1).createBattle([[ - {species: 'Gengar', moves: ['counter']}, + { species: 'Gengar', moves: ['counter'] }, ], [ - {species: 'Hitmonlee', moves: ['highjumpkick']}, + { species: 'Hitmonlee', moves: ['highjumpkick'] }, ]]); battle.makeChoices(); const hitmonlee = battle.p2.active[0]; assert.equal(hitmonlee.maxhp - hitmonlee.hp, 3); }); - it(`[Gen 1] confusion damage can be countered`, function () { - battle = common.gen(1).createBattle({seed: [1, 0, 0, 0]}, [[ - {species: 'Gengar', moves: ['confuseray', 'counter']}, + it(`[Gen 1] confusion damage can be countered`, () => { + battle = common.gen(1).createBattle({ seed: [1, 0, 0, 0] }, [[ + { species: 'Gengar', moves: ['confuseray', 'counter'] }, ], [ - {species: 'Alakazam', moves: ['seismictoss']}, + { species: 'Alakazam', moves: ['seismictoss'] }, ]]); battle.makeChoices(); battle.makeChoices('move counter', 'move seismictoss'); @@ -301,12 +301,12 @@ describe('Counter', function () { assert.false.equal(alakazam.maxhp - alakazam.hp, 200); }); - it(`[Gen 1] draining can be countered`, function () { - battle = common.gen(1).createBattle({seed: [1, 0, 0, 0]}, [[ - {species: 'Gengar', moves: ['megadrain', 'counter']}, + it(`[Gen 1] draining can be countered`, () => { + battle = common.gen(1).createBattle({ seed: [1, 0, 0, 0] }, [[ + { species: 'Gengar', moves: ['megadrain', 'counter'] }, ], [ - {species: 'Alakazam', moves: ['seismictoss']}, - {species: 'Exeggutor', moves: ['barrage']}, + { species: 'Alakazam', moves: ['seismictoss'] }, + { species: 'Exeggutor', moves: ['barrage'] }, ]]); battle.makeChoices(); battle.makeChoices('move counter', 'switch 2'); @@ -315,11 +315,11 @@ describe('Counter', function () { assert.equal(exeggutor.maxhp - exeggutor.hp, (gengar.hp - (gengar.maxhp - 100)) * 2); }); - it(`[Gen 1] Mirror Move can be countered when it calls a counterable move`, function () { + it(`[Gen 1] Mirror Move can be countered when it calls a counterable move`, () => { battle = common.gen(1).createBattle([[ - {species: 'Pidgeot', moves: ['mirrormove']}, + { species: 'Pidgeot', moves: ['mirrormove'] }, ], [ - {species: 'Alakazam', moves: ['seismictoss', 'counter']}, + { species: 'Alakazam', moves: ['seismictoss', 'counter'] }, ]]); battle.makeChoices(); battle.makeChoices('move mirrormove', 'move counter'); @@ -327,21 +327,21 @@ describe('Counter', function () { assert.equal(pidgeot.maxhp - pidgeot.hp, 300); }); - it(`[Gen 1] Moves with unique damage calculation don't overdamage a target with less HP`, function () { + it(`[Gen 1] Moves with unique damage calculation don't overdamage a target with less HP`, () => { battle = common.gen(1).createBattle([[ - {species: 'Gengar', moves: ['seismictoss']}, + { species: 'Gengar', moves: ['seismictoss'] }, ], [ - {species: 'Abra', moves: ['teleport'], level: 5}, + { species: 'Abra', moves: ['teleport'], level: 5 }, ]]); battle.makeChoices(); assert(battle.lastDamage < 100); }); - it(`[Gen 1] Metronome calling Counter fails`, function () { - battle = common.gen(1).createBattle({seed: [1, 3, 1, 7]}, [[ - {species: 'Persian', moves: ['Swift']}, + it(`[Gen 1] Metronome calling Counter fails`, () => { + battle = common.gen(1).createBattle({ seed: [1, 3, 1, 7] }, [[ + { species: 'Persian', moves: ['Swift'] }, ], [ - {species: 'Chansey', moves: ['Metronome']}, + { species: 'Chansey', moves: ['Metronome'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.includes('Chansey|Counter'))); diff --git a/test/sim/moves/courtchange.js b/test/sim/moves/courtchange.js index fc47f74e14..a43515894e 100644 --- a/test/sim/moves/courtchange.js +++ b/test/sim/moves/courtchange.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe(`Court Change`, function () { - afterEach(function () { +describe(`Court Change`, () => { + afterEach(() => { battle.destroy(); }); - it(`should swap certain side conditions to the opponent's side and vice versa`, function () { + it(`should swap certain side conditions to the opponent's side and vice versa`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['sleeptalk', 'stealthrock', 'lightscreen']}, + { species: 'wynaut', moves: ['sleeptalk', 'stealthrock', 'lightscreen'] }, ], [ - {species: 'cinderace', moves: ['courtchange', 'tailwind', 'safeguard']}, + { species: 'cinderace', moves: ['courtchange', 'tailwind', 'safeguard'] }, ]]); battle.makeChoices('move stealthrock', 'move tailwind'); battle.makeChoices('move lightscreen', 'move safeguard'); @@ -26,12 +26,12 @@ describe(`Court Change`, function () { assert(!!battle.p2.sideConditions['lightscreen']); }); - it(`should allow Sticky Web to trigger Defiant when set by the Defiant user's team`, function () { + it(`should allow Sticky Web to trigger Defiant when set by the Defiant user's team`, () => { battle = common.createBattle([[ - {species: 'cinderace', moves: ['courtchange', 'stickyweb', 'sleeptalk']}, - {species: 'pawniard', ability: 'defiant', moves: ['sleeptalk']}, + { species: 'cinderace', moves: ['courtchange', 'stickyweb', 'sleeptalk'] }, + { species: 'pawniard', ability: 'defiant', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move stickyweb', 'auto'); battle.makeChoices('move courtchange', 'auto'); @@ -41,12 +41,12 @@ describe(`Court Change`, function () { assert.statStage(battle.p1.active[0], 'atk', 2); }); - it(`[Gen 8] should not allow Sticky Web to trigger Defiant when set by the Defiant user's team`, function () { + it(`[Gen 8] should not allow Sticky Web to trigger Defiant when set by the Defiant user's team`, () => { battle = common.gen(8).createBattle([[ - {species: 'cinderace', moves: ['courtchange', 'stickyweb', 'sleeptalk']}, - {species: 'pawniard', ability: 'defiant', moves: ['sleeptalk']}, + { species: 'cinderace', moves: ['courtchange', 'stickyweb', 'sleeptalk'] }, + { species: 'pawniard', ability: 'defiant', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move stickyweb', 'auto'); battle.makeChoices('move courtchange', 'auto'); diff --git a/test/sim/moves/curse.js b/test/sim/moves/curse.js index 3d87fae9eb..8afc1675ae 100644 --- a/test/sim/moves/curse.js +++ b/test/sim/moves/curse.js @@ -5,57 +5,57 @@ const common = require('./../../common'); let battle; -describe('Curse', function () { - afterEach(function () { +describe('Curse', () => { + afterEach(() => { battle.destroy(); }); - it(`should request the Ghost target if the user is a known Ghost`, function () { + it(`should request the Ghost target if the user is a known Ghost`, () => { battle = common.createBattle([[ - {species: 'Gengar', moves: ['curse']}, + { species: 'Gengar', moves: ['curse'] }, ], [ - {species: 'Caterpie', moves: ['sleeptalk']}, + { species: 'Caterpie', moves: ['sleeptalk'] }, ]]); assert.equal(battle.p1.active[0].getMoveRequestData().moves[0].target, 'normal'); }); - it(`should request the Ghost target after the user becomes Ghost`, function () { + it(`should request the Ghost target after the user becomes Ghost`, () => { battle = common.createBattle([[ - {species: 'Rapidash', moves: ['curse']}, + { species: 'Rapidash', moves: ['curse'] }, ], [ - {species: 'Trevenant', item: 'laggingtail', moves: ['trickortreat']}, + { species: 'Trevenant', item: 'laggingtail', moves: ['trickortreat'] }, ]]); assert.equal(battle.p1.active[0].getMoveRequestData().moves[0].target, 'self'); battle.makeChoices(); assert.equal(battle.p1.active[0].getMoveRequestData().moves[0].target, 'normal'); }); - it(`should not request a target after the user stops being Ghost`, function () { + it(`should not request a target after the user stops being Ghost`, () => { battle = common.createBattle([[ - {species: 'Gengar', moves: ['curse']}, + { species: 'Gengar', moves: ['curse'] }, ], [ - {species: 'Jellicent', moves: ['soak']}, + { species: 'Jellicent', moves: ['soak'] }, ]]); assert.equal(battle.p1.active[0].getMoveRequestData().moves[0].target, 'normal'); battle.makeChoices(); assert.equal(battle.p1.active[0].getMoveRequestData().moves[0].target, 'self'); }); - it(`should not request a target if the user is a known non-Ghost`, function () { + it(`should not request a target if the user is a known non-Ghost`, () => { battle = common.createBattle([[ - {species: 'Blastoise', moves: ['curse']}, + { species: 'Blastoise', moves: ['curse'] }, ], [ - {species: 'Caterpie', moves: ['sleeptalk']}, + { species: 'Caterpie', moves: ['sleeptalk'] }, ]]); assert.equal(battle.p1.active[0].getMoveRequestData().moves[0].target, 'self'); }); - it(`should not request a target if the user is an unknown non-Ghost`, function () { + it(`should not request a target if the user is an unknown non-Ghost`, () => { battle = common.createBattle([[ - {species: 'Blastoise', moves: ['curse', 'reflecttype']}, + { species: 'Blastoise', moves: ['curse', 'reflecttype'] }, ], [ - {species: 'Zoroark', ability: 'illusion', moves: ['sleeptalk']}, - {species: 'Gengar', moves: ['sleeptalk']}, + { species: 'Zoroark', ability: 'illusion', moves: ['sleeptalk'] }, + { species: 'Gengar', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move reflecttype', 'auto'); @@ -63,11 +63,11 @@ describe('Curse', function () { assert.equal(battle.p1.active[0].getMoveRequestData().moves[0].target, 'self'); }); - it(`should curse a non-Ghost user with Protean`, function () { + it(`should curse a non-Ghost user with Protean`, () => { battle = common.createBattle([[ - {species: 'Greninja', ability: 'protean', moves: ['curse', 'spite']}, + { species: 'Greninja', ability: 'protean', moves: ['curse', 'spite'] }, ], [ - {species: 'Caterpie', moves: ['sleeptalk']}, + { species: 'Caterpie', moves: ['sleeptalk'] }, ]]); const greninja = battle.p1.active[0]; const caterpie = battle.p2.active[0]; @@ -81,11 +81,11 @@ describe('Curse', function () { assert.fullHP(caterpie); }); - it(`should curse the target if a Ghost user has Protean`, function () { + it(`should curse the target if a Ghost user has Protean`, () => { battle = common.createBattle([[ - {species: 'Gengar', ability: 'protean', moves: ['curse']}, + { species: 'Gengar', ability: 'protean', moves: ['curse'] }, ], [ - {species: 'Caterpie', moves: ['sleeptalk']}, + { species: 'Caterpie', moves: ['sleeptalk'] }, ]]); const gengar = battle.p1.active[0]; const caterpie = battle.p2.active[0]; @@ -99,13 +99,13 @@ describe('Curse', function () { assert.equal(caterpie.hp, caterpie.maxhp - curseResidual * 2); }); - it(`should target either random opponent if the target is an ally`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Gengar', moves: ['curse']}, + it(`should target either random opponent if the target is an ally`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Gengar', moves: ['curse'] }, ], [ - {species: 'Caterpie', moves: ['sleeptalk']}, - {species: 'Metapod', moves: ['sleeptalk']}, + { species: 'Caterpie', moves: ['sleeptalk'] }, + { species: 'Metapod', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk, move curse -1', 'auto'); @@ -116,13 +116,13 @@ describe('Curse', function () { assert(caterpie.maxhp !== caterpie.hp || metapod.maxhp !== metapod.hp, `Either Caterpie or Metapod should have lost HP from Curse`); }); - it(`[Gen 7] should target the ally if the target is an ally`, function () { - battle = common.gen(7).createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Gengar', moves: ['curse']}, + it(`[Gen 7] should target the ally if the target is an ally`, () => { + battle = common.gen(7).createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Gengar', moves: ['curse'] }, ], [ - {species: 'Caterpie', moves: ['sleeptalk']}, - {species: 'Metapod', moves: ['sleeptalk']}, + { species: 'Caterpie', moves: ['sleeptalk'] }, + { species: 'Metapod', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk, move curse -1', 'auto'); @@ -131,22 +131,22 @@ describe('Curse', function () { }); }); -describe('XY/ORAS Curse targetting when becoming Ghost the same turn', function () { - afterEach(function () { +describe('XY/ORAS Curse targetting when becoming Ghost the same turn', () => { + afterEach(() => { battle.destroy(); }); const doublesTeams = [[ - {species: "Kecleon", ability: 'colorchange', item: 'laggingtail', moves: ['curse', 'calmmind']}, - {species: "Sableye", ability: 'prankster', item: '', moves: ['lightscreen', 'mudsport']}, + { species: "Kecleon", ability: 'colorchange', item: 'laggingtail', moves: ['curse', 'calmmind'] }, + { species: "Sableye", ability: 'prankster', item: '', moves: ['lightscreen', 'mudsport'] }, ], [ - {species: "Raikou", ability: 'pressure', item: '', moves: ['aurasphere', 'calmmind']}, - {species: "Gastly", ability: 'levitate', item: '', moves: ['lick', 'calmmind']}, + { species: "Raikou", ability: 'pressure', item: '', moves: ['aurasphere', 'calmmind'] }, + { species: "Gastly", ability: 'levitate', item: '', moves: ['lick', 'calmmind'] }, ]]; const triplesTeams = [ - doublesTeams[0].concat({species: "Metapod", ability: 'shedskin', item: '', moves: ['harden', 'stringshot']}), - doublesTeams[1].concat({species: "Kakuna", ability: 'shedskin', item: '', moves: ['harden', 'stringshot']}), + doublesTeams[0].concat({ species: "Metapod", ability: 'shedskin', item: '', moves: ['harden', 'stringshot'] }), + doublesTeams[1].concat({ species: "Kakuna", ability: 'shedskin', item: '', moves: ['harden', 'stringshot'] }), ]; function runDoublesTest(battle, curseUser) { @@ -212,13 +212,13 @@ describe('XY/ORAS Curse targetting when becoming Ghost the same turn', function assert(cursedFoe); } - it('should target an opponent in Doubles if the user is on left side and becomes Ghost the same turn', function () { - battle = common.gen(6).createBattle({gameType: 'doubles'}, doublesTeams.slice()); + it('should target an opponent in Doubles if the user is on left side and becomes Ghost the same turn', () => { + battle = common.gen(6).createBattle({ gameType: 'doubles' }, doublesTeams.slice()); runDoublesTest(battle, battle.p1.active[0]); }); - it('should target the ally in Doubles if the user is on right side and becomes Ghost the same turn', function () { - battle = common.gen(6).createBattle({gameType: 'doubles'}, [ + it('should target the ally in Doubles if the user is on right side and becomes Ghost the same turn', () => { + battle = common.gen(6).createBattle({ gameType: 'doubles' }, [ [doublesTeams[0][1], doublesTeams[0][0]], doublesTeams[1], ]); @@ -226,12 +226,12 @@ describe('XY/ORAS Curse targetting when becoming Ghost the same turn', function }); for (const cursePos of [0, 1, 2]) { - it('should target an opponent in Triples even if the user is on position ' + cursePos, function () { + it('should target an opponent in Triples even if the user is on position ' + cursePos, () => { const p1team = triplesTeams[0].slice(1); p1team.splice(cursePos, 0, triplesTeams[0][0]); const p2team = triplesTeams[1].slice(); - battle = common.gen(5).createBattle({gameType: 'triples'}, [p1team, p2team]); + battle = common.gen(5).createBattle({ gameType: 'triples' }, [p1team, p2team]); runTriplesTest(battle, battle.p1.active[cursePos]); }); } diff --git a/test/sim/moves/destinybond.js b/test/sim/moves/destinybond.js index 6c89b9e904..fa10a1fb67 100644 --- a/test/sim/moves/destinybond.js +++ b/test/sim/moves/destinybond.js @@ -5,13 +5,13 @@ const common = require('./../../common'); let battle; -describe(`Destiny Bond`, function () { +describe(`Destiny Bond`, () => { afterEach(() => battle.destroy()); - it(`should fail if used consecutively`, function () { + it(`should fail if used consecutively`, () => { battle = common.createBattle([ - [{species: "Gastly", ability: 'levitate', moves: ['destinybond']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], - [{species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], + [{ species: "Gastly", ability: 'levitate', moves: ['destinybond'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], + [{ species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], ]); battle.makeChoices('move destinybond', 'move calmmind'); battle.makeChoices('move destinybond', 'move psychic'); @@ -20,8 +20,8 @@ describe(`Destiny Bond`, function () { battle.destroy(); battle = common.createBattle([ - [{species: "Gastly", ability: 'levitate', moves: ['destinybond']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], - [{species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], + [{ species: "Gastly", ability: 'levitate', moves: ['destinybond'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], + [{ species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], ]); battle.makeChoices('move destinybond', 'move calmmind'); battle.makeChoices('move destinybond', 'move psychic'); @@ -29,10 +29,10 @@ describe(`Destiny Bond`, function () { assert.false.fainted(battle.p2.active[0]); }); - it(`should not fail after Protect usage`, function () { + it(`should not fail after Protect usage`, () => { battle = common.createBattle([ - [{species: "Gastly", ability: 'levitate', moves: ['destinybond', 'protect']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], - [{species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], + [{ species: "Gastly", ability: 'levitate', moves: ['destinybond', 'protect'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], + [{ species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], ]); battle.makeChoices('move protect', 'move calmmind'); battle.makeChoices('move destinybond', 'move psychic'); @@ -40,10 +40,10 @@ describe(`Destiny Bond`, function () { assert.fainted(battle.p2.active[0]); }); - it(`should be removed the next turn if a fast user is asleep`, function () { + it(`should be removed the next turn if a fast user is asleep`, () => { battle = common.createBattle([ - [{species: "Gastly", ability: 'levitate', item: '', moves: ['destinybond', 'spite']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], - [{species: "Hypno", ability: 'insomnia', item: 'laggingtail', moves: ['psychic', 'hypnosis']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], + [{ species: "Gastly", ability: 'levitate', item: '', moves: ['destinybond', 'spite'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], + [{ species: "Hypno", ability: 'insomnia', item: 'laggingtail', moves: ['psychic', 'hypnosis'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], ]); battle.makeChoices('move destinybond', 'move hypnosis'); battle.makeChoices('move destinybond', 'move psychic'); @@ -52,13 +52,13 @@ describe(`Destiny Bond`, function () { }); }); -describe(`Destiny Bond [Gen 6]`, function () { +describe(`Destiny Bond [Gen 6]`, () => { afterEach(() => battle.destroy()); - it(`should not fail if used consecutively`, function () { + it(`should not fail if used consecutively`, () => { battle = common.gen(6).createBattle([ - [{species: "Gastly", ability: 'levitate', moves: ['destinybond']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], - [{species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], + [{ species: "Gastly", ability: 'levitate', moves: ['destinybond'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], + [{ species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], ]); battle.makeChoices('move destinybond', 'move calmmind'); battle.makeChoices('move destinybond', 'move psychic'); @@ -67,8 +67,8 @@ describe(`Destiny Bond [Gen 6]`, function () { battle.destroy(); battle = common.gen(6).createBattle([ - [{species: "Gastly", ability: 'levitate', moves: ['destinybond']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], - [{species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind']}, {species: "Clefable", ability: 'unaware', moves: ['calmmind']}], + [{ species: "Gastly", ability: 'levitate', moves: ['destinybond'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], + [{ species: "Metagross", ability: 'clearbody', moves: ['psychic', 'calmmind'] }, { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }], ]); battle.makeChoices('move destinybond', 'move calmmind'); battle.makeChoices('move destinybond', 'move psychic'); @@ -76,10 +76,10 @@ describe(`Destiny Bond [Gen 6]`, function () { assert.fainted(battle.p2.active[0]); }); - it(`should end the effect before the user switches out`, function () { + it(`should end the effect before the user switches out`, () => { battle = common.gen(6).createBattle([ - [{species: "Gastly", level: 50, moves: ['destinybond']}, {species: "Gengar", moves: ['sleeptalk']}], - [{species: "Snorlax", moves: ['sleeptalk', 'pursuit']}], + [{ species: "Gastly", level: 50, moves: ['destinybond'] }, { species: "Gengar", moves: ['sleeptalk'] }], + [{ species: "Snorlax", moves: ['sleeptalk', 'pursuit'] }], ]); const gastly = battle.p1.pokemon[0]; const snorlax = battle.p2.pokemon[0]; @@ -90,13 +90,13 @@ describe(`Destiny Bond [Gen 6]`, function () { }); }); -describe(`Destiny Bond [Gen 4]`, function () { +describe(`Destiny Bond [Gen 4]`, () => { afterEach(() => battle.destroy()); - it(`should not end the effect before the user switches out`, function () { + it(`should not end the effect before the user switches out`, () => { battle = common.gen(4).createBattle([ - [{species: "Gastly", level: 50, moves: ['destinybond']}, {species: "Gengar", moves: ['sleeptalk']}], - [{species: "Snorlax", moves: ['sleeptalk', 'pursuit']}], + [{ species: "Gastly", level: 50, moves: ['destinybond'] }, { species: "Gengar", moves: ['sleeptalk'] }], + [{ species: "Snorlax", moves: ['sleeptalk', 'pursuit'] }], ]); const gastly = battle.p1.pokemon[0]; const snorlax = battle.p2.pokemon[0]; @@ -107,13 +107,13 @@ describe(`Destiny Bond [Gen 4]`, function () { }); }); -describe(`Destiny Bond [Gen 2]`, function () { +describe(`Destiny Bond [Gen 2]`, () => { afterEach(() => battle.destroy()); - it(`should end the effect before the user switches out if it is faster than the Pursuit user`, function () { + it(`should end the effect before the user switches out if it is faster than the Pursuit user`, () => { battle = common.gen(2).createBattle([ - [{species: "Gastly", level: 50, moves: ['destinybond']}, {species: "Haunter", level: 30, moves: ['destinybond']}, {species: "Gengar", moves: ['sleeptalk']}], - [{species: "Snorlax", moves: ['sleeptalk', 'pursuit']}], + [{ species: "Gastly", level: 50, moves: ['destinybond'] }, { species: "Haunter", level: 30, moves: ['destinybond'] }, { species: "Gengar", moves: ['sleeptalk'] }], + [{ species: "Snorlax", moves: ['sleeptalk', 'pursuit'] }], ]); const gastly = battle.p1.pokemon[0]; const haunter = battle.p1.pokemon[1]; diff --git a/test/sim/moves/disable.js b/test/sim/moves/disable.js index 580f9d1a5f..9e0a2506c7 100644 --- a/test/sim/moves/disable.js +++ b/test/sim/moves/disable.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe('Disable', function () { - afterEach(function () { +describe('Disable', () => { + afterEach(() => { battle.destroy(); }); - it(`should prevent the use of the target's last move`, function () { + it(`should prevent the use of the target's last move`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['disable']}, + { species: "Wynaut", moves: ['disable'] }, ], [ - {species: "Spearow", moves: ['growl']}, + { species: "Spearow", moves: ['growl'] }, ]]); battle.makeChoices(); assert.cantMove(() => battle.makeChoices('auto', 'move growl'), "Spearow", 'growl'); }); - it(`should interupt consecutively executed moves like Outrage`, function () { + it(`should interupt consecutively executed moves like Outrage`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['disable']}, + { species: "Wynaut", moves: ['disable'] }, ], [ - {species: "Spearow", moves: ['outrage', 'sleeptalk']}, + { species: "Spearow", moves: ['outrage', 'sleeptalk'] }, ]]); battle.makeChoices(); @@ -34,23 +34,23 @@ describe('Disable', function () { assert.cantMove(() => battle.makeChoices('auto', 'move outrage')); }); - it(`should not work successfully against Struggle`, function () { + it(`should not work successfully against Struggle`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['disable']}, + { species: "Wynaut", moves: ['disable'] }, ], [ - {species: "Spearow", item: 'assaultvest', moves: ['growl']}, + { species: "Spearow", item: 'assaultvest', moves: ['growl'] }, ]]); battle.makeChoices(); assert(battle.log.indexOf('|-fail|p1a: Wynaut') > 0, `Disable should have failed vs Struggle`); }); - describe(`[Gen 1] Disable`, function () { - it(`should fail if the opponent already has a move disabled`, function () { - battle = common.createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['disable']}, + describe(`[Gen 1] Disable`, () => { + it(`should fail if the opponent already has a move disabled`, () => { + battle = common.createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['disable'] }, ], [ - {species: 'Muk', moves: ['splash', 'tackle']}, + { species: 'Muk', moves: ['splash', 'tackle'] }, ]]); battle.makeChoices('auto', 'move tackle'); battle.makeChoices('auto', 'move splash'); @@ -58,32 +58,32 @@ describe('Disable', function () { assert(battle.log.includes('|-fail|p1a: Mew'), `Disable should fail if a move is already disabled`); }); - it(`should work on the first turn so long as the opponent has move with PP`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['disable']}, + it(`should work on the first turn so long as the opponent has move with PP`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['disable'] }, ], [ - {species: 'Muk', moves: ['roar']}, + { species: 'Muk', moves: ['roar'] }, ]]); battle.makeChoices(); assert('disable' in battle.p2.active[0].volatiles); }); - it(`should fail if opponent has no moves with PP`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['disable']}, + it(`should fail if opponent has no moves with PP`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['disable'] }, ], [ - {species: 'Muk', moves: ['hyperbeam']}, + { species: 'Muk', moves: ['hyperbeam'] }, ]]); battle.p2.active[0].deductPP('hyperbeam', 8); battle.makeChoices(); assert(battle.log.includes('|-fail|p2a: Muk'), 'Muk has no moves with positive PP'); }); - it(`should not select moves with 0 PP`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['disable']}, + it(`should not select moves with 0 PP`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['disable'] }, ], [ - {species: 'Muk', moves: ['hyperbeam', 'fireblast', 'blizzard', 'tackle']}, + { species: 'Muk', moves: ['hyperbeam', 'fireblast', 'blizzard', 'tackle'] }, ]]); const muk = battle.p2.active[0]; muk.deductPP('hyperbeam', 8); @@ -94,12 +94,12 @@ describe('Disable', function () { assert.equal(muk.volatiles.disable.move, 'tackle'); }); - it(`Disable should build Rage, even if it misses/fails`, function () { + it(`Disable should build Rage, even if it misses/fails`, () => { // Disable hits battle = common.gen(1).createBattle([[ - {species: 'Drowzee', moves: ['disable']}, + { species: 'Drowzee', moves: ['disable'] }, ], [ - {species: 'Abra', moves: ['rage']}, + { species: 'Abra', moves: ['rage'] }, ]]); // Modding accuracy so Disable always hits battle.onEvent('Accuracy', battle.format, true); @@ -107,12 +107,12 @@ describe('Disable', function () { assert(battle.log.some(line => line.startsWith('|-boost|'))); battle = common.gen(1).createBattle([[ - {species: 'Drowzee', moves: ['disable']}, + { species: 'Drowzee', moves: ['disable'] }, ], [ - {species: 'Abra', moves: ['rage']}, + { species: 'Abra', moves: ['rage'] }, ]]); // Modding accuracy so Disable always misses - battle.onEvent('Accuracy', battle.format, function (accuracy, target, pokemon, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, pokemon, move) => { return move.id === 'rage'; }); battle.makeChoices(); diff --git a/test/sim/moves/doodle.js b/test/sim/moves/doodle.js index eae73c3149..1370fd0914 100644 --- a/test/sim/moves/doodle.js +++ b/test/sim/moves/doodle.js @@ -5,44 +5,44 @@ const common = require('./../../common'); let battle; -describe('Doodle', function () { - afterEach(function () { +describe('Doodle', () => { + afterEach(() => { battle.destroy(); }); - it(`should replace the Abilities of the user and its ally with the Ability of its target`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'shadowtag', moves: ['doodle']}, - {species: 'ironhands', ability: 'quarkdrive', moves: ['sleeptalk']}, + it(`should replace the Abilities of the user and its ally with the Ability of its target`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'shadowtag', moves: ['doodle'] }, + { species: 'ironhands', ability: 'quarkdrive', moves: ['sleeptalk'] }, ], [ - {species: 'clefable', ability: 'magicguard', moves: ['sleeptalk']}, - {species: 'mudkip', ability: 'torrent', moves: ['sleeptalk']}, + { species: 'clefable', ability: 'magicguard', moves: ['sleeptalk'] }, + { species: 'mudkip', ability: 'torrent', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move doodle 1, auto', 'auto'); assert.equal(battle.p1.active[0].ability, 'magicguard'); assert.equal(battle.p1.active[1].ability, 'magicguard'); }); - it(`should fail against certain Abilities`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'shadowtag', moves: ['doodle']}, - {species: 'ironhands', ability: 'quarkdrive', moves: ['sleeptalk']}, + it(`should fail against certain Abilities`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'shadowtag', moves: ['doodle'] }, + { species: 'ironhands', ability: 'quarkdrive', moves: ['sleeptalk'] }, ], [ - {species: 'fluttermane', ability: 'protosynthesis', moves: ['sleeptalk']}, - {species: 'mudkip', ability: 'torrent', moves: ['sleeptalk']}, + { species: 'fluttermane', ability: 'protosynthesis', moves: ['sleeptalk'] }, + { species: 'mudkip', ability: 'torrent', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move doodle 1, auto', 'auto'); assert.equal(battle.p1.active[0].ability, 'shadowtag'); assert.equal(battle.p1.active[1].ability, 'quarkdrive'); }); - it(`should not fail if only the user has an unreplaceable Ability`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'komala', ability: 'comatose', moves: ['doodle']}, - {species: 'wynaut', ability: 'shadowtag', moves: ['swordsdance']}, + it(`should not fail if only the user has an unreplaceable Ability`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'komala', ability: 'comatose', moves: ['doodle'] }, + { species: 'wynaut', ability: 'shadowtag', moves: ['swordsdance'] }, ], [ - {species: 'clefable', ability: 'magicguard', moves: ['swordsdance']}, - {species: 'mudkip', ability: 'torrent', moves: ['swordsdance']}, + { species: 'clefable', ability: 'magicguard', moves: ['swordsdance'] }, + { species: 'mudkip', ability: 'torrent', moves: ['swordsdance'] }, ]]); battle.makeChoices('move doodle 1, auto', 'auto'); assert.equal(battle.p1.active[0].ability, 'comatose'); diff --git a/test/sim/moves/dragoncheer.js b/test/sim/moves/dragoncheer.js index f37b8657a2..a07ae65720 100644 --- a/test/sim/moves/dragoncheer.js +++ b/test/sim/moves/dragoncheer.js @@ -12,52 +12,52 @@ let battle; * * All tests based on confirmations given here: https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9894139 */ -describe('Dragon Cheer', function () { +describe('Dragon Cheer', () => { afterEach(() => battle.destroy()); - it('should raise critical hit ratio by 2 stages for dragon types', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'dragapult', moves: ['dragoncheer']}, - {species: 'kingdra', moves: ['bubble']}, + it('should raise critical hit ratio by 2 stages for dragon types', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'dragapult', moves: ['dragoncheer'] }, + { species: 'kingdra', moves: ['bubble'] }, ], [ - {species: 'dragapult', moves: ['splash']}, - {species: 'dragapult', moves: ['splash']}, + { species: 'dragapult', moves: ['splash'] }, + { species: 'dragapult', moves: ['splash'] }, ]]); battle.onEvent( 'ModifyCritRatio', battle.format, -99, - (critRatio) => assert.equal(critRatio, 3) + critRatio => assert.equal(critRatio, 3) ); battle.makeChoices('auto', 'auto'); assert(battle.log.some(line => line.startsWith('|-start'))); }); - it('should raise critical hit ratio by 1 stage for non-dragon types', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'dragapult', moves: ['dragoncheer']}, - {species: 'horsea', moves: ['bubble']}, + it('should raise critical hit ratio by 1 stage for non-dragon types', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'dragapult', moves: ['dragoncheer'] }, + { species: 'horsea', moves: ['bubble'] }, ], [ - {species: 'dragapult', moves: ['splash']}, - {species: 'dragapult', moves: ['splash']}, + { species: 'dragapult', moves: ['splash'] }, + { species: 'dragapult', moves: ['splash'] }, ]]); battle.onEvent( 'ModifyCritRatio', battle.format, -99, - (critRatio) => assert.equal(critRatio, 2) + critRatio => assert.equal(critRatio, 2) ); battle.makeChoices('auto', 'auto'); assert(battle.log.some(line => line.startsWith('|-start'))); }); - it('should fail if used twice on the same ally', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'dragapult', moves: ['dragoncheer']}, - {species: 'kingdra', moves: ['bubble']}, + it('should fail if used twice on the same ally', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'dragapult', moves: ['dragoncheer'] }, + { species: 'kingdra', moves: ['bubble'] }, ], [ - {species: 'dragapult', moves: ['splash']}, - {species: 'dragapult', moves: ['splash']}, + { species: 'dragapult', moves: ['splash'] }, + { species: 'dragapult', moves: ['splash'] }, ]]); battle.makeChoices('auto', 'auto'); @@ -66,46 +66,46 @@ describe('Dragon Cheer', function () { assert(battle.log.some(line => line.startsWith('|-fail'))); // second trigger }); - it('should not increase ratio if affected Pokemon turns into a Dragon Type after Dragon Cheer', function () { - battle = common.gen(9).createBattle({gameType: 'doubles'}, [[ - {species: 'dragapult', moves: ['dragoncheer', 'splash']}, - {species: 'horsea', moves: ['bubble'], teraType: 'Dragon'}, + it('should not increase ratio if affected Pokemon turns into a Dragon Type after Dragon Cheer', () => { + battle = common.gen(9).createBattle({ gameType: 'doubles' }, [[ + { species: 'dragapult', moves: ['dragoncheer', 'splash'] }, + { species: 'horsea', moves: ['bubble'], teraType: 'Dragon' }, ], [ - {species: 'dragapult', moves: ['splash']}, - {species: 'dragapult', moves: ['splash']}, + { species: 'dragapult', moves: ['splash'] }, + { species: 'dragapult', moves: ['splash'] }, ]]); battle.onEvent( 'ModifyCritRatio', battle.format, -99, - (critRatio) => assert.equal(critRatio, 2) + critRatio => assert.equal(critRatio, 2) ); battle.makeChoices('move dragoncheer -2, move bubble', 'auto'); battle.makeChoices('move splash, move bubble terastallize', 'auto'); }); - it('should fail in singles or if no ally exists', function () { + it('should fail in singles or if no ally exists', () => { battle = common.createBattle([ - [{species: 'gyarados', moves: ['dragoncheer']}], - [{species: 'dragapult', moves: ['splash']}], + [{ species: 'gyarados', moves: ['dragoncheer'] }], + [{ species: 'dragapult', moves: ['splash'] }], ]); battle.makeChoices(); assert(battle.log.some(line => !line.startsWith('|-fail'))); }); - it(`should be copied by Psych Up, using the target's Dragon Cheer level`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'milotic', moves: ['dragoncheer', 'psychup', 'bubble']}, - {species: 'kingdra', moves: ['sleeptalk']}, + it(`should be copied by Psych Up, using the target's Dragon Cheer level`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'milotic', moves: ['dragoncheer', 'psychup', 'bubble'] }, + { species: 'kingdra', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wobbuffet', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wobbuffet', moves: ['sleeptalk'] }, ]]); battle.onEvent( 'ModifyCritRatio', battle.format, -99, - (critRatio) => assert.equal(critRatio, 3) + critRatio => assert.equal(critRatio, 3) ); battle.makeChoices('move dragoncheer -2, move sleeptalk', 'auto'); @@ -113,18 +113,18 @@ describe('Dragon Cheer', function () { battle.makeChoices('move bubble, move sleeptalk', 'auto'); }); - it(`should be copied by Psych Up, using the target's Dragon Cheer level and replacing the user's current critical hit stage`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'milotic', moves: ['dragoncheer', 'psychup', 'bubble', 'focusenergy']}, - {species: 'comfey', moves: ['sleeptalk']}, + it(`should be copied by Psych Up, using the target's Dragon Cheer level and replacing the user's current critical hit stage`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'milotic', moves: ['dragoncheer', 'psychup', 'bubble', 'focusenergy'] }, + { species: 'comfey', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wobbuffet', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wobbuffet', moves: ['sleeptalk'] }, ]]); battle.onEvent( 'ModifyCritRatio', battle.format, -99, - (critRatio) => assert.equal(critRatio, 2) + critRatio => assert.equal(critRatio, 2) ); battle.makeChoices('move focusenergy, move sleeptalk', 'auto'); @@ -133,18 +133,18 @@ describe('Dragon Cheer', function () { battle.makeChoices('move bubble, move sleeptalk', 'auto'); }); - it(`should be copied by Transform, using the target's Dragon Cheer level`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'milotic', moves: ['dragoncheer', 'transform']}, - {species: 'kingdra', moves: ['sleeptalk', 'bubble']}, + it(`should be copied by Transform, using the target's Dragon Cheer level`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'milotic', moves: ['dragoncheer', 'transform'] }, + { species: 'kingdra', moves: ['sleeptalk', 'bubble'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wobbuffet', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wobbuffet', moves: ['sleeptalk'] }, ]]); battle.onEvent( 'ModifyCritRatio', battle.format, -99, - (critRatio) => assert.equal(critRatio, 3) + critRatio => assert.equal(critRatio, 3) ); battle.makeChoices('move dragoncheer -2, move sleeptalk', 'auto'); diff --git a/test/sim/moves/dragondarts.js b/test/sim/moves/dragondarts.js index dda3e76f5e..317f337e90 100644 --- a/test/sim/moves/dragondarts.js +++ b/test/sim/moves/dragondarts.js @@ -5,28 +5,28 @@ const common = require('./../../common'); let battle; -describe('Dragon Darts', function () { - afterEach(function () { +describe('Dragon Darts', () => { + afterEach(() => { battle.destroy(); }); - it(`should hit twice in singles`, function () { + it(`should hit twice in singles`, () => { battle = common.createBattle([[ - {species: "Ninjask", moves: ['dragondarts']}, + { species: "Ninjask", moves: ['dragondarts'] }, ], [ - {species: "Mew", ability: 'stamina', moves: ['splash']}, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'def', 2); }); - it(`should hit each foe once in doubles`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ninjask", moves: ['dragondarts']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + it(`should hit each foe once in doubles`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ninjask", moves: ['dragondarts'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ], [ - {species: "Mew", ability: 'stamina', moves: ['splash']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[1], 'def', 0); @@ -34,13 +34,13 @@ describe('Dragon Darts', function () { assert.statStage(battle.p2.active[1], 'def', 1); }); - it(`should hit the other foe twice if it misses against one`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ninjask", item: 'blunderpolicy', moves: ['dragondarts']}, - {species: "Wynaut", ability: 'stamina', moves: ['splash']}, + it(`should hit the other foe twice if it misses against one`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ninjask", item: 'blunderpolicy', moves: ['dragondarts'] }, + { species: "Wynaut", ability: 'stamina', moves: ['splash'] }, ], [ - {species: "Mew", ability: 'stamina', moves: ['splash']}, - {species: "Shaymin", ability: 'stamina', moves: ['splash']}, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, + { species: "Shaymin", ability: 'stamina', moves: ['splash'] }, ]]); const ninjask = battle.p1.active[0]; @@ -49,7 +49,7 @@ describe('Dragon Darts', function () { const shaymin = battle.p2.active[1]; // Modding accuracy so Dragon Darts always misses Mew - battle.onEvent('Accuracy', battle.format, function (accuracy, target, source, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, source, move) => { return target.species.id !== 'mew'; }); @@ -61,13 +61,13 @@ describe('Dragon Darts', function () { assert.statStage(shaymin, 'def', 2); }); - it(`should hit itself and ally if it targets itself after Ally Switch`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ninjask", ability: 'stamina', moves: ['dragondarts']}, - {species: "Mew", ability: 'stamina', moves: ['allyswitch']}, + it(`should hit itself and ally if it targets itself after Ally Switch`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ninjask", ability: 'stamina', moves: ['dragondarts'] }, + { species: "Mew", ability: 'stamina', moves: ['allyswitch'] }, ], [ - {species: "Mew", ability: 'stamina', moves: ['splash']}, - {species: "Shaymin", ability: 'stamina', moves: ['splash']}, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, + { species: "Shaymin", ability: 'stamina', moves: ['splash'] }, ]]); battle.makeChoices('move dragondarts -2, move allyswitch', 'move splash, move splash'); assert.statStage(battle.p1.active[0], 'def', 1); @@ -76,13 +76,13 @@ describe('Dragon Darts', function () { assert.statStage(battle.p2.active[1], 'def', 0); }); - it(`should hit both targets even if one faints`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ninjask", moves: ['dragondarts']}, - {species: "Mew", moves: ['splash']}, + it(`should hit both targets even if one faints`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ninjask", moves: ['dragondarts'] }, + { species: "Mew", moves: ['splash'] }, ], [ - {species: "Shedinja", moves: ['splash']}, - {species: "Shedinja", moves: ['splash']}, + { species: "Shedinja", moves: ['splash'] }, + { species: "Shedinja", moves: ['splash'] }, ]]); battle.makeChoices(); battle.getDebugLog(); @@ -90,13 +90,13 @@ describe('Dragon Darts', function () { assert.equal(battle.p2.active[1].hp, 0); }); - it(`should hit the ally twice in doubles`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ninjask", moves: ['dragondarts']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + it(`should hit the ally twice in doubles`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ninjask", moves: ['dragondarts'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ], [ - {species: "Mew", ability: 'stamina', moves: ['splash']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ]]); battle.makeChoices('move dragondarts -2, move splash', 'move splash, move splash'); assert.statStage(battle.p1.active[1], 'def', 2); @@ -104,13 +104,13 @@ describe('Dragon Darts', function () { assert.statStage(battle.p2.active[1], 'def', 0); }); - it(`should smart-target the foe that's not Protecting in Doubles`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ninjask", moves: ['dragondarts']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + it(`should smart-target the foe that's not Protecting in Doubles`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ninjask", moves: ['dragondarts'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ], [ - {species: "Mew", ability: 'stamina', moves: ['protect']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + { species: "Mew", ability: 'stamina', moves: ['protect'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[1], 'def', 0); @@ -118,13 +118,13 @@ describe('Dragon Darts', function () { assert.statStage(battle.p2.active[1], 'def', 2); }); - it(`should be able to be redirected`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Ninjask", moves: ['dragondarts']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + it(`should be able to be redirected`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Ninjask", moves: ['dragondarts'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ], [ - {species: "Mew", ability: 'stamina', moves: ['ragepowder']}, - {species: "Mew", ability: 'stamina', moves: ['splash']}, + { species: "Mew", ability: 'stamina', moves: ['ragepowder'] }, + { species: "Mew", ability: 'stamina', moves: ['splash'] }, ]]); battle.makeChoices(); assert.statStage(battle.p1.active[1], 'def', 0); @@ -132,16 +132,16 @@ describe('Dragon Darts', function () { assert.statStage(battle.p2.active[1], 'def', 0); }); - it('should hit one target twice if the other is protected by an ability', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"]}, - {species: "Grimmsnarl", ability: "Prankster", moves: ["electrify"]}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"]}, - {species: "Emolga", ability: "Motor Drive", moves: ["sleeptalk"]}, - ]}); + it('should hit one target twice if the other is protected by an ability', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"] }, + { species: "Grimmsnarl", ability: "Prankster", moves: ["electrify"] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"] }, + { species: "Emolga", ability: "Motor Drive", moves: ["sleeptalk"] }, + ] }); battle.makeChoices('move dragondarts 2, move electrify -1', 'move sleeptalk, move sleeptalk'); assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); @@ -151,48 +151,48 @@ describe('Dragon Darts', function () { assert.statStage(battle.p2.active[1], 'spe', 1); }); - it('should hit one target twice if the other is immunue', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"]}, - {species: "Ludicolo", ability: "Dancer", moves: ["sleeptalk"]}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"]}, - {species: "Clefairy", ability: "Ripen", moves: ["sleeptalk"]}, - ]}); + it('should hit one target twice if the other is immunue', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"] }, + { species: "Ludicolo", ability: "Dancer", moves: ["sleeptalk"] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"] }, + { species: "Clefairy", ability: "Ripen", moves: ["sleeptalk"] }, + ] }); battle.makeChoices('move dragondarts 2, move sleeptalk', 'move sleeptalk, move sleeptalk'); assert.statStage(battle.p2.active[0], 'def', 2); assert.equal(battle.p2.active[1].hp, battle.p2.active[1].maxhp); }); - it('should hit one target twice if the other is semi-invulnerable', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Dragapult", item: "Lagging Tail", ability: "Clear Body", moves: ["dragondarts"]}, - {species: "Ludicolo", ability: "Dancer", moves: ["sleeptalk"]}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"]}, - {species: "Golurk", ability: "Ripen", moves: ["phantomforce"]}, - ]}); + it('should hit one target twice if the other is semi-invulnerable', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Dragapult", item: "Lagging Tail", ability: "Clear Body", moves: ["dragondarts"] }, + { species: "Ludicolo", ability: "Dancer", moves: ["sleeptalk"] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"] }, + { species: "Golurk", ability: "Ripen", moves: ["phantomforce"] }, + ] }); battle.makeChoices('move dragondarts 2, move sleeptalk', 'move sleeptalk, move phantomforce 1'); assert.statStage(battle.p2.active[0], 'def', 2); assert.equal(battle.p2.active[1].hp, battle.p2.active[1].maxhp); }); - it('should hit one target twice if the other is fainted', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"]}, - {species: "Ludicolo", ability: "Dancer", moves: ["sleeptalk"]}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"]}, - {species: "Snom", ability: "Ripen", moves: ["sleeptalk"]}, - ]}); + it('should hit one target twice if the other is fainted', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"] }, + { species: "Ludicolo", ability: "Dancer", moves: ["sleeptalk"] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"] }, + { species: "Snom", ability: "Ripen", moves: ["sleeptalk"] }, + ] }); battle.p2.active[1].faint(); battle.makeChoices('move dragondarts 2, move sleeptalk', 'move sleeptalk, move sleeptalk'); @@ -201,16 +201,16 @@ describe('Dragon Darts', function () { assert.equal(battle.p2.active[1].hp, 0); }); - it('should hit one target twice if the other is Dark type and Dragon Darts is Prankster boosted', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Dragapult", ability: "Clear Body", moves: ["sleeptalk", "dragondarts"]}, - {species: "Liepard", ability: "Prankster", moves: ["assist"]}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"]}, - {species: "Spiritomb", ability: "Infiltrator", moves: ["sleeptalk"]}, - ]}); + it('should hit one target twice if the other is Dark type and Dragon Darts is Prankster boosted', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Dragapult", ability: "Clear Body", moves: ["sleeptalk", "dragondarts"] }, + { species: "Liepard", ability: "Prankster", moves: ["assist"] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arcanine", ability: "Stamina", moves: ["sleeptalk"] }, + { species: "Spiritomb", ability: "Infiltrator", moves: ["sleeptalk"] }, + ] }); battle.makeChoices(); @@ -218,17 +218,17 @@ describe('Dragon Darts', function () { assert.equal(battle.p2.active[1].hp, battle.p2.active[1].maxhp); }); - it('should fail if both targets are fainted', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"]}, - {species: "Ludicolo", ability: "Dancer", moves: ["celebrate"]}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arcanine", ability: "Flash Fire", moves: ["celebrate"]}, - {species: "Arcanine", ability: "Flash Fire", moves: ["celebrate"]}, - {species: "Arcanine", ability: "Flash Fire", moves: ["celebrate"]}, - ]}); + it('should fail if both targets are fainted', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Dragapult", ability: "Clear Body", moves: ["dragondarts"] }, + { species: "Ludicolo", ability: "Dancer", moves: ["celebrate"] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arcanine", ability: "Flash Fire", moves: ["celebrate"] }, + { species: "Arcanine", ability: "Flash Fire", moves: ["celebrate"] }, + { species: "Arcanine", ability: "Flash Fire", moves: ["celebrate"] }, + ] }); battle.p2.active[0].faint(); battle.p2.active[1].faint(); diff --git a/test/sim/moves/echoedvoice.js b/test/sim/moves/echoedvoice.js index d16b7ea9a3..0f224a3d62 100644 --- a/test/sim/moves/echoedvoice.js +++ b/test/sim/moves/echoedvoice.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Echoed Voice', function () { - afterEach(function () { +describe('Echoed Voice', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'echoedvoice']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'echoedvoice'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move echoedvoice', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); }); -describe('Echoed Voice [Gen 5]', function () { - afterEach(function () { +describe('Echoed Voice [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'echoedvoice']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'echoedvoice'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move echoedvoice', 'move rest'); diff --git a/test/sim/moves/electricterrain.js b/test/sim/moves/electricterrain.js index f3e5183dc8..2aa2f3fe84 100644 --- a/test/sim/moves/electricterrain.js +++ b/test/sim/moves/electricterrain.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Electric Terrain', function () { - afterEach(function () { +describe('Electric Terrain', () => { + afterEach(() => { battle.destroy(); }); - it('should change the current terrain to Electric Terrain for five turns', function () { + it('should change the current terrain to Electric Terrain for five turns', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mist', 'electricterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mist']}]}); + battle.setPlayer('p1', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mist', 'electricterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mist'] }] }); battle.makeChoices('move electricterrain', 'move mist'); assert(battle.field.isTerrain('electricterrain')); battle.makeChoices('move electricterrain', 'move mist'); @@ -26,10 +26,10 @@ describe('Electric Terrain', function () { assert(battle.field.isTerrain('')); }); - it('should increase the base power of Electric-type attacks used by grounded Pokemon', function () { + it('should increase the base power of Electric-type attacks used by grounded Pokemon', () => { battle = common.gen(7).createBattle(); - battle.setPlayer('p1', {team: [{species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Thundurus", ability: 'defiant', moves: ['thunderwave']}]}); + battle.setPlayer('p1', { team: [{ species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Thundurus", ability: 'defiant', moves: ['thunderwave'] }] }); battle.makeChoices('move electricterrain', 'move thunderwave'); let basePower; const move = Dex.moves.get('thunderbolt'); @@ -39,68 +39,68 @@ describe('Electric Terrain', function () { assert.equal(basePower, move.basePower); }); - it('should prevent moves from putting grounded Pokemon to sleep', function () { + it('should prevent moves from putting grounded Pokemon to sleep', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain', 'spore']}]}); - battle.setPlayer('p2', {team: [{species: "Abra", ability: 'magicguard', moves: ['telekinesis', 'spore']}]}); + battle.setPlayer('p1', { team: [{ species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain', 'spore'] }] }); + battle.setPlayer('p2', { team: [{ species: "Abra", ability: 'magicguard', moves: ['telekinesis', 'spore'] }] }); battle.makeChoices('move electricterrain', 'move telekinesis'); battle.makeChoices('move spore', 'move spore'); assert.equal(battle.p1.active[0].status, 'slp'); assert.equal(battle.p2.active[0].status, ''); }); - it('should not remove active non-volatile statuses from grounded Pokemon', function () { + it('should not remove active non-volatile statuses from grounded Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Jolteon", ability: 'voltabsorb', moves: ['sleeptalk', 'electricterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Whimsicott", ability: 'prankster', moves: ['spore']}]}); + battle.setPlayer('p1', { team: [{ species: "Jolteon", ability: 'voltabsorb', moves: ['sleeptalk', 'electricterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Whimsicott", ability: 'prankster', moves: ['spore'] }] }); battle.makeChoices('move sleeptalk', 'move spore'); assert.equal(battle.p1.active[0].status, 'slp'); }); - it('should prevent Yawn from putting grounded Pokemon to sleep, and cause Yawn to fail', function () { + it('should prevent Yawn from putting grounded Pokemon to sleep, and cause Yawn to fail', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain', 'yawn']}]}); - battle.setPlayer('p2', {team: [{species: "Sableye", ability: 'prankster', moves: ['yawn']}]}); + battle.setPlayer('p1', { team: [{ species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain', 'yawn'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sableye", ability: 'prankster', moves: ['yawn'] }] }); battle.makeChoices('move electricterrain', 'move yawn'); battle.makeChoices('move yawn', 'move yawn'); assert.equal(battle.p1.active[0].status, ''); assert(!battle.p2.active[0].volatiles['yawn']); }); - it('should cause Rest to fail on grounded Pokemon', function () { + it('should cause Rest to fail on grounded Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Jolteon", ability: 'shellarmor', moves: ['electricterrain', 'rest']}]}); - battle.setPlayer('p2', {team: [{species: "Pidgeot", ability: 'keeneye', moves: ['doubleedge', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Jolteon", ability: 'shellarmor', moves: ['electricterrain', 'rest'] }] }); + battle.setPlayer('p2', { team: [{ species: "Pidgeot", ability: 'keeneye', moves: ['doubleedge', 'rest'] }] }); battle.makeChoices('move electricterrain', 'move doubleedge'); battle.makeChoices('move rest', 'move rest'); assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); assert.equal(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should not affect Pokemon in a semi-invulnerable state', function () { + it('should not affect Pokemon in a semi-invulnerable state', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['yawn', 'skydrop']}]}); - battle.setPlayer('p2', {team: [{species: "Sableye", ability: 'prankster', moves: ['yawn', 'electricterrain']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['yawn', 'skydrop'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sableye", ability: 'prankster', moves: ['yawn', 'electricterrain'] }] }); battle.makeChoices('move yawn', 'move yawn'); battle.makeChoices('move skydrop', 'move electricterrain'); assert.equal(battle.p1.active[0].status, 'slp'); assert.equal(battle.p2.active[0].status, 'slp'); }); - it('should cause Nature Power to become Thunderbolt', function () { + it('should cause Nature Power to become Thunderbolt', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Shuckle", ability: 'sturdy', moves: ['naturepower']}]}); + battle.setPlayer('p1', { team: [{ species: "Jolteon", ability: 'voltabsorb', moves: ['electricterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Shuckle", ability: 'sturdy', moves: ['naturepower'] }] }); battle.makeChoices('move electricterrain', 'move naturepower'); const resultMove = toID(battle.log[battle.lastMoveLine].split('|')[3]); assert.equal(resultMove, 'thunderbolt'); }); - it.skip(`should block Sleep before the move would have missed`, function () { + it.skip(`should block Sleep before the move would have missed`, () => { battle = common.createBattle([[ - {species: 'tapukoko', moves: ['electricterrain']}, + { species: 'tapukoko', moves: ['electricterrain'] }, ], [ - {species: 'venusaur', moves: ['sleeppowder']}, + { species: 'venusaur', moves: ['sleeppowder'] }, ]]); // Modding accuracy so Sleep Powder always misses battle.onEvent('Accuracy', battle.format, false); diff --git a/test/sim/moves/embargo.js b/test/sim/moves/embargo.js index ce8b57ec12..2611994790 100644 --- a/test/sim/moves/embargo.js +++ b/test/sim/moves/embargo.js @@ -5,50 +5,50 @@ const common = require('./../../common'); let battle; -describe('Embargo', function () { - afterEach(function () { +describe('Embargo', () => { + afterEach(() => { battle.destroy(); }); - it('should negate residual healing events', function () { + it('should negate residual healing events', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Lopunny", ability: 'limber', item: 'leftovers', moves: ['bellydrum']}]}); - battle.setPlayer('p2', {team: [{species: "Giratina", ability: 'pressure', moves: ['embargo']}]}); + battle.setPlayer('p1', { team: [{ species: "Lopunny", ability: 'limber', item: 'leftovers', moves: ['bellydrum'] }] }); + battle.setPlayer('p2', { team: [{ species: "Giratina", ability: 'pressure', moves: ['embargo'] }] }); battle.makeChoices('move bellydrum', 'move embargo'); assert.equal(battle.p1.active[0].hp, Math.ceil(battle.p1.active[0].maxhp / 2)); }); - it('should prevent items from being consumed', function () { + it('should prevent items from being consumed', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Lopunny", ability: 'limber', item: 'chopleberry', moves: ['bulkup']}]}); - battle.setPlayer('p2', {team: [{species: "Golem", ability: 'noguard', moves: ['embargo', 'lowkick']}]}); + battle.setPlayer('p1', { team: [{ species: "Lopunny", ability: 'limber', item: 'chopleberry', moves: ['bulkup'] }] }); + battle.setPlayer('p2', { team: [{ species: "Golem", ability: 'noguard', moves: ['embargo', 'lowkick'] }] }); battle.makeChoices('move bulkup', 'move embargo'); battle.makeChoices('move bulkup', 'move lowkick'); assert.equal(battle.p1.active[0].item, 'chopleberry'); }); - it('should ignore the effects of items that disable moves', function () { + it('should ignore the effects of items that disable moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Lopunny", ability: 'limber', item: 'assaultvest', moves: ['protect']}]}); - battle.setPlayer('p2', {team: [{species: "Golem", ability: 'noguard', moves: ['embargo']}]}); + battle.setPlayer('p1', { team: [{ species: "Lopunny", ability: 'limber', item: 'assaultvest', moves: ['protect'] }] }); + battle.setPlayer('p2', { team: [{ species: "Golem", ability: 'noguard', moves: ['embargo'] }] }); battle.makeChoices('default', 'move embargo'); assert.equal(battle.p1.active[0].lastMove.id, 'struggle'); battle.makeChoices('default', 'move embargo'); assert.equal(battle.p1.active[0].lastMove.id, 'protect'); }); - it('should cause Fling to fail', function () { + it('should cause Fling to fail', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Lopunny", ability: 'limber', item: 'seaincense', moves: ['fling']}]}); - battle.setPlayer('p2', {team: [{species: "Sableye", ability: 'prankster', moves: ['embargo']}]}); + battle.setPlayer('p1', { team: [{ species: "Lopunny", ability: 'limber', item: 'seaincense', moves: ['fling'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sableye", ability: 'prankster', moves: ['embargo'] }] }); battle.makeChoices('move fling', 'move embargo'); assert.equal(battle.p1.active[0].item, 'seaincense'); }); - it('should not prevent Pokemon from Mega Evolving', function () { + it('should not prevent Pokemon from Mega Evolving', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Lopunny", ability: 'limber', item: 'lopunnite', moves: ['bulkup']}]}); - battle.setPlayer('p2', {team: [{species: "Golem", ability: 'noguard', moves: ['embargo', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Lopunny", ability: 'limber', item: 'lopunnite', moves: ['bulkup'] }] }); + battle.setPlayer('p2', { team: [{ species: "Golem", ability: 'noguard', moves: ['embargo', 'rest'] }] }); battle.makeChoices('move bulkup', 'move embargo'); battle.makeChoices('move bulkup mega', 'move rest'); assert.equal(battle.p1.active[0].species.id, 'lopunnymega'); diff --git a/test/sim/moves/encore.js b/test/sim/moves/encore.js index c4ceb29e04..b749efa374 100644 --- a/test/sim/moves/encore.js +++ b/test/sim/moves/encore.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Encore', function () { - afterEach(function () { +describe('Encore', () => { + afterEach(() => { battle.destroy(); }); - it(`should cause the target to be forced to repeat its move`, function () { + it(`should cause the target to be forced to repeat its move`, () => { battle = common.createBattle([[ - {species: 'slowbro', moves: ['tackle', 'irondefense']}, + { species: 'slowbro', moves: ['tackle', 'irondefense'] }, ], [ - {species: 'whimsicott', moves: ['encore', 'sleeptalk']}, + { species: 'whimsicott', moves: ['encore', 'sleeptalk'] }, ]]); const whims = battle.p2.active[0]; @@ -25,13 +25,13 @@ describe('Encore', function () { assert.cantMove(() => battle.choose('p1', 'move tackle')); }); - it(`should cause the target to move with its Encored attack at the priority of the originally selected move once`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'regieleki', moves: ['sleeptalk', 'substitute']}, - {species: 'pichu', moves: ['sleeptalk']}, + it(`should cause the target to move with its Encored attack at the priority of the originally selected move once`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'regieleki', moves: ['sleeptalk', 'substitute'] }, + { species: 'pichu', moves: ['sleeptalk'] }, ], [ - {species: 'whimsicott', ability: 'prankster', moves: ['sleeptalk', 'encore']}, - {species: 'terrakion', moves: ['quickattack', 'headlongrush']}, + { species: 'whimsicott', ability: 'prankster', moves: ['sleeptalk', 'encore'] }, + { species: 'terrakion', moves: ['quickattack', 'headlongrush'] }, ]]); const eleki = battle.p1.active[0]; @@ -41,13 +41,13 @@ describe('Encore', function () { assert.fainted(eleki, `Encore + Quick Attack being selected gives Headlong Rush priority.`); }); - it(`should cause the target to move with its Encored attack at the priority of the originally selected move once and get blocked when appropriate`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'regieleki', moves: ['psychicterrain']}, - {species: 'pichu', moves: ['sleeptalk']}, + it(`should cause the target to move with its Encored attack at the priority of the originally selected move once and get blocked when appropriate`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'regieleki', moves: ['psychicterrain'] }, + { species: 'pichu', moves: ['sleeptalk'] }, ], [ - {species: 'whimsicott', ability: 'prankster', moves: ['sleeptalk', 'encore']}, - {species: 'terrakion', moves: ['quickattack', 'headlongrush']}, + { species: 'whimsicott', ability: 'prankster', moves: ['sleeptalk', 'encore'] }, + { species: 'terrakion', moves: ['quickattack', 'headlongrush'] }, ]]); const eleki = battle.p1.active[0]; @@ -59,15 +59,15 @@ describe('Encore', function () { assert.fainted(eleki, `Headlong Rush should no longer be moving with priority.`); }); - it('should not affect Focus Punch if the the user\'s decision is not changed', function () { - battle = common.createBattle({gameType: 'doubles'}, [ + it('should not affect Focus Punch if the the user\'s decision is not changed', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ [ - {species: "Smeargle", level: 50, ability: 'owntempo', moves: ['splash', 'focuspunch']}, - {species: "Abra", level: 1, ability: 'innerfocus', moves: ['knockoff', 'teleport']}, + { species: "Smeargle", level: 50, ability: 'owntempo', moves: ['splash', 'focuspunch'] }, + { species: "Abra", level: 1, ability: 'innerfocus', moves: ['knockoff', 'teleport'] }, ], [ - {species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['encore', 'splash']}, - {species: "Zigzagoon", level: 1, ability: 'pickup', moves: ['extremespeed']}, + { species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['encore', 'splash'] }, + { species: "Zigzagoon", level: 1, ability: 'pickup', moves: ['extremespeed'] }, ], ]); @@ -86,14 +86,14 @@ describe('Encore', function () { assert.equal(battle.p2.active[0].hp, hp); }); - it(`should make Focus Punch always succeed if it changes the user's decision`, function () { + it(`should make Focus Punch always succeed if it changes the user's decision`, () => { // Hardcoded RNG seed so the random target from Encored Focus Punch will not attack Zigzagoon - battle = common.createBattle({gameType: 'doubles', seed: [1, 2, 3, 4]}, [[ - {species: 'Smeargle', level: 50, moves: ['splash', 'focuspunch']}, - {species: 'Abra', level: 1, moves: ['knockoff', 'teleport']}, + battle = common.createBattle({ gameType: 'doubles', seed: [1, 2, 3, 4] }, [[ + { species: 'Smeargle', level: 50, moves: ['splash', 'focuspunch'] }, + { species: 'Abra', level: 1, moves: ['knockoff', 'teleport'] }, ], [ - {species: 'Smeargle', item: 'laggingtail', moves: ['encore', 'splash']}, - {species: 'Zigzagoon', level: 1, moves: ['extremespeed']}, + { species: 'Smeargle', item: 'laggingtail', moves: ['encore', 'splash'] }, + { species: 'Zigzagoon', level: 1, moves: ['extremespeed'] }, ]]); battle.makeChoices('move focuspunch 1, move knockoff 1', 'move splash, move extremespeed 2'); @@ -113,15 +113,15 @@ describe('Encore', function () { assert.equal(p2smeargle.hp, hp); }); - it('should not affect Shell Trap if the user\'s decision is not changed', function () { - battle = common.createBattle({gameType: 'doubles'}, [ + it('should not affect Shell Trap if the user\'s decision is not changed', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ [ - {species: "Smeargle", level: 99, ability: 'owntempo', moves: ['shelltrap', 'splash']}, - {species: "Abra", level: 1, ability: 'innerfocus', moves: ['knockoff', 'teleport']}, + { species: "Smeargle", level: 99, ability: 'owntempo', moves: ['shelltrap', 'splash'] }, + { species: "Abra", level: 1, ability: 'innerfocus', moves: ['knockoff', 'teleport'] }, ], [ - {species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['encore', 'splash']}, - {species: "Zigzagoon", ability: 'pickup', item: 'assaultvest', moves: ['quickattack']}, + { species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['encore', 'splash'] }, + { species: "Zigzagoon", ability: 'pickup', item: 'assaultvest', moves: ['quickattack'] }, ], ]); @@ -141,15 +141,15 @@ describe('Encore', function () { assert.notEqual(battle.p2.active[0].hp, hp); }); - it('should make Shell Trap always fail if the user\'s decision is changed', function () { - battle = common.createBattle({gameType: 'doubles'}, [ + it('should make Shell Trap always fail if the user\'s decision is changed', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ [ - {species: "Smeargle", level: 99, ability: 'owntempo', moves: ['splash', 'shelltrap']}, - {species: "Abra", level: 1, ability: 'innerfocus', moves: ['knockoff', 'teleport']}, + { species: "Smeargle", level: 99, ability: 'owntempo', moves: ['splash', 'shelltrap'] }, + { species: "Abra", level: 1, ability: 'innerfocus', moves: ['knockoff', 'teleport'] }, ], [ - {species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['encore', 'splash']}, - {species: "Zigzagoon", ability: 'pickup', item: 'assaultvest', moves: ['quickattack']}, + { species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['encore', 'splash'] }, + { species: "Zigzagoon", ability: 'pickup', item: 'assaultvest', moves: ['quickattack'] }, ], ]); @@ -169,13 +169,13 @@ describe('Encore', function () { assert.notEqual(battle.p2.active[0].hp, hp); }); - it(`should not cause self-targeting moves to redirect to the opponent`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Wynaut", moves: ['destinybond', 'counter']}, - {species: "Octillery", moves: ['sleeptalk']}, + it(`should not cause self-targeting moves to redirect to the opponent`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Wynaut", moves: ['destinybond', 'counter'] }, + { species: "Octillery", moves: ['sleeptalk'] }, ], [ - {species: "Raichu", moves: ['sleeptalk', 'encore']}, - {species: "Raichu", moves: ['sleeptalk', 'aerialace']}, + { species: "Raichu", moves: ['sleeptalk', 'encore'] }, + { species: "Raichu", moves: ['sleeptalk', 'aerialace'] }, ]]); battle.makeChoices(); @@ -185,17 +185,17 @@ describe('Encore', function () { }); }); -describe('Encore [Gen 2]', function () { - afterEach(function () { +describe('Encore [Gen 2]', () => { + afterEach(() => { battle.destroy(); }); - it(`[Gen 2] Encore succeeds when used against an opponent that last attacked before the Encore user switched in`, function () { - battle = common.gen(2).createBattle({forceRandomChance: true}, [[ - {species: 'slowbro', moves: ['glare']}, - {species: 'fearow', moves: ['encore']}, + it(`[Gen 2] Encore succeeds when used against an opponent that last attacked before the Encore user switched in`, () => { + battle = common.gen(2).createBattle({ forceRandomChance: true }, [[ + { species: 'slowbro', moves: ['glare'] }, + { species: 'fearow', moves: ['encore'] }, ], [ - {species: 'chansey', moves: ['seismictoss']}, + { species: 'chansey', moves: ['seismictoss'] }, ]]); const chansey = battle.p2.active[0]; battle.makeChoices(); diff --git a/test/sim/moves/explosion.js b/test/sim/moves/explosion.js index 00cdfe37f6..c3fbeddccb 100644 --- a/test/sim/moves/explosion.js +++ b/test/sim/moves/explosion.js @@ -5,49 +5,49 @@ const common = require('../../common'); let battle; -describe('Explosion', function () { - afterEach(function () { +describe('Explosion', () => { + afterEach(() => { battle.destroy(); }); - it('should not halve defense in current gens', function () { + it('should not halve defense in current gens', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Metagross", nature: "Adamant", moves: ['explosion']}]}); - battle.setPlayer('p2', {team: [{species: "Hippowdon", nature: "Impish", evs: {hp: 252, def: 252}, moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Metagross", nature: "Adamant", moves: ['explosion'] }] }); + battle.setPlayer('p2', { team: [{ species: "Hippowdon", nature: "Impish", evs: { hp: 252, def: 252 }, moves: ['splash'] }] }); battle.makeChoices('move explosion', 'move splash'); const hippo = battle.p2.active[0]; const damage = hippo.maxhp - hippo.hp; assert.bounded(damage, [164, 193]); }); - it('should halve defense in old gens', function () { + it('should halve defense in old gens', () => { battle = common.gen(4).createBattle(); - battle.setPlayer('p1', {team: [{species: "Metagross", nature: "Adamant", moves: ['explosion']}]}); - battle.setPlayer('p2', {team: [{species: "Hippowdon", nature: "Impish", evs: {hp: 252, def: 252}, moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Metagross", nature: "Adamant", moves: ['explosion'] }] }); + battle.setPlayer('p2', { team: [{ species: "Hippowdon", nature: "Impish", evs: { hp: 252, def: 252 }, moves: ['splash'] }] }); battle.makeChoices('move explosion', 'move splash'); const hippo = battle.p2.active[0]; const damage = hippo.maxhp - hippo.hp; assert.bounded(damage, [327, 385]); }); - it(`[Gen 1] Explosion should build rage, even if it misses`, function () { + it(`[Gen 1] Explosion should build rage, even if it misses`, () => { // Explosion hits battle = common.gen(1).createBattle([[ - {species: 'golem', moves: ['explosion']}, + { species: 'golem', moves: ['explosion'] }, ], [ - {species: 'aerodactyl', moves: ['rage']}, + { species: 'aerodactyl', moves: ['rage'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-boost|'))); // Explosion misses battle = common.gen(1).createBattle([[ - {species: 'golem', moves: ['explosion']}, + { species: 'golem', moves: ['explosion'] }, ], [ - {species: 'aerodactyl', moves: ['rage']}, + { species: 'aerodactyl', moves: ['rage'] }, ]]); // Modding accuracy so Explosion always misses - battle.onEvent('Accuracy', battle.format, function (accuracy, target, pokemon, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, pokemon, move) => { return move.id === 'rage'; }); battle.makeChoices('move explosion', 'move rage'); @@ -55,20 +55,20 @@ describe('Explosion', function () { // Explosion misses against a Ghost-type battle = common.gen(1).createBattle([[ - {species: 'golem', moves: ['explosion']}, + { species: 'golem', moves: ['explosion'] }, ], [ - {species: 'gastly', moves: ['rage']}, + { species: 'gastly', moves: ['rage'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-boost|'))); }); - it(`[Gen 1] Explosion should faint the user when the target is semi-invulnerable`, function () { + it(`[Gen 1] Explosion should faint the user when the target is semi-invulnerable`, () => { // Explosion hits battle = common.gen(1).createBattle([[ - {species: 'golem', moves: ['explosion']}, + { species: 'golem', moves: ['explosion'] }, ], [ - {species: 'aerodactyl', moves: ['fly']}, + { species: 'aerodactyl', moves: ['fly'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); diff --git a/test/sim/moves/fakeout.js b/test/sim/moves/fakeout.js index 7e84c48466..c23fc015de 100644 --- a/test/sim/moves/fakeout.js +++ b/test/sim/moves/fakeout.js @@ -5,26 +5,26 @@ const common = require('./../../common'); let battle; -describe('Fake Out', function () { - afterEach(function () { +describe('Fake Out', () => { + afterEach(() => { battle.destroy(); }); - it('should flinch on the first turn out', function () { + it('should flinch on the first turn out', () => { battle = common.createBattle([[ - {species: 'Chansey', ability: 'naturalcure', moves: ['fakeout']}, + { species: 'Chansey', ability: 'naturalcure', moves: ['fakeout'] }, ], [ - {species: 'Venusaur', ability: 'overgrow', moves: ['swift']}, + { species: 'Venusaur', ability: 'overgrow', moves: ['swift'] }, ]]); battle.makeChoices('move fakeout', 'move swift'); assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should not flinch on the second turn out', function () { + it('should not flinch on the second turn out', () => { battle = common.createBattle([[ - {species: 'Chansey', ability: 'naturalcure', moves: ['fakeout']}, + { species: 'Chansey', ability: 'naturalcure', moves: ['fakeout'] }, ], [ - {species: 'Venusaur', ability: 'overgrow', moves: ['swift']}, + { species: 'Venusaur', ability: 'overgrow', moves: ['swift'] }, ]]); battle.makeChoices('move fakeout', 'move swift'); assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); @@ -32,12 +32,12 @@ describe('Fake Out', function () { assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should flinch after switching out and back in to refresh the move', function () { + it('should flinch after switching out and back in to refresh the move', () => { battle = common.createBattle([[ - {species: 'Chansey', ability: 'naturalcure', moves: ['fakeout']}, - {species: 'Blissey', ability: 'naturalcure', moves: ['fakeout']}, + { species: 'Chansey', ability: 'naturalcure', moves: ['fakeout'] }, + { species: 'Blissey', ability: 'naturalcure', moves: ['fakeout'] }, ], [ - {species: 'Venusaur', ability: 'overgrow', moves: ['swift', 'sleeptalk']}, + { species: 'Venusaur', ability: 'overgrow', moves: ['swift', 'sleeptalk'] }, ]]); battle.makeChoices('move fakeout', 'move swift'); battle.makeChoices('switch 2', 'move sleeptalk'); @@ -46,23 +46,23 @@ describe('Fake Out', function () { assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should not flinch if the user has already used a Dancer move first', function () { + it('should not flinch if the user has already used a Dancer move first', () => { battle = common.createBattle([[ - {species: 'Chansey', ability: 'naturalcure', moves: ['fakeout']}, - {species: 'Oricorio', ability: 'dancer', moves: ['fakeout']}, + { species: 'Chansey', ability: 'naturalcure', moves: ['fakeout'] }, + { species: 'Oricorio', ability: 'dancer', moves: ['fakeout'] }, ], [ - {species: 'Venusaur', ability: 'overgrow', moves: ['swift', 'quiverdance']}, + { species: 'Venusaur', ability: 'overgrow', moves: ['swift', 'quiverdance'] }, ]]); battle.makeChoices('switch 2', 'move quiverdance'); battle.makeChoices('move fakeout', 'move swift'); assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should not flinch if the target had prepared to Focus Punch', function () { + it('should not flinch if the target had prepared to Focus Punch', () => { battle = common.createBattle([[ - {species: 'Hitmontop', ability: 'steadfast', moves: ['fakeout']}, + { species: 'Hitmontop', ability: 'steadfast', moves: ['fakeout'] }, ], [ - {species: 'Gallade', ability: 'steadfast', moves: ['focuspunch']}, + { species: 'Gallade', ability: 'steadfast', moves: ['focuspunch'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].boosts.spe, 0); diff --git a/test/sim/moves/fellstinger.js b/test/sim/moves/fellstinger.js index d25dd29537..c2e54fe3c5 100644 --- a/test/sim/moves/fellstinger.js +++ b/test/sim/moves/fellstinger.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Fell Stringer', function () { - afterEach(function () { +describe('Fell Stringer', () => { + afterEach(() => { battle.destroy(); }); - it('should get a boost when KOing a Pokemon after redirection', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'joltik', moves: ['fellstinger']}, - {species: 'wynaut', moves: ['sleeptalk']}, + it('should get a boost when KOing a Pokemon after redirection', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'joltik', moves: ['fellstinger'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'pichu', level: 1, moves: ['followme']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'pichu', level: 1, moves: ['followme'] }, ]]); battle.makeChoices("move fellstinger 1, move sleeptalk", "move sleeptalk, move followme"); assert.statStage(battle.p1.active[0], 'atk', 3); diff --git a/test/sim/moves/fling.js b/test/sim/moves/fling.js index 95f3783e79..8271905f58 100644 --- a/test/sim/moves/fling.js +++ b/test/sim/moves/fling.js @@ -5,46 +5,46 @@ const common = require('./../../common'); let battle; -describe('Fling', function () { - afterEach(function () { +describe('Fling', () => { + afterEach(() => { battle.destroy(); }); - it(`should consume the user's item after being flung`, function () { + it(`should consume the user's item after being flung`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'ironball', moves: ['fling']}, + { species: 'wynaut', item: 'ironball', moves: ['fling'] }, ], [ - {species: 'cleffa', moves: ['protect']}, + { species: 'cleffa', moves: ['protect'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].item, ''); }); - it(`should apply custom effects when certain items are flung`, function () { + it(`should apply custom effects when certain items are flung`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'flameorb', moves: ['fling']}, + { species: 'wynaut', item: 'flameorb', moves: ['fling'] }, ], [ - {species: 'cleffa', moves: ['sleeptalk']}, + { species: 'cleffa', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].status, 'brn'); }); - it(`should not be usuable in Magic Room`, function () { + it(`should not be usuable in Magic Room`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'ironball', moves: ['fling']}, + { species: 'wynaut', item: 'ironball', moves: ['fling'] }, ], [ - {species: 'cleffa', moves: ['magicroom']}, + { species: 'cleffa', moves: ['magicroom'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].item, 'ironball'); }); - it(`should use its item to be flung in damage calculations`, function () { + it(`should use its item to be flung in damage calculations`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'lifeorb', moves: ['fling']}, + { species: 'wynaut', item: 'lifeorb', moves: ['fling'] }, ], [ - {species: 'cleffa', moves: ['sleeptalk']}, + { species: 'cleffa', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -57,12 +57,12 @@ describe('Fling', function () { assert.fullHP(battle.p1.active[0]); }); - it.skip(`should Fling, not consume Leppa Berry when using 1 PP Leppa Berry Fling`, function () { + it.skip(`should Fling, not consume Leppa Berry when using 1 PP Leppa Berry Fling`, () => { // Currently depends on RNG when it should not battle = common.createBattle([[ - {species: 'wynaut', moves: ['fling']}, + { species: 'wynaut', moves: ['fling'] }, ], [ - {species: 'clefable', item: 'leppaberry', moves: ['trick']}, + { species: 'clefable', item: 'leppaberry', moves: ['trick'] }, ]]); const wynaut = battle.p1.active[0]; const cleffa = battle.p2.active[0]; diff --git a/test/sim/moves/focuspunch.js b/test/sim/moves/focuspunch.js index 9f9f2db9f0..a794d189f8 100644 --- a/test/sim/moves/focuspunch.js +++ b/test/sim/moves/focuspunch.js @@ -5,57 +5,57 @@ const common = require('./../../common'); let battle; -describe('Focus Punch', function () { - afterEach(function () { +describe('Focus Punch', () => { + afterEach(() => { battle.destroy(); }); - it(`should cause the user to lose focus if hit by an attacking move`, function () { + it(`should cause the user to lose focus if hit by an attacking move`, () => { battle = common.createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['magicalleaf']}, + { species: 'Venusaur', moves: ['magicalleaf'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p2.active[0]); }); - it(`should not cause the user to lose focus if hit by a status move`, function () { + it(`should not cause the user to lose focus if hit by a status move`, () => { battle = common.createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['growl']}, + { species: 'Venusaur', moves: ['growl'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it(`should not cause the user to lose focus if hit while behind a substitute`, function () { + it(`should not cause the user to lose focus if hit while behind a substitute`, () => { battle = common.createBattle([[ - {species: 'Chansey', moves: ['substitute', 'focuspunch']}, + { species: 'Chansey', moves: ['substitute', 'focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['magicalleaf']}, + { species: 'Venusaur', moves: ['magicalleaf'] }, ]]); battle.makeChoices(); battle.makeChoices('move focuspunch', 'auto'); assert.false.fullHP(battle.p2.active[0]); }); - it(`should cause the user to lose focus if hit by a move called by Nature Power`, function () { + it(`should cause the user to lose focus if hit by a move called by Nature Power`, () => { battle = common.createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['naturepower']}, + { species: 'Venusaur', moves: ['naturepower'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p2.active[0]); }); - it(`should not cause the user to lose focus on later uses of Focus Punch if hit`, function () { + it(`should not cause the user to lose focus on later uses of Focus Punch if hit`, () => { battle = common.createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['magicalleaf', 'growl']}, + { species: 'Venusaur', moves: ['magicalleaf', 'growl'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p2.active[0]); @@ -63,21 +63,21 @@ describe('Focus Punch', function () { assert.false.fullHP(battle.p2.active[0]); }); - it(`should cause the user to lose focus if hit by an attacking move followed by a status move in one turn`, function () { - battle = common.createBattle({gameType: 'doubles'}, [ - [{species: 'Chansey', ability: 'naturalcure', moves: ['focuspunch']}, {species: 'Blissey', ability: 'naturalcure', moves: ['softboiled']}], - [{species: 'Venusaur', ability: 'overgrow', moves: ['magicalleaf']}, {species: 'Ivysaur', ability: 'overgrow', moves: ['toxic']}], + it(`should cause the user to lose focus if hit by an attacking move followed by a status move in one turn`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [ + [{ species: 'Chansey', ability: 'naturalcure', moves: ['focuspunch'] }, { species: 'Blissey', ability: 'naturalcure', moves: ['softboiled'] }], + [{ species: 'Venusaur', ability: 'overgrow', moves: ['magicalleaf'] }, { species: 'Ivysaur', ability: 'overgrow', moves: ['toxic'] }], ]); battle.makeChoices('move focuspunch 1, move softboiled', 'move magicalleaf 1, move toxic 1'); assert.equal(battle.p1.active[0].status, 'tox'); assert.equal(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it(`should not deduct PP if the user lost focus`, function () { + it(`should not deduct PP if the user lost focus`, () => { battle = common.createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['magicalleaf', 'growl']}, + { species: 'Venusaur', moves: ['magicalleaf', 'growl'] }, ]]); const move = battle.p1.active[0].getMoveData(Dex.moves.get('focuspunch')); battle.makeChoices(); @@ -86,11 +86,11 @@ describe('Focus Punch', function () { assert.equal(move.pp, move.maxpp - 1); }); - it(`should deduct PP if the user lost focus before Gen 5`, function () { + it(`should deduct PP if the user lost focus before Gen 5`, () => { battle = common.gen(4).createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['magicalleaf', 'growl']}, + { species: 'Venusaur', moves: ['magicalleaf', 'growl'] }, ]]); const move = battle.p1.active[0].getMoveData(Dex.moves.get('focuspunch')); battle.makeChoices(); @@ -99,11 +99,11 @@ describe('Focus Punch', function () { assert.equal(move.pp, move.maxpp - 2); }); - it(`should display a message indicating the Pokemon is tightening focus`, function () { + it(`should display a message indicating the Pokemon is tightening focus`, () => { battle = common.createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['magicalleaf']}, + { species: 'Venusaur', moves: ['magicalleaf'] }, ]]); battle.makeChoices(); @@ -111,11 +111,11 @@ describe('Focus Punch', function () { assert(tighteningFocusMessage > 0); }); - it(`should not tighten the Pokemon's focus when Dynamaxing or already Dynamaxed`, function () { + it(`should not tighten the Pokemon's focus when Dynamaxing or already Dynamaxed`, () => { battle = common.gen(8).createBattle([[ - {species: 'Chansey', moves: ['focuspunch']}, + { species: 'Chansey', moves: ['focuspunch'] }, ], [ - {species: 'Venusaur', moves: ['magicalleaf']}, + { species: 'Venusaur', moves: ['magicalleaf'] }, ]]); battle.makeChoices('move focuspunch dynamax', 'auto'); @@ -124,12 +124,12 @@ describe('Focus Punch', function () { assert(tighteningFocusMessage < 0); }); - it(`should tighten focus after switches in Gen 5+`, function () { + it(`should tighten focus after switches in Gen 5+`, () => { battle = common.createBattle([[ - {species: 'salamence', moves: ['focuspunch']}, + { species: 'salamence', moves: ['focuspunch'] }, ], [ - {species: 'mew', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'mew', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move focuspunch', 'switch 2'); @@ -139,12 +139,12 @@ describe('Focus Punch', function () { assert(focusPunchChargeIndex > switchIndex, `Focus Punch's charge message should occur after switches in Gen 5+`); }); - it(`should tighten focus before switches in Gens 3-4`, function () { + it(`should tighten focus before switches in Gens 3-4`, () => { battle = common.gen(4).createBattle([[ - {species: 'salamence', moves: ['focuspunch']}, + { species: 'salamence', moves: ['focuspunch'] }, ], [ - {species: 'mew', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'mew', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move focuspunch', 'switch 2'); diff --git a/test/sim/moves/followme.js b/test/sim/moves/followme.js index e9d77a3e4f..558eea2e05 100644 --- a/test/sim/moves/followme.js +++ b/test/sim/moves/followme.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe('Follow Me', function () { - afterEach(function () { +describe('Follow Me', () => { + afterEach(() => { battle.destroy(); }); it('should redirect single-target moves towards it if it is a valid target', function () { this.timeout(5000); - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: 'Clefable', ability: 'unaware', moves: ['followme']}, - {species: 'Clefairy', ability: 'unaware', moves: ['calmmind']}, - {species: 'Cleffa', ability: 'unaware', moves: ['calmmind']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Abra', ability: 'synchronize', moves: ['lowkick']}, - {species: 'Kadabra', ability: 'synchronize', moves: ['lowkick']}, - {species: 'Alakazam', ability: 'synchronize', moves: ['lowkick']}, - ]}); + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: 'Clefable', ability: 'unaware', moves: ['followme'] }, + { species: 'Clefairy', ability: 'unaware', moves: ['calmmind'] }, + { species: 'Cleffa', ability: 'unaware', moves: ['calmmind'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Abra', ability: 'synchronize', moves: ['lowkick'] }, + { species: 'Kadabra', ability: 'synchronize', moves: ['lowkick'] }, + { species: 'Alakazam', ability: 'synchronize', moves: ['lowkick'] }, + ] }); let hitCount = 0; - battle.onEvent('Damage', battle.format, function (damage, pokemon) { + battle.onEvent('Damage', battle.format, (damage, pokemon) => { if (pokemon.species.id === 'clefable') { hitCount++; } @@ -34,29 +34,29 @@ describe('Follow Me', function () { assert.equal(hitCount, 2); }); - it('should not redirect self-targetting moves', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Clefable', ability: 'unaware', moves: ['followme']}, - {species: 'Clefairy', ability: 'unaware', moves: ['softboiled']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Alakazam', ability: 'synchronize', moves: ['honeclaws']}, - {species: 'Kadabra', ability: 'synchronize', moves: ['honeclaws']}, - ]}); + it('should not redirect self-targetting moves', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Clefable', ability: 'unaware', moves: ['followme'] }, + { species: 'Clefairy', ability: 'unaware', moves: ['softboiled'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Alakazam', ability: 'synchronize', moves: ['honeclaws'] }, + { species: 'Kadabra', ability: 'synchronize', moves: ['honeclaws'] }, + ] }); battle.makeChoices('move followme, move softboiled', 'move honeclaws, move honeclaws'); assert.equal(battle.p1.active[0].boosts['atk'], 0); assert.equal(battle.p2.active[0].boosts['atk'], 1); assert.equal(battle.p2.active[1].boosts['atk'], 1); }); - it(`should allow redirection even if the user is the last slot of a double battle`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Wynaut", moves: ['sleeptalk', 'tackle']}, - {species: "Wynaut", moves: ['sleeptalk', 'tackle']}, + it(`should allow redirection even if the user is the last slot of a double battle`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Wynaut", moves: ['sleeptalk', 'tackle'] }, + { species: "Wynaut", moves: ['sleeptalk', 'tackle'] }, ], [ - {species: "Accelgor", moves: ['finalgambit']}, - {species: "Blissey", moves: ['sleeptalk', 'followme']}, + { species: "Accelgor", moves: ['finalgambit'] }, + { species: "Blissey", moves: ['sleeptalk', 'followme'] }, ]]); battle.makeChoices('auto', 'move final gambit -2, move sleeptalk'); @@ -67,16 +67,16 @@ describe('Follow Me', function () { assert.fullHP(battle.p1.active[1]); }); - it(`should redirect single-target moves towards it if it is a valid target in FFA`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: "Wynaut", moves: ['tackle']}, + it(`should redirect single-target moves towards it if it is a valid target in FFA`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: "Wynaut", moves: ['tackle'] }, ], [ - {species: "Wynaut", moves: ['tackle']}, + { species: "Wynaut", moves: ['tackle'] }, ], [ - {species: "Accelgor", moves: ['finalgambit']}, - {species: "Mimikyu", moves: ['substitute']}, + { species: "Accelgor", moves: ['finalgambit'] }, + { species: "Mimikyu", moves: ['substitute'] }, ], [ - {species: "Blissey", moves: ['followme']}, + { species: "Blissey", moves: ['followme'] }, ]]); battle.makeChoices('move tackle 1', 'move tackle 1', 'move final gambit 2', 'move followme'); @@ -85,14 +85,14 @@ describe('Follow Me', function () { assert.fullHP(battle.p2.active[0]); }); - it(`[Gen 3] should continue to redirect moves after the user is knocked out and replaced`, function () { - battle = common.gen(3).createBattle({gameType: 'doubles'}, [[ - {species: "Swellow", moves: ['aerialace']}, - {species: "Chansey", level: 1, moves: ['followme']}, - {species: "Blissey", moves: ['sleeptalk']}, + it(`[Gen 3] should continue to redirect moves after the user is knocked out and replaced`, () => { + battle = common.gen(3).createBattle({ gameType: 'doubles' }, [[ + { species: "Swellow", moves: ['aerialace'] }, + { species: "Chansey", level: 1, moves: ['followme'] }, + { species: "Blissey", moves: ['sleeptalk'] }, ], [ - {species: "Wynaut", moves: ['pound']}, - {species: "Wobbuffet", moves: ['pound']}, + { species: "Wynaut", moves: ['pound'] }, + { species: "Wobbuffet", moves: ['pound'] }, ]]); const blissey = battle.p1.pokemon[2]; diff --git a/test/sim/moves/foresight.js b/test/sim/moves/foresight.js index 9846fca008..9302331055 100644 --- a/test/sim/moves/foresight.js +++ b/test/sim/moves/foresight.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Foresight', function () { - afterEach(function () { +describe('Foresight', () => { + afterEach(() => { battle.destroy(); }); - it('should negate Normal and Fighting immunities', function () { + it('should negate Normal and Fighting immunities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['foresight', 'vitalthrow', 'tackle']}]}); - battle.setPlayer('p2', {team: [{species: "Dusknoir", ability: 'prankster', moves: ['recover']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['foresight', 'vitalthrow', 'tackle'] }] }); + battle.setPlayer('p2', { team: [{ species: "Dusknoir", ability: 'prankster', moves: ['recover'] }] }); battle.makeChoices('move foresight', 'move recover'); battle.makeChoices('move vitalthrow', 'move recover'); assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); @@ -21,24 +21,24 @@ describe('Foresight', function () { assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should ignore the effect of positive evasion stat stages', function () { + it('should ignore the effect of positive evasion stat stages', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['avalanche', 'foresight']}]}); - battle.setPlayer('p2', {team: [{species: "Forretress", ability: 'sturdy', moves: ['synthesis']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['avalanche', 'foresight'] }] }); + battle.setPlayer('p2', { team: [{ species: "Forretress", ability: 'sturdy', moves: ['synthesis'] }] }); battle.makeChoices('move foresight', 'move synthesis'); - battle.boost({evasion: 6}, battle.p2.active[0]); + battle.boost({ evasion: 6 }, battle.p2.active[0]); for (let i = 0; i < 7; i++) { battle.makeChoices('move avalanche', 'move synthesis'); assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); } }); - it('should not ignore the effect of negative evasion stat stages', function () { + it('should not ignore the effect of negative evasion stat stages', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['zapcannon', 'dynamicpunch', 'foresight']}]}); - battle.setPlayer('p2', {team: [{species: "Zapdos", ability: 'owntempo', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['zapcannon', 'dynamicpunch', 'foresight'] }] }); + battle.setPlayer('p2', { team: [{ species: "Zapdos", ability: 'owntempo', moves: ['roost'] }] }); battle.makeChoices('move foresight', 'move roost'); - battle.boost({spe: 6, evasion: -6}, battle.p2.active[0]); + battle.boost({ spe: 6, evasion: -6 }, battle.p2.active[0]); for (let i = 0; i < 7; i++) { battle.makeChoices('move zapcannon', 'move roost'); assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); diff --git a/test/sim/moves/furycutter.js b/test/sim/moves/furycutter.js index 0765549419..f4b2fe8e61 100644 --- a/test/sim/moves/furycutter.js +++ b/test/sim/moves/furycutter.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Fury Cutter', function () { - afterEach(function () { +describe('Fury Cutter', () => { + afterEach(() => { battle.destroy(); }); - it('should double in power with each successful hit', function () { + it('should double in power with each successful hit', () => { battle = common.createBattle([[ - {species: 'kangaskhan', moves: ['luckychant']}, + { species: 'kangaskhan', moves: ['luckychant'] }, ], [ - {species: 'wynaut', ability: "compoundeyes", moves: ['furycutter']}, + { species: 'wynaut', ability: "compoundeyes", moves: ['furycutter'] }, ]]); battle.makeChoices(); @@ -31,11 +31,11 @@ describe('Fury Cutter', function () { assert.bounded(damage, [49, 58]); // 160 BP }); - it('should double in power with each successful hit (Gen 3)', function () { + it('should double in power with each successful hit (Gen 3)', () => { battle = common.gen(3).createBattle([[ - {species: 'kangaskhan', moves: ['luckychant']}, + { species: 'kangaskhan', moves: ['luckychant'] }, ], [ - {species: 'wynaut', ability: "compoundeyes", moves: ['furycutter']}, + { species: 'wynaut', ability: "compoundeyes", moves: ['furycutter'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/futuresight.js b/test/sim/moves/futuresight.js index 8f874f3d82..38afa90c31 100644 --- a/test/sim/moves/futuresight.js +++ b/test/sim/moves/futuresight.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Future Sight', function () { - afterEach(function () { +describe('Future Sight', () => { + afterEach(() => { battle.destroy(); }); - it(`should damage in two turns, ignoring Protect, affected by Dark immunities`, function () { + it(`should damage in two turns, ignoring Protect, affected by Dark immunities`, () => { battle = common.createBattle([[ - {species: 'Sneasel', moves: ['sleeptalk', 'futuresight']}, + { species: 'Sneasel', moves: ['sleeptalk', 'futuresight'] }, ], [ - {species: 'Girafarig', moves: ['sleeptalk', 'futuresight', 'protect']}, + { species: 'Girafarig', moves: ['sleeptalk', 'futuresight', 'protect'] }, ]]); const sneasel = battle.p1.active[0]; @@ -28,11 +28,11 @@ describe('Future Sight', function () { assert.false.fullHP(girafarig); }); - it(`should fail when already active for the target's position`, function () { + it(`should fail when already active for the target's position`, () => { battle = common.createBattle([[ - {species: 'Sneasel', moves: ['sleeptalk']}, + { species: 'Sneasel', moves: ['sleeptalk'] }, ], [ - {species: 'Girafarig', moves: ['futuresight']}, + { species: 'Girafarig', moves: ['futuresight'] }, ]]); battle.makeChoices(); @@ -40,11 +40,11 @@ describe('Future Sight', function () { assert(battle.log[battle.lastMoveLine + 1].startsWith('|-fail|')); }); - it(`[Gen 2] should damage in two turns, ignoring Protect`, function () { + it(`[Gen 2] should damage in two turns, ignoring Protect`, () => { battle = common.gen(2).createBattle([[ - {species: 'Sneasel', moves: ['sleeptalk', 'futuresight', 'sweetscent']}, + { species: 'Sneasel', moves: ['sleeptalk', 'futuresight', 'sweetscent'] }, ], [ - {species: 'Girafarig', moves: ['sleeptalk', 'futuresight', 'protect', 'sweetscent']}, + { species: 'Girafarig', moves: ['sleeptalk', 'futuresight', 'protect', 'sweetscent'] }, ]]); const sneasel = battle.p1.active[0]; @@ -59,11 +59,11 @@ describe('Future Sight', function () { assert.false.fullHP(girafarig); }); - it(`should not double Stomping Tantrum for exiting normally`, function () { + it(`should not double Stomping Tantrum for exiting normally`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['futuresight', 'stompingtantrum']}, + { species: 'Wynaut', moves: ['futuresight', 'stompingtantrum'] }, ], [ - {species: 'Scizor', ability: 'shellarmor', moves: ['sleeptalk']}, + { species: 'Scizor', ability: 'shellarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -73,24 +73,24 @@ describe('Future Sight', function () { assert.bounded(damage, [19, 23]); // If it were doubled, would be 38-45 }); - it(`should not trigger Eject Button`, function () { + it(`should not trigger Eject Button`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['futuresight']}, + { species: 'Wynaut', moves: ['futuresight'] }, ], [ - {species: 'Scizor', item: 'ejectbutton', moves: ['sleeptalk']}, - {species: 'Roggenrola', moves: ['sleeptalk']}, + { species: 'Scizor', item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: 'Roggenrola', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 3; i++) battle.makeChoices(); assert.equal(battle.requestState, 'move'); }); - it(`should be able to set Future Sight against an empty target slot`, function () { + it(`should be able to set Future Sight against an empty target slot`, () => { battle = common.createBattle([[ - {species: 'Shedinja', moves: ['finalgambit']}, - {species: 'Roggenrola', moves: ['sleeptalk']}, + { species: 'Shedinja', moves: ['finalgambit'] }, + { species: 'Roggenrola', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk', 'futuresight']}, + { species: 'Wynaut', moves: ['sleeptalk', 'futuresight'] }, ]]); battle.makeChoices('auto', 'move future sight'); @@ -101,11 +101,11 @@ describe('Future Sight', function () { assert.false.fullHP(roggenrola); }); - it(`its damaging hit should not count as copyable for Copycat`, function () { + it(`its damaging hit should not count as copyable for Copycat`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['sleeptalk', 'futuresight']}, + { species: 'Wynaut', moves: ['sleeptalk', 'futuresight'] }, ], [ - {species: 'Liepard', moves: ['sleeptalk', 'copycat']}, + { species: 'Liepard', moves: ['sleeptalk', 'copycat'] }, ]]); battle.makeChoices('move futuresight', 'auto'); @@ -118,11 +118,11 @@ describe('Future Sight', function () { assert.fullHP(wynaut); }); - it(`should only cause the user to take Life Orb recoil on its damaging turn`, function () { + it(`should only cause the user to take Life Orb recoil on its damaging turn`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'lifeorb', moves: ['futuresight']}, + { species: 'wynaut', item: 'lifeorb', moves: ['futuresight'] }, ], [ - {species: 'mew', moves: ['sleeptalk']}, + { species: 'mew', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -136,11 +136,11 @@ describe('Future Sight', function () { assert.bounded(damage, [30, 35]); // 22-27 if Life Orb was not applied }); - it(`[Gen 4] should not be affected by Life Orb`, function () { + it(`[Gen 4] should not be affected by Life Orb`, () => { battle = common.gen(4).createBattle([[ - {species: 'wynaut', item: 'lifeorb', moves: ['futuresight']}, + { species: 'wynaut', item: 'lifeorb', moves: ['futuresight'] }, ], [ - {species: 'mew', ability: 'noguard', moves: ['sleeptalk']}, + { species: 'mew', ability: 'noguard', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -153,12 +153,12 @@ describe('Future Sight', function () { assert.bounded(damage, [21, 25]); // [27-32] if Life Orb was applied }); - it(`should not be affected by Life Orb if not the original user`, function () { + it(`should not be affected by Life Orb if not the original user`, () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'lifeorb', moves: ['futuresight']}, - {species: 'liepard', item: 'lifeorb', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'lifeorb', moves: ['futuresight'] }, + { species: 'liepard', item: 'lifeorb', moves: ['sleeptalk'] }, ], [ - {species: 'mew', moves: ['sleeptalk']}, + { species: 'mew', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -171,11 +171,11 @@ describe('Future Sight', function () { assert.bounded(damage, [22, 27]); // 30, 35 if Life Orb was applied }); - it(`should not cause the user to change typing on either its starting or damaging turn`, function () { + it(`should not cause the user to change typing on either its starting or damaging turn`, () => { battle = common.createBattle([[ - {species: 'roggenrola', ability: 'protean', moves: ['futuresight', 'sleeptalk']}, + { species: 'roggenrola', ability: 'protean', moves: ['futuresight', 'sleeptalk'] }, ], [ - {species: 'mew', moves: ['sleeptalk']}, + { species: 'mew', moves: ['sleeptalk'] }, ]]); const roggenrola = battle.p1.active[0]; @@ -186,11 +186,11 @@ describe('Future Sight', function () { assert.false(roggenrola.hasType('Psychic'), `Protean Roggenrola should not change type on Future Sight's damaging turn`); }); - it(`should be boosted by Terrain only if Terrain is active on the damaging turn`, function () { + it(`should be boosted by Terrain only if Terrain is active on the damaging turn`, () => { battle = common.createBattle([[ - {species: 'Blissey', ability: 'shellarmor', moves: ['softboiled']}, + { species: 'Blissey', ability: 'shellarmor', moves: ['softboiled'] }, ], [ - {species: 'Wynaut', ability: 'psychicsurge', moves: ['sleeptalk', 'futuresight']}, + { species: 'Wynaut', ability: 'psychicsurge', moves: ['sleeptalk', 'futuresight'] }, ]]); battle.makeChoices('auto', 'move futuresight'); @@ -207,13 +207,13 @@ describe('Future Sight', function () { assert.bounded(damage, [36, 43]); }); - it(`should be boosted by Terrain even if the user is not on the field, as long as the user is not Flying-type`, function () { + it(`should be boosted by Terrain even if the user is not on the field, as long as the user is not Flying-type`, () => { battle = common.createBattle([[ - {species: 'Blissey', ability: 'shellarmor', moves: ['softboiled']}, + { species: 'Blissey', ability: 'shellarmor', moves: ['softboiled'] }, ], [ - {species: 'cresselia', ability: 'levitate', moves: ['sleeptalk', 'futuresight']}, - {species: 'deino', ability: 'psychicsurge', moves: ['sleeptalk']}, - {species: 'xatu', moves: ['sleeptalk', 'futuresight']}, + { species: 'cresselia', ability: 'levitate', moves: ['sleeptalk', 'futuresight'] }, + { species: 'deino', ability: 'psychicsurge', moves: ['sleeptalk'] }, + { species: 'xatu', moves: ['sleeptalk', 'futuresight'] }, ]]); // Cresselia will be Terrain-boosted because its Ability is not checked while not active @@ -233,12 +233,12 @@ describe('Future Sight', function () { assert.bounded(damage, [96, 114]); }); - it(`should not ignore the target's screens, even when the user is not active on the field`, function () { + it(`should not ignore the target's screens, even when the user is not active on the field`, () => { battle = common.createBattle([[ - {species: 'Blissey', ability: 'shellarmor', item: 'lightclay', moves: ['softboiled', 'lightscreen']}, + { species: 'Blissey', ability: 'shellarmor', item: 'lightclay', moves: ['softboiled', 'lightscreen'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk', 'futuresight']}, - {species: 'deino', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk', 'futuresight'] }, + { species: 'deino', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move lightscreen', 'move futuresight'); @@ -255,12 +255,12 @@ describe('Future Sight', function () { assert.bounded(damage, [18, 21]); }); - it(`should not consider the user's item or Ability when the user is not active`, function () { + it(`should not consider the user's item or Ability when the user is not active`, () => { battle = common.createBattle([[ - {species: 'Blissey', ability: 'shellarmor', moves: ['softboiled']}, + { species: 'Blissey', ability: 'shellarmor', moves: ['softboiled'] }, ], [ - {species: 'Wynaut', ability: 'adaptability', item: 'choicespecs', moves: ['futuresight']}, - {species: 'Deino', ability: 'powerspot', moves: ['sleeptalk']}, + { species: 'Wynaut', ability: 'adaptability', item: 'choicespecs', moves: ['futuresight'] }, + { species: 'Deino', ability: 'powerspot', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 3; i++) battle.makeChoices(); @@ -275,11 +275,11 @@ describe('Future Sight', function () { assert.bounded(damage, [46, 55]); // only boosted by Power Spot }); - it(`should not ignore the target's Unaware`, function () { + it(`should not ignore the target's Unaware`, () => { battle = common.createBattle([[ - {species: 'Manaphy', ability: 'simple', moves: ['tailglow', 'futuresight']}, + { species: 'Manaphy', ability: 'simple', moves: ['tailglow', 'futuresight'] }, ], [ - {species: 'Ho-Oh', ability: 'unaware', moves: ['luckychant']}, + { species: 'Ho-Oh', ability: 'unaware', moves: ['luckychant'] }, ]]); battle.makeChoices(); @@ -291,11 +291,11 @@ describe('Future Sight', function () { assert.bounded(damage, [60, 71]); // Damage would be 236-278 if Unaware was being ignored }); - it(`should use the user's most recent Special Attack stat if the user is on the field`, function () { + it(`should use the user's most recent Special Attack stat if the user is on the field`, () => { battle = common.createBattle([[ - {species: 'Aegislash', ability: 'stancechange', moves: ['futuresight', 'kingsshield']}, + { species: 'Aegislash', ability: 'stancechange', moves: ['futuresight', 'kingsshield'] }, ], [ - {species: 'Ho-Oh', ability: 'shellarmor', moves: ['recover']}, + { species: 'Ho-Oh', ability: 'shellarmor', moves: ['recover'] }, ]]); for (let i = 0; i < 3; i++) battle.makeChoices(); @@ -310,12 +310,12 @@ describe('Future Sight', function () { assert.bounded(damage, [34, 41]); // Shield Forme damage }); - it.skip(`should use the user's most recent Special Attack stat, even if the user is not on the field`, function () { + it.skip(`should use the user's most recent Special Attack stat, even if the user is not on the field`, () => { battle = common.createBattle([[ - {species: 'Aegislash', ability: 'stancechange', moves: ['futuresight', 'kingsshield']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Aegislash', ability: 'stancechange', moves: ['futuresight', 'kingsshield'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Ho-Oh', ability: 'shellarmor', moves: ['recover', 'flareblitz']}, + { species: 'Ho-Oh', ability: 'shellarmor', moves: ['recover', 'flareblitz'] }, ]]); battle.makeChoices(); @@ -334,12 +334,12 @@ describe('Future Sight', function () { assert.bounded(damage, [79, 94], `Future Sight should deal Blade Forme damage, even though Aegislash was KOed in Blade Forme.`); }); - it(`should only use Sp. Atk stat boosts/drops if the user is on the field`, function () { + it(`should only use Sp. Atk stat boosts/drops if the user is on the field`, () => { battle = common.createBattle([[ - {species: 'Flapple', moves: ['futuresight', 'nastyplot', 'sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Flapple', moves: ['futuresight', 'nastyplot', 'sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Ho-Oh', ability: 'shellarmor', moves: ['recover']}, + { species: 'Ho-Oh', ability: 'shellarmor', moves: ['recover'] }, ]]); battle.makeChoices(); @@ -356,11 +356,11 @@ describe('Future Sight', function () { assert.bounded(damage, [57, 68], `Future Sight should deal damage with +0 Sp. Atk`); }); - it(`should never resolve when used on turn 254 or later`, function () { + it(`should never resolve when used on turn 254 or later`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['sleeptalk', 'futuresight']}, + { species: 'Wynaut', moves: ['sleeptalk', 'futuresight'] }, ], [ - {species: 'Stakataka', moves: ['sleeptalk']}, + { species: 'Stakataka', moves: ['sleeptalk'] }, ]]); battle.turn = 255; // Showdown turn is +1 from what the games are; this would ordinarily be 254 @@ -373,13 +373,13 @@ describe('Future Sight', function () { assert.fullHP(stak, `Future Sight should have never resolved.`); }); - it(`should target particular slots in Doubles`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['sleeptalk', 'futuresight']}, - {species: 'Steelix', moves: ['sleeptalk']}, + it(`should target particular slots in Doubles`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['sleeptalk', 'futuresight'] }, + { species: 'Steelix', moves: ['sleeptalk'] }, ], [ - {species: 'Girafarig', moves: ['sleeptalk', 'recover']}, - {species: 'Farigiraf', moves: ['sleeptalk', 'recover']}, + { species: 'Girafarig', moves: ['sleeptalk', 'recover'] }, + { species: 'Farigiraf', moves: ['sleeptalk', 'recover'] }, ]]); battle.makeChoices('move futuresight 2, auto', 'auto'); @@ -402,12 +402,12 @@ describe('Future Sight', function () { assert.false.fullHP(steelix, `Steelix should have been damaged by the 3rd Future Sight`); }); - it(`should do nothing if no Pokemon is present to take damage from the Future attack`, function () { + it(`should do nothing if no Pokemon is present to take damage from the Future attack`, () => { battle = common.createBattle([[ - {species: 'Wynaut', ability: 'magicguard', moves: ['sleeptalk']}, - {species: 'Shedinja', moves: ['sleeptalk']}, + { species: 'Wynaut', ability: 'magicguard', moves: ['sleeptalk'] }, + { species: 'Shedinja', moves: ['sleeptalk'] }, ], [ - {species: 'Happiny', moves: ['stealthrock', 'futuresight']}, + { species: 'Happiny', moves: ['stealthrock', 'futuresight'] }, ]]); battle.makeChoices('auto', 'move futuresight'); diff --git a/test/sim/moves/gearup.js b/test/sim/moves/gearup.js index f6f122fa2a..74bacde983 100644 --- a/test/sim/moves/gearup.js +++ b/test/sim/moves/gearup.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('Gear Up', function () { - afterEach(function () { +describe('Gear Up', () => { + afterEach(() => { battle.destroy(); }); - it('should boost the Attack and Special Attack of all active allies with Plus or Minus', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Minun", ability: 'minus', moves: ['sleeptalk']}, - {species: "Klinklang", ability: 'plus', moves: ['gearup']}, - {species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Plusle", ability: 'plus', moves: ['sleeptalk']}, - {species: "Klinklang", ability: 'minus', moves: ['gearup']}, - {species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk']}, - ]}); + it('should boost the Attack and Special Attack of all active allies with Plus or Minus', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Minun", ability: 'minus', moves: ['sleeptalk'] }, + { species: "Klinklang", ability: 'plus', moves: ['gearup'] }, + { species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Plusle", ability: 'plus', moves: ['sleeptalk'] }, + { species: "Klinklang", ability: 'minus', moves: ['gearup'] }, + { species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move sleeptalk, move gearup, move sleeptalk', 'move sleeptalk, move gearup, move sleeptalk'); for (const active of battle.getAllActive()) { if (active.name === 'Pyukumuku') continue; diff --git a/test/sim/moves/gigatonhammer.js b/test/sim/moves/gigatonhammer.js index 282a774ed2..d2936f24b0 100644 --- a/test/sim/moves/gigatonhammer.js +++ b/test/sim/moves/gigatonhammer.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Gigaton Hammer', function () { - afterEach(function () { +describe('Gigaton Hammer', () => { + afterEach(() => { battle.destroy(); }); - it(`should not be able to be selected if it was the last move used`, function () { + it(`should not be able to be selected if it was the last move used`, () => { battle = common.createBattle([[ - {species: 'Tinkaton', moves: ['helpinghand', 'gigatonhammer']}, + { species: 'Tinkaton', moves: ['helpinghand', 'gigatonhammer'] }, ], [ - {species: 'Brute Bonnet', moves: ['spore']}, + { species: 'Brute Bonnet', moves: ['spore'] }, ]]); battle.makeChoices('move gigatonhammer', 'auto'); assert.cantMove(() => battle.p1.chooseMove('gigatonhammer'), 'Tinkaton', 'Gigaton Hammer', true); @@ -23,11 +23,11 @@ describe('Gigaton Hammer', function () { assert.cantMove(() => battle.p1.chooseMove('gigatonhammer'), 'Tinkaton', 'Gigaton Hammer', true); }); - it(`should be able to be used twice in one turn`, function () { + it(`should be able to be used twice in one turn`, () => { battle = common.createBattle([[ - {species: 'Tinkaton', moves: ['gigatonhammer']}, + { species: 'Tinkaton', moves: ['gigatonhammer'] }, ], [ - {species: 'Oranguru', moves: ['instruct']}, + { species: 'Oranguru', moves: ['instruct'] }, ]]); const oranguru = battle.p2.active[0]; battle.makeChoices(); diff --git a/test/sim/moves/glaiverush.js b/test/sim/moves/glaiverush.js index 3f3f93a04d..8c088a46ed 100644 --- a/test/sim/moves/glaiverush.js +++ b/test/sim/moves/glaiverush.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Glaive Rush', function () { - afterEach(function () { +describe('Glaive Rush', () => { + afterEach(() => { battle.destroy(); }); - it(`should cause the user to take double damage after use`, function () { + it(`should cause the user to take double damage after use`, () => { battle = common.createBattle([[ - {species: 'Baxcalibur', ability: 'battlearmor', moves: ['glaiverush']}, + { species: 'Baxcalibur', ability: 'battlearmor', moves: ['glaiverush'] }, ], [ - {species: 'Skeledirge', moves: ['shadowball']}, + { species: 'Skeledirge', moves: ['shadowball'] }, ]]); battle.makeChoices(); const baxcalibur = battle.p1.active[0]; @@ -22,21 +22,21 @@ describe('Glaive Rush', function () { assert.bounded(damage, [212, 252]); // If it wasn't doubled, range would be 106-126 }); - it(`should cause moves to never miss the user after use`, function () { + it(`should cause moves to never miss the user after use`, () => { battle = common.createBattle([[ - {species: 'Baxcalibur', ability: 'battlearmor', moves: ['glaiverush']}, + { species: 'Baxcalibur', ability: 'battlearmor', moves: ['glaiverush'] }, ], [ - {species: 'Dondozo', moves: ['fissure']}, + { species: 'Dondozo', moves: ['fissure'] }, ]]); battle.makeChoices(); assert.fainted(battle.p1.active[0]); }); - it(`should only apply its drawback until the user's next turn`, function () { + it(`should only apply its drawback until the user's next turn`, () => { battle = common.createBattle([[ - {species: 'Baxcalibur', ability: 'battlearmor', item: 'safetygoggles', moves: ['glaiverush', 'shoreup']}, + { species: 'Baxcalibur', ability: 'battlearmor', item: 'safetygoggles', moves: ['glaiverush', 'shoreup'] }, ], [ - {species: 'Tyranitar', ability: 'sandstream', moves: ['icepunch']}, + { species: 'Tyranitar', ability: 'sandstream', moves: ['icepunch'] }, ]]); const baxcalibur = battle.p1.active[0]; battle.makeChoices(); diff --git a/test/sim/moves/glare.js b/test/sim/moves/glare.js index 2270873ace..0b83064e14 100644 --- a/test/sim/moves/glare.js +++ b/test/sim/moves/glare.js @@ -5,29 +5,29 @@ const common = require('./../../common'); let battle; -describe('Glare', function () { - afterEach(function () { +describe('Glare', () => { + afterEach(() => { battle.destroy(); }); - it('should ignore natural type immunities', function () { + it('should ignore natural type immunities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Arbok", ability: 'noguard', moves: ['glare']}]}); - battle.setPlayer('p2', {team: [{species: "Gengar", ability: 'blaze', moves: ['bulkup']}]}); + battle.setPlayer('p1', { team: [{ species: "Arbok", ability: 'noguard', moves: ['glare'] }] }); + battle.setPlayer('p2', { team: [{ species: "Gengar", ability: 'blaze', moves: ['bulkup'] }] }); battle.makeChoices('move glare', 'move bulkup'); assert.equal(battle.p2.active[0].status, 'par'); }); }); -describe('Glare [Gen 3]', function () { - afterEach(function () { +describe('Glare [Gen 3]', () => { + afterEach(() => { battle.destroy(); }); - it('should not ignore natural type immunities', function () { + it('should not ignore natural type immunities', () => { battle = common.gen(3).createBattle([ - [{species: "Arbok", ability: 'noguard', moves: ['glare']}], - [{species: "Gengar", ability: 'blaze', moves: ['bulkup']}], + [{ species: "Arbok", ability: 'noguard', moves: ['glare'] }], + [{ species: "Gengar", ability: 'blaze', moves: ['bulkup'] }], ]); battle.makeChoices('move glare', 'move bulkup'); assert.equal(battle.p2.active[0].status, ''); diff --git a/test/sim/moves/gmaxchistrike.js b/test/sim/moves/gmaxchistrike.js index 0829d42750..e51ae73ffd 100644 --- a/test/sim/moves/gmaxchistrike.js +++ b/test/sim/moves/gmaxchistrike.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('G-Max Chi Strike', function () { - afterEach(function () { +describe('G-Max Chi Strike', () => { + afterEach(() => { battle.destroy(); }); - it(`should boost the user and its ally's critical hit rate by 1 stage`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Machamp', moves: ['rocksmash'], gigantamax: true}, - {species: 'Wynaut', moves: ['tackle']}, + it(`should boost the user and its ally's critical hit rate by 1 stage`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Machamp', moves: ['rocksmash'], gigantamax: true }, + { species: 'Wynaut', moves: ['tackle'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); - battle.onEvent('ModifyCritRatio', battle.format, function (critRatio, target, source, move) { + battle.onEvent('ModifyCritRatio', battle.format, (critRatio, target, source, move) => { if (move.id === 'tackle') { assert.equal(critRatio, 2, `Wynaut's crit rate should be boosted by G-Max Chi Strike`); } @@ -28,16 +28,16 @@ describe('G-Max Chi Strike', function () { battle.makeChoices('move rocksmash 1 dynamax, move tackle 2', 'auto'); }); - it(`should provide a crit boost independent of Focus Energy`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Machamp', moves: ['sleeptalk', 'rocksmash'], gigantamax: true}, - {species: 'Wynaut', moves: ['focusenergy', 'tackle']}, + it(`should provide a crit boost independent of Focus Energy`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Machamp', moves: ['sleeptalk', 'rocksmash'], gigantamax: true }, + { species: 'Wynaut', moves: ['focusenergy', 'tackle'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); - battle.onEvent('ModifyCritRatio', battle.format, function (critRatio, target, source, move) { + battle.onEvent('ModifyCritRatio', battle.format, (critRatio, target, source, move) => { if (move.id === 'tackle') { assert.equal(critRatio, 4, `Wynaut's crit rate should be boosted by both G-Max Chi Strike and Focus Energy`); } @@ -47,14 +47,14 @@ describe('G-Max Chi Strike', function () { battle.makeChoices('move rocksmash 1 dynamax, move tackle 2', 'auto'); }); - it(`should be copied by Psych Up`, function () { + it(`should be copied by Psych Up`, () => { battle = common.gen(8).createBattle([[ - {species: 'Machamp', moves: ['rocksmash', 'sleeptalk'], gigantamax: true}, + { species: 'Machamp', moves: ['rocksmash', 'sleeptalk'], gigantamax: true }, ], [ - {species: 'Wynaut', moves: ['psychup', 'tackle']}, + { species: 'Wynaut', moves: ['psychup', 'tackle'] }, ]]); - battle.onEvent('ModifyCritRatio', battle.format, function (critRatio, target, source, move) { + battle.onEvent('ModifyCritRatio', battle.format, (critRatio, target, source, move) => { if (move.id === 'tackle') { assert.equal(critRatio, 2, `Wynaut's crit rate should be boosted by Psych Up'd G-Max Chi Strike`); } @@ -64,15 +64,15 @@ describe('G-Max Chi Strike', function () { battle.makeChoices('move rocksmash', 'move tackle'); }); - it(`should not be passed by Baton Pass`, function () { + it(`should not be passed by Baton Pass`, () => { battle = common.gen(8).createBattle([[ - {species: 'Machamp', moves: ['rocksmash', 'batonpass'], gigantamax: true}, - {species: 'Magikarp', moves: ['tackle']}, + { species: 'Machamp', moves: ['rocksmash', 'batonpass'], gigantamax: true }, + { species: 'Magikarp', moves: ['tackle'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); - battle.onEvent('ModifyCritRatio', battle.format, function (critRatio, target, source, move) { + battle.onEvent('ModifyCritRatio', battle.format, (critRatio, target, source, move) => { if (move.id === 'tackle') { assert.equal(critRatio, 1, `Magikarp's crit rate should not be boosted by Baton Passed G-Max Chi Strike`); } diff --git a/test/sim/moves/gmaxsteelsurge.js b/test/sim/moves/gmaxsteelsurge.js index 29d332a0d9..4702d6e778 100644 --- a/test/sim/moves/gmaxsteelsurge.js +++ b/test/sim/moves/gmaxsteelsurge.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('G-Max Steelsurge', function () { - afterEach(function () { +describe('G-Max Steelsurge', () => { + afterEach(() => { battle.destroy(); }); - it(`should deal 2x damage to Eiscue and Mimikyu`, function () { + it(`should deal 2x damage to Eiscue and Mimikyu`, () => { battle = common.gen(8).createBattle([[ - {species: 'Pyukumuku', moves: ['uturn']}, - {species: 'Eiscue', ability: 'iceface', moves: ['splash']}, - {species: 'Mimikyu', ability: 'disguise', moves: ['splash']}, + { species: 'Pyukumuku', moves: ['uturn'] }, + { species: 'Eiscue', ability: 'iceface', moves: ['splash'] }, + { species: 'Mimikyu', ability: 'disguise', moves: ['splash'] }, ], [ - {species: 'Copperajah', moves: ['ironhead', 'sleeptalk'], gigantamax: true}, + { species: 'Copperajah', moves: ['ironhead', 'sleeptalk'], gigantamax: true }, ]]); battle.makeChoices('move uturn', 'move ironhead dynamax'); battle.makeChoices('switch 2'); const eiscue = battle.p1.active[0]; - const expectedPercent = Math.pow(0.5, 2); + const expectedPercent = 0.5 ** 2; let expectedDamage = Math.floor(eiscue.maxhp * expectedPercent); assert.equal(eiscue.maxhp - eiscue.hp, expectedDamage, `Eiscue should take ${expectedPercent * 100}%`); diff --git a/test/sim/moves/gmaxvolcalith.js b/test/sim/moves/gmaxvolcalith.js index 3660faba94..594eedd04b 100644 --- a/test/sim/moves/gmaxvolcalith.js +++ b/test/sim/moves/gmaxvolcalith.js @@ -5,31 +5,31 @@ const common = require('./../../common'); let battle; -describe('G-Max Volcalith', function () { - afterEach(function () { +describe('G-Max Volcalith', () => { + afterEach(() => { battle.destroy(); }); - it(`should not damage Rock-types`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Coalossal', moves: ['rockthrow'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should not damage Rock-types`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Coalossal', moves: ['rockthrow'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Blastoise', moves: ['sleeptalk']}, - {species: 'Boldore', moves: ['sleeptalk']}, + { species: 'Blastoise', moves: ['sleeptalk'] }, + { species: 'Boldore', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move rockthrow 1 dynamax, move sleeptalk', 'move sleeptalk, move sleeptalk'); assert.fullHP(battle.p2.active[1]); }); - it(`should deal damage for four turns, including the fourth turn`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should deal damage for four turns, including the fourth turn`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Blastoise', moves: ['sleeptalk']}, - {species: 'Boldore', moves: ['sleeptalk']}, + { species: 'Blastoise', moves: ['sleeptalk'] }, + { species: 'Boldore', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move rockthrow 2 dynamax, move sleeptalk', 'move sleeptalk, move sleeptalk'); @@ -39,14 +39,14 @@ describe('G-Max Volcalith', function () { assert.equal(blastoise.hp, blastoise.maxhp - (Math.floor(blastoise.maxhp / 6) * 4)); }); - it.skip(`should deal damage alongside Sea of Fire or G-Max Wildfire in the order those field effects were set`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Coalossal', item: 'Eject Button', moves: ['rockthrow', 'sleeptalk'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk', 'grasspledge']}, - {species: 'Wynaut', moves: ['sleeptalk', 'firepledge']}, + it.skip(`should deal damage alongside Sea of Fire or G-Max Wildfire in the order those field effects were set`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Coalossal', item: 'Eject Button', moves: ['rockthrow', 'sleeptalk'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk', 'grasspledge'] }, + { species: 'Wynaut', moves: ['sleeptalk', 'firepledge'] }, ], [ - {species: 'Blissey', moves: ['sleeptalk']}, - {species: 'Chansey', moves: ['sleeptalk']}, + { species: 'Blissey', moves: ['sleeptalk'] }, + { species: 'Chansey', moves: ['sleeptalk'] }, ]]); // Set up Volcalith first, then Sea of Fire @@ -60,13 +60,13 @@ describe('G-Max Volcalith', function () { assert(volcalithDamageIndex < pledgeDamageIndex, 'G-Max Volcalith should damage before Sea of Fire, because Volcalith was set up first.'); }); - it(`should damage Pokemon in order of Speed`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should damage Pokemon in order of Speed`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true}, - {species: 'Mewtwo', moves: ['sleeptalk', 'trickroom']}, + { species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true }, + { species: 'Mewtwo', moves: ['sleeptalk', 'trickroom'] }, ]]); battle.makeChoices('move rockthrow 1 dynamax, move sleeptalk', 'move rockthrow 1 dynamax, move sleeptalk'); @@ -82,13 +82,13 @@ describe('G-Max Volcalith', function () { assert(mewtwoDamagedTRIndex < wynautDamagedTRIndex, 'Wynaut should be damaged before Mewtwo in Trick Room.'); }); - it(`should deal damage before Black Sludge recovery/damage`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should deal damage before Black Sludge recovery/damage`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Toxicroak', item: 'blacksludge', moves: ['sleeptalk']}, - {species: 'Boldore', moves: ['sleeptalk']}, + { species: 'Toxicroak', item: 'blacksludge', moves: ['sleeptalk'] }, + { species: 'Boldore', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move rockthrow 2 dynamax, move sleeptalk', 'move sleeptalk, move sleeptalk'); @@ -96,13 +96,13 @@ describe('G-Max Volcalith', function () { assert.equal(toxicroak.hp, toxicroak.maxhp - Math.floor(toxicroak.maxhp / 6) + Math.floor(toxicroak.maxhp / 16)); }); - it(`should deal damage before Grassy Terrain recovery`, function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should deal damage before Grassy Terrain recovery`, () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'Coalossal', moves: ['sleeptalk', 'rockthrow'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Rillaboom', ability: 'grassysurge', moves: ['sleeptalk']}, - {species: 'Boldore', moves: ['sleeptalk']}, + { species: 'Rillaboom', ability: 'grassysurge', moves: ['sleeptalk'] }, + { species: 'Boldore', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move rockthrow 2 dynamax, move sleeptalk', 'move sleeptalk, move sleeptalk'); diff --git a/test/sim/moves/gmaxwildfire.js b/test/sim/moves/gmaxwildfire.js index 5129cf1a9c..75a8558949 100644 --- a/test/sim/moves/gmaxwildfire.js +++ b/test/sim/moves/gmaxwildfire.js @@ -5,35 +5,35 @@ const common = require('./../../common'); let battle; -describe('G-Max Wildfire', function () { - afterEach(function () { +describe('G-Max Wildfire', () => { + afterEach(() => { battle.destroy(); }); - it('should not damage Fire-types', function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Charizard', moves: ['ember'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Flareon', moves: ['sleeptalk']}, - ]}); + it('should not damage Fire-types', () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Charizard', moves: ['ember'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Flareon', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move ember 1 dynamax, move sleeptalk', 'move sleeptalk, move sleeptalk'); assert.fullHP(battle.p2.active[1]); }); - it('should deal damage for four turns, including the fourth turn', function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Charizard', moves: ['ember', 'sleeptalk'], gigantamax: true}, - {species: 'Wynaut', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Wynaut', moves: ['sleeptalk']}, - {species: 'Flareon', moves: ['sleeptalk']}, - ]}); + it('should deal damage for four turns, including the fourth turn', () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Charizard', moves: ['ember', 'sleeptalk'], gigantamax: true }, + { species: 'Wynaut', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Wynaut', moves: ['sleeptalk'] }, + { species: 'Flareon', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move ember 2 dynamax, move sleeptalk', 'move sleeptalk, move sleeptalk'); battle.makeChoices('move sleeptalk, move sleeptalk', 'move sleeptalk, move sleeptalk'); battle.makeChoices('move sleeptalk, move sleeptalk', 'move sleeptalk, move sleeptalk'); diff --git a/test/sim/moves/grassyterrain.js b/test/sim/moves/grassyterrain.js index e15c889f21..57575d5cd3 100644 --- a/test/sim/moves/grassyterrain.js +++ b/test/sim/moves/grassyterrain.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Grassy Terrain', function () { - afterEach(function () { +describe('Grassy Terrain', () => { + afterEach(() => { battle.destroy(); }); - it(`should change the current terrain to Grassy Terrain for five turns`, function () { + it(`should change the current terrain to Grassy Terrain for five turns`, () => { battle = common.createBattle([[ - {species: 'Florges', moves: ['grassyterrain', 'sleeptalk']}, + { species: 'Florges', moves: ['grassyterrain', 'sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 4; i++) { battle.makeChoices(); @@ -24,11 +24,11 @@ describe('Grassy Terrain', function () { assert(battle.field.isTerrain('')); }); - it(`should halve the base power of Earthquake, Bulldoze, and Magnitude against grounded targets`, function () { + it(`should halve the base power of Earthquake, Bulldoze, and Magnitude against grounded targets`, () => { battle = common.createBattle([[ - {species: 'Shaymin', moves: ['grassyterrain']}, + { species: 'Shaymin', moves: ['grassyterrain'] }, ], [ - {species: 'Aerodactyl', moves: ['sleeptalk']}, + { species: 'Aerodactyl', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const shaymin = battle.p1.active[0]; @@ -39,11 +39,11 @@ describe('Grassy Terrain', function () { assert.equal(battle.runEvent('BasePower', shaymin, aerodactyl, Dex.moves.get('bulldoze'), 60, true), 60); }); - it(`should increase the base power of Grass-type attacks used by grounded Pokemon`, function () { + it(`should increase the base power of Grass-type attacks used by grounded Pokemon`, () => { battle = common.gen(7).createBattle([[ - {species: 'Shaymin', moves: ['grassyterrain']}, + { species: 'Shaymin', moves: ['grassyterrain'] }, ], [ - {species: 'Aerodactyl', moves: ['sleeptalk']}, + { species: 'Aerodactyl', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); let basePower; @@ -56,11 +56,11 @@ describe('Grassy Terrain', function () { assert.equal(basePower, move.basePower); }); - it(`should heal grounded Pokemon by 1/16 of their max HP`, function () { + it(`should heal grounded Pokemon by 1/16 of their max HP`, () => { battle = common.createBattle([[ - {species: 'Shaymin', moves: ['grassyterrain', 'seismictoss']}, + { species: 'Shaymin', moves: ['grassyterrain', 'seismictoss'] }, ], [ - {species: 'Wynaut', moves: ['magnetrise', 'seismictoss']}, + { species: 'Wynaut', moves: ['magnetrise', 'seismictoss'] }, ]]); battle.makeChoices('move grassyterrain', 'move magnetrise'); battle.makeChoices('move seismictoss', 'move seismictoss'); @@ -70,11 +70,11 @@ describe('Grassy Terrain', function () { assert.equal(wynaut.hp, wynaut.maxhp - 100); }); - it(`should not affect Pokemon in a semi-invulnerable state`, function () { + it(`should not affect Pokemon in a semi-invulnerable state`, () => { battle = common.createBattle([[ - {species: 'Shaymin', moves: ['grassyterrain', 'seismictoss']}, + { species: 'Shaymin', moves: ['grassyterrain', 'seismictoss'] }, ], [ - {species: 'Wynaut', moves: ['skydrop', 'seismictoss']}, + { species: 'Wynaut', moves: ['skydrop', 'seismictoss'] }, ]]); battle.makeChoices('move seismictoss', 'move seismictoss'); battle.makeChoices('move grassyterrain', 'move skydrop'); @@ -84,22 +84,22 @@ describe('Grassy Terrain', function () { assert.equal(wynaut.hp, wynaut.maxhp - 100); }); - it(`should cause Nature Power to become Energy Ball`, function () { + it(`should cause Nature Power to become Energy Ball`, () => { battle = common.createBattle([[ - {species: 'Shaymin', moves: ['grassyterrain']}, + { species: 'Shaymin', moves: ['grassyterrain'] }, ], [ - {species: 'Wynaut', moves: ['naturepower']}, + { species: 'Wynaut', moves: ['naturepower'] }, ]]); battle.makeChoices(); const resultMove = toID(battle.log[battle.lastMoveLine].split('|')[3]); assert.equal(resultMove, 'energyball'); }); - it(`should heal by Speed order in the same block as Leftovers`, function () { + it(`should heal by Speed order in the same block as Leftovers`, () => { battle = common.createBattle([[ - {species: 'rillaboom', ability: 'grassysurge', item: 'leftovers', moves: ['seismictoss']}, + { species: 'rillaboom', ability: 'grassysurge', item: 'leftovers', moves: ['seismictoss'] }, ], [ - {species: 'alakazam', item: 'focussash', moves: ['seismictoss']}, + { species: 'alakazam', item: 'focussash', moves: ['seismictoss'] }, ]]); battle.makeChoices(); @@ -111,12 +111,12 @@ describe('Grassy Terrain', function () { assert(rillaGrassyIndex < rillaLeftoversIndex, 'Rillaboom should heal from Grassy Terrain before Leftovers'); }); - it(`should only decrement turn count when being set before it would decrement in the end-of-turn effects`, function () { + it(`should only decrement turn count when being set before it would decrement in the end-of-turn effects`, () => { battle = common.createBattle([[ - {species: 'grookey', ability: 'grassysurge', moves: ['sleeptalk']}, + { species: 'grookey', ability: 'grassysurge', moves: ['sleeptalk'] }, ], [ - {species: 'shedinja', ability: 'neutralizinggas', item: 'stickybarb', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'shedinja', ability: 'neutralizinggas', item: 'stickybarb', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); // KO Neutralizing Gas @@ -130,12 +130,12 @@ describe('Grassy Terrain', function () { assert(battle.field.isTerrain('grassyterrain'), `Grassy Terrain should still be active turn 5, ending turn 6.`); }); - it.skip(`should not skip healing Pokemon if it was set during the block it would heal Pokemon`, function () { + it.skip(`should not skip healing Pokemon if it was set during the block it would heal Pokemon`, () => { battle = common.createBattle([[ - {species: 'coalossal', ability: 'grassysurge', moves: ['sleeptalk', 'rockthrow']}, + { species: 'coalossal', ability: 'grassysurge', moves: ['sleeptalk', 'rockthrow'] }, ], [ - {species: 'shedinja', ability: 'neutralizinggas', item: 'focussash', moves: ['dragonrage']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'shedinja', ability: 'neutralizinggas', item: 'focussash', moves: ['dragonrage'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move rockthrow dynamax', 'auto'); diff --git a/test/sim/moves/gravity.js b/test/sim/moves/gravity.js index 88f5593e67..10c8b3c847 100644 --- a/test/sim/moves/gravity.js +++ b/test/sim/moves/gravity.js @@ -5,41 +5,41 @@ const common = require('./../../common'); let battle; -describe('Gravity', function () { - afterEach(function () { +describe('Gravity', () => { + afterEach(() => { battle.destroy(); }); - it('should ground Flying-type Pokemon and remove their Ground immunity', function () { + it('should ground Flying-type Pokemon and remove their Ground immunity', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Aerodactyl', ability: 'pressure', moves: ['gravity']}]}); - battle.setPlayer('p2', {team: [{species: 'Aron', ability: 'sturdy', moves: ['earthpower']}]}); + battle.setPlayer('p1', { team: [{ species: 'Aerodactyl', ability: 'pressure', moves: ['gravity'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Aron', ability: 'sturdy', moves: ['earthpower'] }] }); battle.makeChoices('move gravity', 'move earthpower'); assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should ground Pokemon with Levitate and remove their Ground immunity', function () { + it('should ground Pokemon with Levitate and remove their Ground immunity', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Rotom', ability: 'levitate', moves: ['gravity']}]}); - battle.setPlayer('p2', {team: [{species: 'Aron', ability: 'sturdy', moves: ['earthpower']}]}); + battle.setPlayer('p1', { team: [{ species: 'Rotom', ability: 'levitate', moves: ['gravity'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Aron', ability: 'sturdy', moves: ['earthpower'] }] }); battle.makeChoices('move gravity', 'move earthpower'); assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should interrupt and disable the use of airborne moves', function () { + it('should interrupt and disable the use of airborne moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Spiritomb', ability: 'pressure', moves: ['gravity']}]}); - battle.setPlayer('p2', {team: [{species: 'Aerodactyl', ability: 'pressure', moves: ['fly']}]}); + battle.setPlayer('p1', { team: [{ species: 'Spiritomb', ability: 'pressure', moves: ['gravity'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Aerodactyl', ability: 'pressure', moves: ['fly'] }] }); battle.makeChoices('move gravity', 'move fly'); assert(!battle.p2.active[0].volatiles['twoturnmove']); assert.cantMove(() => battle.makeChoices('move gravity', 'move fly'), 'Aerodactyl', 'Fly'); }); - it('should allow the use of Z-moves of Gravity-blocked moves, but only apply their Z-effects', function () { + it('should allow the use of Z-moves of Gravity-blocked moves, but only apply their Z-effects', () => { battle = common.gen(7).createBattle([[ - {species: "Magikarp", ability: 'protean', item: 'normaliumz', moves: ['splash', 'sleeptalk']}, + { species: "Magikarp", ability: 'protean', item: 'normaliumz', moves: ['splash', 'sleeptalk'] }, ], [ - {species: "Accelgor", moves: ['gravity']}, + { species: "Accelgor", moves: ['gravity'] }, ]]); battle.makeChoices('move splash zmove', 'move gravity'); diff --git a/test/sim/moves/haze.js b/test/sim/moves/haze.js index 8b4f7070a3..24333bd937 100644 --- a/test/sim/moves/haze.js +++ b/test/sim/moves/haze.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('[Gen 1] Haze', function () { - afterEach(function () { +describe('[Gen 1] Haze', () => { + afterEach(() => { battle.destroy(); }); - it('should remove stat changes', function () { + it('should remove stat changes', () => { battle = common.gen(1).createBattle([ - [{species: "Mew", moves: ['agility', 'haze']}], - [{species: "Mewtwo", moves: ['swordsdance', 'splash']}], + [{ species: "Mew", moves: ['agility', 'haze'] }], + [{ species: "Mewtwo", moves: ['swordsdance', 'splash'] }], ]); battle.makeChoices('move agility', 'move swordsdance'); @@ -25,11 +25,11 @@ describe('[Gen 1] Haze', function () { assert.equal(battle.p2.active[0].boosts.atk, 0); }); - it(`should remove opponent's status`, function () { + it(`should remove opponent's status`, () => { battle = common.gen(1).createBattle([[ - {species: 'Mew', moves: ['thunderwave', 'haze']}, + { species: 'Mew', moves: ['thunderwave', 'haze'] }, ], [ - {species: 'Mewtwo', moves: ['splash']}, + { species: 'Mewtwo', moves: ['splash'] }, ]]); battle.makeChoices('move thunderwave', 'move splash'); @@ -39,11 +39,11 @@ describe('[Gen 1] Haze', function () { assert.equal(battle.p2.active[0].status, ''); }); - it(`should not remove the user's status`, function () { - battle = common.gen(1).createBattle({forceRandomChance: false}, [[ - {species: 'Mew', moves: ['recover']}, + it(`should not remove the user's status`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: false }, [[ + { species: 'Mew', moves: ['recover'] }, ], [ - {species: 'Mewtwo', moves: ['haze']}, + { species: 'Mewtwo', moves: ['haze'] }, ]]); const mewtwo = battle.p2.active[0]; @@ -53,10 +53,10 @@ describe('[Gen 1] Haze', function () { assert.equal(battle.p2.active[0].status, 'par'); }); - it('should remove focus energy', function () { + it('should remove focus energy', () => { battle = common.gen(1).createBattle([ - [{species: "Mew", moves: ['splash']}], - [{species: "Mewtwo", moves: ['focusenergy', 'haze']}], + [{ species: "Mew", moves: ['splash'] }], + [{ species: "Mewtwo", moves: ['focusenergy', 'haze'] }], ]); battle.makeChoices('move splash', 'move focusenergy'); @@ -66,10 +66,10 @@ describe('[Gen 1] Haze', function () { assert.equal(typeof battle.p2.active[0].volatiles['focusenergy'], 'undefined'); }); - it('should remove reflect and light screen', function () { + it('should remove reflect and light screen', () => { battle = common.gen(1).createBattle([ - [{species: "Mew", moves: ['reflect', 'lightscreen', 'haze']}], - [{species: "Mewtwo", moves: ['splash']}], + [{ species: "Mew", moves: ['reflect', 'lightscreen', 'haze'] }], + [{ species: "Mewtwo", moves: ['splash'] }], ]); battle.makeChoices('move reflect', 'move splash'); @@ -83,11 +83,11 @@ describe('[Gen 1] Haze', function () { assert.equal(typeof battle.p1.active[0].volatiles['lightscreen'], 'undefined'); }); - it(`should remove Leech Seed and confusion`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['leechseed', 'confuse ray', 'haze']}, + it(`should remove Leech Seed and confusion`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['leechseed', 'confuse ray', 'haze'] }, ], [ - {species: 'Muk', moves: ['splash']}, + { species: 'Muk', moves: ['splash'] }, ]]); const mukVolatiles = battle.p2.active[0].volatiles; @@ -101,11 +101,11 @@ describe('[Gen 1] Haze', function () { assert.false('confusion' in mukVolatiles); }); - it(`should remove Disable`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['disable', 'haze', 'splash']}, + it(`should remove Disable`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['disable', 'haze', 'splash'] }, ], [ - {species: 'Muk', moves: ['splash', 'tackle']}, + { species: 'Muk', moves: ['splash', 'tackle'] }, ]]); const p2volatiles = battle.p2.active[0].volatiles; @@ -117,11 +117,11 @@ describe('[Gen 1] Haze', function () { assert.false('disable' in p2volatiles); }); - it(`should still make previously disabled Pokemon (on the same turn) with 1 move use Struggle`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['disable', 'haze']}, + it(`should still make previously disabled Pokemon (on the same turn) with 1 move use Struggle`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['disable', 'haze'] }, ], [ - {species: 'Muk', moves: ['tackle']}, + { species: 'Muk', moves: ['tackle'] }, ]]); const p2volatiles = battle.p2.active[0].volatiles; battle.makeChoices('move disable', 'auto'); @@ -131,11 +131,11 @@ describe('[Gen 1] Haze', function () { assert.equal(battle.lastMove.name, 'Struggle'); }); - it(`should convert toxic poisoning to regular poisoning for the user and effectively reset the toxic counter`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Mew', moves: ['toxic']}, + it(`should convert toxic poisoning to regular poisoning for the user and effectively reset the toxic counter`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Mew', moves: ['toxic'] }, ], [ - {species: 'Abra', moves: ['haze']}, + { species: 'Abra', moves: ['haze'] }, ]]); const abra = battle.p2.active[0]; battle.makeChoices(); @@ -144,10 +144,10 @@ describe('[Gen 1] Haze', function () { assert.equal(abra.maxhp - abra.hp, Math.floor(abra.maxhp / 16) * 2); }); - it('should not remove substitute from either side', function () { + it('should not remove substitute from either side', () => { battle = common.gen(1).createBattle([ - [{species: "Mew", moves: ['substitute', 'haze']}], - [{species: "Muk", moves: ['substitute', 'splash']}], + [{ species: "Mew", moves: ['substitute', 'haze'] }], + [{ species: "Muk", moves: ['substitute', 'splash'] }], ]); battle.makeChoices('move substitute', 'move substitute'); @@ -156,10 +156,10 @@ describe('[Gen 1] Haze', function () { assert('substitute' in battle.p2.active[0].volatiles); }); - it.skip('should not allow a previously sleeping opponent to move on the same turn', function () { + it.skip('should not allow a previously sleeping opponent to move on the same turn', () => { battle = common.gen(1).createBattle([ - [{species: "Mew", moves: ['spore', 'haze', 'tackle']}], - [{species: "Muk", moves: ['splash']}], + [{ species: "Mew", moves: ['spore', 'haze', 'tackle'] }], + [{ species: "Muk", moves: ['splash'] }], ]); battle.makeChoices('move spore', 'auto'); battle.makeChoices('move haze', 'auto'); @@ -169,10 +169,10 @@ describe('[Gen 1] Haze', function () { assert.equal(battle.lastMove.name, 'Splash'); }); - it.skip('should not allow a previously frozen opponent to move on the same turn', function () { + it.skip('should not allow a previously frozen opponent to move on the same turn', () => { battle = common.gen(1).createBattle([ - [{species: "Mew", moves: ['haze', 'icebeam']}], - [{species: "Muk", moves: ['splash']}], + [{ species: "Mew", moves: ['haze', 'icebeam'] }], + [{ species: "Muk", moves: ['splash'] }], ]); battle.p2.active[0].trySetStatus('frz', battle.p2.active[0]); battle.makeChoices('move icebeam', 'auto'); diff --git a/test/sim/moves/healbell.js b/test/sim/moves/healbell.js index 4e0f41c7a3..272ee73f5a 100644 --- a/test/sim/moves/healbell.js +++ b/test/sim/moves/healbell.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Heal Bell', function () { - afterEach(function () { +describe('Heal Bell', () => { + afterEach(() => { battle.destroy(); }); - it(`should heal the major status conditions of the user's team`, function () { + it(`should heal the major status conditions of the user's team`, () => { battle = common.createBattle([[ - {species: 'Dunsparce', moves: ['sleeptalk']}, - {species: 'Chansey', moves: ['healbell']}, + { species: 'Dunsparce', moves: ['sleeptalk'] }, + { species: 'Chansey', moves: ['healbell'] }, ], [ - {species: 'Nidoking', moves: ['toxic', 'glare']}, + { species: 'Nidoking', moves: ['toxic', 'glare'] }, ]]); battle.makeChoices('auto', 'move glare'); @@ -25,16 +25,16 @@ describe('Heal Bell', function () { assert.equal(battle.p1.pokemon[1].status, ''); }); - it(`in a Multi Battle, should heal the major status conditions of the ally's team`, function () { - battle = common.createBattle({gameType: 'multi'}, [[ - {species: 'Machamp', ability: 'noguard', moves: ['poisongas']}, + it(`in a Multi Battle, should heal the major status conditions of the ally's team`, () => { + battle = common.createBattle({ gameType: 'multi' }, [[ + { species: 'Machamp', ability: 'noguard', moves: ['poisongas'] }, ], [ - {species: 'Cubone', moves: ['sleeptalk']}, - {species: 'Diggersby', moves: ['sleeptalk']}, + { species: 'Cubone', moves: ['sleeptalk'] }, + { species: 'Diggersby', moves: ['sleeptalk'] }, ], [ - {species: 'Marowak', moves: ['sleeptalk']}, + { species: 'Marowak', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk', 'healbell']}, + { species: 'Wynaut', moves: ['sleeptalk', 'healbell'] }, ]]); battle.makeChoices(); @@ -44,15 +44,15 @@ describe('Heal Bell', function () { assert.equal(battle.p4.pokemon[0].status, '', `Wynaut should not be poisoned.`); // Heal Bell should work from both p2 and p4 - battle = common.createBattle({gameType: 'multi'}, [[ - {species: 'Machamp', ability: 'noguard', moves: ['poisongas']}, + battle = common.createBattle({ gameType: 'multi' }, [[ + { species: 'Machamp', ability: 'noguard', moves: ['poisongas'] }, ], [ - {species: 'Wynaut', moves: ['sleeptalk', 'healbell']}, + { species: 'Wynaut', moves: ['sleeptalk', 'healbell'] }, ], [ - {species: 'Marowak', moves: ['sleeptalk']}, + { species: 'Marowak', moves: ['sleeptalk'] }, ], [ - {species: 'Cubone', moves: ['sleeptalk']}, - {species: 'Diggersby', moves: ['sleeptalk']}, + { species: 'Cubone', moves: ['sleeptalk'] }, + { species: 'Diggersby', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -62,15 +62,15 @@ describe('Heal Bell', function () { assert.equal(battle.p2.pokemon[0].status, '', `Wynaut should not be poisoned.`); }); - it(`in a Free-For-All, should heal the major status conditions of the user's team, and not any opposing teams`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'Machamp', ability: 'noguard', moves: ['poisongas']}, + it(`in a Free-For-All, should heal the major status conditions of the user's team, and not any opposing teams`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'Machamp', ability: 'noguard', moves: ['poisongas'] }, ], [ - {species: 'Marowak', moves: ['sleeptalk']}, + { species: 'Marowak', moves: ['sleeptalk'] }, ], [ - {species: 'Cubone', moves: ['sleeptalk']}, + { species: 'Cubone', moves: ['sleeptalk'] }, ], [ - {species: 'Wynaut', moves: ['healbell']}, + { species: 'Wynaut', moves: ['healbell'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/healblock.js b/test/sim/moves/healblock.js index d7bea20325..0d7c1fffd6 100644 --- a/test/sim/moves/healblock.js +++ b/test/sim/moves/healblock.js @@ -5,58 +5,58 @@ const common = require('./../../common'); let battle; -describe('Heal Block', function () { - afterEach(function () { +describe('Heal Block', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent Pokemon from gaining HP from residual recovery items', function () { + it('should prevent Pokemon from gaining HP from residual recovery items', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Hippowdon', ability: 'sandstream', moves: ['healblock']}]}); - battle.setPlayer('p2', {team: [{species: 'Spiritomb', ability: 'pressure', item: 'leftovers', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Hippowdon', ability: 'sandstream', moves: ['healblock'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Spiritomb', ability: 'pressure', item: 'leftovers', moves: ['calmmind'] }] }); battle.makeChoices('move healblock', 'move calmmind'); assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should prevent Pokemon from consuming HP recovery items', function () { + it('should prevent Pokemon from consuming HP recovery items', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', moves: ['healblock']}]}); - battle.setPlayer('p2', {team: [{species: 'Pansage', ability: 'gluttony', item: 'berryjuice', moves: ['bellydrum']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['healblock'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Pansage', ability: 'gluttony', item: 'berryjuice', moves: ['bellydrum'] }] }); battle.makeChoices('move healblock', 'move bellydrum'); assert.equal(battle.p2.active[0].item, 'berryjuice'); assert.equal(battle.p2.active[0].hp, Math.ceil(battle.p2.active[0].maxhp / 2)); }); - it('should disable the use of healing moves', function () { + it('should disable the use of healing moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Spiritomb', ability: 'pressure', moves: ['healblock']}]}); - battle.setPlayer('p2', {team: [{species: 'Cresselia', ability: 'levitate', moves: ['recover']}]}); + battle.setPlayer('p1', { team: [{ species: 'Spiritomb', ability: 'pressure', moves: ['healblock'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Cresselia', ability: 'levitate', moves: ['recover'] }] }); battle.makeChoices('move healblock', 'move recover'); assert.cantMove(() => battle.makeChoices('move healblock', 'move recover'), 'Cresselia', 'Recover'); }); - it('should prevent Pokemon from using draining moves', function () { + it('should prevent Pokemon from using draining moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', moves: ['healblock']}]}); - battle.setPlayer('p2', {team: [{species: 'Venusaur', ability: 'overgrow', moves: ['gigadrain']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['healblock'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Venusaur', ability: 'overgrow', moves: ['gigadrain'] }] }); battle.makeChoices('move healblock', 'move gigadrain'); assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should prevent abilities from recovering HP', function () { + it('should prevent abilities from recovering HP', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', moves: ['healblock', 'surf']}]}); - battle.setPlayer('p2', {team: [{species: 'Quagsire', ability: 'waterabsorb', moves: ['bellydrum', 'calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['healblock', 'surf'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Quagsire', ability: 'waterabsorb', moves: ['bellydrum', 'calmmind'] }] }); battle.makeChoices('move healblock', 'move bellydrum'); const hp = battle.p2.active[0].hp; battle.makeChoices('move surf', 'move calmmind'); assert.equal(battle.p2.active[0].hp, hp); }); - it('should prevent Leech Seed from healing HP', function () { + it('should prevent Leech Seed from healing HP', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Starmie', ability: 'noguard', moves: ['healblock']}]}); - battle.setPlayer('p2', {team: [{species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'leechseed']}]}); + battle.setPlayer('p1', { team: [{ species: 'Starmie', ability: 'noguard', moves: ['healblock'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'leechseed'] }] }); battle.makeChoices('move healblock', 'move substitute'); const hp = battle.p2.active[0].hp; battle.makeChoices('move healblock', 'move leechseed'); @@ -64,10 +64,10 @@ describe('Heal Block', function () { assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should not prevent the target from using Z-Powered healing status moves or healing from Z Power', function () { + it('should not prevent the target from using Z-Powered healing status moves or healing from Z Power', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Beheeyem', ability: 'telepathy', item: 'normaliumz', moves: ['psychic', 'healblock', 'recover']}]}); - battle.setPlayer('p2', {team: [{species: 'Elgyem', ability: 'telepathy', item: 'psychiumz', moves: ['psychic', 'healblock', 'teleport']}]}); + battle.setPlayer('p1', { team: [{ species: 'Beheeyem', ability: 'telepathy', item: 'normaliumz', moves: ['psychic', 'healblock', 'recover'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Elgyem', ability: 'telepathy', item: 'psychiumz', moves: ['psychic', 'healblock', 'teleport'] }] }); battle.makeChoices('move psychic', 'move psychic'); battle.makeChoices('move healblock', 'move healblock'); battle.makeChoices('move recover zmove', 'move teleport zmove'); @@ -76,43 +76,43 @@ describe('Heal Block', function () { }); }); -describe('Heal Block [Gen 5]', function () { - afterEach(function () { +describe('Heal Block [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent Pokemon from gaining HP from residual recovery items', function () { + it('should prevent Pokemon from gaining HP from residual recovery items', () => { battle = common.gen(5).createBattle([ - [{species: 'Hippowdon', ability: 'sandstream', moves: ['healblock']}], - [{species: 'Spiritomb', ability: 'pressure', item: 'leftovers', moves: ['calmmind']}], + [{ species: 'Hippowdon', ability: 'sandstream', moves: ['healblock'] }], + [{ species: 'Spiritomb', ability: 'pressure', item: 'leftovers', moves: ['calmmind'] }], ]); battle.makeChoices('move healblock', 'move calmmind'); assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should prevent Pokemon from consuming HP recovery items', function () { + it('should prevent Pokemon from consuming HP recovery items', () => { battle = common.gen(5).createBattle([ - [{species: 'Sableye', ability: 'prankster', moves: ['healblock']}], - [{species: 'Pansage', ability: 'gluttony', item: 'sitrusberry', moves: ['bellydrum']}], + [{ species: 'Sableye', ability: 'prankster', moves: ['healblock'] }], + [{ species: 'Pansage', ability: 'gluttony', item: 'sitrusberry', moves: ['bellydrum'] }], ]); battle.makeChoices('move healblock', 'move bellydrum'); assert.equal(battle.p2.active[0].item, 'sitrusberry'); assert.equal(battle.p2.active[0].hp, Math.ceil(battle.p2.active[0].maxhp / 2)); }); - it('should disable the use of healing moves', function () { + it('should disable the use of healing moves', () => { battle = common.gen(5).createBattle([ - [{species: 'Spiritomb', ability: 'pressure', moves: ['healblock']}], - [{species: 'Cresselia', ability: 'levitate', moves: ['recover']}], + [{ species: 'Spiritomb', ability: 'pressure', moves: ['healblock'] }], + [{ species: 'Cresselia', ability: 'levitate', moves: ['recover'] }], ]); battle.makeChoices('move healblock', 'move recover'); assert.cantMove(() => battle.makeChoices('move healblock', 'move recover'), 'Cresselia', 'Recover'); }); - it('should prevent abilities from recovering HP', function () { + it('should prevent abilities from recovering HP', () => { battle = common.gen(5).createBattle([ - [{species: 'Sableye', ability: 'prankster', moves: ['healblock', 'surf']}], - [{species: 'Quagsire', ability: 'waterabsorb', moves: ['bellydrum', 'calmmind']}], + [{ species: 'Sableye', ability: 'prankster', moves: ['healblock', 'surf'] }], + [{ species: 'Quagsire', ability: 'waterabsorb', moves: ['bellydrum', 'calmmind'] }], ]); battle.makeChoices('move healblock', 'move bellydrum'); const hp = battle.p2.active[0].hp; @@ -120,10 +120,10 @@ describe('Heal Block [Gen 5]', function () { assert.equal(battle.p2.active[0].hp, hp); }); - it('should prevent draining moves from healing HP', function () { + it('should prevent draining moves from healing HP', () => { battle = common.gen(5).createBattle([ - [{species: 'Sableye', ability: 'prankster', moves: ['healblock']}], - [{species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'gigadrain']}], + [{ species: 'Sableye', ability: 'prankster', moves: ['healblock'] }], + [{ species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'gigadrain'] }], ]); battle.makeChoices('move healblock', 'move substitute'); const hp = battle.p2.active[0].hp; @@ -132,10 +132,10 @@ describe('Heal Block [Gen 5]', function () { assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should prevent Leech Seed from healing HP', function () { + it('should prevent Leech Seed from healing HP', () => { battle = common.gen(5).createBattle([ - [{species: 'Starmie', ability: 'noguard', moves: ['healblock']}], - [{species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'leechseed']}], + [{ species: 'Starmie', ability: 'noguard', moves: ['healblock'] }], + [{ species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'leechseed'] }], ]); const hp = battle.p2.active[0].hp; battle.makeChoices('move healblock', 'move leechseed'); @@ -144,33 +144,33 @@ describe('Heal Block [Gen 5]', function () { }); }); -describe('Heal Block [Gen 4]', function () { - afterEach(function () { +describe('Heal Block [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should disable the use of healing moves', function () { + it('should disable the use of healing moves', () => { battle = common.gen(4).createBattle([ - [{species: 'Spiritomb', ability: 'pressure', moves: ['healblock']}], - [{species: 'Cresselia', ability: 'levitate', moves: ['recover']}], + [{ species: 'Spiritomb', ability: 'pressure', moves: ['healblock'] }], + [{ species: 'Cresselia', ability: 'levitate', moves: ['recover'] }], ]); battle.makeChoices('move healblock', 'move recover'); assert.cantMove(() => battle.makeChoices('move healblock', 'move recover'), 'Cresselia', 'Recover'); }); - it('should block the effect of Wish', function () { + it('should block the effect of Wish', () => { battle = common.gen(4).createBattle([ - [{species: 'Spiritomb', ability: 'pressure', moves: ['healblock']}], - [{species: 'Deoxys', ability: 'pressure', moves: ['wish']}], + [{ species: 'Spiritomb', ability: 'pressure', moves: ['healblock'] }], + [{ species: 'Deoxys', ability: 'pressure', moves: ['wish'] }], ]); battle.makeChoices('move healblock', 'move wish'); assert.cantMove(() => battle.makeChoices('move healblock', 'move wish'), 'Deoxys', 'Wish'); }); - it('should prevent draining moves from healing HP', function () { + it('should prevent draining moves from healing HP', () => { battle = common.gen(4).createBattle([ - [{species: 'Sableye', ability: 'prankster', moves: ['healblock']}], - [{species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'gigadrain']}], + [{ species: 'Sableye', ability: 'prankster', moves: ['healblock'] }], + [{ species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'gigadrain'] }], ]); battle.makeChoices('move healblock', 'move substitute'); const hp = battle.p2.active[0].hp; @@ -179,10 +179,10 @@ describe('Heal Block [Gen 4]', function () { assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should allow HP recovery items to activate', function () { + it('should allow HP recovery items to activate', () => { battle = common.gen(4).createBattle([ - [{species: 'Spiritomb', ability: 'pressure', moves: ['healblock', 'shadowball']}], - [{species: 'Abra', level: 1, ability: 'synchronize', item: 'leftovers', moves: ['celebrate', 'endure']}, {species: 'Abra', level: 1, ability: 'synchronize', item: 'sitrusberry', moves: ['celebrate', 'endure']}], + [{ species: 'Spiritomb', ability: 'pressure', moves: ['healblock', 'shadowball'] }], + [{ species: 'Abra', level: 1, ability: 'synchronize', item: 'leftovers', moves: ['celebrate', 'endure'] }, { species: 'Abra', level: 1, ability: 'synchronize', item: 'sitrusberry', moves: ['celebrate', 'endure'] }], ]); battle.makeChoices('move healblock', 'move celebrate'); battle.makeChoices('move shadowball', 'move endure'); @@ -193,10 +193,10 @@ describe('Heal Block [Gen 4]', function () { assert.notEqual(battle.p2.active[0].hp, 1); }); - it('should allow abilities that recover HP to activate', function () { + it('should allow abilities that recover HP to activate', () => { battle = common.gen(4).createBattle([ - [{species: 'Sableye', ability: 'keeneye', moves: ['healblock', 'surf']}], - [{species: 'Quagsire', ability: 'waterabsorb', moves: ['bellydrum', 'calmmind']}], + [{ species: 'Sableye', ability: 'keeneye', moves: ['healblock', 'surf'] }], + [{ species: 'Quagsire', ability: 'waterabsorb', moves: ['bellydrum', 'calmmind'] }], ]); battle.makeChoices('move healblock', 'move bellydrum'); const hp = battle.p2.active[0].hp; @@ -204,10 +204,10 @@ describe('Heal Block [Gen 4]', function () { assert.notEqual(battle.p2.active[0].hp, hp); }); - it('should prevent Leech Seed from healing HP', function () { + it('should prevent Leech Seed from healing HP', () => { battle = common.gen(4).createBattle([ - [{species: 'Starmie', ability: 'noguard', moves: ['healblock']}], - [{species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'leechseed']}], + [{ species: 'Starmie', ability: 'noguard', moves: ['healblock'] }], + [{ species: 'Venusaur', ability: 'overgrow', moves: ['substitute', 'leechseed'] }], ]); battle.makeChoices('move healblock', 'move substitute'); const hp = battle.p2.active[0].hp; @@ -216,14 +216,14 @@ describe('Heal Block [Gen 4]', function () { assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it('should fail indepedently on each target', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'porygon2', moves: ['sleeptalk']}, - {species: 'marshadow', moves: ['sleeptalk']}, - {species: 'mew', moves: ['sleeptalk']}, + it('should fail indepedently on each target', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'porygon2', moves: ['sleeptalk'] }, + { species: 'marshadow', moves: ['sleeptalk'] }, + { species: 'mew', moves: ['sleeptalk'] }, ], [ - {species: 'zapdos', moves: ['sleeptalk']}, - {species: 'skitty', moves: ['healblock']}, + { species: 'zapdos', moves: ['sleeptalk'] }, + { species: 'skitty', moves: ['healblock'] }, ]]); battle.makeChoices('move sleeptalk, move sleeptalk', 'move sleeptalk, move healblock'); diff --git a/test/sim/moves/healingwish.js b/test/sim/moves/healingwish.js index 6def07a722..dff578ed5a 100644 --- a/test/sim/moves/healingwish.js +++ b/test/sim/moves/healingwish.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('Healing Wish', function () { - afterEach(function () { +describe('Healing Wish', () => { + afterEach(() => { battle.destroy(); }); - it('should heal a switch-in for full before hazards at end of turn', function () { + it('should heal a switch-in for full before hazards at end of turn', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Caterpie', ability: 'shielddust', moves: ['stringshot']}, - {species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish', 'protect']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Shedinja', ability: 'wonderguard', moves: ['endeavor']}, - {species: 'Tyranitar', ability: 'sandstream', moves: ['seismictoss', 'stealthrock']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Caterpie', ability: 'shielddust', moves: ['stringshot'] }, + { species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish', 'protect'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Shedinja', ability: 'wonderguard', moves: ['endeavor'] }, + { species: 'Tyranitar', ability: 'sandstream', moves: ['seismictoss', 'stealthrock'] }, + ] }); battle.makeChoices('move stringshot', 'move endeavor'); // set Caterpie to 1hp battle.makeChoices('switch jirachi', 'switch tyranitar'); // set up Sand @@ -32,15 +32,15 @@ describe('Healing Wish', function () { assert.equal(battle.p1.active[0].moveSlots[0].pp, 63); }); - it('should not be consumed if a switch-in is fully healed already', function () { + it('should not be consumed if a switch-in is fully healed already', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish', 'protect']}, - {species: 'Caterpie', ability: 'shielddust', moves: ['stringshot']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Tyranitar', ability: 'sandstream', moves: ['seismictoss', 'stealthrock']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish', 'protect'] }, + { species: 'Caterpie', ability: 'shielddust', moves: ['stringshot'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Tyranitar', ability: 'sandstream', moves: ['seismictoss', 'stealthrock'] }, + ] }); battle.makeChoices('move protect', 'move stealthrock'); // set up Sand and Stealth Rock battle.makeChoices('move healingwish', 'move seismictoss'); assert.equal(battle.requestState, 'switch'); @@ -49,17 +49,17 @@ describe('Healing Wish', function () { assert(battle.p1.slotConditions[0]['healingwish']); }); - it('should heal an ally fully after Ally Switch', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish']}, - {species: 'Caterpie', ability: 'shielddust', moves: ['stringshot']}, - {species: 'Rotom', ability: 'levitate', moves: ['allyswitch']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Garchomp', ability: 'sandveil', moves: ['sleeptalk']}, - {species: 'Shedinja', ability: 'wonderguard', moves: ['endeavor', 'protect']}, - ]}); + it('should heal an ally fully after Ally Switch', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish'] }, + { species: 'Caterpie', ability: 'shielddust', moves: ['stringshot'] }, + { species: 'Rotom', ability: 'levitate', moves: ['allyswitch'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Garchomp', ability: 'sandveil', moves: ['sleeptalk'] }, + { species: 'Shedinja', ability: 'wonderguard', moves: ['endeavor', 'protect'] }, + ] }); // set up Healing Wish, Caterpie is at 1 HP battle.makeChoices('move healingwish, move stringshot', 'move sleeptalk, move endeavor 2'); assert.equal(battle.requestState, 'switch'); @@ -72,35 +72,35 @@ describe('Healing Wish', function () { assert.false(battle.p1.slotConditions[0]['healingwish']); }); - it(`should fail to switch the user out if no Pokemon can be switched in`, function () { + it(`should fail to switch the user out if no Pokemon can be switched in`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['healingwish']}, + { species: 'wynaut', moves: ['healingwish'] }, ], [ - {species: 'pichu', moves: ['swordsdance']}, + { species: 'pichu', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-fail'))); assert.false.fainted(battle.p1.active[0]); - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['healingwish']}, - {species: 'pichu', moves: ['swordsdance']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['healingwish'] }, + { species: 'pichu', moves: ['swordsdance'] }, ], [ - {species: 'pichu', moves: ['swordsdance']}, - {species: 'pichu', moves: ['swordsdance']}, + { species: 'pichu', moves: ['swordsdance'] }, + { species: 'pichu', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-fail'))); assert.false.fainted(battle.p1.active[0]); }); - it(`should not set up the slot condition when it fails`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wobbuffet', moves: ['healingwish', 'swordsdance']}, - {species: 'wynaut', moves: ['swordsdance', 'allyswitch']}, + it(`should not set up the slot condition when it fails`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wobbuffet', moves: ['healingwish', 'swordsdance'] }, + { species: 'wynaut', moves: ['swordsdance', 'allyswitch'] }, ], [ - {species: 'dratini', moves: ['breakingswipe', 'swordsdance']}, - {species: 'pichu', moves: ['swordsdance']}, + { species: 'dratini', moves: ['breakingswipe', 'swordsdance'] }, + { species: 'pichu', moves: ['swordsdance'] }, ]]); const wynaut = battle.p1.active[1]; battle.makeChoices(); @@ -109,17 +109,17 @@ describe('Healing Wish', function () { assert.false.fullHP(wynaut); }); - it('[Gen 4] should heal a switch-in for full after hazards mid-turn', function () { + it('[Gen 4] should heal a switch-in for full after hazards mid-turn', () => { battle = common.gen(4).createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Caterpie', ability: 'shielddust', moves: ['stringshot']}, - {species: 'Raichu', ability: 'lightningrod', moves: ['growl']}, - {species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Shedinja', ability: 'wonderguard', moves: ['endeavor']}, - {species: 'Tyranitar', ability: 'sandstream', moves: ['seismictoss', 'stealthrock']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Caterpie', ability: 'shielddust', moves: ['stringshot'] }, + { species: 'Raichu', ability: 'lightningrod', moves: ['growl'] }, + { species: 'Jirachi', ability: 'serenegrace', moves: ['healingwish'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Shedinja', ability: 'wonderguard', moves: ['endeavor'] }, + { species: 'Tyranitar', ability: 'sandstream', moves: ['seismictoss', 'stealthrock'] }, + ] }); battle.makeChoices('move String Shot', 'move Endeavor'); // set Caterpie to 1hp diff --git a/test/sim/moves/highjumpkick.js b/test/sim/moves/highjumpkick.js index 1e532512ec..5f4b3b5fb8 100644 --- a/test/sim/moves/highjumpkick.js +++ b/test/sim/moves/highjumpkick.js @@ -5,32 +5,32 @@ const common = require('./../../common'); let battle; -describe('High Jump Kick', function () { - afterEach(function () { +describe('High Jump Kick', () => { + afterEach(() => { battle.destroy(); }); - it('should damage the user if it does not hit the target', function () { + it('should damage the user if it does not hit the target', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Gastly', ability: 'levitate', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Hitmonlee', ability: 'limber', moves: ['highjumpkick']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Gastly', ability: 'levitate', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Hitmonlee', ability: 'limber', moves: ['highjumpkick'] }, + ] }); assert.hurts(battle.p2.active[0], () => battle.makeChoices()); }); - it('should not damage the user if there was no target', function () { + it('should not damage the user if there was no target', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Dugtrio', ability: 'sandveil', moves: ['memento']}, - {species: 'Dugtrio', ability: 'sandveil', moves: ['memento']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Hitmonlee', ability: 'limber', moves: ['highjumpkick']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Dugtrio', ability: 'sandveil', moves: ['memento'] }, + { species: 'Dugtrio', ability: 'sandveil', moves: ['memento'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Hitmonlee', ability: 'limber', moves: ['highjumpkick'] }, + ] }); assert.false.hurts(battle.p2.active[0], () => battle.makeChoices()); }); diff --git a/test/sim/moves/hydrosteam.js b/test/sim/moves/hydrosteam.js index 2a4c2be833..1ae26acc26 100644 --- a/test/sim/moves/hydrosteam.js +++ b/test/sim/moves/hydrosteam.js @@ -5,49 +5,49 @@ const common = require('./../../common'); let battle; -describe('Hydro Steam', function () { - afterEach(function () { +describe('Hydro Steam', () => { + afterEach(() => { battle.destroy(); }); - it(`should have its damage multiplied by 1.5 in Sunny Day`, function () { + it(`should have its damage multiplied by 1.5 in Sunny Day`, () => { battle = common.createBattle([[ - {species: 'Volcanion', ability: 'waterabsorb', moves: ['hydrosteam']}, + { species: 'Volcanion', ability: 'waterabsorb', moves: ['hydrosteam'] }, ], [ - {species: 'Koraidon', ability: 'orichalcumpulse', moves: ['luckychant']}, + { species: 'Koraidon', ability: 'orichalcumpulse', moves: ['luckychant'] }, ]]); const koraidon = battle.p2.active[0]; battle.makeChoices(); assert.bounded(koraidon.maxhp - koraidon.hp, [81, 96]); }); - it(`should have its damaged halved if the user holds a Utility Umbrella`, function () { + it(`should have its damaged halved if the user holds a Utility Umbrella`, () => { battle = common.createBattle([[ - {species: 'Volcanion', ability: 'waterabsorb', item: 'utilityumbrella', moves: ['hydrosteam']}, + { species: 'Volcanion', ability: 'waterabsorb', item: 'utilityumbrella', moves: ['hydrosteam'] }, ], [ - {species: 'Koraidon', ability: 'orichalcumpulse', moves: ['luckychant']}, + { species: 'Koraidon', ability: 'orichalcumpulse', moves: ['luckychant'] }, ]]); const koraidon = battle.p2.active[0]; battle.makeChoices(); assert.bounded(koraidon.maxhp - koraidon.hp, [27, 32]); }); - it(`should have its damage multiplied by 1.5 if only the target holds Utility Umbrella`, function () { + it(`should have its damage multiplied by 1.5 if only the target holds Utility Umbrella`, () => { battle = common.createBattle([[ - {species: 'Volcanion', ability: 'waterabsorb', moves: ['hydrosteam']}, + { species: 'Volcanion', ability: 'waterabsorb', moves: ['hydrosteam'] }, ], [ - {species: 'Koraidon', ability: 'orichalcumpulse', item: 'utilityumbrella', moves: ['luckychant']}, + { species: 'Koraidon', ability: 'orichalcumpulse', item: 'utilityumbrella', moves: ['luckychant'] }, ]]); const koraidon = battle.p2.active[0]; battle.makeChoices(); assert.bounded(koraidon.maxhp - koraidon.hp, [81, 96]); }); - it(`should not have its damage changed if both the user and target hold Utility Umbrellas`, function () { + it(`should not have its damage changed if both the user and target hold Utility Umbrellas`, () => { battle = common.createBattle([[ - {species: 'Volcanion', ability: 'waterabsorb', item: 'utilityumbrella', moves: ['hydrosteam']}, + { species: 'Volcanion', ability: 'waterabsorb', item: 'utilityumbrella', moves: ['hydrosteam'] }, ], [ - {species: 'Koraidon', ability: 'orichalcumpulse', item: 'utilityumbrella', moves: ['luckychant']}, + { species: 'Koraidon', ability: 'orichalcumpulse', item: 'utilityumbrella', moves: ['luckychant'] }, ]]); const koraidon = battle.p2.active[0]; battle.makeChoices(); diff --git a/test/sim/moves/hyperbeam.js b/test/sim/moves/hyperbeam.js index 708d2a438b..2cf82b1aaf 100644 --- a/test/sim/moves/hyperbeam.js +++ b/test/sim/moves/hyperbeam.js @@ -5,58 +5,58 @@ const common = require('./../../common'); let battle; -describe(`Hyper Beam`, function () { - afterEach(function () { +describe(`Hyper Beam`, () => { + afterEach(() => { battle.destroy(); }); - it(`should always force a recharge turn`, function () { + it(`should always force a recharge turn`, () => { battle = common.createBattle([[ - {species: 'snorlax', ability: 'noguard', moves: ['hyperbeam', 'tackle']}, + { species: 'snorlax', ability: 'noguard', moves: ['hyperbeam', 'tackle'] }, ], [ - {species: 'alakazam', moves: ['substitute']}, + { species: 'alakazam', moves: ['substitute'] }, ]]); battle.makeChoices(); assert.cantMove(() => battle.choose('p1', 'move tackle')); }); - it(`[Gen 1] should not force a recharge turn after KOing a Pokemon`, function () { + it(`[Gen 1] should not force a recharge turn after KOing a Pokemon`, () => { battle = common.gen(1).createBattle([[ - {species: 'snorlax', moves: ['hyperbeam', 'tackle']}, + { species: 'snorlax', moves: ['hyperbeam', 'tackle'] }, ], [ - {species: 'abra', moves: ['swordsdance']}, - {species: 'exeggutor', moves: ['swordsdance']}, + { species: 'abra', moves: ['swordsdance'] }, + { species: 'exeggutor', moves: ['swordsdance'] }, ]]); battle.makeChoices(); battle.choose('p2', 'switch exeggutor'); assert.false.cantMove(() => battle.choose('p1', 'move tackle')); }); - it(`[Gen 1] should not force a recharge turn after breaking a Substitute`, function () { + it(`[Gen 1] should not force a recharge turn after breaking a Substitute`, () => { battle = common.gen(1).createBattle([[ - {species: 'snorlax', moves: ['hyperbeam', 'tackle']}, + { species: 'snorlax', moves: ['hyperbeam', 'tackle'] }, ], [ - {species: 'alakazam', moves: ['substitute']}, + { species: 'alakazam', moves: ['substitute'] }, ]]); battle.makeChoices(); assert.false.cantMove(() => battle.choose('p1', 'move tackle')); }); - it(`[Gen 1] should force a recharge turn after damaging, but not breaking a Substitute`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'slowpoke', moves: ['hyperbeam', 'tackle']}, + it(`[Gen 1] should force a recharge turn after damaging, but not breaking a Substitute`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'slowpoke', moves: ['hyperbeam', 'tackle'] }, ], [ - {species: 'rhydon', moves: ['substitute']}, + { species: 'rhydon', moves: ['substitute'] }, ]]); battle.makeChoices(); assert.cantMove(() => battle.choose('p1', 'move tackle')); }); - it(`[Gen 1] Partial trapping moves negate recharge turns (recharging Pokemon is slower))`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'cloyster', moves: ['surf', 'clamp']}, + it(`[Gen 1] Partial trapping moves negate recharge turns (recharging Pokemon is slower))`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'cloyster', moves: ['surf', 'clamp'] }, ], [ - {species: 'snorlax', moves: ['hyperbeam']}, + { species: 'snorlax', moves: ['hyperbeam'] }, ]]); // All moves hit battle.makeChoices(); @@ -66,11 +66,11 @@ describe(`Hyper Beam`, function () { assert(battle.p2.active[0].volatiles['partiallytrapped']); }); - it(`[Gen 1] Partial trapping moves negate recharge turns (recharging Pokemon is faster)`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'cloyster', moves: ['clamp']}, + it(`[Gen 1] Partial trapping moves negate recharge turns (recharging Pokemon is faster)`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'cloyster', moves: ['clamp'] }, ], [ - {species: 'aerodactyl', moves: ['hyperbeam']}, + { species: 'aerodactyl', moves: ['hyperbeam'] }, ]]); // All moves hit battle.makeChoices(); @@ -79,11 +79,11 @@ describe(`Hyper Beam`, function () { assert(battle.p2.active[0].volatiles['partiallytrapped']); }); - it(`[Gen 1] Hyper Beam automatic selection glitch`, function () { - battle = common.gen(1).createBattle({seed: [0, 0, 1, 0]}, [[ - {species: 'cloyster', moves: ['surf', 'clamp']}, + it(`[Gen 1] Hyper Beam automatic selection glitch`, () => { + battle = common.gen(1).createBattle({ seed: [0, 0, 1, 0] }, [[ + { species: 'cloyster', moves: ['surf', 'clamp'] }, ], [ - {species: 'snorlax', moves: ['hyperbeam']}, + { species: 'snorlax', moves: ['hyperbeam'] }, ]]); // All moves hit in the first turn battle.makeChoices(); diff --git a/test/sim/moves/hypervoice.js b/test/sim/moves/hypervoice.js index 7d1a17f356..f19b96b1ef 100644 --- a/test/sim/moves/hypervoice.js +++ b/test/sim/moves/hypervoice.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Hyper Voice', function () { - afterEach(function () { +describe('Hyper Voice', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'hypervoice']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'hypervoice'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move hypervoice', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); }); -describe('Hyper Voice [Gen 5]', function () { - afterEach(function () { +describe('Hyper Voice [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'hypervoice']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'hypervoice'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move hypervoice', 'move rest'); diff --git a/test/sim/moves/icespinner.js b/test/sim/moves/icespinner.js index 2b844b68e1..d1916dbd36 100644 --- a/test/sim/moves/icespinner.js +++ b/test/sim/moves/icespinner.js @@ -5,52 +5,52 @@ const common = require('./../../common'); let battle; -describe(`Ice Spinner`, function () { - afterEach(function () { +describe(`Ice Spinner`, () => { + afterEach(() => { battle.destroy(); }); - it(`should remove Terrains if the user is active and on the field`, function () { + it(`should remove Terrains if the user is active and on the field`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['icespinner']}, + { species: 'wynaut', moves: ['icespinner'] }, ], [ - {species: 'registeel', ability: 'psychicsurge', moves: ['sleeptalk']}, + { species: 'registeel', ability: 'psychicsurge', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false(battle.field.isTerrain('psychicterrain')); }); - it.skip(`should not remove Terrains if the user faints from Life Orb`, function () { + it.skip(`should not remove Terrains if the user faints from Life Orb`, () => { battle = common.createBattle([[ - {species: 'shedinja', item: 'lifeorb', moves: ['icespinner']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'shedinja', item: 'lifeorb', moves: ['icespinner'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'registeel', ability: 'psychicsurge', moves: ['sleeptalk']}, + { species: 'registeel', ability: 'psychicsurge', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.field.isTerrain('psychicterrain')); }); - it(`should not remove Terrains if the user faints from Rocky Helmet`, function () { + it(`should not remove Terrains if the user faints from Rocky Helmet`, () => { battle = common.createBattle([[ - {species: 'shedinja', moves: ['icespinner']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'shedinja', moves: ['icespinner'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'registeel', item: 'rockyhelmet', ability: 'psychicsurge', moves: ['sleeptalk']}, + { species: 'registeel', item: 'rockyhelmet', ability: 'psychicsurge', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.field.isTerrain('psychicterrain')); }); - it.skip(`should not remove Terrains if the user is forced out via Red Card`, function () { + it.skip(`should not remove Terrains if the user is forced out via Red Card`, () => { battle = common.createBattle([[ - {species: 'shedinja', moves: ['icespinner']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'shedinja', moves: ['icespinner'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'registeel', item: 'redcard', ability: 'psychicsurge', moves: ['sleeptalk']}, + { species: 'registeel', item: 'redcard', ability: 'psychicsurge', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/imprison.js b/test/sim/moves/imprison.js index 4e0da7bc05..e3105a9e73 100644 --- a/test/sim/moves/imprison.js +++ b/test/sim/moves/imprison.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('Imprison', function () { - afterEach(function () { +describe('Imprison', () => { + afterEach(() => { battle.destroy(); }); - it(`should prevent foes from using moves that the user knows`, function () { + it(`should prevent foes from using moves that the user knows`, () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Abra', ability: 'prankster', moves: ['imprison', 'calmmind', 'batonpass']}, - {species: 'Kadabra', ability: 'prankster', moves: ['imprison', 'calmmind']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Abra', ability: 'synchronize', moves: ['calmmind', 'gravity']}, - {species: 'Kadabra', ability: 'prankster', moves: ['imprison', 'calmmind']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Abra', ability: 'prankster', moves: ['imprison', 'calmmind', 'batonpass'] }, + { species: 'Kadabra', ability: 'prankster', moves: ['imprison', 'calmmind'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Abra', ability: 'synchronize', moves: ['calmmind', 'gravity'] }, + { species: 'Kadabra', ability: 'prankster', moves: ['imprison', 'calmmind'] }, + ] }); battle.makeChoices('move imprison', 'move calmmind'); assert.statStage(battle.p2.active[0], 'spa', 0); @@ -48,24 +48,24 @@ describe('Imprison', function () { assert.statStage(battle.p2.active[0], 'spa', 3); }); - it(`should not prevent foes from using Z-Powered Status moves`, function () { + it(`should not prevent foes from using Z-Powered Status moves`, () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', moves: ['imprison', 'sunnyday']}]}); - battle.setPlayer('p2', {team: [{species: 'Charmander', ability: 'blaze', item: 'firiumz', moves: ['sunnyday']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['imprison', 'sunnyday'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Charmander', ability: 'blaze', item: 'firiumz', moves: ['sunnyday'] }] }); battle.makeChoices('move imprison', 'move sunnyday zmove'); assert.statStage(battle.p2.active[0], 'spe', 1); assert(battle.field.isWeather('sunnyday')); }); - it(`should not prevent the user from using moves that a foe knows`, function () { + it(`should not prevent the user from using moves that a foe knows`, () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Abra', ability: 'prankster', moves: ['imprison', 'calmmind', 'batonpass']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Abra', ability: 'synchronize', moves: ['calmmind', 'gravity']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Abra', ability: 'prankster', moves: ['imprison', 'calmmind', 'batonpass'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Abra', ability: 'synchronize', moves: ['calmmind', 'gravity'] }, + ] }); const imprisonUser = battle.p1.active[0]; battle.makeChoices('move imprison', 'auto'); diff --git a/test/sim/moves/ingrain.js b/test/sim/moves/ingrain.js index c1a9e48dfb..b3f0fb4a8d 100644 --- a/test/sim/moves/ingrain.js +++ b/test/sim/moves/ingrain.js @@ -5,20 +5,20 @@ const common = require('./../../common'); let battle; -describe('Ingrain', function () { - afterEach(function () { +describe('Ingrain', () => { + afterEach(() => { battle.destroy(); }); - it('should heal the user by 1/16 of its max HP at the end of each turn', function () { + it('should heal the user by 1/16 of its max HP at the end of each turn', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Cradily', ability: 'prankster', moves: ['ingrain', 'batonpass']}, - {species: 'Lileep', ability: 'stormdrain', moves: ['ingrain', 'uturn']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Miltank', ability: 'thickfat', moves: ['seismictoss', 'protect']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Cradily', ability: 'prankster', moves: ['ingrain', 'batonpass'] }, + { species: 'Lileep', ability: 'stormdrain', moves: ['ingrain', 'uturn'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Miltank', ability: 'thickfat', moves: ['seismictoss', 'protect'] }, + ] }); battle.makeChoices('move ingrain', 'move seismictoss'); assert.equal(battle.p1.active[0].hp, Math.floor(battle.p1.active[0].maxhp * 17 / 16) - 100); @@ -37,23 +37,23 @@ describe('Ingrain', function () { assert.equal(battle.p1.active[0].hp, Math.floor(battle.p1.active[0].maxhp * 17 / 16) - 200); }); - it('should prevent the user from being forced out or switching out', function () { + it('should prevent the user from being forced out or switching out', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Cradily', ability: 'stormdrain', moves: ['ingrain']}, - {species: 'Pikachu', ability: 'static', moves: ['thunder']}, - ]}); - battle.setPlayer('p2', {team: [{species: 'Arcanine', ability: 'flashfire', moves: ['sleeptalk', 'roar']}]}); + battle.setPlayer('p1', { team: [ + { species: 'Cradily', ability: 'stormdrain', moves: ['ingrain'] }, + { species: 'Pikachu', ability: 'static', moves: ['thunder'] }, + ] }); + battle.setPlayer('p2', { team: [{ species: 'Arcanine', ability: 'flashfire', moves: ['sleeptalk', 'roar'] }] }); battle.makeChoices('move ingrain', 'move roar'); assert.equal(battle.p1.active[0].species.id, 'cradily'); assert.trapped(() => battle.makeChoices('switch pikachu', 'move sleeptalk')); assert.equal(battle.p1.active[0].species.id, 'cradily'); }); - it('should remove the users\' Ground immunities', function () { + it('should remove the users\' Ground immunities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Tropius', ability: 'harvest', moves: ['earthquake', 'ingrain']}]}); - battle.setPlayer('p2', {team: [{species: 'Carnivine', ability: 'levitate', moves: ['earthquake', 'ingrain']}]}); + battle.setPlayer('p1', { team: [{ species: 'Tropius', ability: 'harvest', moves: ['earthquake', 'ingrain'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Carnivine', ability: 'levitate', moves: ['earthquake', 'ingrain'] }] }); battle.makeChoices('move ingrain', 'move ingrain'); battle.makeChoices('move earthquake', 'move earthquake'); assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); diff --git a/test/sim/moves/instruct.js b/test/sim/moves/instruct.js index cb79eafbd7..fca4d72252 100644 --- a/test/sim/moves/instruct.js +++ b/test/sim/moves/instruct.js @@ -5,22 +5,22 @@ const common = require('./../../common'); let battle; -describe(`Instruct`, function () { +describe(`Instruct`, () => { afterEach(() => battle.destroy()); - it(`should make the target reuse its last move`, function () { + it(`should make the target reuse its last move`, () => { battle = common.createBattle([ - [{species: "Cramorant", moves: ['stockpile']}], - [{species: "Oranguru", moves: ['instruct']}], + [{ species: "Cramorant", moves: ['stockpile'] }], + [{ species: "Oranguru", moves: ['instruct'] }], ]); battle.makeChoices(); assert.equal(battle.p1.active[0].boosts.def, 2); }); - it(`should not trigger AfterMove effects of the instructed move for the Instruct user`, function () { + it(`should not trigger AfterMove effects of the instructed move for the Instruct user`, () => { battle = common.createBattle([ - [{species: "Swalot", moves: ['stockpile', 'spitup']}], - [{species: "Duskull", moves: ['stockpile', 'instruct']}], + [{ species: "Swalot", moves: ['stockpile', 'spitup'] }], + [{ species: "Duskull", moves: ['stockpile', 'instruct'] }], ]); battle.makeChoices(); battle.makeChoices('move spitup', 'move instruct'); diff --git a/test/sim/moves/judgment.js b/test/sim/moves/judgment.js index 1e0a920914..eb1f2759e6 100644 --- a/test/sim/moves/judgment.js +++ b/test/sim/moves/judgment.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe(`Judgment`, function () { +describe(`Judgment`, () => { afterEach(() => battle.destroy()); - it(`should adapt its type to a held Plate`, function () { + it(`should adapt its type to a held Plate`, () => { battle = common.createBattle([ - [{species: "Arceus", ability: 'Honey Gather', item: 'spookyplate', moves: ['judgment']}], - [{species: "Spiritomb", ability: 'stancechange', moves: ['calmmind']}], + [{ species: "Arceus", ability: 'Honey Gather', item: 'spookyplate', moves: ['judgment'] }], + [{ species: "Spiritomb", ability: 'stancechange', moves: ['calmmind'] }], ]); assert.hurts(battle.p2.active[0], () => battle.makeChoices('move judgment', 'move calmmind')); }); - it(`should not adapt its type to a held Z Crystal`, function () { + it(`should not adapt its type to a held Z Crystal`, () => { battle = common.createBattle([ - [{species: "Arceus", ability: 'Honey Gather', item: 'ghostiumz', moves: ['judgment']}], - [{species: "Spiritomb", ability: 'stancechange', moves: ['calmmind']}], + [{ species: "Arceus", ability: 'Honey Gather', item: 'ghostiumz', moves: ['judgment'] }], + [{ species: "Spiritomb", ability: 'stancechange', moves: ['calmmind'] }], ]); battle.makeChoices('move judgment', 'move calmmind'); assert.fullHP(battle.p2.active[0]); diff --git a/test/sim/moves/kingsshield.js b/test/sim/moves/kingsshield.js index c21409db07..ae864fae23 100644 --- a/test/sim/moves/kingsshield.js +++ b/test/sim/moves/kingsshield.js @@ -5,44 +5,44 @@ const common = require('./../../common'); let battle; -describe(`King's Shield`, function () { +describe(`King's Shield`, () => { afterEach(() => battle.destroy()); - it(`should lower the Atk of a contactor by 2 in Gen 7`, function () { + it(`should lower the Atk of a contactor by 2 in Gen 7`, () => { battle = common.gen(7).createBattle([ - [{species: "Gallade", ability: 'justified', moves: ['zenheadbutt']}], - [{species: "Aegislash", ability: 'stancechange', moves: ['kingsshield']}], + [{ species: "Gallade", ability: 'justified', moves: ['zenheadbutt'] }], + [{ species: "Aegislash", ability: 'stancechange', moves: ['kingsshield'] }], ]); battle.makeChoices('move zenheadbutt', 'move kingsshield'); assert.statStage(battle.p1.active[0], 'atk', -2); }); - it(`should lower the Atk of a contactor by 1 in Gen 8`, function () { + it(`should lower the Atk of a contactor by 1 in Gen 8`, () => { battle = common.createBattle([ - [{species: "Gallade", ability: 'justified', moves: ['zenheadbutt']}], - [{species: "Aegislash", ability: 'stancechange', moves: ['kingsshield']}], + [{ species: "Gallade", ability: 'justified', moves: ['zenheadbutt'] }], + [{ species: "Aegislash", ability: 'stancechange', moves: ['kingsshield'] }], ]); battle.makeChoices('move zenheadbutt', 'move kingsshield'); assert.statStage(battle.p1.active[0], 'atk', -1); }); - it(`should lower the Atk of a contact-move attacker in 2 levels even if immune`, function () { + it(`should lower the Atk of a contact-move attacker in 2 levels even if immune`, () => { battle = common.createBattle([ - [{species: "Gallade", ability: 'justified', moves: ['drainpunch']}], - [{species: "Aegislash", ability: 'stancechange', moves: ['kingsshield']}], + [{ species: "Gallade", ability: 'justified', moves: ['drainpunch'] }], + [{ species: "Aegislash", ability: 'stancechange', moves: ['kingsshield'] }], ]); battle.makeChoices('move drainpunch', 'move kingsshield'); assert.statStage(battle.p1.active[0], 'atk', -1); }); }); -describe(`King's Shield [Gen 6]`, function () { +describe(`King's Shield [Gen 6]`, () => { afterEach(() => battle.destroy()); - it(`should not lower the Atk of a contact-move attacker if immune`, function () { + it(`should not lower the Atk of a contact-move attacker if immune`, () => { battle = common.gen(6).createBattle([ - [{species: "Gallade", ability: 'justified', moves: ['drainpunch']}], - [{species: "Aegislash", ability: 'stancechange', moves: ['kingsshield']}], + [{ species: "Gallade", ability: 'justified', moves: ['drainpunch'] }], + [{ species: "Aegislash", ability: 'stancechange', moves: ['kingsshield'] }], ]); battle.makeChoices('move drainpunch', 'move kingsshield'); assert.statStage(battle.p1.active[0], 'atk', 0); diff --git a/test/sim/moves/knockoff.js b/test/sim/moves/knockoff.js index bdc784753f..0b0bd95fb4 100644 --- a/test/sim/moves/knockoff.js +++ b/test/sim/moves/knockoff.js @@ -5,89 +5,89 @@ const common = require('./../../common'); let battle; -describe('Knock Off', function () { - afterEach(function () { +describe('Knock Off', () => { + afterEach(() => { battle.destroy(); }); - it('should remove most items', function () { + it('should remove most items', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled'] }] }); battle.makeChoices('move knockoff', 'move softboiled'); assert.equal(battle.p2.active[0].item, ''); }); - it('should not remove items when hitting Sub', function () { + it('should not remove items when hitting Sub', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'noability', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: "Ninjask", ability: 'noability', item: 'shedshell', moves: ['substitute']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'noability', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: "Ninjask", ability: 'noability', item: 'shedshell', moves: ['substitute'] }] }); battle.makeChoices(); assert.equal(battle.p2.active[0].item, 'shedshell'); }); - it('should not remove plates from Arceus', function () { + it('should not remove plates from Arceus', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: "Arceus", ability: 'download', item: 'flameplate', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: "Arceus", ability: 'download', item: 'flameplate', moves: ['swordsdance'] }] }); battle.makeChoices('move knockoff', 'move swordsdance'); assert.equal(battle.p2.active[0].item, 'flameplate'); }); - it('should not remove drives from Genesect', function () { + it('should not remove drives from Genesect', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: "Genesect", ability: 'download', item: 'dousedrive', moves: ['shiftgear']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: "Genesect", ability: 'download', item: 'dousedrive', moves: ['shiftgear'] }] }); battle.makeChoices('move knockoff', 'move shiftgear'); assert.equal(battle.p2.active[0].item, 'dousedrive'); }); - it('should not remove correctly held mega stones', function () { + it('should not remove correctly held mega stones', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: "Scizor", ability: 'technician', item: 'scizorite', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: "Scizor", ability: 'technician', item: 'scizorite', moves: ['swordsdance'] }] }); battle.makeChoices('move knockoff', 'move swordsdance'); assert.equal(battle.p2.active[0].item, 'scizorite'); }); - it('should remove wrong mega stones', function () { + it('should remove wrong mega stones', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: "Scizor", ability: 'technician', item: 'audinite', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: "Scizor", ability: 'technician', item: 'audinite', moves: ['swordsdance'] }] }); battle.makeChoices('move knockoff', 'move swordsdance'); assert.equal(battle.p2.active[0].item, ''); }); - it('should not remove items if the user faints mid-move', function () { + it('should not remove items if the user faints mid-move', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Shedinja", ability: 'wonderguard', moves: ['knockoff']}]}); - battle.setPlayer('p2', {team: [{species: "Ferrothorn", ability: 'ironbarbs', item: 'rockyhelmet', moves: ['curse']}]}); + battle.setPlayer('p1', { team: [{ species: "Shedinja", ability: 'wonderguard', moves: ['knockoff'] }] }); + battle.setPlayer('p2', { team: [{ species: "Ferrothorn", ability: 'ironbarbs', item: 'rockyhelmet', moves: ['curse'] }] }); battle.makeChoices('move knockoff', 'move curse'); assert.equal(battle.p2.active[0].item, 'rockyhelmet'); }); }); -describe('Knock Off [Gen 4]', function () { - afterEach(function () { +describe('Knock Off [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should only make the held item unusable, not actually remove it', function () { + it('should only make the held item unusable, not actually remove it', () => { battle = common.gen(4).createBattle([[ - {species: 'Wynaut', moves: ['knockoff']}, + { species: 'Wynaut', moves: ['knockoff'] }, ], [ - {species: 'Aggron', item: 'leftovers', moves: ['sleeptalk']}, + { species: 'Aggron', item: 'leftovers', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p2.active[0]); assert.false.fullHP(battle.p2.active[0], 'Aggron should not have been healed by Leftovers.'); }); - it('should make the target unable to gain a new item', function () { + it('should make the target unable to gain a new item', () => { battle = common.gen(4).createBattle([[ - {species: 'Wynaut', item: 'pokeball', moves: ['knockoff', 'trick']}, + { species: 'Wynaut', item: 'pokeball', moves: ['knockoff', 'trick'] }, ], [ - {species: 'Blissey', item: 'leftovers', moves: ['sleeptalk', 'thief']}, + { species: 'Blissey', item: 'leftovers', moves: ['sleeptalk', 'thief'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.active[0].item, 'pokeball'); @@ -97,11 +97,11 @@ describe('Knock Off [Gen 4]', function () { assert.equal(battle.p2.active[0].item, 'leftovers'); }); - it(`should not knock off the target's item if the target's ability is Sticky Hold or Multitype`, function () { + it(`should not knock off the target's item if the target's ability is Sticky Hold or Multitype`, () => { battle = common.gen(4).createBattle([[ - {species: 'Wynaut', moves: ['knockoff']}, + { species: 'Wynaut', moves: ['knockoff'] }, ], [ - {species: 'Aggron', ability: 'stickyhold', item: 'leftovers', moves: ['sleeptalk']}, + { species: 'Aggron', ability: 'stickyhold', item: 'leftovers', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p2.active[0]); @@ -109,9 +109,9 @@ describe('Knock Off [Gen 4]', function () { battle.destroy(); battle = common.gen(4).createBattle([[ - {species: 'Wynaut', moves: ['knockoff']}, + { species: 'Wynaut', moves: ['knockoff'] }, ], [ - {species: 'Arceus', ability: 'multitype', item: 'leftovers', moves: ['sleeptalk']}, + { species: 'Arceus', ability: 'multitype', item: 'leftovers', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p2.active[0]); diff --git a/test/sim/moves/lashout.js b/test/sim/moves/lashout.js index d899b12291..44118cb6a3 100644 --- a/test/sim/moves/lashout.js +++ b/test/sim/moves/lashout.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Lash Out', function () { - afterEach(function () { +describe('Lash Out', () => { + afterEach(() => { battle.destroy(); }); - it(`should double in base power if the user's stats were lowered this turn`, function () { + it(`should double in base power if the user's stats were lowered this turn`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['lashout']}, + { species: 'Wynaut', moves: ['lashout'] }, ], [ - {species: 'Blissey', moves: ['faketears']}, + { species: 'Blissey', moves: ['faketears'] }, ]]); battle.makeChoices(); const blissey = battle.p2.active[0]; @@ -22,13 +22,13 @@ describe('Lash Out', function () { assert.bounded(damage, [158, 186]); // If it wasn't doubled, range would be 79-94 }); - it(`should double in base power if the user's stats were lowered this turn by an ally`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['lashout']}, - {species: 'Blissey', moves: ['faketears']}, + it(`should double in base power if the user's stats were lowered this turn by an ally`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['lashout'] }, + { species: 'Blissey', moves: ['faketears'] }, ], [ - {species: 'Tyrogue', moves: ['sleeptalk']}, - {species: 'Tyrogue', moves: ['sleeptalk']}, + { species: 'Tyrogue', moves: ['sleeptalk'] }, + { species: 'Tyrogue', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move lashout -2, move faketears -1', 'auto'); const blissey = battle.p1.active[1]; @@ -36,11 +36,11 @@ describe('Lash Out', function () { assert.bounded(damage, [158, 186]); // If it wasn't doubled, range would be 79-94 }); - it(`should double in base power if the user's stats were lowered at the start of the match`, function () { + it(`should double in base power if the user's stats were lowered at the start of the match`, () => { battle = common.createBattle([[ - {species: 'Wynaut', ability: 'shellarmor', moves: ['lashout']}, + { species: 'Wynaut', ability: 'shellarmor', moves: ['lashout'] }, ], [ - {species: 'Blissey', ability: 'intimidate', moves: ['skillswap']}, + { species: 'Blissey', ability: 'intimidate', moves: ['skillswap'] }, ]]); battle.makeChoices(); const blissey = battle.p2.active[0]; @@ -48,12 +48,12 @@ describe('Lash Out', function () { assert.bounded(damage, [104, 123]); // If it wasn't doubled, range would be 52-62 }); - it(`should not double in base power if the user's stats were lowered at a switch after a KO`, function () { + it(`should not double in base power if the user's stats were lowered at a switch after a KO`, () => { battle = common.createBattle([[ - {species: 'Wynaut', ability: 'shellarmor', moves: ['lashout']}, + { species: 'Wynaut', ability: 'shellarmor', moves: ['lashout'] }, ], [ - {species: 'Shedinja', moves: ['sleeptalk']}, - {species: 'Blissey', ability: 'intimidate', moves: ['skillswap']}, + { species: 'Shedinja', moves: ['sleeptalk'] }, + { species: 'Blissey', ability: 'intimidate', moves: ['skillswap'] }, ]]); battle.makeChoices(); battle.makeChoices(); @@ -63,13 +63,13 @@ describe('Lash Out', function () { assert.bounded(damage, [52, 62]); // If it was doubled, range would be 104-123 }); - it(`should double in base power even if stat resets are reset by Haze`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['lashout']}, - {species: 'Blissey', moves: ['faketears']}, + it(`should double in base power even if stat resets are reset by Haze`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['lashout'] }, + { species: 'Blissey', moves: ['faketears'] }, ], [ - {species: 'Tyrogue', moves: ['haze']}, - {species: 'Tyrogue', moves: ['sleeptalk']}, + { species: 'Tyrogue', moves: ['haze'] }, + { species: 'Tyrogue', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move lashout -2, move faketears -1', 'auto'); const blissey = battle.p1.active[1]; diff --git a/test/sim/moves/leechseed.js b/test/sim/moves/leechseed.js index 6464800f33..e5a6f3ce7a 100644 --- a/test/sim/moves/leechseed.js +++ b/test/sim/moves/leechseed.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Leech Seed', function () { - afterEach(function () { +describe('Leech Seed', () => { + afterEach(() => { battle.destroy(); }); - it(`should heal and damage itself if it ends up in the same slot via Ally Switch`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'celesteela', ability: 'noguard', moves: ['sleeptalk', 'leechseed']}, - {species: 'comfey', moves: ['sleeptalk', 'allyswitch']}, + it(`should heal and damage itself if it ends up in the same slot via Ally Switch`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'celesteela', ability: 'noguard', moves: ['sleeptalk', 'leechseed'] }, + { species: 'comfey', moves: ['sleeptalk', 'allyswitch'] }, ], [ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move leech seed -2, move sleeptalk', 'auto'); const comfey = battle.p1.active[1]; diff --git a/test/sim/moves/magicroom.js b/test/sim/moves/magicroom.js index 75dba46e64..c840749c51 100644 --- a/test/sim/moves/magicroom.js +++ b/test/sim/moves/magicroom.js @@ -5,37 +5,37 @@ const common = require('./../../common'); let battle; -describe('Magic Room', function () { - afterEach(function () { +describe('Magic Room', () => { + afterEach(() => { battle.destroy(); }); - it(`should negate residual healing events`, function () { + it(`should negate residual healing events`, () => { battle = common.createBattle([[ - {species: 'Lopunny', item: 'leftovers', moves: ['bellydrum']}, + { species: 'Lopunny', item: 'leftovers', moves: ['bellydrum'] }, ], [ - {species: 'Golem', moves: ['magicroom']}, + { species: 'Golem', moves: ['magicroom'] }, ]]); const lopunny = battle.p1.active[0]; battle.makeChoices(); assert.equal(lopunny.hp, Math.ceil(lopunny.maxhp / 2)); }); - it(`should prevent items from being consumed`, function () { + it(`should prevent items from being consumed`, () => { battle = common.createBattle([[ - {species: 'Lopunny', item: 'chopleberry', moves: ['magicroom']}, + { species: 'Lopunny', item: 'chopleberry', moves: ['magicroom'] }, ], [ - {species: 'Golem', moves: ['lowkick']}, + { species: 'Golem', moves: ['lowkick'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p1.active[0]); }); - it(`should ignore the effects of items that disable moves`, function () { + it(`should ignore the effects of items that disable moves`, () => { battle = common.createBattle([[ - {species: 'Lopunny', item: 'assaultvest', moves: ['protect']}, + { species: 'Lopunny', item: 'assaultvest', moves: ['protect'] }, ], [ - {species: 'Golem', moves: ['magicroom']}, + { species: 'Golem', moves: ['magicroom'] }, ]]); const lopunny = battle.p1.active[0]; battle.makeChoices(); @@ -44,32 +44,32 @@ describe('Magic Room', function () { assert.equal(lopunny.lastMove.id, 'protect'); }); - it(`should cause Fling to fail`, function () { + it(`should cause Fling to fail`, () => { battle = common.createBattle([[ - {species: 'Lopunny', item: 'seaincense', moves: ['fling']}, + { species: 'Lopunny', item: 'seaincense', moves: ['fling'] }, ], [ - {species: 'Deoxys-Speed', moves: ['magicroom']}, + { species: 'Deoxys-Speed', moves: ['magicroom'] }, ]]); battle.makeChoices(); assert.holdsItem(battle.p1.active[0]); }); - it(`should not prevent Mega Evolution`, function () { + it(`should not prevent Mega Evolution`, () => { battle = common.createBattle([[ - {species: 'Lopunny', item: 'lopunnite', moves: ['sleeptalk']}, + { species: 'Lopunny', item: 'lopunnite', moves: ['sleeptalk'] }, ], [ - {species: 'Deoxys-Speed', moves: ['magicroom']}, + { species: 'Deoxys-Speed', moves: ['magicroom'] }, ]]); battle.makeChoices('move sleeptalk mega', 'move magicroom'); assert.species(battle.p1.active[0], 'Lopunny-Mega'); }); - it(`should not prevent Primal Reversion`, function () { + it(`should not prevent Primal Reversion`, () => { battle = common.createBattle([[ - {species: 'Zapdos', moves: ['uturn']}, - {species: 'Groudon', ability: 'drought', item: 'redorb', moves: ['protect']}, + { species: 'Zapdos', moves: ['uturn'] }, + { species: 'Groudon', ability: 'drought', item: 'redorb', moves: ['protect'] }, ], [ - {species: 'Accelgor', moves: ['magicroom']}, + { species: 'Accelgor', moves: ['magicroom'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2'); diff --git a/test/sim/moves/magneticflux.js b/test/sim/moves/magneticflux.js index 1cf20be6ce..6ec3eb5197 100644 --- a/test/sim/moves/magneticflux.js +++ b/test/sim/moves/magneticflux.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('Magnetic Flux', function () { - afterEach(function () { +describe('Magnetic Flux', () => { + afterEach(() => { battle.destroy(); }); - it('should boost the Defense and Special Defense of all active allies with Plus or Minus', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: "Minun", ability: 'minus', moves: ['sleeptalk']}, - {species: "Klinklang", ability: 'plus', moves: ['magneticflux']}, - {species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Plusle", ability: 'plus', moves: ['sleeptalk']}, - {species: "Klinklang", ability: 'minus', moves: ['magneticflux']}, - {species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk']}, - ]}); + it('should boost the Defense and Special Defense of all active allies with Plus or Minus', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: "Minun", ability: 'minus', moves: ['sleeptalk'] }, + { species: "Klinklang", ability: 'plus', moves: ['magneticflux'] }, + { species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Plusle", ability: 'plus', moves: ['sleeptalk'] }, + { species: "Klinklang", ability: 'minus', moves: ['magneticflux'] }, + { species: "Pyukumuku", ability: 'innardsout', moves: ['sleeptalk'] }, + ] }); battle.makeChoices('move sleeptalk, move magneticflux, move sleeptalk', 'move sleeptalk, move magneticflux, move sleeptalk'); for (const active of battle.getAllActive()) { if (active.name === 'Pyukumuku') continue; diff --git a/test/sim/moves/maxguard.js b/test/sim/moves/maxguard.js index 00071b7b99..1440c99150 100644 --- a/test/sim/moves/maxguard.js +++ b/test/sim/moves/maxguard.js @@ -5,28 +5,28 @@ const common = require('./../../common'); let battle; -describe('Max Guard', function () { - afterEach(function () { +describe('Max Guard', () => { + afterEach(() => { battle.destroy(); }); - it('should be disallowed by Taunt', function () { + it('should be disallowed by Taunt', () => { battle = common.gen(8).createBattle([[ - {species: "Feebas", moves: ['splash', 'tackle']}, + { species: "Feebas", moves: ['splash', 'tackle'] }, ], [ - {species: "Wynaut", moves: ['taunt', 'splash']}, + { species: "Wynaut", moves: ['taunt', 'splash'] }, ]]); battle.makeChoices('move tackle dynamax', 'auto'); assert.cantMove(() => battle.choose('p1', 'move splash'), 'Feebas', 'Max Guard', false); }); - it('should allow Feint to damage the user, but not break the protection effect', function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'minun', moves: ['sleeptalk']}, - {species: 'plusle', moves: ['sleeptalk']}, + it('should allow Feint to damage the user, but not break the protection effect', () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'minun', moves: ['sleeptalk'] }, + { species: 'plusle', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'noguard', moves: ['fissure']}, - {species: 'wynaut', moves: ['feint']}, + { species: 'wynaut', ability: 'noguard', moves: ['fissure'] }, + { species: 'wynaut', moves: ['feint'] }, ]]); battle.makeChoices('move sleeptalk dynamax, move sleeptalk', 'move fissure 1, move feint 1'); @@ -34,13 +34,13 @@ describe('Max Guard', function () { assert.false.fainted(minun); }); - it('should block certain moves that bypass Protect', function () { - battle = common.gen(8).createBattle({gameType: 'doubles'}, [[ - {species: 'sunflora', item: 'sitrusberry', ability: 'minus', moves: ['sleeptalk']}, - {species: 'plusle', ability: 'plus', moves: ['magneticflux', 'gearup']}, + it('should block certain moves that bypass Protect', () => { + battle = common.gen(8).createBattle({ gameType: 'doubles' }, [[ + { species: 'sunflora', item: 'sitrusberry', ability: 'minus', moves: ['sleeptalk'] }, + { species: 'plusle', ability: 'plus', moves: ['magneticflux', 'gearup'] }, ], [ - {species: 'ferrothorn', item: 'sitrusberry', moves: ['flowershield', 'teatime']}, - {species: 'tsareena', ability: 'intrepidsword', moves: ['psychup', 'sleeptalk']}, + { species: 'ferrothorn', item: 'sitrusberry', moves: ['flowershield', 'teatime'] }, + { species: 'tsareena', ability: 'intrepidsword', moves: ['psychup', 'sleeptalk'] }, ]]); battle.makeChoices('move sleeptalk dynamax, move magneticflux', 'move flowershield, move psychup 1'); diff --git a/test/sim/moves/mefirst.js b/test/sim/moves/mefirst.js index e96192e408..6e8ebfb87c 100644 --- a/test/sim/moves/mefirst.js +++ b/test/sim/moves/mefirst.js @@ -5,28 +5,28 @@ const common = require('./../../common'); let battle; -describe(`Me First`, function () { - afterEach(function () { +describe(`Me First`, () => { + afterEach(() => { battle.destroy(); }); - it(`should be selectable even if the user is Taunted or holds Assault Vest`, function () { + it(`should be selectable even if the user is Taunted or holds Assault Vest`, () => { battle = common.gen(7).createBattle([[ - {species: 'corphish', moves: ['sleeptalk']}, - {species: 'aerodactyl', item: 'assaultvest', moves: ['mefirst']}, + { species: 'corphish', moves: ['sleeptalk'] }, + { species: 'aerodactyl', item: 'assaultvest', moves: ['mefirst'] }, ], [ - {species: 'wynaut', moves: ['taunt', 'watergun']}, + { species: 'wynaut', moves: ['taunt', 'watergun'] }, ]]); battle.makeChoices('switch 2', 'move taunt'); battle.makeChoices('move mefirst', 'move watergun'); assert.false.fullHP(battle.p2.active[0]); }); - it(`should not copy recharge turns from moves like Hyper Beam`, function () { + it(`should not copy recharge turns from moves like Hyper Beam`, () => { battle = common.gen(7).createBattle([[ - {species: 'aerodactyl', moves: ['sleeptalk', 'mefirst']}, + { species: 'aerodactyl', moves: ['sleeptalk', 'mefirst'] }, ], [ - {species: 'wynaut', ability: 'noguard', moves: ['hyperbeam']}, + { species: 'wynaut', ability: 'noguard', moves: ['hyperbeam'] }, ]]); battle.makeChoices(); battle.makeChoices('move mefirst', 'auto'); diff --git a/test/sim/moves/memento.js b/test/sim/moves/memento.js index 4b5bc16049..04abcf04f6 100644 --- a/test/sim/moves/memento.js +++ b/test/sim/moves/memento.js @@ -5,39 +5,39 @@ const common = require('./../../common'); let battle; -describe(`Memento`, function () { - afterEach(function () { +describe(`Memento`, () => { + afterEach(() => { battle.destroy(); }); - it(`should cause the user to faint even if the target has Clear Body`, function () { + it(`should cause the user to faint even if the target has Clear Body`, () => { battle = common.createBattle([[ - {species: 'whimsicott', moves: ['memento']}, - {species: 'landorus', moves: ['sleeptalk']}, + { species: 'whimsicott', moves: ['memento'] }, + { species: 'landorus', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'clearbody', moves: ['sleeptalk']}, + { species: 'wynaut', ability: 'clearbody', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.equal(battle.requestState, 'switch'); }); - it(`should not cause the user to faint if used into Substitute`, function () { + it(`should not cause the user to faint if used into Substitute`, () => { battle = common.createBattle([[ - {species: 'whimsicott', moves: ['memento']}, - {species: 'landorus', moves: ['sleeptalk']}, + { species: 'whimsicott', moves: ['memento'] }, + { species: 'landorus', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'prankster', moves: ['substitute']}, + { species: 'wynaut', ability: 'prankster', moves: ['substitute'] }, ]]); battle.makeChoices(); assert.equal(battle.requestState, 'move'); }); - it(`should cause the user to faint after stat drops from Mirror Armor`, function () { + it(`should cause the user to faint after stat drops from Mirror Armor`, () => { battle = common.createBattle([[ - {species: 'whimsicott', moves: ['memento']}, - {species: 'landorus', moves: ['sleeptalk']}, + { species: 'whimsicott', moves: ['memento'] }, + { species: 'landorus', moves: ['sleeptalk'] }, ], [ - {species: 'corviknight', ability: 'mirrorarmor', moves: ['sleeptalk']}, + { species: 'corviknight', ability: 'mirrorarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const atkDrop = battle.log.includes('|-unboost|p1a: Whimsicott|atk|2'); @@ -46,12 +46,12 @@ describe(`Memento`, function () { assert.equal(battle.requestState, 'switch'); }); - it(`should set the Z-Memento healing flag even if the Memento itself was not successful`, function () { + it(`should set the Z-Memento healing flag even if the Memento itself was not successful`, () => { battle = common.createBattle([[ - {species: 'landorus', moves: ['sleeptalk']}, - {species: 'whimsicott', item: 'darkiniumz', moves: ['memento']}, + { species: 'landorus', moves: ['sleeptalk'] }, + { species: 'whimsicott', item: 'darkiniumz', moves: ['memento'] }, ], [ - {species: 'wynaut', ability: 'noguard', moves: ['circlethrow', 'substitute']}, + { species: 'wynaut', ability: 'noguard', moves: ['circlethrow', 'substitute'] }, ]]); battle.makeChoices('auto', 'move substitute'); battle.makeChoices(); diff --git a/test/sim/moves/metalburst.js b/test/sim/moves/metalburst.js index 0343d9ff3f..8cabdfbbd3 100644 --- a/test/sim/moves/metalburst.js +++ b/test/sim/moves/metalburst.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Metal Burst', function () { - afterEach(function () { +describe('Metal Burst', () => { + afterEach(() => { battle.destroy(); }); - it(`should run conditions for submove`, function () { + it(`should run conditions for submove`, () => { battle = common.createBattle([[ - {species: 'golem', moves: ['sleeptalk']}, - {species: 'snorlax', moves: ['sleeptalk', 'metalburst']}, + { species: 'golem', moves: ['sleeptalk'] }, + { species: 'snorlax', moves: ['sleeptalk', 'metalburst'] }, ], [ - {species: 'breloom', moves: ['spore', 'sonicboom']}, + { species: 'breloom', moves: ['spore', 'sonicboom'] }, ]]); battle.makeChoices('switch 2', 'move spore'); @@ -24,15 +24,15 @@ describe('Metal Burst', function () { assert.equal(breloom.hp, breloom.maxhp - battle.dex.moves.get('sonicboom').damage * 1.5); }); - it(`should target the opposing Pokemon that hit the user with an attack most recently that turn`, function () { + it(`should target the opposing Pokemon that hit the user with an attack most recently that turn`, () => { // The seed should select venusaur if the test would otherwise fail - battle = common.createBattle({gameType: 'doubles', seed: [3, 4, 5, 6]}, [[ - {species: 'snorlax', moves: ['metalburst']}, - {species: 'tauros', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles', seed: [3, 4, 5, 6] }, [[ + { species: 'snorlax', moves: ['metalburst'] }, + { species: 'tauros', moves: ['sleeptalk'] }, ], [ - {species: 'breloom', moves: ['uturn']}, - {species: 'venusaur', moves: ['swift']}, - {species: 'gallade', moves: ['sleeptalk']}, + { species: 'breloom', moves: ['uturn'] }, + { species: 'venusaur', moves: ['swift'] }, + { species: 'gallade', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move metalburst, move sleeptalk', 'move uturn 1, move swift'); battle.makeChoices(); @@ -40,11 +40,11 @@ describe('Metal Burst', function () { assert.fullHP(battle.p2.active[1]); }); - it(`should deal 1 damage if the user was hit by a 0-damage attack`, function () { + it(`should deal 1 damage if the user was hit by a 0-damage attack`, () => { battle = common.createBattle([[ - {species: 'munchlax', ability: 'sturdy', moves: ['sleeptalk', 'metalburst']}, + { species: 'munchlax', ability: 'sturdy', moves: ['sleeptalk', 'metalburst'] }, ], [ - {species: 'breloom', moves: ['closecombat', 'falseswipe']}, + { species: 'breloom', moves: ['closecombat', 'falseswipe'] }, ]]); battle.makeChoices('move sleeptalk', 'move closecombat'); @@ -52,13 +52,13 @@ describe('Metal Burst', function () { assert.equal(battle.p2.active[0].hp, battle.p2.active[0].maxhp - 1); }); - it(`should be subject to redirection`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'shuckle', moves: ['metalburst']}, - {species: 'chansey', ability: 'moldbreaker', moves: ['electrify', 'sleeptalk']}, + it(`should be subject to redirection`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'shuckle', moves: ['metalburst'] }, + { species: 'chansey', ability: 'moldbreaker', moves: ['electrify', 'sleeptalk'] }, ], [ - {species: 'blissey', moves: ['dragonrage']}, - {species: 'manectric', ability: 'lightningrod', moves: ['sleeptalk', 'followme']}, + { species: 'blissey', moves: ['dragonrage'] }, + { species: 'manectric', ability: 'lightningrod', moves: ['sleeptalk', 'followme'] }, ]]); const blissey = battle.p2.active[0]; const manectric = battle.p2.active[1]; diff --git a/test/sim/moves/mightycleave.js b/test/sim/moves/mightycleave.js index cd8efaa35b..1737ae3c09 100644 --- a/test/sim/moves/mightycleave.js +++ b/test/sim/moves/mightycleave.js @@ -5,13 +5,13 @@ const common = require('../../common'); let battle; -describe('Mighty Cleave', function () { +describe('Mighty Cleave', () => { afterEach(() => battle.destroy()); - it(`should go through Protect`, function () { + it(`should go through Protect`, () => { battle = common.createBattle([ - [{species: "Terrakion", ability: 'justified', moves: ['mightycleave']}], - [{species: "Entei", ability: 'innerfocus', moves: ['protect']}], + [{ species: "Terrakion", ability: 'justified', moves: ['mightycleave'] }], + [{ species: "Entei", ability: 'innerfocus', moves: ['protect'] }], ]); battle.makeChoices(); const damage = battle.p2.active[0].maxhp - battle.p2.active[0].hp; diff --git a/test/sim/moves/mindblown.js b/test/sim/moves/mindblown.js index ca696f77d0..16699ed6ac 100644 --- a/test/sim/moves/mindblown.js +++ b/test/sim/moves/mindblown.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Mind Blown', function () { - afterEach(function () { +describe('Mind Blown', () => { + afterEach(() => { battle.destroy(); }); - it('should deal damage to the user once per use equal to half its max HP, rounded up', function () { + it('should deal damage to the user once per use equal to half its max HP, rounded up', () => { battle = common.createBattle([[ - {species: "Blacephalon", ability: 'parentalbond', moves: ['mindblown']}, + { species: "Blacephalon", ability: 'parentalbond', moves: ['mindblown'] }, ], [ - {species: "Blissey", ability: 'healer', moves: ['sleeptalk']}, + { species: "Blissey", ability: 'healer', moves: ['sleeptalk'] }, ]]); assert.hurtsBy(battle.p1.active[0], Math.ceil(battle.p1.active[0].maxhp / 2), () => battle.makeChoices()); }); - it('should deal damage to the user even if it misses', function () { + it('should deal damage to the user even if it misses', () => { battle = common.createBattle([[ - {species: "Blacephalon", moves: ['mindblown']}, + { species: "Blacephalon", moves: ['mindblown'] }, ], [ - {species: "Talonflame", moves: ['fly']}, + { species: "Talonflame", moves: ['fly'] }, ]]); assert.hurtsBy(battle.p1.active[0], Math.ceil(battle.p1.active[0].maxhp / 2), () => battle.makeChoices()); }); diff --git a/test/sim/moves/miracleeye.js b/test/sim/moves/miracleeye.js index 3e825ef23d..d58dfcde23 100644 --- a/test/sim/moves/miracleeye.js +++ b/test/sim/moves/miracleeye.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Miracle Eye', function () { - afterEach(function () { +describe('Miracle Eye', () => { + afterEach(() => { battle.destroy(); }); - it(`should negate Psychic immunities`, function () { + it(`should negate Psychic immunities`, () => { battle = common.createBattle([[ - {species: 'Smeargle', moves: ['miracleeye', 'psychic']}, + { species: 'Smeargle', moves: ['miracleeye', 'psychic'] }, ], [ - {species: 'Darkrai', moves: ['sleeptalk']}, + { species: 'Darkrai', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move miracle eye', 'auto'); battle.makeChoices('move psychic', 'auto'); assert.false.fullHP(battle.p2.active[0]); }); - it(`should ignore the effect of positive evasion stat stages`, function () { + it(`should ignore the effect of positive evasion stat stages`, () => { battle = common.createBattle([[ - {species: 'Smeargle', moves: ['tackle', 'miracleeye']}, + { species: 'Smeargle', moves: ['tackle', 'miracleeye'] }, ], [ - {species: 'Forretress', moves: ['sleeptalk']}, + { species: 'Forretress', moves: ['sleeptalk'] }, ]]); - battle.onEvent('Accuracy', battle.format, function (accuracy, target, source, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, source, move) => { if (move.id === 'tackle') { assert.equal(accuracy, 100, `Miracle Eye should ignore positive evasion boosts`); } @@ -36,19 +36,19 @@ describe('Miracle Eye', function () { const forretress = battle.p2.active[0]; battle.makeChoices('move miracle eye', 'auto'); - battle.boost({evasion: 6}, forretress); + battle.boost({ evasion: 6 }, forretress); battle.makeChoices('move tackle', 'auto'); assert.false.fullHP(forretress); }); - it(`should not ignore the effect of negative evasion stat stages`, function () { + it(`should not ignore the effect of negative evasion stat stages`, () => { battle = common.createBattle([[ - {species: 'Smeargle', moves: ['zapcannon', 'miracleeye']}, + { species: 'Smeargle', moves: ['zapcannon', 'miracleeye'] }, ], [ - {species: 'Zapdos', moves: ['sleeptalk']}, + { species: 'Zapdos', moves: ['sleeptalk'] }, ]]); - battle.onEvent('Accuracy', battle.format, function (accuracy, target, source, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, source, move) => { if (move.id === 'zapcannon') { assert(accuracy >= 100, `Miracle Eye should not ignore negative evasion drops`); } @@ -56,7 +56,7 @@ describe('Miracle Eye', function () { const zapdos = battle.p2.active[0]; battle.makeChoices('move miracle eye', 'auto'); - battle.boost({evasion: -6}, battle.p2.active[0]); + battle.boost({ evasion: -6 }, battle.p2.active[0]); battle.makeChoices('move zap cannon', 'auto'); assert.false.fullHP(zapdos); }); diff --git a/test/sim/moves/mirrormove.js b/test/sim/moves/mirrormove.js index 06fd0398ec..5cff13faa4 100644 --- a/test/sim/moves/mirrormove.js +++ b/test/sim/moves/mirrormove.js @@ -5,39 +5,39 @@ const common = require('./../../common'); let battle; -describe('Mirror Move [Gen 1]', function () { - afterEach(function () { +describe('Mirror Move [Gen 1]', () => { + afterEach(() => { battle.destroy(); }); - it(`[Gen 1] Mirror Move'd Hyper Beam should force a recharge turn after not KOing a Pokemon`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'golem', moves: ['mirrormove', 'tackle']}, + it(`[Gen 1] Mirror Move'd Hyper Beam should force a recharge turn after not KOing a Pokemon`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'golem', moves: ['mirrormove', 'tackle'] }, ], [ - {species: 'aerodactyl', moves: ['hyperbeam']}, + { species: 'aerodactyl', moves: ['hyperbeam'] }, ]]); battle.makeChoices(); assert.cantMove(() => battle.choose('p1', 'move tackle')); }); - it(`[Gen 1] Mirror Move'd Hyper Beam should not force a recharge turn after KOing a Pokemon`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'fearow', moves: ['mirrormove', 'tackle']}, + it(`[Gen 1] Mirror Move'd Hyper Beam should not force a recharge turn after KOing a Pokemon`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'fearow', moves: ['mirrormove', 'tackle'] }, ], [ - {species: 'kadabra', moves: ['hyperbeam']}, - {species: 'exeggutor', moves: ['splash']}, + { species: 'kadabra', moves: ['hyperbeam'] }, + { species: 'exeggutor', moves: ['splash'] }, ]]); battle.makeChoices(); battle.choose('p2', 'switch exeggutor'); assert.false.cantMove(() => battle.choose('p1', 'move tackle')); }); - it(`[Gen 1] Mirror Move should fail when used by a Pokemon that has not seen the opponent use an attack`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'slowbro', moves: ['thunderwave']}, - {species: 'fearow', moves: ['mirrormove']}, + it(`[Gen 1] Mirror Move should fail when used by a Pokemon that has not seen the opponent use an attack`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'slowbro', moves: ['thunderwave'] }, + { species: 'fearow', moves: ['mirrormove'] }, ], [ - {species: 'chansey', moves: ['seismictoss']}, + { species: 'chansey', moves: ['seismictoss'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'auto'); @@ -47,11 +47,11 @@ describe('Mirror Move [Gen 1]', function () { assert.fullHP(battle.p2.active[0]); }); - it(`[Gen 1] Mirror Move should not copy the charging turn of a two-turn attack`, function () { + it(`[Gen 1] Mirror Move should not copy the charging turn of a two-turn attack`, () => { battle = common.gen(1).createBattle([[ - {species: 'fearow', moves: ['mirrormove']}, + { species: 'fearow', moves: ['mirrormove'] }, ], [ - {species: 'dugtrio', moves: ['dig']}, + { species: 'dugtrio', moves: ['dig'] }, ]]); const fearow = battle.p1.active[0]; battle.makeChoices(); @@ -60,21 +60,21 @@ describe('Mirror Move [Gen 1]', function () { assert(fearow.volatiles['twoturnmove']); }); - it(`[Gen 1] Mirror Move should not copy Metronome if Metronome calls a regular move`, function () { - battle = common.gen(1).createBattle({seed: [0, 0, 0, 1]}, [[ - {species: 'fearow', moves: ['mirrormove']}, + it(`[Gen 1] Mirror Move should not copy Metronome if Metronome calls a regular move`, () => { + battle = common.gen(1).createBattle({ seed: [0, 0, 0, 1] }, [[ + { species: 'fearow', moves: ['mirrormove'] }, ], [ - {species: 'alakazam', moves: ['metronome']}, + { species: 'alakazam', moves: ['metronome'] }, ]]); battle.makeChoices(); assert.false(battle.log.some(line => line.includes('|move|p1a: Fearow|Metronome|p1a: Fearow|[from]Mirror Move'))); }); - it(`[Gen 1] Mirror Move should copy Metronome if Metronome calls a two-turn move`, function () { - battle = common.gen(1).createBattle({seed: [0, 1, 0, 1]}, [[ - {species: 'fearow', moves: ['mirrormove']}, + it(`[Gen 1] Mirror Move should copy Metronome if Metronome calls a two-turn move`, () => { + battle = common.gen(1).createBattle({ seed: [0, 1, 0, 1] }, [[ + { species: 'fearow', moves: ['mirrormove'] }, ], [ - {species: 'alakazam', moves: ['metronome']}, + { species: 'alakazam', moves: ['metronome'] }, ]]); battle.makeChoices(); assert(battle.p2.active[0].volatiles['twoturnmove']); @@ -82,17 +82,17 @@ describe('Mirror Move [Gen 1]', function () { }); }); -describe('Mirror Move [Gen 2]', function () { - afterEach(function () { +describe('Mirror Move [Gen 2]', () => { + afterEach(() => { battle.destroy(); }); - it(`[Gen 2] Mirror Move should fail when used by a Pokemon that has not seen the opponent use an attack`, function () { - battle = common.gen(2).createBattle({forceRandomChance: true}, [[ - {species: 'slowbro', moves: ['glare']}, - {species: 'fearow', moves: ['mirrormove']}, + it(`[Gen 2] Mirror Move should fail when used by a Pokemon that has not seen the opponent use an attack`, () => { + battle = common.gen(2).createBattle({ forceRandomChance: true }, [[ + { species: 'slowbro', moves: ['glare'] }, + { species: 'fearow', moves: ['mirrormove'] }, ], [ - {species: 'chansey', moves: ['seismictoss']}, + { species: 'chansey', moves: ['seismictoss'] }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'auto'); diff --git a/test/sim/moves/mistyterrain.js b/test/sim/moves/mistyterrain.js index 2cf286ab11..faf99db69c 100644 --- a/test/sim/moves/mistyterrain.js +++ b/test/sim/moves/mistyterrain.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Misty Terrain', function () { - afterEach(function () { +describe('Misty Terrain', () => { + afterEach(() => { battle.destroy(); }); - it('should change the current terrain to Misty Terrain for five turns', function () { + it('should change the current terrain to Misty Terrain for five turns', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mist', 'mistyterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mist']}]}); + battle.setPlayer('p1', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mist', 'mistyterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mist'] }] }); battle.makeChoices('move mistyterrain', 'move mist'); assert(battle.field.isTerrain('mistyterrain')); battle.makeChoices('move mist', 'move mist'); @@ -26,10 +26,10 @@ describe('Misty Terrain', function () { assert(battle.field.isTerrain('')); }); - it('should halve the base power of Dragon-type attacks on grounded Pokemon', function () { + it('should halve the base power of Dragon-type attacks on grounded Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Shaymin", ability: 'naturalcure', moves: ['mistyterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Shaymin-Sky", ability: 'serenegrace', moves: ['leechseed']}]}); + battle.setPlayer('p1', { team: [{ species: "Shaymin", ability: 'naturalcure', moves: ['mistyterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Shaymin-Sky", ability: 'serenegrace', moves: ['leechseed'] }] }); battle.makeChoices('move mistyterrain', 'move leechseed'); let basePower; const move = Dex.moves.get('dragonpulse'); @@ -39,28 +39,28 @@ describe('Misty Terrain', function () { assert.equal(basePower, move.basePower); }); - it('should prevent moves from setting non-volatile status on grounded Pokemon', function () { + it('should prevent moves from setting non-volatile status on grounded Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mistyterrain', 'toxic']}]}); - battle.setPlayer('p2', {team: [{species: "Machamp", ability: 'noguard', item: 'airballoon', moves: ['bulkup', 'toxic']}]}); + battle.setPlayer('p1', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mistyterrain', 'toxic'] }] }); + battle.setPlayer('p2', { team: [{ species: "Machamp", ability: 'noguard', item: 'airballoon', moves: ['bulkup', 'toxic'] }] }); battle.makeChoices('move mistyterrain', 'move bulkup'); battle.makeChoices('move toxic', 'move toxic'); assert.equal(battle.p1.active[0].status, ''); assert.equal(battle.p2.active[0].status, 'tox'); }); - it('should not remove active non-volatile statuses from grounded Pokemon', function () { + it('should not remove active non-volatile statuses from grounded Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mistyterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Crobat", ability: 'infiltrator', moves: ['toxic']}]}); + battle.setPlayer('p1', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mistyterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Crobat", ability: 'infiltrator', moves: ['toxic'] }] }); battle.makeChoices('move mistyterrain', 'move toxic'); assert.equal(battle.p1.active[0].status, 'tox'); }); - it('should prevent Yawn from putting grounded Pokemon to sleep, but not cause Yawn to fail', function () { + it('should prevent Yawn from putting grounded Pokemon to sleep, but not cause Yawn to fail', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mistyterrain', 'yawn']}]}); - battle.setPlayer('p2', {team: [{species: "Sableye", ability: 'prankster', moves: ['yawn']}]}); + battle.setPlayer('p1', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mistyterrain', 'yawn'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sableye", ability: 'prankster', moves: ['yawn'] }] }); battle.makeChoices('move mistyterrain', 'move yawn'); battle.makeChoices('move yawn', 'move yawn'); assert.equal(battle.p1.active[0].status, ''); @@ -69,30 +69,30 @@ describe('Misty Terrain', function () { assert(toID(dataLine[3]).endsWith('yawn')); }); - it('should cause Rest to fail on grounded Pokemon', function () { + it('should cause Rest to fail on grounded Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Florges", ability: 'symbiosis', moves: ['mistyterrain', 'rest']}]}); - battle.setPlayer('p2', {team: [{species: "Pidgeot", ability: 'keeneye', moves: ['doubleedge', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Florges", ability: 'symbiosis', moves: ['mistyterrain', 'rest'] }] }); + battle.setPlayer('p2', { team: [{ species: "Pidgeot", ability: 'keeneye', moves: ['doubleedge', 'rest'] }] }); battle.makeChoices('move mistyterrain', 'move doubleedge'); battle.makeChoices('move rest', 'move rest'); assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); assert.equal(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should not affect Pokemon in a semi-invulnerable state', function () { + it('should not affect Pokemon in a semi-invulnerable state', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", ability: 'owntempo', moves: ['yawn', 'skydrop']}]}); - battle.setPlayer('p2', {team: [{species: "Sableye", ability: 'prankster', moves: ['yawn', 'mistyterrain']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", ability: 'owntempo', moves: ['yawn', 'skydrop'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sableye", ability: 'prankster', moves: ['yawn', 'mistyterrain'] }] }); battle.makeChoices('move yawn', 'move yawn'); battle.makeChoices('move skydrop', 'move mistyterrain'); assert.equal(battle.p1.active[0].status, 'slp'); assert.equal(battle.p2.active[0].status, 'slp'); }); - it('should cause Nature Power to become Moonblast', function () { + it('should cause Nature Power to become Moonblast', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Whimsicott", ability: 'prankster', moves: ['mistyterrain']}]}); - battle.setPlayer('p2', {team: [{species: "Shuckle", ability: 'sturdy', moves: ['naturepower']}]}); + battle.setPlayer('p1', { team: [{ species: "Whimsicott", ability: 'prankster', moves: ['mistyterrain'] }] }); + battle.setPlayer('p2', { team: [{ species: "Shuckle", ability: 'sturdy', moves: ['naturepower'] }] }); battle.makeChoices('move mistyterrain', 'move naturepower'); const resultMove = toID(battle.log[battle.lastMoveLine].split('|')[3]); assert.equal(resultMove, 'moonblast'); diff --git a/test/sim/moves/nightmare.js b/test/sim/moves/nightmare.js index e541f30d14..bc80911dd8 100644 --- a/test/sim/moves/nightmare.js +++ b/test/sim/moves/nightmare.js @@ -5,34 +5,34 @@ const common = require('./../../common'); let battle; -describe('Nightmare [Gen 2]', function () { - afterEach(function () { +describe('Nightmare [Gen 2]', () => { + afterEach(() => { battle.destroy(); }); - it('should not deal damage to the affected if the opponent is KOed', function () { + it('should not deal damage to the affected if the opponent is KOed', () => { battle = common.gen(2).createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Slugma", moves: ['sleeptalk']}, - {species: "Magcargo", moves: ['sleeptalk', 'flamethrower']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Forretress", moves: ['spore', 'nightmare']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Slugma", moves: ['sleeptalk'] }, + { species: "Magcargo", moves: ['sleeptalk', 'flamethrower'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Forretress", moves: ['spore', 'nightmare'] }, + ] }); battle.makeChoices('switch 2', 'move spore'); battle.makeChoices('move sleeptalk', 'move nightmare'); assert(battle.p1.active[0].volatiles['nightmare']); assert.fullHP(battle.p1.active[0]); }); - it('should continue dealing damage to the affected if it falls asleep while asleep', function () { + it('should continue dealing damage to the affected if it falls asleep while asleep', () => { battle = common.gen(2).createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Magcargo", moves: ['sleeptalk', 'rest']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Forretress", moves: ['nightmare', 'pound']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Magcargo", moves: ['sleeptalk', 'rest'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Forretress", moves: ['nightmare', 'pound'] }, + ] }); battle.makeChoices('move rest', 'move pound'); battle.makeChoices('move rest', 'move nightmare'); battle.makeChoices('move sleeptalk', 'move pound'); diff --git a/test/sim/moves/noretreat.js b/test/sim/moves/noretreat.js index 48f24bd92d..bfabaf6ab9 100644 --- a/test/sim/moves/noretreat.js +++ b/test/sim/moves/noretreat.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('No Retreat', function () { - afterEach(function () { +describe('No Retreat', () => { + afterEach(() => { battle.destroy(); }); - it(`should not allow usage multiple times in a row normally`, function () { + it(`should not allow usage multiple times in a row normally`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['noretreat']}, + { species: "Wynaut", moves: ['noretreat'] }, ], [ - {species: "Caterpie", moves: ['sleeptalk']}, + { species: "Caterpie", moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -24,11 +24,11 @@ describe('No Retreat', function () { assert.statStage(wynaut, 'atk', 1); }); - it(`should allow usage multiple times in a row normally if it has the trapped volatile`, function () { + it(`should allow usage multiple times in a row normally if it has the trapped volatile`, () => { battle = common.createBattle([[ - {species: "Wynaut", moves: ['noretreat']}, + { species: "Wynaut", moves: ['noretreat'] }, ], [ - {species: "Caterpie", moves: ['block']}, + { species: "Caterpie", moves: ['block'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/orderup.js b/test/sim/moves/orderup.js index 459a0d7b50..2a88085fd3 100644 --- a/test/sim/moves/orderup.js +++ b/test/sim/moves/orderup.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Order Up', function () { - afterEach(function () { +describe('Order Up', () => { + afterEach(() => { battle.destroy(); }); - it.skip(`should boost Dondozo's stat even if Sheer Force-boosted`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['sleeptalk']}, - {species: 'mew', ability: 'shellarmor', moves: ['sleeptalk']}, + it.skip(`should boost Dondozo's stat even if Sheer Force-boosted`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['sleeptalk'] }, + { species: 'mew', ability: 'shellarmor', moves: ['sleeptalk'] }, ], [ - {species: 'tatsugiristretchy', ability: 'commander', moves: ['sleeptalk']}, - {species: 'dondozo', ability: 'sheerforce', moves: ['orderup']}, + { species: 'tatsugiristretchy', ability: 'commander', moves: ['sleeptalk'] }, + { species: 'dondozo', ability: 'sheerforce', moves: ['orderup'] }, ]]); battle.makeChoices('auto', 'move orderup 2'); const mew = battle.p1.active[1]; diff --git a/test/sim/moves/painsplit.js b/test/sim/moves/painsplit.js index 0029862854..21d9c86247 100644 --- a/test/sim/moves/painsplit.js +++ b/test/sim/moves/painsplit.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('Pain Split', function () { - afterEach(function () { +describe('Pain Split', () => { + afterEach(() => { battle.destroy(); }); - it('should reduce the HP of the target to the average of the user and target', function () { + it('should reduce the HP of the target to the average of the user and target', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shedinja', ability: 'wonderguard', moves: ['painsplit']}]}); - battle.setPlayer('p2', {team: [{species: 'Arceus', ability: 'multitype', moves: ['judgment']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shedinja', ability: 'wonderguard', moves: ['painsplit'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Arceus', ability: 'multitype', moves: ['judgment'] }] }); battle.makeChoices('move painsplit', 'move judgment'); assert.equal(battle.p2.active[0].hp, (battle.p2.active[0].maxhp + 1) / 2); }); - it('should calculate HP changes against a dynamaxed target properly', function () { + it('should calculate HP changes against a dynamaxed target properly', () => { battle = common.gen(8).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Drifblim', ability: 'unburden', moves: ['painsplit']}]}); - battle.setPlayer('p2', {team: [{species: 'Blissey', ability: 'serenegrace', moves: ['doubleedge']}]}); + battle.setPlayer('p1', { team: [{ species: 'Drifblim', ability: 'unburden', moves: ['painsplit'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Blissey', ability: 'serenegrace', moves: ['doubleedge'] }] }); battle.makeChoices('move painsplit', 'move doubleedge dynamax'); diff --git a/test/sim/moves/partingshot.js b/test/sim/moves/partingshot.js index e1aa2e4d53..c5ab291ffb 100644 --- a/test/sim/moves/partingshot.js +++ b/test/sim/moves/partingshot.js @@ -5,22 +5,22 @@ const common = require('./../../common'); let battle; -describe(`Parting Shot`, function () { - afterEach(function () { +describe(`Parting Shot`, () => { + afterEach(() => { battle.destroy(); }); - it(`should not switch the user out if the target's stats are not changed`, function () { + it(`should not switch the user out if the target's stats are not changed`, () => { battle = common.createBattle([[ - {species: 'Silvally', ability: 'prankster', moves: ['partingshot', 'splash']}, - {species: 'Type: Null', ability: 'battlearmor', moves: ['return']}, + { species: 'Silvally', ability: 'prankster', moves: ['partingshot', 'splash'] }, + { species: 'Type: Null', ability: 'battlearmor', moves: ['return'] }, ], [ - {species: 'Registeel', ability: 'clearbody', moves: ['splash']}, - {species: 'Solgaleo', ability: 'fullmetalbody', moves: ['splash']}, - {species: 'Torkoal', ability: 'whitesmoke', moves: ['splash']}, - {species: 'Shaymin', ability: 'flowerveil', moves: ['splash']}, - {species: 'Kingler', ability: 'hypercutter', moves: ['splash']}, - {species: 'Spinda', ability: 'contrary', moves: ['splash', 'partingshot']}, + { species: 'Registeel', ability: 'clearbody', moves: ['splash'] }, + { species: 'Solgaleo', ability: 'fullmetalbody', moves: ['splash'] }, + { species: 'Torkoal', ability: 'whitesmoke', moves: ['splash'] }, + { species: 'Shaymin', ability: 'flowerveil', moves: ['splash'] }, + { species: 'Kingler', ability: 'hypercutter', moves: ['splash'] }, + { species: 'Spinda', ability: 'contrary', moves: ['splash', 'partingshot'] }, ]]); battle.makeChoices('move partingshot', 'move splash'); assert.equal(battle.requestState, 'move'); @@ -31,24 +31,24 @@ describe(`Parting Shot`, function () { battle.makeChoices('move partingshot', 'switch 4'); // Shaymin assert.equal(battle.requestState, 'move'); battle.makeChoices('move splash', 'switch 5'); // Kingler - battle.p2.active[0].boostBy({spa: -6}); // hack Kingler's Sp. Atk to -6; Hyper Cutter & -6 Sp. Atk + battle.p2.active[0].boostBy({ spa: -6 }); // hack Kingler's Sp. Atk to -6; Hyper Cutter & -6 Sp. Atk battle.makeChoices('move partingshot', 'move splash'); assert.equal(battle.requestState, 'move'); battle.makeChoices('move splash', 'switch 6'); // Spinda - battle.p2.active[0].boostBy({atk: 6, spa: 6}); // hack Contrary Spinda to +6 Atk / +6 Sp. Atk + battle.p2.active[0].boostBy({ atk: 6, spa: 6 }); // hack Contrary Spinda to +6 Atk / +6 Sp. Atk battle.makeChoices('move partingshot', 'move splash'); assert.equal(battle.requestState, 'move'); - battle.p1.active[0].boostBy({atk: -6, spa: -6}); + battle.p1.active[0].boostBy({ atk: -6, spa: -6 }); battle.makeChoices('move splash', 'move partingshot'); // Spinda's Parting Shot against Silvally this time assert.equal(battle.requestState, 'move'); }); - it(`should set the Z-Parting Shot healing flag even if the Parting Shot itself was not successful`, function () { + it(`should set the Z-Parting Shot healing flag even if the Parting Shot itself was not successful`, () => { battle = common.createBattle([[ - {species: 'landorus', ability: 'noguard', moves: ['sleeptalk']}, - {species: 'persian-alola', ability: 'noguard', item: 'darkiniumz', moves: ['partingshot']}, + { species: 'landorus', ability: 'noguard', moves: ['sleeptalk'] }, + { species: 'persian-alola', ability: 'noguard', item: 'darkiniumz', moves: ['partingshot'] }, ], [ - {species: 'wynaut', ability: 'clearbody', moves: ['circlethrow']}, + { species: 'wynaut', ability: 'clearbody', moves: ['circlethrow'] }, ]]); battle.makeChoices(); battle.makeChoices('move partingshot zmove', 'auto'); diff --git a/test/sim/moves/perishsong.js b/test/sim/moves/perishsong.js index 80d9f8b0dd..b388f5c2f8 100644 --- a/test/sim/moves/perishsong.js +++ b/test/sim/moves/perishsong.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Perish Song', function () { - afterEach(function () { +describe('Perish Song', () => { + afterEach(() => { battle.destroy(); }); - it(`should KO all Pokemon that heard it in 3 turns`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Primarina", moves: ['perishsong', 'moonblast']}, - {species: "Magikarp", moves: ['splash']}, + it(`should KO all Pokemon that heard it in 3 turns`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Primarina", moves: ['perishsong', 'moonblast'] }, + { species: "Magikarp", moves: ['splash'] }, ], [ - {species: "Magikarp", moves: ['splash']}, - {species: "Magikarp", moves: ['splash']}, + { species: "Magikarp", moves: ['splash'] }, + { species: "Magikarp", moves: ['splash'] }, ]]); battle.makeChoices('move perishsong, move splash', 'auto'); // We've had a crash related to fainted Pokemon and Perish Song @@ -28,22 +28,22 @@ describe('Perish Song', function () { } }); - it(`should cause Pokemon to faint by order of Speed`, function () { + it(`should cause Pokemon to faint by order of Speed`, () => { battle = common.createBattle([[ - {species: 'Weavile', moves: ['perishsong']}, + { species: 'Weavile', moves: ['perishsong'] }, ], [ - {species: 'Slowpoke', moves: ['sleeptalk']}, + { species: 'Slowpoke', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 4; i++) { battle.makeChoices(); } assert.equal(battle.winner, 'Player 2'); }); - it(`should not affect other Pokemon with the ability Soundproof`, function () { + it(`should not affect other Pokemon with the ability Soundproof`, () => { battle = common.createBattle([[ - {species: 'Weavile', ability: 'soundproof', moves: ['perishsong']}, + { species: 'Weavile', ability: 'soundproof', moves: ['perishsong'] }, ], [ - {species: 'Slowpoke', ability: 'soundproof', moves: ['sleeptalk']}, + { species: 'Slowpoke', ability: 'soundproof', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -51,11 +51,11 @@ describe('Perish Song', function () { assert.false(battle.p2.active[0].volatiles['perishsong'], 'Slowpoke should not have been affected by Perish Song'); }); - it(`should not affect any Pokemon with the ability Soundproof in Gen 7`, function () { + it(`should not affect any Pokemon with the ability Soundproof in Gen 7`, () => { battle = common.gen(7).createBattle([[ - {species: 'Weavile', ability: 'soundproof', moves: ['perishsong']}, + { species: 'Weavile', ability: 'soundproof', moves: ['perishsong'] }, ], [ - {species: 'Slowpoke', ability: 'soundproof', moves: ['sleeptalk']}, + { species: 'Slowpoke', ability: 'soundproof', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/photongeyser.js b/test/sim/moves/photongeyser.js index dc03f43cc0..810218fc9f 100644 --- a/test/sim/moves/photongeyser.js +++ b/test/sim/moves/photongeyser.js @@ -5,14 +5,14 @@ const common = require('./../../common'); let battle; -describe(`Photon Geyser`, function () { +describe(`Photon Geyser`, () => { afterEach(() => battle.destroy()); - it(`should become physical when Attack stat is higher than Special Attack stat`, function () { + it(`should become physical when Attack stat is higher than Special Attack stat`, () => { battle = common.createBattle([[ - {species: 'Necrozma-Dusk-Mane', moves: ['photongeyser']}, + { species: 'Necrozma-Dusk-Mane', moves: ['photongeyser'] }, ], [ - {species: 'Mew', item: 'keeberry', moves: ['counter']}, + { species: 'Mew', item: 'keeberry', moves: ['counter'] }, ]]); battle.makeChoices(); @@ -20,59 +20,59 @@ describe(`Photon Geyser`, function () { assert.false.fullHP(battle.p1.active[0], `physical Photon Geyser should be susceptible to Counter`); }); - it(`should determine which attack stat is higher after factoring in stat stages, but no other kind of modifier`, function () { + it(`should determine which attack stat is higher after factoring in stat stages, but no other kind of modifier`, () => { battle = common.createBattle([[ - {species: 'Latias', ability: 'hugepower', item: 'choiceband', moves: ['photongeyser']}, + { species: 'Latias', ability: 'hugepower', item: 'choiceband', moves: ['photongeyser'] }, ], [ - {species: 'Scizor-Mega', item: 'keeberry', moves: ['strugglebug', 'sleeptalk']}, + { species: 'Scizor-Mega', item: 'keeberry', moves: ['strugglebug', 'sleeptalk'] }, ]]); const scizor = battle.p2.active[0]; - battle.makeChoices(); //should be special this turn (196 vs. 256) + battle.makeChoices(); // should be special this turn (196 vs. 256) assert.statStage(scizor, 'def', 0, `incorrectly swayed by Choice Band and/or Huge Power`); - battle.makeChoices(); //should be special this turn (196 vs. 256) + battle.makeChoices(); // should be special this turn (196 vs. 256) assert.statStage(scizor, 'def', 1, `the stat drop should have turned Photon Geyser into a special move`); }); - it(`should always be a special Max Move, never physical`, function () { + it(`should always be a special Max Move, never physical`, () => { battle = common.gen(8).createBattle([[ - {species: 'conkeldurr', moves: ['photongeyser']}, + { species: 'conkeldurr', moves: ['photongeyser'] }, ], [ - {species: 'cresselia', item: 'marangaberry', moves: ['sleeptalk']}, + { species: 'cresselia', item: 'marangaberry', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move photongeyser dynamax', 'auto'); assert.statStage(battle.p2.active[0], 'spd', 1, `Photon Geyser behaved as a physical Max move, when it shouldn't`); }); - it(`should always be a special Z-move, never physical`, function () { + it(`should always be a special Z-move, never physical`, () => { battle = common.gen(7).createBattle([[ - {species: 'conkeldurr', item: 'psychiumz', moves: ['photongeyser']}, + { species: 'conkeldurr', item: 'psychiumz', moves: ['photongeyser'] }, ], [ - {species: 'cresselia', item: 'marangaberry', moves: ['sleeptalk']}, + { species: 'cresselia', item: 'marangaberry', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move photongeyser zmove', 'auto'); assert.statStage(battle.p2.active[0], 'spd', 1, `Photon Geyser behaved as a physical Z-move, when it shouldn't`); }); - it(`should ignore abilities the same way as Mold Breaker`, function () { + it(`should ignore abilities the same way as Mold Breaker`, () => { battle = common.createBattle([[ - {species: 'Necrozma', moves: ['photongeyser']}, + { species: 'Necrozma', moves: ['photongeyser'] }, ], [ - {species: 'Zeraora', ability: 'voltabsorb', moves: ['electrify']}, + { species: 'Zeraora', ability: 'voltabsorb', moves: ['electrify'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0], `Electrified Photon Geyser should damage through Volt Absorb`); }); - it(`should not ignore abilities when called as a submove of another move`, function () { + it(`should not ignore abilities when called as a submove of another move`, () => { battle = common.createBattle([[ - {species: 'Liepard', ability: 'prankster', moves: ['assist', 'copycat', 'sleeptalk', 'photongeyser']}, - {species: 'Necrozma', moves: ['photongeyser']}, + { species: 'Liepard', ability: 'prankster', moves: ['assist', 'copycat', 'sleeptalk', 'photongeyser'] }, + { species: 'Necrozma', moves: ['photongeyser'] }, ], [ - {species: 'Bruxish', ability: 'dazzling', moves: ['photongeyser', 'spore']}, + { species: 'Bruxish', ability: 'dazzling', moves: ['photongeyser', 'spore'] }, ]]); const bruxish = battle.p2.active[0]; @@ -86,11 +86,11 @@ describe(`Photon Geyser`, function () { assert.fullHP(bruxish, `incorrectly ignores abilities through Sleep Talk`); }); - it(`should ignore abilities when called as a submove by a Pokemon that also has Mold Breaker`, function () { + it(`should ignore abilities when called as a submove by a Pokemon that also has Mold Breaker`, () => { battle = common.createBattle([[ - {species: 'Shuckle', ability: 'moldbreaker', moves: ['sleeptalk', 'photongeyser']}, + { species: 'Shuckle', ability: 'moldbreaker', moves: ['sleeptalk', 'photongeyser'] }, ], [ - {species: 'Shedinja', ability: 'disguise', moves: ['spore']}, + { species: 'Shedinja', ability: 'disguise', moves: ['spore'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/pledge.js b/test/sim/moves/pledge.js index fde3b40f99..2fae5a20b9 100644 --- a/test/sim/moves/pledge.js +++ b/test/sim/moves/pledge.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('Pledge moves', function () { - afterEach(function () { +describe('Pledge moves', () => { + afterEach(() => { battle.destroy(); }); - it(`should work`, function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Ninjask', ability: 'noability', moves: ['waterpledge']}, - {species: 'Incineroar', ability: 'noability', moves: ['grasspledge']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Garchomp', ability: 'noability', moves: ['waterpledge']}, - {species: 'Mew', ability: 'noability', moves: ['firepledge']}, - ]}); + it(`should work`, () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Ninjask', ability: 'noability', moves: ['waterpledge'] }, + { species: 'Incineroar', ability: 'noability', moves: ['grasspledge'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Garchomp', ability: 'noability', moves: ['waterpledge'] }, + { species: 'Mew', ability: 'noability', moves: ['firepledge'] }, + ] }); battle.makeChoices('move 1 1, move 1 1', 'move 1 1, move 1 2'); // Incineroar should start Grass Pledge first, then faint to Water Pledge diff --git a/test/sim/moves/pollenpuff.js b/test/sim/moves/pollenpuff.js index 3640b5e9df..46f309e933 100644 --- a/test/sim/moves/pollenpuff.js +++ b/test/sim/moves/pollenpuff.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Pollen Puff', function () { - afterEach(function () { +describe('Pollen Puff', () => { + afterEach(() => { battle.destroy(); }); - it(`should heal allies through Substitute, but not damage opponents through Substitute`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Wynaut", level: 1, moves: ['pollenpuff']}, - {species: "Garchomp", ability: 'compoundeyes', moves: ['superfang']}, + it(`should heal allies through Substitute, but not damage opponents through Substitute`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Wynaut", level: 1, moves: ['pollenpuff'] }, + { species: "Garchomp", ability: 'compoundeyes', moves: ['superfang'] }, ], [ - {species: "Wobbuffet", moves: ['pollenpuff']}, - {species: "Lucario", moves: ['substitute']}, + { species: "Wobbuffet", moves: ['pollenpuff'] }, + { species: "Lucario", moves: ['substitute'] }, ]]); battle.makeChoices('move pollenpuff 2, move superfang 2', 'move pollenpuff -2, move substitute'); @@ -26,27 +26,27 @@ describe('Pollen Puff', function () { assert.equal(lucario.hp, lucario.maxhp - Math.floor(lucario.maxhp / 4)); }); - it(`should not heal a Pokemon if they have natural type immunity to Pollen Puff`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Wynaut", ability: 'normalize', moves: ['pollenpuff']}, - {species: "Froslass", moves: ['bellydrum']}, + it(`should not heal a Pokemon if they have natural type immunity to Pollen Puff`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Wynaut", ability: 'normalize', moves: ['pollenpuff'] }, + { species: "Froslass", moves: ['bellydrum'] }, ], [ - {species: "Wobbuffet", moves: ['sleeptalk']}, - {species: "Lucario", moves: ['sleeptalk']}, + { species: "Wobbuffet", moves: ['sleeptalk'] }, + { species: "Lucario", moves: ['sleeptalk'] }, ]]); battle.makeChoices('move pollenpuff -2, move bellydrum', 'auto'); assert.false.fullHP(battle.p1.active[1]); }); - describe(`interaction of Heal Block and Pollen Puff`, function () { - it(`should prevent the user from targeting an ally with Pollen Puff while the user is affected by Heal Block`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'bunnelby', moves: ['sleeptalk', 'pollenpuff']}, - {species: 'roggenrola', ability: 'magicbounce', moves: ['sleeptalk']}, + describe(`interaction of Heal Block and Pollen Puff`, () => { + it(`should prevent the user from targeting an ally with Pollen Puff while the user is affected by Heal Block`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'bunnelby', moves: ['sleeptalk', 'pollenpuff'] }, + { species: 'roggenrola', ability: 'magicbounce', moves: ['sleeptalk'] }, ], [ - {species: 'scolipede', moves: ['healblock']}, - {species: 'lucario', moves: ['sleeptalk']}, + { species: 'scolipede', moves: ['healblock'] }, + { species: 'lucario', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -54,26 +54,26 @@ describe('Pollen Puff', function () { assert.false.cantMove(() => battle.choose('p1', 'move pollenpuff 1, move sleeptalk')); }); - it(`should not prevent the user from targeting an ally with Z-Pollen Puff while the user is affected by Heal Block`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'bunnelby', item: 'buginiumz', moves: ['sleeptalk', 'pollenpuff']}, - {species: 'roggenrola', ability: 'magicbounce', moves: ['sleeptalk']}, + it(`should not prevent the user from targeting an ally with Z-Pollen Puff while the user is affected by Heal Block`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'bunnelby', item: 'buginiumz', moves: ['sleeptalk', 'pollenpuff'] }, + { species: 'roggenrola', ability: 'magicbounce', moves: ['sleeptalk'] }, ], [ - {species: 'scolipede', moves: ['healblock']}, - {species: 'lucario', moves: ['sleeptalk']}, + { species: 'scolipede', moves: ['healblock'] }, + { species: 'lucario', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.cantMove(() => battle.choose('p1', 'move pollenpuff zmove -2, move sleeptalk')); }); - it(`should not prevent the user from targeting an ally with Pollen Puff while the target is affected by Heal Block at move selection, but it should fail at move execution`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', ability: 'magicbounce', moves: ['sleeptalk', 'pollenpuff']}, - {species: 'roggenrola', moves: ['sleeptalk']}, + it(`should not prevent the user from targeting an ally with Pollen Puff while the target is affected by Heal Block at move selection, but it should fail at move execution`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', ability: 'magicbounce', moves: ['sleeptalk', 'pollenpuff'] }, + { species: 'roggenrola', moves: ['sleeptalk'] }, ], [ - {species: 'wobbuffet', moves: ['healblock']}, - {species: 'lucario', moves: ['falseswipe']}, + { species: 'wobbuffet', moves: ['healblock'] }, + { species: 'lucario', moves: ['falseswipe'] }, ]]); battle.makeChoices(); @@ -81,26 +81,26 @@ describe('Pollen Puff', function () { assert.false.fullHP(battle.p1.active[1], `Roggenrola should not have healed from Pollen Puff`); }); - it(`should prevent the user from successfully using Pollen Puff into an ally if the user becomes affected by Heal Block mid-turn`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['pollenpuff']}, - {species: 'roggenrola', ability: 'magicbounce', moves: ['sleeptalk']}, + it(`should prevent the user from successfully using Pollen Puff into an ally if the user becomes affected by Heal Block mid-turn`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['pollenpuff'] }, + { species: 'roggenrola', ability: 'magicbounce', moves: ['sleeptalk'] }, ], [ - {species: 'wobbuffet', moves: ['healblock']}, - {species: 'lucario', moves: ['falseswipe']}, + { species: 'wobbuffet', moves: ['healblock'] }, + { species: 'lucario', moves: ['falseswipe'] }, ]]); battle.makeChoices('move pollenpuff -2, move sleeptalk', 'move healblock, move falseswipe 2'); assert.false.fullHP(battle.p1.active[1], `Roggenrola should not have healed from Pollen Puff`); }); - it(`should not prevent the user from using Z-Pollen Puff into an ally`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', item: 'buginiumz', moves: ['pollenpuff']}, - {species: 'roggenrola', moves: ['sleeptalk']}, + it(`should not prevent the user from using Z-Pollen Puff into an ally`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', item: 'buginiumz', moves: ['pollenpuff'] }, + { species: 'roggenrola', moves: ['sleeptalk'] }, ], [ - {species: 'wobbuffet', moves: ['healblock']}, - {species: 'lucario', moves: ['sleeptalk']}, + { species: 'wobbuffet', moves: ['healblock'] }, + { species: 'lucario', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move pollenpuff zmove -2, move sleeptalk', 'auto'); diff --git a/test/sim/moves/psyblade.js b/test/sim/moves/psyblade.js index 881843861f..d4307d1059 100644 --- a/test/sim/moves/psyblade.js +++ b/test/sim/moves/psyblade.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe('Psyblade', function () { - afterEach(function () { +describe('Psyblade', () => { + afterEach(() => { battle.destroy(); }); - it(`should have its base power multiplied by 1.5 in Electric Terrain`, function () { + it(`should have its base power multiplied by 1.5 in Electric Terrain`, () => { battle = common.createBattle([[ - {species: 'Gallade', ability: 'steadfast', moves: ['psyblade']}, + { species: 'Gallade', ability: 'steadfast', moves: ['psyblade'] }, ], [ - {species: 'Miraidon', ability: 'hadronengine', moves: ['luckychant']}, + { species: 'Miraidon', ability: 'hadronengine', moves: ['luckychant'] }, ]]); const miraidon = battle.p2.active[0]; battle.makeChoices(); assert.bounded(miraidon.maxhp - miraidon.hp, [157, 186]); }); - it(`should have its base power multiplied by 1.5 in Electric Terrain even if the user or the target isn't grounded`, function () { + it(`should have its base power multiplied by 1.5 in Electric Terrain even if the user or the target isn't grounded`, () => { battle = common.createBattle([[ - {species: 'Gallade', ability: 'steadfast', item: 'airballoon', moves: ['psyblade']}, + { species: 'Gallade', ability: 'steadfast', item: 'airballoon', moves: ['psyblade'] }, ], [ - {species: 'Miraidon', ability: 'hadronengine', item: 'airballoon', moves: ['luckychant']}, + { species: 'Miraidon', ability: 'hadronengine', item: 'airballoon', moves: ['luckychant'] }, ]]); const miraidon = battle.p2.active[0]; battle.makeChoices(); diff --git a/test/sim/moves/psychicnoise.js b/test/sim/moves/psychicnoise.js index ece6cdf204..a6db7b228e 100644 --- a/test/sim/moves/psychicnoise.js +++ b/test/sim/moves/psychicnoise.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Psychic Noise', function () { - afterEach(function () { +describe('Psychic Noise', () => { + afterEach(() => { battle.destroy(); }); - it(`should prevent the target from healing, like Heal Block`, function () { + it(`should prevent the target from healing, like Heal Block`, () => { battle = common.createBattle([[ - {species: 'Wynaut', ability: 'battlearmor', moves: ['softboiled', 'sleeptalk']}, + { species: 'Wynaut', ability: 'battlearmor', moves: ['softboiled', 'sleeptalk'] }, ], [ - {species: 'Regieleki', moves: ['psychicnoise']}, + { species: 'Regieleki', moves: ['psychicnoise'] }, ]]); const wynaut = battle.p1.active[0]; battle.makeChoices(); @@ -22,13 +22,13 @@ describe('Psychic Noise', function () { assert.cantMove(() => battle.choose('p1', 'move softboiled')); }); - it.skip(`should prevent the target's ally from healing it with Life Dew`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', ability: 'battlearmor', moves: ['sleeptalk']}, - {species: 'Blissey', ability: 'battlearmor', moves: ['lifedew']}, + it.skip(`should prevent the target's ally from healing it with Life Dew`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', ability: 'battlearmor', moves: ['sleeptalk'] }, + { species: 'Blissey', ability: 'battlearmor', moves: ['lifedew'] }, ], [ - {species: 'Regieleki', moves: ['psychicnoise']}, - {species: 'Mew', moves: ['watergun']}, + { species: 'Regieleki', moves: ['psychicnoise'] }, + { species: 'Mew', moves: ['watergun'] }, ]]); const wynaut = battle.p1.active[0]; const blissey = battle.p1.active[1]; diff --git a/test/sim/moves/psychup.js b/test/sim/moves/psychup.js index a31f387e3e..6bef62d1bb 100644 --- a/test/sim/moves/psychup.js +++ b/test/sim/moves/psychup.js @@ -5,21 +5,21 @@ const common = require('./../../common'); let battle; -describe('Psych Up', function () { - afterEach(function () { +describe('Psych Up', () => { + afterEach(() => { battle.destroy(); }); - it('should copy the opponent\'s crit ratio', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Palkia', level: 100, moves: ['sleeptalk', 'focusenergy', 'psychup', 'laserfocus']}, - {species: 'Smeargle', level: 1, moves: ['laserfocus', 'sleeptalk', 'focusenergy']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - ]}); + it('should copy the opponent\'s crit ratio', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Palkia', level: 100, moves: ['sleeptalk', 'focusenergy', 'psychup', 'laserfocus'] }, + { species: 'Smeargle', level: 1, moves: ['laserfocus', 'sleeptalk', 'focusenergy'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + ] }); const palkia = battle.p1.active[0]; battle.makeChoices('move focusenergy, move sleeptalk', 'move sleeptalk, move sleeptalk'); @@ -39,16 +39,16 @@ describe('Psych Up', function () { assert(palkia.volatiles['laserfocus'], "A pokemon should gain a Laser Focus boost if the target of Psych Up has a Laser Focus boost."); }); - it('should copy both positive and negative stat changes', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Palkia', level: 100, moves: ['sleeptalk', 'psychup']}, - {species: 'Smeargle', level: 1, moves: ['sleeptalk', 'swordsdance', 'featherdance']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - ]}); + it('should copy both positive and negative stat changes', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Palkia', level: 100, moves: ['sleeptalk', 'psychup'] }, + { species: 'Smeargle', level: 1, moves: ['sleeptalk', 'swordsdance', 'featherdance'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + ] }); const palkia = battle.p1.active[0]; battle.makeChoices('move sleeptalk, move swordsdance', 'move sleeptalk, move sleeptalk'); @@ -61,21 +61,21 @@ describe('Psych Up', function () { }); }); -describe('Psych Up [Gen 5]', function () { - afterEach(function () { +describe('Psych Up [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not copy the opponent\'s crit ratio', function () { - battle = common.gen(5).createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: 'Palkia', level: 100, moves: ['sleeptalk', 'focusenergy', 'psychup']}, - {species: 'Smeargle', level: 1, moves: ['sleeptalk', 'focusenergy']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - {species: 'Suicune', level: 1, moves: ['sleeptalk']}, - ]}); + it('should not copy the opponent\'s crit ratio', () => { + battle = common.gen(5).createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: 'Palkia', level: 100, moves: ['sleeptalk', 'focusenergy', 'psychup'] }, + { species: 'Smeargle', level: 1, moves: ['sleeptalk', 'focusenergy'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + { species: 'Suicune', level: 1, moves: ['sleeptalk'] }, + ] }); const palkia = battle.p1.active[0]; battle.makeChoices('move sleeptalk, move focusenergy', 'move sleeptalk, move sleeptalk'); diff --git a/test/sim/moves/pursuit.js b/test/sim/moves/pursuit.js index 2209192c29..07fdc5c0e2 100644 --- a/test/sim/moves/pursuit.js +++ b/test/sim/moves/pursuit.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe(`Pursuit`, function () { +describe(`Pursuit`, () => { afterEach(() => battle.destroy()); - it(`should execute before the target switches out and after the user mega evolves`, function () { + it(`should execute before the target switches out and after the user mega evolves`, () => { battle = common.createBattle([[ - {species: "Beedrill", ability: 'swarm', item: 'beedrillite', moves: ['pursuit']}, + { species: "Beedrill", ability: 'swarm', item: 'beedrillite', moves: ['pursuit'] }, ], [ - {species: "Alakazam", ability: 'magicguard', moves: ['psyshock']}, - {species: "Clefable", ability: 'unaware', moves: ['calmmind']}, + { species: "Alakazam", ability: 'magicguard', moves: ['psyshock'] }, + { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }, ]]); battle.makeChoices('move Pursuit mega', 'switch 2'); assert.species(battle.p1.active[0], "Beedrill-Mega"); assert.fainted(battle.p2.active[0]); }); - it(`should execute before the target switches out and after the user Terastallizes`, function () { + it(`should execute before the target switches out and after the user Terastallizes`, () => { battle = common.gen(9).createBattle([[ - {species: "Kingambit", ability: 'defiant', moves: ['pursuit']}, + { species: "Kingambit", ability: 'defiant', moves: ['pursuit'] }, ], [ - {species: "Giratina", ability: 'pressure', moves: ['shadow ball']}, - {species: "Clefable", ability: 'unaware', moves: ['calmmind']}, + { species: "Giratina", ability: 'pressure', moves: ['shadow ball'] }, + { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }, ]]); const giratina = battle.p2.pokemon[0]; const hpBeforeSwitch = giratina.hp; @@ -35,35 +35,35 @@ describe(`Pursuit`, function () { assert.bounded(damage, [256, 304], 'Actual damage: ' + damage); }); - it(`should continue the switch in Gen 3`, function () { + it(`should continue the switch in Gen 3`, () => { battle = common.gen(3).createBattle([[ - {species: "Tyranitar", ability: 'sandstream', moves: ['pursuit']}, + { species: "Tyranitar", ability: 'sandstream', moves: ['pursuit'] }, ], [ - {species: "Alakazam", ability: 'magicguard', moves: ['psyshock']}, - {species: "Clefable", ability: 'unaware', moves: ['calmmind']}, + { species: "Alakazam", ability: 'magicguard', moves: ['psyshock'] }, + { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }, ]]); battle.makeChoices('move Pursuit', 'switch 2'); assert(battle.p2.active[0].hp); }); - it(`should continue the switch in Gen 4`, function () { + it(`should continue the switch in Gen 4`, () => { battle = common.gen(4).createBattle([[ - {species: "Tyranitar", ability: 'sandstream', moves: ['pursuit']}, + { species: "Tyranitar", ability: 'sandstream', moves: ['pursuit'] }, ], [ - {species: "Alakazam", ability: 'magicguard', moves: ['psyshock']}, - {species: "Clefable", ability: 'unaware', moves: ['calmmind']}, + { species: "Alakazam", ability: 'magicguard', moves: ['psyshock'] }, + { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }, ]]); battle.makeChoices('move Pursuit', 'switch 2'); assert(battle.p2.active[0].hp); }); - it(`should not repeat`, function () { + it(`should not repeat`, () => { battle = common.createBattle([[ - {species: "Beedrill", ability: 'swarm', item: 'beedrillite', moves: ['pursuit']}, - {species: "Clefable", ability: 'unaware', moves: ['calmmind']}, + { species: "Beedrill", ability: 'swarm', item: 'beedrillite', moves: ['pursuit'] }, + { species: "Clefable", ability: 'unaware', moves: ['calmmind'] }, ], [ - {species: "Clefable", ability: 'magicguard', moves: ['calmmind']}, - {species: "Alakazam", ability: 'unaware', moves: ['calmmind']}, + { species: "Clefable", ability: 'magicguard', moves: ['calmmind'] }, + { species: "Alakazam", ability: 'unaware', moves: ['calmmind'] }, ]]); battle.makeChoices('move Pursuit mega', 'auto'); const clefable = battle.p2.pokemon[0]; @@ -72,26 +72,26 @@ describe(`Pursuit`, function () { assert.equal(hpBeforeSwitch, clefable.hp); }); - it(`should not double in power or activate before a switch if targeting an ally`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: "Beedrill", item: 'beedrillite', moves: ['pursuit']}, - {species: "Clefable", moves: ['calmmind']}, - {species: "Furret", ability: 'shellarmor', moves: ['uturn']}, + it(`should not double in power or activate before a switch if targeting an ally`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: "Beedrill", item: 'beedrillite', moves: ['pursuit'] }, + { species: "Clefable", moves: ['calmmind'] }, + { species: "Furret", ability: 'shellarmor', moves: ['uturn'] }, ], [ - {species: "Clefable", moves: ['calmmind']}, - {species: "Alakazam", moves: ['calmmind']}, + { species: "Clefable", moves: ['calmmind'] }, + { species: "Alakazam", moves: ['calmmind'] }, ]]); const furret = battle.p1.pokemon[2]; battle.makeChoices('move pursuit mega -2, switch 3', 'auto'); assert.bounded(furret.maxhp - furret.hp, [60, 70]); }); - it(`should deal damage prior to attacker selecting a switch in after u-turn etc`, function () { + it(`should deal damage prior to attacker selecting a switch in after u-turn etc`, () => { battle = common.createBattle([[ - {species: 'parasect', moves: ['pursuit']}, + { species: 'parasect', moves: ['pursuit'] }, ], [ - {species: 'emolga', moves: ['voltswitch']}, - {species: 'zapdos', moves: ['batonpass']}, + { species: 'emolga', moves: ['voltswitch'] }, + { species: 'zapdos', moves: ['batonpass'] }, ]]); battle.makeChoices('move Pursuit', 'move voltswitch'); assert.false.fullHP(battle.p2.pokemon[0]); @@ -104,16 +104,16 @@ describe(`Pursuit`, function () { battle.makeChoices('move Pursuit', 'move voltswitch'); }); - it(`should only activate before switches on adjacent foes`, function () { - battle = common.gen(5).createBattle({gameType: 'triples'}, [[ - {species: 'Beedrill', moves: ['pursuit']}, - {species: 'Wynaut', moves: ['swordsdance']}, - {species: 'Wynaut', moves: ['swordsdance']}, + it(`should only activate before switches on adjacent foes`, () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }, [[ + { species: 'Beedrill', moves: ['pursuit'] }, + { species: 'Wynaut', moves: ['swordsdance'] }, + { species: 'Wynaut', moves: ['swordsdance'] }, ], [ - {species: 'Alakazam', moves: ['swordsdance']}, - {species: 'Solosis', moves: ['swordsdance']}, - {species: 'Wynaut', moves: ['swordsdance']}, - {species: 'Wynaut', moves: ['swordsdance']}, + { species: 'Alakazam', moves: ['swordsdance'] }, + { species: 'Solosis', moves: ['swordsdance'] }, + { species: 'Wynaut', moves: ['swordsdance'] }, + { species: 'Wynaut', moves: ['swordsdance'] }, ]]); battle.makeChoices('move pursuit 2, auto', 'switch 4, auto'); assert.false(battle.log.includes('|-activate|p2a: Alakazam|move: Pursuit')); diff --git a/test/sim/moves/quash.js b/test/sim/moves/quash.js index 710c206e75..cea4ecaabc 100644 --- a/test/sim/moves/quash.js +++ b/test/sim/moves/quash.js @@ -5,38 +5,38 @@ const common = require('./../../common'); let battle; -describe('Quash', function () { - afterEach(function () { +describe('Quash', () => { + afterEach(() => { battle.destroy(); }); - it('should cause the target to move last if it has not moved yet', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Sableye", ability: 'prankster', moves: ['quash']}, - {species: "Aggron", ability: 'sturdy', moves: ['earthquake']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arceus", ability: 'multitype', moves: ['voltswitch']}, - {species: "Aerodactyl", ability: 'unnerve', moves: ['swift']}, - {species: "Rotom", ability: 'levitate', moves: ['thunderbolt']}, - ]}); + it('should cause the target to move last if it has not moved yet', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Sableye", ability: 'prankster', moves: ['quash'] }, + { species: "Aggron", ability: 'sturdy', moves: ['earthquake'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arceus", ability: 'multitype', moves: ['voltswitch'] }, + { species: "Aerodactyl", ability: 'unnerve', moves: ['swift'] }, + { species: "Rotom", ability: 'levitate', moves: ['thunderbolt'] }, + ] }); battle.makeChoices('move quash 2, move earthquake', 'move voltswitch 2, move swift'); battle.makeChoices('', 'switch 3, pass'); // Volt Switch assert.equal(battle.log[battle.lastMoveLine].split('|')[3], 'Swift'); }); - it('should not cause the target to move again if it has already moved', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Sableye", ability: 'prankster', moves: ['quash']}, - {species: "Aggron", ability: 'sturdy', moves: ['earthquake']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Arceus", ability: 'multitype', moves: ['voltswitch']}, - {species: "Aerodactyl", ability: 'unnerve', moves: ['extremespeed']}, - {species: "Rotom", ability: 'levitate', moves: ['thunderbolt']}, - ]}); + it('should not cause the target to move again if it has already moved', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Sableye", ability: 'prankster', moves: ['quash'] }, + { species: "Aggron", ability: 'sturdy', moves: ['earthquake'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Arceus", ability: 'multitype', moves: ['voltswitch'] }, + { species: "Aerodactyl", ability: 'unnerve', moves: ['extremespeed'] }, + { species: "Rotom", ability: 'levitate', moves: ['thunderbolt'] }, + ] }); battle.makeChoices('move quash 2, move earthquake', 'move voltswitch 2, move extremespeed 1'); battle.makeChoices('', 'switch 3, pass'); // Volt Switch assert.notEqual(battle.log[battle.lastMoveLine].split('|')[3], 'Extremespeed'); diff --git a/test/sim/moves/rage.js b/test/sim/moves/rage.js index aed2c54b16..441491b238 100644 --- a/test/sim/moves/rage.js +++ b/test/sim/moves/rage.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Rage [Gen 1]', function () { - afterEach(function () { +describe('Rage [Gen 1]', () => { + afterEach(() => { battle.destroy(); }); - it("Rage accuracy bug", function () { - battle = common.gen(1).createBattle({seed: [1, 1, 1, 0]}); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['rage']}]}); - battle.setPlayer('p2', {team: [{species: "Aerodactyl", moves: ['doubleteam']}]}); + it("Rage accuracy bug", () => { + battle = common.gen(1).createBattle({ seed: [1, 1, 1, 0] }); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['rage'] }] }); + battle.setPlayer('p2', { team: [{ species: "Aerodactyl", moves: ['doubleteam'] }] }); const nidoking = battle.p1.active[0]; battle.makeChoices(); assert.equal(nidoking.volatiles['rage'].accuracy, 255); diff --git a/test/sim/moves/ragefist.js b/test/sim/moves/ragefist.js index a70e6d97e9..252fafe242 100644 --- a/test/sim/moves/ragefist.js +++ b/test/sim/moves/ragefist.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Rage Fist', function () { - afterEach(function () { +describe('Rage Fist', () => { + afterEach(() => { battle.destroy(); }); - it(`should increase BP by 50 each time the user is hit`, function () { + it(`should increase BP by 50 each time the user is hit`, () => { battle = common.createBattle([[ - {species: 'Primeape', moves: ['ragefist']}, + { species: 'Primeape', moves: ['ragefist'] }, ], [ - {species: 'Umbreon', ability: 'shellarmor', moves: ['tackle']}, + { species: 'Umbreon', ability: 'shellarmor', moves: ['tackle'] }, ]]); battle.makeChoices(); const umbreon = battle.p2.active[0]; @@ -26,11 +26,11 @@ describe('Rage Fist', function () { assert.bounded(rageFistDamage, [34, 41], `Rage Fist should be 100 BP`); }); - it(`should not increase BP after being hit by status moves`, function () { + it(`should not increase BP after being hit by status moves`, () => { battle = common.createBattle([[ - {species: 'Primeape', moves: ['ragefist']}, + { species: 'Primeape', moves: ['ragefist'] }, ], [ - {species: 'Umbreon', ability: 'shellarmor', moves: ['taunt']}, + { species: 'Umbreon', ability: 'shellarmor', moves: ['taunt'] }, ]]); battle.makeChoices(); @@ -43,11 +43,11 @@ describe('Rage Fist', function () { assert.bounded(rageFistDamage, [17, 21]); }); - it(`should increase BP after each hit of multi-hit moves`, function () { + it(`should increase BP after each hit of multi-hit moves`, () => { battle = common.createBattle([[ - {species: 'Primeape', ability: 'noguard', moves: ['sleeptalk', 'ragefist']}, + { species: 'Primeape', ability: 'noguard', moves: ['sleeptalk', 'ragefist'] }, ], [ - {species: 'Umbreon', ability: 'shellarmor', moves: ['doublehit', 'sleeptalk']}, + { species: 'Umbreon', ability: 'shellarmor', moves: ['doublehit', 'sleeptalk'] }, ]]); battle.makeChoices(); @@ -56,11 +56,11 @@ describe('Rage Fist', function () { assert.bounded(umbreon.maxhp - umbreon.hp, [52, 61]); }); - it(`should use user's own number of times hit when called by another move`, function () { + it(`should use user's own number of times hit when called by another move`, () => { battle = common.createBattle([[ - {species: 'Primeape', moves: ['ragefist']}, + { species: 'Primeape', moves: ['ragefist'] }, ], [ - {species: 'Umbreon', ability: 'shellarmor', moves: ['copycat']}, + { species: 'Umbreon', ability: 'shellarmor', moves: ['copycat'] }, ]]); battle.makeChoices(); @@ -68,11 +68,11 @@ describe('Rage Fist', function () { assert.bounded(primeape.maxhp - primeape.hp, [77, 91]); }); - it(`should not increase BP when the user's Substitute is damaged or broken`, function () { + it(`should not increase BP when the user's Substitute is damaged or broken`, () => { battle = common.createBattle([[ - {species: 'Primeape', moves: ['substitute', 'ragefist']}, + { species: 'Primeape', moves: ['substitute', 'ragefist'] }, ], [ - {species: 'Umbreon', ability: 'shellarmor', moves: ['dragonrage', 'sleeptalk']}, + { species: 'Umbreon', ability: 'shellarmor', moves: ['dragonrage', 'sleeptalk'] }, ]]); battle.makeChoices(); @@ -82,13 +82,13 @@ describe('Rage Fist', function () { assert.equal(primeape.timesAttacked, 0); }); - it(`should not increase BP when healed by an ally's Pollen Puff`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Wynaut', moves: ['pollenpuff']}, - {species: 'Annihilape', moves: ['sleeptalk', 'bellydrum']}, + it(`should not increase BP when healed by an ally's Pollen Puff`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Wynaut', moves: ['pollenpuff'] }, + { species: 'Annihilape', moves: ['sleeptalk', 'bellydrum'] }, ], [ - {species: 'Wobbuffet', moves: ['sleeptalk']}, - {species: 'Lucario', moves: ['sleeptalk']}, + { species: 'Wobbuffet', moves: ['sleeptalk'] }, + { species: 'Lucario', moves: ['sleeptalk'] }, ]]); const annihilape = battle.p1.active[1]; @@ -99,13 +99,13 @@ describe('Rage Fist', function () { assert.equal(annihilape.timesAttacked, 0, `timesAttacked should not have incremented after a not-full HP Pollen Puff`); }); - it(`should increase BP when hit by Dragon Darts`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Primeape', moves: ['sleeptalk', 'ragefist']}, - {species: 'Wynaut', moves: ['sleeptalk', 'allyswitch']}, + it(`should increase BP when hit by Dragon Darts`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Primeape', moves: ['sleeptalk', 'ragefist'] }, + { species: 'Wynaut', moves: ['sleeptalk', 'allyswitch'] }, ], [ - {species: 'Dreepy', moves: ['dragondarts']}, - {species: 'Pichu', moves: ['sleeptalk']}, + { species: 'Dreepy', moves: ['dragondarts'] }, + { species: 'Pichu', moves: ['sleeptalk'] }, ]]); battle.makeChoices('auto', 'move dragondarts 1, move sleeptalk'); diff --git a/test/sim/moves/ragepowder.js b/test/sim/moves/ragepowder.js index 68ef9a5398..24d533926f 100644 --- a/test/sim/moves/ragepowder.js +++ b/test/sim/moves/ragepowder.js @@ -6,25 +6,25 @@ const Sim = require('./../../../dist/sim'); let battle; -describe('Rage Powder', function () { - afterEach(function () { +describe('Rage Powder', () => { + afterEach(() => { battle.destroy(); }); it('should redirect single-target moves towards it if it is a valid target', function () { this.timeout(5000); - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: 'Amoonguss', ability: 'overcoat', item: 'safetygoggles', moves: ['ragepowder']}, - {species: 'Venusaur', ability: 'overcoat', moves: ['growth']}, - {species: 'Ivysaur', ability: 'overcoat', moves: ['growth']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Abra', ability: 'synchronize', moves: ['absorb']}, - {species: 'Kadabra', ability: 'synchronize', moves: ['absorb']}, - {species: 'Alakazam', ability: 'synchronize', moves: ['absorb']}, - ]}); + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: 'Amoonguss', ability: 'overcoat', item: 'safetygoggles', moves: ['ragepowder'] }, + { species: 'Venusaur', ability: 'overcoat', moves: ['growth'] }, + { species: 'Ivysaur', ability: 'overcoat', moves: ['growth'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Abra', ability: 'synchronize', moves: ['absorb'] }, + { species: 'Kadabra', ability: 'synchronize', moves: ['absorb'] }, + { species: 'Alakazam', ability: 'synchronize', moves: ['absorb'] }, + ] }); const hitCount = [0, 0, 0]; battle.p1.active[0].damage = function (...args) { hitCount[0]++; @@ -44,18 +44,18 @@ describe('Rage Powder', function () { assert.equal(hitCount[2], 0); }); - it('should not affect Pokemon with Powder immunities', function () { - battle = common.gen(5).createBattle({gameType: 'triples'}); - battle.setPlayer('p1', {team: [ - {species: 'Amoonguss', ability: 'overcoat', moves: ['growth']}, - {species: 'Venusaur', ability: 'overcoat', moves: ['ragepowder']}, - {species: 'Ivysaur', ability: 'overcoat', moves: ['growth']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Squirtle', ability: 'naturalcure', moves: ['absorb']}, - {species: 'Escavalier', ability: 'overcoat', moves: ['absorb']}, - {species: 'Alakazam', ability: 'synchronize', item: 'safetygoggles', moves: ['absorb']}, - ]}); + it('should not affect Pokemon with Powder immunities', () => { + battle = common.gen(5).createBattle({ gameType: 'triples' }); + battle.setPlayer('p1', { team: [ + { species: 'Amoonguss', ability: 'overcoat', moves: ['growth'] }, + { species: 'Venusaur', ability: 'overcoat', moves: ['ragepowder'] }, + { species: 'Ivysaur', ability: 'overcoat', moves: ['growth'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Squirtle', ability: 'naturalcure', moves: ['absorb'] }, + { species: 'Escavalier', ability: 'overcoat', moves: ['absorb'] }, + { species: 'Alakazam', ability: 'synchronize', item: 'safetygoggles', moves: ['absorb'] }, + ] }); const hitCount = [0, 0, 0]; battle.p1.active[0].damage = function (...args) { hitCount[0]++; diff --git a/test/sim/moves/rapidspin.js b/test/sim/moves/rapidspin.js index 02d67346d9..1842c231dc 100644 --- a/test/sim/moves/rapidspin.js +++ b/test/sim/moves/rapidspin.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Rapid Spin', function () { - afterEach(function () { +describe('Rapid Spin', () => { + afterEach(() => { battle.destroy(); }); - it(`should remove entry hazards`, function () { + it(`should remove entry hazards`, () => { battle = common.createBattle([[ - {species: 'Omastar', moves: ['stealthrock', 'spikes', 'toxicspikes', 'stickyweb']}, + { species: 'Omastar', moves: ['stealthrock', 'spikes', 'toxicspikes', 'stickyweb'] }, ], [ - {species: 'Armaldo', moves: ['sleeptalk', 'rapidspin']}, + { species: 'Armaldo', moves: ['sleeptalk', 'rapidspin'] }, ]]); for (let i = 1; i < 5; i++) { battle.makeChoices('move ' + i, 'auto'); @@ -24,43 +24,43 @@ describe('Rapid Spin', function () { assert(!side['stealthrock'] && !side['spikes'] && !side['toxicspikes'] && !side['stickyweb']); }); - it(`should remove entry hazards past a Substitute`, function () { + it(`should remove entry hazards past a Substitute`, () => { battle = common.createBattle([[ - {species: 'Cobalion', moves: ['stealthrock', 'substitute']}, + { species: 'Cobalion', moves: ['stealthrock', 'substitute'] }, ], [ - {species: 'Armaldo', moves: ['sleeptalk', 'rapidspin']}, + { species: 'Armaldo', moves: ['sleeptalk', 'rapidspin'] }, ]]); battle.makeChoices(); battle.makeChoices('move substitute', 'move rapidspin'); assert(!battle.p2.sideConditions['stealthrock']); }); - it(`should not remove hazards if the user faints`, function () { + it(`should not remove hazards if the user faints`, () => { battle = common.createBattle([[ - {species: 'Mew', item: 'rockyhelmet', moves: ['stealthrock']}, + { species: 'Mew', item: 'rockyhelmet', moves: ['stealthrock'] }, ], [ - {species: 'Shedinja', moves: ['rapidspin']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Shedinja', moves: ['rapidspin'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert(battle.p2.sideConditions['stealthrock']); }); - it(`should not remove hazards if the user has Sheer Force`, function () { + it(`should not remove hazards if the user has Sheer Force`, () => { battle = common.createBattle([[ - {species: 'Cobalion', moves: ['stealthrock']}, + { species: 'Cobalion', moves: ['stealthrock'] }, ], [ - {species: 'Armaldo', ability: 'sheerforce', moves: ['rapidspin']}, + { species: 'Armaldo', ability: 'sheerforce', moves: ['rapidspin'] }, ]]); battle.makeChoices(); assert(battle.p2.sideConditions['stealthrock']); }); - it(`should remove hazards if the user has Sheer Force [Gen 7]`, function () { + it(`should remove hazards if the user has Sheer Force [Gen 7]`, () => { battle = common.gen(7).createBattle([[ - {species: 'Cobalion', moves: ['stealthrock']}, + { species: 'Cobalion', moves: ['stealthrock'] }, ], [ - {species: 'Armaldo', ability: 'sheerforce', moves: ['rapidspin']}, + { species: 'Armaldo', ability: 'sheerforce', moves: ['rapidspin'] }, ]]); battle.makeChoices(); assert.false(battle.p2.sideConditions['stealthrock']); diff --git a/test/sim/moves/reflecttype.js b/test/sim/moves/reflecttype.js index a24c82df51..b8f372add8 100644 --- a/test/sim/moves/reflecttype.js +++ b/test/sim/moves/reflecttype.js @@ -5,22 +5,22 @@ const common = require('./../../common'); let battle; -describe('Reflect Type', function () { - afterEach(function () { +describe('Reflect Type', () => { + afterEach(() => { battle.destroy(); }); - it('should fail when used against a Pokemon whose type is "???"', function () { + it('should fail when used against a Pokemon whose type is "???"', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Arcanine', ability: 'intimidate', moves: ['burnup']}]}); - battle.setPlayer('p2', {team: [{species: 'Latias', ability: 'levitate', item: 'laggingtail', moves: ['reflecttype']}]}); + battle.setPlayer('p1', { team: [{ species: 'Arcanine', ability: 'intimidate', moves: ['burnup'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Latias', ability: 'levitate', item: 'laggingtail', moves: ['reflecttype'] }] }); assert.constant(() => battle.p2.active[0].getTypes(), () => battle.makeChoices('move burnup', 'move reflecttype')); }); - it('should ignore the "???" type when used against a Pokemon whose type contains "???" and a non-added type', function () { + it('should ignore the "???" type when used against a Pokemon whose type contains "???" and a non-added type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Latias', ability: 'levitate', item: 'laggingtail', moves: ['reflecttype', 'trickortreat']}]}); - battle.setPlayer('p2', {team: [{species: 'Moltres', ability: 'pressure', moves: ['burnup']}]}); + battle.setPlayer('p1', { team: [{ species: 'Latias', ability: 'levitate', item: 'laggingtail', moves: ['reflecttype', 'trickortreat'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Moltres', ability: 'pressure', moves: ['burnup'] }] }); battle.makeChoices('move reflecttype', 'move burnup'); assert.equal(battle.p1.active[0].getTypes().join('/'), 'Flying'); battle.makeChoices('move trickortreat', 'move burnup'); @@ -28,10 +28,10 @@ describe('Reflect Type', function () { assert.equal(battle.p1.active[0].getTypes().join('/'), 'Flying/Ghost'); }); - it('should turn the "???" type into "Normal" when used against a Pokemon whose type is only "???" and an added type', function () { + it('should turn the "???" type into "Normal" when used against a Pokemon whose type is only "???" and an added type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Latias', ability: 'levitate', item: 'laggingtail', moves: ['reflecttype', 'trickortreat']}]}); - battle.setPlayer('p2', {team: [{species: 'Arcanine', ability: 'intimidate', moves: ['burnup']}]}); + battle.setPlayer('p1', { team: [{ species: 'Latias', ability: 'levitate', item: 'laggingtail', moves: ['reflecttype', 'trickortreat'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Arcanine', ability: 'intimidate', moves: ['burnup'] }] }); battle.makeChoices('move trickortreat', 'move burnup'); battle.makeChoices('move reflecttype', 'move burnup'); assert.equal(battle.p1.active[0].getTypes().join('/'), 'Normal/Ghost'); diff --git a/test/sim/moves/relicsong.js b/test/sim/moves/relicsong.js index 94bdec3840..aa72d51fad 100644 --- a/test/sim/moves/relicsong.js +++ b/test/sim/moves/relicsong.js @@ -5,56 +5,56 @@ const common = require('./../../common'); let battle; -describe('Relic Song', function () { - afterEach(function () { +describe('Relic Song', () => { + afterEach(() => { battle.destroy(); }); - it('should transform Meloetta into its Pirouette forme', function () { + it('should transform Meloetta into its Pirouette forme', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Meloetta", ability: 'serenegrace', moves: ['relicsong']}]}); - battle.setPlayer('p2', {team: [{species: "Registeel", ability: 'clearbody', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Meloetta", ability: 'serenegrace', moves: ['relicsong'] }] }); + battle.setPlayer('p2', { team: [{ species: "Registeel", ability: 'clearbody', moves: ['rest'] }] }); battle.makeChoices('move relicsong', 'move rest'); assert.equal(battle.p1.active[0].species.id, 'meloettapirouette'); }); - it('should transform Meloetta-Pirouette into its Aria forme', function () { + it('should transform Meloetta-Pirouette into its Aria forme', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Meloetta-Pirouette", ability: 'serenegrace', moves: ['relicsong']}]}); - battle.setPlayer('p2', {team: [{species: "Registeel", ability: 'clearbody', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Meloetta-Pirouette", ability: 'serenegrace', moves: ['relicsong'] }] }); + battle.setPlayer('p2', { team: [{ species: "Registeel", ability: 'clearbody', moves: ['rest'] }] }); battle.makeChoices('move relicsong', 'move rest'); assert.equal(battle.p1.active[0].species.id, 'meloetta'); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'relicsong']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'relicsong'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move relicsong', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); }); -describe('Relic Song [Gen 5]', function () { - afterEach(function () { +describe('Relic Song [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'relicsong']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'relicsong'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move relicsong', 'move rest'); assert.equal(battle.p2.active[0].item, 'focussash'); }); - it('should transform Meloetta into its Pirouette forme even if it hits a substitute', function () { + it('should transform Meloetta into its Pirouette forme even if it hits a substitute', () => { battle = common.createBattle([ - [{species: "Meloetta", ability: 'serenegrace', moves: ['relicsong']}], - [{species: "Registeel", ability: 'prankster', moves: ['substitute']}], + [{ species: "Meloetta", ability: 'serenegrace', moves: ['relicsong'] }], + [{ species: "Registeel", ability: 'prankster', moves: ['substitute'] }], ]); battle.makeChoices('move relicsong', 'move substitute'); assert.equal(battle.p1.active[0].species.id, 'meloettapirouette'); diff --git a/test/sim/moves/revivalblessing.js b/test/sim/moves/revivalblessing.js index 20380a1191..42726dadfd 100644 --- a/test/sim/moves/revivalblessing.js +++ b/test/sim/moves/revivalblessing.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Revival Blessing', function () { - afterEach(function () { +describe('Revival Blessing', () => { + afterEach(() => { battle.destroy(); }); - it(`should revive allies`, function () { + it(`should revive allies`, () => { battle = common.createBattle([[ - {species: 'corviknight', ability: 'runaway', moves: ['memento']}, - {species: 'zoroark', ability: 'runaway', moves: ['revivalblessing']}, - {species: 'wynaut', ability: 'runaway', moves: ['splash']}, + { species: 'corviknight', ability: 'runaway', moves: ['memento'] }, + { species: 'zoroark', ability: 'runaway', moves: ['revivalblessing'] }, + { species: 'wynaut', ability: 'runaway', moves: ['splash'] }, ], [ - {species: 'goodra', ability: 'gooey', moves: ['sleeptalk']}, + { species: 'goodra', ability: 'gooey', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move memento', 'auto'); battle.makeChoices('switch zoroark', ''); @@ -26,13 +26,13 @@ describe('Revival Blessing', function () { assert.equal(battle.p1.pokemon[1].hp, Math.floor(battle.p1.pokemon[1].maxhp / 2)); }); - it(`should not actually switch the active Pokemon`, function () { + it(`should not actually switch the active Pokemon`, () => { battle = common.createBattle([[ - {species: 'corviknight', ability: 'runaway', moves: ['memento']}, - {species: 'zoroark', ability: 'runaway', moves: ['revivalblessing']}, - {species: 'wynaut', ability: 'runaway', moves: ['splash']}, + { species: 'corviknight', ability: 'runaway', moves: ['memento'] }, + { species: 'zoroark', ability: 'runaway', moves: ['revivalblessing'] }, + { species: 'wynaut', ability: 'runaway', moves: ['splash'] }, ], [ - {species: 'goodra', ability: 'gooey', moves: ['sleeptalk']}, + { species: 'goodra', ability: 'gooey', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move memento', 'auto'); battle.makeChoices('switch zoroark', ''); @@ -42,12 +42,12 @@ describe('Revival Blessing', function () { assert.species(battle.p1.active[0], 'Zoroark'); }); - it(`should let you revive even with one Pokemon remaining`, function () { + it(`should let you revive even with one Pokemon remaining`, () => { battle = common.createBattle([[ - {species: 'corviknight', ability: 'runaway', moves: ['memento']}, - {species: 'zoroark', ability: 'runaway', moves: ['revivalblessing']}, + { species: 'corviknight', ability: 'runaway', moves: ['memento'] }, + { species: 'zoroark', ability: 'runaway', moves: ['revivalblessing'] }, ], [ - {species: 'goodra', ability: 'gooey', moves: ['sleeptalk']}, + { species: 'goodra', ability: 'gooey', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move memento', 'auto'); battle.makeChoices('switch zoroark', ''); @@ -58,12 +58,12 @@ describe('Revival Blessing', function () { }); it(`should send the Pokemon back in immediately if in an active slot in Doubles`, () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'pawmot', ability: 'naturalcure', moves: ['revivalblessing']}, - {species: 'shinx', ability: 'intimidate', moves: ['sleeptalk']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'pawmot', ability: 'naturalcure', moves: ['revivalblessing'] }, + { species: 'shinx', ability: 'intimidate', moves: ['sleeptalk'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, - {species: 'chienpao', ability: 'noguard', moves: ['sheercold']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, + { species: 'chienpao', ability: 'noguard', moves: ['sheercold'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, move sheercold 2'); battle.makeChoices('switch 2', ''); @@ -71,12 +71,12 @@ describe('Revival Blessing', function () { }); it(`shouldn't allow a fainted Pokemon to make its move the same turn after being revived`, () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'pawmot', ability: 'naturalcure', moves: ['revivalblessing']}, - {species: 'lycanrocmidnight', ability: 'noguard', item: 'laggingtail', moves: ['doubleteam']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'pawmot', ability: 'naturalcure', moves: ['revivalblessing'] }, + { species: 'lycanrocmidnight', ability: 'noguard', item: 'laggingtail', moves: ['doubleteam'] }, ], [ - {species: 'mareep', ability: 'static', moves: ['sleeptalk']}, - {species: 'chienpao', ability: 'swordofruin', moves: ['sheercold']}, + { species: 'mareep', ability: 'static', moves: ['sleeptalk'] }, + { species: 'chienpao', ability: 'swordofruin', moves: ['sheercold'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, move sheercold 2'); battle.makeChoices('switch 2', ''); diff --git a/test/sim/moves/rollout.js b/test/sim/moves/rollout.js index 70f888edec..88e1b4e51e 100644 --- a/test/sim/moves/rollout.js +++ b/test/sim/moves/rollout.js @@ -8,22 +8,22 @@ let battle; const moves = ['Ice Ball', 'Rollout']; for (const move of moves) { - describe(move, function () { + describe(move, () => { const id = move.toLowerCase().replace(/\W+/g, ''); - afterEach(function () { + afterEach(() => { battle.destroy(); }); - it('should double its Base Power every turn for five turns, then resets to 30 BP', function () { + it('should double its Base Power every turn for five turns, then resets to 30 BP', () => { battle = common.createBattle([ - [{species: 'Shuckle', ability: 'gluttony', moves: [id]}], - [{species: 'Steelix', ability: 'noguard', moves: ['recover']}], + [{ species: 'Shuckle', ability: 'gluttony', moves: [id] }], + [{ species: 'Steelix', ability: 'noguard', moves: ['recover'] }], ]); let ebp = 30; let count = 0; - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { count++; assert.equal(basePower, ebp); if (count % 5 === 0) { @@ -39,15 +39,15 @@ for (const move of moves) { assert.equal(count, 8); }); - it('should reset its Base Power if the move misses', function () { + it('should reset its Base Power if the move misses', () => { battle = common.createBattle([ - [{species: 'Shuckle', ability: 'gluttony', moves: [id]}], - [{species: 'Steelix', ability: 'furcoat', moves: ['recover']}], + [{ species: 'Shuckle', ability: 'gluttony', moves: [id] }], + [{ species: 'Steelix', ability: 'furcoat', moves: ['recover'] }], ]); let ebp = 30; let count = 0; - battle.onEvent('Accuracy', battle.format, function (accuracy, target, pokemon, move) { + battle.onEvent('Accuracy', battle.format, (accuracy, target, pokemon, move) => { if (move.id === 'recover') return; count++; @@ -58,7 +58,7 @@ for (const move of moves) { return true; } }); - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { assert.equal(basePower, ebp); ebp *= 2; }); @@ -69,15 +69,15 @@ for (const move of moves) { assert.equal(count, 5); }); - it('should reset its Base Power if the Pokemon is immobilized', function () { + it('should reset its Base Power if the Pokemon is immobilized', () => { battle = common.createBattle([ - [{species: 'Shuckle', ability: 'gluttony', moves: [id]}], - [{species: 'Steelix', ability: 'noguard', moves: ['recover']}], + [{ species: 'Shuckle', ability: 'gluttony', moves: [id] }], + [{ species: 'Steelix', ability: 'noguard', moves: ['recover'] }], ]); let ebp = 30; let count = 0; - battle.onEvent('BeforeMove', battle.format, function (attacker, defender, move) { + battle.onEvent('BeforeMove', battle.format, (attacker, defender, move) => { if (move.id === 'recover') return; count++; @@ -86,7 +86,7 @@ for (const move of moves) { return false; // Imitate immobilization from Paralysis, etc. } }); - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { assert.equal(basePower, ebp); ebp *= 2; }); @@ -97,14 +97,14 @@ for (const move of moves) { assert.equal(count, 5); }); - it('should have double Base Power if the Pokemon used Defense Curl earlier', function () { + it('should have double Base Power if the Pokemon used Defense Curl earlier', () => { battle = common.createBattle([ - [{species: 'Shuckle', ability: 'gluttony', moves: [id, 'defensecurl']}], - [{species: 'Steelix', ability: 'noguard', moves: ['recover']}], + [{ species: 'Shuckle', ability: 'gluttony', moves: [id, 'defensecurl'] }], + [{ species: 'Steelix', ability: 'noguard', moves: ['recover'] }], ]); let runCount = 0; - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { assert.equal(basePower, 60); runCount++; }); @@ -114,14 +114,14 @@ for (const move of moves) { assert.equal(runCount, 1); }); - it('should not be affected by Parental Bond', function () { + it('should not be affected by Parental Bond', () => { battle = common.createBattle([ - [{species: 'Shuckle', ability: 'parentalbond', moves: [id]}], - [{species: 'Steelix', ability: 'noguard', moves: ['recover']}], + [{ species: 'Shuckle', ability: 'parentalbond', moves: [id] }], + [{ species: 'Steelix', ability: 'noguard', moves: ['recover'] }], ]); let hitCount = 0; - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { assert.equal(basePower, 30); hitCount++; }); @@ -130,14 +130,14 @@ for (const move of moves) { assert.equal(hitCount, 1); }); - describe(`Rollout Storage glitch (Gen 7 / Gen 8DLC1)`, function () { - it(`should delay the Rollout multiplier when hitting Disguise or Ice Face`, function () { + describe(`Rollout Storage glitch (Gen 7 / Gen 8DLC1)`, () => { + it(`should delay the Rollout multiplier when hitting Disguise or Ice Face`, () => { battle = common.gen(7).createBattle([[ - {species: 'wynaut', ability: 'compoundeyes', ivs: {atk: '0'}, nature: 'bold', moves: [id, 'watergun']}, + { species: 'wynaut', ability: 'compoundeyes', ivs: { atk: '0' }, nature: 'bold', moves: [id, 'watergun'] }, ], [ - {species: 'mimikyu', ability: 'disguise', evs: {hp: '252', def: '252'}, nature: 'bold', moves: ['gravity']}, - {species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk']}, - {species: 'wigglytuff', ability: 'battlearmor', moves: ['rest']}, + { species: 'mimikyu', ability: 'disguise', evs: { hp: '252', def: '252' }, nature: 'bold', moves: ['gravity'] }, + { species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk'] }, + { species: 'wigglytuff', ability: 'battlearmor', moves: ['rest'] }, ]]); for (let i = 0; i < 5; i++) { battle.makeChoices(); } @@ -151,13 +151,13 @@ for (const move of moves) { assert.bounded(damage, [18, 22]); }); - it(`should delay the Rollout multiplier when hitting multiple Disguise or Ice Face`, function () { + it(`should delay the Rollout multiplier when hitting multiple Disguise or Ice Face`, () => { battle = common.gen(7).createBattle([[ - {species: 'wynaut', ability: 'compoundeyes', ivs: {atk: '0'}, nature: 'bold', moves: [id, 'watergun']}, + { species: 'wynaut', ability: 'compoundeyes', ivs: { atk: '0' }, nature: 'bold', moves: [id, 'watergun'] }, ], [ - {species: 'mimikyu', ability: 'disguise', evs: {hp: '252', def: '252'}, nature: 'bold', moves: ['gravity']}, - {species: 'mimikyu', ability: 'disguise', evs: {hp: '252', def: '252'}, nature: 'bold', moves: ['gravity']}, - {species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk']}, + { species: 'mimikyu', ability: 'disguise', evs: { hp: '252', def: '252' }, nature: 'bold', moves: ['gravity'] }, + { species: 'mimikyu', ability: 'disguise', evs: { hp: '252', def: '252' }, nature: 'bold', moves: ['gravity'] }, + { species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -169,12 +169,12 @@ for (const move of moves) { assert.bounded(damage, [74, 88]); // 40 * 2^3 BP; would be 40 BP otherwise, range 10-12 }); - it(`should use the move's default BP when applying the modifier`, function () { + it(`should use the move's default BP when applying the modifier`, () => { battle = common.gen(7).createBattle([[ - {species: 'wynaut', ability: 'compoundeyes', ivs: {atk: '0'}, nature: 'bold', moves: [id, 'grassknot']}, + { species: 'wynaut', ability: 'compoundeyes', ivs: { atk: '0' }, nature: 'bold', moves: [id, 'grassknot'] }, ], [ - {species: 'mimikyu', ability: 'disguise', evs: {hp: '252', def: '252'}, nature: 'bold', moves: ['gravity']}, - {species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk']}, + { species: 'mimikyu', ability: 'disguise', evs: { hp: '252', def: '252' }, nature: 'bold', moves: ['gravity'] }, + { species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 5; i++) { battle.makeChoices(); } @@ -184,13 +184,13 @@ for (const move of moves) { assert.bounded(damage, [5, 6]); // 1 * 2^4 BP; would be 120 BP otherwise, range 28-34 }); - it(`should only apply the Rollout Storage boost to the first target of a spread move`, function () { - battle = common.gen(7).createBattle({gameType: 'doubles'}, [[ - {species: 'mimikyu', ability: 'disguise', evs: {hp: '252', def: '252'}, nature: 'bold', moves: ['gravity']}, - {species: 'wynaut', ability: 'compoundeyes', ivs: {atk: '0'}, nature: 'bold', moves: [id, 'snarl']}, + it(`should only apply the Rollout Storage boost to the first target of a spread move`, () => { + battle = common.gen(7).createBattle({ gameType: 'doubles' }, [[ + { species: 'mimikyu', ability: 'disguise', evs: { hp: '252', def: '252' }, nature: 'bold', moves: ['gravity'] }, + { species: 'wynaut', ability: 'compoundeyes', ivs: { atk: '0' }, nature: 'bold', moves: [id, 'snarl'] }, ], [ - {species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk']}, - {species: 'hydreigon', ability: 'battlearmor', moves: ['sleeptalk']}, + { species: 'snorlax', ability: 'battlearmor', moves: ['sleeptalk'] }, + { species: 'hydreigon', ability: 'battlearmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move gravity, move ' + id + ' -1', 'auto'); diff --git a/test/sim/moves/roost.js b/test/sim/moves/roost.js index 9e95b11748..19341b7fd2 100644 --- a/test/sim/moves/roost.js +++ b/test/sim/moves/roost.js @@ -6,32 +6,32 @@ const Sim = require('./../../../dist/sim'); let battle; -describe('Roost', function () { - afterEach(function () { +describe('Roost', () => { + afterEach(() => { battle.destroy(); }); - it('should fail if the user is at max HP', function () { + it('should fail if the user is at max HP', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Clefable", item: 'leftovers', ability: 'unaware', moves: ['calmmind']}]}); - battle.setPlayer('p2', {team: [{species: "Dragonite", item: 'laggingtail', ability: 'multiscale', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [{ species: "Clefable", item: 'leftovers', ability: 'unaware', moves: ['calmmind'] }] }); + battle.setPlayer('p2', { team: [{ species: "Dragonite", item: 'laggingtail', ability: 'multiscale', moves: ['roost'] }] }); battle.makeChoices('move calmmind', 'move roost'); assert(battle.log[battle.lastMoveLine + 1].startsWith('|-fail|')); }); - it('should heal the user', function () { + it('should heal the user', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Clefable", ability: 'unaware', moves: ['calmmind', 'hiddenpowergrass']}]}); - battle.setPlayer('p2', {team: [{species: "Dragonite", ability: 'multiscale', moves: ['roost', 'dragondance']}]}); + battle.setPlayer('p1', { team: [{ species: "Clefable", ability: 'unaware', moves: ['calmmind', 'hiddenpowergrass'] }] }); + battle.setPlayer('p2', { team: [{ species: "Dragonite", ability: 'multiscale', moves: ['roost', 'dragondance'] }] }); battle.makeChoices('move hiddenpowergrass', 'move dragondance'); battle.makeChoices('move calmmind', 'move roost'); assert.equal(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); - it('should suppress user\'s current Flying type if succesful', function () { + it('should suppress user\'s current Flying type if succesful', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Aggron", item: 'leftovers', ability: 'sturdy', moves: ['mudslap', 'hiddenpowergrass']}]}); - battle.setPlayer('p2', {team: [{species: "Aerodactyl", item: 'focussash', ability: 'wonderguard', moves: ['roost', 'doubleedge']}]}); + battle.setPlayer('p1', { team: [{ species: "Aggron", item: 'leftovers', ability: 'sturdy', moves: ['mudslap', 'hiddenpowergrass'] }] }); + battle.setPlayer('p2', { team: [{ species: "Aerodactyl", item: 'focussash', ability: 'wonderguard', moves: ['roost', 'doubleedge'] }] }); battle.makeChoices('move mudslap', 'move roost'); assert.equal(battle.p2.active[0].hp, battle.p2.active[0].maxhp); // Immune to Mud Slap @@ -49,16 +49,16 @@ describe('Roost', function () { assert.notEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); // Hit super-effectively by HP Grass }); - it('should suppress Flying type yet to be acquired this turn', function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Pidgeot", item: 'laggingtail', ability: 'victorystar', moves: ['aircutter']}, - {species: "Gligar", item: 'laggingtail', ability: 'immunity', moves: ['earthquake']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Kecleon", ability: 'colorchange', moves: ['roost']}, - {species: "Venusaur", ability: 'chlorophyll', moves: ['earthquake']}, - ]}); + it('should suppress Flying type yet to be acquired this turn', () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Pidgeot", item: 'laggingtail', ability: 'victorystar', moves: ['aircutter'] }, + { species: "Gligar", item: 'laggingtail', ability: 'immunity', moves: ['earthquake'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Kecleon", ability: 'colorchange', moves: ['roost'] }, + { species: "Venusaur", ability: 'chlorophyll', moves: ['earthquake'] }, + ] }); let hitCount = 0; battle.p2.active[0].damage = function (...args) { @@ -70,10 +70,10 @@ describe('Roost', function () { assert.equal(hitCount, 3); }); - it('should treat a pure Flying pokémon as Normal type', function () { + it('should treat a pure Flying pokémon as Normal type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Tornadus", item: 'focussash', ability: 'prankster', moves: ['roost']}]}); - battle.setPlayer('p2', {team: [{species: "Gastly", item: 'laggingtail', ability: 'levitate', moves: ['astonish', 'trickortreat']}]}); + battle.setPlayer('p1', { team: [{ species: "Tornadus", item: 'focussash', ability: 'prankster', moves: ['roost'] }] }); + battle.setPlayer('p2', { team: [{ species: "Gastly", item: 'laggingtail', ability: 'levitate', moves: ['astonish', 'trickortreat'] }] }); battle.makeChoices('move roost', 'move astonish'); battle.makeChoices('move roost', 'move astonish'); assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); // Immune to Astonish @@ -85,11 +85,11 @@ describe('Roost', function () { assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp); // Immune to Astonish }); - it('should not remove Flying type during Terastallization', function () { + it('should not remove Flying type during Terastallization', () => { battle = common.gen(9).createBattle([[ - {species: "Dudunsparce", ability: "runaway", moves: ['sleeptalk', 'roost'], teraType: "Flying"}, + { species: "Dudunsparce", ability: "runaway", moves: ['sleeptalk', 'roost'], teraType: "Flying" }, ], [ - {species: "Chansey", ability: "naturalcure", moves: ['earthquake']}, + { species: "Chansey", ability: "naturalcure", moves: ['earthquake'] }, ]]); battle.makeChoices(); battle.makeChoices('move roost terastallize', 'auto'); @@ -97,15 +97,15 @@ describe('Roost', function () { }); }); -describe('Roost - DPP', function () { - afterEach(function () { +describe('Roost - DPP', () => { + afterEach(() => { battle.destroy(); }); - it('should treat a pure Flying pokémon as `???` type', function () { + it('should treat a pure Flying pokémon as `???` type', () => { battle = common.gen(4).createBattle([ - [{species: "Arceus-Flying", item: 'skyplate', ability: 'multitype', moves: ['roost']}], - [{species: "Gastly", item: 'laggingtail', ability: 'levitate', moves: ['astonish', 'earthpower']}], + [{ species: "Arceus-Flying", item: 'skyplate', ability: 'multitype', moves: ['roost'] }], + [{ species: "Gastly", item: 'laggingtail', ability: 'levitate', moves: ['astonish', 'earthpower'] }], ]); battle.makeChoices('move roost', 'move astonish'); diff --git a/test/sim/moves/round.js b/test/sim/moves/round.js index ed4e6620b2..64f76d7cec 100644 --- a/test/sim/moves/round.js +++ b/test/sim/moves/round.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Round', function () { - afterEach(function () { +describe('Round', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'round']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'round'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move round', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); }); -describe('Round [Gen 5]', function () { - afterEach(function () { +describe('Round [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'round']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'round'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move splash', 'move substitute'); diff --git a/test/sim/moves/shedtail.js b/test/sim/moves/shedtail.js index 79f4a10349..a53adee468 100644 --- a/test/sim/moves/shedtail.js +++ b/test/sim/moves/shedtail.js @@ -12,10 +12,10 @@ describe('Shed Tail', () => { it("should make the user switch out and pass a Substitute", () => { battle = common.createBattle([[ - {species: 'Cyclizar', ability: 'shedskin', moves: ['shedtail']}, - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, + { species: 'Cyclizar', ability: 'shedskin', moves: ['shedtail'] }, + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, ], [ - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, ]]); battle.makeChoices(); assert.equal(battle.requestState, 'switch'); @@ -25,9 +25,9 @@ describe('Shed Tail', () => { it("should fail (and not set Substitute) if the user has no teammates", () => { battle = common.createBattle([[ - {species: 'Cyclizar', ability: 'shedskin', moves: ['shedtail']}, + { species: 'Cyclizar', ability: 'shedskin', moves: ['shedtail'] }, ], [ - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, ]]); battle.makeChoices(); assert.false(battle.p1.active[0].volatiles['substitute']); diff --git a/test/sim/moves/sheercold.js b/test/sim/moves/sheercold.js index ddf4921137..2b7f079623 100644 --- a/test/sim/moves/sheercold.js +++ b/test/sim/moves/sheercold.js @@ -5,30 +5,30 @@ const common = require('./../../common'); let battle; -describe('Sheer Cold', function () { - afterEach(function () { +describe('Sheer Cold', () => { + afterEach(() => { battle.destroy(); }); - it('should not affect Ice-type Pokémon', function () { + it('should not affect Ice-type Pokémon', () => { battle = common.createBattle([ - [{species: "Deoxys-Speed", ability: 'noguard', moves: ['sheercold']}], - [{species: "Arceus-Ice", item: 'icicleplate', ability: 'multitype', moves: ['calmmind']}], + [{ species: "Deoxys-Speed", ability: 'noguard', moves: ['sheercold'] }], + [{ species: "Arceus-Ice", item: 'icicleplate', ability: 'multitype', moves: ['calmmind'] }], ]); battle.makeChoices('move sheercold', 'move calmmind'); assert.false.fainted(battle.p2.active[0]); }); }); -describe('Sheer Cold [Gen 6]', function () { - afterEach(function () { +describe('Sheer Cold [Gen 6]', () => { + afterEach(() => { battle.destroy(); }); - it('should affect Ice-type Pokémon', function () { + it('should affect Ice-type Pokémon', () => { battle = common.gen(6).createBattle([ - [{species: "Deoxys-Speed", ability: 'noguard', moves: ['sheercold']}], - [{species: "Arceus-Ice", item: 'icicleplate', ability: 'multitype', moves: ['calmmind']}], + [{ species: "Deoxys-Speed", ability: 'noguard', moves: ['sheercold'] }], + [{ species: "Arceus-Ice", item: 'icicleplate', ability: 'multitype', moves: ['calmmind'] }], ]); battle.makeChoices('move sheercold', 'move calmmind'); assert.fainted(battle.p2.active[0]); diff --git a/test/sim/moves/shelltrap.js b/test/sim/moves/shelltrap.js index 782cf54c2d..f75f2ddf5b 100644 --- a/test/sim/moves/shelltrap.js +++ b/test/sim/moves/shelltrap.js @@ -5,20 +5,20 @@ const common = require('./../../common'); let battle; -describe('Shell Trap', function () { - afterEach(function () { +describe('Shell Trap', () => { + afterEach(() => { battle.destroy(); }); - it('should deduct PP regardless if it was successful', function () { - battle = common.createBattle({gameType: 'doubles'}, [ + it('should deduct PP regardless if it was successful', () => { + battle = common.createBattle({ gameType: 'doubles' }, [ [ - {species: 'Turtonator', ability: 'shellarmor', moves: ['shelltrap']}, - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, + { species: 'Turtonator', ability: 'shellarmor', moves: ['shelltrap'] }, + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, ], [ - {species: 'Turtonator', ability: 'shellarmor', moves: ['tackle', 'irondefense']}, - {species: 'Magikarp', ability: 'swiftswim', moves: ['splash']}, + { species: 'Turtonator', ability: 'shellarmor', moves: ['tackle', 'irondefense'] }, + { species: 'Magikarp', ability: 'swiftswim', moves: ['splash'] }, ], ]); @@ -33,19 +33,19 @@ describe('Shell Trap', function () { assert.equal(move.pp, move.maxpp - 2); }); - it('should not Z-power if hit by a Z-move', function () { + it('should not Z-power if hit by a Z-move', () => { battle = common.createBattle({}, [ - [{species: 'Turtonator', moves: ['shelltrap']}], - [{species: 'Magikarp', item: 'normaliumz', moves: ['flail']}], + [{ species: 'Turtonator', moves: ['shelltrap'] }], + [{ species: 'Magikarp', item: 'normaliumz', moves: ['flail'] }], ]); battle.makeChoices('move shelltrap', 'move flail zmove'); assert(battle.log.some(line => line.includes('|Shell Trap|'))); }); - it('should not Max if hit by a Max move', function () { + it('should not Max if hit by a Max move', () => { battle = common.gen(8).createBattle({}, [ - [{species: 'Turtonator', moves: ['shelltrap']}], - [{species: 'Magikarp', moves: ['flail']}], + [{ species: 'Turtonator', moves: ['shelltrap'] }], + [{ species: 'Magikarp', moves: ['flail'] }], ]); battle.makeChoices('move shelltrap', 'move flail dynamax'); assert(battle.log.some(line => line.includes('|Shell Trap|'))); diff --git a/test/sim/moves/skillswap.js b/test/sim/moves/skillswap.js index 08ebc06e56..cbe4a2df46 100644 --- a/test/sim/moves/skillswap.js +++ b/test/sim/moves/skillswap.js @@ -5,20 +5,20 @@ const common = require('./../../common'); let battle; -describe('Skill Swap', function () { - afterEach(function () { +describe('Skill Swap', () => { + afterEach(() => { battle.destroy(); }); - it('should not be able to Skill Swap certain abilities', function () { + it('should not be able to Skill Swap certain abilities', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'moxie', moves: ['skillswap', 'sleeptalk']}, - {species: 'wynaut', ability: 'schooling', moves: ['skillswap']}, - {species: 'wynaut', ability: 'wonderguard', moves: ['skillswap']}, + { species: 'wynaut', ability: 'moxie', moves: ['skillswap', 'sleeptalk'] }, + { species: 'wynaut', ability: 'schooling', moves: ['skillswap'] }, + { species: 'wynaut', ability: 'wonderguard', moves: ['skillswap'] }, ], [ - {species: 'ferroseed', ability: 'overcoat', moves: ['skillswap', 'sleeptalk']}, - {species: 'ferroseed', ability: 'schooling', moves: ['skillswap']}, - {species: 'ferroseed', ability: 'wonderguard', moves: ['skillswap']}, + { species: 'ferroseed', ability: 'overcoat', moves: ['skillswap', 'sleeptalk'] }, + { species: 'ferroseed', ability: 'schooling', moves: ['skillswap'] }, + { species: 'ferroseed', ability: 'wonderguard', moves: ['skillswap'] }, ]]); let wynaut = battle.p1.active[0]; diff --git a/test/sim/moves/skydrop.js b/test/sim/moves/skydrop.js index 337f39b0ce..700411b7f2 100644 --- a/test/sim/moves/skydrop.js +++ b/test/sim/moves/skydrop.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Sky Drop', function () { - afterEach(function () { +describe('Sky Drop', () => { + afterEach(() => { battle.destroy(); }); - it(`should prevent its target from moving when it is caught by the effect`, function () { + it(`should prevent its target from moving when it is caught by the effect`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Lairon', moves: ['tackle']}, + { species: 'Lairon', moves: ['tackle'] }, ]]); const aerodactyl = battle.p1.active[0]; @@ -24,27 +24,27 @@ describe('Sky Drop', function () { assert.false.fullHP(aerodactyl); }); - it(`should prevent its target from switching out when it is caught by the effect`, function () { + it(`should prevent its target from switching out when it is caught by the effect`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Lairon', moves: ['tackle']}, - {species: 'Aggron', moves: ['tackle']}, + { species: 'Lairon', moves: ['tackle'] }, + { species: 'Aggron', moves: ['tackle'] }, ]]); battle.makeChoices(); assert.trapped(() => battle.makeChoices('auto', 'switch aggron')); }); - it(`should prevent both the user and the target from being forced out when caught by the effect`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['skydrop']}, - {species: 'Machamp', ability: 'noguard', moves: ['circlethrow']}, - {species: 'Kabutops', moves: ['sleeptalk']}, + it(`should prevent both the user and the target from being forced out when caught by the effect`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['skydrop'] }, + { species: 'Machamp', ability: 'noguard', moves: ['circlethrow'] }, + { species: 'Kabutops', moves: ['sleeptalk'] }, ], [ - {species: 'Armaldo', moves: ['sleeptalk']}, - {species: 'Aggron', ability: 'noguard', moves: ['dragontail']}, - {species: 'Omastar', moves: ['sleeptalk']}, + { species: 'Armaldo', moves: ['sleeptalk'] }, + { species: 'Aggron', ability: 'noguard', moves: ['dragontail'] }, + { species: 'Omastar', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move skydrop 1, move circlethrow 1', 'move sleeptalk, move dragontail 1'); @@ -52,15 +52,15 @@ describe('Sky Drop', function () { assert.species(battle.p2.active[0], 'Armaldo'); }); - it(`should prevent both the user and the target from being forced out by Eject Button`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', item: 'ejectbutton', moves: ['skydrop']}, - {species: 'Machamp', ability: 'noguard', moves: ['tackle']}, - {species: 'Kabutops', moves: ['sleeptalk']}, + it(`should prevent both the user and the target from being forced out by Eject Button`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', item: 'ejectbutton', moves: ['skydrop'] }, + { species: 'Machamp', ability: 'noguard', moves: ['tackle'] }, + { species: 'Kabutops', moves: ['sleeptalk'] }, ], [ - {species: 'Armaldo', item: 'ejectbutton', moves: ['sleeptalk']}, - {species: 'Aggron', ability: 'noguard', moves: ['watergun']}, - {species: 'Omastar', moves: ['sleeptalk']}, + { species: 'Armaldo', item: 'ejectbutton', moves: ['sleeptalk'] }, + { species: 'Aggron', ability: 'noguard', moves: ['watergun'] }, + { species: 'Omastar', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move skydrop 1, move tackle 1', 'move sleeptalk, move watergun 1'); @@ -68,22 +68,22 @@ describe('Sky Drop', function () { assert.holdsItem(battle.p2.active[0]); }); - it(`should prevent its target from using Mega Evolution when it is caught by the effect`, function () { + it(`should prevent its target from using Mega Evolution when it is caught by the effect`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Manectric', item: 'manectite', moves: ['charge']}, + { species: 'Manectric', item: 'manectite', moves: ['charge'] }, ]]); battle.makeChoices(); battle.makeChoices('auto', 'move charge mega'); assert.false.species(battle.p2.active[0], 'Manectric-Mega'); }); - it(`should prevent its target from activating Stance Change when it is caught by the effect`, function () { + it(`should prevent its target from activating Stance Change when it is caught by the effect`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Aegislash', ability: 'stancechange', moves: ['tackle', 'kingsshield']}, + { species: 'Aegislash', ability: 'stancechange', moves: ['tackle', 'kingsshield'] }, ]]); const aegi = battle.p2.active[0]; @@ -96,13 +96,13 @@ describe('Sky Drop', function () { assert.species(aegi, 'Aegislash-Blade'); }); - it(`should free its target and allow it to move if the user faints`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['skydrop']}, - {species: 'Kyogre', ability: 'noguard', moves: ['sheercold']}, + it(`should free its target and allow it to move if the user faints`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['skydrop'] }, + { species: 'Kyogre', ability: 'noguard', moves: ['sheercold'] }, ], [ - {species: 'Lairon', moves: ['swordsdance']}, - {species: 'Aggron', moves: ['sleeptalk']}, + { species: 'Lairon', moves: ['swordsdance'] }, + { species: 'Aggron', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move skydrop 1, move sheercold -1', 'auto'); @@ -110,11 +110,11 @@ describe('Sky Drop', function () { assert.statStage(lairon, 'atk', 2); }); - it(`should pick up Flying-type Pokemon but do no damage`, function () { + it(`should pick up Flying-type Pokemon but do no damage`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Salamence', moves: ['tackle']}, + { species: 'Salamence', moves: ['tackle'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p1.active[0]); @@ -122,12 +122,12 @@ describe('Sky Drop', function () { assert.fullHP(battle.p2.active[0]); }); - it(`should pick up non-Flying weak Wonder Guard Pokemon but do no damage`, function () { + it(`should pick up non-Flying weak Wonder Guard Pokemon but do no damage`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Shuckle', ability: 'wonderguard', moves: ['tackle']}, - {species: 'Shedinja', ability: 'wonderguard', moves: ['sleeptalk']}, + { species: 'Shuckle', ability: 'wonderguard', moves: ['tackle'] }, + { species: 'Shedinja', ability: 'wonderguard', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -139,12 +139,12 @@ describe('Sky Drop', function () { assert.hurts(shedinja, () => battle.makeChoices()); }); - it(`should only make contact on the way down`, function () { + it(`should only make contact on the way down`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Aegislash', moves: ['kingsshield']}, - {species: 'Ferrothorn', ability: 'ironbarbs', moves: ['sleeptalk']}, + { species: 'Aegislash', moves: ['kingsshield'] }, + { species: 'Ferrothorn', ability: 'ironbarbs', moves: ['sleeptalk'] }, ]]); const aerodactyl = battle.p1.active[0]; battle.makeChoices(); @@ -155,47 +155,47 @@ describe('Sky Drop', function () { assert.false.fullHP(aerodactyl); }); - it(`should fail if the target has a Substitute`, function () { + it(`should fail if the target has a Substitute`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['sleeptalk', 'skydrop']}, + { species: 'Aerodactyl', moves: ['sleeptalk', 'skydrop'] }, ], [ - {species: 'Lairon', moves: ['substitute', 'tackle']}, + { species: 'Lairon', moves: ['substitute', 'tackle'] }, ]]); battle.makeChoices(); battle.makeChoices('move skydrop', 'move tackle'); assert.false.fullHP(battle.p1.active[0]); }); - it(`should fail if the target is heavier than 200kg`, function () { + it(`should fail if the target is heavier than 200kg`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Aggron', moves: ['tackle']}, + { species: 'Aggron', moves: ['tackle'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p1.active[0]); }); - it(`should fail if used against an ally`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['skydrop']}, - {species: 'Smeargle', moves: ['spore']}, + it(`should fail if used against an ally`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['skydrop'] }, + { species: 'Smeargle', moves: ['spore'] }, ], [ - {species: 'Lairon', moves: ['sleeptalk']}, - {species: 'Aggron', moves: ['sleeptalk']}, + { species: 'Lairon', moves: ['sleeptalk'] }, + { species: 'Aggron', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move skydrop -2, move spore 1', 'auto'); assert.equal(battle.p2.active[0].status, 'slp'); }); - it(`should hit its picked-up target even if its position changed with Ally Switch`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['skydrop']}, - {species: 'Smeargle', moves: ['sleeptalk']}, + it(`should hit its picked-up target even if its position changed with Ally Switch`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['skydrop'] }, + { species: 'Smeargle', moves: ['sleeptalk'] }, ], [ - {species: 'Lairon', moves: ['sleeptalk']}, - {species: 'Aggron', moves: ['sleeptalk', 'allyswitch']}, + { species: 'Lairon', moves: ['sleeptalk'] }, + { species: 'Aggron', moves: ['sleeptalk', 'allyswitch'] }, ]]); battle.makeChoices('move skydrop 1, move sleeptalk', 'auto'); battle.makeChoices('move skydrop 1, move sleeptalk', 'move sleeptalk, move allyswitch'); @@ -204,13 +204,13 @@ describe('Sky Drop', function () { assert.false.fullHP(lairon); }); - it(`should hit its target even if Follow Me would have otherwise redirected it`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['skydrop']}, - {species: 'Smeargle', moves: ['sleeptalk']}, + it(`should hit its target even if Follow Me would have otherwise redirected it`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['skydrop'] }, + { species: 'Smeargle', moves: ['sleeptalk'] }, ], [ - {species: 'Lairon', moves: ['sleeptalk']}, - {species: 'Clamperl', moves: ['followme']}, + { species: 'Lairon', moves: ['sleeptalk'] }, + { species: 'Clamperl', moves: ['followme'] }, ]]); battle.makeChoices('move skydrop 1, move sleeptalk', 'auto'); @@ -219,13 +219,13 @@ describe('Sky Drop', function () { assert.fullHP(battle.p2.active[1]); }); - it(`should cause most moves aimed at the user or target to miss`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['skydrop']}, - {species: 'Kabutops', moves: ['sleeptalk', 'aquajet']}, + it(`should cause most moves aimed at the user or target to miss`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['skydrop'] }, + { species: 'Kabutops', moves: ['sleeptalk', 'aquajet'] }, ], [ - {species: 'Charizard', moves: ['sleeptalk']}, - {species: 'Azumarill', moves: ['sleeptalk', 'aquajet']}, + { species: 'Charizard', moves: ['sleeptalk'] }, + { species: 'Azumarill', moves: ['sleeptalk', 'aquajet'] }, ]]); battle.makeChoices('move skydrop 1, move sleeptalk', 'auto'); @@ -234,34 +234,34 @@ describe('Sky Drop', function () { assert.fullHP(battle.p2.active[0]); }); - it(`should be canceled by Gravity and allow the target to use its move`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['skydrop']}, - {species: 'Jirachi', moves: ['gravity']}, + it(`should be canceled by Gravity and allow the target to use its move`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['skydrop'] }, + { species: 'Jirachi', moves: ['gravity'] }, ], [ - {species: 'Lairon', moves: ['swordsdance']}, - {species: 'Clamperl', moves: ['sleeptalk']}, + { species: 'Lairon', moves: ['swordsdance'] }, + { species: 'Clamperl', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'atk', 2); }); - it(`should not suppress Speed Boost`, function () { + it(`should not suppress Speed Boost`, () => { battle = common.createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Mew', ability: 'speedboost', moves: ['splash']}, + { species: 'Mew', ability: 'speedboost', moves: ['splash'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'spe', 1); }); - it(`should not claim to have dropped a Pokemon if it is already fainted`, function () { + it(`should not claim to have dropped a Pokemon if it is already fainted`, () => { battle = common.createBattle([[ - {species: 'Shedinja', item: 'stickybarb', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Shedinja', item: 'stickybarb', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ]]); battle.makeChoices(); @@ -271,38 +271,38 @@ describe('Sky Drop', function () { }); }); -describe('Sky Drop [Gen 5]', function () { - afterEach(function () { +describe('Sky Drop [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it(`should not fail even if the target is heavier than 200kg`, function () { + it(`should not fail even if the target is heavier than 200kg`, () => { battle = common.gen(5).createBattle([[ - {species: 'Aerodactyl', moves: ['skydrop']}, + { species: 'Aerodactyl', moves: ['skydrop'] }, ], [ - {species: 'Aggron', moves: ['tackle']}, + { species: 'Aggron', moves: ['tackle'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p1.active[0]); }); - describe.skip(`Sky Drop Glitch`, function () { - beforeEach(function () { - battle = common.gen(5).createBattle({gameType: 'doubles'}, [[ - {species: 'Aerodactyl', moves: ['rockpolish', 'skydrop', 'dig']}, - {species: 'Alakazam', moves: ['recover', 'gravity']}, - {species: 'Aggron', moves: ['rest']}, + describe.skip(`Sky Drop Glitch`, () => { + beforeEach(() => { + battle = common.gen(5).createBattle({ gameType: 'doubles' }, [[ + { species: 'Aerodactyl', moves: ['rockpolish', 'skydrop', 'dig'] }, + { species: 'Alakazam', moves: ['recover', 'gravity'] }, + { species: 'Aggron', moves: ['rest'] }, ], [ - {species: 'Magikarp', moves: ['sleeptalk', 'tackle']}, - {species: 'Deoxys-Attack', ability: 'sturdy', moves: ['nastyplot', 'thunderbolt', 'roar']}, - {species: 'Azurill', ability: 'thickfat', moves: ['watersport']}, + { species: 'Magikarp', moves: ['sleeptalk', 'tackle'] }, + { species: 'Deoxys-Attack', ability: 'sturdy', moves: ['nastyplot', 'thunderbolt', 'roar'] }, + { species: 'Azurill', ability: 'thickfat', moves: ['watersport'] }, ]]); console.log('-------------------------------'); battle.makeChoices('move skydrop 1, move gravity', 'move sleeptalk, move nastyplot'); // Magikarp should now be stuck because of the Sky Drop glitch. }); - it(`should prevent the target from moving or switching`, function () { + it(`should prevent the target from moving or switching`, () => { const alakazam = battle.p1.active[1]; const magikarp = battle.p2.active[0]; battle.makeChoices('move rockpolish, move recover', 'move tackle 2, move nastyplot'); @@ -311,25 +311,25 @@ describe('Sky Drop [Gen 5]', function () { assert.species(magikarp, 'Magikarp'); }); - it(`should prevent the user from being forced out`, function () { + it(`should prevent the user from being forced out`, () => { const aerodactyl = battle.p1.active[0]; battle.makeChoices('move rockpolish, move recover', 'move sleeptalk, move roar 1'); assert.species(aerodactyl, 'Aerodactyl'); }); - it(`should end when the user switches out`, function () { + it(`should end when the user switches out`, () => { const alakazam = battle.p1.active[1]; battle.makeChoices('switch 3, move recover', 'move tackle 2, move nastyplot'); assert.false.fullHP(alakazam); }); - it(`should end when the user faints`, function () { + it(`should end when the user faints`, () => { const alakazam = battle.p1.active[1]; battle.makeChoices('move rockpolish, move recover', 'move tackle 2, move thunderbolt 1'); assert.false.fullHP(alakazam); }); - it(`should end when the user completes another two-turn move`, function () { + it(`should end when the user completes another two-turn move`, () => { const alakazam = battle.p1.active[1]; battle.makeChoices('move dig 2, move recover', 'move sleeptalk, move nastyplot'); battle.makeChoices('move dig 2, move recover', 'move sleeptalk, move nastyplot'); diff --git a/test/sim/moves/sleeptalk.js b/test/sim/moves/sleeptalk.js index a7d9bedd7f..1550c2b9fc 100644 --- a/test/sim/moves/sleeptalk.js +++ b/test/sim/moves/sleeptalk.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Sleep Talk', function () { - afterEach(function () { +describe('Sleep Talk', () => { + afterEach(() => { battle.destroy(); }); - it('should run conditions for submove', function () { + it('should run conditions for submove', () => { battle = common.createBattle([[ - {species: 'snorlax', ability: 'noguard', moves: ['sleeptalk', 'highjumpkick']}, + { species: 'snorlax', ability: 'noguard', moves: ['sleeptalk', 'highjumpkick'] }, ], [ - {species: 'breloom', moves: ['spore', 'gravity']}, + { species: 'breloom', moves: ['spore', 'gravity'] }, ]]); battle.makeChoices('move sleeptalk', 'move gravity'); battle.makeChoices('move sleeptalk', 'move spore'); @@ -22,11 +22,11 @@ describe('Sleep Talk', function () { assert(battle.log[battle.lastMoveLine + 1].startsWith('|cant'), 'should log that High Jump Kick failed'); }); - it('should fail and lose PP on subsequent turns while Choice locked, prior to Gen 5', function () { + it('should fail and lose PP on subsequent turns while Choice locked, prior to Gen 5', () => { battle = common.gen(4).createBattle([[ - {species: 'Breloom', moves: ['spore', 'snore']}, + { species: 'Breloom', moves: ['spore', 'snore'] }, ], [ - {species: 'Chansey', item: 'choiceband', moves: ['sleeptalk', 'pound']}, + { species: 'Chansey', item: 'choiceband', moves: ['sleeptalk', 'pound'] }, ]]); const breloom = battle.p1.active[0]; const chansey = battle.p2.active[0]; diff --git a/test/sim/moves/smellingsalts.js b/test/sim/moves/smellingsalts.js index 819ddebe25..4f5fb6914a 100644 --- a/test/sim/moves/smellingsalts.js +++ b/test/sim/moves/smellingsalts.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Smelling Salts', function () { - afterEach(function () { +describe('Smelling Salts', () => { + afterEach(() => { battle.destroy(); }); - it('should cure a paralyzed target', function () { + it('should cure a paralyzed target', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Meloetta", ability: 'serenegrace', moves: ['smellingsalts', 'thunderwave']}]}); - battle.setPlayer('p2', {team: [{species: "Dragonite", ability: 'multiscale', moves: ['roost']}]}); + battle.setPlayer('p1', { team: [{ species: "Meloetta", ability: 'serenegrace', moves: ['smellingsalts', 'thunderwave'] }] }); + battle.setPlayer('p2', { team: [{ species: "Dragonite", ability: 'multiscale', moves: ['roost'] }] }); battle.makeChoices('move thunderwave', 'move roost'); battle.makeChoices('move smellingsalts', 'move roost'); assert.notEqual(battle.p2.active[0].status, 'par'); diff --git a/test/sim/moves/snarl.js b/test/sim/moves/snarl.js index b974209941..403a388135 100644 --- a/test/sim/moves/snarl.js +++ b/test/sim/moves/snarl.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Snarl', function () { - afterEach(function () { +describe('Snarl', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'snarl']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'snarl'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move Splash', 'move Substitute'); battle.makeChoices('move Snarl', 'move Rest'); @@ -22,15 +22,15 @@ describe('Snarl', function () { }); }); -describe('Snarl [Gen 5]', function () { - afterEach(function () { +describe('Snarl [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'snarl']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'snarl'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move Splash', 'move Substitute'); diff --git a/test/sim/moves/snatch.js b/test/sim/moves/snatch.js index 531be25f2f..eb2bf47804 100644 --- a/test/sim/moves/snatch.js +++ b/test/sim/moves/snatch.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Snatch', function () { - afterEach(function () { +describe('Snatch', () => { + afterEach(() => { battle.destroy(); }); - it('should cause the victim of Snatch to change typing with Protean rather than the Snatch user', function () { + it('should cause the victim of Snatch to change typing with Protean rather than the Snatch user', () => { battle = common.createBattle([[ - {species: 'wynaut', ability: 'protean', moves: ['snatch']}, + { species: 'wynaut', ability: 'protean', moves: ['snatch'] }, ], [ - {species: 'dratini', ability: 'protean', moves: ['howl']}, + { species: 'dratini', ability: 'protean', moves: ['howl'] }, ]]); const wynaut = battle.p1.active[0]; @@ -25,13 +25,13 @@ describe('Snatch', function () { assert(dratini.hasType('Normal')); }); - it('should not Choice lock the user from the snatched move', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['snatch', 'howl']}, - {species: 'accelgor', item: 'choicescarf', moves: ['trick']}, + it('should not Choice lock the user from the snatched move', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['snatch', 'howl'] }, + { species: 'accelgor', item: 'choicescarf', moves: ['trick'] }, ], [ - {species: 'dratini', moves: ['howl']}, - {species: 'luvdisc', moves: ['sleeptalk']}, + { species: 'dratini', moves: ['howl'] }, + { species: 'luvdisc', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move snatch, move trick -1', 'auto'); @@ -40,13 +40,13 @@ describe('Snatch', function () { battle.makeChoices('move snatch, move trick 1', 'auto'); }); - it('should not be able to steal Rest when the Rest user is at full HP', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['snatch']}, - {species: 'accelgor', moves: ['rest']}, + it('should not be able to steal Rest when the Rest user is at full HP', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['snatch'] }, + { species: 'accelgor', moves: ['rest'] }, ], [ - {species: 'dratini', moves: ['howl']}, - {species: 'luvdisc', moves: ['quickattack']}, + { species: 'dratini', moves: ['howl'] }, + { species: 'luvdisc', moves: ['quickattack'] }, ]]); const wynaut = battle.p1.active[0]; @@ -55,13 +55,13 @@ describe('Snatch', function () { assert.statStage(wynaut, 'atk', 1); }); - it('should Snatch moves and run Throat Chop and Heal Block checks', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'porygon2', moves: ['sleeptalk', 'howl']}, - {species: 'weavile', moves: ['toxicthread', 'sleeptalk', 'snatch']}, + it('should Snatch moves and run Throat Chop and Heal Block checks', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'porygon2', moves: ['sleeptalk', 'howl'] }, + { species: 'weavile', moves: ['toxicthread', 'sleeptalk', 'snatch'] }, ], [ - {species: 'mew', item: 'powerherb', moves: ['throatchop', 'toxicthread', 'sleeptalk', 'healblock']}, - {species: 'skitty', ability: 'intrepidsword', moves: ['throatchop', 'healbell', 'recover']}, + { species: 'mew', item: 'powerherb', moves: ['throatchop', 'toxicthread', 'sleeptalk', 'healblock'] }, + { species: 'skitty', ability: 'intrepidsword', moves: ['throatchop', 'healbell', 'recover'] }, ]]); battle.makeChoices('move sleeptalk, move toxicthread 2', 'move throatchop 1, move throatchop 2'); @@ -78,12 +78,12 @@ describe('Snatch', function () { }); it('should not snatch Swallow if the Swallow user has no Stockpiles', () => { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'mandibuzz', moves: ['snatch']}, - {species: 'accelgor', moves: ['swallow']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'mandibuzz', moves: ['snatch'] }, + { species: 'accelgor', moves: ['swallow'] }, ], [ - {species: 'surskit', moves: ['quickattack']}, - {species: 'wingull', moves: ['quickattack']}, + { species: 'surskit', moves: ['quickattack'] }, + { species: 'wingull', moves: ['quickattack'] }, ]]); battle.makeChoices('auto', 'move quickattack 1, move quickattack 2'); @@ -94,9 +94,9 @@ describe('Snatch', function () { it('Snatched Swallow should heal the snatcher by 25% if the snatcher has no Stockpiles', () => { battle = common.createBattle([[ - {species: 'clefable', moves: ['sleeptalk', 'bellydrum', 'snatch']}, + { species: 'clefable', moves: ['sleeptalk', 'bellydrum', 'snatch'] }, ], [ - {species: 'dewgong', moves: ['stockpile', 'swallow']}, + { species: 'dewgong', moves: ['stockpile', 'swallow'] }, ]]); battle.makeChoices('move bellydrum', 'auto'); battle.makeChoices(); @@ -106,29 +106,29 @@ describe('Snatch', function () { }); }); -describe('Snatch [Gen 4]', function () { - afterEach(function () { +describe('Snatch [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should Snatch moves that were called by another user of Snatch', function () { - battle = common.gen(4).createBattle({gameType: 'doubles'}, [[ - {species: 'weavile', moves: ['snatch']}, - {species: 'wynaut', moves: ['howl']}, + it('should Snatch moves that were called by another user of Snatch', () => { + battle = common.gen(4).createBattle({ gameType: 'doubles' }, [[ + { species: 'weavile', moves: ['snatch'] }, + { species: 'wynaut', moves: ['howl'] }, ], [ - {species: 'alakazam', moves: ['snatch']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'alakazam', moves: ['snatch'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'atk', 1); }); - it.skip(`should only deduct additional PP from Snatch if the Snatch was successful`, function () { + it.skip(`should only deduct additional PP from Snatch if the Snatch was successful`, () => { battle = common.gen(4).createBattle([[ - {species: 'Palkia', ability: 'pressure', moves: ['watergun', 'calmmind']}, + { species: 'Palkia', ability: 'pressure', moves: ['watergun', 'calmmind'] }, ], [ - {species: 'Dialga', moves: ['snatch']}, + { species: 'Dialga', moves: ['snatch'] }, ]]); battle.makeChoices(); const move = battle.p2.active[0].getMoveData(Dex.moves.get('snatch')); diff --git a/test/sim/moves/sparklingaria.js b/test/sim/moves/sparklingaria.js index 9c3a848263..945034e370 100644 --- a/test/sim/moves/sparklingaria.js +++ b/test/sim/moves/sparklingaria.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Sparkling Aria', function () { - afterEach(function () { +describe('Sparkling Aria', () => { + afterEach(() => { battle.destroy(); }); - it(`should cure the target's burn`, function () { + it(`should cure the target's burn`, () => { battle = common.createBattle([[ - {species: 'Wynaut', ability: 'compoundeyes', moves: ['will-o-wisp', 'sparklingaria']}, + { species: 'Wynaut', ability: 'compoundeyes', moves: ['will-o-wisp', 'sparklingaria'] }, ], [ - {species: 'Chansey', moves: ['sleeptalk']}, + { species: 'Chansey', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -22,14 +22,14 @@ describe('Sparkling Aria', function () { assert.equal(battle.p2.active[0].status, ''); }); - it(`should not cure the target's burn if the user fainted`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Shedinja', moves: ['sparklingaria']}, - {species: 'Wynaut', level: 1, ability: 'innardsout', moves: ['sleeptalk']}, - {species: 'Wynaut', moves: ['sleeptalk']}, + it(`should not cure the target's burn if the user fainted`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Shedinja', moves: ['sparklingaria'] }, + { species: 'Wynaut', level: 1, ability: 'innardsout', moves: ['sleeptalk'] }, + { species: 'Wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'Chansey', moves: ['sleeptalk']}, - {species: 'Gengar', ability: 'compoundeyes', moves: ['willowisp']}, + { species: 'Chansey', moves: ['sleeptalk'] }, + { species: 'Gengar', ability: 'compoundeyes', moves: ['willowisp'] }, ]]); battle.makeChoices('auto', 'move sleeptalk, move willowisp -1'); diff --git a/test/sim/moves/spectralthief.js b/test/sim/moves/spectralthief.js index 51c5a06fa2..074dccb3a2 100644 --- a/test/sim/moves/spectralthief.js +++ b/test/sim/moves/spectralthief.js @@ -5,13 +5,13 @@ const common = require('./../../common'); let battle; -describe(`Spectral Thief`, function () { +describe(`Spectral Thief`, () => { afterEach(() => battle.destroy()); - it(`should steal the target's boosts before hitting`, function () { + it(`should steal the target's boosts before hitting`, () => { battle = common.createBattle([ - [{species: "Smeargle", ability: 'technician', moves: ['calmmind', 'spectralthief']}], - [{species: "Litten", ability: 'intimidate', item: 'focussash', moves: ['swordsdance', 'roar']}], + [{ species: "Smeargle", ability: 'technician', moves: ['calmmind', 'spectralthief'] }], + [{ species: "Litten", ability: 'intimidate', item: 'focussash', moves: ['swordsdance', 'roar'] }], ]); const [thief, victim] = battle.sides.map(s => s.active[0]); @@ -31,10 +31,10 @@ describe(`Spectral Thief`, function () { assert.atLeast(victim.maxhp - victim.hp, 3 * minusOneDmg); }); - it(`should double the boosts if the user has Simple`, function () { + it(`should double the boosts if the user has Simple`, () => { battle = common.createBattle([ - [{species: "Smeargle", ability: 'simple', moves: ['calmmind', 'spectralthief']}], - [{species: "Mew", ability: 'pressure', moves: ['swordsdance', 'roar']}], + [{ species: "Smeargle", ability: 'simple', moves: ['calmmind', 'spectralthief'] }], + [{ species: "Mew", ability: 'pressure', moves: ['swordsdance', 'roar'] }], ]); const [thief, victim] = battle.sides.map(s => s.active[0]); @@ -47,10 +47,10 @@ describe(`Spectral Thief`, function () { assert.statStage(victim, 'atk', 0); }); - it(`should only steal boosts once if the user has Parental Bond`, function () { + it(`should only steal boosts once if the user has Parental Bond`, () => { battle = common.createBattle([ - [{species: "Smeargle", ability: 'parentalbond', moves: ['calmmind', 'spectralthief']}], - [{species: "Mew", ability: 'pressure', item: 'weaknesspolicy', moves: ['swordsdance', 'roar']}], + [{ species: "Smeargle", ability: 'parentalbond', moves: ['calmmind', 'spectralthief'] }], + [{ species: "Mew", ability: 'pressure', item: 'weaknesspolicy', moves: ['swordsdance', 'roar'] }], ]); const [thief, victim] = battle.sides.map(s => s.active[0]); @@ -64,10 +64,10 @@ describe(`Spectral Thief`, function () { assert.statStage(victim, 'atk', 2); }); - it(`should not steal boosts if the target is immune to the hit`, function () { + it(`should not steal boosts if the target is immune to the hit`, () => { battle = common.createBattle([ - [{species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['spectralthief']}], - [{species: "Zangoose", ability: 'immunity', moves: ['swordsdance']}], + [{ species: "Smeargle", ability: 'owntempo', item: 'laggingtail', moves: ['spectralthief'] }], + [{ species: "Zangoose", ability: 'immunity', moves: ['swordsdance'] }], ]); const [thief, victim] = battle.sides.map(s => s.active[0]); @@ -76,10 +76,10 @@ describe(`Spectral Thief`, function () { assert.statStage(victim, 'atk', 2); }); - it(`should zero target's boosts if the target has Contrary`, function () { + it(`should zero target's boosts if the target has Contrary`, () => { battle = common.createBattle([ - [{species: "Smeargle", ability: 'owntempo', item: 'focussash', moves: ['spectralthief']}], - [{species: "Serperior", ability: 'contrary', moves: ['leafstorm']}], + [{ species: "Smeargle", ability: 'owntempo', item: 'focussash', moves: ['spectralthief'] }], + [{ species: "Serperior", ability: 'contrary', moves: ['leafstorm'] }], ]); const victim = battle.p2.active[0]; battle.makeChoices('move spectralthief', 'move leafstorm'); @@ -87,10 +87,10 @@ describe(`Spectral Thief`, function () { assert.false.fainted(victim); }); - it(`should zero target's boosts if the target has Clear Body`, function () { + it(`should zero target's boosts if the target has Clear Body`, () => { battle = common.createBattle([ - [{species: "Smeargle", ability: 'owntempo', moves: ['spectralthief']}], - [{species: "Tentacruel", ability: 'clearbody', moves: ['swordsdance']}], + [{ species: "Smeargle", ability: 'owntempo', moves: ['spectralthief'] }], + [{ species: "Tentacruel", ability: 'clearbody', moves: ['swordsdance'] }], ]); const victim = battle.p2.active[0]; battle.makeChoices('move spectralthief', 'move swordsdance'); @@ -98,10 +98,10 @@ describe(`Spectral Thief`, function () { assert.false.fainted(victim); }); - it(`should zero target's boosts if the target has Simple`, function () { + it(`should zero target's boosts if the target has Simple`, () => { battle = common.createBattle([ - [{species: "Smeargle", ability: 'owntempo', moves: ['spectralthief']}], - [{species: "Swoobat", ability: 'simple', moves: ['amnesia']}], + [{ species: "Smeargle", ability: 'owntempo', moves: ['spectralthief'] }], + [{ species: "Swoobat", ability: 'simple', moves: ['amnesia'] }], ]); const victim = battle.p2.active[0]; battle.makeChoices('move spectralthief', 'move amnesia'); diff --git a/test/sim/moves/spikes.js b/test/sim/moves/spikes.js index ae50093b2d..a67671fd4a 100644 --- a/test/sim/moves/spikes.js +++ b/test/sim/moves/spikes.js @@ -5,33 +5,33 @@ const common = require('./../../common'); let battle; -describe('Spikes', function () { - afterEach(function () { +describe('Spikes', () => { + afterEach(() => { battle.destroy(); }); - it(`should apply one layer per use in a double battle`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Bronzong', moves: ['sleeptalk']}, - {species: 'Cufant', moves: ['sleeptalk']}, + it(`should apply one layer per use in a double battle`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Bronzong', moves: ['sleeptalk'] }, + { species: 'Cufant', moves: ['sleeptalk'] }, ], [ - {species: 'Qwilfish', moves: ['sleeptalk']}, - {species: 'Glalie', moves: ['spikes']}, + { species: 'Qwilfish', moves: ['sleeptalk'] }, + { species: 'Glalie', moves: ['spikes'] }, ]]); battle.makeChoices(); assert.equal(battle.sides[0].sideConditions.spikes.layers, 1); }); - it(`should be bounced without any layers being set by the original user`, function () { - battle = common.createBattle({gameType: 'freeforall'}, [[ - {species: 'Hatterene', ability: 'Magic Bounce', moves: ['sleeptalk']}, + it(`should be bounced without any layers being set by the original user`, () => { + battle = common.createBattle({ gameType: 'freeforall' }, [[ + { species: 'Hatterene', ability: 'Magic Bounce', moves: ['sleeptalk'] }, ], [ - {species: 'Cufant', moves: ['sleeptalk']}, + { species: 'Cufant', moves: ['sleeptalk'] }, ], [ - {species: 'Qwilfish', moves: ['sleeptalk']}, + { species: 'Qwilfish', moves: ['sleeptalk'] }, ], [ - {species: 'Glalie', moves: ['spikes']}, + { species: 'Glalie', moves: ['spikes'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/spite.js b/test/sim/moves/spite.js index 4bc614ce23..f3beab9864 100644 --- a/test/sim/moves/spite.js +++ b/test/sim/moves/spite.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Spite', function () { - afterEach(function () { +describe('Spite', () => { + afterEach(() => { battle.destroy(); }); - it(`should fail on Z-moves`, function () { + it(`should fail on Z-moves`, () => { battle = common.gen(7).createBattle([[ - {species: 'Gengar', item: 'ghostiumz', moves: ['shadowball']}, + { species: 'Gengar', item: 'ghostiumz', moves: ['shadowball'] }, ], [ - {species: 'Snorlax', moves: ['spite']}, + { species: 'Snorlax', moves: ['spite'] }, ]]); battle.makeChoices('move shadowball zmove', 'move spite'); @@ -23,11 +23,11 @@ describe('Spite', function () { }); // Eerie Spell and G-Max Depletion should also behave this way - it(`should succeed on Max Moves, and announce the base move that PP was deducted from`, function () { + it(`should succeed on Max Moves, and announce the base move that PP was deducted from`, () => { battle = common.gen(8).createBattle([[ - {species: 'Gengar', moves: ['shadowball']}, + { species: 'Gengar', moves: ['shadowball'] }, ], [ - {species: 'Snorlax', moves: ['spite']}, + { species: 'Snorlax', moves: ['spite'] }, ]]); battle.makeChoices('move shadowball dynamax', 'move spite'); diff --git a/test/sim/moves/stealthrock.js b/test/sim/moves/stealthrock.js index c1e1645dc3..1f1f84cba5 100644 --- a/test/sim/moves/stealthrock.js +++ b/test/sim/moves/stealthrock.js @@ -5,53 +5,53 @@ const common = require('./../../common'); let battle; -describe('Stealth Rock', function () { - afterEach(function () { +describe('Stealth Rock', () => { + afterEach(() => { battle.destroy(); }); - it('should succeed against Substitute', function () { + it('should succeed against Substitute', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", moves: ['stealthrock']}]}); - battle.setPlayer('p2', {team: [{species: "Ninjask", moves: ['substitute']}]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", moves: ['stealthrock'] }] }); + battle.setPlayer('p2', { team: [{ species: "Ninjask", moves: ['substitute'] }] }); battle.makeChoices('move stealthrock', 'move substitute'); assert(battle.p2.sideConditions['stealthrock']); }); - it('should deal damage to Pokemon switching in based on their type effectiveness against Rock-type', function () { + it('should deal damage to Pokemon switching in based on their type effectiveness against Rock-type', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Smeargle", moves: ['splash', 'stealthrock']}]}); - battle.setPlayer('p2', {team: [ - {species: "Ninjask", moves: ['protect']}, - {species: "Volcarona", moves: ['roost']}, - {species: "Staraptor", moves: ['roost']}, - {species: "Chansey", moves: ['wish']}, - {species: "Hitmonchan", moves: ['rest']}, - {species: "Steelix", moves: ['rest']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Smeargle", moves: ['splash', 'stealthrock'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Ninjask", moves: ['protect'] }, + { species: "Volcarona", moves: ['roost'] }, + { species: "Staraptor", moves: ['roost'] }, + { species: "Chansey", moves: ['wish'] }, + { species: "Hitmonchan", moves: ['rest'] }, + { species: "Steelix", moves: ['rest'] }, + ] }); battle.makeChoices('move stealthrock', 'move protect'); let pokemon; for (let i = 2; i <= 6; i++) { battle.makeChoices('move splash', 'switch ' + i); pokemon = battle.p2.active[0]; - const expectedPercent = Math.pow(0.5, i - 1); + const expectedPercent = 0.5 ** (i - 1); const expectedDamage = Math.floor(pokemon.maxhp * expectedPercent); assert.equal(pokemon.maxhp - pokemon.hp, expectedDamage, `${pokemon.name} should take ${expectedPercent * 100}%`); } }); - it('should deal 2x damage to Eiscue', function () { + it('should deal 2x damage to Eiscue', () => { battle = common.createBattle([[ - {species: "Ninjask", moves: ['stealthrock']}, + { species: "Ninjask", moves: ['stealthrock'] }, ], [ - {species: "Mew", moves: ['uturn']}, - {species: "Eiscue", ability: 'iceface', moves: ['splash']}, + { species: "Mew", moves: ['uturn'] }, + { species: "Eiscue", ability: 'iceface', moves: ['splash'] }, ]]); battle.makeChoices(); battle.makeChoices('', 'switch eiscue'); const pokemon = battle.p2.active[0]; - const expectedPercent = Math.pow(0.5, 2); + const expectedPercent = 0.5 ** 2; const expectedDamage = Math.floor(pokemon.maxhp * expectedPercent); assert.equal(pokemon.maxhp - pokemon.hp, expectedDamage, `${pokemon.name} should take ${expectedPercent * 100}%`); }); diff --git a/test/sim/moves/stockpile.js b/test/sim/moves/stockpile.js index 300a869f61..cb79bb3f7d 100644 --- a/test/sim/moves/stockpile.js +++ b/test/sim/moves/stockpile.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Stockpile', function () { - afterEach(function () { +describe('Stockpile', () => { + afterEach(() => { battle.destroy(); }); - it('should keep track of how many boosts to each defense stat were successful', function () { + it('should keep track of how many boosts to each defense stat were successful', () => { battle = common.createBattle([ - [{species: 'Seviper', ability: 'shedskin', moves: ['stockpile', 'spitup']}], - [{species: 'Zangoose', ability: 'immunity', moves: ['sleeptalk']}], + [{ species: 'Seviper', ability: 'shedskin', moves: ['stockpile', 'spitup'] }], + [{ species: 'Zangoose', ability: 'immunity', moves: ['sleeptalk'] }], ]); - battle.boost({def: 4, spd: 5}, battle.p1.active[0]); + battle.boost({ def: 4, spd: 5 }, battle.p1.active[0]); battle.makeChoices('move stockpile', 'move sleeptalk'); battle.makeChoices('move stockpile', 'move sleeptalk'); diff --git a/test/sim/moves/stompingtantrum.js b/test/sim/moves/stompingtantrum.js index ed4945a86c..d4fe8a0708 100644 --- a/test/sim/moves/stompingtantrum.js +++ b/test/sim/moves/stompingtantrum.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Stomping Tantrum', function () { - afterEach(function () { +describe('Stomping Tantrum', () => { + afterEach(() => { battle.destroy(); }); - it(`should double its Base Power if the last move used on the previous turn failed`, function () { + it(`should double its Base Power if the last move used on the previous turn failed`, () => { battle = common.createBattle([[ - {species: 'Marowak', moves: ['attract', 'spore', 'stompingtantrum']}, + { species: 'Marowak', moves: ['attract', 'spore', 'stompingtantrum'] }, ], [ - {species: 'Manaphy', moves: ['rest']}, + { species: 'Manaphy', moves: ['rest'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { assert.equal(basePower, 150); }); @@ -27,14 +27,14 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'move rest'); }); - it(`should not double its Base Power if the last move used on the previous turn hit Protect`, function () { + it(`should not double its Base Power if the last move used on the previous turn hit Protect`, () => { battle = common.createBattle([[ - {species: 'Marowak', moves: ['stompingtantrum']}, + { species: 'Marowak', moves: ['stompingtantrum'] }, ], [ - {species: 'Manaphy', moves: ['protect', 'sleeptalk']}, + { species: 'Manaphy', moves: ['protect', 'sleeptalk'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { assert.equal(basePower, 75); }); @@ -42,16 +42,16 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'move sleeptalk'); }); - it(`should double its Base Power if the last move used was a spread move that partially hit Protect and otherwise failed`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Cresselia', moves: ['sunnyday']}, - {species: 'Groudon', ability: 'noguard', moves: ['stompingtantrum', 'precipiceblades']}, + it(`should double its Base Power if the last move used was a spread move that partially hit Protect and otherwise failed`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Cresselia', moves: ['sunnyday'] }, + { species: 'Groudon', ability: 'noguard', moves: ['stompingtantrum', 'precipiceblades'] }, ], [ - {species: 'Tapu Lele', moves: ['protect', 'calmmind']}, - {species: 'Ho-Oh', moves: ['recover']}, + { species: 'Tapu Lele', moves: ['protect', 'calmmind'] }, + { species: 'Ho-Oh', moves: ['recover'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (basePower, attacker, defender, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 150); }); @@ -59,14 +59,14 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move sunnyday, move stompingtantrum 1', 'move calmmind, move recover'); }); - it(`should not double its Base Power if the last move used on the previous turn was a successful Celebrate`, function () { + it(`should not double its Base Power if the last move used on the previous turn was a successful Celebrate`, () => { battle = common.createBattle([[ - {species: 'Snorlax', moves: ['celebrate', 'stompingtantrum']}, + { species: 'Snorlax', moves: ['celebrate', 'stompingtantrum'] }, ], [ - {species: 'Manaphy', moves: ['sleeptalk']}, + { species: 'Manaphy', moves: ['sleeptalk'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower) { + battle.onEvent('BasePower', battle.format, basePower => { assert.equal(basePower, 75); }); @@ -74,14 +74,14 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'auto'); }); - it(`should not double its Base Power if the last "move" used on the previous turn was a recharge`, function () { + it(`should not double its Base Power if the last "move" used on the previous turn was a recharge`, () => { battle = common.createBattle([[ - {species: 'Marowak-Alola', ability: 'noguard', moves: ['stompingtantrum', 'hyperbeam']}, + { species: 'Marowak-Alola', ability: 'noguard', moves: ['stompingtantrum', 'hyperbeam'] }, ], [ - {species: 'Lycanroc-Midnight', moves: ['sleeptalk']}, + { species: 'Lycanroc-Midnight', moves: ['sleeptalk'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 75); }); @@ -90,14 +90,14 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'auto'); }); - it.skip(`should not double its Base Power if the user dropped mid-Fly due to Smack Down`, function () { + it.skip(`should not double its Base Power if the user dropped mid-Fly due to Smack Down`, () => { battle = common.createBattle([[ - {species: 'Magikarp', moves: ['fly', 'stompingtantrum']}, + { species: 'Magikarp', moves: ['fly', 'stompingtantrum'] }, ], [ - {species: 'Wynaut', moves: ['smackdown']}, + { species: 'Wynaut', moves: ['smackdown'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 75); }); @@ -105,14 +105,14 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'auto'); }); - it(`should double its Base Power if a two-turn move fails for a different reason`, function () { + it(`should double its Base Power if a two-turn move fails for a different reason`, () => { battle = common.createBattle([[ - {species: 'Magikarp', moves: ['dive', 'stompingtantrum']}, + { species: 'Magikarp', moves: ['dive', 'stompingtantrum'] }, ], [ - {species: 'Wynaut', ability: 'waterabsorb', moves: ['splash']}, + { species: 'Wynaut', ability: 'waterabsorb', moves: ['splash'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 150); }); @@ -121,15 +121,15 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'auto'); }); - it(`should double its Base Power on some failure conditions of Rest`, function () { + it(`should double its Base Power on some failure conditions of Rest`, () => { battle = common.createBattle([[ - {species: 'Magikarp', ability: 'comatose', moves: ['rest', 'stompingtantrum']}, - {species: 'Feebas', ability: 'insomnia', moves: ['rest', 'stompingtantrum']}, + { species: 'Magikarp', ability: 'comatose', moves: ['rest', 'stompingtantrum'] }, + { species: 'Feebas', ability: 'insomnia', moves: ['rest', 'stompingtantrum'] }, ], [ - {species: 'Accelgor', moves: ['sleeptalk', 'nightshade']}, + { species: 'Accelgor', moves: ['sleeptalk', 'nightshade'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 150); }); @@ -144,14 +144,14 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'auto'); }); - it.skip(`should not double its Base Power on other failure conditions of Rest`, function () { + it.skip(`should not double its Base Power on other failure conditions of Rest`, () => { battle = common.createBattle([[ - {species: 'Magikarp', moves: ['rest', 'stompingtantrum', 'defog']}, + { species: 'Magikarp', moves: ['rest', 'stompingtantrum', 'defog'] }, ], [ - {species: 'Accelgor', moves: ['sleeptalk', 'nightshade', 'electricterrain', 'mistyterrain']}, + { species: 'Accelgor', moves: ['sleeptalk', 'nightshade', 'electricterrain', 'mistyterrain'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 75); }); @@ -167,16 +167,16 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum', 'auto'); }); - it.skip(`should not double its Base Power on most failed healing effects`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'Magikarp', moves: ['roost', 'lifedew', 'healpulse', 'stompingtantrum']}, - {species: 'Feebas', moves: ['shoreup', 'junglehealing', 'pollenpuff', 'stompingtantrum']}, + it.skip(`should not double its Base Power on most failed healing effects`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'Magikarp', moves: ['roost', 'lifedew', 'healpulse', 'stompingtantrum'] }, + { species: 'Feebas', moves: ['shoreup', 'junglehealing', 'pollenpuff', 'stompingtantrum'] }, ], [ - {species: 'Accelgor', moves: ['sleeptalk']}, - {species: 'Accelgor', moves: ['sleeptalk']}, + { species: 'Accelgor', moves: ['sleeptalk'] }, + { species: 'Accelgor', moves: ['sleeptalk'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 75); }); @@ -190,14 +190,14 @@ describe('Stomping Tantrum', function () { battle.makeChoices('move stompingtantrum 1, move stompingtantrum 1', 'auto'); }); - it(`should cause Gravity-negated moves to double in BP, even Z-moves`, function () { + it(`should cause Gravity-negated moves to double in BP, even Z-moves`, () => { battle = common.gen(7).createBattle([[ - {species: "Magikarp", item: 'normaliumz', moves: ['splash', 'stompingtantrum']}, + { species: "Magikarp", item: 'normaliumz', moves: ['splash', 'stompingtantrum'] }, ], [ - {species: "Accelgor", moves: ['gravity']}, + { species: "Accelgor", moves: ['gravity'] }, ]]); - battle.onEvent('BasePower', battle.format, function (basePower, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (basePower, pokemon, target, move) => { if (move.id === 'stompingtantrum') assert.equal(basePower, 150); }); diff --git a/test/sim/moves/stoneaxe.js b/test/sim/moves/stoneaxe.js index 4bf2f41be5..8efb0a9982 100644 --- a/test/sim/moves/stoneaxe.js +++ b/test/sim/moves/stoneaxe.js @@ -7,29 +7,29 @@ let battle; // tests are derived from the following post and related quotes: // https://www.smogon.com/forums/threads/scarlet-violet-battle-mechanics-research.3709545/post-9417627 -describe('Stone Axe', function () { - afterEach(function () { +describe('Stone Axe', () => { + afterEach(() => { battle.destroy(); }); - it(`should set up Stealth Rock on the side of the opponent`, function () { + it(`should set up Stealth Rock on the side of the opponent`, () => { battle = common.createBattle([[ - {species: 'kleavor', ability: 'noguard', moves: ['stoneaxe']}, + { species: 'kleavor', ability: 'noguard', moves: ['stoneaxe'] }, ], [ - {species: 'registeel', moves: ['splash']}, + { species: 'registeel', moves: ['splash'] }, ]]); battle.makeChoices(); assert(battle.p2.sideConditions.stealthrock); }); - it(`should set up Stealth Rock on the side of the opponent, not necessarily the target, in a double battle`, function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'kleavor', ability: 'noguard', moves: ['stoneaxe']}, - {species: 'pikachu', moves: ['splash']}, + it(`should set up Stealth Rock on the side of the opponent, not necessarily the target, in a double battle`, () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'kleavor', ability: 'noguard', moves: ['stoneaxe'] }, + { species: 'pikachu', moves: ['splash'] }, ], [ - {species: 'squirtle', moves: ['splash']}, - {species: 'bulbasaur', moves: ['splash']}, + { species: 'squirtle', moves: ['splash'] }, + { species: 'bulbasaur', moves: ['splash'] }, ]]); battle.makeChoices('move stoneaxe -2, move splash', 'move splash, move splash'); @@ -38,33 +38,33 @@ describe('Stone Axe', function () { assert(battle.p2.sideConditions.stealthrock); }); - it(`should still set up Stealth Rock on the side of the opponent that is behind a Substitute`, function () { + it(`should still set up Stealth Rock on the side of the opponent that is behind a Substitute`, () => { battle = common.createBattle([[ - {species: 'kleavor', ability: 'noguard', moves: ['stoneaxe']}, + { species: 'kleavor', ability: 'noguard', moves: ['stoneaxe'] }, ], [ - {species: 'regieleki', moves: ['substitute']}, + { species: 'regieleki', moves: ['substitute'] }, ]]); battle.makeChoices(); assert(battle.p2.sideConditions.stealthrock); }); - it(`should not set up Stealth Rock if the move does not hit opponent or its Substitute`, function () { + it(`should not set up Stealth Rock if the move does not hit opponent or its Substitute`, () => { battle = common.createBattle([[ - {species: 'kleavor', moves: ['stoneaxe']}, + { species: 'kleavor', moves: ['stoneaxe'] }, ], [ - {species: 'regieleki', moves: ['protect']}, + { species: 'regieleki', moves: ['protect'] }, ]]); battle.makeChoices(); assert.equal(!!(battle.p2.sideConditions.stealthrock), false); }); - it('should not be bounced back by Magic Bounce', function () { + it('should not be bounced back by Magic Bounce', () => { battle = common.createBattle([[ - {species: 'kleavor', ability: 'noguard', moves: ['stoneaxe']}, + { species: 'kleavor', ability: 'noguard', moves: ['stoneaxe'] }, ], [ - {species: 'registeel', ability: 'magicbounce', moves: ['splash']}, + { species: 'registeel', ability: 'magicbounce', moves: ['splash'] }, ]]); battle.makeChoices(); @@ -72,23 +72,23 @@ describe('Stone Axe', function () { assert(battle.p2.sideConditions.stealthrock); }); - it('should have its Stealth Rock prevented by Sheer Force', function () { + it('should have its Stealth Rock prevented by Sheer Force', () => { battle = common.createBattle([[ - {species: 'kleavor', ability: 'sheerforce', moves: ['stoneaxe']}, + { species: 'kleavor', ability: 'sheerforce', moves: ['stoneaxe'] }, ], [ - {species: 'registeel', ability: 'noguard', moves: ['splash']}, + { species: 'registeel', ability: 'noguard', moves: ['splash'] }, ]]); battle.makeChoices(); assert.equal(!!(battle.p2.sideConditions.stealthrock), false); }); - it(`should not set Stealth Rock when the user faints from Rocky Helmet`, function () { + it(`should not set Stealth Rock when the user faints from Rocky Helmet`, () => { battle = common.createBattle([[ - {species: 'kleavor', ability: 'noguard', item: 'focussash', moves: ['stoneaxe']}, - {species: 'wynaut', moves: ['sleeptalk']}, + { species: 'kleavor', ability: 'noguard', item: 'focussash', moves: ['stoneaxe'] }, + { species: 'wynaut', moves: ['sleeptalk'] }, ], [ - {species: 'regieleki', item: 'rockyhelmet', moves: ['sheercold']}, + { species: 'regieleki', item: 'rockyhelmet', moves: ['sheercold'] }, ]]); battle.makeChoices(); // Kleavor will faint to the Rocky Helmet diff --git a/test/sim/moves/struggle.js b/test/sim/moves/struggle.js index 401d077329..e0f8d71c8d 100644 --- a/test/sim/moves/struggle.js +++ b/test/sim/moves/struggle.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Struggle', function () { - afterEach(function () { +describe('Struggle', () => { + afterEach(() => { battle.destroy(); }); - it(`should KO Shedinja in Gen 4 (and every other gen)`, function () { + it(`should KO Shedinja in Gen 4 (and every other gen)`, () => { battle = common.gen(4).createBattle([[ - {species: 'Shedinja', moves: ['sleeptalk']}, + { species: 'Shedinja', moves: ['sleeptalk'] }, ], [ - {species: 'Salamence', moves: ['taunt']}, + { species: 'Salamence', moves: ['taunt'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/substitute.js b/test/sim/moves/substitute.js index 98107f2112..1d2cca185d 100644 --- a/test/sim/moves/substitute.js +++ b/test/sim/moves/substitute.js @@ -5,54 +5,54 @@ const common = require('./../../common'); let battle; -describe('Substitute', function () { - afterEach(function () { +describe('Substitute', () => { + afterEach(() => { battle.destroy(); }); - it('should deduct 25% of max HP, rounded down', function () { + it('should deduct 25% of max HP, rounded down', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['substitute']}]}); - battle.setPlayer('p2', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['recover']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['substitute'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['recover'] }] }); battle.makeChoices('move substitute', 'move recover'); const pokemon = battle.p1.active[0]; assert.equal(pokemon.maxhp - pokemon.hp, Math.floor(pokemon.maxhp / 4)); }); - it('should not block the user\'s own moves from targetting itself', function () { + it('should not block the user\'s own moves from targetting itself', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['substitute', 'calmmind']}]}); - battle.setPlayer('p2', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['recover']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['substitute', 'calmmind'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['recover'] }] }); battle.makeChoices('move substitute', 'move recover'); battle.makeChoices('move calmmind', 'move recover'); assert.equal(battle.p1.active[0].boosts['spa'], 1); assert.equal(battle.p1.active[0].boosts['spd'], 1); }); - it('should block damage from most moves', function () { + it('should block damage from most moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['substitute']}]}); - battle.setPlayer('p2', {team: [{species: 'Mewtwo', ability: 'pressure', item: 'laggingtail', moves: ['psystrike']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['substitute'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Mewtwo', ability: 'pressure', item: 'laggingtail', moves: ['psystrike'] }] }); battle.makeChoices('move substitute', 'move psystrike'); const pokemon = battle.p1.active[0]; assert.equal(pokemon.maxhp - pokemon.hp, Math.floor(pokemon.maxhp / 4)); }); - it('should not block recoil damage', function () { + it('should not block recoil damage', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['substitute', 'doubleedge']}]}); - battle.setPlayer('p2', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['nastyplot']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['substitute', 'doubleedge'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['nastyplot'] }] }); battle.makeChoices('move substitute', 'move nastyplot'); battle.makeChoices('move doubleedge', 'move nastyplot'); const pokemon = battle.p1.active[0]; assert.notEqual(pokemon.maxhp - pokemon.hp, Math.floor(pokemon.maxhp / 4)); }); - it('should take specific recoil damage in Gen 1', function () { + it('should take specific recoil damage in Gen 1', () => { battle = common.gen(1).createBattle([[ - {species: 'Hitmonlee', moves: ['substitute', 'highjumpkick']}, + { species: 'Hitmonlee', moves: ['substitute', 'highjumpkick'] }, ], [ - {species: 'Hitmonchan', moves: ['substitute', 'agility']}, + { species: 'Hitmonchan', moves: ['substitute', 'agility'] }, ]]); const hitmonlee = battle.p1.active[0]; @@ -87,50 +87,50 @@ describe('Substitute', function () { assert.equal(hitmonchan.maxhp - hitmonchan.hp, Math.floor(hitmonchan.maxhp / 4)); }); - it('should cause recoil damage from an opponent\'s moves to be based on damage dealt to the substitute', function () { + it('should cause recoil damage from an opponent\'s moves to be based on damage dealt to the substitute', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mewtwo', ability: 'pressure', moves: ['substitute']}]}); - battle.setPlayer('p2', {team: [{species: 'Mewtwo', ability: 'noguard', moves: ['nastyplot', 'lightofruin']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mewtwo', ability: 'pressure', moves: ['substitute'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Mewtwo', ability: 'noguard', moves: ['nastyplot', 'lightofruin'] }] }); battle.makeChoices('move substitute', 'move nastyplot'); battle.makeChoices('move substitute', 'move lightofruin'); const pokemon = battle.p2.active[0]; assert.equal(pokemon.maxhp - pokemon.hp, Math.ceil(Math.floor(battle.p1.active[0].maxhp / 4) / 2)); }); - it('should cause recovery from an opponent\'s draining moves to be based on damage dealt to the substitute', function () { + it('should cause recovery from an opponent\'s draining moves to be based on damage dealt to the substitute', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Zangoose', ability: 'pressure', moves: ['substitute']}]}); - battle.setPlayer('p2', {team: [{species: 'Zangoose', ability: 'noguard', moves: ['bellydrum', 'drainpunch']}]}); + battle.setPlayer('p1', { team: [{ species: 'Zangoose', ability: 'pressure', moves: ['substitute'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Zangoose', ability: 'noguard', moves: ['bellydrum', 'drainpunch'] }] }); battle.makeChoices('move substitute', 'move bellydrum'); const hp = battle.p2.active[0].hp; battle.makeChoices('move substitute', 'move drainpunch'); assert.equal(battle.p2.active[0].hp - hp, Math.ceil(Math.floor(battle.p1.active[0].maxhp / 4) / 2)); }); - it('should block most status moves targetting the user', function () { + it('should block most status moves targetting the user', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Mewtwo', ability: 'noguard', moves: ['substitute']}]}); - battle.setPlayer('p2', {team: [{species: 'Mewtwo', ability: 'pressure', item: 'laggingtail', moves: ['hypnosis', 'toxic', 'poisongas', 'thunderwave', 'willowisp']}]}); + battle.setPlayer('p1', { team: [{ species: 'Mewtwo', ability: 'noguard', moves: ['substitute'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Mewtwo', ability: 'pressure', item: 'laggingtail', moves: ['hypnosis', 'toxic', 'poisongas', 'thunderwave', 'willowisp'] }] }); for (let i = 1; i <= 5; i++) { battle.makeChoices('move substitute', 'move ' + i); assert.equal(battle.p1.active[0].status, ''); } }); - it('should allow multi-hit moves to continue after the substitute fades', function () { + it('should allow multi-hit moves to continue after the substitute fades', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Dragonite', ability: 'noguard', item: 'focussash', moves: ['substitute', 'roost']}]}); - battle.setPlayer('p2', {team: [{species: 'Dragonite', ability: 'hugepower', item: 'laggingtail', moves: ['roost', 'dualchop']}]}); + battle.setPlayer('p1', { team: [{ species: 'Dragonite', ability: 'noguard', item: 'focussash', moves: ['substitute', 'roost'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Dragonite', ability: 'hugepower', item: 'laggingtail', moves: ['roost', 'dualchop'] }] }); battle.makeChoices('move substitute', 'move roost'); battle.makeChoices('move roost', 'move dualchop'); assert.notEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); - it(`[Gen 1] should track what the actual damage would have been without the Substitute`, function () { + it(`[Gen 1] should track what the actual damage would have been without the Substitute`, () => { battle = common.gen(1).createBattle([[ - {species: 'Ponyta', moves: ['substitute', 'growl'], evs: {hp: 252, spd: 252}}, + { species: 'Ponyta', moves: ['substitute', 'growl'], evs: { hp: 252, spd: 252 } }, ], [ - {species: 'Cloyster', moves: ['clamp'], evs: {spa: 252}}, + { species: 'Cloyster', moves: ['clamp'], evs: { spa: 252 } }, ]]); const ponyta = battle.p1.active[0]; @@ -142,22 +142,22 @@ describe('Substitute', function () { assert.bounded(hp - ponyta.hp, [91, 108]); }); - it(`[Gen 1] Substitute should not block secondary effect confusion if it is unbroken`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Magikarp', moves: ['psybeam']}, + it(`[Gen 1] Substitute should not block secondary effect confusion if it is unbroken`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Magikarp', moves: ['psybeam'] }, ], [ - {species: 'Alakazam', moves: ['substitute']}, + { species: 'Alakazam', moves: ['substitute'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.includes('confusion'))); }); - it(`[Gen 1] if a Pokemon with a Substitute hurts itself due to confusion and the target does not have a Substitute, there is no damage dealt.`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Magikarp', moves: ['substitute', 'agility']}, + it(`[Gen 1] if a Pokemon with a Substitute hurts itself due to confusion and the target does not have a Substitute, there is no damage dealt.`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Magikarp', moves: ['substitute', 'agility'] }, ], [ - {species: 'Alakazam', moves: ['confuseray', 'agility']}, + { species: 'Alakazam', moves: ['confuseray', 'agility'] }, ]]); const magikarp = battle.p1.active[0]; const alakazam = battle.p2.active[0]; @@ -176,11 +176,11 @@ describe('Substitute', function () { assert.equal(alakazam.hp, alakaxamHp); }); - it(`[Gen 1] if a Pokemon with a Substitute hurts itself due to confusion and the target has a Substitute, the target's Substitute takes the damage.`, function () { - battle = common.gen(1).createBattle({forceRandomChance: true}, [[ - {species: 'Magikarp', moves: ['substitute', 'agility']}, + it(`[Gen 1] if a Pokemon with a Substitute hurts itself due to confusion and the target has a Substitute, the target's Substitute takes the damage.`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: true }, [[ + { species: 'Magikarp', moves: ['substitute', 'agility'] }, ], [ - {species: 'Alakazam', moves: ['confuseray', 'substitute', 'agility']}, + { species: 'Alakazam', moves: ['confuseray', 'substitute', 'agility'] }, ]]); const magikarp = battle.p1.active[0]; const alakazam = battle.p2.active[0]; diff --git a/test/sim/moves/sunsteelstrike.js b/test/sim/moves/sunsteelstrike.js index 85ee4ff6f2..938ce8db3f 100644 --- a/test/sim/moves/sunsteelstrike.js +++ b/test/sim/moves/sunsteelstrike.js @@ -5,27 +5,27 @@ const common = require('./../../common'); let battle; -describe('Sunsteel Strike', function () { - afterEach(function () { +describe('Sunsteel Strike', () => { + afterEach(() => { battle.destroy(); }); - it(`should not ignore the user's own Ability`, function () { + it(`should not ignore the user's own Ability`, () => { battle = common.createBattle([[ - {species: 'metagross', ability: 'clearbody', moves: ['sunsteelstrike']}, + { species: 'metagross', ability: 'clearbody', moves: ['sunsteelstrike'] }, ], [ - {species: 'goodra', ability: 'gooey', moves: ['sleeptalk']}, + { species: 'goodra', ability: 'gooey', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const metagross = battle.p1.active[0]; assert.statStage(metagross, 'spe', 0); }); - it(`should ignore the user's own Ability (Gen 7)`, function () { + it(`should ignore the user's own Ability (Gen 7)`, () => { battle = common.gen(7).createBattle([[ - {species: 'metagross', ability: 'clearbody', moves: ['sunsteelstrike']}, + { species: 'metagross', ability: 'clearbody', moves: ['sunsteelstrike'] }, ], [ - {species: 'goodra', ability: 'gooey', moves: ['sleeptalk']}, + { species: 'goodra', ability: 'gooey', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const metagross = battle.p1.active[0]; diff --git a/test/sim/moves/syrupbomb.js b/test/sim/moves/syrupbomb.js index 89a41d24dd..710c8b811a 100644 --- a/test/sim/moves/syrupbomb.js +++ b/test/sim/moves/syrupbomb.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Syrup Bomb', function () { - afterEach(function () { +describe('Syrup Bomb', () => { + afterEach(() => { battle.destroy(); }); - it(`should lower the opponent's Speed for 3 turns, but not remove its volatile until after 4 turns`, function () { + it(`should lower the opponent's Speed for 3 turns, but not remove its volatile until after 4 turns`, () => { battle = common.createBattle([[ - {species: 'Wynaut', ability: 'noguard', moves: ['syrupbomb']}, + { species: 'Wynaut', ability: 'noguard', moves: ['syrupbomb'] }, ], [ - {species: 'Applin', moves: ['sleeptalk']}, + { species: 'Applin', moves: ['sleeptalk'] }, ]]); for (let i = 0; i < 3; i++) battle.makeChoices(); @@ -27,12 +27,12 @@ describe('Syrup Bomb', function () { assert.false(applin.volatiles['syrupbomb'], `Applin should no longer have the Syrup Bomb volatile`); }); - it(`should end if the source leaves the field`, function () { + it(`should end if the source leaves the field`, () => { battle = common.createBattle([[ - {species: 'Dipplin', ability: 'noguard', moves: ['syrupbomb']}, - {species: 'Furret', moves: ['sleeptalk']}, + { species: 'Dipplin', ability: 'noguard', moves: ['syrupbomb'] }, + { species: 'Furret', moves: ['sleeptalk'] }, ], [ - {species: 'Applin', moves: ['sleeptalk']}, + { species: 'Applin', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -40,11 +40,11 @@ describe('Syrup Bomb', function () { assert.statStage(battle.p2.active[0], 'spe', -1); }); - it(`the stat changes should be reflected by Mirror Armor`, function () { + it(`the stat changes should be reflected by Mirror Armor`, () => { battle = common.createBattle([[ - {species: 'Dipplin', ability: 'noguard', moves: ['syrupbomb']}, + { species: 'Dipplin', ability: 'noguard', moves: ['syrupbomb'] }, ], [ - {species: 'Corviknight', ability: 'mirrorarmor', moves: ['sleeptalk']}, + { species: 'Corviknight', ability: 'mirrorarmor', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/tarshot.js b/test/sim/moves/tarshot.js index 77c9164e7a..4686242707 100644 --- a/test/sim/moves/tarshot.js +++ b/test/sim/moves/tarshot.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Tar Shot', function () { - afterEach(function () { +describe('Tar Shot', () => { + afterEach(() => { battle.destroy(); }); - it('should cause subsequent Fire-type attacks to deal 2x damage as a type chart multiplier', function () { + it('should cause subsequent Fire-type attacks to deal 2x damage as a type chart multiplier', () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['tarshot', 'fusionflare']}, + { species: 'wynaut', moves: ['tarshot', 'fusionflare'] }, ], [ - {species: 'cleffa', moves: ['sleeptalk']}, + { species: 'cleffa', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices('move fusionflare', 'auto'); @@ -23,11 +23,11 @@ describe('Tar Shot', function () { assert.bounded(damage, [82, 98]); }); - it('should cause Fire-type attacks to trigger Weakness Policy', function () { + it('should cause Fire-type attacks to trigger Weakness Policy', () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['tarshot', 'fusionflare']}, + { species: 'wynaut', moves: ['tarshot', 'fusionflare'] }, ], [ - {species: 'cleffa', item: 'weaknesspolicy', moves: ['sleeptalk']}, + { species: 'cleffa', item: 'weaknesspolicy', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); battle.makeChoices('move fusionflare', 'auto'); @@ -36,13 +36,13 @@ describe('Tar Shot', function () { assert.statStage(battle.p2.active[0], 'spa', 2); }); - it('should not interact with Delta Stream', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wobbuffet', moves: ['tarshot']}, - {species: 'wynaut', moves: ['fusionflare']}, + it('should not interact with Delta Stream', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wobbuffet', moves: ['tarshot'] }, + { species: 'wynaut', moves: ['fusionflare'] }, ], [ - {species: 'tornadus', ability: 'shellarmor', moves: ['sleeptalk']}, - {species: 'thundurus', ability: 'deltastream', moves: ['sleeptalk']}, + { species: 'tornadus', ability: 'shellarmor', moves: ['sleeptalk'] }, + { species: 'thundurus', ability: 'deltastream', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move tarshot 1, move fusionflare 1', 'auto'); const torn = battle.p2.active[0]; @@ -50,11 +50,11 @@ describe('Tar Shot', function () { assert.bounded(damage, [62, 74]); }); - it(`should add a Fire-type weakness, not make the target 2x weaker to Fire`, function () { + it(`should add a Fire-type weakness, not make the target 2x weaker to Fire`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['tarshot', 'flamecharge']}, + { species: 'wynaut', moves: ['tarshot', 'flamecharge'] }, ], [ - {species: 'ferrothorn', moves: ['sleeptalk']}, + { species: 'ferrothorn', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move tarshot', 'auto'); battle.makeChoices('move flamecharge', 'auto'); @@ -63,11 +63,11 @@ describe('Tar Shot', function () { assert.bounded(damage, [88, 104]); }); - it(`should not remove the Tar Shot status when a Pokemon Terastallizes`, function () { + it(`should not remove the Tar Shot status when a Pokemon Terastallizes`, () => { battle = common.gen(9).createBattle([[ - {species: 'wynaut', moves: ['tarshot', 'flamecharge']}, + { species: 'wynaut', moves: ['tarshot', 'flamecharge'] }, ], [ - {species: 'snorlax', item: 'weaknesspolicy', moves: ['sleeptalk']}, + { species: 'snorlax', item: 'weaknesspolicy', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move tarshot', 'auto'); battle.makeChoices('move flamecharge', 'move sleeptalk terastallize'); @@ -75,11 +75,11 @@ describe('Tar Shot', function () { assert.statStage(lax, 'atk', 2, `Weakness Policy should have activated`); }); - it(`should prevent a Terastallized Pokemon from being afflicted with the Tar Shot status`, function () { + it(`should prevent a Terastallized Pokemon from being afflicted with the Tar Shot status`, () => { battle = common.gen(9).createBattle([[ - {species: 'wynaut', moves: ['tarshot', 'flamecharge']}, + { species: 'wynaut', moves: ['tarshot', 'flamecharge'] }, ], [ - {species: 'snorlax', item: 'weaknesspolicy', moves: ['sleeptalk']}, + { species: 'snorlax', item: 'weaknesspolicy', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move tarshot', 'move sleeptalk terastallize'); battle.makeChoices('move flamecharge', 'auto'); diff --git a/test/sim/moves/taunt.js b/test/sim/moves/taunt.js index 3c55a0a557..f3377915b0 100644 --- a/test/sim/moves/taunt.js +++ b/test/sim/moves/taunt.js @@ -5,25 +5,25 @@ const common = require('./../../common'); let battle; -describe('Taunt', function () { - afterEach(function () { +describe('Taunt', () => { + afterEach(() => { battle.destroy(); }); - it('should prevent the target from using Status moves and disable them', function () { + it('should prevent the target from using Status moves and disable them', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', moves: ['taunt']}]}); - battle.setPlayer('p2', {team: [{species: 'Chansey', ability: 'naturalcure', moves: ['calmmind']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['taunt'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Chansey', ability: 'naturalcure', moves: ['calmmind'] }] }); battle.makeChoices('move taunt', 'move calmmind'); assert.equal(battle.p2.active[0].boosts['spa'], 0); assert.equal(battle.p2.active[0].boosts['spd'], 0); battle.makeChoices('move taunt', 'move struggle'); }); - it('should not prevent the target from using Z-Powered Status moves', function () { + it('should not prevent the target from using Z-Powered Status moves', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: 'Sableye', ability: 'prankster', moves: ['taunt']}]}); - battle.setPlayer('p2', {team: [{species: 'Charmander', ability: 'blaze', item: 'firiumz', moves: ['sunnyday']}]}); + battle.setPlayer('p1', { team: [{ species: 'Sableye', ability: 'prankster', moves: ['taunt'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Charmander', ability: 'blaze', item: 'firiumz', moves: ['sunnyday'] }] }); battle.makeChoices('move taunt', 'move sunnyday zmove'); assert.statStage(battle.p2.active[0], 'spe', 1); assert(battle.field.isWeather('sunnyday')); diff --git a/test/sim/moves/teattime.js b/test/sim/moves/teattime.js index 0d4dfedf46..5ae6f15147 100644 --- a/test/sim/moves/teattime.js +++ b/test/sim/moves/teattime.js @@ -5,18 +5,18 @@ const common = require('./../../common'); let battle; -describe('Teatime', function () { - afterEach(function () { +describe('Teatime', () => { + afterEach(() => { battle.destroy(); }); - it('should force all Pokemon to eat their Berries immediately', function () { - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', item: 'sitrusberry', moves: ['sleeptalk']}, - {species: 'wynaut', item: 'aguavberry', moves: ['sleeptalk']}, + it('should force all Pokemon to eat their Berries immediately', () => { + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', item: 'sitrusberry', moves: ['sleeptalk'] }, + { species: 'wynaut', item: 'aguavberry', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', item: 'lumberry', moves: ['sleeptalk']}, - {species: 'wynaut', item: 'sitrusberry', moves: ['teatime']}, + { species: 'wynaut', item: 'lumberry', moves: ['sleeptalk'] }, + { species: 'wynaut', item: 'sitrusberry', moves: ['teatime'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].item, ''); @@ -25,61 +25,61 @@ describe('Teatime', function () { assert.equal(battle.p2.pokemon[1].item, ''); }); - it('should force Pokemon to eat Berries while affected by Unnerve', function () { + it('should force Pokemon to eat Berries while affected by Unnerve', () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'sitrusberry', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'sitrusberry', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', ability: 'unnerve', moves: ['teatime']}, + { species: 'wynaut', ability: 'unnerve', moves: ['teatime'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].item, ''); }); - it('should force Pokemon to eat Berries while Magic Room is active', function () { + it('should force Pokemon to eat Berries while Magic Room is active', () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'sitrusberry', evs: {spe: 252}, moves: ['magicroom']}, + { species: 'wynaut', item: 'sitrusberry', evs: { spe: 252 }, moves: ['magicroom'] }, ], [ - {species: 'wynaut', moves: ['teatime']}, + { species: 'wynaut', moves: ['teatime'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].item, ''); }); - it('should force Pokemon with Klutz to eat Berries', function () { + it('should force Pokemon with Klutz to eat Berries', () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'sitrusberry', ability: 'klutz', moves: ['sleeptalk']}, + { species: 'wynaut', item: 'sitrusberry', ability: 'klutz', moves: ['sleeptalk'] }, ], [ - {species: 'wynaut', moves: ['teatime']}, + { species: 'wynaut', moves: ['teatime'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].item, ''); }); - it('should force Pokemon with Substitute to eat Berries', function () { + it('should force Pokemon with Substitute to eat Berries', () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'sitrusberry', evs: {spe: 252}, moves: ['substitute']}, + { species: 'wynaut', item: 'sitrusberry', evs: { spe: 252 }, moves: ['substitute'] }, ], [ - {species: 'wynaut', moves: ['teatime']}, + { species: 'wynaut', moves: ['teatime'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].item, ''); }); - it('should not cause Pokemon in the semi-invulernable state to eat their Berries', function () { + it('should not cause Pokemon in the semi-invulernable state to eat their Berries', () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'sitrusberry', evs: {spe: 252}, moves: ['fly']}, + { species: 'wynaut', item: 'sitrusberry', evs: { spe: 252 }, moves: ['fly'] }, ], [ - {species: 'wynaut', moves: ['teatime']}, + { species: 'wynaut', moves: ['teatime'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].item, 'sitrusberry'); }); - it('should not cause Recycle to fail to restore the Berry', function () { + it('should not cause Recycle to fail to restore the Berry', () => { battle = common.createBattle([[ - {species: 'wynaut', item: 'sitrusberry', moves: ['recycle']}, + { species: 'wynaut', item: 'sitrusberry', moves: ['recycle'] }, ], [ - {species: 'wynaut', evs: {spe: 252}, moves: ['teatime']}, + { species: 'wynaut', evs: { spe: 252 }, moves: ['teatime'] }, ]]); battle.makeChoices(); assert.equal(battle.p1.pokemon[0].item, 'sitrusberry'); diff --git a/test/sim/moves/teleport.js b/test/sim/moves/teleport.js index 340077e35f..5055e79497 100644 --- a/test/sim/moves/teleport.js +++ b/test/sim/moves/teleport.js @@ -5,26 +5,26 @@ const common = require('./../../common'); let battle; -describe(`Teleport`, function () { - afterEach(function () { +describe(`Teleport`, () => { + afterEach(() => { battle.destroy(); }); - it(`should fail to switch the user out if no Pokemon can be switched in`, function () { + it(`should fail to switch the user out if no Pokemon can be switched in`, () => { battle = common.createBattle([[ - {species: 'wynaut', moves: ['teleport']}, + { species: 'wynaut', moves: ['teleport'] }, ], [ - {species: 'pichu', moves: ['swordsdance']}, + { species: 'pichu', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-fail'))); - battle = common.createBattle({gameType: 'doubles'}, [[ - {species: 'wynaut', moves: ['teleport']}, - {species: 'pichu', moves: ['swordsdance']}, + battle = common.createBattle({ gameType: 'doubles' }, [[ + { species: 'wynaut', moves: ['teleport'] }, + { species: 'pichu', moves: ['swordsdance'] }, ], [ - {species: 'pichu', moves: ['swordsdance']}, - {species: 'pichu', moves: ['swordsdance']}, + { species: 'pichu', moves: ['swordsdance'] }, + { species: 'pichu', moves: ['swordsdance'] }, ]]); battle.makeChoices(); assert(battle.log.some(line => line.startsWith('|-fail'))); diff --git a/test/sim/moves/terablast.js b/test/sim/moves/terablast.js index 631e6309ce..8d04ce5fff 100644 --- a/test/sim/moves/terablast.js +++ b/test/sim/moves/terablast.js @@ -3,25 +3,25 @@ const assert = require('./../../assert'); const common = require('./../../common'); -describe('Tera Blast', function () { - it(`should be a special attack when base stats are tied`, function () { +describe('Tera Blast', () => { + it(`should be a special attack when base stats are tied`, () => { const battle = common.gen(9).createBattle([[ // Regidrago has equal base attack and special attack stats. - {species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast']}, + { species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast'] }, ], [ - {species: 'regirock', ability: 'clearbody', moves: ['protect']}, + { species: 'regirock', ability: 'clearbody', moves: ['protect'] }, ]]); battle.makeChoices('move terablast terastallize', 'move protect'); assert.equal(battle.p1.pokemon[0].lastMove.category, 'Special'); }); - it(`should be a physical attack when terastallized with higher attack stat`, function () { + it(`should be a physical attack when terastallized with higher attack stat`, () => { const battle = common.gen(9).createBattle([[ // Regidrago has equal base attack and special attack stats. - {species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast', 'dragondance']}, + { species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast', 'dragondance'] }, ], [ - {species: 'regirock', ability: 'clearbody', moves: ['protect']}, + { species: 'regirock', ability: 'clearbody', moves: ['protect'] }, ]]); // Dragon Dance boosts Regidrago's attack stat. battle.makeChoices('move dragondance', 'move protect'); @@ -30,12 +30,12 @@ describe('Tera Blast', function () { assert.equal(battle.p1.pokemon[0].lastMove.category, 'Physical'); }); - it(`should be a special attack when not terastallized, even if attack stat is higher`, function () { + it(`should be a special attack when not terastallized, even if attack stat is higher`, () => { const battle = common.createBattle([[ // Regidrago has equal base attack and special attack stats. - {species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast', 'dragondance']}, + { species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast', 'dragondance'] }, ], [ - {species: 'regirock', ability: 'clearbody', moves: ['protect']}, + { species: 'regirock', ability: 'clearbody', moves: ['protect'] }, ]]); // Dragon Dance boosts Regidrago's attack stat. battle.makeChoices('move dragondance', 'move protect'); @@ -46,13 +46,13 @@ describe('Tera Blast', function () { }); // Skipped until https://github.com/smogon/pokemon-showdown/issues/9381 is fixed. - it.skip(`should be a special attack when terastallized even if target ignores stat changes`, function () { + it.skip(`should be a special attack when terastallized even if target ignores stat changes`, () => { const battle = common.gen(9).createBattle([[ // Regidrago has equal base attack and special attack stats. - {species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast', 'dragondance']}, + { species: 'regidrago', ability: 'dragonsmaw', moves: ['terablast', 'dragondance'] }, ], [ // Dondozo's Unaware should not affect Tera Blast's category. - {species: 'dondozo', ability: 'unaware', moves: ['splash']}, + { species: 'dondozo', ability: 'unaware', moves: ['splash'] }, ]]); // Dragon Dance boosts Regidrago's attack stat. battle.makeChoices('move dragondance', 'move splash'); diff --git a/test/sim/moves/terastarstorm.js b/test/sim/moves/terastarstorm.js index 9f5546c656..edbbf77f32 100644 --- a/test/sim/moves/terastarstorm.js +++ b/test/sim/moves/terastarstorm.js @@ -5,29 +5,29 @@ const common = require('./../../common'); let battle; -describe(`Tera Starstorm`, function () { - afterEach(function () { +describe(`Tera Starstorm`, () => { + afterEach(() => { battle.destroy(); }); - it(`should be a physical attack when terastallized with higher attack stat and the user is Terapagos-Stellar`, function () { + it(`should be a physical attack when terastallized with higher attack stat and the user is Terapagos-Stellar`, () => { battle = common.gen(9).createBattle([[ - {species: 'terapagos', evs: {atk: 252}, ability: 'terashift', moves: ['terastarstorm'], teraType: 'Stellar'}, + { species: 'terapagos', evs: { atk: 252 }, ability: 'terashift', moves: ['terastarstorm'], teraType: 'Stellar' }, ], [ - {species: 'regirock', moves: ['sleeptalk']}, + { species: 'regirock', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move terastarstorm terastallize', 'auto'); assert.equal(battle.p1.pokemon[0].lastMove.category, 'Physical'); }); - it(`should be a spread move when the user is Terapagos-Stellar`, function () { - battle = common.gen(9).createBattle({gameType: 'doubles'}, [[ - {species: 'terapagos', ability: 'terashift', moves: ['terastarstorm'], teraType: 'Stellar'}, - {species: 'pichu', moves: ['sleeptalk']}, + it(`should be a spread move when the user is Terapagos-Stellar`, () => { + battle = common.gen(9).createBattle({ gameType: 'doubles' }, [[ + { species: 'terapagos', ability: 'terashift', moves: ['terastarstorm'], teraType: 'Stellar' }, + { species: 'pichu', moves: ['sleeptalk'] }, ], [ - {species: 'regirock', moves: ['sleeptalk']}, - {species: 'registeel', moves: ['sleeptalk']}, + { species: 'regirock', moves: ['sleeptalk'] }, + { species: 'registeel', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move terastarstorm -2 terastallize, move sleeptalk', 'auto'); @@ -37,13 +37,13 @@ describe(`Tera Starstorm`, function () { assert.false.fullHP(battle.p2.active[1]); }); - it(`should only get its unique properties while the user is Terapagos-Stellar`, function () { - battle = common.gen(9).createBattle({gameType: 'doubles'}, [[ - {species: 'incineroar', moves: ['terastarstorm'], teraType: 'Stellar'}, - {species: 'pichu', moves: ['sleeptalk']}, + it(`should only get its unique properties while the user is Terapagos-Stellar`, () => { + battle = common.gen(9).createBattle({ gameType: 'doubles' }, [[ + { species: 'incineroar', moves: ['terastarstorm'], teraType: 'Stellar' }, + { species: 'pichu', moves: ['sleeptalk'] }, ], [ - {species: 'mismagius', moves: ['sleeptalk']}, - {species: 'registeel', moves: ['sleeptalk']}, + { species: 'mismagius', moves: ['sleeptalk'] }, + { species: 'registeel', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move terastarstorm 1 terastallize, move sleeptalk', 'auto'); diff --git a/test/sim/moves/thief.js b/test/sim/moves/thief.js index 3581f89f36..f681516cd5 100644 --- a/test/sim/moves/thief.js +++ b/test/sim/moves/thief.js @@ -5,31 +5,31 @@ const common = require('./../../common'); let battle; -describe('Thief', function () { - afterEach(function () { +describe('Thief', () => { + afterEach(() => { battle.destroy(); }); - it('should steal most items', function () { + it('should steal most items', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['thief']}]}); - battle.setPlayer('p2', {team: [{species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['thief'] }] }); + battle.setPlayer('p2', { team: [{ species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled'] }] }); battle.makeChoices('move thief', 'move softboiled'); assert.equal(battle.p1.active[0].item, 'shedshell'); }); - it('should not steal items if it is holding an item', function () { + it('should not steal items if it is holding an item', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', item: 'focussash', moves: ['thief']}]}); - battle.setPlayer('p2', {team: [{species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', item: 'focussash', moves: ['thief'] }] }); + battle.setPlayer('p2', { team: [{ species: "Blissey", ability: 'naturalcure', item: 'shedshell', moves: ['softboiled'] }] }); battle.makeChoices('move thief', 'move softboiled'); assert.equal(battle.p2.active[0].item, 'shedshell'); }); - it('should take Life Orb damage from a stolen Life Orb', function () { + it('should take Life Orb damage from a stolen Life Orb', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['thief']}]}); - battle.setPlayer('p2', {team: [{species: "Blissey", ability: 'naturalcure', item: 'lifeorb', moves: ['softboiled']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['thief'] }] }); + battle.setPlayer('p2', { team: [{ species: "Blissey", ability: 'naturalcure', item: 'lifeorb', moves: ['softboiled'] }] }); battle.makeChoices('move thief', 'move softboiled'); assert.equal(battle.p1.active[0].hp, Math.ceil(9 / 10 * battle.p1.active[0].maxhp)); }); diff --git a/test/sim/moves/thousandarrows.js b/test/sim/moves/thousandarrows.js index eceb097848..237dc8a0c3 100644 --- a/test/sim/moves/thousandarrows.js +++ b/test/sim/moves/thousandarrows.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Thousand Arrows', function () { - afterEach(function () { +describe('Thousand Arrows', () => { + afterEach(() => { battle.destroy(); }); - it(`should hit Flying-type Pokemon and remove their Ground immunity`, function () { + it(`should hit Flying-type Pokemon and remove their Ground immunity`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows', 'earthquake']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows', 'earthquake'] }, ], [ - {species: 'Tropius', moves: ['synthesis']}, + { species: 'Tropius', moves: ['synthesis'] }, ]]); const tropius = battle.p2.active[0]; battle.makeChoices(); @@ -23,11 +23,11 @@ describe('Thousand Arrows', function () { assert.false.fullHP(tropius); }); - it(`should ignore type effectiveness on the first hit against Flying-type Pokemon`, function () { + it(`should ignore type effectiveness on the first hit against Flying-type Pokemon`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows'] }, ], [ - {species: 'Ho-Oh', item: 'weaknesspolicy', moves: ['recover']}, + { species: 'Ho-Oh', item: 'weaknesspolicy', moves: ['recover'] }, ]]); const hooh = battle.p2.active[0]; battle.makeChoices(); @@ -38,21 +38,21 @@ describe('Thousand Arrows', function () { assert.statStage(hooh, 'spa', 2); }); - it(`should not ignore type effectiveness on the first hit against Flying-type Pokemon with Ring Target`, function () { + it(`should not ignore type effectiveness on the first hit against Flying-type Pokemon with Ring Target`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows'] }, ], [ - {species: 'Ho-Oh', ability: 'wonderguard', item: 'ringtarget', moves: ['recover']}, + { species: 'Ho-Oh', ability: 'wonderguard', item: 'ringtarget', moves: ['recover'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it(`should not ground or deal neutral damage to Flying-type Pokemon holding an Iron Ball`, function () { + it(`should not ground or deal neutral damage to Flying-type Pokemon holding an Iron Ball`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows', 'earthquake']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows', 'earthquake'] }, ], [ - {species: 'Ho-Oh', item: 'ironball', moves: ['recover', 'trick']}, + { species: 'Ho-Oh', item: 'ironball', moves: ['recover', 'trick'] }, ]]); const hooh = battle.p2.active[0]; @@ -65,11 +65,11 @@ describe('Thousand Arrows', function () { assert.equal(hp, hooh.hp); }); - it(`should not ground or deal neutral damage to Flying-type Pokemon affected by Gravity`, function () { + it(`should not ground or deal neutral damage to Flying-type Pokemon affected by Gravity`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows', 'sleeptalk']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows', 'sleeptalk'] }, ], [ - {species: 'Ho-Oh', moves: ['recover', 'gravity']}, + { species: 'Ho-Oh', moves: ['recover', 'gravity'] }, ]]); battle.makeChoices('move sleeptalk', 'move gravity'); @@ -84,11 +84,11 @@ describe('Thousand Arrows', function () { assert(battle.log[battle.lastMoveLine + 1].startsWith('|-supereffective|')); }); - it(`should hit Pokemon with Levitate and remove their Ground immunity`, function () { + it(`should hit Pokemon with Levitate and remove their Ground immunity`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows', 'earthquake']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows', 'earthquake'] }, ], [ - {species: 'Cresselia', moves: ['recover']}, + { species: 'Cresselia', moves: ['recover'] }, ]]); const cress = battle.p2.active[0]; battle.makeChoices(); @@ -97,11 +97,11 @@ describe('Thousand Arrows', function () { assert.false.fullHP(cress); }); - it(`should hit non-Flying-type Pokemon with Levitate with standard type effectiveness`, function () { + it(`should hit non-Flying-type Pokemon with Levitate with standard type effectiveness`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows'] }, ], [ - {species: 'Eelektross', ability: 'levitate', item: 'weaknesspolicy', moves: ['sleeptalk']}, + { species: 'Eelektross', ability: 'levitate', item: 'weaknesspolicy', moves: ['sleeptalk'] }, ]]); const eelektross = battle.p2.active[0]; battle.makeChoices(); @@ -109,11 +109,11 @@ describe('Thousand Arrows', function () { assert.statStage(eelektross, 'spa', 2); }); - it(`should hit Pokemon with Air Balloon`, function () { + it(`should hit Pokemon with Air Balloon`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows'] }, ], [ - {species: 'Donphan', item: 'airballoon', moves: ['sleeptalk']}, + { species: 'Donphan', item: 'airballoon', moves: ['sleeptalk'] }, ]]); const donphan = battle.p2.active[0]; battle.makeChoices(); @@ -121,31 +121,31 @@ describe('Thousand Arrows', function () { assert.false.holdsItem(donphan); }); - it(`should hit Electric-type Wonder Guard Pokemon holding an Air Balloon`, function () { + it(`should hit Electric-type Wonder Guard Pokemon holding an Air Balloon`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows'] }, ], [ - {species: 'Regieleki', ability: 'wonderguard', item: 'airballoon', moves: ['sleeptalk']}, + { species: 'Regieleki', ability: 'wonderguard', item: 'airballoon', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.false.fullHP(battle.p2.active[0]); }); - it(`should not hit Ground-type Pokemon when affected by Electrify`, function () { + it(`should not hit Ground-type Pokemon when affected by Electrify`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, moves: ['thousandarrows']}, + { species: 'Zygarde', level: 1, moves: ['thousandarrows'] }, ], [ - {species: 'Stunfisk', moves: ['electrify']}, + { species: 'Stunfisk', moves: ['electrify'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p2.active[0]); }); - it(`should not hit Ghost-type Pokemon when affected by Normalize`, function () { + it(`should not hit Ghost-type Pokemon when affected by Normalize`, () => { battle = common.createBattle([[ - {species: 'Zygarde', level: 1, ability: 'normalize', moves: ['thousandarrows']}, + { species: 'Zygarde', level: 1, ability: 'normalize', moves: ['thousandarrows'] }, ], [ - {species: 'Dusknoir', moves: ['sleeptalk']}, + { species: 'Dusknoir', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.fullHP(battle.p2.active[0]); diff --git a/test/sim/moves/thrash.js b/test/sim/moves/thrash.js index 94ee865a65..1140f6b1aa 100644 --- a/test/sim/moves/thrash.js +++ b/test/sim/moves/thrash.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Thrash [Gen 1]', function () { - afterEach(function () { +describe('Thrash [Gen 1]', () => { + afterEach(() => { battle.destroy(); }); - it("Three turn Thrash", function () { + it("Three turn Thrash", () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Golem", moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Golem", moves: ['splash'] }] }); const nidoking = battle.p1.active[0]; battle.makeChoices(); assert.equal(nidoking.volatiles['lockedmove'].time, 2); @@ -24,10 +24,10 @@ describe('Thrash [Gen 1]', function () { assert(nidoking.volatiles['confusion']); }); - it("Four turn Thrash", function () { - battle = common.gen(1).createBattle({seed: 'gen5,0001000100010001'}); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Golem", moves: ['splash']}]}); + it("Four turn Thrash", () => { + battle = common.gen(1).createBattle({ seed: 'gen5,0001000100010001' }); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Golem", moves: ['splash'] }] }); const nidoking = battle.p1.active[0]; battle.makeChoices(); assert.equal(nidoking.volatiles['lockedmove'].time, 3); @@ -39,28 +39,28 @@ describe('Thrash [Gen 1]', function () { assert(nidoking.volatiles['confusion']); }); - it("Thrash locks the user in, even if it targets a semi-invulnerable foe", function () { + it("Thrash locks the user in, even if it targets a semi-invulnerable foe", () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Aerodactyl", moves: ['fly']}]}); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Aerodactyl", moves: ['fly'] }] }); const nidoking = battle.p1.active[0]; battle.makeChoices(); assert(nidoking.volatiles['lockedmove']); }); - it("Thrash locks the user in, even if it targets a Ghost type", function () { + it("Thrash locks the user in, even if it targets a Ghost type", () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Gengar", moves: ['splash']}]}); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Gengar", moves: ['splash'] }] }); const nidoking = battle.p1.active[0]; battle.makeChoices(); assert(nidoking.volatiles['lockedmove']); }); - it("Thrash locks the user in, even if it targets and breaks a Substitute", function () { + it("Thrash locks the user in, even if it targets and breaks a Substitute", () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Alakazam", moves: ['substitute']}]}); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Alakazam", moves: ['substitute'] }] }); const nidoking = battle.p1.active[0]; const alakazam = battle.p2.active[0]; battle.makeChoices(); @@ -68,10 +68,10 @@ describe('Thrash [Gen 1]', function () { assert(alakazam.subFainted); }); - it("Thrash is paused when asleep or frozen", function () { + it("Thrash is paused when asleep or frozen", () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Parasect", moves: ['spore']}]}); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Parasect", moves: ['spore'] }] }); const nidoking = battle.p1.active[0]; for (let i = 0; i < 10; i++) { battle.makeChoices(); @@ -79,10 +79,10 @@ describe('Thrash [Gen 1]', function () { } }); - it("Thrash is paused when disabled", function () { - battle = common.gen(1).createBattle({seed: [1, 1, 1, 1]}); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Golem", moves: ['disable']}]}); + it("Thrash is paused when disabled", () => { + battle = common.gen(1).createBattle({ seed: [1, 1, 1, 1] }); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Golem", moves: ['disable'] }] }); const nidoking = battle.p1.active[0]; battle.makeChoices(); assert.equal(nidoking.volatiles['lockedmove'].time, 3); @@ -91,10 +91,10 @@ describe('Thrash [Gen 1]', function () { assert.equal(nidoking.volatiles['lockedmove'].time, 3); }); - it("Thrash accuracy bug", function () { - battle = common.gen(1).createBattle({seed: [1, 1, 1, 1]}); - battle.setPlayer('p1', {team: [{species: "Nidoking", moves: ['thrash']}]}); - battle.setPlayer('p2', {team: [{species: "Aerodactyl", moves: ['doubleteam']}]}); + it("Thrash accuracy bug", () => { + battle = common.gen(1).createBattle({ seed: [1, 1, 1, 1] }); + battle.setPlayer('p1', { team: [{ species: "Nidoking", moves: ['thrash'] }] }); + battle.setPlayer('p2', { team: [{ species: "Aerodactyl", moves: ['doubleteam'] }] }); const nidoking = battle.p1.active[0]; battle.makeChoices(); assert.equal(nidoking.volatiles['lockedmove'].accuracy, 168); diff --git a/test/sim/moves/thunderwave.js b/test/sim/moves/thunderwave.js index 64ee51fb4d..6dc18c6771 100644 --- a/test/sim/moves/thunderwave.js +++ b/test/sim/moves/thunderwave.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Thunder Wave', function () { - afterEach(function () { +describe('Thunder Wave', () => { + afterEach(() => { battle.destroy(); }); - it('should not ignore natural type immunities', function () { + it('should not ignore natural type immunities', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Jolteon", ability: 'quickfeet', moves: ['thunderwave']}]}); - battle.setPlayer('p2', {team: [{species: "Hippowdon", ability: 'sandforce', moves: ['slackoff']}]}); + battle.setPlayer('p1', { team: [{ species: "Jolteon", ability: 'quickfeet', moves: ['thunderwave'] }] }); + battle.setPlayer('p2', { team: [{ species: "Hippowdon", ability: 'sandforce', moves: ['slackoff'] }] }); battle.makeChoices('move thunderwave', 'move slackoff'); assert.equal(battle.p2.active[0].status, ''); }); diff --git a/test/sim/moves/toxic.js b/test/sim/moves/toxic.js index 401b65b2b7..16ae1f4c76 100644 --- a/test/sim/moves/toxic.js +++ b/test/sim/moves/toxic.js @@ -5,28 +5,28 @@ const common = require('./../../common'); let battle; -describe('Toxic', function () { - it('should always hit when used by a Poison-type', function () { +describe('Toxic', () => { + it('should always hit when used by a Poison-type', () => { battle = common.createBattle([ - [{species: "Naganadel", moves: ['toxic']}], - [{species: "Sigilyph", ability: 'wonderskin', moves: ['sleeptalk']}], + [{ species: "Naganadel", moves: ['toxic'] }], + [{ species: "Sigilyph", ability: 'wonderskin', moves: ['sleeptalk'] }], ]); battle.makeChoices('move toxic', 'move sleeptalk'); assert.equal(battle.p2.active[0].status, 'tox'); }); }); -describe('Toxic [Gen 7]', function () { - it('should set all moves to sure-hit until the end of the turn', function () { - battle = common.gen(7).createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Nidoking", moves: ['toxic', 'horndrill']}, - {species: "Oranguru", moves: ['trickroom', 'instruct']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Dugtrio", moves: ['dig']}, - {species: "Wynaut", moves: ['splash']}, - ]}); +describe('Toxic [Gen 7]', () => { + it('should set all moves to sure-hit until the end of the turn', () => { + battle = common.gen(7).createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Nidoking", moves: ['toxic', 'horndrill'] }, + { species: "Oranguru", moves: ['trickroom', 'instruct'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Dugtrio", moves: ['dig'] }, + { species: "Wynaut", moves: ['splash'] }, + ] }); battle.makeChoices('move toxic 1, move trickroom', 'move dig 2, move splash'); assert.equal(battle.p2.active[0].status, 'tox'); battle.makeChoices('move horndrill 2, move instruct -1', 'move dig 2, move splash'); diff --git a/test/sim/moves/transform.js b/test/sim/moves/transform.js index 04771f113b..438caadb84 100644 --- a/test/sim/moves/transform.js +++ b/test/sim/moves/transform.js @@ -5,23 +5,23 @@ const common = require('./../../common'); let battle; -describe('Transform', function () { - afterEach(function () { +describe('Transform', () => { + afterEach(() => { battle.destroy(); }); - it('should copy the Pokemon\'s species', function () { + it('should copy the Pokemon\'s species', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Hoopa-Unbound", ability: 'magician', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Hoopa-Unbound", ability: 'magician', moves: ['rest'] }] }); battle.makeChoices('move transform', 'move rest'); assert.equal(battle.p1.active[0].species, battle.p2.active[0].species); }); - it('should copy all stats except HP', function () { + it('should copy all stats except HP', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Mewtwo", ability: 'pressure', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Mewtwo", ability: 'pressure', moves: ['rest'] }] }); battle.makeChoices('move transform', 'move rest'); const p1poke = battle.p1.active[0]; const p2poke = battle.p2.active[0]; @@ -32,10 +32,10 @@ describe('Transform', function () { assert.notEqual(p1poke.maxhp, p2poke.maxhp); }); - it('should copy all stat changes', function () { + it('should copy all stat changes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', item: 'laggingtail', moves: ['calmmind', 'agility', 'transform']}]}); - battle.setPlayer('p2', {team: [{species: "Scolipede", ability: 'swarm', moves: ['honeclaws', 'irondefense', 'doubleteam']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', item: 'laggingtail', moves: ['calmmind', 'agility', 'transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Scolipede", ability: 'swarm', moves: ['honeclaws', 'irondefense', 'doubleteam'] }] }); for (let i = 1; i <= 3; i++) { battle.makeChoices('move ' + i, 'move ' + i); } @@ -46,18 +46,18 @@ describe('Transform', function () { } }); - it("should copy the target's focus energy status", function () { + it("should copy the target's focus energy status", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Sawk", ability: 'sturdy', moves: ['focusenergy']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sawk", ability: 'sturdy', moves: ['focusenergy'] }] }); battle.makeChoices('move transform', 'move focusenergy'); assert(battle.p1.active[0].volatiles['focusenergy']); }); - it('should copy the target\'s moves with 5 PP each', function () { + it('should copy the target\'s moves with 5 PP each', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Mew", ability: 'synchronize', moves: ['rest', 'psychic', 'energyball', 'hyperbeam']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Mew", ability: 'synchronize', moves: ['rest', 'psychic', 'energyball', 'hyperbeam'] }] }); const p1poke = battle.p1.active[0]; const p2poke = battle.p2.active[0]; battle.makeChoices('move transform', 'move rest'); @@ -71,61 +71,61 @@ describe('Transform', function () { } }); - it(`should copy and activate the target's Ability`, function () { + it(`should copy and activate the target's Ability`, () => { battle = common.createBattle([[ - {species: 'Ditto', ability: 'limber', moves: ['transform']}, + { species: 'Ditto', ability: 'limber', moves: ['transform'] }, ], [ - {species: 'Arcanine', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'Arcanine', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'atk', -1); }); - it(`should copy, but not activate the target's Ability if it is the same as the user's pre-Transform`, function () { + it(`should copy, but not activate the target's Ability if it is the same as the user's pre-Transform`, () => { battle = common.createBattle([[ - {species: 'Ditto', ability: 'intimidate', moves: ['transform']}, + { species: 'Ditto', ability: 'intimidate', moves: ['transform'] }, ], [ - {species: 'Arcanine', ability: 'intimidate', moves: ['sleeptalk']}, + { species: 'Arcanine', ability: 'intimidate', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); assert.statStage(battle.p2.active[0], 'atk', -1); }); - it('should not copy speed boosts from Unburden', function () { + it('should not copy speed boosts from Unburden', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Hitmonlee", ability: 'unburden', item: 'normalgem', moves: ['feint']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Hitmonlee", ability: 'unburden', item: 'normalgem', moves: ['feint'] }] }); battle.makeChoices('move transform', 'move feint'); assert.notEqual(battle.p1.active[0].getStat('spe'), battle.p2.active[0].getStat('spe')); }); - it('should fail against Pokemon with a Substitute', function () { + it('should fail against Pokemon with a Substitute', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Mewtwo", ability: 'pressure', moves: ['substitute']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Mewtwo", ability: 'pressure', moves: ['substitute'] }] }); battle.makeChoices('move transform', 'move substitute'); assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); }); - it(`should fail if either the user or target have Illusion active`, function () { + it(`should fail if either the user or target have Illusion active`, () => { battle = common.createBattle([[ - {species: 'Ditto', ability: 'limber', moves: ['transform']}, + { species: 'Ditto', ability: 'limber', moves: ['transform'] }, ], [ - {species: "Zoroark", ability: 'illusion', moves: ['transform']}, - {species: "Mewtwo", ability: 'pressure', moves: ['rest']}, + { species: "Zoroark", ability: 'illusion', moves: ['transform'] }, + { species: "Mewtwo", ability: 'pressure', moves: ['rest'] }, ]]); battle.makeChoices(); assert.species(battle.p1.active[0], 'Ditto'); assert.species(battle.p2.active[0], 'Zoroark'); }); - it('should fail against tranformed Pokemon', function () { + it('should fail against tranformed Pokemon', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [ - {species: "Magikarp", ability: 'rattled', moves: ['splash']}, - {species: "Mew", ability: 'synchronize', moves: ['transform']}, - ]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [ + { species: "Magikarp", ability: 'rattled', moves: ['splash'] }, + { species: "Mew", ability: 'synchronize', moves: ['transform'] }, + ] }); battle.makeChoices('move transform', 'move splash'); assert.equal(battle.p1.active[0].species, battle.p2.active[0].species); battle.makeChoices('move splash', 'switch 2'); @@ -133,30 +133,30 @@ describe('Transform', function () { assert.notEqual(battle.p1.active[0].species, battle.p2.active[0].species); }); - it(`should copy the target's real type, even if the target is an Arceus`, function () { + it(`should copy the target's real type, even if the target is an Arceus`, () => { battle = common.createBattle([ - [{species: "Ditto", ability: 'limber', item: 'flameplate', moves: ['transform']}], - [{species: "Arceus-Steel", ability: 'multitype', item: 'ironplate', moves: ['rest']}], + [{ species: "Ditto", ability: 'limber', item: 'flameplate', moves: ['transform'] }], + [{ species: "Arceus-Steel", ability: 'multitype', item: 'ironplate', moves: ['rest'] }], ]); battle.makeChoices('move transform', 'move rest'); assert.deepEqual(battle.p1.active[0].getTypes(), ["Steel"]); }); - it(`should ignore the effects of Roost`, function () { + it(`should ignore the effects of Roost`, () => { battle = common.createBattle([ - [{species: "Mew", ability: 'synchronize', moves: ['seismictoss', 'transform']}], - [{species: "Talonflame", ability: 'flamebody', moves: ['roost']}], + [{ species: "Mew", ability: 'synchronize', moves: ['seismictoss', 'transform'] }], + [{ species: "Talonflame", ability: 'flamebody', moves: ['roost'] }], ]); battle.makeChoices('move seismictoss', 'move roost'); battle.makeChoices('move transform', 'move roost'); assert.deepEqual(battle.p1.active[0].getTypes(), ["Fire", "Flying"]); }); - it(`should not announce that its ability was suppressed after Transforming`, function () { + it(`should not announce that its ability was suppressed after Transforming`, () => { battle = common.createBattle([[ - {species: "Mew", ability: 'synchronize', moves: ['transform']}, + { species: "Mew", ability: 'synchronize', moves: ['transform'] }, ], [ - {species: 'roggenrola', ability: 'sturdy', moves: ['sleeptalk']}, + { species: 'roggenrola', ability: 'sturdy', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); const log = battle.getDebugLog(); @@ -165,16 +165,16 @@ describe('Transform', function () { }); }); -describe('Transform [Gen 9]', function () { - afterEach(function () { +describe('Transform [Gen 9]', () => { + afterEach(() => { battle.destroy(); }); - it("should copy the target's old types, not the Tera Type", function () { + it("should copy the target's old types, not the Tera Type", () => { battle = common.gen(9).createBattle([[ - {species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire"}, + { species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire" }, ], [ - {species: "Ampharos", ability: "static", moves: ['sleeptalk'], teraType: "Dragon"}, + { species: "Ampharos", ability: "static", moves: ['sleeptalk'], teraType: "Dragon" }, ]]); battle.makeChoices('auto', 'move sleeptalk terastallize'); assert.equal(battle.p1.active[0].getTypes().join('/'), 'Electric'); @@ -182,52 +182,52 @@ describe('Transform [Gen 9]', function () { assert.equal(battle.p1.active[0].getTypes().join('/'), 'Fire'); }); - it("should keep the user's Tera Type when Terastallized", function () { + it("should keep the user's Tera Type when Terastallized", () => { battle = common.gen(9).createBattle([[ - {species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire"}, + { species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire" }, ], [ - {species: "Ampharos", ability: "static", moves: ['sleeptalk'], teraType: "Dragon"}, + { species: "Ampharos", ability: "static", moves: ['sleeptalk'], teraType: "Dragon" }, ]]); battle.makeChoices('move transform terastallize', 'move sleeptalk terastallize'); assert.equal(battle.p1.active[0].getTypes().join('/'), 'Fire'); }); - it("should fail against Ogerpon when the user is Terastallized", function () { + it("should fail against Ogerpon when the user is Terastallized", () => { battle = common.gen(9).createBattle([[ - {species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire"}, + { species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire" }, ], [ - {species: "Ogerpon", ability: "defiant", moves: ['sleeptalk'], teraType: "Grass"}, + { species: "Ogerpon", ability: "defiant", moves: ['sleeptalk'], teraType: "Grass" }, ]]); battle.makeChoices('move transform terastallize', 'move sleeptalk'); assert.false(battle.p1.active[0].transformed); }); - it("should fail against Ogerpon when Ogerpon is Terastallized", function () { + it("should fail against Ogerpon when Ogerpon is Terastallized", () => { battle = common.gen(9).createBattle([[ - {species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire"}, + { species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire" }, ], [ - {species: "Ogerpon", ability: "defiant", moves: ['sleeptalk'], teraType: "Grass"}, + { species: "Ogerpon", ability: "defiant", moves: ['sleeptalk'], teraType: "Grass" }, ]]); battle.makeChoices('move transform', 'move sleeptalk terastallize'); assert.false(battle.p1.active[0].transformed); }); - it("should prevent Pokemon transformed into Ogerpon from Terastallizing", function () { + it("should prevent Pokemon transformed into Ogerpon from Terastallizing", () => { battle = common.gen(9).createBattle([[ - {species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire"}, + { species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire" }, ], [ - {species: "Ogerpon", ability: "defiant", moves: ['sleeptalk'], teraType: "Grass"}, + { species: "Ogerpon", ability: "defiant", moves: ['sleeptalk'], teraType: "Grass" }, ]]); battle.makeChoices(); assert.cantMove(() => battle.choose('p1', 'move sleeptalk terastallize')); }); - it("should not allow Pokemon transformed into Ogerpon to Terastallize later if they couldn't before transforming", function () { - battle = common.gen(9).createBattle({formatid: 'gen9customgame@@@!teampreview,terastalclause'}, [[ - {species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire"}, - {species: "Shedinja", ability: "wonderguard", moves: ['transform'], teraType: "Fire"}, + it("should not allow Pokemon transformed into Ogerpon to Terastallize later if they couldn't before transforming", () => { + battle = common.gen(9).createBattle({ formatid: 'gen9customgame@@@!teampreview,terastalclause' }, [[ + { species: "Ditto", ability: "limber", moves: ['transform'], teraType: "Fire" }, + { species: "Shedinja", ability: "wonderguard", moves: ['transform'], teraType: "Fire" }, ], [ - {species: "Ogerpon", ability: "defiant", moves: ['spikes'], teraType: "Grass"}, + { species: "Ogerpon", ability: "defiant", moves: ['spikes'], teraType: "Grass" }, ]]); battle.makeChoices(); battle.makeChoices('switch 2', 'default'); @@ -236,93 +236,93 @@ describe('Transform [Gen 9]', function () { assert.cantMove(() => battle.choose('p1', 'move transform terastallize')); }); - it(`should not work if the user is Tera Stellar`, function () { + it(`should not work if the user is Tera Stellar`, () => { battle = common.gen(9).createBattle([[ - {species: 'Ditto', ability: 'limber', moves: ['transform'], teraType: 'Stellar'}, + { species: 'Ditto', ability: 'limber', moves: ['transform'], teraType: 'Stellar' }, ], [ - {species: 'Wynaut', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk'] }, ]]); battle.makeChoices('move transform terastallize', 'auto'); assert.false(battle.p1.active[0].transformed); }); }); -describe('Transform [Gen 5]', function () { - afterEach(function () { +describe('Transform [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it("should not copy the target's focus energy status", function () { + it("should not copy the target's focus energy status", () => { battle = common.gen(5).createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", ability: 'limber', moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Sawk", ability: 'sturdy', moves: ['focusenergy']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", ability: 'limber', moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Sawk", ability: 'sturdy', moves: ['focusenergy'] }] }); assert.constant(() => battle.p1.active[0].volatiles['focusenergy'], () => battle.makeChoices('move transform', 'move focusenergy')); }); }); -describe('Transform [Gen 4]', function () { - afterEach(function () { +describe('Transform [Gen 4]', () => { + afterEach(() => { battle.destroy(); }); - it('should revert Pokemon transformed into Giratina-Origin to Giratina-Alternate if not holding a Griseous Orb', function () { + it('should revert Pokemon transformed into Giratina-Origin to Giratina-Alternate if not holding a Griseous Orb', () => { battle = common.gen(4).createBattle([ - [{species: "Ditto", ability: 'limber', moves: ['transform']}], - [{species: "Giratina-Origin", ability: 'levitate', item: 'griseousorb', moves: ['rest']}], + [{ species: "Ditto", ability: 'limber', moves: ['transform'] }], + [{ species: "Giratina-Origin", ability: 'levitate', item: 'griseousorb', moves: ['rest'] }], ]); battle.makeChoices('move transform', 'move rest'); assert.equal(battle.p1.active[0].species.name, 'Giratina'); }); - it('should cause Pokemon transformed into Giratina-Alternate to become Giratina-Origin if holding a Griseous Orb', function () { + it('should cause Pokemon transformed into Giratina-Alternate to become Giratina-Origin if holding a Griseous Orb', () => { battle = common.gen(4).createBattle([ - [{species: "Ditto", ability: 'limber', item: 'griseousorb', moves: ['transform']}], - [{species: "Giratina", ability: 'pressure', moves: ['rest']}], + [{ species: "Ditto", ability: 'limber', item: 'griseousorb', moves: ['transform'] }], + [{ species: "Giratina", ability: 'pressure', moves: ['rest'] }], ]); battle.makeChoices('move transform', 'move rest'); assert.equal(battle.p1.active[0].species.name, 'Giratina-Origin'); }); - it('should cause Pokemon transformed into Arceus to become an Arceus forme corresponding to its held Plate', function () { + it('should cause Pokemon transformed into Arceus to become an Arceus forme corresponding to its held Plate', () => { battle = common.gen(4).createBattle([ - [{species: "Ditto", ability: 'limber', item: 'flameplate', moves: ['transform']}], - [{species: "Arceus-Steel", ability: 'multitype', item: 'ironplate', moves: ['rest']}], + [{ species: "Ditto", ability: 'limber', item: 'flameplate', moves: ['transform'] }], + [{ species: "Arceus-Steel", ability: 'multitype', item: 'ironplate', moves: ['rest'] }], ]); battle.makeChoices('move transform', 'move rest'); assert.equal(battle.p1.active[0].species.name, 'Arceus-Fire'); assert.deepEqual(battle.p1.active[0].getTypes(), ["Fire"]); }); - it('should succeed against a Substitute', function () { + it('should succeed against a Substitute', () => { battle = common.gen(4).createBattle([ - [{species: "Ditto", ability: 'limber', moves: ['transform']}], - [{species: "Mewtwo", ability: 'pressure', moves: ['substitute']}], + [{ species: "Ditto", ability: 'limber', moves: ['transform'] }], + [{ species: "Mewtwo", ability: 'pressure', moves: ['substitute'] }], ]); battle.makeChoices('move transform', 'move substitute'); assert.equal(battle.p1.active[0].species, battle.p2.active[0].species); }); }); -describe('Transform [Gen 1]', function () { - afterEach(function () { +describe('Transform [Gen 1]', () => { + afterEach(() => { battle.destroy(); }); - it("should not send |-endability|", function () { + it("should not send |-endability|", () => { battle = common.gen(1).createBattle(); - battle.setPlayer('p1', {team: [{species: "Ditto", moves: ['transform']}]}); - battle.setPlayer('p2', {team: [{species: "Gengar", moves: ['lick']}]}); + battle.setPlayer('p1', { team: [{ species: "Ditto", moves: ['transform'] }] }); + battle.setPlayer('p2', { team: [{ species: "Gengar", moves: ['lick'] }] }); battle.makeChoices('move transform', 'move lick'); assert(battle.log.every(line => !line.startsWith('|-endability|'))); }); - it(`should copy the target's boosted stats`, function () { - battle = common.gen(1).createBattle({forceRandomChance: false}, [[ // disable crits - {species: 'Ditto', moves: ['transform']}, + it(`should copy the target's boosted stats`, () => { + battle = common.gen(1).createBattle({ forceRandomChance: false }, [[ // disable crits + { species: 'Ditto', moves: ['transform'] }, ], [ - {species: 'Gengar', moves: ['amnesia', 'thunderbolt']}, - {species: 'Starmie', moves: ['recover']}, + { species: 'Gengar', moves: ['amnesia', 'thunderbolt'] }, + { species: 'Starmie', moves: ['recover'] }, ]]); // Set all moves to perfect accuracy battle.onEvent('Accuracy', battle.format, true); @@ -332,11 +332,11 @@ describe('Transform [Gen 1]', function () { assert.fainted(battle.p2.active[0]); }); - it(`should copy the target's stats (except HP), even if different level`, function () { + it(`should copy the target's stats (except HP), even if different level`, () => { battle = common.gen(1).createBattle([[ - {species: 'Ditto', moves: ['transform'], level: 5}, + { species: 'Ditto', moves: ['transform'], level: 5 }, ], [ - {species: 'Gengar', moves: ['splash']}, + { species: 'Gengar', moves: ['splash'] }, ]]); battle.makeChoices(); const p1poke = battle.p1.active[0]; @@ -347,11 +347,11 @@ describe('Transform [Gen 1]', function () { } }); - it(`should copy the target's status-modified stats`, function () { + it(`should copy the target's status-modified stats`, () => { battle = common.gen(1).createBattle([[ - {species: 'Ditto', moves: ['transform', 'thunderwave']}, + { species: 'Ditto', moves: ['transform', 'thunderwave'] }, ], [ - {species: 'Gengar', moves: ['splash']}, + { species: 'Gengar', moves: ['splash'] }, ]]); battle.makeChoices('move thunderwave', 'move splash'); battle.makeChoices('move transform', 'move splash'); @@ -361,11 +361,11 @@ describe('Transform [Gen 1]', function () { assert.equal(p1poke.modifiedStats['spe'], p2poke.modifiedStats['spe']); }); - it(`should not re-apply status stat modifier after transforming`, function () { + it(`should not re-apply status stat modifier after transforming`, () => { battle = common.gen(1).createBattle([[ - {species: 'Ditto', moves: ['transform', 'splash']}, + { species: 'Ditto', moves: ['transform', 'splash'] }, ], [ - {species: 'Gengar', moves: ['splash', 'thunderwave']}, + { species: 'Gengar', moves: ['splash', 'thunderwave'] }, ]]); battle.makeChoices('move splash', 'move thunderwave'); do { diff --git a/test/sim/moves/trick.js b/test/sim/moves/trick.js index a7df6bd5f9..23eaa0866b 100644 --- a/test/sim/moves/trick.js +++ b/test/sim/moves/trick.js @@ -5,74 +5,74 @@ const common = require('./../../common'); let battle; -describe('Trick', function () { +describe('Trick', () => { afterEach(() => battle.destroy()); - it("should exchange the items of the user and target", function () { + it("should exchange the items of the user and target", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', item: 'leftovers', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Purugly", ability: 'defiant', item: 'sitrusberry', moves: ['rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', item: 'leftovers', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Purugly", ability: 'defiant', item: 'sitrusberry', moves: ['rest'] }] }); battle.makeChoices('move trick', 'move rest'); assert.equal(battle.p1.active[0].item, 'sitrusberry'); assert.equal(battle.p2.active[0].item, 'leftovers'); }); - it('should not take plates from Arceus', function () { + it('should not take plates from Arceus', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Arceus", ability: 'download', item: 'flameplate', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Arceus", ability: 'download', item: 'flameplate', moves: ['swordsdance'] }] }); battle.makeChoices('move trick', 'move swordsdance'); assert.equal(battle.p2.active[0].item, 'flameplate'); }); - it('should not cause Arceus to gain a plate', function () { + it('should not cause Arceus to gain a plate', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', item: 'fistplate', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Arceus", ability: 'download', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', item: 'fistplate', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Arceus", ability: 'download', moves: ['swordsdance'] }] }); battle.makeChoices('move trick', 'move swordsdance'); assert.equal(battle.p2.active[0].item, ''); }); - it('should not remove drives from Genesect', function () { + it('should not remove drives from Genesect', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Genesect", ability: 'download', item: 'dousedrive', moves: ['shiftgear']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Genesect", ability: 'download', item: 'dousedrive', moves: ['shiftgear'] }] }); battle.makeChoices('move trick', 'move shiftgear'); assert.equal(battle.p2.active[0].item, 'dousedrive'); }); - it('should not cause Genesect to gain a drive', function () { + it('should not cause Genesect to gain a drive', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', item: 'shockdrive', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Genesect", ability: 'download', moves: ['shiftgear']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', item: 'shockdrive', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Genesect", ability: 'download', moves: ['shiftgear'] }] }); battle.makeChoices('move trick', 'move shiftgear'); assert.equal(battle.p2.active[0].item, ''); }); - it('should not remove correctly held mega stones', function () { + it('should not remove correctly held mega stones', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Scizor", ability: 'technician', item: 'scizorite', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Scizor", ability: 'technician', item: 'scizorite', moves: ['swordsdance'] }] }); battle.makeChoices('move trick', 'move swordsdance'); assert.equal(battle.p2.active[0].item, 'scizorite'); }); - it('should remove wrong mega stones', function () { + it('should remove wrong mega stones', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Scizor", ability: 'technician', item: 'audinite', moves: ['swordsdance']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Scizor", ability: 'technician', item: 'audinite', moves: ['swordsdance'] }] }); battle.makeChoices('move trick', 'move swordsdance'); assert.equal(battle.p1.active[0].item, 'audinite'); }); }); -describe('Z-Trick', function () { +describe('Z-Trick', () => { afterEach(() => battle.destroy()); - it("boost the user's Speed by 2 stages, but should fail to exchange the items", function () { + it("boost the user's Speed by 2 stages, but should fail to exchange the items", () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Mew", ability: 'synchronize', item: 'psychiumz', moves: ['trick']}]}); - battle.setPlayer('p2', {team: [{species: "Rattata", ability: 'guts', item: 'leftovers', moves: ['quickattack']}]}); + battle.setPlayer('p1', { team: [{ species: "Mew", ability: 'synchronize', item: 'psychiumz', moves: ['trick'] }] }); + battle.setPlayer('p2', { team: [{ species: "Rattata", ability: 'guts', item: 'leftovers', moves: ['quickattack'] }] }); const [user, nonTarget] = [battle.p1.active[0], battle.p2.active[0]]; battle.makeChoices('move trick zmove', 'move quickattack'); assert.statStage(user, 'spe', 2); diff --git a/test/sim/moves/trickroom.js b/test/sim/moves/trickroom.js index de37738b10..f2af482e06 100644 --- a/test/sim/moves/trickroom.js +++ b/test/sim/moves/trickroom.js @@ -5,15 +5,15 @@ const common = require('./../../common'); let battle; -describe('Trick Room', function () { - afterEach(function () { +describe('Trick Room', () => { + afterEach(() => { battle.destroy(); }); - it('should cause slower Pokemon to move before faster Pokemon in a priority bracket', function () { + it('should cause slower Pokemon to move before faster Pokemon in a priority bracket', () => { battle = common.createBattle([ - [{species: 'Bronzong', ability: 'heatproof', moves: ['spore', 'trickroom']}], - [{species: 'Ninjask', ability: 'speedboost', moves: ['poisonjab', 'spore']}], + [{ species: 'Bronzong', ability: 'heatproof', moves: ['spore', 'trickroom'] }], + [{ species: 'Ninjask', ability: 'speedboost', moves: ['poisonjab', 'spore'] }], ]); battle.makeChoices('move trickroom', 'move poisonjab'); battle.makeChoices('move spore', 'move spore'); @@ -21,10 +21,10 @@ describe('Trick Room', function () { assert.equal(battle.p2.active[0].status, 'slp'); }); - it('should not allow Pokemon using a lower priority move to act before other Pokemon', function () { + it('should not allow Pokemon using a lower priority move to act before other Pokemon', () => { battle = common.createBattle([ - [{species: 'Bronzong', ability: 'heatproof', moves: ['spore', 'trickroom']}], - [{species: 'Ninjask', ability: 'speedboost', moves: ['poisonjab', 'protect']}], + [{ species: 'Bronzong', ability: 'heatproof', moves: ['spore', 'trickroom'] }], + [{ species: 'Ninjask', ability: 'speedboost', moves: ['poisonjab', 'protect'] }], ]); battle.makeChoices('move trickroom', 'move poisonjab'); battle.makeChoices('move spore', 'move protect'); @@ -32,16 +32,16 @@ describe('Trick Room', function () { assert.equal(battle.p2.active[0].status, ''); }); - it('should also affect the activation order for abilities and other non-move actions', function () { + it('should also affect the activation order for abilities and other non-move actions', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: 'Bronzong', ability: 'heatproof', moves: ['trickroom', 'explosion']}, - {species: 'Hippowdon', ability: 'sandstream', moves: ['protect']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: 'Ninjask', ability: 'speedboost', moves: ['shellsmash']}, - {species: 'Ninetales', ability: 'drought', moves: ['protect']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: 'Bronzong', ability: 'heatproof', moves: ['trickroom', 'explosion'] }, + { species: 'Hippowdon', ability: 'sandstream', moves: ['protect'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: 'Ninjask', ability: 'speedboost', moves: ['shellsmash'] }, + { species: 'Ninetales', ability: 'drought', moves: ['protect'] }, + ] }); battle.makeChoices('move trickroom', 'move shellsmash'); battle.makeChoices('move explosion', 'move shellsmash'); battle.makeChoices('switch hippowdon', 'switch ninetales'); @@ -52,18 +52,18 @@ describe('Trick Room', function () { // The following two tests involve the Trick Room glitch, where turn order changes when a Pokemon goes to 1809 speed. - it('should roll over and cause Pokemon with 1809 or more speed to outspeed Pokemon with 1808 or less', function () { + it('should roll over and cause Pokemon with 1809 or more speed to outspeed Pokemon with 1808 or less', () => { battle = common.createBattle([ - [{species: 'Ninjask', ability: 'swarm', evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 184}, moves: ['protect', 'spore']}], - [{species: 'Deoxys-Speed', ability: 'pressure', evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 224}, moves: ['spore', 'trickroom']}], + [{ species: 'Ninjask', ability: 'swarm', evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 184 }, moves: ['protect', 'spore'] }], + [{ species: 'Deoxys-Speed', ability: 'pressure', evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 224 }, moves: ['spore', 'trickroom'] }], ]); battle.makeChoices('move protect', 'move trickroom'); // Trick Room is now up. // This sets Ninjask to exactly 1809 Speed - battle.p1.active[0].boostBy({spe: 4}); + battle.p1.active[0].boostBy({ spe: 4 }); battle.p1.active[0].setItem('choicescarf'); // This sets Deoxys to exactly 1808 Speed - battle.p2.active[0].boostBy({spe: 6}); + battle.p2.active[0].boostBy({ spe: 6 }); battle.makeChoices('move spore', 'move spore'); assert.equal(battle.p1.active[0].status, ''); @@ -75,17 +75,17 @@ describe('Trick Room', function () { assert.equal(battle.p2.active[0].status, 'slp'); }); - it('should not affect damage dealt by moves whose power is reliant on speed', function () { + it('should not affect damage dealt by moves whose power is reliant on speed', () => { battle = common.createBattle([ - [{species: 'Ninjask', ability: 'swarm', evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 184}, item: 'choicescarf', moves: ['earthquake']}], - [{species: 'Deoxys-Speed', ability: 'levitate', evs: {hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 224}, moves: ['gyroball', 'trickroom']}], + [{ species: 'Ninjask', ability: 'swarm', evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 184 }, item: 'choicescarf', moves: ['earthquake'] }], + [{ species: 'Deoxys-Speed', ability: 'levitate', evs: { hp: 0, atk: 0, def: 0, spa: 0, spd: 0, spe: 224 }, moves: ['gyroball', 'trickroom'] }], ]); battle.makeChoices('move earthquake', 'move trickroom'); - battle.p1.active[0].boostBy({spe: 4}); // 1809 Speed - battle.p2.active[0].boostBy({spe: 6}); // 1808 Speed + battle.p1.active[0].boostBy({ spe: 4 }); // 1809 Speed + battle.p2.active[0].boostBy({ spe: 6 }); // 1808 Speed - battle.onEvent('BasePower', battle.format, function (bp, pokemon, target, move) { + battle.onEvent('BasePower', battle.format, (bp, pokemon, target, move) => { if (move.id !== 'gyroball') return; assert.equal(bp, 26); // BP should theoretically be this based on speed values }); diff --git a/test/sim/moves/trumpcard.js b/test/sim/moves/trumpcard.js index 1b1663274d..4107ce267c 100644 --- a/test/sim/moves/trumpcard.js +++ b/test/sim/moves/trumpcard.js @@ -5,19 +5,19 @@ const common = require('./../../common'); let battle; -describe('Trump Card', function () { - afterEach(function () { +describe('Trump Card', () => { + afterEach(() => { battle.destroy(); }); - it('should power-up the less PP the move has', function () { + it('should power-up the less PP the move has', () => { battle = common.createBattle([ - [{species: 'Eevee', ability: 'runaway', moves: ['trumpcard']}], - [{species: 'Lugia', ability: 'multiscale', moves: ['recover']}], + [{ species: 'Eevee', ability: 'runaway', moves: ['trumpcard'] }], + [{ species: 'Lugia', ability: 'multiscale', moves: ['recover'] }], ]); const basePowers = []; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'trumpcard') { basePowers.push(bp); } @@ -30,14 +30,14 @@ describe('Trump Card', function () { assert.deepEqual(basePowers, [40, 50, 60, 80, 200]); }); - it('should get its base power calculated from a move calling it', function () { + it('should get its base power calculated from a move calling it', () => { battle = common.createBattle([ - [{species: 'Komala', ability: 'comatose', moves: ['sleeptalk', 'trumpcard']}], - [{species: 'Lugia', ability: 'multiscale', moves: ['recover']}], + [{ species: 'Komala', ability: 'comatose', moves: ['sleeptalk', 'trumpcard'] }], + [{ species: 'Lugia', ability: 'multiscale', moves: ['recover'] }], ]); const basePowers = []; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'trumpcard') { basePowers.push(bp); } @@ -52,14 +52,14 @@ describe('Trump Card', function () { assert.deepEqual(basePowers, [80, 200]); }); - it('should work if called via Custap Berry in Gen 4', function () { + it('should work if called via Custap Berry in Gen 4', () => { battle = common.gen(4).createBattle([ - [{species: 'Eevee', level: 1, ability: 'runaway', item: 'custapberry', moves: ['trumpcard']}], - [{species: 'Scizor', ability: 'technician', moves: ['falseswipe']}], + [{ species: 'Eevee', level: 1, ability: 'runaway', item: 'custapberry', moves: ['trumpcard'] }], + [{ species: 'Scizor', ability: 'technician', moves: ['falseswipe'] }], ]); const basePowers = []; - battle.onEvent('BasePower', battle.format, function (bp, attacker, defender, move) { + battle.onEvent('BasePower', battle.format, (bp, attacker, defender, move) => { if (move.id === 'trumpcard') { basePowers.push(bp); } diff --git a/test/sim/moves/uproar.js b/test/sim/moves/uproar.js index 29af056a8b..fbed34283f 100644 --- a/test/sim/moves/uproar.js +++ b/test/sim/moves/uproar.js @@ -5,38 +5,38 @@ const common = require('./../../common'); let battle; -describe('Uproar', function () { - afterEach(function () { +describe('Uproar', () => { + afterEach(() => { battle.destroy(); }); - it('should pierce through substitutes', function () { + it('should pierce through substitutes', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'uproar']}]}); - battle.setPlayer('p2', {team: [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}]}); + battle.setPlayer('p1', { team: [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'uproar'] }] }); + battle.setPlayer('p2', { team: [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }] }); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move uproar', 'move rest'); assert.equal(battle.p2.active[0].item, ''); }); - it('should end if the user is under the effect of Throat Chop', function () { + it('should end if the user is under the effect of Throat Chop', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [{species: "Zoroark", moves: ['uproar']}]}); - battle.setPlayer('p2', {team: [{species: "Corsola", moves: ['throatchop']}]}); + battle.setPlayer('p1', { team: [{ species: "Zoroark", moves: ['uproar'] }] }); + battle.setPlayer('p2', { team: [{ species: "Corsola", moves: ['throatchop'] }] }); battle.makeChoices('move uproar', 'move throatchop'); assert.equal(battle.p1.active[0].volatiles['uproar'], undefined); }); }); -describe('Uproar [Gen 5]', function () { - afterEach(function () { +describe('Uproar [Gen 5]', () => { + afterEach(() => { battle.destroy(); }); - it('should not pierce through substitutes', function () { + it('should not pierce through substitutes', () => { battle = common.gen(5).createBattle([ - [{species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'uproar']}], - [{species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest']}], + [{ species: "Deoxys-Attack", ability: 'victorystar', item: 'laggingtail', moves: ['splash', 'uproar'] }], + [{ species: "Caterpie", level: 2, ability: 'naturalcure', item: 'focussash', moves: ['substitute', 'rest'] }], ]); battle.makeChoices('move splash', 'move substitute'); battle.makeChoices('move uproar', 'move rest'); diff --git a/test/sim/moves/uturn.js b/test/sim/moves/uturn.js index 6a5412d658..00204feaef 100644 --- a/test/sim/moves/uturn.js +++ b/test/sim/moves/uturn.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('U-turn', function () { - afterEach(function () { +describe('U-turn', () => { + afterEach(() => { battle.destroy(); }); - it('should switch the user out after a successful hit against a Substitute', function () { + it('should switch the user out after a successful hit against a Substitute', () => { battle = common.createBattle([[ - {species: 'Beedrill', ability: 'swarm', moves: ['uturn']}, - {species: 'Kakuna', ability: 'shedskin', moves: ['harden']}, + { species: 'Beedrill', ability: 'swarm', moves: ['uturn'] }, + { species: 'Kakuna', ability: 'shedskin', moves: ['harden'] }, ], [ - {species: 'Alakazam', ability: 'magicguard', moves: ['substitute']}, + { species: 'Alakazam', ability: 'magicguard', moves: ['substitute'] }, ]]); battle.makeChoices('move uturn', 'move substitute'); diff --git a/test/sim/moves/weatherball.js b/test/sim/moves/weatherball.js index 9c8310fc47..f8802ba3ce 100644 --- a/test/sim/moves/weatherball.js +++ b/test/sim/moves/weatherball.js @@ -5,65 +5,65 @@ const common = require('./../../common'); let battle; -describe('Weather Ball', function () { - afterEach(function () { +describe('Weather Ball', () => { + afterEach(() => { battle.destroy(); }); - it('should change type when used as a Z-move in weather', function () { + it('should change type when used as a Z-move in weather', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Castform", item: 'normaliumz', moves: ['weatherball']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Gastly", level: 2, ability: 'drought', item: 'focussash', moves: ['splash']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Castform", item: 'normaliumz', moves: ['weatherball'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Gastly", level: 2, ability: 'drought', item: 'focussash', moves: ['splash'] }, + ] }); battle.makeChoices('move weatherball zmove', 'move splash'); assert.equal(battle.p2.active[0].item, ''); }); - it('should not change type when called by a Z-move in weather', function () { + it('should not change type when called by a Z-move in weather', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Castform", item: 'normaliumz', moves: ['shadowball', 'assist']}, - {species: "Castform", moves: ['weatherball']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Gastly", level: 2, ability: 'drought', item: 'focussash', moves: ['splash']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Castform", item: 'normaliumz', moves: ['shadowball', 'assist'] }, + { species: "Castform", moves: ['weatherball'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Gastly", level: 2, ability: 'drought', item: 'focussash', moves: ['splash'] }, + ] }); battle.makeChoices('move shadowball', 'move splash'); battle.makeChoices('move assist zmove', 'move splash'); assert(!battle.p2.active[0].fainted); }); - it('should not trigger counter when it is special during gen 3', function () { + it('should not trigger counter when it is special during gen 3', () => { battle = common.gen(3).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shuckle', ability: 'drizzle', moves: ['weatherball']}]}); - battle.setPlayer('p2', {team: [{species: 'Shuckle', moves: ['counter']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'drizzle', moves: ['weatherball'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['counter'] }] }); battle.makeChoices(); assert.fullHP(battle.p1.active[0]); }); - it('should trigger mirror coat when it is special during gen 3', function () { + it('should trigger mirror coat when it is special during gen 3', () => { battle = common.gen(3).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shuckle', ability: 'drought', moves: ['weatherball']}]}); - battle.setPlayer('p2', {team: [{species: 'Shuckle', moves: ['mirrorcoat']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'drought', moves: ['weatherball'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['mirrorcoat'] }] }); battle.makeChoices(); assert.false.fullHP(battle.p1.active[0]); }); - it('should not trigger mirror coat when it is physical during gen 3', function () { + it('should not trigger mirror coat when it is physical during gen 3', () => { battle = common.gen(3).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shuckle', moves: ['weatherball']}]}); - battle.setPlayer('p2', {team: [{species: 'Shuckle', moves: ['mirrorcoat']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shuckle', moves: ['weatherball'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['mirrorcoat'] }] }); battle.makeChoices(); assert.fullHP(battle.p1.active[0]); }); - it('should trigger counter when it is physical during gen 3', function () { + it('should trigger counter when it is physical during gen 3', () => { battle = common.gen(3).createBattle(); - battle.setPlayer('p1', {team: [{species: 'Shuckle', ability: 'sandstream', moves: ['weatherball']}]}); - battle.setPlayer('p2', {team: [{species: 'Shuckle', moves: ['counter']}]}); + battle.setPlayer('p1', { team: [{ species: 'Shuckle', ability: 'sandstream', moves: ['weatherball'] }] }); + battle.setPlayer('p2', { team: [{ species: 'Shuckle', moves: ['counter'] }] }); battle.makeChoices(); assert.false.fullHP(battle.p1.active[0]); }); diff --git a/test/sim/moves/wish.js b/test/sim/moves/wish.js index 938fe2e892..16fecacc2a 100644 --- a/test/sim/moves/wish.js +++ b/test/sim/moves/wish.js @@ -5,49 +5,49 @@ const common = require('./../../common'); let battle; -describe('Wish', function () { - afterEach(function () { +describe('Wish', () => { + afterEach(() => { battle.destroy(); }); - it(`should heal the Pokemon in the user's slot by 1/2 of the user's max HP 1 turn after use`, function () { - battle = common.createBattle({gameType: 'doubles'}); - battle.setPlayer('p1', {team: [ - {species: "Chansey", moves: ['wish']}, - {species: "Chansey", moves: ['wish']}, - {species: "Donphan", ability: 'sturdy', moves: ['sleeptalk']}, - {species: "Guzzlord", item: 'focussash', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Kyurem", moves: ['icebeam']}, - {species: "Diancie", moves: ['moonblast']}, - ]}); + it(`should heal the Pokemon in the user's slot by 1/2 of the user's max HP 1 turn after use`, () => { + battle = common.createBattle({ gameType: 'doubles' }); + battle.setPlayer('p1', { team: [ + { species: "Chansey", moves: ['wish'] }, + { species: "Chansey", moves: ['wish'] }, + { species: "Donphan", ability: 'sturdy', moves: ['sleeptalk'] }, + { species: "Guzzlord", item: 'focussash', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Kyurem", moves: ['icebeam'] }, + { species: "Diancie", moves: ['moonblast'] }, + ] }); battle.makeChoices('move wish, move wish', 'move icebeam 1, move moonblast 2'); battle.makeChoices('switch 3, switch 4', 'move icebeam 1, move moonblast 2'); assert.fullHP(battle.p1.active[0]); assert.equal(battle.p1.active[1].hp, 321); }); - it('should progress its duration whether or not the Pokemon in its slot is fainted', function () { + it('should progress its duration whether or not the Pokemon in its slot is fainted', () => { battle = common.createBattle(); - battle.setPlayer('p1', {team: [ - {species: "Pichu", ability: 'prankster', moves: ['wish']}, - {species: "Parasect", ability: 'effectspore', moves: ['sleeptalk']}, - ]}); - battle.setPlayer('p2', {team: [ - {species: "Zygarde", ability: 'aurabreak', moves: ['thousandarrows']}, - ]}); + battle.setPlayer('p1', { team: [ + { species: "Pichu", ability: 'prankster', moves: ['wish'] }, + { species: "Parasect", ability: 'effectspore', moves: ['sleeptalk'] }, + ] }); + battle.setPlayer('p2', { team: [ + { species: "Zygarde", ability: 'aurabreak', moves: ['thousandarrows'] }, + ] }); battle.makeChoices('move wish', 'move thousandarrows'); battle.makeChoices('switch 2'); battle.makeChoices('auto', 'move thousandarrows'); assert.fullHP(battle.p1.active[0]); }); - it(`should never resolve when used on a turn that is a multiple of 256n - 1`, function () { + it(`should never resolve when used on a turn that is a multiple of 256n - 1`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['sleeptalk', 'wish', 'doubleedge']}, + { species: 'Wynaut', moves: ['sleeptalk', 'wish', 'doubleedge'] }, ], [ - {species: 'Stakataka', moves: ['sleeptalk']}, + { species: 'Stakataka', moves: ['sleeptalk'] }, ]]); battle.turn = 255; // Showdown turn is +1 from what the games are; this would ordinarily be 254 @@ -61,12 +61,12 @@ describe('Wish', function () { assert.false.fullHP(wynaut, `Wish should have never resolved.`); }); - it(`should do nothing if no Pokemon is present to heal from Wish`, function () { + it(`should do nothing if no Pokemon is present to heal from Wish`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['sleeptalk', 'wish']}, - {species: 'Shedinja', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['sleeptalk', 'wish'] }, + { species: 'Shedinja', moves: ['sleeptalk'] }, ], [ - {species: 'Happiny', ability: 'noguard', moves: ['sleeptalk', 'stoneaxe']}, + { species: 'Happiny', ability: 'noguard', moves: ['sleeptalk', 'stoneaxe'] }, ]]); battle.makeChoices('move wish', 'move stoneaxe'); diff --git a/test/sim/moves/wonderroom.js b/test/sim/moves/wonderroom.js index b7e907181f..e05797b60a 100644 --- a/test/sim/moves/wonderroom.js +++ b/test/sim/moves/wonderroom.js @@ -5,17 +5,17 @@ const common = require('./../../common'); let battle; -describe('Wonder Room', function () { - afterEach(function () { +describe('Wonder Room', () => { + afterEach(() => { battle.destroy(); }); - it(`should swap the raw Defense and Special Defense stats, but not stat stage changes or other defense modifiers`, function () { + it(`should swap the raw Defense and Special Defense stats, but not stat stage changes or other defense modifiers`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['brickbreak']}, + { species: 'Wynaut', moves: ['brickbreak'] }, ], [ - {species: 'Blissey', ability: 'shellarmor', moves: ['wonderroom', 'defensecurl', 'roost']}, - {species: 'Chansey', ability: 'shellarmor', item: 'assaultvest', moves: ['sleeptalk']}, + { species: 'Blissey', ability: 'shellarmor', moves: ['wonderroom', 'defensecurl', 'roost'] }, + { species: 'Chansey', ability: 'shellarmor', item: 'assaultvest', moves: ['sleeptalk'] }, ]]); battle.makeChoices(); @@ -34,11 +34,11 @@ describe('Wonder Room', function () { assert.bounded(damage, [38, 46], `Wonder Room should not use Assault Vest for Brick Break's damage calculation`); }); - it(`should cause Body Press to use Sp. Def stat stage changes`, function () { + it(`should cause Body Press to use Sp. Def stat stage changes`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['amnesia', 'bodypress']}, + { species: 'Wynaut', moves: ['amnesia', 'bodypress'] }, ], [ - {species: 'Blissey', ability: 'shellarmor', moves: ['wonderroom', 'sleeptalk']}, + { species: 'Blissey', ability: 'shellarmor', moves: ['wonderroom', 'sleeptalk'] }, ]]); battle.makeChoices(); @@ -48,12 +48,12 @@ describe('Wonder Room', function () { assert.bounded(damage, [100, 118]); }); - it(`should be ignored by Download when determining raw stats, but not stat stage changes`, function () { + it(`should be ignored by Download when determining raw stats, but not stat stage changes`, () => { battle = common.createBattle([[ - {species: 'Wynaut', moves: ['wonderroom']}, - {species: 'Porygon', ability: 'download', moves: ['sleeptalk']}, + { species: 'Wynaut', moves: ['wonderroom'] }, + { species: 'Porygon', ability: 'download', moves: ['sleeptalk'] }, ], [ - {species: 'Venusaur', moves: ['sleeptalk', 'amnesia']}, + { species: 'Venusaur', moves: ['sleeptalk', 'amnesia'] }, ]]); battle.makeChoices(); diff --git a/test/sim/moves/yawn.js b/test/sim/moves/yawn.js index 437f8231fc..1fce3ad9cf 100644 --- a/test/sim/moves/yawn.js +++ b/test/sim/moves/yawn.js @@ -5,16 +5,16 @@ const common = require('./../../common'); let battle; -describe('Yawn', function () { - afterEach(function () { +describe('Yawn', () => { + afterEach(() => { battle.destroy(); }); - it(`should put foes to sleep eventually`, function () { + it(`should put foes to sleep eventually`, () => { battle = common.createBattle([[ - {species: "Mew", moves: ['yawn', 'splash']}, + { species: "Mew", moves: ['yawn', 'splash'] }, ], [ - {species: "Ninjask", moves: ['splash']}, + { species: "Ninjask", moves: ['splash'] }, ]]); battle.makeChoices(); assert.equal(battle.p2.active[0].status, ''); @@ -22,22 +22,22 @@ describe('Yawn', function () { assert.equal(battle.p2.active[0].status, 'slp'); }); - it(`should be blocked by Safeguard`, function () { + it(`should be blocked by Safeguard`, () => { battle = common.createBattle([[ - {species: "Mew", moves: ['yawn']}, + { species: "Mew", moves: ['yawn'] }, ], [ - {species: "Ninjask", moves: ['safeguard']}, + { species: "Ninjask", moves: ['safeguard'] }, ]]); battle.makeChoices(); battle.makeChoices(); assert.equal(battle.p2.active[0].status, ''); }); - it(`should be able to put foes to sleep through Safeguard if used first`, function () { + it(`should be able to put foes to sleep through Safeguard if used first`, () => { battle = common.createBattle([[ - {species: "Ninjask", moves: ['yawn']}, + { species: "Ninjask", moves: ['yawn'] }, ], [ - {species: "Mew", moves: ['safeguard']}, + { species: "Mew", moves: ['safeguard'] }, ]]); battle.makeChoices(); battle.makeChoices(); diff --git a/test/sim/team-validator/basic.js b/test/sim/team-validator/basic.js index a666e511b5..db18072a5b 100644 --- a/test/sim/team-validator/basic.js +++ b/test/sim/team-validator/basic.js @@ -3,8 +3,8 @@ const assert = require('../../assert'); const Teams = require('../../../dist/sim/teams').Teams; -describe('Team Validator', function () { - it('should have valid formats to work with', function () { +describe('Team Validator', () => { + it('should have valid formats to work with', () => { Dex.includeFormats(); for (const format in Dex.formatsCache) { try { @@ -15,35 +15,35 @@ describe('Team Validator', function () { } } }); - it('should reject non-existent Pokemon', function () { + it('should reject non-existent Pokemon', () => { const team = [ - {species: 'nonexistentPokemon', moves: ['thunderbolt'], evs: {hp: 1}}, + { species: 'nonexistentPokemon', moves: ['thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7customgame'); }); - it('should reject non-existent items', function () { + it('should reject non-existent items', () => { const team = [ - {species: 'pikachu', moves: ['thunderbolt'], ability: 'static', item: 'nonexistentItem', evs: {hp: 1}}, + { species: 'pikachu', moves: ['thunderbolt'], ability: 'static', item: 'nonexistentItem', evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7customgame'); }); - it('should reject non-existent abilities', function () { + it('should reject non-existent abilities', () => { const team = [ - {species: 'pikachu', moves: ['thunderbolt'], ability: 'nonexistentAbility', evs: {hp: 1}}, + { species: 'pikachu', moves: ['thunderbolt'], ability: 'nonexistentAbility', evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7customgame'); }); - it('should reject non-existent moves', function () { + it('should reject non-existent moves', () => { const team = [ - {species: 'pikachu', ability: 'static', moves: ['nonexistentMove'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['nonexistentMove'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7customgame'); }); - it('should validate Gen 2 IVs', function () { + it('should validate Gen 2 IVs', () => { let team = Teams.unpack('|raikou|||hiddenpowerwater||||14,28,26,,,|||'); assert.legalTeam(team, 'gen2ou'); @@ -57,7 +57,7 @@ describe('Team Validator', function () { assert.false.legalTeam(team, 'gen2ou'); }); - it('should validate Gen 2 EVs', function () { + it('should validate Gen 2 EVs', () => { let team = Teams.unpack('|gengar|||thunderbolt||,,,200,200,|||||'); assert.legalTeam(team, 'gen2ou'); @@ -65,188 +65,188 @@ describe('Team Validator', function () { assert.false.legalTeam(team, 'gen2ou'); }); - it('should validate Gen 7 IVs', function () { + it('should validate Gen 7 IVs', () => { let team = [ - {species: 'yveltal', ability: 'darkaura', moves: ['hiddenpowerfighting'], evs: {hp: 1}}, + { species: 'yveltal', ability: 'darkaura', moves: ['hiddenpowerfighting'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ubers'); team = [ - {species: 'latiasmega', ability: 'levitate', item: 'latiasite', moves: ['hiddenpowerfighting'], evs: {hp: 1}}, + { species: 'latiasmega', ability: 'levitate', item: 'latiasite', moves: ['hiddenpowerfighting'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7ubers'); }); - it(`should enforce the 3 perfect IV minimum on legendaries with Gen 6+ origin`, function () { + it(`should enforce the 3 perfect IV minimum on legendaries with Gen 6+ origin`, () => { const team = [ - {species: 'xerneas', ability: 'fairyaura', moves: ['snore'], ivs: {hp: 0, atk: 0, def: 0, spa: 0}, evs: {hp: 1}}, + { species: 'xerneas', ability: 'fairyaura', moves: ['snore'], ivs: { hp: 0, atk: 0, def: 0, spa: 0 }, evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9anythinggoes'); assert.legalTeam(team, 'gen9purehackmons'); }); - it('should reject non-existent natures', function () { + it('should reject non-existent natures', () => { const team = [ - {species: 'pikachu', ability: 'static', moves: ['thunderbolt'], nature: 'nonexistentNature', evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['thunderbolt'], nature: 'nonexistentNature', evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7customgame'); }); - it('should reject invalid happiness values', function () { + it('should reject invalid happiness values', () => { const team = [ - {species: 'pikachu', ability: 'static', moves: ['thunderbolt'], happiness: 'invalidHappinessValue', evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['thunderbolt'], happiness: 'invalidHappinessValue', evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7customgame'); }); - it('should validate EVs', function () { + it('should validate EVs', () => { const team = [ - {species: 'pikachu', ability: 'static', moves: ['thunderbolt'], evs: {hp: 252, atk: 252, def: 252}}, + { species: 'pikachu', ability: 'static', moves: ['thunderbolt'], evs: { hp: 252, atk: 252, def: 252 } }, ]; assert.false.legalTeam(team, 'gen8ou'); }); - it('should accept legal movesets', function () { + it('should accept legal movesets', () => { let team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'meowstic', ability: 'prankster', moves: ['trick', 'magiccoat'], evs: {hp: 1}}, + { species: 'meowstic', ability: 'prankster', moves: ['trick', 'magiccoat'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); }); - it('should reject illegal movesets', function () { + it('should reject illegal movesets', () => { const team = [ - {species: 'pikachu', ability: 'static', moves: ['blastburn', 'frenzyplant', 'hydrocannon', 'dragonascent'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['blastburn', 'frenzyplant', 'hydrocannon', 'dragonascent'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); - it('should reject banned Pokemon', function () { + it('should reject banned Pokemon', () => { let team = [ - {species: 'arceus', ability: 'multitype', item: 'dragoniumz', moves: ['judgment'], evs: {hp: 1}}, + { species: 'arceus', ability: 'multitype', item: 'dragoniumz', moves: ['judgment'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen71v1'); team = [ - {species: 'rayquazamega', ability: 'deltastream', moves: ['dragonascent'], evs: {hp: 1}}, + { species: 'rayquazamega', ability: 'deltastream', moves: ['dragonascent'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou'); team = [ - {species: 'mimikyutotem', ability: 'disguise', moves: ['shadowsneak'], evs: {hp: 1}}, + { species: 'mimikyutotem', ability: 'disguise', moves: ['shadowsneak'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou@@@-mimikyu'); // bans should override past unbans team = [ - {species: 'torkoal', ability: 'drought', moves: ['bodyslam'], evs: {hp: 1}}, + { species: 'torkoal', ability: 'drought', moves: ['bodyslam'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7ou@@@-drought,+drought'); assert.false.legalTeam(team, 'gen7ou@@@-drought,+drought,-drought'); }); - it('should validate Sketch', function () { + it('should validate Sketch', () => { // Spore is a Gen 5 event move // Sketch itself should still be valid const team = [ - {species: 'smeargle', ability: 'owntempo', moves: ['bellydrum', 'spore', 'sketch'], evs: {hp: 1}}, + { species: 'smeargle', ability: 'owntempo', moves: ['bellydrum', 'spore', 'sketch'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen4ou'); }); - it('should accept both ability types for Mega Evolutions', function () { + it('should accept both ability types for Mega Evolutions', () => { // base forme ability let team = [ - {species: 'gyaradosmega', item: 'gyaradosite', ability: 'intimidate', moves: ['dragondance', 'crunch', 'waterfall', 'icefang'], evs: {hp: 1}}, - {species: 'kyogreprimal', item: 'blueorb', ability: 'drizzle', moves: ['originpulse'], evs: {hp: 1}}, - {species: 'rayquazamega', item: 'leftovers', ability: 'airlock', moves: ['dragonascent'], evs: {hp: 1}}, + { species: 'gyaradosmega', item: 'gyaradosite', ability: 'intimidate', moves: ['dragondance', 'crunch', 'waterfall', 'icefang'], evs: { hp: 1 } }, + { species: 'kyogreprimal', item: 'blueorb', ability: 'drizzle', moves: ['originpulse'], evs: { hp: 1 } }, + { species: 'rayquazamega', item: 'leftovers', ability: 'airlock', moves: ['dragonascent'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); // mega forme ability team = [ - {species: 'gyaradosmega', item: 'gyaradosite', ability: 'moldbreaker', moves: ['dragondance', 'crunch', 'waterfall', 'icefang'], evs: {hp: 1}}, - {species: 'kyogreprimal', item: 'blueorb', ability: 'primordialsea', moves: ['originpulse'], evs: {hp: 1}}, - {species: 'rayquazamega', item: 'leftovers', ability: 'deltastream', moves: ['dragonascent'], evs: {hp: 1}}, + { species: 'gyaradosmega', item: 'gyaradosite', ability: 'moldbreaker', moves: ['dragondance', 'crunch', 'waterfall', 'icefang'], evs: { hp: 1 } }, + { species: 'kyogreprimal', item: 'blueorb', ability: 'primordialsea', moves: ['originpulse'], evs: { hp: 1 } }, + { species: 'rayquazamega', item: 'leftovers', ability: 'deltastream', moves: ['dragonascent'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); }); - it('should reject newer Pokemon in older gens', function () { + it('should reject newer Pokemon in older gens', () => { const team = [ - {species: 'pichu', ability: 'static', moves: ['thunderbolt']}, + { species: 'pichu', ability: 'static', moves: ['thunderbolt'] }, ]; assert.false.legalTeam(team, 'gen1ou'); }); - it('should reject exclusive G-Max moves added directly to a Pokemon\'s moveset', function () { + it('should reject exclusive G-Max moves added directly to a Pokemon\'s moveset', () => { const team = [ - {species: 'charizard', ability: 'blaze', moves: ['gmaxwildfire'], evs: {hp: 1}, gigantamax: true}, + { species: 'charizard', ability: 'blaze', moves: ['gmaxwildfire'], evs: { hp: 1 }, gigantamax: true }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); assert.false.legalTeam(team, 'gen8customgame@@@-nonexistent'); }); - it('should reject Gmax Pokemon from formats with Dynamax Clause', function () { + it('should reject Gmax Pokemon from formats with Dynamax Clause', () => { const team = [ - {species: 'gengar-gmax', ability: 'cursedbody', moves: ['shadowball'], evs: {hp: 1}}, - {species: 'gengar', ability: 'cursedbody', moves: ['shadowball'], evs: {hp: 1}, gigantamax: true}, + { species: 'gengar-gmax', ability: 'cursedbody', moves: ['shadowball'], evs: { hp: 1 } }, + { species: 'gengar', ability: 'cursedbody', moves: ['shadowball'], evs: { hp: 1 }, gigantamax: true }, ]; assert.false.legalTeam(team, 'gen8customgame@@@dynamaxclause'); }); - it(`should not allow duplicate moves on the same set, except in hackmons`, function () { + it(`should not allow duplicate moves on the same set, except in hackmons`, () => { const team = [ - {species: 'corsola', ability: 'hustle', moves: ['snore', 'snore'], evs: {hp: 1}}, + { species: 'corsola', ability: 'hustle', moves: ['snore', 'snore'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9anythinggoes'); assert.legalTeam(team, 'gen9purehackmons'); }); - it('should accept VC moves only with Hidden ability and correct IVs', function () { + it('should accept VC moves only with Hidden ability and correct IVs', () => { let team = [ - {species: 'machamp', ability: 'steadfast', moves: ['fissure'], evs: {hp: 1}}, + { species: 'machamp', ability: 'steadfast', moves: ['fissure'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'tauros', ability: 'sheerforce', moves: ['bodyslam'], evs: {hp: 1}}, + { species: 'tauros', ability: 'sheerforce', moves: ['bodyslam'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'tauros', ability: 'intimidate', ivs: {hp: 31, atk: 31, def: 30, spa: 30, spd: 30, spe: 30}, moves: ['bodyslam'], evs: {hp: 1}}, - {species: 'suicune', ability: 'innerfocus', moves: ['scald'], evs: {hp: 1}}, + { species: 'tauros', ability: 'intimidate', ivs: { hp: 31, atk: 31, def: 30, spa: 30, spd: 30, spe: 30 }, moves: ['bodyslam'], evs: { hp: 1 } }, + { species: 'suicune', ability: 'innerfocus', moves: ['scald'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'machamp', ability: 'noguard', moves: ['fissure'], evs: {hp: 1}}, + { species: 'machamp', ability: 'noguard', moves: ['fissure'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'tauros', ability: 'sheerforce', ivs: {hp: 31, atk: 31, def: 30, spa: 30, spd: 30, spe: 30}, moves: ['bodyslam'], evs: {hp: 1}}, + { species: 'tauros', ability: 'sheerforce', ivs: { hp: 31, atk: 31, def: 30, spa: 30, spd: 30, spe: 30 }, moves: ['bodyslam'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'koffing', ability: 'levitate', moves: ['zapcannon'], evs: {hp: 1}}, + { species: 'koffing', ability: 'levitate', moves: ['zapcannon'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8ou'); team = [ - {species: 'weezing-galar', ability: 'levitate', moves: ['zapcannon'], evs: {hp: 1}}, + { species: 'weezing-galar', ability: 'levitate', moves: ['zapcannon'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8ou'); }); - it(`should disallow past gen only moves in Gen 9`, function () { + it(`should disallow past gen only moves in Gen 9`, () => { const team = [ - {species: 'oricorio', ability: 'dancer', moves: ['roleplay'], evs: {hp: 1}}, + { species: 'oricorio', ability: 'dancer', moves: ['roleplay'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9ou'); }); diff --git a/test/sim/team-validator/breeding.js b/test/sim/team-validator/breeding.js index 206914fdf2..65c202766f 100644 --- a/test/sim/team-validator/breeding.js +++ b/test/sim/team-validator/breeding.js @@ -4,112 +4,112 @@ const assert = require('../../assert'); let team; -describe('Team Validator', function () { - it("should validate Shedinja's egg moves correctly", function () { +describe('Team Validator', () => { + it("should validate Shedinja's egg moves correctly", () => { team = [ - {species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'gust'], evs: {hp: 1}}, + { species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'gust'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen3ou'); }); - it("should properly exclude egg moves for Baby Pokemon and their evolutions", function () { + it("should properly exclude egg moves for Baby Pokemon and their evolutions", () => { team = [ - {species: 'blissey', ability: 'naturalcure', moves: ['charm', 'seismictoss'], evs: {hp: 1}}, + { species: 'blissey', ability: 'naturalcure', moves: ['charm', 'seismictoss'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou'); team = [ - {species: 'marill', ability: 'hugepower', moves: ['splash', 'aquajet'], evs: {hp: 1}}, + { species: 'marill', ability: 'hugepower', moves: ['splash', 'aquajet'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou'); team = [ - {species: 'azumarill', ability: 'thickfat', moves: ['futuresight', 'slam'], evs: {hp: 1}}, + { species: 'azumarill', ability: 'thickfat', moves: ['futuresight', 'slam'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou'); }); - it("should disallow 4 egg moves on move evolutions before gen 6", function () { + it("should disallow 4 egg moves on move evolutions before gen 6", () => { team = [ - {species: 'mamoswine', ability: 'oblivious', moves: ['tackle', 'iceshard', 'amnesia', 'furyattack'], evs: {hp: 1}}, + { species: 'mamoswine', ability: 'oblivious', moves: ['tackle', 'iceshard', 'amnesia', 'furyattack'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen5ou'); assert.legalTeam(team, 'gen7ou'); }); - it("should disallow egg moves with male-only Hidden Abilities", function () { + it("should disallow egg moves with male-only Hidden Abilities", () => { team = [ - {species: 'combusken', ability: 'speedboost', moves: ['batonpass'], evs: {hp: 1}}, + { species: 'combusken', ability: 'speedboost', moves: ['batonpass'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen5ou'); }); - it("should disallow Pokemon in Little Cup that can't be bred to be level 5", function () { + it("should disallow Pokemon in Little Cup that can't be bred to be level 5", () => { team = [ - {species: 'kubfu', ability: 'innerfocus', moves: ['aerialace'], evs: {hp: 1}}, + { species: 'kubfu', ability: 'innerfocus', moves: ['aerialace'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8lc'); }); - it('should reject illegal egg move combinations', function () { + it('should reject illegal egg move combinations', () => { team = [ - {species: 'azumarill', ability: 'hugepower', moves: ['bellydrum', 'aquajet'], evs: {hp: 1}}, + { species: 'azumarill', ability: 'hugepower', moves: ['bellydrum', 'aquajet'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen5ou'); team = [ - {species: 'cloyster', moves: ['rapidspin', 'explosion']}, + { species: 'cloyster', moves: ['rapidspin', 'explosion'] }, ]; assert.false.legalTeam(team, 'gen2ou'); team = [ - {species: 'skarmory', ability: 'keeneye', moves: ['curse', 'drillpeck'], evs: {hp: 1}}, + { species: 'skarmory', ability: 'keeneye', moves: ['curse', 'drillpeck'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen3ou'); team = [ - {species: 'skarmory', ability: 'keeneye', moves: ['whirlwind', 'drillpeck'], evs: {hp: 1}}, + { species: 'skarmory', ability: 'keeneye', moves: ['whirlwind', 'drillpeck'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen3ou'); team = [ - {species: 'armaldo', ability: 'battlearmor', moves: ['knockoff', 'rapidspin'], evs: {hp: 1}}, + { species: 'armaldo', ability: 'battlearmor', moves: ['knockoff', 'rapidspin'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen3ou'); }); - it('should allow chain breeding', function () { + it('should allow chain breeding', () => { // via duskull team = [ - {species: 'weezing', ability: 'levitate', moves: ['painsplit', 'willowisp'], evs: {hp: 1}}, + { species: 'weezing', ability: 'levitate', moves: ['painsplit', 'willowisp'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen3ou'); // via snubbull team = [ - {species: 'blissey', moves: ['present', 'healbell']}, + { species: 'blissey', moves: ['present', 'healbell'] }, ]; assert.legalTeam(team, 'gen2ou'); // combine different tyrogue evos team = [ - {species: 'hitmontop', ability: 'intimidate', moves: ["highjumpkick", 'machpunch'], evs: {hp: 1}}, + { species: 'hitmontop', ability: 'intimidate', moves: ["highjumpkick", 'machpunch'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen3ou'); // via cranidos team = [ - {species: 'snorlax', ability: 'immunity', moves: ['curse', 'pursuit'], evs: {hp: 1}}, + { species: 'snorlax', ability: 'immunity', moves: ['curse', 'pursuit'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen4ou'); }); - it('should accept this chainbreed on Snorlax', function () { + it('should accept this chainbreed on Snorlax', () => { // the weirdest chainbreed I've ever seen: // breed male Curse Snorlax in Gen 3, transfer to XD, teach Self-destruct // by tutor, breed with female Gluttony Snorlax team = [ - {species: 'snorlax', ability: 'gluttony', moves: ['curse', 'selfdestruct'], evs: {hp: 1}}, + { species: 'snorlax', ability: 'gluttony', moves: ['curse', 'selfdestruct'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen5ou'); }); @@ -117,12 +117,12 @@ describe('Team Validator', function () { it('should allow trading back Gen 2 egg moves if compatible with Gen 1', () => { // HJK can be bred onto Tyrogue in Gen 2, evolved into Hitmonchan, transferred back to Gen 1, taught Body Slam via TM, and transferred back to Gen 2. team = [ - {species: 'hitmonchan', moves: ['highjumpkick', 'bodyslam']}, + { species: 'hitmonchan', moves: ['highjumpkick', 'bodyslam'] }, ]; assert.legalTeam(team, 'gen2ou'); team = [ - {species: 'marowak', moves: ['swordsdance', 'rockslide', 'bodyslam']}, + { species: 'marowak', moves: ['swordsdance', 'rockslide', 'bodyslam'] }, ]; assert.legalTeam(team, 'gen2ou'); assert.legalTeam(team, 'gen1tradebacksou'); @@ -131,130 +131,130 @@ describe('Team Validator', function () { it("should disallow trading back an egg move not in gen 1", () => { team = [ - {species: 'marowak', moves: ['swordsdance', 'ancientpower', 'bodyslam']}, + { species: 'marowak', moves: ['swordsdance', 'ancientpower', 'bodyslam'] }, ]; assert.false.legalTeam(team, 'gen2ou'); }); - it("should properly resolve egg moves for Pokemon with pre-evolutions that don't have Hidden Abilities", function () { + it("should properly resolve egg moves for Pokemon with pre-evolutions that don't have Hidden Abilities", () => { team = [ - {species: 'tyranitar', ability: 'unnerve', moves: ['dragondance'], evs: {hp: 1}}, - {species: 'staraptor', ability: 'reckless', moves: ['pursuit'], evs: {hp: 1}}, + { species: 'tyranitar', ability: 'unnerve', moves: ['dragondance'], evs: { hp: 1 } }, + { species: 'staraptor', ability: 'reckless', moves: ['pursuit'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen5ou'); }); - it("should allow Nidoqueen to have egg moves", function () { + it("should allow Nidoqueen to have egg moves", () => { team = [ - {species: 'nidoqueen', ability: 'poisonpoint', moves: ['charm'], evs: {hp: 1}}, + { species: 'nidoqueen', ability: 'poisonpoint', moves: ['charm'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen6ou'); }); - it("should properly handle HA Dragonite with Extreme Speed", function () { + it("should properly handle HA Dragonite with Extreme Speed", () => { team = [ - {species: 'dragonite', ability: 'multiscale', moves: ['extremespeed'], evs: {hp: 1}}, + { species: 'dragonite', ability: 'multiscale', moves: ['extremespeed'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen5ou'); team = [ - {species: 'dragonite', ability: 'multiscale', moves: ['extremespeed', 'aquajet'], evs: {hp: 1}}, + { species: 'dragonite', ability: 'multiscale', moves: ['extremespeed', 'aquajet'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen5ou'); }); - it("should disallow low-level female-only Pokemon with illegal (level up) egg moves/egg move combinations", function () { + it("should disallow low-level female-only Pokemon with illegal (level up) egg moves/egg move combinations", () => { team = [ - {species: 'tinkatink', level: 5, ability: 'moldbreaker', moves: ['brutalswing'], evs: {hp: 1}}, + { species: 'tinkatink', level: 5, ability: 'moldbreaker', moves: ['brutalswing'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9lc'); team = [ - {species: 'tinkatink', level: 5, ability: 'moldbreaker', moves: ['covet', 'fakeout'], evs: {hp: 1}}, + { species: 'tinkatink', level: 5, ability: 'moldbreaker', moves: ['covet', 'fakeout'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9lc'); }); - it("should disallow illegal (level up) egg move combinations involving moves that can't be tradebacked", function () { + it("should disallow illegal (level up) egg move combinations involving moves that can't be tradebacked", () => { team = [ - {species: 'chansey', level: 5, moves: ['healbell', 'softboiled'], evs: {hp: 1}}, + { species: 'chansey', level: 5, moves: ['healbell', 'softboiled'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen2ou'); }); - it("should disallow illegal (level up) egg moves/egg move combinations involving Pomeg glitch and Gen 4 abilities", function () { + it("should disallow illegal (level up) egg moves/egg move combinations involving Pomeg glitch and Gen 4 abilities", () => { team = [ - {species: 'smoochum', level: 5, ability: 'forewarn', moves: ['powdersnow'], evs: {hp: 1}}, + { species: 'smoochum', level: 5, ability: 'forewarn', moves: ['powdersnow'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen4lc'); }); - it("should allow previously illegal level up egg moves in Gen 7", function () { + it("should allow previously illegal level up egg moves in Gen 7", () => { team = [ - {species: 'smoochum', level: 5, ability: 'hydration', moves: ['powdersnow'], evs: {hp: 1}}, + { species: 'smoochum', level: 5, ability: 'hydration', moves: ['powdersnow'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7lc'); }); - it("should allow Pomeg glitch with event egg moves", function () { + it("should allow Pomeg glitch with event egg moves", () => { team = [ - {species: 'zigzagoon', level: 5, ability: 'pickup', moves: ['bellydrum', 'extremespeed'], evs: {hp: 1}}, + { species: 'zigzagoon', level: 5, ability: 'pickup', moves: ['bellydrum', 'extremespeed'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen3ou'); }); - it("should disallow illegal egg move combinations containing past gen universal moves", function () { + it("should disallow illegal egg move combinations containing past gen universal moves", () => { team = [ - {species: 'salamence', ability: 'intimidate', moves: ['defensecurl', 'thrash', 'dragonrage', 'dragonrush'], evs: {hp: 1}}, + { species: 'salamence', ability: 'intimidate', moves: ['defensecurl', 'thrash', 'dragonrage', 'dragonrush'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen5ou'); }); - it('should allow complex chainbred sets', function () { + it('should allow complex chainbred sets', () => { team = [ - {species: 'toxicroak', ability: 'dryskin', moves: ['bulletpunch', 'crosschop', 'fakeout'], evs: {hp: 4}}, + { species: 'toxicroak', ability: 'dryskin', moves: ['bulletpunch', 'crosschop', 'fakeout'], evs: { hp: 4 } }, ]; assert.legalTeam(team, 'gen5ou'); team = [ - {species: 'corphish', ability: 'hypercutter', moves: ['dragondance', 'metalclaw'], evs: {hp: 1}}, + { species: 'corphish', ability: 'hypercutter', moves: ['dragondance', 'metalclaw'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen4ou'); }); - it('should reject Volbeat with both Lunge and Dizzy Punch in Gen 7', function () { + it('should reject Volbeat with both Lunge and Dizzy Punch in Gen 7', () => { team = [ - {species: 'volbeat', ability: 'swarm', moves: ['lunge', 'dizzypunch'], evs: {hp: 1}}, + { species: 'volbeat', ability: 'swarm', moves: ['lunge', 'dizzypunch'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); - it('should allow level 5 Indeedee-M with Disarming Voice', function () { + it('should allow level 5 Indeedee-M with Disarming Voice', () => { team = [ - {species: 'indeedee', level: 5, ability: 'innerfocus', moves: ['disarmingvoice'], evs: {hp: 1}}, + { species: 'indeedee', level: 5, ability: 'innerfocus', moves: ['disarmingvoice'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8ou'); }); - it('should allow egg moves on event formes in Gen 9', function () { + it('should allow egg moves on event formes in Gen 9', () => { team = [ - {species: 'ursalunabloodmoon', ability: 'mindseye', moves: ['yawn', 'bellydrum'], evs: {hp: 1}}, - {species: 'greninjabond', ability: 'battlebond', moves: ['counter', 'switcheroo'], evs: {hp: 1}}, - {species: 'pikachualola', ability: 'static', moves: ['wish', 'fakeout'], evs: {hp: 1}}, + { species: 'ursalunabloodmoon', ability: 'mindseye', moves: ['yawn', 'bellydrum'], evs: { hp: 1 } }, + { species: 'greninjabond', ability: 'battlebond', moves: ['counter', 'switcheroo'], evs: { hp: 1 } }, + { species: 'pikachualola', ability: 'static', moves: ['wish', 'fakeout'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen9anythinggoes'); }); - it('should not allow egg moves on event formes before Gen 9', function () { + it('should not allow egg moves on event formes before Gen 9', () => { team = [ - {species: 'greninjabond', ability: 'battlebond', moves: ['toxicspikes'], evs: {hp: 1}}, + { species: 'greninjabond', ability: 'battlebond', moves: ['toxicspikes'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); - it('should not allow egg Pokemon below level 5 in Gens 2-3', function () { + it('should not allow egg Pokemon below level 5 in Gens 2-3', () => { team = [ - {species: 'totodile', level: 1, ability: 'torrent', moves: ['ancientpower']}, + { species: 'totodile', level: 1, ability: 'torrent', moves: ['ancientpower'] }, ]; assert.false.legalTeam(team, 'gen3ou'); }); diff --git a/test/sim/team-validator/custom-rules.js b/test/sim/team-validator/custom-rules.js index 0645d8bf35..01b83c08ac 100644 --- a/test/sim/team-validator/custom-rules.js +++ b/test/sim/team-validator/custom-rules.js @@ -2,209 +2,209 @@ const assert = require('../../assert'); -describe("Custom Rules", function () { - it('should support legality tags', function () { +describe("Custom Rules", () => { + it('should support legality tags', () => { let team = [ - {species: 'kitsunoh', ability: 'frisk', moves: ['shadowstrike'], evs: {hp: 1}}, + { species: 'kitsunoh', ability: 'frisk', moves: ['shadowstrike'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); assert.legalTeam(team, 'gen7anythinggoes@@@+cap'); team = [ - {species: 'pikachu', ability: 'airlock', moves: ['thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'airlock', moves: ['thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); assert.legalTeam(team, 'gen7ou@@@!obtainableabilities'); team = [ - {species: 'pikachu', ability: 'airlock', moves: ['dragondance'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'airlock', moves: ['dragondance'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou@@@!obtainableabilities'); }); - it('should allow Pokemon to be banned', function () { + it('should allow Pokemon to be banned', () => { let team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes@@@-Pikachu'); team = [ - {species: 'greninjaash', ability: 'battlebond', moves: ['surf'], evs: {hp: 1}}, + { species: 'greninjaash', ability: 'battlebond', moves: ['surf'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes@@@-Greninja-Bond'); team = [ - {species: 'greninjabond', ability: 'battlebond', moves: ['surf'], evs: {hp: 1}}, + { species: 'greninjabond', ability: 'battlebond', moves: ['surf'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes@@@!Obtainable Formes,-Greninja-Ash'); }); - it('should allow Pokemon to be unbanned', function () { + it('should allow Pokemon to be unbanned', () => { const team = [ - {species: 'blaziken', ability: 'blaze', moves: ['skyuppercut'], evs: {hp: 1}}, + { species: 'blaziken', ability: 'blaze', moves: ['skyuppercut'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7ou@@@+Blaziken'); }); - it('should allow Pokemon to be whitelisted', function () { + it('should allow Pokemon to be whitelisted', () => { let team = [ - {species: 'giratina', ability: 'pressure', moves: ['protect'], evs: {hp: 1}}, + { species: 'giratina', ability: 'pressure', moves: ['protect'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7ubers@@@-allpokemon,+giratinaaltered'); team = [ - {species: 'giratinaorigin', ability: 'levitate', moves: ['protect'], evs: {hp: 1}}, + { species: 'giratinaorigin', ability: 'levitate', moves: ['protect'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ubers@@@-allpokemon,+giratinaaltered'); team = [ - {species: 'tyrantrum', ability: 'strongjaw', moves: ['protect'], evs: {hp: 1}}, + { species: 'tyrantrum', ability: 'strongjaw', moves: ['protect'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8nationaldex@@@-allpokemon'); }); - it('should support banning/unbanning tag combinations', function () { + it('should support banning/unbanning tag combinations', () => { let team = [ - {species: 'Crucibelle-Mega', ability: 'Regenerator', moves: ['protect'], evs: {hp: 1}}, + { species: 'Crucibelle-Mega', ability: 'Regenerator', moves: ['protect'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8customgame@@@-nonexistent,+mega', "Nonexistent should override all tags that aren't existence-related"); team = [ - {species: 'Crucibelle-Mega', ability: 'Regenerator', moves: ['protect'], evs: {hp: 1}}, + { species: 'Crucibelle-Mega', ability: 'Regenerator', moves: ['protect'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8customgame@@@+mega,-nonexistent', "Nonexistent should override all tags that aren't existence-related"); team = [ - {species: 'Crucibelle-Mega', ability: 'Regenerator', moves: ['protect'], evs: {hp: 1}}, + { species: 'Crucibelle-Mega', ability: 'Regenerator', moves: ['protect'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8customgame@@@-nonexistent,+crucibellemega', "Nonexistent should override all tags that aren't existence-related"); team = [ - {species: 'Moltres-Galar', ability: 'Berserk', moves: ['protect'], evs: {hp: 1}}, + { species: 'Moltres-Galar', ability: 'Berserk', moves: ['protect'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8customgame@@@-sublegendary'); }); - it('should support restrictions', function () { + it('should support restrictions', () => { let team = [ - {species: 'Yveltal', ability: 'No Ability', moves: ['protect'], evs: {hp: 1}}, + { species: 'Yveltal', ability: 'No Ability', moves: ['protect'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7customgame@@@limitonerestricted,*restrictedlegendary'); team = [ - {species: 'Yveltal', ability: 'No Ability', moves: ['protect'], evs: {hp: 1}}, - {species: 'Xerneas', ability: 'No Ability', moves: ['protect'], evs: {hp: 1}}, + { species: 'Yveltal', ability: 'No Ability', moves: ['protect'], evs: { hp: 1 } }, + { species: 'Xerneas', ability: 'No Ability', moves: ['protect'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7customgame@@@limitonerestricted,*restrictedlegendary'); }); - it('should allow moves to be banned', function () { + it('should allow moves to be banned', () => { const team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes@@@-Agility'); }); - it('should allow moves to be unbanned', function () { + it('should allow moves to be unbanned', () => { const team = [ - {species: 'absol', ability: 'pressure', moves: ['batonpass'], evs: {hp: 1}}, + { species: 'absol', ability: 'pressure', moves: ['batonpass'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7ou@@@+Baton Pass'); }); - it('should allow items to be banned', function () { + it('should allow items to be banned', () => { let team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], item: 'lightball', evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], item: 'lightball', evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes@@@-Light Ball'); team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], item: 'lightball', evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], item: 'lightball', evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes@@@-noitem'); team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes@@@-noitem'); team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes@@@-allitems'); }); - it('should allow items to be unbanned', function () { + it('should allow items to be unbanned', () => { const team = [ - {species: 'eevee', ability: 'runaway', moves: ['tackle'], item: 'eeviumz', evs: {hp: 1}}, + { species: 'eevee', ability: 'runaway', moves: ['tackle'], item: 'eeviumz', evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7lc@@@+Eevium Z'); }); - it('should allow abilities to be banned', function () { + it('should allow abilities to be banned', () => { const team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes@@@-Static'); }); - it('should allow abilities to be unbanned', function () { + it('should allow abilities to be unbanned', () => { const team = [ - {species: 'wobbuffet', ability: 'shadowtag', moves: ['counter'], evs: {hp: 1}}, + { species: 'wobbuffet', ability: 'shadowtag', moves: ['counter'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7ou@@@+Shadow Tag'); }); - it('should allow complex bans to be added', function () { + it('should allow complex bans to be added', () => { let team = [ - {species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: {hp: 1}}, + { species: 'pikachu', ability: 'static', moves: ['agility', 'protect', 'thunder', 'thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes@@@-Pikachu + Agility'); team = [ - {species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: {hp: 1}}, - {species: 'pikachu', ability: 'static', moves: ['thunderbolt'], evs: {hp: 1}}, + { species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: { hp: 1 } }, + { species: 'pikachu', ability: 'static', moves: ['thunderbolt'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7doublesou@@@-Gravity ++ Thunderbolt'); }); - it('should allow complex bans to be altered', function () { + it('should allow complex bans to be altered', () => { let team = [ - {species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: {hp: 1}}, - {species: 'abomasnow', ability: 'snowwarning', moves: ['grasswhistle'], evs: {hp: 1}}, + { species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: { hp: 1 } }, + { species: 'abomasnow', ability: 'snowwarning', moves: ['grasswhistle'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7doublesou@@@-Gravity ++ Grass Whistle > 2'); team = [ - {species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: {hp: 1}}, - {species: 'abomasnow', ability: 'snowwarning', moves: ['grasswhistle'], evs: {hp: 1}}, - {species: 'cacturne', ability: 'sandveil', moves: ['grasswhistle'], evs: {hp: 1}}, + { species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: { hp: 1 } }, + { species: 'abomasnow', ability: 'snowwarning', moves: ['grasswhistle'], evs: { hp: 1 } }, + { species: 'cacturne', ability: 'sandveil', moves: ['grasswhistle'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7doublesou@@@-Gravity ++ Grass Whistle > 2'); }); - it('should allow complex bans to be removed', function () { + it('should allow complex bans to be removed', () => { const team = [ - {species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: {hp: 1}}, - {species: 'abomasnow', ability: 'snowwarning', moves: ['grasswhistle'], evs: {hp: 1}}, + { species: 'smeargle', ability: 'owntempo', moves: ['gravity'], evs: { hp: 1 } }, + { species: 'abomasnow', ability: 'snowwarning', moves: ['grasswhistle'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7doublesou@@@+Gravity ++ Grass Whistle'); }); - it('should allow rule bundles to be removed', function () { + it('should allow rule bundles to be removed', () => { const team = [ - {species: 'azumarill', ability: 'hugepower', moves: ['waterfall'], evs: {hp: 1}}, - {species: 'azumarill', ability: 'hugepower', moves: ['waterfall'], evs: {hp: 1}}, + { species: 'azumarill', ability: 'hugepower', moves: ['waterfall'], evs: { hp: 1 } }, + { species: 'azumarill', ability: 'hugepower', moves: ['waterfall'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7ou@@@!Standard'); }); - it('should allow rule bundles to be overridden', function () { + it('should allow rule bundles to be overridden', () => { const team = [ - {species: 'charizard-mega-y', ability: 'drought', item: 'charizarditey', moves: ['wingattack'], evs: {hp: 1}}, + { species: 'charizard-mega-y', ability: 'drought', item: 'charizarditey', moves: ['wingattack'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7customgame@@@Standard'); }); diff --git a/test/sim/team-validator/events.js b/test/sim/team-validator/events.js index 39ca3486c9..3c093f0d8b 100644 --- a/test/sim/team-validator/events.js +++ b/test/sim/team-validator/events.js @@ -2,165 +2,165 @@ const assert = require('../../assert'); -describe('Team Validator', function () { - it('should require Hidden Ability status to match event moves', function () { +describe('Team Validator', () => { + it('should require Hidden Ability status to match event moves', () => { const team = [ - {species: 'raichu', ability: 'lightningrod', moves: ['extremespeed'], evs: {hp: 1}}, + { species: 'raichu', ability: 'lightningrod', moves: ['extremespeed'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); - it('should handle Dream World moves', function () { + it('should handle Dream World moves', () => { const team = [ - {species: 'garchomp', ability: 'roughskin', moves: ['endure'], evs: {hp: 1}}, + { species: 'garchomp', ability: 'roughskin', moves: ['endure'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen5ou'); }); - it('should reject mutually incompatible Dream World moves', function () { + it('should reject mutually incompatible Dream World moves', () => { let team = [ - {species: 'spinda', ability: 'contrary', moves: ['superpower', 'fakeout'], evs: {hp: 1}}, + { species: 'spinda', ability: 'contrary', moves: ['superpower', 'fakeout'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen5ou'); // Both are Dream World moves, but Smack Down is also level-up/TM team = [ - {species: 'boldore', ability: 'sandforce', moves: ['heavyslam', 'smackdown'], evs: {hp: 1}}, + { species: 'boldore', ability: 'sandforce', moves: ['heavyslam', 'smackdown'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen5ou'); }); - it('should consider Dream World Abilities as Hidden based on Gen 5 data', function () { + it('should consider Dream World Abilities as Hidden based on Gen 5 data', () => { let team = [ - {species: 'kecleon', ability: 'colorchange', moves: ['reflecttype'], evs: {hp: 1}}, + { species: 'kecleon', ability: 'colorchange', moves: ['reflecttype'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen6ou'); team = [ - {species: 'kecleon', ability: 'protean', moves: ['reflecttype'], evs: {hp: 1}}, + { species: 'kecleon', ability: 'protean', moves: ['reflecttype'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen6ou'); }); - it('should properly validate Greninja-Ash', function () { + it('should properly validate Greninja-Ash', () => { let team = [ - {species: 'greninja-ash', ability: 'battlebond', moves: ['happyhour'], shiny: true, evs: {hp: 1}}, + { species: 'greninja-ash', ability: 'battlebond', moves: ['happyhour'], shiny: true, evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'greninja-ash', ability: 'battlebond', moves: ['protect'], shiny: true, evs: {hp: 1}}, + { species: 'greninja-ash', ability: 'battlebond', moves: ['protect'], shiny: true, evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'greninja-ash', ability: 'battlebond', moves: ['protect'], ivs: {atk: 0}, evs: {hp: 1}}, + { species: 'greninja-ash', ability: 'battlebond', moves: ['protect'], ivs: { atk: 0 }, evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'greninja-ash', ability: 'battlebond', moves: ['hiddenpowergrass'], evs: {hp: 1}}, + { species: 'greninja-ash', ability: 'battlebond', moves: ['hiddenpowergrass'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); - it('should not allow evolutions of Shiny-locked events to be Shiny', function () { + it('should not allow evolutions of Shiny-locked events to be Shiny', () => { const team = [ - {species: 'urshifu', ability: 'unseenfist', shiny: true, moves: ['snore'], evs: {hp: 1}}, - {species: 'cosmoem', ability: 'sturdy', shiny: true, moves: ['teleport'], evs: {hp: 1}}, + { species: 'urshifu', ability: 'unseenfist', shiny: true, moves: ['snore'], evs: { hp: 1 } }, + { species: 'cosmoem', ability: 'sturdy', shiny: true, moves: ['teleport'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); }); - it('should not allow events to use moves only obtainable in a previous generation', function () { + it('should not allow events to use moves only obtainable in a previous generation', () => { const team = [ - {species: 'zeraora', ability: 'voltabsorb', shiny: true, moves: ['knockoff'], evs: {hp: 1}}, + { species: 'zeraora', ability: 'voltabsorb', shiny: true, moves: ['knockoff'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); }); - it(`should accept event Pokemon with oldgen tutor moves and HAs in formats with Ability Patch`, function () { + it(`should accept event Pokemon with oldgen tutor moves and HAs in formats with Ability Patch`, () => { const team = [ - {species: 'heatran', ability: 'flamebody', moves: ['eruption'], evs: {hp: 1}}, - {species: 'regirock', ability: 'sturdy', moves: ['counter'], evs: {hp: 1}}, - {species: 'zapdos', ability: 'static', moves: ['aircutter'], evs: {hp: 1}}, + { species: 'heatran', ability: 'flamebody', moves: ['eruption'], evs: { hp: 1 } }, + { species: 'regirock', ability: 'sturdy', moves: ['counter'], evs: { hp: 1 } }, + { species: 'zapdos', ability: 'static', moves: ['aircutter'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8anythinggoes'); }); - it('should validate the Diancie released with zero perfect IVs', function () { + it('should validate the Diancie released with zero perfect IVs', () => { let team = [ - {species: 'diancie', ability: 'clearbody', shiny: true, moves: ['hiddenpowerfighting'], evs: {hp: 1}}, + { species: 'diancie', ability: 'clearbody', shiny: true, moves: ['hiddenpowerfighting'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen6ou'); team = [ - {species: 'diancie', ability: 'clearbody', moves: ['hiddenpowerfighting'], evs: {hp: 1}}, + { species: 'diancie', ability: 'clearbody', moves: ['hiddenpowerfighting'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen6ou'); }); - it('should not allow Gen 1 JP events', function () { + it('should not allow Gen 1 JP events', () => { const team = [ - {species: 'rapidash', moves: ['payday']}, + { species: 'rapidash', moves: ['payday'] }, ]; assert.false.legalTeam(team, 'gen1ou'); }); it('should allow Gen 2 events of Gen 1 Pokemon to learn moves exclusive to Gen 1', () => { let team = [ - {species: 'nidoking', moves: ['lovelykiss', 'counter']}, + { species: 'nidoking', moves: ['lovelykiss', 'counter'] }, ]; assert.legalTeam(team, 'gen2ou'); // Espeon should be allowed to learn moves as an Eevee team = [ - {species: 'espeon', moves: ['growth', 'substitute']}, + { species: 'espeon', moves: ['growth', 'substitute'] }, ]; assert.legalTeam(team, 'gen2ou'); }); it('should allow Gen 2 events that evolve into Gen 1 Pokemon to learn moves exclusive to Gen 1', () => { const team = [ - {species: 'pikachu', moves: ['sing', 'surf']}, - {species: 'clefairy', moves: ['dizzypunch', 'bodyslam']}, + { species: 'pikachu', moves: ['sing', 'surf'] }, + { species: 'clefairy', moves: ['dizzypunch', 'bodyslam'] }, ]; assert.legalTeam(team, 'gen2ou'); }); it('should allow Gen 2 events in Gen 1 Tradebacks OU', () => { const team = [ - {species: 'charizard', moves: ['crunch']}, + { species: 'charizard', moves: ['crunch'] }, ]; assert.false.legalTeam(team, 'gen1tradebacksou'); }); - it('should allow use of a Hidden Ability if the format has the item Ability Patch', function () { + it('should allow use of a Hidden Ability if the format has the item Ability Patch', () => { let team = [ - {species: 'heatran', ability: 'flamebody', moves: ['sleeptalk'], evs: {hp: 1}}, - {species: 'entei', ability: 'innerfocus', moves: ['sleeptalk'], evs: {hp: 1}}, - {species: 'dracovish', ability: 'sandrush', moves: ['sleeptalk'], evs: {hp: 1}}, - {species: 'zapdos', ability: 'static', moves: ['sleeptalk'], evs: {hp: 1}}, + { species: 'heatran', ability: 'flamebody', moves: ['sleeptalk'], evs: { hp: 1 } }, + { species: 'entei', ability: 'innerfocus', moves: ['sleeptalk'], evs: { hp: 1 } }, + { species: 'dracovish', ability: 'sandrush', moves: ['sleeptalk'], evs: { hp: 1 } }, + { species: 'zapdos', ability: 'static', moves: ['sleeptalk'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8vgc2021'); team = [ - {species: 'heatran', ability: 'flamebody', moves: ['sleeptalk'], evs: {hp: 1}}, + { species: 'heatran', ability: 'flamebody', moves: ['sleeptalk'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); - it('should allow evolved Pokemon obtainable from events at lower levels than they could otherwise be obtained', function () { + it('should allow evolved Pokemon obtainable from events at lower levels than they could otherwise be obtained', () => { let team = [ - {species: 'dragonite', ability: 'innerfocus', moves: ['dracometeor'], nature: 'Mild', evs: {hp: 1}, level: 50}, - {species: 'magmar', ability: 'flamebody', moves: ['ember'], evs: {hp: 1}, level: 10}, - {species: 'electivire', ability: 'motordrive', moves: ['quickattack'], evs: {hp: 1}, level: 10}, + { species: 'dragonite', ability: 'innerfocus', moves: ['dracometeor'], nature: 'Mild', evs: { hp: 1 }, level: 50 }, + { species: 'magmar', ability: 'flamebody', moves: ['ember'], evs: { hp: 1 }, level: 10 }, + { species: 'electivire', ability: 'motordrive', moves: ['quickattack'], evs: { hp: 1 }, level: 10 }, ]; assert.legalTeam(team, 'gen4ou'); team = [ - {species: 'mandibuzz', level: 25, ability: 'weakarmor', moves: ['pluck'], evs: {hp: 1}}, - {species: 'volcarona', level: 35, ability: 'flamebody', moves: ['leechlife'], evs: {hp: 1}}, + { species: 'mandibuzz', level: 25, ability: 'weakarmor', moves: ['pluck'], evs: { hp: 1 } }, + { species: 'volcarona', level: 35, ability: 'flamebody', moves: ['leechlife'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen5ou'); }); diff --git a/test/sim/team-validator/formes.js b/test/sim/team-validator/formes.js index 3c7bdcc18d..7a3380e7da 100644 --- a/test/sim/team-validator/formes.js +++ b/test/sim/team-validator/formes.js @@ -4,98 +4,98 @@ const assert = require('../../assert'); let team; -describe('Team Validator', function () { - it("should validate Necrozma formes correctly", function () { +describe('Team Validator', () => { + it("should validate Necrozma formes correctly", () => { team = [ - {species: 'necrozmadawnwings', ability: 'prismarmor', shiny: true, moves: ['moongeistbeam', 'metalclaw'], evs: {hp: 1}}, + { species: 'necrozmadawnwings', ability: 'prismarmor', shiny: true, moves: ['moongeistbeam', 'metalclaw'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); }); - it('should reject Ultra Necrozma where ambiguous', function () { + it('should reject Ultra Necrozma where ambiguous', () => { team = [ - {species: 'necrozmaultra', ability: 'neuroforce', moves: ['confusion'], evs: {hp: 1}}, + { species: 'necrozmaultra', ability: 'neuroforce', moves: ['confusion'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ubers'); }); - it('should handle Deoxys formes in Gen 3', function () { + it('should handle Deoxys formes in Gen 3', () => { team = [ - {species: 'deoxys', ability: 'pressure', moves: ['wrap'], evs: {hp: 1}}, - {species: 'deoxys', ability: 'pressure', moves: ['wrap'], evs: {hp: 1}}, + { species: 'deoxys', ability: 'pressure', moves: ['wrap'], evs: { hp: 1 } }, + { species: 'deoxys', ability: 'pressure', moves: ['wrap'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen3ubers'); assert.legalTeam(team, 'gen3ubers@@@!speciesclause'); team = [ - {species: 'deoxysattack', ability: 'pressure', moves: ['wrap'], evs: {hp: 1}}, - {species: 'deoxysdefense', ability: 'pressure', moves: ['wrap'], evs: {hp: 1}}, + { species: 'deoxysattack', ability: 'pressure', moves: ['wrap'], evs: { hp: 1 } }, + { species: 'deoxysdefense', ability: 'pressure', moves: ['wrap'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen3ubers@@@!speciesclause'); assert.legalTeam(team, 'gen3ubers@@@!speciesclause,+nonexistent'); }); - it('should correctly validate USUM Rockruff', function () { + it('should correctly validate USUM Rockruff', () => { team = [ - {species: 'rockruff', ability: 'owntempo', moves: ['happyhour'], evs: {hp: 1}}, + { species: 'rockruff', ability: 'owntempo', moves: ['happyhour'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'rockruff', level: 9, ability: 'owntempo', moves: ['happyhour'], evs: {hp: 1}}, + { species: 'rockruff', level: 9, ability: 'owntempo', moves: ['happyhour'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'rockruff', level: 9, ability: 'owntempo', moves: ['tackle'], evs: {hp: 1}}, + { species: 'rockruff', level: 9, ability: 'owntempo', moves: ['tackle'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'rockruff', level: 9, ability: 'steadfast', moves: ['happyhour'], evs: {hp: 1}}, + { species: 'rockruff', level: 9, ability: 'steadfast', moves: ['happyhour'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'lycanrocdusk', ability: 'toughclaws', moves: ['happyhour'], evs: {hp: 1}}, + { species: 'lycanrocdusk', ability: 'toughclaws', moves: ['happyhour'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); team = [ - {species: 'lycanroc', ability: 'steadfast', moves: ['happyhour'], evs: {hp: 1}}, + { species: 'lycanroc', ability: 'steadfast', moves: ['happyhour'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); - it('should reject Pokemon that cannot obtain moves in a particular forme', function () { + it('should reject Pokemon that cannot obtain moves in a particular forme', () => { team = [ - {species: 'toxtricity', ability: 'punkrock', moves: ['venomdrench, magneticflux'], evs: {hp: 1}}, - {species: 'toxtricity-low-key', ability: 'punkrock', moves: ['venoshock, shiftgear'], evs: {hp: 1}}, + { species: 'toxtricity', ability: 'punkrock', moves: ['venomdrench, magneticflux'], evs: { hp: 1 } }, + { species: 'toxtricity-low-key', ability: 'punkrock', moves: ['venoshock, shiftgear'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); team = [ - {species: 'rotom-wash', ability: 'levitate', moves: ['overheat'], evs: {hp: 1}}, + { species: 'rotom-wash', ability: 'levitate', moves: ['overheat'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); team = [ - {species: 'kyurem-black', ability: 'teravolt', moves: ['glaciate'], evs: {hp: 1}}, + { species: 'kyurem-black', ability: 'teravolt', moves: ['glaciate'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); // Scary Face is a TM in Gen 8, so use Gen 7 to test team = [ - {species: 'kyurem-white', ability: 'turboblaze', moves: ['scaryface'], evs: {hp: 1}}, + { species: 'kyurem-white', ability: 'turboblaze', moves: ['scaryface'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); // Hoopa's Hyperspace moves are form-specific in Generation 9 team = [ - {species: 'hoopa-confined', ability: 'magician', moves: ['hyperspacefury'], evs: {hp: 1}}, - {species: 'hoopa-unbound', ability: 'magician', moves: ['hyperspacehole'], evs: {hp: 1}}, + { species: 'hoopa-confined', ability: 'magician', moves: ['hyperspacefury'], evs: { hp: 1 } }, + { species: 'hoopa-unbound', ability: 'magician', moves: ['hyperspacehole'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9anythinggoes'); team = [ - {species: 'hoopa-confined', ability: 'magician', moves: ['hyperspacefury'], evs: {hp: 1}}, - {species: 'hoopa-unbound', ability: 'magician', moves: ['hyperspacehole'], evs: {hp: 1}}, + { species: 'hoopa-confined', ability: 'magician', moves: ['hyperspacefury'], evs: { hp: 1 } }, + { species: 'hoopa-unbound', ability: 'magician', moves: ['hyperspacehole'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen7anythinggoes'); }); @@ -103,24 +103,24 @@ describe('Team Validator', function () { // Zamazenta is unreleased currently it.skip('should tier Zacian and Zamazenta formes seperately', () => { team = [ - {species: 'zamazenta-crowned', ability: 'dauntlessshield', item: 'rustedshield', moves: ['howl'], evs: {hp: 1}}, + { species: 'zamazenta-crowned', ability: 'dauntlessshield', item: 'rustedshield', moves: ['howl'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen9almostanyability'); team = [ - {species: 'zamazenta', ability: 'dauntlessshield', item: 'lifeorb', moves: ['howl'], evs: {hp: 1}}, + { species: 'zamazenta', ability: 'dauntlessshield', item: 'lifeorb', moves: ['howl'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9almostanyability'); }); it('should validate Unown formes in Gen 2 based on DVs', () => { team = [ - {species: 'unowng', moves: ['hiddenpower'], ivs: {hp: 12, atk: 20, def: 18, spa: 28, spd: 28, spe: 2}}, + { species: 'unowng', moves: ['hiddenpower'], ivs: { hp: 12, atk: 20, def: 18, spa: 28, spd: 28, spe: 2 } }, ]; assert.legalTeam(team, 'gen2ou'); team = [ - {species: 'unown', moves: ['hiddenpower'], ivs: {hp: 0, atk: 4, def: 4, spa: 4, spd: 4, spe: 4}}, + { species: 'unown', moves: ['hiddenpower'], ivs: { hp: 0, atk: 4, def: 4, spa: 4, spd: 4, spe: 4 } }, ]; assert.false.legalTeam(team, 'gen2ou'); }); diff --git a/test/sim/team-validator/misc.js b/test/sim/team-validator/misc.js index 10c1ddf81b..3497b2f655 100644 --- a/test/sim/team-validator/misc.js +++ b/test/sim/team-validator/misc.js @@ -2,67 +2,67 @@ const assert = require('../../assert'); -describe('Team Validator', function () { - it("should allow Shedinja to take exactly one level-up move from Ninjask in gen 3-4", function () { +describe('Team Validator', () => { + it("should allow Shedinja to take exactly one level-up move from Ninjask in gen 3-4", () => { let team = [ - {species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'swordsdance'], evs: {hp: 1}}, + { species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'swordsdance'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen4ou'); team = [ - {species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'batonpass'], evs: {hp: 1}}, + { species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'batonpass'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen3ou'); team = [ - {species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'swordsdance', 'batonpass'], evs: {hp: 1}}, - {species: 'charmander', ability: 'blaze', moves: ['flareblitz', 'dragondance'], evs: {hp: 1}}, + { species: 'shedinja', ability: 'wonderguard', moves: ['silverwind', 'swordsdance', 'batonpass'], evs: { hp: 1 } }, + { species: 'charmander', ability: 'blaze', moves: ['flareblitz', 'dragondance'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen4ou'); }); it('should correctly enforce levels on Pokémon with unusual encounters in RBY', () => { const team = [ - {species: 'dragonair', level: 15, moves: ['dragonrage'], evs: {hp: 1}}, - {species: 'electrode', level: 15, moves: ['thunderbolt'], evs: {hp: 1}}, + { species: 'dragonair', level: 15, moves: ['dragonrage'], evs: { hp: 1 } }, + { species: 'electrode', level: 15, moves: ['thunderbolt'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen1ou'); }); - it('should correctly enforce per-game evolution restrictions', function () { + it('should correctly enforce per-game evolution restrictions', () => { let team = [ - {species: 'raichualola', ability: 'surgesurfer', moves: ['doublekick'], evs: {hp: 1}}, + { species: 'raichualola', ability: 'surgesurfer', moves: ['doublekick'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); team = [ - {species: 'raichualola', ability: 'surgesurfer', moves: ['sing', 'fakeout'], evs: {hp: 1}}, + { species: 'raichualola', ability: 'surgesurfer', moves: ['sing', 'fakeout'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes@@@minsourcegen=8'); team = [ - {species: 'exeggutoralola', ability: 'frisk', moves: ['psybeam'], evs: {hp: 1}}, + { species: 'exeggutoralola', ability: 'frisk', moves: ['psybeam'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8anythinggoes'); // This works in Gen 9+ because of Mirror Herb team = [ - {species: 'raichualola', ability: 'surgesurfer', moves: ['fakeout'], evs: {hp: 1}}, + { species: 'raichualola', ability: 'surgesurfer', moves: ['fakeout'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen9anythinggoes@@@minsourcegen=9'); }); - it('should prevent Pokemon that don\'t evolve via level-up and evolve from a Pokemon that does evolve via level-up from being underleveled.', function () { + it('should prevent Pokemon that don\'t evolve via level-up and evolve from a Pokemon that does evolve via level-up from being underleveled.', () => { const team = [ - {species: 'nidoking', level: 1, ability: 'sheerforce', moves: ['earthpower'], evs: {hp: 1}}, - {species: 'mamoswine', level: 1, ability: 'oblivious', moves: ['earthquake'], evs: {hp: 1}}, + { species: 'nidoking', level: 1, ability: 'sheerforce', moves: ['earthpower'], evs: { hp: 1 } }, + { species: 'mamoswine', level: 1, ability: 'oblivious', moves: ['earthquake'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7anythinggoes'); }); it('should require Pokémon transferred from Gens 1 and 2 to be above Level 2', () => { const team = [ - {species: 'pidgey', level: 1, ability: 'bigpecks', moves: ['curse'], evs: {hp: 1}}, + { species: 'pidgey', level: 1, ability: 'bigpecks', moves: ['curse'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou'); @@ -75,141 +75,141 @@ describe('Team Validator', function () { it('should enforce Gen 1 minimum levels', () => { let team = [ - {species: 'onix', level: 12, moves: ['headbutt']}, + { species: 'onix', level: 12, moves: ['headbutt'] }, ]; assert.false.legalTeam(team, 'gen1ou'); assert.legalTeam(team, 'gen2ou'); team = [ - {species: 'slowbro', level: 15, moves: ['earthquake']}, - {species: 'voltorb', level: 14, moves: ['thunderbolt']}, - {species: 'scyther', level: 15, moves: ['quickattack']}, - {species: 'pinsir', level: 15, moves: ['visegrip']}, + { species: 'slowbro', level: 15, moves: ['earthquake'] }, + { species: 'voltorb', level: 14, moves: ['thunderbolt'] }, + { species: 'scyther', level: 15, moves: ['quickattack'] }, + { species: 'pinsir', level: 15, moves: ['visegrip'] }, ]; assert.legalTeam(team, 'gen1ou'); }); - it('should correctly enforce Shell Smash as a sketched move for Necturna prior to Gen 9', function () { + it('should correctly enforce Shell Smash as a sketched move for Necturna prior to Gen 9', () => { const team = [ - {species: 'necturna', ability: 'forewarn', moves: ['shellsmash', 'vcreate'], evs: {hp: 1}}, + { species: 'necturna', ability: 'forewarn', moves: ['shellsmash', 'vcreate'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen8cap'); }); - it("should prevent Pokemon from having a Gen 3 tutor move and a Gen 4 ability together without evolving", function () { + it("should prevent Pokemon from having a Gen 3 tutor move and a Gen 4 ability together without evolving", () => { let team = [ - {species: 'hitmonchan', ability: 'ironfist', moves: ['dynamicpunch'], evs: {hp: 1}}, + { species: 'hitmonchan', ability: 'ironfist', moves: ['dynamicpunch'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen4ou'); // Clefairy can learn Softboiled and evolve into Magic Guard Clefable team = [ - {species: 'clefable', ability: 'magicguard', moves: ['softboiled'], evs: {hp: 1}}, + { species: 'clefable', ability: 'magicguard', moves: ['softboiled'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen4ou'); }); // Based on research by Anubis: https://www.smogon.com/forums/posts/9713378 - describe(`Hackmons formes`, function () { - it(`should reject battle-only formes in Gen 9, even in Hackmons`, function () { + describe(`Hackmons formes`, () => { + it(`should reject battle-only formes in Gen 9, even in Hackmons`, () => { const team = [ - {species: 'palafinhero', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'zamazentacrowned', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'palafinhero', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'zamazentacrowned', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9purehackmons'); }); - it(`should also reject battle-only dexited formes in Gen 9 Hackmons`, function () { + it(`should also reject battle-only dexited formes in Gen 9 Hackmons`, () => { const team = [ - {species: 'zygardecomplete', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'darmanitangalarzen', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'eternatuseternamax', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'zygardecomplete', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'darmanitangalarzen', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'eternatuseternamax', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9purehackmons'); }); - it(`should not allow Xerneas with a hacked Ability in Gen 9 Hackmons`, function () { + it(`should not allow Xerneas with a hacked Ability in Gen 9 Hackmons`, () => { const team = [ - {species: 'xerneasneutral', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'xerneasneutral', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9purehackmons'); }); - it(`should allow various other hacked formes in Gen 9 Hackmons`, function () { + it(`should allow various other hacked formes in Gen 9 Hackmons`, () => { const team = [ - {species: 'giratinaorigin', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'calyrexshadow', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'greninjaash', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'gengarmega', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'groudonprimal', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'necrozmaultra', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'giratinaorigin', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'calyrexshadow', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'greninjaash', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'gengarmega', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'groudonprimal', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'necrozmaultra', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen9purehackmons'); }); - it(`should not allow old gen-exclusive formes in Gen 9 Hackmons`, function () { + it(`should not allow old gen-exclusive formes in Gen 9 Hackmons`, () => { let team = [ - {species: 'pikachucosplay', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'pikachucosplay', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9purehackmons'); team = [ - {species: 'pichuspikyeared', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'pichuspikyeared', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9purehackmons'); team = [ - {species: 'pokestarsmeargle', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'pokestarsmeargle', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9purehackmons'); }); - it(`should not allow CAP Pokemon in Gen 9 Hackmons`, function () { + it(`should not allow CAP Pokemon in Gen 9 Hackmons`, () => { const team = [ - {species: 'hemogoblin', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'hemogoblin', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen9purehackmons'); }); - it(`should allow battle-only formes in Hackmons before Gen 9`, function () { + it(`should allow battle-only formes in Hackmons before Gen 9`, () => { const team = [ - {species: 'zamazentacrowned', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, - {species: 'zygardecomplete', ability: 'steadfast', moves: ['watergun'], evs: {hp: 1}}, + { species: 'zamazentacrowned', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, + { species: 'zygardecomplete', ability: 'steadfast', moves: ['watergun'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8customgame@@@-Nonexistent'); }); }); - it('should allow various (underleveled) from Pokemon GO', function () { + it('should allow various (underleveled) from Pokemon GO', () => { const team = [ - {species: 'mewtwo', level: 20, ability: 'pressure', moves: ['agility'], evs: {hp: 1}, ivs: {hp: 1, atk: 1, def: 1, spa: 1, spd: 1}}, - {species: 'donphan', level: 1, ability: 'sturdy', moves: ['endeavor']}, - {species: 'mew', shiny: true, level: 15, ability: 'synchronize', moves: ['pound'], evs: {hp: 1}}, - {species: 'uxie', level: 1, ability: 'levitate', moves: ['acrobatics']}, - {species: 'zacian', ability: 'intrepidsword', moves: ['agility'], evs: {hp: 1}}, - {species: 'volcarona', level: 2, ability: 'flamebody', moves: ['acrobatics'], evs: {hp: 1}}, + { species: 'mewtwo', level: 20, ability: 'pressure', moves: ['agility'], evs: { hp: 1 }, ivs: { hp: 1, atk: 1, def: 1, spa: 1, spd: 1 } }, + { species: 'donphan', level: 1, ability: 'sturdy', moves: ['endeavor'] }, + { species: 'mew', shiny: true, level: 15, ability: 'synchronize', moves: ['pound'], evs: { hp: 1 } }, + { species: 'uxie', level: 1, ability: 'levitate', moves: ['acrobatics'] }, + { species: 'zacian', ability: 'intrepidsword', moves: ['agility'], evs: { hp: 1 } }, + { species: 'volcarona', level: 2, ability: 'flamebody', moves: ['acrobatics'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen9ubers'); }); - it('should disallow Pokemon from Pokemon GO knowing incompatible moves', function () { + it('should disallow Pokemon from Pokemon GO knowing incompatible moves', () => { const team = [ - {species: 'mew', shiny: true, level: 15, ability: 'synchronize', moves: ['aircutter'], evs: {hp: 1}, ivs: {hp: 21, atk: 31, def: 21, spa: 21, spd: 31, spe: 0}}, + { species: 'mew', shiny: true, level: 15, ability: 'synchronize', moves: ['aircutter'], evs: { hp: 1 }, ivs: { hp: 21, atk: 31, def: 21, spa: 21, spd: 31, spe: 0 } }, ]; assert.false.legalTeam(team, 'gen8ou'); }); - it('should check for legal combinations of prevo/evo-exclusive moves', function () { + it('should check for legal combinations of prevo/evo-exclusive moves', () => { let team = [ - {species: 'slowking', ability: 'oblivious', moves: ['counter', 'slackoff'], evs: {hp: 1}}, + { species: 'slowking', ability: 'oblivious', moves: ['counter', 'slackoff'], evs: { hp: 1 } }, ]; assert.false.legalTeam(team, 'gen7ou'); team = [ - {species: 'incineroar', ability: 'blaze', moves: ['knockoff', 'partingshot'], evs: {hp: 1}}, - {species: 'shelloseast', ability: 'stickyhold', moves: ['infestation', 'stringshot'], evs: {hp: 1}}, + { species: 'incineroar', ability: 'blaze', moves: ['knockoff', 'partingshot'], evs: { hp: 1 } }, + { species: 'shelloseast', ability: 'stickyhold', moves: ['infestation', 'stringshot'], evs: { hp: 1 } }, ]; assert.legalTeam(team, 'gen8ou'); }); diff --git a/test/sim/tools/exhaustive-runner.js b/test/sim/tools/exhaustive-runner.js index 8cf69eb033..a55e25dddd 100644 --- a/test/sim/tools/exhaustive-runner.js +++ b/test/sim/tools/exhaustive-runner.js @@ -2,12 +2,12 @@ const assert = require('assert').strict; -const {ExhaustiveRunner} = require('../../../dist/sim/tools/exhaustive-runner'); +const { ExhaustiveRunner } = require('../../../dist/sim/tools/exhaustive-runner'); -describe('ExhaustiveRunner (slow)', async function () { +describe('ExhaustiveRunner (slow)', async () => { it('should run successfully', async function () { this.timeout(0); - const opts = {prng: [1, 2, 3, 4]}; + const opts = { prng: [1, 2, 3, 4] }; for (const format of ExhaustiveRunner.FORMATS) { opts.format = format; assert.equal(await (new ExhaustiveRunner(opts).run()), 0); diff --git a/test/sim/tools/multi-random-runner.js b/test/sim/tools/multi-random-runner.js index 77c4ca80df..87c9baf184 100644 --- a/test/sim/tools/multi-random-runner.js +++ b/test/sim/tools/multi-random-runner.js @@ -2,12 +2,12 @@ const assert = require('assert').strict; -const {MultiRandomRunner} = require('../../../dist/sim/tools/multi-random-runner'); +const { MultiRandomRunner } = require('../../../dist/sim/tools/multi-random-runner'); -describe('MultiRandomRunner (slow)', async function () { +describe('MultiRandomRunner (slow)', async () => { it('should run successfully', async function () { this.timeout(0); - const opts = {totalGames: 100, prng: [1, 2, 3, 4]}; + const opts = { totalGames: 100, prng: [1, 2, 3, 4] }; assert.equal(await (new MultiRandomRunner(opts).run()), 0); }); }); diff --git a/test/tools/build/sucrase.js b/test/tools/build/sucrase.js index 0efd733277..52fadf852f 100644 --- a/test/tools/build/sucrase.js +++ b/test/tools/build/sucrase.js @@ -3,7 +3,7 @@ * @author mia-pi-git */ 'use strict'; -const {execSync: exec} = require('child_process'); +const { execSync: exec } = require('child_process'); const common = require('../../common'); (common.hasModule('sucrase') ? describe : describe.skip)("The Sucrase build script", () => { diff --git a/test/tools/modlog/converter.js b/test/tools/modlog/converter.js index 84f95ae826..22594861d4 100644 --- a/test/tools/modlog/converter.js +++ b/test/tools/modlog/converter.js @@ -352,12 +352,12 @@ describe('Modlog conversion script', () => { it('should correctly parse poll modlogs', () => { assert.equal( - converter.modernizeLog('[2020-08-23T19:50:49.944Z] (development) ([apoll] was started by [annika].)',), + converter.modernizeLog('[2020-08-23T19:50:49.944Z] (development) ([apoll] was started by [annika].)'), '[2020-08-23T19:50:49.944Z] (development) POLL: by annika' ); assert.equal( - converter.modernizeLog('[2020-08-23T19:50:49.944Z] (development) ([thepoll] was ended by [annika].)',), + converter.modernizeLog('[2020-08-23T19:50:49.944Z] (development) ([thepoll] was ended by [annika].)'), '[2020-08-23T19:50:49.944Z] (development) POLL END: by annika' ); }); @@ -516,7 +516,6 @@ describe('Modlog conversion script', () => { } ); - assert.deepEqual( converter.parseModlog(`[2020-08-23T19:50:49.944Z] (development) WEEKLOCK: [gejg] alts:[annalytically] [127.0.0.1] by somemod: terrible user`), { @@ -648,13 +647,13 @@ describe('Modlog conversion script', () => { action: 'OLD MODLOG', roomID: 'development', isGlobal: false, loggedBy: 'unknown', note: `hello hi test`, time: 1598212249944, alts: [], }), - `[2020-08-23T19:50:49.944Z] (development) OLD MODLOG: by unknown: hello hi test\n`, + `[2020-08-23T19:50:49.944Z] (development) OLD MODLOG: by unknown: hello hi test\n` ); }); it('should handle hangman', () => { assert.deepEqual( - converter.rawifyLog({action: 'HANGMAN', roomID: 'lobby', isGlobal: false, loggedBy: 'archastl', time: 1600557924908, alts: []}), + converter.rawifyLog({ action: 'HANGMAN', roomID: 'lobby', isGlobal: false, loggedBy: 'archastl', time: 1600557924908, alts: [] }), `[2020-09-19T23:25:24.908Z] (lobby) HANGMAN: by archastl\n` ); }); diff --git a/test/users-utils.js b/test/users-utils.js index 327358747c..81ac4bdf9c 100644 --- a/test/users-utils.js +++ b/test/users-utils.js @@ -8,7 +8,7 @@ class WorkerStream extends ObjectReadWriteStream { constructor(id) { super(); this.id = id; - this.process = {connected: true}; + this.process = { connected: true }; this.sockets = new Set(); this.rooms = new Map(); this.roomChannels = new Map(); diff --git a/tools/build-utils.js b/tools/build-utils.js index 96f6ea0ed4..2853a20287 100644 --- a/tools/build-utils.js +++ b/tools/build-utils.js @@ -41,7 +41,7 @@ const findFilesForPath = path => { return out; }; -exports.transpile = (decl) => { +exports.transpile = decl => { esbuild.buildSync({ entryPoints: findFilesForPath('./'), outdir: './dist', @@ -61,6 +61,6 @@ exports.transpile = (decl) => { exports.buildDecls = () => { try { - child_process.execSync(`node ./node_modules/typescript/bin/tsc -p sim`, {stdio: 'inherit'}); + child_process.execSync(`node ./node_modules/typescript/bin/tsc -p sim`, { stdio: 'inherit' }); } catch {} }; diff --git a/tools/modlog/converter.ts b/tools/modlog/converter.ts index 0b8685afac..f59e7a6070 100644 --- a/tools/modlog/converter.ts +++ b/tools/modlog/converter.ts @@ -17,7 +17,7 @@ if (!global.Config) { nofswriting: false, usesqlitemodlog: hasSQLite, usesqlite: hasSQLite, - }; + } as any; } import type * as DatabaseType from 'better-sqlite3'; diff --git a/tools/set-import/importer.ts b/tools/set-import/importer.ts index b9619962d9..b1ee5ce5de 100644 --- a/tools/set-import/importer.ts +++ b/tools/set-import/importer.ts @@ -5,9 +5,9 @@ import * as util from 'util'; import * as smogon from 'smogon'; -import {Streams} from '../../lib'; -import {Dex, toID} from '../../sim/dex'; -import {TeamValidator} from '../../sim/team-validator'; +import { Streams } from '../../lib'; +import { Dex, toID } from '../../sim/dex'; +import { TeamValidator } from '../../sim/team-validator'; Dex.includeModData(); type DeepPartial = { @@ -24,7 +24,7 @@ interface PokemonSets { interface IncomingMessage extends NodeJS.ReadableStream { statusCode: number; - headers: {location?: string}; + headers: { location?: string }; } // eg. 'gen1.json' @@ -50,13 +50,13 @@ export const TIERS = new Set([ 'anythinggoes', 'nationaldexag', 'almostanyability', 'balancedhackmons', 'letsgoou', 'monotype', 'purehackmons', 'nationaldexmonotype', ]); -const FORMATS = new Map(); +const FORMATS = new Map(); const VALIDATORS = new Map(); for (let gen = 1; gen <= 9; gen++) { for (const tier of TIERS) { const format = Dex.formats.get(`gen${gen}${tier}`); if (format.effectType === 'Format') { - FORMATS.set(format.id, {gen: gen as GenerationNum, format}); + FORMATS.set(format.id, { gen: gen as GenerationNum, format }); VALIDATORS.set(format.id, new TeamValidator(format)); } } @@ -76,10 +76,10 @@ export async function importAll() { async function importGen(gen: GenerationNum, index: string) { const data: GenerationData = {}; - const smogonSetsByFormat: {[formatid: string]: PokemonSets} = {}; - const thirdPartySetsByFormat: {[source: string]: {[formatid: string]: PokemonSets}} = {}; + const smogonSetsByFormat: { [formatid: string]: PokemonSets } = {}; + const thirdPartySetsByFormat: { [source: string]: { [formatid: string]: PokemonSets } } = {}; - const numByFormat: {[formatid: string]: number} = {}; + const numByFormat: { [formatid: string]: number } = {}; const imports = []; const dex = Dex.forFormat(`gen${gen}ou`); for (const id in dex.data.Pokedex) { @@ -90,7 +90,7 @@ async function importGen(gen: GenerationNum, index: string) { } await Promise.all(imports); - for (const {format, gen: g} of FORMATS.values()) { + for (const { format, gen: g } of FORMATS.values()) { if (g !== gen) continue; if (smogonSetsByFormat[format.id] && Object.keys(smogonSetsByFormat[format.id]).length) { @@ -167,8 +167,8 @@ function toGen(dex: ModdedDex, name: string): GenerationNum | undefined { async function importSmogonSets( pokemon: string, gen: GenerationNum, - setsByFormat: {[format: string]: PokemonSets}, - numByFormat: {[format: string]: number} + setsByFormat: { [format: string]: PokemonSets }, + numByFormat: { [format: string]: number } ) { const analysesByFormat = await getAnalysesByFormat(pokemon, gen); if (!analysesByFormat) return; @@ -200,7 +200,7 @@ async function importSmogonSets( addSmogonSet(dex, format, pokemon, name, set, setsForPokemon, numByFormat); for (const battleOnlyForme of battleOnlyFormes) { // Note: this is just a shallow copy which is fine because we're just modifying the ability - const s = {...set}; + const s = { ...set }; if (!format.id.includes('balancedhackmons')) s.ability = battleOnlyForme.abilities[0]; if (typeof battleOnlyForme.battleOnly !== 'string') { if (!battleOnlyForme.battleOnly!.includes(pokemon)) continue; @@ -223,7 +223,7 @@ function addSmogonSet( name: string, set: DeepPartial, setsForPokemon: PokemonSets, - numByFormat: {[format: string]: number}, + numByFormat: { [format: string]: number }, outOfBattleSpeciesName?: string ) { if (validSet('dex', dex, format, pokemon, name, set, outOfBattleSpeciesName)) { @@ -302,8 +302,8 @@ function validSet( } function skip(dex: ModdedDex, format: Format, pokemon: string, set: DeepPartial) { - const {gen} = FORMATS.get(format.id)!; - const hasMove = (m: string) => set.moves && set.moves.includes(m); + const { gen } = FORMATS.get(format.id)!; + const hasMove = (m: string) => set.moves?.includes(m); const bh = format.id.includes('balancedhackmons'); if (pokemon === 'Groudon-Primal' && set.item !== 'Red Orb') return true; @@ -334,7 +334,7 @@ function toPokemonSet( outOfBattleSpeciesName?: string ): PokemonSet { // To simplify things, during validation we mutate the input set to correct for HP mismatches - const hp = set.moves && set.moves.find(m => m.startsWith('Hidden Power')); + const hp = set.moves?.find(m => m.startsWith('Hidden Power')); let fill = dex.gen === 2 ? 30 : 31; if (hp) { const type = hp.slice(13); @@ -343,23 +343,23 @@ function toPokemonSet( set.hpType = type; fill = 31; } else if (dex.gen === 2) { - const dvs = {...dex.types.get(type).HPdvs}; + const dvs = { ...dex.types.get(type).HPdvs }; let stat: StatID; for (stat in dvs) { dvs[stat]! *= 2; } - set.ivs = {...dvs, ...set.ivs}; + set.ivs = { ...dvs, ...set.ivs }; set.ivs.hp = expectedHP(set.ivs); } else { - set.ivs = {...dex.types.get(type).HPivs, ...set.ivs}; + set.ivs = { ...dex.types.get(type).HPivs, ...set.ivs }; } } } - const copy = {species: pokemon, ...set} as PokemonSet; + const copy = { species: pokemon, ...set } as PokemonSet; copy.ivs = fillStats(set.ivs, fill); // The validator expects us to have at least 1 EV set to prove it is intentional - if (!set.evs && dex.gen >= 3 && format.id !== 'gen7letsgoou') set.evs = {spe: 1}; + if (!set.evs && dex.gen >= 3 && format.id !== 'gen7letsgoou') set.evs = { spe: 1 }; copy.evs = fillStats(set.evs, dex.gen <= 2 ? 252 : 0); // The validator wants an ability even when Gen < 3 copy.ability = copy.ability || 'None'; @@ -378,7 +378,6 @@ function toPokemonSet( return copy; } - function expectedHP(ivs: Partial) { ivs = fillStats(ivs, 31); const atkDV = Math.floor(ivs.atk! / 2); @@ -405,7 +404,7 @@ const SMOGON = { vgc24regulatione: 'vgc2023regulatione', // bssseries1: 'battlestadiumsinglesseries1', // ? bssseries2: 'battlestadiumsinglesseries2', -} as unknown as {[id: string]: ID}; +} as unknown as { [id: string]: ID }; const getAnalysis = retrying(async (u: string) => { try { @@ -459,11 +458,11 @@ function getLevel(format: Format, level = 0) { export async function getStatisticsURL( index: string, format: Format -): Promise<{url: string, count: number} | undefined> { +): Promise<{ url: string, count: number } | undefined> { const current = index.includes(format.id); const latest = await smogon.Statistics.latestDate(format.id, !current); if (!latest) return undefined; - return {url: smogon.Statistics.url(latest.date, format.id, current || 1500), count: latest.count}; + return { url: smogon.Statistics.url(latest.date, format.id, current || 1500), count: latest.count }; } // TODO: Use bigram matrix, bucketed spreads and generative validation logic for more realistic sets @@ -487,7 +486,7 @@ function importUsageBasedSets(gen: GenerationNum, format: Format, statistics: sm if (gen >= 3) { const id = top(stats.Abilities) as string; set.ability = fixedAbility(dex, pokemon, dex.abilities.get(id).name); - const {nature, evs} = fromSpread(top(stats.Spreads) as string); + const { nature, evs } = fromSpread(top(stats.Spreads) as string); set.nature = nature; if (format.id !== 'gen7letsgoou') { if (!evs || !Object.keys(evs).length) continue; @@ -523,10 +522,10 @@ function fromSpread(spread: string) { const ev = Number(rev); if (ev) evs[STATS[i]] = ev; } - return {nature, evs}; + return { nature, evs }; } -function top(weighted: {[key: string]: number}, n = 1): string | string[] | undefined { +function top(weighted: { [key: string]: number }, n = 1): string | string[] | undefined { if (n === 0) return undefined; // Optimize the more common case with an linear algorithm instead of log-linear if (n === 1) { @@ -562,7 +561,7 @@ const request = retrying(throttling(fetch, 1, 50), 5, 20); export function fetch(u: string) { const client = u.startsWith('http:') ? http : https; return new Promise((resolve, reject) => { - // @ts-ignore Typescript bug - thinks the second argument should be RequestOptions, not a callback + // @ts-expect-error Typescript bug - thinks the second argument should be RequestOptions, not a callback const req = client.get(u, (res: IncomingMessage) => { if (res.statusCode !== 200) { if (res.statusCode >= 500 && res.statusCode < 600) { diff --git a/tools/set-import/index.js b/tools/set-import/index.js index f61a16ea74..db896d3236 100755 --- a/tools/set-import/index.js +++ b/tools/set-import/index.js @@ -22,7 +22,7 @@ const child_process = require('child_process'); const path = require('path'); const fs = require('fs'); -const shell = cmd => child_process.execSync(cmd, {stdio: 'inherit', cwd: path.resolve(__dirname, '../..')}); +const shell = cmd => child_process.execSync(cmd, { stdio: 'inherit', cwd: path.resolve(__dirname, '../..') }); shell('node build'); function missing(dep) { @@ -84,7 +84,7 @@ const SETS = path.resolve(__dirname, 'sets'); } else { version = `${major}.${minor}.${Number(patch) + 1}`; } - } catch (err) { + } catch { console.error("Version required to create '@smogon/sets' package"); process.exit(1); } @@ -92,7 +92,7 @@ const SETS = path.resolve(__dirname, 'sets'); const packagejson = { "name": "@smogon/sets", - "version": version, + version, "description": "Set data imported from Smogon.com and used on Pokémon Showdown", "main": "index.js", "unpkg": "index.js", diff --git a/tools/simulate/index.js b/tools/simulate/index.js index 5bb265218e..410b9929df 100644 --- a/tools/simulate/index.js +++ b/tools/simulate/index.js @@ -38,11 +38,11 @@ if (process.argv[2]) { require('child_process').execSync('node ' + __dirname + "/../../build"); const Dex = require('../../sim/dex').Dex; -global.Config = {allowrequestingties: false}; +global.Config = { allowrequestingties: false }; Dex.includeModData(); -const {ExhaustiveRunner} = require('../../sim/tools/exhaustive-runner'); -const {MultiRandomRunner} = require('../../sim/tools/multi-random-runner'); +const { ExhaustiveRunner } = require('../../sim/tools/exhaustive-runner'); +const { MultiRandomRunner } = require('../../sim/tools/multi-random-runner'); // Tracks whether some promises threw errors that weren't caught so we can log // and exit with a non-zero status to fail any tests. This "shouldn't happen" @@ -53,7 +53,7 @@ const RejectionTracker = new class { } onUnhandledRejection(reason, promise) { - this.unhandled.push({reason, promise}); + this.unhandled.push({ reason, promise }); } onRejectionHandled(promise) { @@ -90,8 +90,11 @@ function missing(dep) { } } +function shell(cmd) { + require('child_process').execSync(cmd, { stdio: 'inherit', cwd: __dirname }); +} function parseFlags(argv) { - if (!(argv.length > 3 || argv.length === 3 && argv[2].startsWith('-'))) return {_: argv.slice(2)}; + if (!(argv.length > 3 || argv.length === 3 && argv[2].startsWith('-'))) return { _: argv.slice(2) }; if (missing('minimist')) shell('npm install minimist'); return require('minimist')(argv.slice(2)); } @@ -102,7 +105,7 @@ case 'multi': case 'random': { const argv = parseFlags(process.argv); - const options = Object.assign({totalGames: 100}, argv); + const options = { totalGames: 100, ...argv }; options.totalGames = Number(argv._[1] || argv.num) || options.totalGames; if (argv.seed) options.prng = argv.seed.split(',').map(s => Number(s)); // Run options.totalGames, exiting with the number of games with errors. diff --git a/tools/team-generation-benchmark.js b/tools/team-generation-benchmark.js index b419626618..3affadfa19 100644 --- a/tools/team-generation-benchmark.js +++ b/tools/team-generation-benchmark.js @@ -1,18 +1,15 @@ 'use strict'; -const {Teams} = require('../dist/sim'); -const {Dex} = require('../dist/sim/dex'); - +const { Teams } = require('../dist/sim'); +const { Dex } = require('../dist/sim/dex'); if (!process.argv[2]) { console.log(`Usage: node team-generation-benchmark.js [number of runs]`); process.exit(1); } - const n = parseInt(process.argv[3]) || 10000; - // initial team to warm things up const format = Dex.formats.get(process.argv[2]); const generator = Teams.getGenerator(format); @@ -20,8 +17,8 @@ generator.getTeam(); const start = Date.now(); for (let i = 0; i < n; i++) { - const generator = Teams.getGenerator(format); - generator.getTeam(); + const newGenerator = Teams.getGenerator(format); + newGenerator.getTeam(); } const delta = Date.now() - start; console.log(`${format.name}: ${Math.round((delta / n) * 1000)}ns per team (${n} teams in ${delta}ms)`); diff --git a/tsconfig.json b/tsconfig.json index f0cd522688..0da0a4cfc6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ "strict": true, "allowJs": true, "checkJs": true, + "forceConsistentCasingInFileNames": true, "incremental": true, "allowUnreachableCode": false, "esModuleInterop": true, @@ -20,6 +21,7 @@ }, "types": ["node"], "exclude": [ + "/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.dom.d.ts", "./.*-dist/**/*", "./server/chat-plugins/private/*/*.d.ts" ],