From 9c6c052623ecd414769f2bf7676bc943842a1a15 Mon Sep 17 00:00:00 2001 From: Sylvain Pollet-Villard Date: Thu, 20 Jul 2023 08:32:47 +0200 Subject: [PATCH] Psychic rework and Unowns (#827) --- README.md | 2 +- app/core/abilities/hidden-power.ts | 779 ++++++++++++++++++ app/core/abilities/index.ts | 400 +++++++++ app/core/attack-strategy.ts | 19 +- app/core/attacking-state.ts | 6 +- app/core/pokemon-entity.ts | 5 +- app/core/pokemon-state.ts | 37 +- app/core/simulation.ts | 26 +- app/models/colyseus-models/pokemon.ts | 384 +++++---- app/models/colyseus-models/synergies.ts | 6 +- app/models/pokemon-factory.ts | 20 +- app/models/precomputed/ability.json | 2 +- app/models/precomputed/pokemons-data.csv | 16 +- app/models/precomputed/type-pokemons-all.json | 2 +- app/models/precomputed/type-rarity-all.json | 2 +- app/models/shop.ts | 37 +- .../src/game/components/battle-manager.ts | 31 + .../src/game/components/unown-manager.ts | 180 +++- .../component/collection/pokemon-carousel.tsx | 2 + .../component/collection/unown-panel.tsx | 44 +- .../component/game/game-pokemon-portrait.tsx | 23 +- app/rooms/commands/game-commands.ts | 37 +- app/rooms/commands/lobby-commands.ts | 21 +- app/rooms/commands/preparation-commands.ts | 38 +- app/rooms/game-room.ts | 19 + app/types/enum/Ability.ts | 370 +-------- app/types/enum/Passive.ts | 3 +- app/types/enum/Pokemon.ts | 141 ++-- app/types/index.ts | 1 - app/types/strings/Ability.ts | 349 +++++++- app/types/strings/Effect.ts | 4 +- app/types/strings/Passive.ts | 13 +- app/types/strings/Synergy.ts | 2 +- changelog/patch-3.10.md | 3 +- gen/precompute.ts | 4 +- package-lock.json | 54 +- tests/ability-check.ts | 16 + 37 files changed, 2356 insertions(+), 742 deletions(-) create mode 100644 app/core/abilities/hidden-power.ts create mode 100644 app/core/abilities/index.ts create mode 100644 tests/ability-check.ts diff --git a/README.md b/README.md index 7827c6ba14..6e2f6e705e 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ The private key is a json that contain those informations: "token_uri": "", "auth_provider_x509_cert_url": "", "client_x509_cert_url": "", - "universe_domain": " + "universe_domain": "" } ``` diff --git a/app/core/abilities/hidden-power.ts b/app/core/abilities/hidden-power.ts new file mode 100644 index 0000000000..259c6c96a2 --- /dev/null +++ b/app/core/abilities/hidden-power.ts @@ -0,0 +1,779 @@ +import PokemonFactory from "../../models/pokemon-factory" +import { Ability } from "../../types/enum/Ability" +import { AttackType, PokemonActionState } from "../../types/enum/Game" +import { Item } from "../../types/enum/Item" +import { Pkm, PkmIndex, Unowns } from "../../types/enum/Pokemon" +import { Synergy } from "../../types/enum/Synergy" +import { pickRandomIn } from "../../utils/random" +import { AttackStrategy } from "../attack-strategy" +import Board from "../board" +import PokemonEntity from "../pokemon-entity" +import PokemonState from "../pokemon-state" +import PRECOMPUTED_TYPE_POKEMONS from "../../models/precomputed/type-pokemons.json" +import ItemFactory from "../../models/item-factory" +import { AbilityStrategy } from "." +import { Transfer } from "../../types" + +export class HiddenPowerStrategy extends AttackStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ): void { + super.process(unown, state, board, target, crit) + unown.handleDamage({ + damage: unown.life, + board, + attackType: AttackType.TRUE, + attacker: null, + shouldTargetGainMana: false + }) + } +} + +export class HiddenPowerAStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const corners = [ + [0, 0], + [board.columns - 1, 0], + [0, board.rows - 1], + [board.columns - 1, board.rows - 1] + ] + corners.forEach(([x, y]) => { + const player = unown.simulation.player! + const abra = PokemonFactory.createPokemonFromName( + Pkm.ABRA, + player.pokemonCollection.get(PkmIndex[Pkm.ABRA]) + ) + const coord = unown.simulation.getClosestAvailablePlaceOnBoardTo( + x, + y, + unown.team + ) + unown.simulation.addPokemon(abra, coord.x, coord.y, unown.team, false) + }) + } +} + +export class HiddenPowerBStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach((x: number, y: number, enemy: PokemonEntity | undefined) => { + if (enemy && unown.team != enemy.team) { + enemy.status.triggerBurn(30000, enemy, unown, board) + } + }) + } +} + +export class HiddenPowerCStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach( + (x: number, y: number, pokemon: PokemonEntity | undefined) => { + if (pokemon && unown.team === pokemon.team) { + if (pokemon.items.size < 3) { + pokemon.items.add(Item.AMULET_COIN) + pokemon.simulation.applyItemEffect(pokemon, Item.AMULET_COIN) + } + } + } + ) + } +} + +export class HiddenPowerDStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const player = unown.simulation.player! + const x = player.simulation.room.getFirstAvailablePositionInBench(player.id) + if (x !== undefined) { + const ditto = PokemonFactory.createPokemonFromName( + Pkm.DITTO, + player.pokemonCollection.get(PkmIndex[Pkm.DITTO]) + ) + ditto.positionX = x + ditto.positionY = 0 + player.board.set(ditto.id, ditto) + } + } +} + +export class HiddenPowerEStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const egg = PokemonFactory.createRandomEgg() + const player = unown.simulation.player! + const x = player.simulation.room.getFirstAvailablePositionInBench(player.id) + if (x !== undefined) { + egg.positionX = x + egg.positionY = 0 + egg.evolutionTimer = 1 + player.board.set(egg.id, egg) + } + } +} + +export class HiddenPowerFStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const fishingLevel = 3 + const nbFishes = 2 + const player = unown.simulation.player! + + for (let i = 0; i < nbFishes; i++) { + const pkm = player.simulation.room.state.shop.fishPokemon( + player, + fishingLevel + ) + const fish = PokemonFactory.createPokemonFromName(pkm) + const x = unown.simulation.room.getFirstAvailablePositionInBench( + player.id + ) + fish.positionX = x !== undefined ? x : -1 + fish.positionY = 0 + fish.action = PokemonActionState.FISH + player.board.set(fish.id, fish) + unown.simulation.room.updateEvolution(player.id) + unown.simulation.room.clock.setTimeout(() => { + fish.action = PokemonActionState.IDLE + }, 1000) + } + } +} + +export class HiddenPowerGStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const player = unown.simulation.player! + player.money += 5 + } +} + +export class HiddenPowerHStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach( + (x: number, y: number, pokemon: PokemonEntity | undefined) => { + if (pokemon && unown.team === pokemon.team) { + pokemon.handleHeal(pokemon.hp - pokemon.life, unown, 1) + } + } + ) + } +} + +export class HiddenPowerIStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const player = unown.simulation.player! + player.items.add(ItemFactory.createBasicRandomItem()) + } +} + +export class HiddenPowerJStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const numberToSpawn = 2 + const player = unown.simulation.player! + for (let i = 0; i < numberToSpawn; i++) { + const coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const sharpedo = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.SHARPEDO, + player.pokemonCollection.get(PkmIndex[Pkm.SHARPEDO]) + ), + coord.x, + coord.y, + unown.team, + false + ) + sharpedo.items.add(Item.RAZOR_CLAW) + sharpedo.simulation.applyItemsEffects(sharpedo) + } + } +} + +export class HiddenPowerKStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const player = unown.simulation.player! + const hitmonlee = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.HITMONLEE, + player.pokemonCollection.get(PkmIndex[Pkm.HITMONLEE]) + ), + coord.x, + coord.y, + unown.team, + false + ) + hitmonlee.items.add(Item.RED_ORB) + hitmonlee.simulation.applyItemsEffects(hitmonlee) + hitmonlee.mana = hitmonlee.maxMana - 1 + } +} + +export class HiddenPowerLStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach( + (x: number, y: number, pokemon: PokemonEntity | undefined) => { + if (pokemon && unown.team === pokemon.team) { + if (pokemon.items.size < 3) { + pokemon.items.add(Item.MAX_REVIVE) + pokemon.simulation.applyItemEffect(pokemon, Item.MAX_REVIVE) + } + } + } + ) + } +} + +export class HiddenPowerMStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach( + (x: number, y: number, pokemon: PokemonEntity | undefined) => { + if (pokemon && unown.team === pokemon.team) { + pokemon.mana = pokemon.maxMana + } + } + ) + } +} + +export class HiddenPowerNStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach( + (x: number, y: number, pokemon: PokemonEntity | undefined) => { + if (pokemon && unown.team === pokemon.team) { + const target = board.getValue(pokemon.targetX, pokemon.targetY) + if (target) { + AbilityStrategy[Ability.EXPLOSION].process( + pokemon, + pokemon.state, + board, + target, + false + ) + pokemon.simulation.room.broadcast(Transfer.ABILITY, { + id: pokemon.simulation.id, + skill: Ability.EXPLOSION, + positionX: pokemon.positionX, + positionY: pokemon.positionY, + targetX: target.positionX, + targetY: target.positionY, + orientation: pokemon.orientation + }) + } + } + } + ) + } +} + +export class HiddenPowerOStrategy extends HiddenPowerStrategy { + process( + pokemon: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(pokemon, state, board, target, crit) + board.forEach((x: number, y: number, value: PokemonEntity | undefined) => { + if (value && pokemon.team === value.team) { + if (value.items.size < 3) { + value.items.add(Item.ORAN_BERRY) + value.simulation.applyItemEffect(value, Item.ORAN_BERRY) + } + } + }) + } +} + +export class HiddenPowerPStrategy extends HiddenPowerStrategy { + process( + pokemon: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(pokemon, state, board, target, crit) + const player = pokemon.simulation.player! + const numberToSpawn = 5 + const bugs = [ + ...PRECOMPUTED_TYPE_POKEMONS[Synergy.BUG].pokemons, + ...PRECOMPUTED_TYPE_POKEMONS[Synergy.BUG].additionalPokemons + ] as Pkm[] + for (let i = 0; i < numberToSpawn; i++) { + const bug = pickRandomIn(bugs) + const coord = pokemon.simulation.getClosestAvailablePlaceOnBoardToPokemon( + pokemon, + pokemon.team + ) + pokemon.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + bug, + player.pokemonCollection.get(PkmIndex[bug]) + ), + coord.x, + coord.y, + pokemon.team, + false + ) + } + } +} + +export class HiddenPowerQStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + unown.simulation.room.state.time = 0 + } +} + +export class HiddenPowerRStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + let coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const player = unown.simulation.player! + const geodude = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.GEODUDE, + player.pokemonCollection.get(PkmIndex[Pkm.GEODUDE]) + ), + coord.x, + coord.y, + unown.team, + false + ) + geodude.items.add(Item.ROCKY_HELMET) + geodude.simulation.applyItemsEffects(geodude) + + coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const graveler = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.GRAVELER, + player.pokemonCollection.get(PkmIndex[Pkm.GRAVELER]) + ), + coord.x, + coord.y, + unown.team, + false + ) + graveler.items.add(Item.ROCKY_HELMET) + graveler.simulation.applyItemsEffects(graveler) + + coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const golem = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.GOLEM, + player.pokemonCollection.get(PkmIndex[Pkm.GOLEM]) + ), + coord.x, + coord.y, + unown.team, + false + ) + golem.items.add(Item.ROCKY_HELMET) + golem.simulation.applyItemsEffects(golem) + } +} + +export class HiddenPowerSStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach((x: number, y: number, enemy: PokemonEntity | undefined) => { + if (enemy && unown.team != enemy.team) { + enemy.status.triggerFreeze(4000, enemy) + } + }) + } +} + +export class HiddenPowerTStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const player = unown.simulation.player! + const tapu = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.TAPU_LELE, + player.pokemonCollection.get(PkmIndex[Pkm.TAPU_LELE]) + ), + coord.x, + coord.y, + unown.team, + false + ) + tapu.items.add(Item.CHOICE_SPECS) + tapu.simulation.applyItemsEffects(tapu) + tapu.mana = tapu.maxMana + } +} + +export class HiddenPowerUStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const player = unown.simulation.player! + const uxie = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.UXIE, + player.pokemonCollection.get(PkmIndex[Pkm.UXIE]) + ), + coord.x, + coord.y, + unown.team, + false + ) + uxie.items.add(Item.AQUA_EGG) + uxie.simulation.applyItemsEffects(uxie) + uxie.mana = uxie.maxMana - 1 + } +} + +export class HiddenPowerVStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach((x: number, y: number, enemy: PokemonEntity | undefined) => { + if (enemy && unown.team !== enemy.team) { + AbilityStrategy[Ability.THUNDER].process( + unown, + unown.state, + board, + enemy, + false + ) + unown.simulation.room.broadcast(Transfer.ABILITY, { + id: unown.simulation.id, + skill: Ability.THUNDER, + positionX: unown.positionX, + positionY: unown.positionY, + targetX: enemy.positionX, + targetY: enemy.positionY, + orientation: unown.orientation + }) + } + }) + } +} + +export class HiddenPowerWStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const player = unown.simulation.player! + const topSynergy = Array.from(player.synergies).sort( + ([s1, v1], [s2, v2]) => v2 - v1 + )[0][0] + const candidates = [ + ...PRECOMPUTED_TYPE_POKEMONS[topSynergy].pokemons, + ...PRECOMPUTED_TYPE_POKEMONS[topSynergy].additionalPokemons + ] as Pkm[] + const pkm = pickRandomIn(candidates) + + const x = player.simulation.room.getFirstAvailablePositionInBench(player.id) + if (x !== undefined) { + const pokemon = PokemonFactory.createPokemonFromName( + pkm, + player.pokemonCollection.get(PkmIndex[pkm]) + ) + pokemon.positionX = x + pokemon.positionY = 0 + player.board.set(pokemon.id, pokemon) + } + } +} + +export class HiddenPowerXStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach( + (x: number, y: number, pokemon: PokemonEntity | undefined) => { + if (pokemon && unown.team === pokemon.team) { + if (pokemon.items.size < 3) { + pokemon.items.add(Item.XRAY_VISION) + pokemon.simulation.applyItemEffect(pokemon, Item.XRAY_VISION) + } + } + } + ) + } +} + +export class HiddenPowerYStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const numberToSpawn = 2 + const player = unown.simulation.player! + for (let i = 0; i < numberToSpawn; i++) { + const coord = unown.simulation.getClosestAvailablePlaceOnBoardToPokemon( + unown, + unown.team + ) + const meditite = unown.simulation.addPokemon( + PokemonFactory.createPokemonFromName( + Pkm.MEDITITE, + player.pokemonCollection.get(PkmIndex[Pkm.MEDITITE]) + ), + coord.x, + coord.y, + unown.team, + false + ) + meditite.items.add(Item.SOUL_DEW) + meditite.simulation.applyItemsEffects(meditite) + } + } +} + +export class HiddenPowerZStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + board.forEach((x: number, y: number, enemy: PokemonEntity | undefined) => { + if (enemy && unown.team != enemy.team) { + enemy.status.triggerSleep(5000, enemy) + } + }) + } +} + +export class HiddenPowerQMStrategy extends HiddenPowerStrategy { + process( + unown: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(unown, state, board, target, crit) + const player = unown.simulation.player! + const nbUnownsObtained = 4 + for (let i = 0; i < nbUnownsObtained; i++) { + const pkm = pickRandomIn(Unowns) + const x = player.simulation.room.getFirstAvailablePositionInBench( + player.id + ) + if (x !== undefined) { + const pokemon = PokemonFactory.createPokemonFromName( + pkm, + player.pokemonCollection.get(PkmIndex[pkm]) + ) + pokemon.positionX = x + pokemon.positionY = 0 + player.board.set(pokemon.id, pokemon) + } + } + } +} + +export class HiddenPowerEMStrategy extends HiddenPowerStrategy { + process( + pokemon: PokemonEntity, + state: PokemonState, + board: Board, + target: PokemonEntity, + crit: boolean + ) { + super.process(pokemon, state, board, target, crit) + const player = pokemon.simulation.player! + const corners = [ + [0, 0], + [board.columns - 1, 0], + [0, board.rows - 1], + [board.columns - 1, board.rows - 1] + ] + corners.forEach(([x, y]) => { + const unownName = pickRandomIn(Unowns) + const unown = PokemonFactory.createPokemonFromName( + unownName, + player.pokemonCollection.get(PkmIndex[unownName]) + ) + const coord = pokemon.simulation.getClosestAvailablePlaceOnBoardTo( + x, + y, + pokemon.team + ) + pokemon.simulation.addPokemon( + unown, + coord.x, + coord.y, + pokemon.team, + false + ) + }) + } +} diff --git a/app/core/abilities/index.ts b/app/core/abilities/index.ts new file mode 100644 index 0000000000..4b12366a15 --- /dev/null +++ b/app/core/abilities/index.ts @@ -0,0 +1,400 @@ +import { Ability } from "../../types/enum/Ability" +import { + AttackStrategy, + SongOfDesireStrategy, + ConfusingMindStrategy, + KnowledgeThiefStrategy, + WonderGuardStrategy, + CorruptedNatureStrategy, + CrabHammerStrategy, + KingShieldStrategy, + ExplosionStrategy, + NightmareStrategy, + ClangorousSoulStrategy, + BonemerangStrategy, + GrowlStrategy, + RelicSongStrategy, + DisarmingVoiceStrategy, + HighJumpKickStrategy, + GrassWhistleStrategy, + TriAttackStrategy, + EchoStrategy, + PetalDanceStrategy, + HyperVoiceStrategy, + ShadowCloneStrategy, + VoltSwitchStrategy, + FireBlastStrategy, + WheelOfFireStrategy, + SeismicTossStrategy, + GuillotineStrategy, + RockSlideStrategy, + HeatWaveStrategy, + ThunderStrategy, + HydroPumpStrategy, + DracoMeteorStrategy, + BlazeKickStrategy, + WishStrategy, + CalmMindStrategy, + IronDefenseStrategy, + MetronomeStrategy, + SoakStrategy, + IronTailStrategy, + BlastBurnStrategy, + ChargeStrategy, + DischargeStrategy, + BiteStrategy, + DragonTailStrategy, + DragonBreathStrategy, + IcicleCrashStrategy, + RootStrategy, + TormentStrategy, + StompStrategy, + PaybackStrategy, + NightSlashStrategy, + BugBuzzStrategy, + StringShotStrategy, + StickyWebStrategy, + PoisonStingStrategy, + LeechLifeStrategy, + HappyHourStrategy, + TeleportStrategy, + NastyPlotStrategy, + ThiefStrategy, + StunSporeStrategy, + MeteorMashStrategy, + HurricaneStrategy, + BurnStrategy, + SleepStrategy, + SilenceStrategy, + ConfusionStrategy, + FreezeStrategy, + ProtectStrategy, + PoisonStrategy, + OriginPulseStrategy, + SeedFlareStrategy, + HealBlockStrategy, + RoarOfTimeStrategy, + RockTombStrategy, + RockSmashStrategy, + HeadSmashStrategy, + DiamondStormStrategy, + DracoEnergyStrategy, + DynamaxCannonStrategy, + DynamicPunchStrategy, + ElectroBoostStrategy, + ElectroWebStrategy, + FireTrickStrategy, + FlameChargeStrategy, + LeechSeedStrategy, + LockOnStrategy, + PsychUpStrategy, + RazorWindStrategy, + TwistingNetherStrategy, + EarthquakeStrategy, + SoftBoiledStrategy, + ElectricSurgeStrategy, + PsychicSurgeStrategy, + MindBlownStrategy, + PaydayStrategy, + BeatUpStrategy, + BlueFlareStrategy, + FusionBoltStrategy, + AuroraVeilStrategy, + AquaJetStrategy, + JudgementStrategy, + ChatterStrategy, + LiquidationStrategy, + SteamEruptionStrategy, + AppleAcidStrategy, + ShadowBallStrategy, + DiveStrategy, + SpikeArmorStrategy, + FutureSightStrategy, + FakeTearsStrategy, + SparklingAriaStrategy, + DragonDartsStrategy, + GrassySurgeStrategy, + MistySurgeStrategy, + SkyAttackStrategy, + IllusionStrategy, + SmogStrategy, + AuroraBeamStrategy, + AgilityStrategy, + SpiritShackleStrategy, + WaterShurikenStrategy, + ShadowSneakStrategy, + MachPunchStrategy, + UppercutStrategy, + TripleKickStrategy, + MawashiGeriStrategy, + ForecastStrategy, + SacredSwordStrategy, + XScissorStrategy, + PlasmaFistStrategy, + SpectralThiefStrategy, + GeomancyStrategy, + DeathWingStrategy, + SlackOffStrategy, + DarkVoidStrategy, + OverheatStrategy, + HypnosisStrategy, + MimicStrategy, + HexStrategy, + GrowthStrategy, + HealOrderStrategy, + ShellTrapStrategy, + DigStrategy, + FireSpinStrategy, + SearingShotStrategy, + PeckStrategy, + SplashStrategy, + CounterStrategy, + ComsicPowerStrategy, + PoisonPowderStrategy, + SilverWindStrategy, + IcyWindStrategy, + GigatonHammerStrategy, + AcrobaticsStrategy, + AbsorbStrategy, + RolloutStrategy, + ThrashStrategy, + SolarBeamStrategy, + MagmaStormStrategy, + SlashingClawStrategy, + EruptionStrategy, + MistBallStrategy, + LusterPurgeStrategy, + MudBubbleStrategy, + LinkCableStrategy, + MagicBounceStrategy +} from "../attack-strategy" +import { + HiddenPowerAStrategy, + HiddenPowerBStrategy, + HiddenPowerCStrategy, + HiddenPowerDStrategy, + HiddenPowerEStrategy, + HiddenPowerFStrategy, + HiddenPowerGStrategy, + HiddenPowerHStrategy, + HiddenPowerIStrategy, + HiddenPowerJStrategy, + HiddenPowerKStrategy, + HiddenPowerLStrategy, + HiddenPowerMStrategy, + HiddenPowerNStrategy, + HiddenPowerOStrategy, + HiddenPowerPStrategy, + HiddenPowerQStrategy, + HiddenPowerRStrategy, + HiddenPowerSStrategy, + HiddenPowerTStrategy, + HiddenPowerUStrategy, + HiddenPowerVStrategy, + HiddenPowerWStrategy, + HiddenPowerXStrategy, + HiddenPowerYStrategy, + HiddenPowerZStrategy, + HiddenPowerQMStrategy, + HiddenPowerEMStrategy +} from "./hidden-power" + +export * from "./hidden-power" + +export const AbilityStrategy: { [key in Ability]: AttackStrategy } = { + [Ability.SONG_OF_DESIRE]: new SongOfDesireStrategy(), + [Ability.CONFUSING_MIND]: new ConfusingMindStrategy(), + [Ability.KNOWLEDGE_THIEF]: new KnowledgeThiefStrategy(), + [Ability.WONDER_GUARD]: new WonderGuardStrategy(), + [Ability.CORRUPTED_NATURE]: new CorruptedNatureStrategy(), + [Ability.CRABHAMMER]: new CrabHammerStrategy(), + [Ability.KING_SHIELD]: new KingShieldStrategy(), + [Ability.EXPLOSION]: new ExplosionStrategy(), + [Ability.NIGHTMARE]: new NightmareStrategy(), + [Ability.CLANGOROUS_SOUL]: new ClangorousSoulStrategy(), + [Ability.BONEMERANG]: new BonemerangStrategy(), + [Ability.GROWL]: new GrowlStrategy(), + [Ability.RELIC_SONG]: new RelicSongStrategy(), + [Ability.DISARMING_VOICE]: new DisarmingVoiceStrategy(), + [Ability.HIGH_JUMP_KICK]: new HighJumpKickStrategy(), + [Ability.GRASS_WHISTLE]: new GrassWhistleStrategy(), + [Ability.TRI_ATTACK]: new TriAttackStrategy(), + [Ability.ECHO]: new EchoStrategy(), + [Ability.PETAL_DANCE]: new PetalDanceStrategy(), + [Ability.HYPER_VOICE]: new HyperVoiceStrategy(), + [Ability.SHADOW_CLONE]: new ShadowCloneStrategy(), + [Ability.VOLT_SWITCH]: new VoltSwitchStrategy(), + [Ability.FIRE_BLAST]: new FireBlastStrategy(), + [Ability.WHEEL_OF_FIRE]: new WheelOfFireStrategy(), + [Ability.SEISMIC_TOSS]: new SeismicTossStrategy(), + [Ability.GUILLOTINE]: new GuillotineStrategy(), + [Ability.ROCK_SLIDE]: new RockSlideStrategy(), + [Ability.HEAT_WAVE]: new HeatWaveStrategy(), + [Ability.THUNDER]: new ThunderStrategy(), + [Ability.HYDRO_PUMP]: new HydroPumpStrategy(), + [Ability.DRACO_METEOR]: new DracoMeteorStrategy(), + [Ability.BLAZE_KICK]: new BlazeKickStrategy(), + [Ability.WISH]: new WishStrategy(), + [Ability.CALM_MIND]: new CalmMindStrategy(), + [Ability.IRON_DEFENSE]: new IronDefenseStrategy(), + [Ability.METRONOME]: new MetronomeStrategy(), + [Ability.SOAK]: new SoakStrategy(), + [Ability.IRON_TAIL]: new IronTailStrategy(), + [Ability.BLAST_BURN]: new BlastBurnStrategy(), + [Ability.CHARGE]: new ChargeStrategy(), + [Ability.DISCHARGE]: new DischargeStrategy(), + [Ability.BITE]: new BiteStrategy(), + [Ability.DRAGON_TAIL]: new DragonTailStrategy(), + [Ability.DRAGON_BREATH]: new DragonBreathStrategy(), + [Ability.ICICLE_CRASH]: new IcicleCrashStrategy(), + [Ability.ROOT]: new RootStrategy(), + [Ability.TORMENT]: new TormentStrategy(), + [Ability.STOMP]: new StompStrategy(), + [Ability.PAYBACK]: new PaybackStrategy(), + [Ability.NIGHT_SLASH]: new NightSlashStrategy(), + [Ability.BUG_BUZZ]: new BugBuzzStrategy(), + [Ability.STRING_SHOT]: new StringShotStrategy(), + [Ability.STICKY_WEB]: new StickyWebStrategy(), + [Ability.VENOSHOCK]: new PoisonStingStrategy(), + [Ability.LEECH_LIFE]: new LeechLifeStrategy(), + [Ability.HAPPY_HOUR]: new HappyHourStrategy(), + [Ability.TELEPORT]: new TeleportStrategy(), + [Ability.NASTY_PLOT]: new NastyPlotStrategy(), + [Ability.THIEF]: new ThiefStrategy(), + [Ability.STUN_SPORE]: new StunSporeStrategy(), + [Ability.METEOR_MASH]: new MeteorMashStrategy(), + [Ability.HURRICANE]: new HurricaneStrategy(), + [Ability.BURN]: new BurnStrategy(), + [Ability.SLEEP]: new SleepStrategy(), + [Ability.SILENCE]: new SilenceStrategy(), + [Ability.CONFUSION]: new ConfusionStrategy(), + [Ability.FREEZE]: new FreezeStrategy(), + [Ability.PROTECT]: new ProtectStrategy(), + [Ability.POISON]: new PoisonStrategy(), + [Ability.ORIGIN_PULSE]: new OriginPulseStrategy(), + [Ability.SEED_FLARE]: new SeedFlareStrategy(), + [Ability.HEAL_BLOCK]: new HealBlockStrategy(), + [Ability.ROAR_OF_TIME]: new RoarOfTimeStrategy(), + [Ability.ROCK_TOMB]: new RockTombStrategy(), + [Ability.ROCK_SMASH]: new RockSmashStrategy(), + [Ability.HEAD_SMASH]: new HeadSmashStrategy(), + [Ability.DEFAULT]: new AttackStrategy(), + [Ability.DIAMOND_STORM]: new DiamondStormStrategy(), + [Ability.DRACO_ENERGY]: new DracoEnergyStrategy(), + [Ability.DYNAMAX_CANNON]: new DynamaxCannonStrategy(), + [Ability.DYNAMIC_PUNCH]: new DynamicPunchStrategy(), + [Ability.ELECTRO_BOOST]: new ElectroBoostStrategy(), + [Ability.ELECTRO_WEB]: new ElectroWebStrategy(), + [Ability.FIRE_TRICK]: new FireTrickStrategy(), + [Ability.FLAME_CHARGE]: new FlameChargeStrategy(), + [Ability.LEECH_SEED]: new LeechSeedStrategy(), + [Ability.LOCK_ON]: new LockOnStrategy(), + [Ability.PSYCH_UP]: new PsychUpStrategy(), + [Ability.RAZOR_WIND]: new RazorWindStrategy(), + [Ability.TWISTING_NETHER]: new TwistingNetherStrategy(), + [Ability.EARTHQUAKE]: new EarthquakeStrategy(), + [Ability.SOFT_BOILED]: new SoftBoiledStrategy(), + [Ability.ELECTRIC_SURGE]: new ElectricSurgeStrategy(), + [Ability.PSYCHIC_SURGE]: new PsychicSurgeStrategy(), + [Ability.MIND_BLOWN]: new MindBlownStrategy(), + [Ability.PAYDAY]: new PaydayStrategy(), + [Ability.BEAT_UP]: new BeatUpStrategy(), + [Ability.BLUE_FLARE]: new BlueFlareStrategy(), + [Ability.FUSION_BOLT]: new FusionBoltStrategy(), + [Ability.AURORA_VEIL]: new AuroraVeilStrategy(), + [Ability.AQUA_JET]: new AquaJetStrategy(), + [Ability.JUDGEMENT]: new JudgementStrategy(), + [Ability.CHATTER]: new ChatterStrategy(), + [Ability.LIQUIDATION]: new LiquidationStrategy(), + [Ability.STEAM_ERUPTION]: new SteamEruptionStrategy(), + [Ability.APPLE_ACID]: new AppleAcidStrategy(), + [Ability.SHADOW_BALL]: new ShadowBallStrategy(), + [Ability.DIVE]: new DiveStrategy(), + [Ability.SPIKE_ARMOR]: new SpikeArmorStrategy(), + [Ability.FUTURE_SIGHT]: new FutureSightStrategy(), + [Ability.FAKE_TEARS]: new FakeTearsStrategy(), + [Ability.SPARKLING_ARIA]: new SparklingAriaStrategy(), + [Ability.DRAGON_DARTS]: new DragonDartsStrategy(), + [Ability.GRASSY_SURGE]: new GrassySurgeStrategy(), + [Ability.MISTY_SURGE]: new MistySurgeStrategy(), + [Ability.SKY_ATTACK]: new SkyAttackStrategy(), + [Ability.ILLUSION]: new IllusionStrategy(), + [Ability.SMOG]: new SmogStrategy(), + [Ability.AURORA_BEAM]: new AuroraBeamStrategy(), + [Ability.AGILITY]: new AgilityStrategy(), + [Ability.SPIRIT_SHACKLE]: new SpiritShackleStrategy(), + [Ability.WATER_SHURIKEN]: new WaterShurikenStrategy(), + [Ability.SHADOW_SNEAK]: new ShadowSneakStrategy(), + [Ability.MACH_PUNCH]: new MachPunchStrategy(), + [Ability.UPPERCUT]: new UppercutStrategy(), + [Ability.TRIPLE_KICK]: new TripleKickStrategy(), + [Ability.MAWASHI_GERI]: new MawashiGeriStrategy(), + [Ability.FORECAST]: new ForecastStrategy(), + [Ability.SACRED_SWORD]: new SacredSwordStrategy(), + [Ability.X_SCISSOR]: new XScissorStrategy(), + [Ability.PLASMA_FIST]: new PlasmaFistStrategy(), + [Ability.SPECTRAL_THIEF]: new SpectralThiefStrategy(), + [Ability.GEOMANCY]: new GeomancyStrategy(), + [Ability.DEATH_WING]: new DeathWingStrategy(), + [Ability.SLACK_OFF]: new SlackOffStrategy(), + [Ability.DARK_VOID]: new DarkVoidStrategy(), + [Ability.OVERHEAT]: new OverheatStrategy(), + [Ability.HYPNOSIS]: new HypnosisStrategy(), + [Ability.MIMIC]: new MimicStrategy(), + [Ability.HEX]: new HexStrategy(), + [Ability.GROWTH]: new GrowthStrategy(), + [Ability.HEAL_ORDER]: new HealOrderStrategy(), + [Ability.SHELL_TRAP]: new ShellTrapStrategy(), + [Ability.DIG]: new DigStrategy(), + [Ability.FIRE_SPIN]: new FireSpinStrategy(), + [Ability.SEARING_SHOT]: new SearingShotStrategy(), + [Ability.PECK]: new PeckStrategy(), + [Ability.SPLASH]: new SplashStrategy(), + [Ability.COUNTER]: new CounterStrategy(), + [Ability.COSMIC_POWER]: new ComsicPowerStrategy(), + [Ability.POISON_POWDER]: new PoisonPowderStrategy(), + [Ability.SILVER_WIND]: new SilverWindStrategy(), + [Ability.ICY_WIND]: new IcyWindStrategy(), + [Ability.GIGATON_HAMMER]: new GigatonHammerStrategy(), + [Ability.ACROBATICS]: new AcrobaticsStrategy(), + [Ability.ABSORB]: new AbsorbStrategy(), + [Ability.ROLLOUT]: new RolloutStrategy(), + [Ability.THRASH]: new ThrashStrategy(), + [Ability.SOLAR_BEAM]: new SolarBeamStrategy(), + [Ability.MAGMA_STORM]: new MagmaStormStrategy(), + [Ability.SLASHING_CLAW]: new SlashingClawStrategy(), + [Ability.ERUPTION]: new EruptionStrategy(), + [Ability.MIST_BALL]: new MistBallStrategy(), + [Ability.LUSTER_PURGE]: new LusterPurgeStrategy(), + [Ability.MUD_BUBBLE]: new MudBubbleStrategy(), + [Ability.LINK_CABLE]: new LinkCableStrategy(), + [Ability.MAGIC_BOUNCE]: new MagicBounceStrategy(), + [Ability.HIDDEN_POWER_A]: new HiddenPowerAStrategy(), + [Ability.HIDDEN_POWER_B]: new HiddenPowerBStrategy(), + [Ability.HIDDEN_POWER_C]: new HiddenPowerCStrategy(), + [Ability.HIDDEN_POWER_D]: new HiddenPowerDStrategy(), + [Ability.HIDDEN_POWER_E]: new HiddenPowerEStrategy(), + [Ability.HIDDEN_POWER_F]: new HiddenPowerFStrategy(), + [Ability.HIDDEN_POWER_G]: new HiddenPowerGStrategy(), + [Ability.HIDDEN_POWER_H]: new HiddenPowerHStrategy(), + [Ability.HIDDEN_POWER_I]: new HiddenPowerIStrategy(), + [Ability.HIDDEN_POWER_J]: new HiddenPowerJStrategy(), + [Ability.HIDDEN_POWER_K]: new HiddenPowerKStrategy(), + [Ability.HIDDEN_POWER_L]: new HiddenPowerLStrategy(), + [Ability.HIDDEN_POWER_M]: new HiddenPowerMStrategy(), + [Ability.HIDDEN_POWER_N]: new HiddenPowerNStrategy(), + [Ability.HIDDEN_POWER_O]: new HiddenPowerOStrategy(), + [Ability.HIDDEN_POWER_P]: new HiddenPowerPStrategy(), + [Ability.HIDDEN_POWER_Q]: new HiddenPowerQStrategy(), + [Ability.HIDDEN_POWER_R]: new HiddenPowerRStrategy(), + [Ability.HIDDEN_POWER_S]: new HiddenPowerSStrategy(), + [Ability.HIDDEN_POWER_T]: new HiddenPowerTStrategy(), + [Ability.HIDDEN_POWER_U]: new HiddenPowerUStrategy(), + [Ability.HIDDEN_POWER_V]: new HiddenPowerVStrategy(), + [Ability.HIDDEN_POWER_W]: new HiddenPowerWStrategy(), + [Ability.HIDDEN_POWER_X]: new HiddenPowerXStrategy(), + [Ability.HIDDEN_POWER_Y]: new HiddenPowerYStrategy(), + [Ability.HIDDEN_POWER_Z]: new HiddenPowerZStrategy(), + [Ability.HIDDEN_POWER_QM]: new HiddenPowerQMStrategy(), + [Ability.HIDDEN_POWER_EM]: new HiddenPowerEMStrategy() +} diff --git a/app/core/attack-strategy.ts b/app/core/attack-strategy.ts index c7cb9170a5..129af83002 100644 --- a/app/core/attack-strategy.ts +++ b/app/core/attack-strategy.ts @@ -6,7 +6,7 @@ import Board from "./board" import PokemonEntity from "./pokemon-entity" import PokemonState from "./pokemon-state" import { Synergy } from "../types/enum/Synergy" -import { AbilityStrategy, Ability } from "../types/enum/Ability" +import { Ability } from "../types/enum/Ability" import PokemonFactory from "../models/pokemon-factory" import { Pkm } from "../types/enum/Pokemon" import { @@ -22,6 +22,7 @@ import { max, min } from "../utils/number" import { distanceC } from "../utils/distance" import { Transfer } from "../types" import { Passive } from "../types/enum/Passive" +import { AbilityStrategy } from "./abilities" export class AttackStrategy { process( @@ -198,7 +199,7 @@ export class BeatUpStrategy extends AttackStrategy { super.process(pokemon, state, board, target, crit) for (let i = 0; i < pokemon.stars; i++) { const houndour = PokemonFactory.createPokemonFromName(Pkm.HOUNDOUR) - const coord = pokemon.simulation.getClosestAvailablePlaceOnBoard( + const coord = pokemon.simulation.getClosestAvailablePlaceOnBoardToPokemon( pokemon, pokemon.team ) @@ -1050,7 +1051,7 @@ export class RazorWindStrategy extends AttackStrategy { } } -export class TwistingNeiherStrategy extends AttackStrategy { +export class TwistingNetherStrategy extends AttackStrategy { process( pokemon: PokemonEntity, state: PokemonState, @@ -1059,11 +1060,7 @@ export class TwistingNeiherStrategy extends AttackStrategy { crit: boolean ) { super.process(pokemon, state, board, target, crit) - const cells = board.getCellsInRadius( - target.positionX, - target.positionY, - 2 - ) + const cells = board.getCellsInRadius(target.positionX, target.positionY, 2) cells.forEach((cell) => { if (cell && cell.value && cell.value.team !== pokemon.team) { cell.value.handleSpecialDamage( @@ -3524,9 +3521,9 @@ export class TeleportStrategy extends AttackStrategy { const potentialCells = [ [0, 0], - [0, 5], - [7, 5], - [7, 0] + [0, board.rows - 1], + [board.columns - 1, board.rows - 1], + [board.columns - 1, 0] ] shuffleArray(potentialCells) diff --git a/app/core/attacking-state.ts b/app/core/attacking-state.ts index fdea9a9dd9..99d71312f5 100644 --- a/app/core/attacking-state.ts +++ b/app/core/attacking-state.ts @@ -115,6 +115,10 @@ export default class AttackingState extends PokemonState { let totalTakenDamage = 0 const attackType = pokemon.attackType + if (pokemon.items.has(Item.FIRE_GEM)) { + physicalDamage = Math.round(physicalDamage + target.hp * 0.1) + } + let isAttackSuccessful = true if (chance(target.dodge) && !pokemon.items.has(Item.XRAY_VISION)) { isAttackSuccessful = false @@ -122,8 +126,8 @@ export default class AttackingState extends PokemonState { target.count.dodgeCount += 1 } if (target.status.protect) { - physicalDamage = 0 isAttackSuccessful = false + physicalDamage = 0 } const crit = chance(pokemon.critChance / 100) diff --git a/app/core/pokemon-entity.ts b/app/core/pokemon-entity.ts index 28f1d93f0e..4bc3e64c03 100644 --- a/app/core/pokemon-entity.ts +++ b/app/core/pokemon-entity.ts @@ -8,12 +8,13 @@ import Count from "../models/colyseus-models/count" import Simulation from "./simulation" import { Schema, type, ArraySchema, SetSchema } from "@colyseus/schema" import { AttackStrategy } from "./attack-strategy" +import { AbilityStrategy } from "./abilities" import Board from "./board" import PokemonState from "./pokemon-state" import { IPokemonEntity, IPokemon, Emotion, AttackSprite } from "../types" import { AttackType, Rarity } from "../types/enum/Game" import { Effect } from "../types/enum/Effect" -import { AbilityStrategy, Ability } from "../types/enum/Ability" +import { Ability } from "../types/enum/Ability" import { Synergy, SynergyEffects } from "../types/enum/Synergy" import { Pkm } from "../types/enum/Pokemon" import { IdleState } from "./idle-state" @@ -180,7 +181,7 @@ export default class PokemonEntity extends Schema implements IPokemonEntity { damage: number board: Board attackType: AttackType - attacker: PokemonEntity + attacker: PokemonEntity | null shouldTargetGainMana: boolean }) { return this.state.handleDamage({ target: this, ...params }) diff --git a/app/core/pokemon-state.ts b/app/core/pokemon-state.ts index fc40de8767..2f320de828 100644 --- a/app/core/pokemon-state.ts +++ b/app/core/pokemon-state.ts @@ -16,7 +16,7 @@ import { chance, pickRandomIn } from "../utils/random" import { logger } from "../utils/logger" import { Passive } from "../types/enum/Passive" import { Weather } from "../types/enum/Weather" -import { min } from "../utils/number" +import { max, min } from "../utils/number" import { distanceC } from "../utils/distance" export default class PokemonState { @@ -125,37 +125,31 @@ export default class PokemonState { takenDamage = 0 pokemon.status.triggerProtect(1000) } else { - let reducedDamage = damage - if (pokemon.items.has(Item.POKE_DOLL)) { - reducedDamage = Math.ceil(reducedDamage * 0.7) + damage = Math.ceil(damage * 0.7) } if (attacker && attacker.status.electricField) { - reducedDamage = Math.ceil(reducedDamage * 1.2) + damage = Math.ceil(damage * 1.2) } if (attacker && attacker.status.psychicField) { - reducedDamage = Math.ceil(reducedDamage * 1.2) + damage = Math.ceil(damage * 1.2) } if (attacker && attacker.status.grassField) { - reducedDamage = Math.ceil(reducedDamage * 1.2) + damage = Math.ceil(damage * 1.2) } if (attacker && attacker.status.fairyField) { - reducedDamage = Math.ceil(reducedDamage * 1.2) - } - - if (attacker && attacker.items.has(Item.FIRE_GEM)) { - reducedDamage = Math.ceil(reducedDamage + pokemon.hp * 0.1) + damage = Math.ceil(damage * 1.2) } if ( pokemon.simulation.weather === Weather.MISTY && attackType === AttackType.SPECIAL ) { - reducedDamage = Math.ceil(reducedDamage * 1.2) + damage = Math.ceil(damage * 1.2) } if ( @@ -165,19 +159,20 @@ export default class PokemonState { ) { attackType = AttackType.TRUE } - const armorFactor = 0.1 + + const ARMOR_FACTOR = 0.1 const def = pokemon.status.armorReduction ? Math.round(pokemon.def / 2) : pokemon.def const speDef = pokemon.status.armorReduction ? Math.round(pokemon.speDef / 2) : pokemon.speDef + + let reducedDamage = damage if (attackType == AttackType.PHYSICAL) { - const ritodamage = damage / (1 + armorFactor * def) - reducedDamage = Math.max(0, Math.round(ritodamage)) + reducedDamage = damage / (1 + ARMOR_FACTOR * def) } else if (attackType == AttackType.SPECIAL) { - const ritodamage = damage / (1 + armorFactor * speDef) - reducedDamage = Math.max(0, Math.round(ritodamage)) + reducedDamage = damage / (1 + ARMOR_FACTOR * speDef) } else if (attackType == AttackType.TRUE) { reducedDamage = damage } @@ -196,7 +191,7 @@ export default class PokemonState { reducedDamage = reducedDamage - damageBlocked } - reducedDamage = Math.max(1, reducedDamage) // should deal 1 damage at least + reducedDamage = min(1)(reducedDamage) // should deal 1 damage at least if (isNaN(reducedDamage)) { reducedDamage = 0 @@ -224,11 +219,11 @@ export default class PokemonState { takenDamage += damageOnShield pokemon.shield = pokemon.shield - damageOnShield - residualDamage = Math.max(0, reducedDamage - damageOnShield) + residualDamage = min(0)(reducedDamage - damageOnShield) } if (pokemon.passive == Passive.WONDER_GUARD) { - residualDamage = 1 + residualDamage = max(1)(residualDamage) } takenDamage += Math.min(residualDamage, pokemon.life) diff --git a/app/core/simulation.ts b/app/core/simulation.ts index 4065c63c06..445f04d84e 100644 --- a/app/core/simulation.ts +++ b/app/core/simulation.ts @@ -170,7 +170,7 @@ export default class Simulation extends Schema implements ISimulation { bugTeam[i].name, player.pokemonCollection.get(bugTeam[i].index) ) - const coord = this.getClosestAvailablePlaceOnBoard( + const coord = this.getClosestAvailablePlaceOnBoardToPokemon( bugTeam[i], teamIndex ) @@ -253,11 +253,13 @@ export default class Simulation extends Schema implements ISimulation { return { x: candidateX, y: candidateY } } - getClosestAvailablePlaceOnBoard( - pokemon: IPokemon | IPokemonEntity, + getClosestAvailablePlaceOnBoardTo( + positionX: number, + positionY: number, teamIndex: number ): { x: number; y: number } { const placesToConsiderByOrderOfPriority = [ + [0, 0], [-1, 0], [+1, 0], [0, -1], @@ -294,11 +296,8 @@ export default class Simulation extends Schema implements ISimulation { [+3, +1] ] for (const [dx, dy] of placesToConsiderByOrderOfPriority) { - const x = pokemon.positionX + dx - const y = - teamIndex === 0 - ? pokemon.positionY - 1 + dy - : 5 - (pokemon.positionY - 1) - dy + const x = positionX + dx + const y = teamIndex === 0 ? positionY - 1 + dy : 5 - (positionY - 1) - dy if ( x >= 0 && @@ -313,6 +312,17 @@ export default class Simulation extends Schema implements ISimulation { return this.getFirstAvailablePlaceOnBoard(teamIndex) } + getClosestAvailablePlaceOnBoardToPokemon( + pokemon: IPokemon | IPokemonEntity, + teamIndex: number + ): { x: number; y: number } { + return this.getClosestAvailablePlaceOnBoardTo( + pokemon.positionX, + pokemon.positionY, + teamIndex + ) + } + applyStat(pokemon: PokemonEntity, stat: Stat, value: number) { switch (stat) { case Stat.ATK: diff --git a/app/models/colyseus-models/pokemon.ts b/app/models/colyseus-models/pokemon.ts index 9735e2a059..04a186b7b6 100644 --- a/app/models/colyseus-models/pokemon.ts +++ b/app/models/colyseus-models/pokemon.ts @@ -4,7 +4,7 @@ import { Schema, type, ArraySchema, SetSchema } from "@colyseus/schema" import { nanoid } from "nanoid" import { Emotion, IPokemon, AttackSprite } from "../../types" -import { DEFAULT_ATK_SPEED, EvolutionTime, PkmCost } from "../../types/Config" +import { DEFAULT_ATK_SPEED, EvolutionTime } from "../../types/Config" import { Item } from "../../types/enum/Item" import { Pkm, PkmIndex } from "../../types/enum/Pokemon" import { Rarity, AttackType, PokemonActionState } from "../../types/enum/Game" @@ -22,7 +22,6 @@ export class Pokemon extends Schema implements IPokemon { @type("string") evolution: Pkm @type("int8") positionX = -1 @type("int8") positionY = -1 - @type("uint8") cost: number @type("string") attackSprite: AttackSprite @type("float32") atkSpeed = DEFAULT_ATK_SPEED @type("uint8") def: number @@ -69,7 +68,6 @@ export class Pokemon extends Schema implements IPokemon { this.rarity = rarity this.index = PkmIndex[name] this.evolution = evolution - this.cost = PkmCost[rarity] this.hp = hp this.atk = atk this.def = def @@ -928,12 +926,12 @@ export class Gible extends Pokemon { super( Pkm.GIBLE, [Synergy.DRAGON, Synergy.GROUND, Synergy.MONSTER], - Rarity.EPIC, + Rarity.RARE, Pkm.GABITE, - 100, + 90, 6, - 4, - 4, + 3, + 2, 1, AttackSprite.DRAGON_MELEE, 1, @@ -951,12 +949,12 @@ export class Gabite extends Pokemon { super( Pkm.GABITE, [Synergy.DRAGON, Synergy.GROUND, Synergy.MONSTER], - Rarity.EPIC, + Rarity.RARE, Pkm.GARCHOMP, - 160, + 150, 14, - 5, - 5, + 4, + 3, 1, AttackSprite.DRAGON_MELEE, 2, @@ -974,12 +972,12 @@ export class Garchomp extends Pokemon { super( Pkm.GARCHOMP, [Synergy.DRAGON, Synergy.GROUND, Synergy.MONSTER], - Rarity.EPIC, + Rarity.RARE, Pkm.DEFAULT, 240, - 32, - 6, - 6, + 28, + 5, + 4, 1, AttackSprite.DRAGON_MELEE, 3, @@ -12003,18 +12001,20 @@ export class UnownA extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_A, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12025,18 +12025,20 @@ export class UnownB extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 30, + Ability.HIDDEN_POWER_B, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12048,18 +12050,20 @@ export class UnownC extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 60, + Ability.HIDDEN_POWER_C, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12071,18 +12075,20 @@ export class UnownD extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 150, + Ability.HIDDEN_POWER_D, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12094,18 +12100,20 @@ export class UnownE extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_E, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12117,18 +12125,20 @@ export class UnownF extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_F, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12140,18 +12150,20 @@ export class UnownG extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_G, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12163,18 +12175,20 @@ export class UnownH extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 80, + Ability.HIDDEN_POWER_H, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12186,18 +12200,20 @@ export class UnownI extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_I, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12209,18 +12225,20 @@ export class UnownJ extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_J, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12232,18 +12250,20 @@ export class UnownK extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_K, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12255,18 +12275,20 @@ export class UnownL extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_L, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12278,18 +12300,20 @@ export class UnownM extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 50, + Ability.HIDDEN_POWER_M, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12301,18 +12325,20 @@ export class UnownN extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_N, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12324,18 +12350,20 @@ export class UnownO extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_O, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12347,18 +12375,20 @@ export class UnownP extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_P, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12370,18 +12400,20 @@ export class UnownQ extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 200, + Ability.HIDDEN_POWER_Q, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12393,18 +12425,20 @@ export class UnownR extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_R, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12416,18 +12450,20 @@ export class UnownS extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_S, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12439,18 +12475,20 @@ export class UnownT extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 80, + Ability.HIDDEN_POWER_T, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12462,18 +12500,20 @@ export class UnownU extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 80, + Ability.HIDDEN_POWER_U, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12485,18 +12525,20 @@ export class UnownV extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_V, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12508,18 +12550,20 @@ export class UnownW extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_W, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12531,18 +12575,20 @@ export class UnownX extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_X, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12554,18 +12600,20 @@ export class UnownY extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 50, + Ability.HIDDEN_POWER_Y, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12577,18 +12625,20 @@ export class UnownZ extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_Z, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12600,18 +12650,20 @@ export class UnownQuestion extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, 100, - Ability.DEFAULT, + Ability.HIDDEN_POWER_QM, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } @@ -12623,18 +12675,20 @@ export class UnownExclamation extends Pokemon { [Synergy.PSYCHIC], Rarity.SPECIAL, Pkm.DEFAULT, - 40, - 4, + 100, 1, 1, - 2, + 1, + 9, AttackSprite.PSYCHIC_RANGE, 1, - 100, - Ability.DEFAULT, + 50, + Ability.HIDDEN_POWER_EM, shiny, emotion, - false + false, + false, + Passive.UNOWN ) } } diff --git a/app/models/colyseus-models/synergies.ts b/app/models/colyseus-models/synergies.ts index 8a9058327b..b6c578af35 100644 --- a/app/models/colyseus-models/synergies.ts +++ b/app/models/colyseus-models/synergies.ts @@ -6,13 +6,13 @@ import { Synergy } from "../../types/enum/Synergy" import { Pokemon } from "./pokemon" export default class Synergies - extends MapSchema - implements Map + extends MapSchema + implements Map { constructor() { super() Object.keys(Synergy).forEach((key) => { - this.set(key, 0) + this.set(key as Synergy, 0) }) } diff --git a/app/models/pokemon-factory.ts b/app/models/pokemon-factory.ts index d756e0abf4..ff360dc6ce 100644 --- a/app/models/pokemon-factory.ts +++ b/app/models/pokemon-factory.ts @@ -7,7 +7,14 @@ import { PkmCost } from "../types/Config" import { PokemonActionState, Rarity } from "../types/enum/Game" -import { Pkm, PkmDuos, PkmFamily, PkmProposition } from "../types/enum/Pokemon" +import { Passive } from "../types/enum/Passive" +import { + Pkm, + PkmDuos, + PkmFamily, + PkmProposition, + Unowns +} from "../types/enum/Pokemon" import { Synergy } from "../types/enum/Synergy" import { logger } from "../utils/logger" import { pickRandomIn } from "../utils/random" @@ -2018,6 +2025,8 @@ export default class PokemonFactory { return 2 } else if (name === Pkm.MAGIKARP) { return 1 + } else if (pokemon.passive === Passive.UNOWN) { + return 1 } else if (pokemon.rarity === Rarity.HATCH) { return [3, 4, 5][pokemon.stars - 1] } else if (pokemon.rarity === Rarity.MYTHICAL) { @@ -2035,6 +2044,15 @@ export default class PokemonFactory { return PkmCost[pokemon.rarity] * pokemon.stars } } + + static getBuyPrice(name: Pkm): number { + if (Unowns.includes(name)) { + return 1 + } else { + const pokemon: Pokemon = PokemonFactory.createPokemonFromName(name) + return PkmCost[pokemon.rarity] + } + } } export function isAdditionalPick(pkm: Pkm): boolean { diff --git a/app/models/precomputed/ability.json b/app/models/precomputed/ability.json index 71339ae40c..e409ed1536 100644 --- a/app/models/precomputed/ability.json +++ b/app/models/precomputed/ability.json @@ -1 +1 @@ -{"DEFAULT":["Egg","ditto","landorus","thundurus","terrakion","kyurem","deino","zweilous","hydreigon","sandile","krokorok","krookodile","tirtouga","carracosta","tyrunt","tyrantrum","axew","fraxure","haxorus","venipede","whirlipede","scolipede","tympole","palpitoad","seismitoad","sewaddle","swadloon","leavanny","pikipek","trumbeak","toucannon","unown-a","unown-b","unown-c","unown-d","unown-e","unown-f","unown-g","unown-h","unown-i","unown-j","unown-k","unown-l","unown-m","unown-n","unown-o","unown-p","unown-q","unown-r","unown-s","unown-t","unown-u","unown-v","unown-w","unown-x","unown-y","unown-z","unown-question","unown-exclamation","pirouette-meloetta","melmetal","hoopa","hoopa_unbound","silvally","type_null"],"FIRE_BLAST":["volcarona","slugma","magcargo"],"WHEEL_OF_FIRE":["cyndaquil","quilava","typlosion"],"SEISMIC_TOSS":["cobalion"],"GUILLOTINE":["machop","machoke","machamp","croagunk","toxicroak","pinsir"],"ROCK_SLIDE":["geodude","graveler","golem","regirock","aerodactyl"],"HEAT_WAVE":["magby","magmar","magmortar"],"THUNDER":["mareep","flaffy","ampharos","chinchou","lanturn"],"HYDRO_PUMP":["squirtle","wartortle","blastoise","azurill","marill","azumarill","horsea","seadra","kingdra","gyarados","gorebyss"],"DRACO_METEOR":["rayquaza","mega-Rayquaza"],"BLAZE_KICK":["torchic","combusken","blaziken","scorbunny","raboot","cinderace"],"WISH":["togepi","togetic","togekiss","jirachi","cresselia"],"CALM_MIND":["rotom","drifloon","drifblim"],"IRON_DEFENSE":["registeel","shieldon","bastiodon","stakataka","bronzor","bronzong"],"METRONOME":["cleffa","clefairy","clefable"],"SOAK":["poliwag","poliwhirl","politoed","slowpoke","slowbro","slowking"],"IRON_TAIL":["piplup","prinplup","empoleon","regigigas","mawile","tepig","pignite","emboar"],"BLAST_BURN":["charmander","charmeleon","charizard"],"CHARGE":["zapdos"],"DISCHARGE":["shinx","luxio","luxray","elekid","electabuzz","electivire","alolan-geodude","alolan-graveler","alolan-golem"],"BITE":["totodile","croconaw","feraligatr","larvitar","pupitar","tyranitar","snubull","granbull"],"DRAGON_TAIL":["trapinch","vibrava","flygon"],"DRAGON_BREATH":["dratini","dragonair","dragonite","gible","gabite","garchomp"],"ICICLE_CRASH":["spheal","sealeo","walrein","regice","swinub","piloswine","mamoswine","amaura","aurorus"],"ROOT":["bulbasaur","ivysaur","venusaur","bellsprout","weepinbell","victreebel"],"TORMENT":["chimchar","monferno","infernape","magnemite","magneton","magnezone","lotad","lombre","ludicolo"],"STOMP":["aron","lairon","aggron","rhyhorn","rhydon","rhyperior"],"PAYBACK":["seedot","nuzleaf","shiftry"],"NIGHT_SLASH":["duskull","dusclops","dusknoir","spiritomb"],"BUG_BUZZ":["weedle","kakuna","beedrill","venonat","venomoth","snom","frosmoth"],"STRING_SHOT":["caterpie","metapod","butterfree"],"VENOSHOCK":["nidoranF","nidorina","nidoqueen","seviper","snivy","servine","serperior","ekans","arbok"],"LEECH_LIFE":["zubat","golbat","crobat"],"HAPPY_HOUR":["eevee","vaporeon","jolteon","flareon","espeon","umbreon","leafeon","sylveon","glaceon"],"TELEPORT":["abra","kadabra","alakazam","mew"],"NASTY_PLOT":["manaphy","phione"],"THIEF":["treecko","grovyle","sceptile","absol"],"STUN_SPORE":["chikorita","bayleef","meganium","oddish","gloom","vileplume","bellossom"],"METEOR_MASH":["beldum","metang","metagross"],"HURRICANE":["pidgey","pidgeotto","pidgeot","starly","staravia","staraptor"],"BURN":[],"SILENCE":["riolu","lucario","mega-lucario"],"SLEEP":["igglybuff","wygglytuff","jigglypuff","vanillite","vanillish","vanilluxe"],"FREEZE":["articuno","snover","abomasnow","mega-abomasnow"],"PROTECT":["deoxys"],"POISON":["nidoranM","nidorino","nidoking","salandit","salazzle","tentacool","tentacruel"],"CONFUSION":["meditite","medicham","mega-medicham","smoochum","jynx"],"ORIGIN_PULSE":["kyogre","primal-Kyogre"],"SEED_FLARE":["shaymin","shaymin-sky"],"HEAL_BLOCK":["kabuto","kabutops","cacnea","cacturne"],"ROAR_OF_TIME":["dialga","palkia"],"ROCK_TOMB":["omanyte","omastar","relicanth","clamperl","huntail"],"ROCK_SMASH":["anorith","armaldo","archen","archeops"],"HEAD_SMASH":["bagon","shelgon","cranidos","rampardos","tauros"],"VOLT_SWITCH":["pichu","pikachu","raichu","raikou","electrike","manectric","mega-manectric","regieleki"],"SHADOW_CLONE":["shuppet","banette","mega-banette"],"HYPER_VOICE":["swablu","altaria","mega-altaria"],"PETAL_DANCE":["budew","roselia","roserade"],"ECHO":["whismur","loudred","exploud"],"TRI_ATTACK":["tornadus","porygon","porygon2","porygon-z"],"GRASS_WHISTLE":[],"HIGH_JUMP_KICK":["buneary","lopunny","mega-lopunny","bounsweet","steenee","tsareena"],"DISARMING_VOICE":["flabebe","floette","florges"],"RELIC_SONG":["meloetta"],"GROWL":["growlithe","arcanine","poochyena","mightyena"],"BONEMERANG":["cubone","marowak","alolan-marowak"],"CLANGOROUS_SOUL":["jangmo-o","hakamo-o","kommo-o"],"NIGHTMARE":["gastly","haunter","gengar"],"EXPLOSION":["voltorb","electrode","pineco","forretress"],"KING_SHIELD":["honedge","doublade","aegislash"],"CORRUPTED_NATURE":["pumpkaboo","gourgeist"],"CRABHAMMER":["poliwrath","corphish","crawdaunt","oshawott","dewott","samurott"],"DIAMOND_STORM":["carbink","diancie"],"DRACO_ENERGY":["regidrago"],"DYNAMAX_CANNON":["mewtwo","eternatus"],"DYNAMIC_PUNCH":["makuhita","hariyama"],"ELECTRO_BOOST":[],"ELECTRO_WEB":["joltik","galvantula"],"FIRE_TRICK":["fennekin","braixen","delphox"],"FLAME_CHARGE":["entei","ponyta","rapidash"],"LEECH_SEED":["lileep","cradily","shroomish","breloom"],"LOCK_ON":["genesect"],"PSYCH_UP":["hatenna","hattrem","hatterene"],"RAZOR_WIND":["noibat","noivern","farfetch-d"],"TWISTING_NETHER":["guzzlord"],"WONDER_GUARD":["nincada","ninjask","shedninja"],"SONG_OF_DESIRE":["azelf"],"CONFUSING_MIND":["mesprit"],"KNOWLEDGE_THIEF":["uxie"],"EARTHQUAKE":["groudon","primal-Groudon"],"SOFT_BOILED":["happiny","chansey","blissey"],"ELECTRIC_SURGE":["tapu-koko"],"PSYCHIC_SURGE":["tapu-lele"],"MIND_BLOWN":["blacephalon"],"PAYDAY":["meowth","persian"],"BEAT_UP":["houndour","houndoom","mega-houndoom"],"BLUE_FLARE":["reshiram"],"FUSION_BOLT":["zekrom"],"AURORA_VEIL":["celebi","alolan-vulpix","alolan-ninetales"],"AQUA_JET":["suicune","keldeo","buizel","floatzel"],"JUDGEMENT":["arceus"],"CHATTER":["chatot"],"LIQUIDATION":["goomy","sligoo","goodra"],"STEAM_ERUPTION":["volcanion"],"APPLE_ACID":["applin","appletun"],"SHADOW_BALL":["solosis","duosion","reuniclus"],"DIVE":["lapras","wailmer","wailord"],"SPIKE_ARMOR":["onix","steelix","mega-steelix","sandshrew","sandslash","silcoon","cascoon","maractus"],"FUTURE_SIGHT":["ralts","kirlia","gardevoir"],"FAKE_TEARS":["gothita","gothorita","gothitelle"],"SPARKLING_ARIA":["popplio","brionne","primarina"],"DRAGON_DARTS":["salamence","dreepy","drakloak","dragapult"],"GRASSY_SURGE":["tapu-bulu"],"MISTY_SURGE":["tapu-fini"],"SKY_ATTACK":["lugia"],"ILLUSION":["kecleon","zorua","zoroark","hisui-zorua","hisui-zoroark"],"SMOG":["grimer","muk","alolan-grimer","alolan_muk"],"AURORA_BEAM":["seel","dewgong"],"AGILITY":["rattata","raticate","carvanha","sharpedo"],"SPIRIT_SHACKLE":["rowlet","dartix","decidueye"],"WATER_SHURIKEN":["froakie","frogadier","greninja"],"SHADOW_SNEAK":["giratina","mimikyu","origin-giratina"],"MACH_PUNCH":["tyrogue"],"UPPERCUT":["hitmonchan"],"TRIPLE_KICK":["hitmontop"],"MAWASHI_GERI":["hitmonlee"],"FORECAST":["castform","castform-sun","castform-rain","castform-hail"],"SACRED_SWORD":["virizion"],"X_SCISSOR":["scyther","scizor","mega-scizor"],"PLASMA_FIST":["zeraora"],"SPECTRAL_THIEF":["marshadow"],"GEOMANCY":["xerneas"],"DEATH_WING":["yveltal"],"SLACK_OFF":["slakoth","vigoroth","slaking","munchlax","snorlax"],"DARK_VOID":["darkrai"],"OVERHEAT":["moltres"],"HYPNOSIS":["hoothoot","noctowl"],"MIMIC":["mime-jr","mr-mime","bonsley","sudowoodo"],"HEX":["litwick","lampent","chandelure"],"GROWTH":["turtwig","grotle","torterra"],"HEAL_ORDER":["combee","vespiqueen"],"SHELL_TRAP":["shuckle"],"DIG":["diglett","dugtrio"],"FIRE_SPIN":["ho-Oh","vulpix","ninetales"],"SEARING_SHOT":["victini"],"PECK":["spearow","fearow"],"SPLASH":["magikarp"],"COUNTER":["wynaut","Wobbuffet"],"COSMIC_POWER":["lunatone","solrock"],"STICKY_WEB":["wurmple"],"SILVER_WIND":["beautifly"],"POISON_POWDER":["dustox"],"ICY_WIND":["snorunt","glalie","froslass"],"GIGATON_HAMMER":["tinkatink","tinkatuff","tinkaton"],"ACROBATICS":["hoppip","skiploom","jumpluff"],"ABSORB":["paras","parasect"],"ROLLOUT":["miltank"],"THRASH":["mankey","primeape"],"SOLAR_BEAM":["sunkern","sunflora"],"MAGMA_STORM":["heatran"],"SLASHING_CLAW":["sneasel","weavile"],"ERUPTION":["numel","camerupt","mega-camerupt"],"MIST_BALL":["latias"],"LUSTER_PURGE":["latios"],"MUD_BUBBLE":["mudkip","marshtomp","swampert"],"LINK_CABLE":["minun","plusle"],"MAGIC_BOUNCE":["natu","xatu"]} \ No newline at end of file +{"DEFAULT":["Egg","ditto","landorus","thundurus","terrakion","kyurem","deino","zweilous","hydreigon","sandile","krokorok","krookodile","tirtouga","carracosta","tyrunt","tyrantrum","axew","fraxure","haxorus","venipede","whirlipede","scolipede","tympole","palpitoad","seismitoad","sewaddle","swadloon","leavanny","pikipek","trumbeak","toucannon","pirouette-meloetta","melmetal","hoopa","hoopa_unbound","silvally","type_null"],"FIRE_BLAST":["volcarona","slugma","magcargo"],"WHEEL_OF_FIRE":["cyndaquil","quilava","typlosion"],"SEISMIC_TOSS":["cobalion"],"GUILLOTINE":["machop","machoke","machamp","croagunk","toxicroak","pinsir"],"ROCK_SLIDE":["geodude","graveler","golem","regirock","aerodactyl"],"HEAT_WAVE":["magby","magmar","magmortar"],"THUNDER":["mareep","flaffy","ampharos","chinchou","lanturn"],"HYDRO_PUMP":["squirtle","wartortle","blastoise","azurill","marill","azumarill","horsea","seadra","kingdra","gyarados","gorebyss"],"DRACO_METEOR":["rayquaza","mega-Rayquaza"],"BLAZE_KICK":["torchic","combusken","blaziken","scorbunny","raboot","cinderace"],"WISH":["togepi","togetic","togekiss","jirachi","cresselia"],"CALM_MIND":["rotom","drifloon","drifblim"],"IRON_DEFENSE":["registeel","shieldon","bastiodon","stakataka","bronzor","bronzong"],"METRONOME":["cleffa","clefairy","clefable"],"SOAK":["poliwag","poliwhirl","politoed","slowpoke","slowbro","slowking"],"IRON_TAIL":["piplup","prinplup","empoleon","regigigas","mawile","tepig","pignite","emboar"],"BLAST_BURN":["charmander","charmeleon","charizard"],"CHARGE":["zapdos"],"DISCHARGE":["shinx","luxio","luxray","elekid","electabuzz","electivire","alolan-geodude","alolan-graveler","alolan-golem"],"BITE":["totodile","croconaw","feraligatr","larvitar","pupitar","tyranitar","snubull","granbull"],"DRAGON_TAIL":["trapinch","vibrava","flygon"],"DRAGON_BREATH":["dratini","dragonair","dragonite","gible","gabite","garchomp"],"ICICLE_CRASH":["spheal","sealeo","walrein","regice","swinub","piloswine","mamoswine","amaura","aurorus"],"ROOT":["bulbasaur","ivysaur","venusaur","bellsprout","weepinbell","victreebel"],"TORMENT":["chimchar","monferno","infernape","magnemite","magneton","magnezone","lotad","lombre","ludicolo"],"STOMP":["aron","lairon","aggron","rhyhorn","rhydon","rhyperior"],"PAYBACK":["seedot","nuzleaf","shiftry"],"NIGHT_SLASH":["duskull","dusclops","dusknoir","spiritomb"],"BUG_BUZZ":["weedle","kakuna","beedrill","venonat","venomoth","snom","frosmoth"],"STRING_SHOT":["caterpie","metapod","butterfree"],"VENOSHOCK":["nidoranF","nidorina","nidoqueen","seviper","snivy","servine","serperior","ekans","arbok"],"LEECH_LIFE":["zubat","golbat","crobat"],"HAPPY_HOUR":["eevee","vaporeon","jolteon","flareon","espeon","umbreon","leafeon","sylveon","glaceon"],"TELEPORT":["abra","kadabra","alakazam","mew"],"NASTY_PLOT":["manaphy","phione"],"THIEF":["treecko","grovyle","sceptile","absol"],"STUN_SPORE":["chikorita","bayleef","meganium","oddish","gloom","vileplume","bellossom"],"METEOR_MASH":["beldum","metang","metagross"],"HURRICANE":["pidgey","pidgeotto","pidgeot","starly","staravia","staraptor"],"BURN":[],"SILENCE":["riolu","lucario","mega-lucario"],"SLEEP":["igglybuff","wygglytuff","jigglypuff","vanillite","vanillish","vanilluxe"],"FREEZE":["articuno","snover","abomasnow","mega-abomasnow"],"PROTECT":["deoxys"],"POISON":["nidoranM","nidorino","nidoking","salandit","salazzle","tentacool","tentacruel"],"CONFUSION":["meditite","medicham","mega-medicham","smoochum","jynx"],"ORIGIN_PULSE":["kyogre","primal-Kyogre"],"SEED_FLARE":["shaymin","shaymin-sky"],"HEAL_BLOCK":["kabuto","kabutops","cacnea","cacturne"],"ROAR_OF_TIME":["dialga","palkia"],"ROCK_TOMB":["omanyte","omastar","relicanth","clamperl","huntail"],"ROCK_SMASH":["anorith","armaldo","archen","archeops"],"HEAD_SMASH":["bagon","shelgon","cranidos","rampardos","tauros"],"VOLT_SWITCH":["pichu","pikachu","raichu","raikou","electrike","manectric","mega-manectric","regieleki"],"SHADOW_CLONE":["shuppet","banette","mega-banette"],"HYPER_VOICE":["swablu","altaria","mega-altaria"],"PETAL_DANCE":["budew","roselia","roserade"],"ECHO":["whismur","loudred","exploud"],"TRI_ATTACK":["tornadus","porygon","porygon2","porygon-z"],"GRASS_WHISTLE":[],"HIGH_JUMP_KICK":["buneary","lopunny","mega-lopunny","bounsweet","steenee","tsareena"],"DISARMING_VOICE":["flabebe","floette","florges"],"RELIC_SONG":["meloetta"],"GROWL":["growlithe","arcanine","poochyena","mightyena"],"BONEMERANG":["cubone","marowak","alolan-marowak"],"CLANGOROUS_SOUL":["jangmo-o","hakamo-o","kommo-o"],"NIGHTMARE":["gastly","haunter","gengar"],"EXPLOSION":["voltorb","electrode","pineco","forretress"],"KING_SHIELD":["honedge","doublade","aegislash"],"CORRUPTED_NATURE":["pumpkaboo","gourgeist"],"CRABHAMMER":["poliwrath","corphish","crawdaunt","oshawott","dewott","samurott"],"DIAMOND_STORM":["carbink","diancie"],"DRACO_ENERGY":["regidrago"],"DYNAMAX_CANNON":["mewtwo","eternatus"],"DYNAMIC_PUNCH":["makuhita","hariyama"],"ELECTRO_BOOST":[],"ELECTRO_WEB":["joltik","galvantula"],"FIRE_TRICK":["fennekin","braixen","delphox"],"FLAME_CHARGE":["entei","ponyta","rapidash"],"LEECH_SEED":["lileep","cradily","shroomish","breloom"],"LOCK_ON":["genesect"],"PSYCH_UP":["hatenna","hattrem","hatterene"],"RAZOR_WIND":["noibat","noivern","farfetch-d"],"TWISTING_NETHER":["guzzlord"],"WONDER_GUARD":["nincada","ninjask","shedninja"],"SONG_OF_DESIRE":["azelf"],"CONFUSING_MIND":["mesprit"],"KNOWLEDGE_THIEF":["uxie"],"EARTHQUAKE":["groudon","primal-Groudon"],"SOFT_BOILED":["happiny","chansey","blissey"],"ELECTRIC_SURGE":["tapu-koko"],"PSYCHIC_SURGE":["tapu-lele"],"MIND_BLOWN":["blacephalon"],"PAYDAY":["meowth","persian"],"BEAT_UP":["houndour","houndoom","mega-houndoom"],"BLUE_FLARE":["reshiram"],"FUSION_BOLT":["zekrom"],"AURORA_VEIL":["celebi","alolan-vulpix","alolan-ninetales"],"AQUA_JET":["suicune","keldeo","buizel","floatzel"],"JUDGEMENT":["arceus"],"CHATTER":["chatot"],"LIQUIDATION":["goomy","sligoo","goodra"],"STEAM_ERUPTION":["volcanion"],"APPLE_ACID":["applin","appletun"],"SHADOW_BALL":["solosis","duosion","reuniclus"],"DIVE":["lapras","wailmer","wailord"],"SPIKE_ARMOR":["onix","steelix","mega-steelix","sandshrew","sandslash","silcoon","cascoon","maractus"],"FUTURE_SIGHT":["ralts","kirlia","gardevoir"],"FAKE_TEARS":["gothita","gothorita","gothitelle"],"SPARKLING_ARIA":["popplio","brionne","primarina"],"DRAGON_DARTS":["salamence","dreepy","drakloak","dragapult"],"GRASSY_SURGE":["tapu-bulu"],"MISTY_SURGE":["tapu-fini"],"SKY_ATTACK":["lugia"],"ILLUSION":["kecleon","zorua","zoroark","hisui-zorua","hisui-zoroark"],"SMOG":["grimer","muk","alolan-grimer","alolan_muk"],"AURORA_BEAM":["seel","dewgong"],"AGILITY":["rattata","raticate","carvanha","sharpedo"],"SPIRIT_SHACKLE":["rowlet","dartix","decidueye"],"WATER_SHURIKEN":["froakie","frogadier","greninja"],"SHADOW_SNEAK":["giratina","mimikyu","origin-giratina"],"MACH_PUNCH":["tyrogue"],"UPPERCUT":["hitmonchan"],"TRIPLE_KICK":["hitmontop"],"MAWASHI_GERI":["hitmonlee"],"FORECAST":["castform","castform-sun","castform-rain","castform-hail"],"SACRED_SWORD":["virizion"],"X_SCISSOR":["scyther","scizor","mega-scizor"],"PLASMA_FIST":["zeraora"],"SPECTRAL_THIEF":["marshadow"],"GEOMANCY":["xerneas"],"DEATH_WING":["yveltal"],"SLACK_OFF":["slakoth","vigoroth","slaking","munchlax","snorlax"],"DARK_VOID":["darkrai"],"OVERHEAT":["moltres"],"HYPNOSIS":["hoothoot","noctowl"],"MIMIC":["mime-jr","mr-mime","bonsley","sudowoodo"],"HEX":["litwick","lampent","chandelure"],"GROWTH":["turtwig","grotle","torterra"],"HEAL_ORDER":["combee","vespiqueen"],"SHELL_TRAP":["shuckle"],"DIG":["diglett","dugtrio"],"FIRE_SPIN":["ho-Oh","vulpix","ninetales"],"SEARING_SHOT":["victini"],"PECK":["spearow","fearow"],"SPLASH":["magikarp"],"COUNTER":["wynaut","Wobbuffet"],"COSMIC_POWER":["lunatone","solrock"],"STICKY_WEB":["wurmple"],"SILVER_WIND":["beautifly"],"POISON_POWDER":["dustox"],"ICY_WIND":["snorunt","glalie","froslass"],"GIGATON_HAMMER":["tinkatink","tinkatuff","tinkaton"],"ACROBATICS":["hoppip","skiploom","jumpluff"],"ABSORB":["paras","parasect"],"ROLLOUT":["miltank"],"THRASH":["mankey","primeape"],"SOLAR_BEAM":["sunkern","sunflora"],"MAGMA_STORM":["heatran"],"SLASHING_CLAW":["sneasel","weavile"],"ERUPTION":["numel","camerupt","mega-camerupt"],"MIST_BALL":["latias"],"LUSTER_PURGE":["latios"],"MUD_BUBBLE":["mudkip","marshtomp","swampert"],"LINK_CABLE":["minun","plusle"],"MAGIC_BOUNCE":["natu","xatu"],"HIDDEN_POWER_A":["unown-a"],"HIDDEN_POWER_B":["unown-b"],"HIDDEN_POWER_C":["unown-c"],"HIDDEN_POWER_D":["unown-d"],"HIDDEN_POWER_E":["unown-e"],"HIDDEN_POWER_F":["unown-f"],"HIDDEN_POWER_G":["unown-g"],"HIDDEN_POWER_H":["unown-h"],"HIDDEN_POWER_I":["unown-i"],"HIDDEN_POWER_J":["unown-j"],"HIDDEN_POWER_K":["unown-k"],"HIDDEN_POWER_L":["unown-l"],"HIDDEN_POWER_M":["unown-m"],"HIDDEN_POWER_N":["unown-n"],"HIDDEN_POWER_O":["unown-o"],"HIDDEN_POWER_P":["unown-p"],"HIDDEN_POWER_Q":["unown-q"],"HIDDEN_POWER_R":["unown-r"],"HIDDEN_POWER_S":["unown-s"],"HIDDEN_POWER_T":["unown-t"],"HIDDEN_POWER_U":["unown-u"],"HIDDEN_POWER_V":["unown-v"],"HIDDEN_POWER_W":["unown-w"],"HIDDEN_POWER_X":["unown-x"],"HIDDEN_POWER_Y":["unown-y"],"HIDDEN_POWER_Z":["unown-z"],"HIDDEN_POWER_QM":["unown-question"],"HIDDEN_POWER_EM":["unown-exclamation"]} \ No newline at end of file diff --git a/app/models/precomputed/pokemons-data.csv b/app/models/precomputed/pokemons-data.csv index b0ee62d5c3..34e944af0f 100644 --- a/app/models/precomputed/pokemons-data.csv +++ b/app/models/precomputed/pokemons-data.csv @@ -193,9 +193,9 @@ Index,Name,Category,Tier,Additional pick,Type 1,Type 2,Type 3,Type 4,HP,Attack,D 0243,raikou,MYTHICAL,2,false,ELECTRIC,FIELD,,,300,30,5,5,1,130,VOLT_SWITCH,raikou,ELECTRIC,FIELD,,,false 0244,entei,MYTHICAL,2,false,FIRE,FIELD,,,300,30,5,5,1,130,FLAME_CHARGE,entei,FIRE,FIELD,,,false 0245,suicune,MYTHICAL,2,false,WATER,ICE,FIELD,,300,30,5,5,1,100,AQUA_JET,suicune,WATER,ICE,FIELD,,false -0246,larvitar,RARE,1,false,DARK,MONSTER,ROCK,,80,7,4,2,1,90,BITE,larvitar,DARK,MONSTER,ROCK,,false -0247,pupitar,RARE,2,false,DARK,MONSTER,ROCK,,140,15,6,4,1,90,BITE,larvitar,DARK,MONSTER,ROCK,,false -0248,tyranitar,RARE,3,false,DARK,MONSTER,ROCK,,220,29,8,5,1,90,BITE,larvitar,DARK,MONSTER,ROCK,,false +0246,larvitar,RARE,1,false,DARK,MONSTER,ROCK,,75,7,4,2,1,90,BITE,larvitar,DARK,MONSTER,ROCK,,false +0247,pupitar,RARE,2,false,DARK,MONSTER,ROCK,,130,14,6,4,1,90,BITE,larvitar,DARK,MONSTER,ROCK,,false +0248,tyranitar,RARE,3,false,DARK,MONSTER,ROCK,,210,28,8,5,1,90,BITE,larvitar,DARK,MONSTER,ROCK,,false 0249,lugia,MYTHICAL,3,false,AQUATIC,FLYING,PSYCHIC,,300,30,6,6,1,60,SKY_ATTACK,lugia,AQUATIC,FLYING,PSYCHIC,,false 0250,ho-Oh,MYTHICAL,2,false,FIRE,FLYING,,,300,30,5,5,3,100,FIRE_SPIN,ho-Oh,FIRE,FLYING,,,false 0251,celebi,MYTHICAL,2,false,GRASS,PSYCHIC,,,300,30,5,5,3,100,AURORA_VEIL,celebi,GRASS,PSYCHIC,,,false @@ -235,8 +235,8 @@ Index,Name,Category,Tier,Additional pick,Type 1,Type 2,Type 3,Type 4,HP,Attack,D 0293,whismur,RARE,1,false,NORMAL,SOUND,,,90,6,1,1,2,90,ECHO,whismur,NORMAL,SOUND,,,false 0294,loudred,RARE,2,false,NORMAL,SOUND,,,150,14,2,2,2,90,ECHO,whismur,NORMAL,SOUND,,,false 0295,exploud,RARE,3,false,NORMAL,SOUND,,,300,24,3,3,2,90,ECHO,whismur,NORMAL,SOUND,,,false -0296,makuhita,RARE,1,true,FIGHTING,MONSTER,,,70,8,3,3,1,100,DYNAMIC_PUNCH,makuhita,FIGHTING,MONSTER,,,false -0297,hariyama,RARE,2,true,FIGHTING,MONSTER,,,160,22,5,5,1,80,DYNAMIC_PUNCH,makuhita,FIGHTING,MONSTER,,,false +0296,makuhita,RARE,1,true,FIGHTING,MONSTER,,,80,8,3,3,1,100,DYNAMIC_PUNCH,makuhita,FIGHTING,MONSTER,,,false +0297,hariyama,RARE,2,true,FIGHTING,MONSTER,,,170,22,5,5,1,80,DYNAMIC_PUNCH,makuhita,FIGHTING,MONSTER,,,false 0298,azurill,COMMON,1,false,WATER,FAIRY,BABY,,50,5,1,1,2,100,HYDRO_PUMP,azurill,WATER,FAIRY,BABY,,false 0303,mawile,MYTHICAL,1,false,STEEL,FAIRY,MONSTER,,180,15,6,6,1,80,IRON_TAIL,mawile,STEEL,FAIRY,MONSTER,,false 0304,aron,COMMON,1,false,STEEL,MONSTER,ROCK,,60,4,2,2,1,100,STOMP,aron,STEEL,MONSTER,ROCK,,false @@ -352,9 +352,9 @@ Index,Name,Category,Tier,Additional pick,Type 1,Type 2,Type 3,Type 4,HP,Attack,D 0440,happiny,LEGENDARY,1,false,NORMAL,HUMAN,BABY,,150,8,5,5,1,130,SOFT_BOILED,happiny,NORMAL,HUMAN,BABY,,false 0441,chatot,MYTHICAL,1,false,FLYING,SOUND,,,200,20,2,2,3,120,CHATTER,chatot,FLYING,SOUND,,,false 0442,spiritomb,MYTHICAL,1,false,DARK,GHOST,,,200,20,2,2,2,80,NIGHT_SLASH,spiritomb,DARK,GHOST,,,false -0443,gible,EPIC,1,false,DRAGON,GROUND,MONSTER,,100,6,4,4,1,100,DRAGON_BREATH,gible,DRAGON,GROUND,MONSTER,,false -0444,gabite,EPIC,2,false,DRAGON,GROUND,MONSTER,,160,14,5,5,1,100,DRAGON_BREATH,gible,DRAGON,GROUND,MONSTER,,false -0445,garchomp,EPIC,3,false,DRAGON,GROUND,MONSTER,,240,32,6,6,1,100,DRAGON_BREATH,gible,DRAGON,GROUND,MONSTER,,false +0443,gible,RARE,1,false,DRAGON,GROUND,MONSTER,,90,6,3,2,1,100,DRAGON_BREATH,gible,DRAGON,GROUND,MONSTER,,false +0444,gabite,RARE,2,false,DRAGON,GROUND,MONSTER,,150,14,4,3,1,100,DRAGON_BREATH,gible,DRAGON,GROUND,MONSTER,,false +0445,garchomp,RARE,3,false,DRAGON,GROUND,MONSTER,,240,28,5,4,1,100,DRAGON_BREATH,gible,DRAGON,GROUND,MONSTER,,false 0446,munchlax,EPIC,1,true,NORMAL,HUMAN,BABY,,120,8,2,2,1,120,SLACK_OFF,munchlax,NORMAL,HUMAN,BABY,,false 0447,riolu,LEGENDARY,1,false,FIGHTING,STEEL,BABY,,120,10,3,3,2,90,SILENCE,riolu,FIGHTING,STEEL,BABY,,false 0448,lucario,LEGENDARY,2,false,FIGHTING,STEEL,,,240,24,5,5,2,90,SILENCE,riolu,FIGHTING,STEEL,BABY,,false diff --git a/app/models/precomputed/type-pokemons-all.json b/app/models/precomputed/type-pokemons-all.json index 461a84602b..e45f128d2b 100644 --- a/app/models/precomputed/type-pokemons-all.json +++ b/app/models/precomputed/type-pokemons-all.json @@ -1 +1 @@ -{"NORMAL":["pidgey","pidgeotto","pidgeot","rattata","raticate","spearow","fearow","sandshrew","sandslash","clefairy","clefable","jigglypuff","wygglytuff","diglett","dugtrio","meowth","persian","farfetch-d","chansey","tauros","eevee","porygon","snorlax","hoothoot","noctowl","cleffa","togepi","togetic","snubull","granbull","porygon2","miltank","blissey","poochyena","mightyena","silcoon","beautifly","slakoth","vigoroth","slaking","whismur","loudred","exploud","swablu","castform","castform-sun","castform-rain","castform-hail","starly","staravia","staraptor","buneary","lopunny","mega-lopunny","happiny","munchlax","togekiss","porygon-z","regigigas","hisui-zorua","hisui-zoroark","meloetta"],"GRASS":["bulbasaur","ivysaur","venusaur","caterpie","metapod","butterfree","oddish","gloom","vileplume","paras","parasect","bellsprout","weepinbell","victreebel","chikorita","bayleef","meganium","bellossom","hoppip","skiploom","jumpluff","sunkern","sunflora","celebi","treecko","grovyle","sceptile","lotad","lombre","ludicolo","seedot","nuzleaf","shiftry","shroomish","breloom","roselia","cacnea","cacturne","lileep","cradily","turtwig","grotle","torterra","budew","roserade","snover","abomasnow","mega-abomasnow","leafeon","shaymin","shaymin-sky","snivy","servine","serperior","maractus","virizion","pumpkaboo","gourgeist","rowlet","dartix","decidueye","bounsweet","steenee","tsareena","tapu-bulu","applin","appletun"],"FIRE":["charmander","charmeleon","charizard","vulpix","ninetales","growlithe","arcanine","ponyta","rapidash","alolan-marowak","magmar","flareon","moltres","cyndaquil","quilava","typlosion","sunkern","sunflora","slugma","magcargo","houndour","houndoom","mega-houndoom","magby","entei","ho-Oh","torchic","combusken","blaziken","numel","camerupt","mega-camerupt","castform-sun","groudon","primal-Groudon","chimchar","monferno","infernape","magmortar","heatran","victini","tepig","pignite","emboar","litwick","lampent","chandelure","volcarona","reshiram","fennekin","braixen","delphox","volcanion","salandit","salazzle","blacephalon","scorbunny","raboot","cinderace"],"WATER":["squirtle","wartortle","blastoise","poliwag","poliwhirl","poliwrath","tentacool","tentacruel","horsea","seadra","magikarp","magikarp","gyarados","lapras","vaporeon","omanyte","omastar","kabuto","kabutops","totodile","croconaw","feraligatr","chinchou","lanturn","marill","azumarill","politoed","kingdra","suicune","mudkip","marshtomp","swampert","lotad","lombre","ludicolo","azurill","carvanha","sharpedo","wailmer","wailord","corphish","crawdaunt","castform-rain","clamperl","huntail","gorebyss","relicanth","kyogre","primal-Kyogre","piplup","prinplup","empoleon","buizel","floatzel","palkia","phione","manaphy","oshawott","dewott","samurott","keldeo","froakie","frogadier","greninja","volcanion","popplio","brionne","primarina","tapu-fini"],"ELECTRIC":["pikachu","raichu","alolan-geodude","alolan-graveler","alolan-golem","magnemite","magneton","voltorb","electrode","electabuzz","jolteon","zapdos","chinchou","lanturn","pichu","mareep","flaffy","ampharos","elekid","raikou","electrike","manectric","mega-manectric","plusle","minun","primal-Kyogre","shinx","luxio","luxray","magnezone","electivire","rotom","joltik","galvantula","zekrom","tapu-koko","zeraora","regieleki"],"FIGHTING":["mankey","primeape","poliwag","poliwhirl","poliwrath","machop","machoke","machamp","hitmonlee","hitmonchan","politoed","tyrogue","hitmontop","torchic","combusken","blaziken","shroomish","breloom","makuhita","hariyama","meditite","medicham","mega-medicham","chimchar","monferno","infernape","buneary","lopunny","mega-lopunny","riolu","lucario","mega-lucario","croagunk","toxicroak","tepig","pignite","emboar","oshawott","dewott","samurott","cobalion","virizion","keldeo","bounsweet","steenee","tsareena","jangmo-o","hakamo-o","kommo-o","marshadow","zeraora","scorbunny","raboot","cinderace"],"PSYCHIC":["vulpix","ninetales","venonat","venomoth","abra","kadabra","alakazam","slowpoke","slowbro","mr-mime","jynx","porygon","mewtwo","mew","hoothoot","noctowl","natu","xatu","espeon","slowking","Wobbuffet","porygon2","smoochum","lugia","celebi","ralts","kirlia","gardevoir","meditite","medicham","mega-medicham","lunatone","solrock","wynaut","gorebyss","beldum","metang","metagross","latias","latios","jirachi","deoxys","bronzor","bronzong","mime-jr","porygon-z","uxie","mesprit","azelf","cresselia","victini","gothita","gothorita","gothitelle","solosis","duosion","reuniclus","fennekin","braixen","delphox","tapu-lele","hatenna","hattrem","hatterene"],"DARK":["ekans","arbok","alolan-grimer","alolan_muk","umbreon","sneasel","houndour","houndoom","mega-houndoom","larvitar","pupitar","tyranitar","poochyena","mightyena","seedot","nuzleaf","shiftry","carvanha","sharpedo","cacnea","cacturne","corphish","crawdaunt","shuppet","banette","mega-banette","duskull","dusclops","absol","spiritomb","weavile","dusknoir","darkrai","zorua","zoroark","gothita","gothorita","gothitelle","froakie","frogadier","greninja","yveltal","guzzlord"],"STEEL":["magnemite","magneton","onix","pineco","forretress","steelix","mega-steelix","scizor","mega-scizor","mawile","aron","lairon","aggron","beldum","metang","metagross","registeel","jirachi","piplup","prinplup","empoleon","shieldon","bastiodon","bronzor","bronzong","riolu","lucario","mega-lucario","magnezone","dialga","heatran","cobalion","genesect","honedge","doublade","aegislash","stakataka","tinkatink","tinkatuff","tinkaton"],"GROUND":["sandshrew","sandslash","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","diglett","dugtrio","geodude","graveler","golem","onix","cubone","marowak","alolan-marowak","rhyhorn","rhydon","steelix","mega-steelix","swinub","piloswine","mudkip","marshtomp","swampert","numel","camerupt","mega-camerupt","trapinch","vibrava","flygon","groudon","primal-Groudon","turtwig","grotle","torterra","gible","gabite","garchomp","rhyperior","mamoswine","maractus"],"POISON":["bulbasaur","ivysaur","venusaur","weedle","kakuna","beedrill","ekans","arbok","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","zubat","golbat","oddish","gloom","vileplume","paras","parasect","bellsprout","weepinbell","victreebel","tentacool","tentacruel","grimer","alolan-grimer","muk","alolan_muk","gastly","haunter","gengar","crobat","bellossom","cascoon","dustox","roselia","seviper","budew","roserade","croagunk","toxicroak","salandit","salazzle","eternatus"],"DRAGON":["charmander","charmeleon","charizard","horsea","seadra","gyarados","dratini","dragonair","dragonite","kingdra","vibrava","flygon","altaria","mega-altaria","bagon","shelgon","salamence","latias","latios","rayquaza","mega-Rayquaza","gible","gabite","garchomp","dialga","palkia","giratina","origin-giratina","reshiram","zekrom","goomy","sligoo","goodra","noibat","noivern","jangmo-o","hakamo-o","kommo-o","guzzlord","applin","appletun","dreepy","drakloak","dragapult","eternatus","regidrago"],"FIELD":["squirtle","wartortle","blastoise","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","meowth","persian","mankey","primeape","growlithe","arcanine","ponyta","rapidash","tauros","eevee","vaporeon","jolteon","flareon","mew","cyndaquil","quilava","typlosion","mareep","flaffy","ampharos","espeon","umbreon","snubull","granbull","swinub","piloswine","miltank","raikou","entei","suicune","poochyena","mightyena","slakoth","vigoroth","slaking","electrike","manectric","mega-manectric","numel","camerupt","mega-camerupt","absol","shinx","luxio","luxray","buizel","floatzel","leafeon","glaceon","mamoswine","snivy","servine","serperior","tepig","pignite","emboar","oshawott","dewott","samurott","zorua","zoroark","sylveon"],"MONSTER":["grimer","muk","gastly","haunter","gengar","rhyhorn","rhydon","mewtwo","totodile","croconaw","feraligatr","sudowoodo","sneasel","larvitar","pupitar","tyranitar","treecko","grovyle","sceptile","makuhita","hariyama","mawile","aron","lairon","aggron","seviper","bagon","shelgon","salamence","cranidos","rampardos","gible","gabite","garchomp","weavile","rhyperior","regigigas","tornadus","goomy","sligoo","goodra"],"HUMAN":["abra","kadabra","alakazam","machop","machoke","machamp","hitmonlee","hitmonchan","chansey","mr-mime","jynx","electabuzz","magmar","pinsir","snorlax","hitmontop","magby","blissey","ralts","kirlia","gardevoir","meditite","medicham","mega-medicham","cacnea","cacturne","regirock","regice","registeel","deoxys","chimchar","monferno","infernape","happiny","munchlax","electivire","magmortar","regigigas","gothita","gothorita","gothitelle","tornadus","fennekin","braixen","delphox","scorbunny","raboot","cinderace","regieleki","regidrago"],"AQUATIC":["poliwag","poliwhirl","poliwrath","tentacool","tentacruel","slowpoke","slowbro","seel","dewgong","vaporeon","dratini","dragonair","dragonite","totodile","croconaw","feraligatr","politoed","slowking","lugia","lotad","lombre","ludicolo","anorith","armaldo","spheal","sealeo","walrein","clamperl","huntail","kyogre","primal-Kyogre","buizel","floatzel","croagunk","toxicroak","phione","manaphy","froakie","frogadier","greninja","goomy","sligoo","goodra","volcanion"],"BUG":["caterpie","metapod","butterfree","weedle","kakuna","beedrill","paras","parasect","venonat","venomoth","scyther","pinsir","pineco","forretress","scizor","mega-scizor","shuckle","wurmple","silcoon","beautifly","cascoon","dustox","nincada","ninjask","shedninja","trapinch","vibrava","flygon","anorith","armaldo","combee","vespiqueen","phione","manaphy","joltik","galvantula","volcarona","genesect","snom","frosmoth"],"FLYING":["charizard","butterfree","beedrill","pidgey","pidgeotto","pidgeot","spearow","fearow","zubat","golbat","venonat","venomoth","farfetch-d","scyther","gyarados","aerodactyl","articuno","zapdos","moltres","dratini","dragonair","dragonite","hoothoot","noctowl","crobat","togetic","natu","xatu","hoppip","skiploom","jumpluff","scizor","mega-scizor","lugia","ho-Oh","torchic","combusken","blaziken","beautifly","dustox","nincada","ninjask","shedninja","salamence","rayquaza","mega-Rayquaza","piplup","prinplup","empoleon","starly","staravia","staraptor","drifloon","drifblim","chatot","togekiss","origin-giratina","shaymin-sky","archen","archeops","tornadus","noibat","noivern","yveltal","rowlet","dartix","decidueye"],"FLORA":["bulbasaur","ivysaur","venusaur","bellsprout","weepinbell","victreebel","chikorita","bayleef","meganium","sudowoodo","hoppip","skiploom","jumpluff","sunkern","sunflora","roselia","lileep","cradily","turtwig","grotle","torterra","roserade","combee","vespiqueen","bonsley","leafeon","shaymin","shaymin-sky","maractus","flabebe","floette","florges"],"ROCK":["geodude","alolan-geodude","graveler","alolan-graveler","golem","alolan-golem","onix","alolan-marowak","rhyhorn","rhydon","aerodactyl","sudowoodo","steelix","mega-steelix","shuckle","slugma","magcargo","larvitar","pupitar","tyranitar","aron","lairon","aggron","lunatone","solrock","relicanth","regirock","bonsley","rhyperior","archen","archeops","carbink","diancie","stakataka"],"GHOST":["gastly","haunter","gengar","cubone","marowak","alolan-marowak","shedninja","shuppet","banette","mega-banette","duskull","dusclops","snorunt","glalie","drifloon","drifblim","spiritomb","dusknoir","froslass","rotom","giratina","origin-giratina","darkrai","hisui-zorua","hisui-zoroark","litwick","lampent","chandelure","honedge","doublade","aegislash","pumpkaboo","gourgeist","rowlet","dartix","decidueye","mimikyu","marshadow","blacephalon","dreepy","drakloak","dragapult"],"FAIRY":["pikachu","raichu","clefairy","clefable","alolan-vulpix","alolan-ninetales","jigglypuff","wygglytuff","mr-mime","pichu","cleffa","igglybuff","togepi","togetic","marill","azumarill","snubull","granbull","ralts","kirlia","gardevoir","azurill","mawile","plusle","minun","swablu","altaria","mega-altaria","mime-jr","togekiss","uxie","mesprit","azelf","cresselia","vanillite","vanillish","vanilluxe","flabebe","floette","florges","sylveon","carbink","xerneas","diancie","popplio","brionne","primarina","mimikyu","tapu-koko","tapu-lele","tapu-bulu","tapu-fini","hatenna","hattrem","hatterene","tinkatink","tinkatuff","tinkaton"],"ICE":["alolan-vulpix","alolan-ninetales","seel","dewgong","jynx","lapras","articuno","sneasel","swinub","piloswine","smoochum","suicune","castform-hail","snorunt","glalie","spheal","sealeo","walrein","regice","snover","abomasnow","mega-abomasnow","weavile","glaceon","mamoswine","froslass","vanillite","vanillish","vanilluxe","amaura","aurorus","snom","frosmoth"],"FOSSIL":["omanyte","omastar","kabuto","kabutops","aerodactyl","lileep","cradily","anorith","armaldo","clamperl","huntail","gorebyss","relicanth","cranidos","rampardos","shieldon","bastiodon","archen","archeops","amaura","aurorus","carbink","diancie"],"SOUND":["jigglypuff","wygglytuff","zubat","golbat","crobat","igglybuff","whismur","loudred","exploud","wailmer","wailord","swablu","altaria","mega-altaria","chatot","meloetta","flabebe","floette","florges","sylveon","noibat","noivern","popplio","brionne","primarina","jangmo-o","hakamo-o","kommo-o"],"ARTIFICIAL":["voltorb","electrode","electabuzz","porygon","mewtwo","porygon2","elekid","castform","castform-sun","castform-rain","castform-hail","beldum","metang","metagross","deoxys","electivire","porygon-z","vanillite","vanillish","vanilluxe","litwick","lampent","chandelure","genesect","honedge","doublade","aegislash"],"BABY":["pichu","cleffa","igglybuff","togepi","tyrogue","smoochum","elekid","magby","azurill","wynaut","budew","bonsley","mime-jr","happiny","munchlax","riolu"]} \ No newline at end of file +{"NORMAL":["pidgey","pidgeotto","pidgeot","rattata","raticate","spearow","fearow","sandshrew","sandslash","clefairy","clefable","jigglypuff","wygglytuff","diglett","dugtrio","meowth","persian","farfetch-d","chansey","tauros","eevee","porygon","snorlax","hoothoot","noctowl","cleffa","togepi","togetic","snubull","granbull","porygon2","miltank","blissey","poochyena","mightyena","silcoon","beautifly","slakoth","vigoroth","slaking","whismur","loudred","exploud","swablu","castform","castform-sun","castform-rain","castform-hail","starly","staravia","staraptor","buneary","lopunny","mega-lopunny","happiny","munchlax","togekiss","porygon-z","regigigas","hisui-zorua","hisui-zoroark","meloetta"],"GRASS":["bulbasaur","ivysaur","venusaur","caterpie","metapod","butterfree","oddish","gloom","vileplume","paras","parasect","bellsprout","weepinbell","victreebel","chikorita","bayleef","meganium","bellossom","hoppip","skiploom","jumpluff","sunkern","sunflora","celebi","treecko","grovyle","sceptile","lotad","lombre","ludicolo","seedot","nuzleaf","shiftry","shroomish","breloom","roselia","cacnea","cacturne","lileep","cradily","turtwig","grotle","torterra","budew","roserade","snover","abomasnow","mega-abomasnow","leafeon","shaymin","shaymin-sky","snivy","servine","serperior","maractus","virizion","pumpkaboo","gourgeist","rowlet","dartix","decidueye","bounsweet","steenee","tsareena","tapu-bulu","applin","appletun"],"FIRE":["charmander","charmeleon","charizard","vulpix","ninetales","growlithe","arcanine","ponyta","rapidash","alolan-marowak","magmar","flareon","moltres","cyndaquil","quilava","typlosion","sunkern","sunflora","slugma","magcargo","houndour","houndoom","mega-houndoom","magby","entei","ho-Oh","torchic","combusken","blaziken","numel","camerupt","mega-camerupt","castform-sun","groudon","primal-Groudon","chimchar","monferno","infernape","magmortar","heatran","victini","tepig","pignite","emboar","litwick","lampent","chandelure","volcarona","reshiram","fennekin","braixen","delphox","volcanion","salandit","salazzle","blacephalon","scorbunny","raboot","cinderace"],"WATER":["squirtle","wartortle","blastoise","poliwag","poliwhirl","poliwrath","tentacool","tentacruel","horsea","seadra","magikarp","magikarp","gyarados","lapras","vaporeon","omanyte","omastar","kabuto","kabutops","totodile","croconaw","feraligatr","chinchou","lanturn","marill","azumarill","politoed","kingdra","suicune","mudkip","marshtomp","swampert","lotad","lombre","ludicolo","azurill","carvanha","sharpedo","wailmer","wailord","corphish","crawdaunt","castform-rain","clamperl","huntail","gorebyss","relicanth","kyogre","primal-Kyogre","piplup","prinplup","empoleon","buizel","floatzel","palkia","phione","manaphy","oshawott","dewott","samurott","keldeo","froakie","frogadier","greninja","volcanion","popplio","brionne","primarina","tapu-fini"],"ELECTRIC":["pikachu","raichu","alolan-geodude","alolan-graveler","alolan-golem","magnemite","magneton","voltorb","electrode","electabuzz","jolteon","zapdos","chinchou","lanturn","pichu","mareep","flaffy","ampharos","elekid","raikou","electrike","manectric","mega-manectric","plusle","minun","primal-Kyogre","shinx","luxio","luxray","magnezone","electivire","rotom","joltik","galvantula","zekrom","tapu-koko","zeraora","regieleki"],"FIGHTING":["mankey","primeape","poliwag","poliwhirl","poliwrath","machop","machoke","machamp","hitmonlee","hitmonchan","politoed","tyrogue","hitmontop","torchic","combusken","blaziken","shroomish","breloom","makuhita","hariyama","meditite","medicham","mega-medicham","chimchar","monferno","infernape","buneary","lopunny","mega-lopunny","riolu","lucario","mega-lucario","croagunk","toxicroak","tepig","pignite","emboar","oshawott","dewott","samurott","cobalion","virizion","keldeo","bounsweet","steenee","tsareena","jangmo-o","hakamo-o","kommo-o","marshadow","zeraora","scorbunny","raboot","cinderace"],"PSYCHIC":["vulpix","ninetales","venonat","venomoth","abra","kadabra","alakazam","slowpoke","slowbro","mr-mime","jynx","porygon","mewtwo","mew","hoothoot","noctowl","natu","xatu","espeon","slowking","unown-a","unown-b","unown-c","unown-d","unown-e","unown-f","unown-g","unown-h","unown-i","unown-j","unown-k","unown-l","unown-m","unown-n","unown-o","unown-p","unown-q","unown-r","unown-s","unown-t","unown-u","unown-v","unown-w","unown-x","unown-y","unown-z","unown-exclamation","unown-question","Wobbuffet","porygon2","smoochum","lugia","celebi","ralts","kirlia","gardevoir","meditite","medicham","mega-medicham","lunatone","solrock","wynaut","gorebyss","beldum","metang","metagross","latias","latios","jirachi","deoxys","bronzor","bronzong","mime-jr","porygon-z","uxie","mesprit","azelf","cresselia","victini","gothita","gothorita","gothitelle","solosis","duosion","reuniclus","fennekin","braixen","delphox","tapu-lele","hatenna","hattrem","hatterene"],"DARK":["ekans","arbok","alolan-grimer","alolan_muk","umbreon","sneasel","houndour","houndoom","mega-houndoom","larvitar","pupitar","tyranitar","poochyena","mightyena","seedot","nuzleaf","shiftry","carvanha","sharpedo","cacnea","cacturne","corphish","crawdaunt","shuppet","banette","mega-banette","duskull","dusclops","absol","spiritomb","weavile","dusknoir","darkrai","zorua","zoroark","gothita","gothorita","gothitelle","froakie","frogadier","greninja","yveltal","guzzlord"],"STEEL":["magnemite","magneton","onix","pineco","forretress","steelix","mega-steelix","scizor","mega-scizor","mawile","aron","lairon","aggron","beldum","metang","metagross","registeel","jirachi","piplup","prinplup","empoleon","shieldon","bastiodon","bronzor","bronzong","riolu","lucario","mega-lucario","magnezone","dialga","heatran","cobalion","genesect","honedge","doublade","aegislash","stakataka","tinkatink","tinkatuff","tinkaton"],"GROUND":["sandshrew","sandslash","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","diglett","dugtrio","geodude","graveler","golem","onix","cubone","marowak","alolan-marowak","rhyhorn","rhydon","steelix","mega-steelix","swinub","piloswine","mudkip","marshtomp","swampert","numel","camerupt","mega-camerupt","trapinch","vibrava","flygon","groudon","primal-Groudon","turtwig","grotle","torterra","gible","gabite","garchomp","rhyperior","mamoswine","maractus"],"POISON":["bulbasaur","ivysaur","venusaur","weedle","kakuna","beedrill","ekans","arbok","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","zubat","golbat","oddish","gloom","vileplume","paras","parasect","bellsprout","weepinbell","victreebel","tentacool","tentacruel","grimer","alolan-grimer","muk","alolan_muk","gastly","haunter","gengar","crobat","bellossom","cascoon","dustox","roselia","seviper","budew","roserade","croagunk","toxicroak","salandit","salazzle","eternatus"],"DRAGON":["charmander","charmeleon","charizard","horsea","seadra","gyarados","dratini","dragonair","dragonite","kingdra","vibrava","flygon","altaria","mega-altaria","bagon","shelgon","salamence","latias","latios","rayquaza","mega-Rayquaza","gible","gabite","garchomp","dialga","palkia","giratina","origin-giratina","reshiram","zekrom","goomy","sligoo","goodra","noibat","noivern","jangmo-o","hakamo-o","kommo-o","guzzlord","applin","appletun","dreepy","drakloak","dragapult","eternatus","regidrago"],"FIELD":["squirtle","wartortle","blastoise","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","meowth","persian","mankey","primeape","growlithe","arcanine","ponyta","rapidash","tauros","eevee","vaporeon","jolteon","flareon","mew","cyndaquil","quilava","typlosion","mareep","flaffy","ampharos","espeon","umbreon","snubull","granbull","swinub","piloswine","miltank","raikou","entei","suicune","poochyena","mightyena","slakoth","vigoroth","slaking","electrike","manectric","mega-manectric","numel","camerupt","mega-camerupt","absol","shinx","luxio","luxray","buizel","floatzel","leafeon","glaceon","mamoswine","snivy","servine","serperior","tepig","pignite","emboar","oshawott","dewott","samurott","zorua","zoroark","sylveon"],"MONSTER":["grimer","muk","gastly","haunter","gengar","rhyhorn","rhydon","mewtwo","totodile","croconaw","feraligatr","sudowoodo","sneasel","larvitar","pupitar","tyranitar","treecko","grovyle","sceptile","makuhita","hariyama","mawile","aron","lairon","aggron","seviper","bagon","shelgon","salamence","cranidos","rampardos","gible","gabite","garchomp","weavile","rhyperior","regigigas","tornadus","goomy","sligoo","goodra"],"HUMAN":["abra","kadabra","alakazam","machop","machoke","machamp","hitmonlee","hitmonchan","chansey","mr-mime","jynx","electabuzz","magmar","pinsir","snorlax","hitmontop","magby","blissey","ralts","kirlia","gardevoir","meditite","medicham","mega-medicham","cacnea","cacturne","regirock","regice","registeel","deoxys","chimchar","monferno","infernape","happiny","munchlax","electivire","magmortar","regigigas","gothita","gothorita","gothitelle","tornadus","fennekin","braixen","delphox","scorbunny","raboot","cinderace","regieleki","regidrago"],"AQUATIC":["poliwag","poliwhirl","poliwrath","tentacool","tentacruel","slowpoke","slowbro","seel","dewgong","vaporeon","dratini","dragonair","dragonite","totodile","croconaw","feraligatr","politoed","slowking","lugia","lotad","lombre","ludicolo","anorith","armaldo","spheal","sealeo","walrein","clamperl","huntail","kyogre","primal-Kyogre","buizel","floatzel","croagunk","toxicroak","phione","manaphy","froakie","frogadier","greninja","goomy","sligoo","goodra","volcanion"],"BUG":["caterpie","metapod","butterfree","weedle","kakuna","beedrill","paras","parasect","venonat","venomoth","scyther","pinsir","pineco","forretress","scizor","mega-scizor","shuckle","wurmple","silcoon","beautifly","cascoon","dustox","nincada","ninjask","shedninja","trapinch","vibrava","flygon","anorith","armaldo","combee","vespiqueen","phione","manaphy","joltik","galvantula","volcarona","genesect","snom","frosmoth"],"FLYING":["charizard","butterfree","beedrill","pidgey","pidgeotto","pidgeot","spearow","fearow","zubat","golbat","venonat","venomoth","farfetch-d","scyther","gyarados","aerodactyl","articuno","zapdos","moltres","dratini","dragonair","dragonite","hoothoot","noctowl","crobat","togetic","natu","xatu","hoppip","skiploom","jumpluff","scizor","mega-scizor","lugia","ho-Oh","torchic","combusken","blaziken","beautifly","dustox","nincada","ninjask","shedninja","salamence","rayquaza","mega-Rayquaza","piplup","prinplup","empoleon","starly","staravia","staraptor","drifloon","drifblim","chatot","togekiss","origin-giratina","shaymin-sky","archen","archeops","tornadus","noibat","noivern","yveltal","rowlet","dartix","decidueye"],"FLORA":["bulbasaur","ivysaur","venusaur","bellsprout","weepinbell","victreebel","chikorita","bayleef","meganium","sudowoodo","hoppip","skiploom","jumpluff","sunkern","sunflora","roselia","lileep","cradily","turtwig","grotle","torterra","roserade","combee","vespiqueen","bonsley","leafeon","shaymin","shaymin-sky","maractus","flabebe","floette","florges"],"ROCK":["geodude","alolan-geodude","graveler","alolan-graveler","golem","alolan-golem","onix","alolan-marowak","rhyhorn","rhydon","aerodactyl","sudowoodo","steelix","mega-steelix","shuckle","slugma","magcargo","larvitar","pupitar","tyranitar","aron","lairon","aggron","lunatone","solrock","relicanth","regirock","bonsley","rhyperior","archen","archeops","carbink","diancie","stakataka"],"GHOST":["gastly","haunter","gengar","cubone","marowak","alolan-marowak","shedninja","shuppet","banette","mega-banette","duskull","dusclops","snorunt","glalie","drifloon","drifblim","spiritomb","dusknoir","froslass","rotom","giratina","origin-giratina","darkrai","hisui-zorua","hisui-zoroark","litwick","lampent","chandelure","honedge","doublade","aegislash","pumpkaboo","gourgeist","rowlet","dartix","decidueye","mimikyu","marshadow","blacephalon","dreepy","drakloak","dragapult"],"FAIRY":["pikachu","raichu","clefairy","clefable","alolan-vulpix","alolan-ninetales","jigglypuff","wygglytuff","mr-mime","pichu","cleffa","igglybuff","togepi","togetic","marill","azumarill","snubull","granbull","ralts","kirlia","gardevoir","azurill","mawile","plusle","minun","swablu","altaria","mega-altaria","mime-jr","togekiss","uxie","mesprit","azelf","cresselia","vanillite","vanillish","vanilluxe","flabebe","floette","florges","sylveon","carbink","xerneas","diancie","popplio","brionne","primarina","mimikyu","tapu-koko","tapu-lele","tapu-bulu","tapu-fini","hatenna","hattrem","hatterene","tinkatink","tinkatuff","tinkaton"],"ICE":["alolan-vulpix","alolan-ninetales","seel","dewgong","jynx","lapras","articuno","sneasel","swinub","piloswine","smoochum","suicune","castform-hail","snorunt","glalie","spheal","sealeo","walrein","regice","snover","abomasnow","mega-abomasnow","weavile","glaceon","mamoswine","froslass","vanillite","vanillish","vanilluxe","amaura","aurorus","snom","frosmoth"],"FOSSIL":["omanyte","omastar","kabuto","kabutops","aerodactyl","lileep","cradily","anorith","armaldo","clamperl","huntail","gorebyss","relicanth","cranidos","rampardos","shieldon","bastiodon","archen","archeops","amaura","aurorus","carbink","diancie"],"SOUND":["jigglypuff","wygglytuff","zubat","golbat","crobat","igglybuff","whismur","loudred","exploud","wailmer","wailord","swablu","altaria","mega-altaria","chatot","meloetta","flabebe","floette","florges","sylveon","noibat","noivern","popplio","brionne","primarina","jangmo-o","hakamo-o","kommo-o"],"ARTIFICIAL":["voltorb","electrode","electabuzz","porygon","mewtwo","porygon2","elekid","castform","castform-sun","castform-rain","castform-hail","beldum","metang","metagross","deoxys","electivire","porygon-z","vanillite","vanillish","vanilluxe","litwick","lampent","chandelure","genesect","honedge","doublade","aegislash"],"BABY":["pichu","cleffa","igglybuff","togepi","tyrogue","smoochum","elekid","magby","azurill","wynaut","budew","bonsley","mime-jr","happiny","munchlax","riolu"]} \ No newline at end of file diff --git a/app/models/precomputed/type-rarity-all.json b/app/models/precomputed/type-rarity-all.json index 91fb942136..06ee5ea834 100644 --- a/app/models/precomputed/type-rarity-all.json +++ b/app/models/precomputed/type-rarity-all.json @@ -1 +1 @@ -{"COMMON":["charmander","charmeleon","charizard","squirtle","wartortle","blastoise","caterpie","metapod","butterfree","weedle","kakuna","beedrill","pidgey","pidgeotto","pidgeot","pikachu","raichu","clefairy","clefable","zubat","golbat","poliwag","poliwhirl","poliwrath","tentacool","tentacruel","geodude","graveler","golem","seel","dewgong","grimer","alolan-grimer","muk","alolan_muk","voltorb","electrode","jynx","omanyte","omastar","crobat","pichu","cleffa","mareep","flaffy","ampharos","marill","azumarill","politoed","hoppip","skiploom","jumpluff","Wobbuffet","swinub","piloswine","smoochum","mudkip","marshtomp","swampert","poochyena","mightyena","seedot","nuzleaf","shiftry","azurill","aron","lairon","aggron","anorith","armaldo","wynaut","chimchar","monferno","infernape","starly","staravia","staraptor","mamoswine","litwick","lampent","chandelure","fennekin","braixen","delphox","pumpkaboo","gourgeist","noibat","noivern"],"UNCOMMON":["ekans","arbok","sandshrew","sandslash","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","jigglypuff","wygglytuff","venonat","venomoth","diglett","dugtrio","growlithe","arcanine","machop","machoke","machamp","bellsprout","weepinbell","victreebel","slowpoke","slowbro","magnemite","magneton","horsea","seadra","eevee","vaporeon","jolteon","flareon","chikorita","bayleef","meganium","cyndaquil","quilava","typlosion","hoothoot","noctowl","chinchou","lanturn","igglybuff","natu","xatu","espeon","umbreon","slowking","pineco","forretress","kingdra","treecko","grovyle","sceptile","torchic","combusken","blaziken","shroomish","breloom","carvanha","sharpedo","corphish","crawdaunt","duskull","dusclops","spheal","sealeo","walrein","piplup","prinplup","empoleon","cranidos","rampardos","magnezone","leafeon","glaceon","dusknoir","zorua","hisui-zorua","zoroark","hisui-zoroark","flabebe","floette","florges","sylveon","hatenna","hattrem","hatterene"],"RARE":["bulbasaur","ivysaur","venusaur","vulpix","alolan-vulpix","ninetales","alolan-ninetales","paras","parasect","meowth","persian","abra","kadabra","alakazam","rhyhorn","rhydon","mr-mime","magmar","kabuto","kabutops","dratini","dragonair","dragonite","totodile","croconaw","feraligatr","togepi","togetic","slugma","magcargo","magby","larvitar","pupitar","tyranitar","lotad","lombre","ludicolo","whismur","loudred","exploud","makuhita","hariyama","trapinch","vibrava","flygon","cacnea","cacturne","lileep","cradily","bagon","shelgon","salamence","turtwig","grotle","torterra","shinx","luxio","luxray","shieldon","bastiodon","drifloon","drifblim","bronzor","bronzong","mime-jr","croagunk","toxicroak","rhyperior","magmortar","togekiss","archen","archeops","vanillite","vanillish","vanilluxe","joltik","galvantula","honedge","doublade","aegislash","salandit","salazzle","snom","frosmoth"],"EPIC":["mankey","primeape","ponyta","rapidash","cubone","marowak","alolan-marowak","electabuzz","porygon","snorlax","sudowoodo","sunkern","sunflora","snubull","granbull","sneasel","houndour","houndoom","mega-houndoom","porygon2","elekid","wurmple","silcoon","beautifly","cascoon","dustox","ralts","kirlia","gardevoir","slakoth","vigoroth","slaking","roselia","wailmer","wailord","snorunt","glalie","clamperl","huntail","gorebyss","beldum","metang","metagross","budew","roserade","combee","vespiqueen","buizel","floatzel","bonsley","gible","gabite","garchomp","munchlax","weavile","electivire","porygon-z","froslass","oshawott","dewott","samurott","amaura","aurorus","carbink","goomy","sligoo","goodra","diancie","bounsweet","steenee","tsareena","jangmo-o","hakamo-o","kommo-o","applin","appletun","tinkatink","tinkatuff","tinkaton"],"LEGENDARY":["gastly","haunter","gengar","onix","chansey","scyther","steelix","mega-steelix","scizor","mega-scizor","blissey","nincada","ninjask","shedninja","meditite","medicham","mega-medicham","electrike","manectric","mega-manectric","numel","camerupt","mega-camerupt","swablu","altaria","mega-altaria","shuppet","banette","mega-banette","buneary","lopunny","mega-lopunny","happiny","riolu","lucario","mega-lucario","snover","abomasnow","mega-abomasnow","solosis","duosion","reuniclus"],"MYTHICAL":["farfetch-d","hitmonlee","hitmonchan","pinsir","tauros","lapras","aerodactyl","articuno","zapdos","moltres","mewtwo","mew","shuckle","tyrogue","hitmontop","miltank","raikou","entei","suicune","lugia","ho-Oh","celebi","mawile","plusle","minun","seviper","lunatone","solrock","castform","castform-sun","castform-rain","castform-hail","kecleon","absol","relicanth","regirock","regice","registeel","latias","latios","kyogre","primal-Kyogre","groudon","primal-Groudon","rayquaza","mega-Rayquaza","jirachi","deoxys","chatot","spiritomb","rotom","uxie","mesprit","azelf","dialga","palkia","heatran","regigigas","giratina","origin-giratina","cresselia","phione","manaphy","darkrai","shaymin","shaymin-sky","arceus","victini","maractus","volcarona","cobalion","virizion","tornadus","thundurus","reshiram","zekrom","landorus","kyurem","keldeo","meloetta","genesect","xerneas","yveltal","volcanion","mimikyu","tapu-koko","tapu-lele","tapu-bulu","tapu-fini","guzzlord","marshadow","stakataka","blacephalon","zeraora","eternatus","regieleki","regidrago"],"SPECIAL":["Egg","rattata","raticate","spearow","fearow","oddish","gloom","vileplume","magikarp","gyarados","ditto","bellossom"],"HATCH":["alolan-geodude","alolan-graveler","alolan-golem","snivy","servine","serperior","tepig","pignite","emboar","gothita","gothorita","gothitelle","froakie","frogadier","greninja","rowlet","dartix","decidueye","popplio","brionne","primarina","scorbunny","raboot","cinderace","dreepy","drakloak","dragapult"]} \ No newline at end of file +{"COMMON":["charmander","charmeleon","charizard","squirtle","wartortle","blastoise","caterpie","metapod","butterfree","weedle","kakuna","beedrill","pidgey","pidgeotto","pidgeot","pikachu","raichu","clefairy","clefable","zubat","golbat","poliwag","poliwhirl","poliwrath","tentacool","tentacruel","geodude","graveler","golem","seel","dewgong","grimer","alolan-grimer","muk","alolan_muk","voltorb","electrode","jynx","omanyte","omastar","crobat","pichu","cleffa","mareep","flaffy","ampharos","marill","azumarill","politoed","hoppip","skiploom","jumpluff","Wobbuffet","swinub","piloswine","smoochum","mudkip","marshtomp","swampert","poochyena","mightyena","seedot","nuzleaf","shiftry","azurill","aron","lairon","aggron","anorith","armaldo","wynaut","chimchar","monferno","infernape","starly","staravia","staraptor","mamoswine","litwick","lampent","chandelure","fennekin","braixen","delphox","pumpkaboo","gourgeist","noibat","noivern"],"UNCOMMON":["ekans","arbok","sandshrew","sandslash","nidoranF","nidorina","nidoqueen","nidoranM","nidorino","nidoking","jigglypuff","wygglytuff","venonat","venomoth","diglett","dugtrio","growlithe","arcanine","machop","machoke","machamp","bellsprout","weepinbell","victreebel","slowpoke","slowbro","magnemite","magneton","horsea","seadra","eevee","vaporeon","jolteon","flareon","chikorita","bayleef","meganium","cyndaquil","quilava","typlosion","hoothoot","noctowl","chinchou","lanturn","igglybuff","natu","xatu","espeon","umbreon","slowking","pineco","forretress","kingdra","treecko","grovyle","sceptile","torchic","combusken","blaziken","shroomish","breloom","carvanha","sharpedo","corphish","crawdaunt","duskull","dusclops","spheal","sealeo","walrein","piplup","prinplup","empoleon","cranidos","rampardos","magnezone","leafeon","glaceon","dusknoir","zorua","hisui-zorua","zoroark","hisui-zoroark","flabebe","floette","florges","sylveon","hatenna","hattrem","hatterene"],"RARE":["bulbasaur","ivysaur","venusaur","vulpix","alolan-vulpix","ninetales","alolan-ninetales","paras","parasect","meowth","persian","abra","kadabra","alakazam","rhyhorn","rhydon","mr-mime","magmar","kabuto","kabutops","dratini","dragonair","dragonite","totodile","croconaw","feraligatr","togepi","togetic","slugma","magcargo","magby","larvitar","pupitar","tyranitar","lotad","lombre","ludicolo","whismur","loudred","exploud","makuhita","hariyama","trapinch","vibrava","flygon","cacnea","cacturne","lileep","cradily","bagon","shelgon","salamence","turtwig","grotle","torterra","shinx","luxio","luxray","shieldon","bastiodon","drifloon","drifblim","bronzor","bronzong","mime-jr","gible","gabite","garchomp","croagunk","toxicroak","rhyperior","magmortar","togekiss","archen","archeops","vanillite","vanillish","vanilluxe","joltik","galvantula","honedge","doublade","aegislash","salandit","salazzle","snom","frosmoth"],"EPIC":["mankey","primeape","ponyta","rapidash","cubone","marowak","alolan-marowak","electabuzz","porygon","snorlax","sudowoodo","sunkern","sunflora","snubull","granbull","sneasel","houndour","houndoom","mega-houndoom","porygon2","elekid","wurmple","silcoon","beautifly","cascoon","dustox","ralts","kirlia","gardevoir","slakoth","vigoroth","slaking","roselia","wailmer","wailord","snorunt","glalie","clamperl","huntail","gorebyss","beldum","metang","metagross","budew","roserade","combee","vespiqueen","buizel","floatzel","bonsley","munchlax","weavile","electivire","porygon-z","froslass","oshawott","dewott","samurott","amaura","aurorus","carbink","goomy","sligoo","goodra","diancie","bounsweet","steenee","tsareena","jangmo-o","hakamo-o","kommo-o","applin","appletun","tinkatink","tinkatuff","tinkaton"],"LEGENDARY":["gastly","haunter","gengar","onix","chansey","scyther","steelix","mega-steelix","scizor","mega-scizor","blissey","nincada","ninjask","shedninja","meditite","medicham","mega-medicham","electrike","manectric","mega-manectric","numel","camerupt","mega-camerupt","swablu","altaria","mega-altaria","shuppet","banette","mega-banette","buneary","lopunny","mega-lopunny","happiny","riolu","lucario","mega-lucario","snover","abomasnow","mega-abomasnow","solosis","duosion","reuniclus"],"MYTHICAL":["farfetch-d","hitmonlee","hitmonchan","pinsir","tauros","lapras","aerodactyl","articuno","zapdos","moltres","mewtwo","mew","shuckle","tyrogue","hitmontop","miltank","raikou","entei","suicune","lugia","ho-Oh","celebi","mawile","plusle","minun","seviper","lunatone","solrock","castform","castform-sun","castform-rain","castform-hail","kecleon","absol","relicanth","regirock","regice","registeel","latias","latios","kyogre","primal-Kyogre","groudon","primal-Groudon","rayquaza","mega-Rayquaza","jirachi","deoxys","chatot","spiritomb","rotom","uxie","mesprit","azelf","dialga","palkia","heatran","regigigas","giratina","origin-giratina","cresselia","phione","manaphy","darkrai","shaymin","shaymin-sky","arceus","victini","maractus","volcarona","cobalion","virizion","tornadus","thundurus","reshiram","zekrom","landorus","kyurem","keldeo","meloetta","genesect","xerneas","yveltal","volcanion","mimikyu","tapu-koko","tapu-lele","tapu-bulu","tapu-fini","guzzlord","marshadow","stakataka","blacephalon","zeraora","eternatus","regieleki","regidrago"],"SPECIAL":["Egg","rattata","raticate","spearow","fearow","oddish","gloom","vileplume","magikarp","gyarados","ditto","bellossom","unown-a","unown-b","unown-c","unown-d","unown-e","unown-f","unown-g","unown-h","unown-i","unown-j","unown-k","unown-l","unown-m","unown-n","unown-o","unown-p","unown-q","unown-r","unown-s","unown-t","unown-u","unown-v","unown-w","unown-x","unown-y","unown-z","unown-exclamation","unown-question"],"HATCH":["alolan-geodude","alolan-graveler","alolan-golem","snivy","servine","serperior","tepig","pignite","emboar","gothita","gothorita","gothitelle","froakie","frogadier","greninja","rowlet","dartix","decidueye","popplio","brionne","primarina","scorbunny","raboot","cinderace","dreepy","drakloak","dragapult"]} \ No newline at end of file diff --git a/app/models/shop.ts b/app/models/shop.ts index 710f027177..c475a48ff0 100644 --- a/app/models/shop.ts +++ b/app/models/shop.ts @@ -1,5 +1,11 @@ import PokemonFactory from "./pokemon-factory" -import { Pkm, PkmDuos, PkmFamily, PkmProposition } from "../types/enum/Pokemon" +import { + Pkm, + PkmDuos, + PkmFamily, + PkmProposition, + Unowns +} from "../types/enum/Pokemon" import Player from "./colyseus-models/player" import { RarityProbabilityPerLevel, @@ -13,12 +19,14 @@ import { FishRarityProbability } from "../types/Config" import { Rarity } from "../types/enum/Game" -import { pickRandomIn, shuffleArray } from "../utils/random" +import { chance, pickRandomIn, shuffleArray } from "../utils/random" import { clamp } from "../utils/number" import { removeInArray } from "../utils/array" import { Pokemon } from "./colyseus-models/pokemon" import { logger } from "../utils/logger" import { Synergy } from "../types/enum/Synergy" +import { IPlayer } from "../types" +import { Effect } from "../types/enum/Effect" export function getPoolSize(rarity: Rarity, maxStars: number): number { return PoolSize[rarity][clamp(maxStars, 1, 3) - 1] @@ -120,11 +128,17 @@ export default class Shop { } } - assignShop(player: Player) { + assignShop(player: Player, manualRefresh: boolean) { player.shop.forEach((pkm) => this.releasePokemon(pkm)) - for (let i = 0; i < 6; i++) { - player.shop[i] = this.pickPokemon(player) + if (player.effects.list.includes(Effect.EERIE_SPELL) && !manualRefresh) { + for (let i = 0; i < 6; i++) { + player.shop[i] = pickRandomIn(Unowns) + } + } else { + for (let i = 0; i < 6; i++) { + player.shop[i] = this.pickPokemon(player) + } } } @@ -211,16 +225,23 @@ export default class Shop { pickPokemon(player: Player): Pkm { const rarityProbability = RarityProbabilityPerLevel[player.experienceManager.level] - const ditto_seed = Math.random() const rarity_seed = Math.random() let pokemon = Pkm.MAGIKARP let threshold = 0 const finals = new Array() - if (ditto_seed < DITTO_RATE) { + if (chance(DITTO_RATE)) { return Pkm.DITTO } + const UNOWN_RATE = 0.05 + if ( + player.effects.list.includes(Effect.LIGHT_SCREEN) && + chance(UNOWN_RATE) + ) { + return pickRandomIn(Unowns) + } + player.board.forEach((pokemon: Pokemon) => { if (pokemon.final) { finals.push(PkmFamily[pokemon.name]) @@ -259,7 +280,7 @@ export default class Shop { return pokemon } - fishPokemon(player: Player, fishingLevel: number): Pkm { + fishPokemon(player: IPlayer, fishingLevel: number): Pkm { const rarityProbability = FishRarityProbability[fishingLevel] const rarity_seed = Math.random() let fish: Pkm = Pkm.MAGIKARP diff --git a/app/public/src/game/components/battle-manager.ts b/app/public/src/game/components/battle-manager.ts index 562c5a64f4..ebce059bc9 100644 --- a/app/public/src/game/components/battle-manager.ts +++ b/app/public/src/game/components/battle-manager.ts @@ -3484,6 +3484,37 @@ export default class BattleManager { break } + case Ability.HIDDEN_POWER_A: + case Ability.HIDDEN_POWER_B: + case Ability.HIDDEN_POWER_C: + case Ability.HIDDEN_POWER_D: + case Ability.HIDDEN_POWER_E: + case Ability.HIDDEN_POWER_F: + case Ability.HIDDEN_POWER_G: + case Ability.HIDDEN_POWER_H: + case Ability.HIDDEN_POWER_I: + case Ability.HIDDEN_POWER_J: + case Ability.HIDDEN_POWER_K: + case Ability.HIDDEN_POWER_L: + case Ability.HIDDEN_POWER_M: + case Ability.HIDDEN_POWER_N: + case Ability.HIDDEN_POWER_O: + case Ability.HIDDEN_POWER_P: + case Ability.HIDDEN_POWER_Q: + case Ability.HIDDEN_POWER_R: + case Ability.HIDDEN_POWER_S: + case Ability.HIDDEN_POWER_T: + case Ability.HIDDEN_POWER_U: + case Ability.HIDDEN_POWER_V: + case Ability.HIDDEN_POWER_W: + case Ability.HIDDEN_POWER_X: + case Ability.HIDDEN_POWER_Y: + case Ability.HIDDEN_POWER_Z: + case Ability.HIDDEN_POWER_QM: + case Ability.HIDDEN_POWER_EM: + this.scene.unownManager?.hiddenPowerAnimation(skill, positionX, positionY) + break + default: break } diff --git a/app/public/src/game/components/unown-manager.ts b/app/public/src/game/components/unown-manager.ts index a4af1ba2cc..6ef9e9ddc3 100644 --- a/app/public/src/game/components/unown-manager.ts +++ b/app/public/src/game/components/unown-manager.ts @@ -2,13 +2,14 @@ import { GameObjects } from "phaser" import PokemonFactory from "../../../../models/pokemon-factory" import { Transfer } from "../../../../types" import { PokemonActionState } from "../../../../types/enum/Game" -import { PkmFamily, Pkm } from "../../../../types/enum/Pokemon" +import { Pkm, Unowns } from "../../../../types/enum/Pokemon" import { pickRandomIn, coinflip } from "../../../../utils/random" import { getGameContainer } from "../../pages/game" import AnimationManager from "../animation-manager" import GameScene from "../scenes/game-scene" import Pokemon from "./pokemon" -import { AnimationType } from "../../../../types/Animation" +import { Ability } from "../../../../types/enum/Ability" +import { transformAttackCoordinate } from "../../pages/utils/utils" const SHARDS_PER_ENCOUNTER = 50 @@ -28,9 +29,6 @@ export default class UnownManager { } addWanderingUnown() { - const unowns = (Object.keys(PkmFamily) as Pkm[]).filter( - (pkm) => PkmFamily[pkm] === Pkm.UNOWN_A - ) const [startX, endX] = coinflip() ? [-100, +window.innerWidth + 100] : [+window.innerWidth + 100, -100] @@ -43,7 +41,7 @@ export default class UnownManager { this.scene, startX, startY, - PokemonFactory.createPokemonFromName(pickRandomIn(unowns)), + PokemonFactory.createPokemonFromName(pickRandomIn(Unowns)), "unown", false ) @@ -126,4 +124,174 @@ export default class UnownManager { } }) } + + hiddenPowerAnimation(skill: Ability, originX: number, originY: number) { + const [x, y] = transformAttackCoordinate(originX, originY) + const unownsGroup = this.scene.add.group() + const letters = UNOWNS_PER_ABILITY.get(skill) + for (let n = 0; n < 8; n++) { + letters?.forEach((letter, i) => { + const unown = new Pokemon( + this.scene, + x, + y, + PokemonFactory.createPokemonFromName(letter), + "unown", + false + ) + unown.draggable = false + unownsGroup.add(unown) + this.animationManager.animatePokemon(unown, PokemonActionState.IDLE) + }) + } + + const circle = new Phaser.Geom.Circle(x, y, 10) + Phaser.Actions.PlaceOnCircle(unownsGroup.getChildren(), circle) + + this.scene.tweens.add({ + targets: circle, + radius: 500, + ease: Phaser.Math.Easing.Quartic.Out, + duration: 2500, + onUpdate: function (tween) { + Phaser.Actions.RotateAroundDistance( + unownsGroup.getChildren(), + { x, y }, + -0.02 * (1 - tween.progress), + circle.radius + ) + if (tween.progress > 0.8) { + unownsGroup.setAlpha((1 - tween.progress) * 5) + } + }, + onComplete() { + unownsGroup.destroy(true, true) + } + }) + } } + +const UNOWNS_PER_ABILITY = new Map([ + [ + Ability.HIDDEN_POWER_A, + [Pkm.UNOWN_A, Pkm.UNOWN_B, Pkm.UNOWN_R, Pkm.UNOWN_A] + ], + [ + Ability.HIDDEN_POWER_B, + [Pkm.UNOWN_B, Pkm.UNOWN_U, Pkm.UNOWN_R, Pkm.UNOWN_N] + ], + [ + Ability.HIDDEN_POWER_C, + [Pkm.UNOWN_C, Pkm.UNOWN_O, Pkm.UNOWN_I, Pkm.UNOWN_N] + ], + [ + Ability.HIDDEN_POWER_D, + [Pkm.UNOWN_D, Pkm.UNOWN_I, Pkm.UNOWN_T, Pkm.UNOWN_O] + ], + [ + Ability.HIDDEN_POWER_E, + [Pkm.UNOWN_E, Pkm.UNOWN_G, Pkm.UNOWN_G, Pkm.UNOWN_S] + ], + [ + Ability.HIDDEN_POWER_F, + [Pkm.UNOWN_F, Pkm.UNOWN_I, Pkm.UNOWN_S, Pkm.UNOWN_H] + ], + [ + Ability.HIDDEN_POWER_G, + [Pkm.UNOWN_G, Pkm.UNOWN_O, Pkm.UNOWN_L, Pkm.UNOWN_D] + ], + [ + Ability.HIDDEN_POWER_H, + [Pkm.UNOWN_H, Pkm.UNOWN_E, Pkm.UNOWN_A, Pkm.UNOWN_L] + ], + [ + Ability.HIDDEN_POWER_I, + [Pkm.UNOWN_I, Pkm.UNOWN_T, Pkm.UNOWN_E, Pkm.UNOWN_M] + ], + [ + Ability.HIDDEN_POWER_J, + [Pkm.UNOWN_J, Pkm.UNOWN_A, Pkm.UNOWN_W, Pkm.UNOWN_S] + ], + [ + Ability.HIDDEN_POWER_K, + [Pkm.UNOWN_K, Pkm.UNOWN_I, Pkm.UNOWN_C, Pkm.UNOWN_K] + ], + [ + Ability.HIDDEN_POWER_L, + [Pkm.UNOWN_L, Pkm.UNOWN_I, Pkm.UNOWN_F, Pkm.UNOWN_E] + ], + [ + Ability.HIDDEN_POWER_M, + [Pkm.UNOWN_M, Pkm.UNOWN_A, Pkm.UNOWN_N, Pkm.UNOWN_A] + ], + [ + Ability.HIDDEN_POWER_N, + [Pkm.UNOWN_N, Pkm.UNOWN_U, Pkm.UNOWN_K, Pkm.UNOWN_E] + ], + [ + Ability.HIDDEN_POWER_O, + [Pkm.UNOWN_O, Pkm.UNOWN_N, Pkm.UNOWN_I, Pkm.UNOWN_X] + ], + [ + Ability.HIDDEN_POWER_P, + [Pkm.UNOWN_P, Pkm.UNOWN_E, Pkm.UNOWN_S, Pkm.UNOWN_T] + ], + [ + Ability.HIDDEN_POWER_Q, + [Pkm.UNOWN_Q, Pkm.UNOWN_U, Pkm.UNOWN_I, Pkm.UNOWN_T] + ], + [ + Ability.HIDDEN_POWER_R, + [Pkm.UNOWN_R, Pkm.UNOWN_O, Pkm.UNOWN_C, Pkm.UNOWN_K] + ], + [ + Ability.HIDDEN_POWER_S, + [Pkm.UNOWN_S, Pkm.UNOWN_T, Pkm.UNOWN_O, Pkm.UNOWN_P] + ], + [ + Ability.HIDDEN_POWER_T, + [Pkm.UNOWN_T, Pkm.UNOWN_A, Pkm.UNOWN_N, Pkm.UNOWN_K] + ], + [ + Ability.HIDDEN_POWER_U, + [Pkm.UNOWN_U, Pkm.UNOWN_X, Pkm.UNOWN_I, Pkm.UNOWN_E] + ], + [ + Ability.HIDDEN_POWER_V, + [Pkm.UNOWN_V, Pkm.UNOWN_O, Pkm.UNOWN_L, Pkm.UNOWN_T] + ], + [ + Ability.HIDDEN_POWER_W, + [Pkm.UNOWN_W, Pkm.UNOWN_I, Pkm.UNOWN_S, Pkm.UNOWN_H] + ], + [ + Ability.HIDDEN_POWER_X, + [Pkm.UNOWN_X, Pkm.UNOWN_R, Pkm.UNOWN_A, Pkm.UNOWN_Y] + ], + [ + Ability.HIDDEN_POWER_Y, + [Pkm.UNOWN_Y, Pkm.UNOWN_O, Pkm.UNOWN_G, Pkm.UNOWN_A] + ], + [ + Ability.HIDDEN_POWER_Z, + [Pkm.UNOWN_Z, Pkm.UNOWN_Z, Pkm.UNOWN_Z, Pkm.UNOWN_Z] + ], + [ + Ability.HIDDEN_POWER_EM, + [ + Pkm.UNOWN_EXCLAMATION, + Pkm.UNOWN_EXCLAMATION, + Pkm.UNOWN_EXCLAMATION, + Pkm.UNOWN_EXCLAMATION + ] + ], + [ + Ability.HIDDEN_POWER_QM, + [ + Pkm.UNOWN_QUESTION, + Pkm.UNOWN_QUESTION, + Pkm.UNOWN_QUESTION, + Pkm.UNOWN_QUESTION + ] + ] +]) diff --git a/app/public/src/pages/component/collection/pokemon-carousel.tsx b/app/public/src/pages/component/collection/pokemon-carousel.tsx index 724331df7d..e813a776b3 100644 --- a/app/public/src/pages/component/collection/pokemon-carousel.tsx +++ b/app/public/src/pages/component/collection/pokemon-carousel.tsx @@ -7,6 +7,7 @@ import { Ability } from "../../../../../types/enum/Ability" import { Synergy } from "../../../../../types/enum/Synergy" import { Pkm } from "../../../../../types/enum/Pokemon" import { Pokemon } from "../../../../../models/colyseus-models/pokemon" +import { Passive } from "../../../../../types/enum/Passive" export default function PokemonCarousel(props: { type: Synergy | "all" @@ -27,6 +28,7 @@ export default function PokemonCarousel(props: { if ( v !== Pkm.DEFAULT && pkm.skill !== Ability.DEFAULT && + pkm.passive !== Passive.UNOWN && (props.type === "all" || pkm.types.includes(Synergy[props.type])) ) { filteredCollection.push(pkm) diff --git a/app/public/src/pages/component/collection/unown-panel.tsx b/app/public/src/pages/component/collection/unown-panel.tsx index 9043a66760..f294a45453 100644 --- a/app/public/src/pages/component/collection/unown-panel.tsx +++ b/app/public/src/pages/component/collection/unown-panel.tsx @@ -1,7 +1,7 @@ import PokemonCollectionItem from "./pokemon-collection-item" import React, { Dispatch, SetStateAction } from "react" import { ITracker } from "../../../../../types/ITracker" -import { Pkm, PkmIndex, PkmFamily } from "../../../../../types/enum/Pokemon" +import { Pkm, PkmIndex, Unowns } from "../../../../../types/enum/Pokemon" import { useAppSelector } from "../../../hooks" import "./unown-panel.css" import { Emotion } from "../../../../../types/enum/Emotion" @@ -24,29 +24,27 @@ export default function UnownPanel(props: { .replace(/\s+$/gm, "") .split("") - const unowns = (Object.keys(PkmFamily) as Pkm[]) - .filter((pkm) => PkmFamily[pkm] === Pkm.UNOWN_A) - .flatMap((pkm: Pkm) => { - const pathIndex = PkmIndex[pkm].split("-") - let metadata: ITracker | undefined = undefined - if (pathIndex.length == 1) { - metadata = props.metadata[PkmIndex[pkm]] - } else if (pathIndex.length == 2) { - metadata = props.metadata[pathIndex[0]].subgroups[pathIndex[1]] + const unowns = Unowns.flatMap((pkm: Pkm) => { + const pathIndex = PkmIndex[pkm].split("-") + let metadata: ITracker | undefined = undefined + if (pathIndex.length == 1) { + metadata = props.metadata[PkmIndex[pkm]] + } else if (pathIndex.length == 2) { + metadata = props.metadata[pathIndex[0]].subgroups[pathIndex[1]] + } + if (metadata) { + const config = pokemonCollection.find((p) => p.id === PkmIndex[pkm]) + const { emotions, shinyEmotions } = config ?? { + dust: 0, + emotions: [] as Emotion[], + shinyEmotions: [] as Emotion[] } - if (metadata) { - const config = pokemonCollection.find((p) => p.id === PkmIndex[pkm]) - const { emotions, shinyEmotions } = config ?? { - dust: 0, - emotions: [] as Emotion[], - shinyEmotions: [] as Emotion[] - } - const isUnlocked = emotions?.length > 0 || shinyEmotions?.length > 0 - return [{ pkm, metadata, config, isUnlocked }] - } else { - return [] - } - }) + const isUnlocked = emotions?.length > 0 || shinyEmotions?.length > 0 + return [{ pkm, metadata, config, isUnlocked }] + } else { + return [] + } + }) return (
diff --git a/app/public/src/pages/component/game/game-pokemon-portrait.tsx b/app/public/src/pages/component/game/game-pokemon-portrait.tsx index db79c534f9..d28e85f4d3 100644 --- a/app/public/src/pages/component/game/game-pokemon-portrait.tsx +++ b/app/public/src/pages/component/game/game-pokemon-portrait.tsx @@ -2,7 +2,7 @@ import React from "react" import ReactTooltip from "react-tooltip" import { Pokemon } from "../../../../../models/colyseus-models/pokemon" import { IPokemonConfig } from "../../../../../models/mongo-models/user-metadata" -import { PkmCost, RarityColor } from "../../../../../types/Config" +import { RarityColor } from "../../../../../types/Config" import { getPortraitSrc } from "../../../utils" import { GamePokemonDetail } from "./game-pokemon-detail" import SynergyIcon from "../icons/synergy-icon" @@ -27,7 +27,9 @@ export default function GamePokemonPortrait(props: { const pokemonCollection = useAppSelector( (state) => state.game.pokemonCollection ) - const pokemonConfig: IPokemonConfig | undefined = pokemonCollection.get(props.pokemon.index) + const pokemonConfig: IPokemonConfig | undefined = pokemonCollection.get( + props.pokemon.index + ) const uid: string = useAppSelector((state) => state.network.uid) const currentPlayerId: string = useAppSelector( @@ -63,8 +65,13 @@ export default function GamePokemonPortrait(props: { if (count === 2 && countEvol === 2 && pokemonEvolution2 != null) pokemonEvolution = pokemonEvolution2 - const pokemonInPortrait = (willEvolve && pokemonEvolution) ? PokemonFactory.createPokemonFromName(pokemonEvolution) : props.pokemon - const pokemonInPortraitConfig = pokemonCollection.get(pokemonInPortrait.index) + const pokemonInPortrait = + willEvolve && pokemonEvolution + ? PokemonFactory.createPokemonFromName(pokemonEvolution) + : props.pokemon + const pokemonInPortraitConfig = pokemonCollection.get( + pokemonInPortrait.index + ) return (
)} - {props.origin === "shop" &&
- -
} + {props.origin === "shop" && ( +
+ +
+ )}
    {props.pokemon.types.map((type) => { return ( diff --git a/app/rooms/commands/game-commands.ts b/app/rooms/commands/game-commands.ts index efee4b6235..168582f256 100644 --- a/app/rooms/commands/game-commands.ts +++ b/app/rooms/commands/game-commands.ts @@ -20,7 +20,7 @@ import UserMetadata from "../../models/mongo-models/user-metadata" import GameRoom from "../game-room" import { Client, updateLobby } from "colyseus" import { Effect } from "../../types/enum/Effect" -import { Title, FIGHTING_PHASE_DURATION, Emotion } from "../../types" +import { Title, FIGHTING_PHASE_DURATION, Emotion, IPlayer } from "../../types" import { MapSchema } from "@colyseus/schema" import { GamePhaseState, @@ -64,8 +64,9 @@ export class OnShopCommand extends Command< name, player.pokemonCollection.get(PkmIndex[name]) ) + const cost = PokemonFactory.getBuyPrice(name) if ( - player.money >= pokemon.cost && + player.money >= cost && (this.room.getBenchSize(player.board) < 8 || (this.room.getPossibleEvolution(player.board, pokemon.name) && this.room.getBenchSize(player.board) == 8)) @@ -79,7 +80,7 @@ export class OnShopCommand extends Command< }) } if (allowBuy) { - player.money -= pokemon.cost + player.money -= cost if ( pokemon.passive === Passive.PROTEAN2 || pokemon.passive === Passive.PROTEAN3 @@ -93,7 +94,12 @@ export class OnShopCommand extends Command< player.board.set(pokemon.id, pokemon) if (pokemon.rarity == Rarity.MYTHICAL) { - this.state.shop.assignShop(player) + this.state.shop.assignShop(player, false) + } else if ( + pokemon.passive === Passive.UNOWN && + player.effects.list.includes(Effect.EERIE_SPELL) + ) { + this.state.shop.assignShop(player, true) } else { player.shop[index] = Pkm.DEFAULT } @@ -411,7 +417,7 @@ export class OnDragDropItemCommand extends Command< const pokemon = player.getPokemonAt(x, y) - if (pokemon === undefined) { + if (pokemon === undefined || !pokemon.canHoldItems) { client.send(Transfer.DRAG_DROP_FAILED, message) return } @@ -500,9 +506,6 @@ export class OnDragDropItemCommand extends Command< break } break - case Pkm.DITTO: - client.send(Transfer.DRAG_DROP_FAILED, message) - break case Pkm.PHIONE: if (item == Item.AQUA_EGG) { @@ -697,7 +700,7 @@ export class OnRefreshCommand extends Command< execute(id) { const player = this.state.players.get(id) if (player && player.money >= 1 && player.alive) { - this.state.shop.assignShop(player) + this.state.shop.assignShop(player, true) player.money -= 1 player.rerollCount++ } @@ -770,7 +773,7 @@ export class OnJoinCommand extends Command< ) } - this.state.shop.assignShop(player) + this.state.shop.assignShop(player, false) if (this.state.players.size >= MAX_PLAYERS_PER_LOBBY) { let nbHumanPlayers = 0 this.state.players.forEach((p) => { @@ -1209,6 +1212,8 @@ export class OnUpdatePhaseCommand extends Command { } const isPVE = this.checkForPVE() + const commands = new Array() + this.state.players.forEach((player: Player) => { if ( this.room.getBenchSize(player.board) < 8 && @@ -1235,6 +1240,8 @@ export class OnUpdatePhaseCommand extends Command { }, 1000) } }) + + return commands } checkForLazyTeam() { @@ -1383,7 +1390,7 @@ export class OnUpdatePhaseCommand extends Command { if (!player.isBot) { if (!player.shopLocked) { - this.state.shop.assignShop(player) + this.state.shop.assignShop(player, false) } else { this.state.shop.refillShop(player) player.shopLocked = false @@ -1419,6 +1426,14 @@ export class OnUpdatePhaseCommand extends Command { } } } + if (pokemon.passive === Passive.UNOWN && !pokemon.isOnBench) { + // remove after one fight + player.board.delete(key) + player.board.delete(pokemon.id) + player.synergies.update(player.board) + player.effects.update(player.synergies, player.board) + this.state.shop.assignShop(player, false) // refresh unown shop in case player lost psychic 6 + } }) // Refreshes effects (like tapu Terrains) player.synergies.update(player.board) diff --git a/app/rooms/commands/lobby-commands.ts b/app/rooms/commands/lobby-commands.ts index 5e339fff0b..43859c0982 100644 --- a/app/rooms/commands/lobby-commands.ts +++ b/app/rooms/commands/lobby-commands.ts @@ -23,7 +23,7 @@ import { CDN_PORTRAIT_URL } from "../../types" import CustomLobbyRoom from "../custom-lobby-room" -import { Pkm, PkmFamily, PkmIndex } from "../../types/enum/Pokemon" +import { Pkm, PkmIndex, Unowns } from "../../types/enum/Pokemon" import PokemonConfig from "../../models/colyseus-models/pokemon-config" import PRECOMPUTED_RARITY_POKEMONS from "../../models/precomputed/type-rarity-all.json" import { BoosterRarityProbability, getEmotionCost } from "../../types/Config" @@ -274,7 +274,7 @@ export class OnNewMessageCommand extends Command< try { const MAX_MESSAGE_LENGTH = 250 message = cleanProfanity(message.substring(0, MAX_MESSAGE_LENGTH)) - + const user = this.state.users.get(client.auth.uid) if (user && !user.anonymous && message != "") { this.state.addMessage( @@ -607,12 +607,9 @@ export class BuyEmotionCommand extends Command< u.titles.push(Title.DUCHESS) } - const unowns = (Object.keys(PkmFamily) as Pkm[]).filter( - (pkm) => PkmFamily[pkm] === Pkm.UNOWN_A - ) if ( !u.titles.includes(Title.ARCHEOLOGIST) && - unowns.every((name) => { + Unowns.every((name) => { const index = PkmIndex[name] const collection = u.pokemonCollection.get(index) const isUnlocked = @@ -918,7 +915,10 @@ export class AddBotCommand extends Command< } this.room.bots.set(resultCreate.id, resultCreate) - this.room.broadcast(Transfer.REQUEST_BOT_LIST, createBotList(this.room.bots)) + this.room.broadcast( + Transfer.REQUEST_BOT_LIST, + createBotList(this.room.bots) + ) } else { client.send( Transfer.BOT_DATABASE_LOG, @@ -978,7 +978,10 @@ export class DeleteBotCommand extends Command< } this.room.bots.delete(id) - this.room.broadcast(Transfer.REQUEST_BOT_LIST, createBotList(this.room.bots)) + this.room.broadcast( + Transfer.REQUEST_BOT_LIST, + createBotList(this.room.bots) + ) } } catch (error) { logger.error(error) @@ -1048,4 +1051,4 @@ export class OnBotUploadCommand extends Command< logger.error(error) } } -} \ No newline at end of file +} diff --git a/app/rooms/commands/preparation-commands.ts b/app/rooms/commands/preparation-commands.ts index 9f95cd7f99..c081d068c5 100644 --- a/app/rooms/commands/preparation-commands.ts +++ b/app/rooms/commands/preparation-commands.ts @@ -223,7 +223,10 @@ export class OnRoomNameCommand extends Command< > { execute({ client, message }) { try { - if (client.auth.uid == this.state.ownerId && this.state.name != message) { + if ( + client.auth?.uid == this.state.ownerId && + this.state.name != message + ) { this.room.setName(message) this.state.name = message } @@ -243,7 +246,7 @@ export class OnRoomPasswordCommand extends Command< execute({ client, message: password }) { try { if ( - client.auth.uid == this.state.ownerId && + client.auth?.uid == this.state.ownerId && this.state.password != password ) { this.room.setPassword(password) @@ -264,7 +267,10 @@ export class OnToggleEloCommand extends Command< > { execute({ client, message: noElo }) { try { - if (client.auth.uid === this.state.ownerId && this.state.noElo != noElo) { + if ( + client.auth?.uid === this.state.ownerId && + this.state.noElo != noElo + ) { this.state.noElo = noElo this.room.toggleElo(noElo) this.room.broadcast(Transfer.MESSAGES, { @@ -291,11 +297,13 @@ export class OnKickPlayerCommand extends Command< > { execute({ client, message: userId }) { try { - const user = this.state.users.get(client.auth.uid) - if (client.auth.uid === this.state.ownerId - || (user && [Role.ADMIN, Role.MODERATOR].includes(user.role))) { + const user = this.state.users.get(client.auth?.uid) + if ( + client.auth?.uid === this.state.ownerId || + (user && [Role.ADMIN, Role.MODERATOR].includes(user.role)) + ) { this.room.clients.forEach((cli) => { - if (cli.auth.uid === userId && this.state.users.has(userId)) { + if (cli.auth?.uid === userId && this.state.users.has(userId)) { const user = this.state.users.get(userId)! if (user.role === Role.BASIC) { this.room.broadcast(Transfer.MESSAGES, { @@ -331,9 +339,13 @@ export class OnDeleteRoomCommand extends Command< > { execute({ client }) { try { - const user = this.state.users.get(client.auth.uid) - if (user && [Role.ADMIN, Role.MODERATOR].includes(user.role)) { - this.room.clients.forEach(cli => { + const user = this.state.users.get(client.auth?.uid) + if (user && [Role.ADMIN, Role.MODERATOR].includes(user.role)) { + this.room.clients.forEach((cli) => { + cli.send(Transfer.KICK) + cli.leave() + }) + this.room.clients.forEach((cli) => { cli.send(Transfer.KICK) cli.leave() }) @@ -355,7 +367,7 @@ export class OnLeaveCommand extends Command< execute({ client, consented }) { try { if (client.auth?.uid) { - const user = this.state.users.get(client.auth.uid) + const user = this.state.users.get(client.auth?.uid) if (user) { this.room.broadcast(Transfer.MESSAGES, { name: "Server", @@ -397,7 +409,7 @@ export class OnToggleReadyCommand extends Command< execute({ client }) { try { // logger.debug(this.state.users.get(client.auth.uid).ready); - if (client.auth.uid && this.state.users.has(client.auth.uid)) { + if (client.auth?.uid && this.state.users.has(client.auth.uid)) { const user = this.state.users.get(client.auth.uid)! user.ready = !user.ready } @@ -622,7 +634,7 @@ export class OnListBotsCommand extends Command { } this.room.clients.forEach((client) => { - if (client.auth.uid === this.state.ownerId) { + if (client.auth?.uid === this.state.ownerId) { client.send(Transfer.REQUEST_BOT_LIST, bots) } }) diff --git a/app/rooms/game-room.ts b/app/rooms/game-room.ts index 9563653394..b5a1b367d7 100644 --- a/app/rooms/game-room.ts +++ b/app/rooms/game-room.ts @@ -434,6 +434,9 @@ export default class GameRoom extends Room { ) { // if player left game during the loading screen or before stage 4, remove it from the players this.state.players.delete(client.auth.uid) + this.state.players.forEach((player) => { + player.opponents.delete(client.auth.uid) + }) logger.info( `${client.auth.displayName} has been removed from players list` ) @@ -695,6 +698,22 @@ export default class GameRoom extends Room { player.opponentAvatar = opponent.avatar player.opponentTitle = TitleName[opponent.title] ?? "" return id + } else { + logger.error( + "ERROR, no opponent found. Players size:", + this.state.players.size + ) + logger.error("ERROR, sortArray =") + sortArray.forEach((p) => logger.error(p)) + logger.error("ERROR, potentials = ") + potentials.forEach((p) => logger.error(p)) + logger.error("ERROR, potentail = ", potential) + logger.error("ERROR, id", id) + logger.error("ERROR", opponent) + this.state.players.forEach((player) => { + logger.error(player.id, player.name, player.alive) + logger.error(player.opponents) + }) } } } diff --git a/app/types/enum/Ability.ts b/app/types/enum/Ability.ts index 11e8ddb0e9..3ecda10f72 100644 --- a/app/types/enum/Ability.ts +++ b/app/types/enum/Ability.ts @@ -1,173 +1,3 @@ -import { - AttackStrategy, - SoftBoiledStrategy, - BiteStrategy, - BlastBurnStrategy, - BlazeKickStrategy, - BonemerangStrategy, - BugBuzzStrategy, - BurnStrategy, - CalmMindStrategy, - ChargeStrategy, - ClangorousSoulStrategy, - ConfusingMindStrategy, - ConfusionStrategy, - CorruptedNatureStrategy, - CrabHammerStrategy, - PaybackStrategy, - DiamondStormStrategy, - DisarmingVoiceStrategy, - DischargeStrategy, - DracoEnergyStrategy, - DracoMeteorStrategy, - DragonBreathStrategy, - DragonTailStrategy, - DynamaxCannonStrategy, - DynamicPunchStrategy, - EarthquakeStrategy, - EchoStrategy, - ElectroBoostStrategy, - ElectroWebStrategy, - ExplosionStrategy, - FireBlastStrategy, - FireTrickStrategy, - FlameChargeStrategy, - FreezeStrategy, - GrassWhistleStrategy, - GrowlStrategy, - GuillotineStrategy, - HappyHourStrategy, - HeadSmashStrategy, - HealBlockStrategy, - HeatWaveStrategy, - HighJumpKickStrategy, - HurricaneStrategy, - HydroPumpStrategy, - HyperVoiceStrategy, - IcicleCrashStrategy, - IronDefenseStrategy, - IronTailStrategy, - JudgementStrategy, - KingShieldStrategy, - KnowledgeThiefStrategy, - LeechLifeStrategy, - LeechSeedStrategy, - LockOnStrategy, - MeteorMashStrategy, - MetronomeStrategy, - NastyPlotStrategy, - NightmareStrategy, - NightSlashStrategy, - OriginPulseStrategy, - PetalDanceStrategy, - PoisonStingStrategy, - PoisonStrategy, - ProtectStrategy, - PsychUpStrategy, - RazorWindStrategy, - RelicSongStrategy, - RoarOfTimeStrategy, - RockSlideStrategy, - RockSmashStrategy, - RockTombStrategy, - RootStrategy, - SeedFlareStrategy, - SeismicTossStrategy, - ShadowCloneStrategy, - SilenceStrategy, - SleepStrategy, - SoakStrategy, - SongOfDesireStrategy, - StickyWebStrategy, - StompStrategy, - StringShotStrategy, - StunSporeStrategy, - TeleportStrategy, - ThiefStrategy, - ThunderStrategy, - TormentStrategy, - TriAttackStrategy, - TwistingNeiherStrategy, - VoltSwitchStrategy, - WheelOfFireStrategy, - WishStrategy, - WonderGuardStrategy, - ElectricSurgeStrategy, - PsychicSurgeStrategy, - MindBlownStrategy, - PaydayStrategy, - BeatUpStrategy, - BlueFlareStrategy, - FusionBoltStrategy, - AuroraVeilStrategy, - AquaJetStrategy, - ChatterStrategy, - LiquidationStrategy, - SteamEruptionStrategy, - AppleAcidStrategy, - ShadowBallStrategy, - DiveStrategy, - SpikeArmorStrategy, - FutureSightStrategy, - FakeTearsStrategy, - SparklingAriaStrategy, - DragonDartsStrategy, - MistySurgeStrategy, - GrassySurgeStrategy, - SkyAttackStrategy, - IllusionStrategy, - SmogStrategy, - AuroraBeamStrategy, - AgilityStrategy, - SpiritShackleStrategy, - WaterShurikenStrategy, - ShadowSneakStrategy, - MachPunchStrategy, - UppercutStrategy, - TripleKickStrategy, - MawashiGeriStrategy, - ForecastStrategy, - SacredSwordStrategy, - XScissorStrategy, - PlasmaFistStrategy, - SpectralThiefStrategy, - GeomancyStrategy, - DeathWingStrategy, - SlackOffStrategy, - DarkVoidStrategy, - OverheatStrategy, - HypnosisStrategy, - MimicStrategy, - HexStrategy, - GrowthStrategy, - HealOrderStrategy, - ShellTrapStrategy, - DigStrategy, - FireSpinStrategy, - SearingShotStrategy, - PeckStrategy, - SplashStrategy, - CounterStrategy, - ComsicPowerStrategy, - PoisonPowderStrategy, - SilverWindStrategy, - IcyWindStrategy, - GigatonHammerStrategy, - AcrobaticsStrategy, - AbsorbStrategy, - RolloutStrategy, - ThrashStrategy, - SolarBeamStrategy, - MagmaStormStrategy, - SlashingClawStrategy, - EruptionStrategy, - MistBallStrategy, - LusterPurgeStrategy, - MudBubbleStrategy, - LinkCableStrategy, - MagicBounceStrategy -} from "../../core/attack-strategy" - export enum Ability { DEFAULT = "DEFAULT", FIRE_BLAST = "FIRE_BLAST", @@ -335,175 +165,33 @@ export enum Ability { LUSTER_PURGE = "LUSTER_PURGE", MUD_BUBBLE = "MUD_BUBBLE", LINK_CABLE = "LINK_CABLE", - MAGIC_BOUNCE = "MAGIC_BOUNCE" -} - -export const AbilityStrategy: { [key in Ability]: AttackStrategy } = { - [Ability.SONG_OF_DESIRE]: new SongOfDesireStrategy(), - [Ability.CONFUSING_MIND]: new ConfusingMindStrategy(), - [Ability.KNOWLEDGE_THIEF]: new KnowledgeThiefStrategy(), - [Ability.WONDER_GUARD]: new WonderGuardStrategy(), - [Ability.CORRUPTED_NATURE]: new CorruptedNatureStrategy(), - [Ability.CRABHAMMER]: new CrabHammerStrategy(), - [Ability.KING_SHIELD]: new KingShieldStrategy(), - [Ability.EXPLOSION]: new ExplosionStrategy(), - [Ability.NIGHTMARE]: new NightmareStrategy(), - [Ability.CLANGOROUS_SOUL]: new ClangorousSoulStrategy(), - [Ability.BONEMERANG]: new BonemerangStrategy(), - [Ability.GROWL]: new GrowlStrategy(), - [Ability.RELIC_SONG]: new RelicSongStrategy(), - [Ability.DISARMING_VOICE]: new DisarmingVoiceStrategy(), - [Ability.HIGH_JUMP_KICK]: new HighJumpKickStrategy(), - [Ability.GRASS_WHISTLE]: new GrassWhistleStrategy(), - [Ability.TRI_ATTACK]: new TriAttackStrategy(), - [Ability.ECHO]: new EchoStrategy(), - [Ability.PETAL_DANCE]: new PetalDanceStrategy(), - [Ability.HYPER_VOICE]: new HyperVoiceStrategy(), - [Ability.SHADOW_CLONE]: new ShadowCloneStrategy(), - [Ability.VOLT_SWITCH]: new VoltSwitchStrategy(), - [Ability.FIRE_BLAST]: new FireBlastStrategy(), - [Ability.WHEEL_OF_FIRE]: new WheelOfFireStrategy(), - [Ability.SEISMIC_TOSS]: new SeismicTossStrategy(), - [Ability.GUILLOTINE]: new GuillotineStrategy(), - [Ability.ROCK_SLIDE]: new RockSlideStrategy(), - [Ability.HEAT_WAVE]: new HeatWaveStrategy(), - [Ability.THUNDER]: new ThunderStrategy(), - [Ability.HYDRO_PUMP]: new HydroPumpStrategy(), - [Ability.DRACO_METEOR]: new DracoMeteorStrategy(), - [Ability.BLAZE_KICK]: new BlazeKickStrategy(), - [Ability.WISH]: new WishStrategy(), - [Ability.CALM_MIND]: new CalmMindStrategy(), - [Ability.IRON_DEFENSE]: new IronDefenseStrategy(), - [Ability.METRONOME]: new MetronomeStrategy(), - [Ability.SOAK]: new SoakStrategy(), - [Ability.IRON_TAIL]: new IronTailStrategy(), - [Ability.BLAST_BURN]: new BlastBurnStrategy(), - [Ability.CHARGE]: new ChargeStrategy(), - [Ability.DISCHARGE]: new DischargeStrategy(), - [Ability.BITE]: new BiteStrategy(), - [Ability.DRAGON_TAIL]: new DragonTailStrategy(), - [Ability.DRAGON_BREATH]: new DragonBreathStrategy(), - [Ability.ICICLE_CRASH]: new IcicleCrashStrategy(), - [Ability.ROOT]: new RootStrategy(), - [Ability.TORMENT]: new TormentStrategy(), - [Ability.STOMP]: new StompStrategy(), - [Ability.PAYBACK]: new PaybackStrategy(), - [Ability.NIGHT_SLASH]: new NightSlashStrategy(), - [Ability.BUG_BUZZ]: new BugBuzzStrategy(), - [Ability.STRING_SHOT]: new StringShotStrategy(), - [Ability.STICKY_WEB]: new StickyWebStrategy(), - [Ability.VENOSHOCK]: new PoisonStingStrategy(), - [Ability.LEECH_LIFE]: new LeechLifeStrategy(), - [Ability.HAPPY_HOUR]: new HappyHourStrategy(), - [Ability.TELEPORT]: new TeleportStrategy(), - [Ability.NASTY_PLOT]: new NastyPlotStrategy(), - [Ability.THIEF]: new ThiefStrategy(), - [Ability.STUN_SPORE]: new StunSporeStrategy(), - [Ability.METEOR_MASH]: new MeteorMashStrategy(), - [Ability.HURRICANE]: new HurricaneStrategy(), - [Ability.BURN]: new BurnStrategy(), - [Ability.SLEEP]: new SleepStrategy(), - [Ability.SILENCE]: new SilenceStrategy(), - [Ability.CONFUSION]: new ConfusionStrategy(), - [Ability.FREEZE]: new FreezeStrategy(), - [Ability.PROTECT]: new ProtectStrategy(), - [Ability.POISON]: new PoisonStrategy(), - [Ability.ORIGIN_PULSE]: new OriginPulseStrategy(), - [Ability.SEED_FLARE]: new SeedFlareStrategy(), - [Ability.HEAL_BLOCK]: new HealBlockStrategy(), - [Ability.ROAR_OF_TIME]: new RoarOfTimeStrategy(), - [Ability.ROCK_TOMB]: new RockTombStrategy(), - [Ability.ROCK_SMASH]: new RockSmashStrategy(), - [Ability.HEAD_SMASH]: new HeadSmashStrategy(), - [Ability.DEFAULT]: new AttackStrategy(), - [Ability.DIAMOND_STORM]: new DiamondStormStrategy(), - [Ability.DRACO_ENERGY]: new DracoEnergyStrategy(), - [Ability.DYNAMAX_CANNON]: new DynamaxCannonStrategy(), - [Ability.DYNAMIC_PUNCH]: new DynamicPunchStrategy(), - [Ability.ELECTRO_BOOST]: new ElectroBoostStrategy(), - [Ability.ELECTRO_WEB]: new ElectroWebStrategy(), - [Ability.FIRE_TRICK]: new FireTrickStrategy(), - [Ability.FLAME_CHARGE]: new FlameChargeStrategy(), - [Ability.LEECH_SEED]: new LeechSeedStrategy(), - [Ability.LOCK_ON]: new LockOnStrategy(), - [Ability.PSYCH_UP]: new PsychUpStrategy(), - [Ability.RAZOR_WIND]: new RazorWindStrategy(), - [Ability.TWISTING_NETHER]: new TwistingNeiherStrategy(), - [Ability.EARTHQUAKE]: new EarthquakeStrategy(), - [Ability.SOFT_BOILED]: new SoftBoiledStrategy(), - [Ability.ELECTRIC_SURGE]: new ElectricSurgeStrategy(), - [Ability.PSYCHIC_SURGE]: new PsychicSurgeStrategy(), - [Ability.MIND_BLOWN]: new MindBlownStrategy(), - [Ability.PAYDAY]: new PaydayStrategy(), - [Ability.BEAT_UP]: new BeatUpStrategy(), - [Ability.BLUE_FLARE]: new BlueFlareStrategy(), - [Ability.FUSION_BOLT]: new FusionBoltStrategy(), - [Ability.AURORA_VEIL]: new AuroraVeilStrategy(), - [Ability.AQUA_JET]: new AquaJetStrategy(), - [Ability.JUDGEMENT]: new JudgementStrategy(), - [Ability.CHATTER]: new ChatterStrategy(), - [Ability.LIQUIDATION]: new LiquidationStrategy(), - [Ability.STEAM_ERUPTION]: new SteamEruptionStrategy(), - [Ability.APPLE_ACID]: new AppleAcidStrategy(), - [Ability.SHADOW_BALL]: new ShadowBallStrategy(), - [Ability.DIVE]: new DiveStrategy(), - [Ability.SPIKE_ARMOR]: new SpikeArmorStrategy(), - [Ability.FUTURE_SIGHT]: new FutureSightStrategy(), - [Ability.FAKE_TEARS]: new FakeTearsStrategy(), - [Ability.SPARKLING_ARIA]: new SparklingAriaStrategy(), - [Ability.DRAGON_DARTS]: new DragonDartsStrategy(), - [Ability.GRASSY_SURGE]: new GrassySurgeStrategy(), - [Ability.MISTY_SURGE]: new MistySurgeStrategy(), - [Ability.SKY_ATTACK]: new SkyAttackStrategy(), - [Ability.ILLUSION]: new IllusionStrategy(), - [Ability.SMOG]: new SmogStrategy(), - [Ability.AURORA_BEAM]: new AuroraBeamStrategy(), - [Ability.AGILITY]: new AgilityStrategy(), - [Ability.SPIRIT_SHACKLE]: new SpiritShackleStrategy(), - [Ability.WATER_SHURIKEN]: new WaterShurikenStrategy(), - [Ability.SHADOW_SNEAK]: new ShadowSneakStrategy(), - [Ability.MACH_PUNCH]: new MachPunchStrategy(), - [Ability.UPPERCUT]: new UppercutStrategy(), - [Ability.TRIPLE_KICK]: new TripleKickStrategy(), - [Ability.MAWASHI_GERI]: new MawashiGeriStrategy(), - [Ability.FORECAST]: new ForecastStrategy(), - [Ability.SACRED_SWORD]: new SacredSwordStrategy(), - [Ability.X_SCISSOR]: new XScissorStrategy(), - [Ability.PLASMA_FIST]: new PlasmaFistStrategy(), - [Ability.SPECTRAL_THIEF]: new SpectralThiefStrategy(), - [Ability.GEOMANCY]: new GeomancyStrategy(), - [Ability.DEATH_WING]: new DeathWingStrategy(), - [Ability.SLACK_OFF]: new SlackOffStrategy(), - [Ability.DARK_VOID]: new DarkVoidStrategy(), - [Ability.OVERHEAT]: new OverheatStrategy(), - [Ability.HYPNOSIS]: new HypnosisStrategy(), - [Ability.MIMIC]: new MimicStrategy(), - [Ability.HEX]: new HexStrategy(), - [Ability.GROWTH]: new GrowthStrategy(), - [Ability.HEAL_ORDER]: new HealOrderStrategy(), - [Ability.SHELL_TRAP]: new ShellTrapStrategy(), - [Ability.DIG]: new DigStrategy(), - [Ability.FIRE_SPIN]: new FireSpinStrategy(), - [Ability.SEARING_SHOT]: new SearingShotStrategy(), - [Ability.PECK]: new PeckStrategy(), - [Ability.SPLASH]: new SplashStrategy(), - [Ability.COUNTER]: new CounterStrategy(), - [Ability.COSMIC_POWER]: new ComsicPowerStrategy(), - [Ability.POISON_POWDER]: new PoisonPowderStrategy(), - [Ability.SILVER_WIND]: new SilverWindStrategy(), - [Ability.ICY_WIND]: new IcyWindStrategy(), - [Ability.GIGATON_HAMMER]: new GigatonHammerStrategy(), - [Ability.ACROBATICS]: new AcrobaticsStrategy(), - [Ability.ABSORB]: new AbsorbStrategy(), - [Ability.ROLLOUT]: new RolloutStrategy(), - [Ability.THRASH]: new ThrashStrategy(), - [Ability.SOLAR_BEAM]: new SolarBeamStrategy(), - [Ability.MAGMA_STORM]: new MagmaStormStrategy(), - [Ability.SLASHING_CLAW]: new SlashingClawStrategy(), - [Ability.ERUPTION]: new EruptionStrategy(), - [Ability.MIST_BALL]: new MistBallStrategy(), - [Ability.LUSTER_PURGE]: new LusterPurgeStrategy(), - [Ability.MUD_BUBBLE]: new MudBubbleStrategy(), - [Ability.LINK_CABLE]: new LinkCableStrategy(), - [Ability.MAGIC_BOUNCE]: new MagicBounceStrategy() + MAGIC_BOUNCE = "MAGIC_BOUNCE", + HIDDEN_POWER_A = "HIDDEN_POWER_A", + HIDDEN_POWER_B = "HIDDEN_POWER_B", + HIDDEN_POWER_C = "HIDDEN_POWER_C", + HIDDEN_POWER_D = "HIDDEN_POWER_D", + HIDDEN_POWER_E = "HIDDEN_POWER_E", + HIDDEN_POWER_F = "HIDDEN_POWER_F", + HIDDEN_POWER_G = "HIDDEN_POWER_G", + HIDDEN_POWER_H = "HIDDEN_POWER_H", + HIDDEN_POWER_I = "HIDDEN_POWER_I", + HIDDEN_POWER_J = "HIDDEN_POWER_J", + HIDDEN_POWER_K = "HIDDEN_POWER_K", + HIDDEN_POWER_L = "HIDDEN_POWER_L", + HIDDEN_POWER_M = "HIDDEN_POWER_M", + HIDDEN_POWER_N = "HIDDEN_POWER_N", + HIDDEN_POWER_O = "HIDDEN_POWER_O", + HIDDEN_POWER_P = "HIDDEN_POWER_P", + HIDDEN_POWER_Q = "HIDDEN_POWER_Q", + HIDDEN_POWER_R = "HIDDEN_POWER_R", + HIDDEN_POWER_S = "HIDDEN_POWER_S", + HIDDEN_POWER_T = "HIDDEN_POWER_T", + HIDDEN_POWER_U = "HIDDEN_POWER_U", + HIDDEN_POWER_V = "HIDDEN_POWER_V", + HIDDEN_POWER_W = "HIDDEN_POWER_W", + HIDDEN_POWER_X = "HIDDEN_POWER_X", + HIDDEN_POWER_Y = "HIDDEN_POWER_Y", + HIDDEN_POWER_Z = "HIDDEN_POWER_Z", + HIDDEN_POWER_QM = "HIDDEN_POWER_QM", + HIDDEN_POWER_EM = "HIDDEN_POWER_EM" } diff --git a/app/types/enum/Passive.ts b/app/types/enum/Passive.ts index 6942e3a29f..74850f2feb 100644 --- a/app/types/enum/Passive.ts +++ b/app/types/enum/Passive.ts @@ -33,5 +33,6 @@ export enum Passive { SHARED_VISION = "SHARED_VISION", WATER_SPRING = "WATER_SPRING", MAGIKARP = "MAGIKARP", - GIRATINA = "GIRATINA" + GIRATINA = "GIRATINA", + UNOWN = "UNOWN" } diff --git a/app/types/enum/Pokemon.ts b/app/types/enum/Pokemon.ts index f91edeae6a..7b6cfe9c2c 100644 --- a/app/types/enum/Pokemon.ts +++ b/app/types/enum/Pokemon.ts @@ -1761,6 +1761,37 @@ export const PkmDuos = { [PkmDuo.PLUSLE_MINUN]: [Pkm.PLUSLE, Pkm.MINUN] } +export const Unowns: Pkm[] = [ + Pkm.UNOWN_A, + Pkm.UNOWN_B, + Pkm.UNOWN_C, + Pkm.UNOWN_D, + Pkm.UNOWN_E, + Pkm.UNOWN_F, + Pkm.UNOWN_G, + Pkm.UNOWN_H, + Pkm.UNOWN_I, + Pkm.UNOWN_J, + Pkm.UNOWN_K, + Pkm.UNOWN_L, + Pkm.UNOWN_M, + Pkm.UNOWN_N, + Pkm.UNOWN_O, + Pkm.UNOWN_P, + Pkm.UNOWN_Q, + Pkm.UNOWN_R, + Pkm.UNOWN_S, + Pkm.UNOWN_T, + Pkm.UNOWN_U, + Pkm.UNOWN_V, + Pkm.UNOWN_W, + Pkm.UNOWN_X, + Pkm.UNOWN_Y, + Pkm.UNOWN_Z, + Pkm.UNOWN_QUESTION, + Pkm.UNOWN_EXCLAMATION +] + export const AnimationConfig: { [key in Pkm]: { attack: AnimationType @@ -4104,144 +4135,144 @@ export const AnimationConfig: { emote: AnimationType.Shoot }, [Pkm.UNOWN_A]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_B]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_C]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_D]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_E]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_F]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_G]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_H]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_I]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_J]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_K]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_L]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_M]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_N]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_O]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_P]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_Q]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_R]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_S]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_T]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_U]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_V]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_W]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_X]: { attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_Y]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_Z]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_QUESTION]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.UNOWN_EXCLAMATION]: { - attack: AnimationType.Swing, + attack: AnimationType.Rotate, ability: AnimationType.Rotate, - emote: AnimationType.Shoot + emote: AnimationType.Rotate }, [Pkm.TAPU_FINI]: { attack: AnimationType.Attack, diff --git a/app/types/index.ts b/app/types/index.ts index 2c46e05a34..1f1793b251 100644 --- a/app/types/index.ts +++ b/app/types/index.ts @@ -357,7 +357,6 @@ export interface IPokemon { evolution: Pkm positionX: number positionY: number - cost: number attackSprite: AttackSprite atkSpeed: number def: number diff --git a/app/types/strings/Ability.ts b/app/types/strings/Ability.ts index 759579ce01..280e4edd75 100644 --- a/app/types/strings/Ability.ts +++ b/app/types/strings/Ability.ts @@ -2,6 +2,7 @@ import { Langage } from ".." import { Ability } from "../enum/Ability" import { Damage, Stat } from "../enum/Game" import { Status } from "../enum/Status" +import { Synergy } from "../enum/Synergy" export const AbilityName: { [key in Ability]: Langage } = { [Ability.SOFT_BOILED]: { @@ -1005,10 +1006,184 @@ export const AbilityName: { [key in Ability]: Langage } = { esp: "", prt: "", fra: "" + }, + [Ability.HIDDEN_POWER_A]: { + eng: "Hidden Power (ABRA)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_B]: { + eng: "Hidden Power (BURN)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_C]: { + eng: "Hidden Power (COIN)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_D]: { + eng: "Hidden Power (DITO)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_E]: { + eng: "Hidden Power (EGGS)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_F]: { + eng: "Hidden Power (FISH)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_G]: { + eng: "Hidden Power (GOLD)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_H]: { + eng: "Hidden Power (HEAL)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_I]: { + eng: "Hidden Power (ITEM)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_J]: { + eng: "Hidden Power (JAWS)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_K]: { + eng: "Hidden Power (KICK)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_L]: { + eng: "Hidden Power (LIFE)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_M]: { + eng: "Hidden Power (MANA)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_N]: { + eng: "Hidden Power (NUKE)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_O]: { + eng: "Hidden Power (ORAN)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_P]: { + eng: "Hidden Power (PEST)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_Q]: { + eng: "Hidden Power (QUIT)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_R]: { + eng: "Hidden Power (ROCK)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_S]: { + eng: "Hidden Power (STOP)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_T]: { + eng: "Hidden Power (TAPU)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_U]: { + eng: "Hidden Power (UXIE)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_V]: { + eng: "Hidden Power (VOLT)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_W]: { + eng: "Hidden Power (WISH)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_X]: { + eng: "Hidden Power (XRAY)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_Y]: { + eng: "Hidden Power (YOGA)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_Z]: { + eng: "Hidden Power (ZZZZ)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_QM]: { + eng: "Hidden Power (?)", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_EM]: { + eng: "Hidden Power (!)", + esp: "", + prt: "", + fra: "" } } export const AbilityDescription: { [key in Ability]: Langage } = { + [Ability.DEFAULT]: { + eng: ``, + esp: ``, + fra: ``, + prt: `` + }, [Ability.SOFT_BOILED]: { eng: `Cures every status effects and grants [20,40,80,SP] ${Stat.SHIELD} for every ally`, esp: ``, @@ -1141,12 +1316,6 @@ export const AbilityDescription: { [key in Ability]: Langage } = { fra: ``, prt: `` }, - [Ability.DEFAULT]: { - eng: ``, - esp: ``, - fra: ``, - prt: `` - }, [Ability.BURN]: { eng: `${Status.BURN} the whole enemy team for [5,10,20] seconds`, esp: `Quemar todo el equipo durante 2,4,8 segundos, repartiendo el 5% de hp,segundos`, @@ -2013,5 +2182,173 @@ Snow: also gives [2,SP] ${Stat.DEF} / ${Stat.SPE_DEF}`, esp: "", prt: "", fra: "" + }, + [Ability.HIDDEN_POWER_A]: { + eng: "Spawn 4 Abra at every corner of the board", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_B]: { + eng: "Burn the opponent team for 30 seconds", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_C]: { + eng: "Give Amulet Coin to your whole team. The item is removed at the end of the fight.", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_D]: { + eng: `Get a Ditto on your bench`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_E]: { + eng: "Get a Pokemon Egg on your bench. It hatches in the next stage", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_F]: { + eng: `Fish 2 random ${Synergy.WATER} Pokemon at max fishing level`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_G]: { + eng: "Gain 5 Gold", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_H]: { + eng: `Heal your team to Max ${Stat.HP}`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_I]: { + eng: "Get a random item component", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_J]: { + eng: "Spawn 2 Sharpedo with Razor Claws", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_K]: { + eng: `Spawn Hitmonlee with a Red Orb and max ${Stat.MANA}`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_L]: { + eng: `Give Max Revive to your whole team. The item is removed at the end of the fight.`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_M]: { + eng: `Your whole team gets max ${Stat.MANA}`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_N]: { + eng: `Your whole team cast ${AbilityName[Ability.EXPLOSION].eng}`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_O]: { + eng: "Give Oran Berry to your whole team. The item is removed at the end of the fight.", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_P]: { + eng: `Spawn 5 random ${Synergy.BUG} pokemon at their first stage of evolution`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_Q]: { + eng: "Immediately ends the fight with a draw", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_R]: { + eng: "Spawn Geodude, Graveler and Golem with Rocky Helmets", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_S]: { + eng: `${Status.FREEZE} the opponent team for 4 seconds`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_T]: { + eng: `Spawn Tapu-Lele with Choice Specs and max ${Stat.MANA}`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_U]: { + eng: `Spawn Uxie with Aqua Egg and max ${Stat.MANA}`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_V]: { + eng: `Cast ${AbilityName[Ability.THUNDER].eng} on all the enemy team`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_W]: { + eng: "Get a high rarity pokemon matching your top synergy", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_X]: { + eng: "Gives XRay Vision to your whole team. The item is removed at the end of the fight.", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_Y]: { + eng: "Spawn 2 Meditite with a Soul Dew", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_Z]: { + eng: `Put the enemy team ${Status.SLEEP} for 5 seconds`, + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_QM]: { + eng: "Get 4 random Unown on your bench", + esp: "", + prt: "", + fra: "" + }, + [Ability.HIDDEN_POWER_EM]: { + eng: "Spawn 4 random Unown at every corner of the board", + esp: "", + prt: "", + fra: "" } } diff --git a/app/types/strings/Effect.ts b/app/types/strings/Effect.ts index 9f92ed9aaa..4b0f3da0c0 100644 --- a/app/types/strings/Effect.ts +++ b/app/types/strings/Effect.ts @@ -210,12 +210,12 @@ export const EffectDescription: { fra: `` }, [Effect.LIGHT_SCREEN]: { - eng: `+100% ${Stat.AP}`, + eng: `+100% ${Stat.AP}. Unowns have 5% chance to appear in shop.`, esp: ``, fra: `` }, [Effect.EERIE_SPELL]: { - eng: `+150% ${Stat.AP}`, + eng: `+150% ${Stat.AP}. After a fight, get an Unown shop.`, esp: ``, fra: `` }, diff --git a/app/types/strings/Passive.ts b/app/types/strings/Passive.ts index e207fe01eb..0fb8f49585 100644 --- a/app/types/strings/Passive.ts +++ b/app/types/strings/Passive.ts @@ -18,13 +18,13 @@ export const PassiveDescription: { [key in Passive]: string } = { [Passive.MISTY_SURGE]: `Give ${Status.FAIRY_FIELD} to your Fairy Pokemon, boosting their damage by 20%`, [Passive.PSYCHIC_SURGE]: `Give ${Status.PSYCHIC_FIELD} to your Psychic Pokemon, boosting their damage by 20%`, [Passive.EEVEE]: `Eevee can evolve into one of the 8 Eeveelutions when given a synergy stone`, - [Passive.TREE]: `Pretends to be a tree and does not attack but gain 2 ${Stat.ATK} per second instead (stackable).\nStarts attacking when ${Stat.MANA} bar is full.`, - [Passive.DITTO]: `Ditto can't fight, but it can transform to create a copy of the basic form of one of your pokemons you drop it over (except Mythical and Hatch).`, - [Passive.EGG]: `You can feel something moving inside.`, + [Passive.TREE]: `Pretends to be a tree and does not attack but gain 2 ${Stat.ATK} per second instead (stackable).\nStarts attacking when ${Stat.MANA} bar is full`, + [Passive.DITTO]: `Ditto can't fight, but it can transform to create a copy of the basic form of one of your pokemons you drop it over (except Mythical and Hatch)`, + [Passive.EGG]: `You can feel something moving inside`, [Passive.HATCH]: `Hatched pokemons evolve automatically after 4 stages`, [Passive.SYNCHRO]: `If the pokemon is affected by ${Status.POISON}, ${Status.BURN}, ${Status.WOUND} or ${Status.SILENCE}, the enemy caster will suffer the same negative status`, - [Passive.TADPOLE]: `Poliwhirl will evolve into Poliwrath if placed on the frontlane, Politoed otherwise.`, - [Passive.BIVALVE]: `Clamperl will evolve into Huntail if placed on the frontlane, Gorebyss otherwise.`, + [Passive.TADPOLE]: `Poliwhirl will evolve into Poliwrath if placed on the frontlane, Politoed otherwise`, + [Passive.BIVALVE]: `Clamperl will evolve into Huntail if placed on the frontlane, Gorebyss otherwise`, [Passive.SUN]: `Change weather to ${Weather.SUN}`, [Passive.RAIN]: `Change weather to ${Weather.RAIN}`, [Passive.SANDSTORM]: `Change weather to ${Weather.SANDSTORM}`, @@ -39,5 +39,6 @@ export const PassiveDescription: { [key in Passive]: string } = { [Passive.SHARED_VISION]: `Shared vision: all Pokemon with shared vision will attack the same target, if at range`, [Passive.WATER_SPRING]: `Whenever an enemy uses their ability, gain 5 ${Stat.MANA}`, [Passive.MAGIKARP]: `9 Magikarp evolve in Gyriados`, - [Passive.GIRATINA]: `Giratina switches between its Altered Forme and Origin Forme depending on its position on the board` + [Passive.GIRATINA]: `Giratina switches between its Altered Forme and Origin Forme depending on its position on the board`, + [Passive.UNOWN]: `Unown cannot hold items and vanish after one fight or after casting their ability` } diff --git a/app/types/strings/Synergy.ts b/app/types/strings/Synergy.ts index 3e7db0c4ec..f1250fec70 100644 --- a/app/types/strings/Synergy.ts +++ b/app/types/strings/Synergy.ts @@ -176,7 +176,7 @@ export const SynergyDescription: { fra: "" }, [Synergy.PSYCHIC]: { - eng: `Psychic pokemons gain additional ${Stat.AP}`, + eng: `Psychic pokemons gain additional ${Stat.AP} and attract Unowns`, esp: "", fra: "" }, diff --git a/changelog/patch-3.10.md b/changelog/patch-3.10.md index d514f933ed..aa7337bbdb 100644 --- a/changelog/patch-3.10.md +++ b/changelog/patch-3.10.md @@ -46,6 +46,7 @@ patch announcement - Dragon rework: Dragon amplify synergies and gains more stats when fully evolved. - Water dodge chance: 25/50/75 → 30/50/70 - Water rework: A new water pokemon is fished after each PvP turn and put on your bench +- Psychic rework: you can now find Unowns in shop - Rock rework: Rock pokemons gain Defense and better resist to critical damage - Monster rework: Monster pokemons gain Attack, heal and increase their max HP, and grow in size every time they knock down an opponent - Artificial rework: Gain +10/20/30% base Attack, Ability Power and max HP as Shield per held item @@ -67,9 +68,7 @@ patch announcement - fix duration of Maractus ability - do not count Castform synergies for getting the dominant synergy - Fix shiny pokemon bug - - fix Twisting Nether damage zone - - fix streak resetting one round after a draw # UI diff --git a/gen/precompute.ts b/gen/precompute.ts index ebfffb1b16..13c70a2f19 100644 --- a/gen/precompute.ts +++ b/gen/precompute.ts @@ -43,8 +43,8 @@ Object.values(Pkm).forEach((pkm) => { Object.keys(data).forEach((type) => { const sortByRarity = (a, b) => { - const aIndex = PokemonFactory.createPokemonFromName(a).cost - const bIndex = PokemonFactory.createPokemonFromName(b).cost + const aIndex = PokemonFactory.getBuyPrice(a) + const bIndex = PokemonFactory.getBuyPrice(b) return aIndex - bIndex } data[type].pokemons.sort(sortByRarity) diff --git a/package-lock.json b/package-lock.json index d32f0ccf3f..38e62af802 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4042,6 +4042,31 @@ "node": ">=6" } }, + "node_modules/@grpc/proto-loader/node_modules/protobufjs": { + "version": "6.11.3", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", + "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", @@ -11748,30 +11773,11 @@ "node": ">=12.0.0" } }, - "node_modules/protobufjs": { - "version": "6.11.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", - "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.1", - "@types/node": ">=13.7.0", - "long": "^4.0.0" - }, - "bin": { - "pbjs": "bin/pbjs", - "pbts": "bin/pbts" - } + "node_modules/protobufjs/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", + "extraneous": true }, "node_modules/proxy-addr": { "version": "2.0.7", diff --git a/tests/ability-check.ts b/tests/ability-check.ts new file mode 100644 index 0000000000..4ba67c6fb7 --- /dev/null +++ b/tests/ability-check.ts @@ -0,0 +1,16 @@ +import PokemonFactory from "../app/models/pokemon-factory" +import { Ability } from "../app/types/enum/Ability" +import { Pkm } from "../app/types/enum/Pokemon" + +Object.values(Ability) + .map((v) => { + return { + [v]: Object.values(Pkm) + .map((pkm) => PokemonFactory.createPokemonFromName(pkm)) + .filter((pokemon) => pokemon.skill === v) + .map((pokemon) => pokemon.name) + } + }) + .map((v) => { + console.log(v) + })