Merge branch 'beta' into refactor/fix-and-optimize-imports

This commit is contained in:
Mumble 2024-09-06 12:02:44 -07:00 committed by GitHub
commit 01b1d6b01e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 273 additions and 149 deletions

View File

@ -1,150 +1,150 @@
{
"music": "Music: ",
"music": "BGM: ",
"missing_entries": "{{name}}",
"battle_kanto_champion": "B2W2 Kanto Champion Battle",
"battle_johto_champion": "B2W2 Johto Champion Battle",
"battle_hoenn_champion_g5": "B2W2 Hoenn Champion Battle",
"battle_hoenn_champion_g6": "ORAS Hoenn Champion Battle",
"battle_sinnoh_champion": "B2W2 Sinnoh Champion Battle",
"battle_champion_alder": "BW Unova Champion Battle",
"battle_champion_iris": "B2W2 Unova Champion Battle",
"battle_kalos_champion": "XY Kalos Champion Battle",
"battle_alola_champion": "USUM Alola Champion Battle",
"battle_galar_champion": "SWSH Galar Champion Battle",
"battle_champion_geeta": "SV Champion Geeta Battle",
"battle_champion_nemona": "SV Champion Nemona Battle",
"battle_champion_kieran": "SV Champion Kieran Battle",
"battle_hoenn_elite": "ORAS Elite Four Battle",
"battle_unova_elite": "BW Elite Four Battle",
"battle_kalos_elite": "XY Elite Four Battle",
"battle_alola_elite": "SM Elite Four Battle",
"battle_galar_elite": "SWSH League Tournament Battle",
"battle_paldea_elite": "SV Elite Four Battle",
"battle_bb_elite": "SV BB League Elite Four Battle",
"battle_final_encounter": "PMD RTDX Rayquaza's Domain",
"battle_final": "BW Ghetsis Battle",
"battle_kanto_gym": "B2W2 Kanto Gym Battle",
"battle_johto_gym": "B2W2 Johto Gym Battle",
"battle_hoenn_gym": "B2W2 Hoenn Gym Battle",
"battle_sinnoh_gym": "B2W2 Sinnoh Gym Battle",
"battle_unova_gym": "BW Unova Gym Battle",
"battle_kalos_gym": "XY Kalos Gym Battle",
"battle_galar_gym": "SWSH Galar Gym Battle",
"battle_paldea_gym": "SV Paldea Gym Battle",
"battle_legendary_kanto": "XY Kanto Legendary Battle",
"battle_legendary_raikou": "HGSS Raikou Battle",
"battle_legendary_entei": "HGSS Entei Battle",
"battle_legendary_suicune": "HGSS Suicune Battle",
"battle_legendary_lugia": "HGSS Lugia Battle",
"battle_legendary_ho_oh": "HGSS Ho-oh Battle",
"battle_legendary_regis_g5": "B2W2 Legendary Titan Battle",
"battle_legendary_regis_g6": "ORAS Legendary Titan Battle",
"battle_legendary_gro_kyo": "ORAS Groudon & Kyogre Battle",
"battle_legendary_rayquaza": "ORAS Rayquaza Battle",
"battle_legendary_deoxys": "ORAS Deoxys Battle",
"battle_legendary_lake_trio": "ORAS Lake Guardians Battle",
"battle_legendary_sinnoh": "ORAS Sinnoh Legendary Battle",
"battle_legendary_dia_pal": "ORAS Dialga & Palkia Battle",
"battle_legendary_origin_forme": "LA Origin Dialga & Palkia Battle",
"battle_legendary_giratina": "ORAS Giratina Battle",
"battle_legendary_arceus": "HGSS Arceus Battle",
"battle_legendary_unova": "BW Unova Legendary Battle",
"battle_legendary_kyurem": "BW Kyurem Battle",
"battle_legendary_res_zek": "BW Reshiram & Zekrom Battle",
"battle_legendary_xern_yvel": "XY Xerneas & Yveltal Battle",
"battle_legendary_tapu": "SM Tapu Battle",
"battle_legendary_sol_lun": "SM Solgaleo & Lunala Battle",
"battle_legendary_ub": "SM Ultra Beast Battle",
"battle_legendary_dusk_dawn": "USUM Dusk Mane & Dawn Wings Necrozma Battle",
"battle_legendary_ultra_nec": "USUM Ultra Necrozma Battle",
"battle_legendary_zac_zam": "SWSH Zacian & Zamazenta Battle",
"battle_legendary_glas_spec": "SWSH Glastrier & Spectrier Battle",
"battle_legendary_calyrex": "SWSH Calyrex Battle",
"battle_legendary_riders": "SWSH Ice & Shadow Rider Calyrex Battle",
"battle_legendary_birds_galar": "SWSH Galarian Legendary Birds Battle",
"battle_legendary_ruinous": "SV Treasures of Ruin Battle",
"battle_legendary_kor_mir": "SV Depths of Area Zero Battle",
"battle_legendary_loyal_three": "SV Loyal Three Battle",
"battle_legendary_ogerpon": "SV Ogerpon Battle",
"battle_legendary_terapagos": "SV Terapagos Battle",
"battle_legendary_pecharunt": "SV Pecharunt Battle",
"battle_rival": "BW Rival Battle",
"battle_rival_2": "BW N Battle",
"battle_rival_3": "BW Final N Battle",
"battle_trainer": "BW Trainer Battle",
"battle_wild": "BW Wild Battle",
"battle_wild_strong": "BW Strong Wild Battle",
"end_summit": "PMD RTDX Sky Tower Summit",
"battle_rocket_grunt": "HGSS Team Rocket Battle",
"battle_aqua_magma_grunt": "ORAS Team Aqua & Magma Battle",
"battle_galactic_grunt": "BDSP Team Galactic Battle",
"battle_plasma_grunt": "BW Team Plasma Battle",
"battle_flare_grunt": "XY Team Flare Battle",
"battle_aether_grunt": "SM Aether Foundation Battle",
"battle_skull_grunt": "SM Team Skull Battle",
"battle_macro_grunt": "SWSH Trainer Battle",
"battle_galactic_admin": "BDSP Team Galactic Admin Battle",
"battle_skull_admin": "SM Team Skull Admin Battle",
"battle_oleana": "SWSH Oleana Battle",
"battle_rocket_boss": "USUM Giovanni Battle",
"battle_aqua_magma_boss": "ORAS Archie & Maxie Battle",
"battle_galactic_boss": "BDSP Cyrus Battle",
"battle_plasma_boss": "B2W2 Ghetsis Battle",
"battle_flare_boss": "XY Lysandre Battle",
"battle_aether_boss": "SM Lusamine Battle",
"battle_skull_boss": "SM Guzma Battle",
"battle_macro_boss": "SWSH Rose Battle",
"battle_kanto_champion": "B2W2 戦闘!チャンピオン(カントー)",
"battle_johto_champion": "B2W2 戦闘!チャンピオン(ジョウト)",
"battle_hoenn_champion_g5": "B2W2 戦闘!チャンピオン(ホウエン)",
"battle_hoenn_champion_g6": "ORAS 決戦!ダイゴ",
"battle_sinnoh_champion": "B2W2 戦闘!チャンピオン(シンオウ)",
"battle_champion_alder": "BW チャンピオン アデク",
"battle_champion_iris": "B2W2 戦闘!チャンピオンアイリス",
"battle_kalos_champion": "XY 戦闘!チャンピオン",
"battle_alola_champion": "USUM 頂上決戦!ハウ",
"battle_galar_champion": "SWSH 決戦!チャンピオンダンデ",
"battle_champion_geeta": "SV 戦闘!トップチャンピオン",
"battle_champion_nemona": "SV 戦闘!チャンピオンネモ",
"battle_champion_kieran": "SV 戦闘!チャンピオンスグリ",
"battle_hoenn_elite": "ORAS 戦闘!四天王",
"battle_unova_elite": "BW 戦闘!四天王",
"battle_kalos_elite": "XY 戦闘!四天王",
"battle_alola_elite": "SM 戦闘!四天王",
"battle_galar_elite": "SWSH 戦闘!ファイナルトーナメント!",
"battle_paldea_elite": "SV 戦闘!四天王",
"battle_bb_elite": "SV 戦闘!ブルベリーグ四天王",
"battle_final_encounter": "ポケダンDX レックウザ登場",
"battle_final": "BW 戦闘!ゲーチス",
"battle_kanto_gym": "B2W2 戦闘!ジムリーダー(カントー)",
"battle_johto_gym": "B2W2 戦闘!ジムリーダー(ジョウト)",
"battle_hoenn_gym": "B2W2 戦闘!ジムリーダー(ホウエン)",
"battle_sinnoh_gym": "B2W2 戦闘!ジムリーダー(シンオウ)",
"battle_unova_gym": "BW 戦闘!ジムリーダー",
"battle_kalos_gym": "XY 戦闘!ジムリーダー",
"battle_galar_gym": "SWSH 戦闘!ジムリーダー",
"battle_paldea_gym": "SV 戦闘!ジムリーダー",
"battle_legendary_kanto": "XY 戦闘!ミュウツー",
"battle_legendary_raikou": "HGSS 戦闘!ライコウ",
"battle_legendary_entei": "HGSS 戦闘!エンテイ",
"battle_legendary_suicune": "HGSS 戦闘!スイクン",
"battle_legendary_lugia": "HGSS 戦闘!ルギア",
"battle_legendary_ho_oh": "HGSS 戦闘!ホウオウ",
"battle_legendary_regis_g5": "B2W2 戦闘!レジロック・レジアイス・レジスチル",
"battle_legendary_regis_g6": "ORAS 戦闘!レジロック・レジアイス・レジスチル",
"battle_legendary_gro_kyo": "ORAS 戦闘!ゲンシカイキ",
"battle_legendary_rayquaza": "ORAS 戦闘!超古代ポケモン",
"battle_legendary_deoxys": "ORAS 戦闘!デオキシス",
"battle_legendary_lake_trio": "ORAS 戦闘!ユクシー・エムリット・アグノム",
"battle_legendary_sinnoh": "ORAS 戦闘!伝説のポケモン(シンオウ)",
"battle_legendary_dia_pal": "ORAS 戦闘!ディアルガ・パルキア",
"battle_legendary_origin_forme": "LA 戦い:ディアルガ・パルキア(オリジンフォルム)",
"battle_legendary_giratina": "ORAS 戦闘!ギラティナ",
"battle_legendary_arceus": "HGSS アルセウス",
"battle_legendary_unova": "BW 戦闘!伝説のポケモン",
"battle_legendary_kyurem": "BW 戦闘!キュレム",
"battle_legendary_res_zek": "BW 戦闘!ゼクロム・レシラム",
"battle_legendary_xern_yvel": "XY 戦闘!ゼルネアス・イベルタル・ジガルデ",
"battle_legendary_tapu": "SM 戦闘!カプ",
"battle_legendary_sol_lun": "SM 戦闘!ソルガレオ・ルナアーラ",
"battle_legendary_ub": "SM 戦闘!ウルトラビースト",
"battle_legendary_dusk_dawn": "USUM 戦闘!日食・月食ネクロズマ",
"battle_legendary_ultra_nec": "USUM 戦闘!ウルトラネクロズマ",
"battle_legendary_zac_zam": "SWSH 戦闘!ザシアン・ザマゼンタ",
"battle_legendary_glas_spec": "SWSH 戦闘!ブリザポス・レイスポス",
"battle_legendary_calyrex": "SWSH 戦闘!バドレックス",
"battle_legendary_riders": "SWSH 戦闘!豊穣の王",
"battle_legendary_birds_galar": "SWSH 戦闘!伝説のとりポケモン",
"battle_legendary_ruinous": "SV 戦闘!災厄ポケモン",
"battle_legendary_kor_mir": "SV 戦闘!エリアゼロのポケモン",
"battle_legendary_loyal_three": "SV 戦闘!ともっこ",
"battle_legendary_ogerpon": "SV 戦闘!オーガポン",
"battle_legendary_terapagos": "SV 戦闘!テラパゴス",
"battle_legendary_pecharunt": "SV 戦闘!モモワロウ",
"battle_rival": "BW 戦闘!チェレン・ベル",
"battle_rival_2": "BW 戦闘!N",
"battle_rival_3": "BW 決戦N",
"battle_trainer": "BW 戦闘!トレーナー",
"battle_wild": "BW 戦闘!野生ポケモン",
"battle_wild_strong": "BW 戦闘!強い野生ポケモン",
"end_summit": "ポケダンDX 天空の塔 最上階",
"battle_rocket_grunt": "HGSS 戦闘!ロケット団",
"battle_aqua_magma_grunt": "ORAS 戦闘!アクア団・マグマ団",
"battle_galactic_grunt": "BDSP 戦闘!ギンガ団",
"battle_plasma_grunt": "BW 戦闘!プラズマ団",
"battle_flare_grunt": "XY 戦闘!フレア団",
"battle_aether_grunt": "SM 戦闘!エーテル財団トレーナー",
"battle_skull_grunt": "SM 戦闘!スカル団",
"battle_macro_grunt": "SWSH 戦闘!トレーナー",
"battle_galactic_admin": "BDSP 戦闘!ギンガ団幹部",
"battle_skull_admin": "SM 戦闘!スカル団幹部",
"battle_oleana": "SWSH 戦闘!オリーヴ",
"battle_rocket_boss": "USUM 戦闘!レインボーロケット団ボス",
"battle_aqua_magma_boss": "ORAS 戦闘!アクア団・マグマ団のリーダー",
"battle_galactic_boss": "BDSP 戦闘!ギンガ団ボス",
"battle_plasma_boss": "B2W2 戦闘!ゲーチス",
"battle_flare_boss": "XY 戦闘!フラダリ",
"battle_aether_boss": "SM 戦闘!ルザミーネ",
"battle_skull_boss": "SM 戦闘!スカル団ボス",
"battle_macro_boss": "SWSH 戦闘!ローズ",
"abyss": "PMD EoS Dark Crater",
"badlands": "PMD EoS Barren Valley",
"beach": "PMD EoS Drenched Bluff",
"cave": "PMD EoS Sky Peak Cave",
"construction_site": "PMD EoS Boulder Quarry",
"desert": "PMD EoS Northern Desert",
"dojo": "PMD EoS Marowak Dojo",
"end": "PMD RTDX Sky Tower",
"factory": "PMD EoS Concealed Ruins",
"fairy_cave": "PMD EoS Star Cave",
"forest": "PMD EoS Dusk Forest",
"grass": "PMD EoS Apple Woods",
"graveyard": "PMD EoS Mystifying Forest",
"ice_cave": "PMD EoS Vast Ice Mountain",
"island": "PMD EoS Craggy Coast",
"jungle": "Lmz - Jungle",
"laboratory": "Firel - Laboratory",
"lake": "PMD EoS Crystal Cave",
"meadow": "PMD EoS Sky Peak Forest",
"metropolis": "Firel - Metropolis",
"mountain": "PMD EoS Mt. Horn",
"plains": "PMD EoS Sky Peak Prairie",
"power_plant": "PMD EoS Far Amp Plains",
"ruins": "PMD EoS Deep Sealed Ruin",
"sea": "Andr06 - Marine Mystique",
"seabed": "Firel - Seabed",
"slum": "Andr06 - Sneaky Snom",
"snowy_forest": "PMD EoS Sky Peak Snowfield",
"space": "Firel - Aether",
"swamp": "PMD EoS Surrounded Sea",
"tall_grass": "PMD EoS Foggy Forest",
"temple": "PMD EoS Aegis Cave",
"town": "PMD EoS Random Dungeon Theme 3",
"volcano": "PMD EoS Steam Cave",
"wasteland": "PMD EoS Hidden Highland",
"encounter_ace_trainer": "BW Trainers' Eyes Meet (Ace Trainer)",
"encounter_backpacker": "BW Trainers' Eyes Meet (Backpacker)",
"encounter_clerk": "BW Trainers' Eyes Meet (Clerk)",
"encounter_cyclist": "BW Trainers' Eyes Meet (Cyclist)",
"encounter_lass": "BW Trainers' Eyes Meet (Lass)",
"encounter_parasol_lady": "BW Trainers' Eyes Meet (Parasol Lady)",
"encounter_pokefan": "BW Trainers' Eyes Meet (Poke Fan)",
"encounter_psychic": "BW Trainers' Eyes Meet (Psychic)",
"encounter_rich": "BW Trainers' Eyes Meet (Gentleman)",
"encounter_rival": "BW Cheren",
"encounter_roughneck": "BW Trainers' Eyes Meet (Roughneck)",
"encounter_scientist": "BW Trainers' Eyes Meet (Scientist)",
"encounter_twins": "BW Trainers' Eyes Meet (Twins)",
"encounter_youngster": "BW Trainers' Eyes Meet (Youngster)",
"heal": "BW Pokémon Heal",
"menu": "PMD EoS Welcome to the World of Pokémon!",
"title": "PMD EoS Top Menu Theme"
"abyss": "ポケダン空 やみのかこう",
"badlands": "ポケダン空 こかつのたに",
"beach": "ポケダン空 しめったいわば",
"cave": "ポケダン空 そらのいただき(どうくつ)",
"construction_site": "ポケダン空 きょだいがんせきぐん",
"desert": "ポケダン空 きたのさばく",
"dojo": "ポケダン空 ガラガラどうじょう",
"end": "ポケダンDX 天空の塔",
"factory": "ポケダン空 かくされたいせき",
"fairy_cave": "ポケダン空 ほしのどうくつ",
"forest": "ポケダン空 くろのもり",
"grass": "ポケダン空 リンゴのもり",
"graveyard": "ポケダン空 しんぴのもり",
"ice_cave": "ポケダン空 だいひょうざん",
"island": "ポケダン空 えんがんのいわば",
"jungle": "Lmz - Jungle(ジャングル)",
"laboratory": "Firel - Laboratory(ラボラトリー)",
"lake": "ポケダン空 すいしょうのどうくつ",
"meadow": "ポケダン空 そらのいただき(もり)",
"metropolis": "Firel - Metropolis(大都市)",
"mountain": "ポケダン空 ツノやま",
"plains": "ポケダン空 そらのいただき(そうげん)",
"power_plant": "ポケダン空 エレキへいげん",
"ruins": "ポケダン空 ふういんのいわば",
"sea": "Andr06 - Marine Mystique(海の神秘性)",
"seabed": "Firel - Seabed(海底)",
"slum": "Andr06 - Sneaky Snom(ずるいユキハミ)",
"snowy_forest": "ポケダン空 そらのいただき(ゆきやま)",
"space": "Firel - Aether(エーテル)",
"swamp": "ポケダン空 とざされたうみ",
"tall_grass": "ポケダン空 のうむのもり",
"temple": "ポケダン空 ばんにんのどうくつ",
"town": "ポケダン空 ランダムダンジョン3",
"volcano": "ポケダン空 ねっすいのどうくつ",
"wasteland": "ポケダン空 まぼろしのだいち",
"encounter_ace_trainer": "BW 視線!エリートトレーナー",
"encounter_backpacker": "BW 視線!バックパッカー",
"encounter_clerk": "BW 視線!ビジネスマン",
"encounter_cyclist": "BW 視線!サイクリング",
"encounter_lass": "BW 視線!ミニスカート",
"encounter_parasol_lady": "BW 視線!パラソルおねえさん",
"encounter_pokefan": "BW 視線!だいすきクラブ",
"encounter_psychic": "BW 視線!サイキッカー",
"encounter_rich": "BW 視線!ジェントルマン",
"encounter_rival": "BW チェレンのテーマ",
"encounter_roughneck": "BW 視線!スキンヘッズ",
"encounter_scientist": "BW 視線!けんきゅういん",
"encounter_twins": "BW 視線!ふたごちゃん",
"encounter_youngster": "BW 視線!たんぱんこぞう",
"heal": "BW 回復",
"menu": "ポケダン空 ようこそ! ポケモンたちのせかいへ!",
"title": "ポケダン空 トップメニュー"
}

View File

@ -49,7 +49,9 @@ export class GameOverPhase extends BattlePhase {
}
if (this.victory && this.scene.gameMode.isEndless) {
this.scene.ui.showDialogue(i18next.t("PGMmiscDialogue:ending_endless"), i18next.t("PGMmiscDialogue:ending_name"), 0, () => this.handleGameOver());
const genderIndex = this.scene.gameData.gender ?? PlayerGender.UNSET;
const genderStr = PlayerGender[genderIndex].toLowerCase();
this.scene.ui.showDialogue(i18next.t("miscDialogue:ending_endless", { context: genderStr }), i18next.t("miscDialogue:ending_name"), 0, () => this.handleGameOver());
} else if (this.victory || !this.scene.enableRetries) {
this.handleGameOver();
} else {

View File

@ -1,7 +1,8 @@
import BattleScene from "#app/battle-scene";
import { applyPreWeatherEffectAbAttrs, SuppressWeatherEffectAbAttr, PreWeatherDamageAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr } from "#app/data/ability";
import { applyPreWeatherEffectAbAttrs, SuppressWeatherEffectAbAttr, PreWeatherDamageAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr } from "#app/data/ability.js";
import { CommonAnim } from "#app/data/battle-anims";
import { Weather, getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weather";
import { BattlerTagType } from "#app/enums/battler-tag-type";
import { WeatherType } from "#app/enums/weather-type";
import Pokemon, { HitResult } from "#app/field/pokemon";
import * as Utils from "#app/utils";
@ -39,7 +40,7 @@ export class WeatherEffectPhase extends CommonAnimPhase {
applyPreWeatherEffectAbAttrs(PreWeatherDamageAbAttr, pokemon, this.weather, cancelled);
applyAbAttrs(BlockNonDirectDamageAbAttr, pokemon, cancelled);
if (cancelled.value) {
if (cancelled.value || pokemon.getTag(BattlerTagType.UNDERGROUND) || pokemon.getTag(BattlerTagType.UNDERWATER)) {
return;
}

View File

@ -0,0 +1,62 @@
import { WeatherType } from "#app/data/weather";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils";
import { BattlerIndex } from "#app/battle";
describe("Weather - Hail", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
beforeAll(() => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.weather(WeatherType.HAIL)
.battleType("single")
.moveset(SPLASH_ONLY)
.enemyMoveset(SPLASH_ONLY)
.enemySpecies(Species.MAGIKARP);
});
it("inflicts damage equal to 1/16 of Pokemon's max HP at turn end", async () => {
await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.SPLASH);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("TurnEndPhase");
game.scene.getField(true).forEach(pokemon => {
expect(pokemon.hp).toBeLessThan(pokemon.getMaxHp() - Math.floor(pokemon.getMaxHp() / 16));
});
});
it("does not inflict damage to a Pokemon that is underwater (Dive) or underground (Dig)", async () => {
game.override.moveset([Moves.DIG]);
await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.DIG);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("TurnEndPhase");
const playerPokemon = game.scene.getPlayerPokemon()!;
const enemyPokemon = game.scene.getEnemyPokemon()!;
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp());
expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp() - Math.floor(enemyPokemon.getMaxHp() / 16));
});
});

View File

@ -0,0 +1,59 @@
import { WeatherType } from "#app/data/weather";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import { SPLASH_ONLY } from "../utils/testUtils";
describe("Weather - Sandstorm", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
beforeAll(() => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.weather(WeatherType.SANDSTORM)
.battleType("single")
.moveset(SPLASH_ONLY)
.enemyMoveset(SPLASH_ONLY)
.enemySpecies(Species.MAGIKARP);
});
it("inflicts damage equal to 1/16 of Pokemon's max HP at turn end", async () => {
await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.SPLASH);
await game.phaseInterceptor.to("TurnEndPhase");
game.scene.getField(true).forEach(pokemon => {
expect(pokemon.hp).toBeLessThan(pokemon.getMaxHp() - Math.floor(pokemon.getMaxHp() / 16));
});
});
it("does not inflict damage to a Pokemon that is underwater (Dive) or underground (Dig)", async () => {
game.override.moveset([Moves.DIVE]);
await game.classicMode.startBattle([Species.MAGIKARP]);
game.move.select(Moves.DIVE);
await game.phaseInterceptor.to("TurnEndPhase");
const playerPokemon = game.scene.getPlayerPokemon()!;
const enemyPokemon = game.scene.getEnemyPokemon()!;
expect(playerPokemon.hp).toBe(playerPokemon.getMaxHp());
expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp() - Math.floor(enemyPokemon.getMaxHp() / 16));
});
});