mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-22 17:44:19 +01:00
[Biome] Add "no unused imports" rule (#5580)
* Apply Biome to files * Add `lint/correctness/noUnusedImports` rule * Apply rule * Remove obsolete eslint directives * Fix variable naming in `game-speed.ts`
This commit is contained in:
parent
a727375730
commit
25b9fa7933
@ -50,7 +50,8 @@
|
|||||||
"noUndeclaredVariables": "off",
|
"noUndeclaredVariables": "off",
|
||||||
"noUnusedVariables": "error",
|
"noUnusedVariables": "error",
|
||||||
"noSwitchDeclarations": "warn", // TODO: refactor and make this an error
|
"noSwitchDeclarations": "warn", // TODO: refactor and make this an error
|
||||||
"noVoidTypeReturn": "warn" // TODO: Refactor and make this an error
|
"noVoidTypeReturn": "warn", // TODO: Refactor and make this an error
|
||||||
|
"noUnusedImports": "error"
|
||||||
},
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"noVar": "error",
|
"noVar": "error",
|
||||||
|
@ -30,7 +30,6 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode
|
|||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { getPokeballTintColor } from "#app/data/pokeball";
|
import { getPokeballTintColor } from "#app/data/pokeball";
|
||||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
|
||||||
|
|
||||||
/** the i18n namespace for the encounter */
|
/** the i18n namespace for the encounter */
|
||||||
const namespace = "mysteryEncounters/theExpertPokemonBreeder";
|
const namespace = "mysteryEncounters/theExpertPokemonBreeder";
|
||||||
|
@ -332,7 +332,6 @@ export function initMysteryEncounters() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add ANY biome encounters to biome map
|
// Add ANY biome encounters to biome map
|
||||||
// eslint-disable-next-line
|
|
||||||
let _encounterBiomeTableLog = "";
|
let _encounterBiomeTableLog = "";
|
||||||
mysteryEncountersByBiome.forEach((biomeEncounters, biome) => {
|
mysteryEncountersByBiome.forEach((biomeEncounters, biome) => {
|
||||||
anyBiomeEncounters.forEach(encounter => {
|
anyBiomeEncounters.forEach(encounter => {
|
||||||
|
@ -7,7 +7,7 @@ import i18next from "i18next";
|
|||||||
import type { AnySound } from "#app/battle-scene";
|
import type { AnySound } from "#app/battle-scene";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { GameMode } from "#app/game-mode";
|
import type { GameMode } from "#app/game-mode";
|
||||||
import { DexAttr, DexEntry, type StarterMoveset } from "#app/system/game-data";
|
import { DexAttr, type StarterMoveset } from "#app/system/game-data";
|
||||||
import * as Utils from "#app/utils";
|
import * as Utils from "#app/utils";
|
||||||
import { uncatchableSpecies } from "#app/data/balance/biomes";
|
import { uncatchableSpecies } from "#app/data/balance/biomes";
|
||||||
import { speciesEggMoves } from "#app/data/balance/egg-moves";
|
import { speciesEggMoves } from "#app/data/balance/egg-moves";
|
||||||
|
@ -214,7 +214,7 @@ const commonSplashMessages = [
|
|||||||
"bornToBeAWinner",
|
"bornToBeAWinner",
|
||||||
"onARollout",
|
"onARollout",
|
||||||
"itsAlwaysNightDeepInTheAbyss",
|
"itsAlwaysNightDeepInTheAbyss",
|
||||||
"folksThisIsInsane"
|
"folksThisIsInsane",
|
||||||
];
|
];
|
||||||
|
|
||||||
//#region Seasonal Messages
|
//#region Seasonal Messages
|
||||||
@ -224,10 +224,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
name: "New Year's",
|
name: "New Year's",
|
||||||
start: "01-01",
|
start: "01-01",
|
||||||
end: "01-15",
|
end: "01-15",
|
||||||
messages: [
|
messages: ["newYears.happyNewYear", "newYears.andAHappyNewYear"],
|
||||||
"newYears.happyNewYear",
|
|
||||||
"newYears.andAHappyNewYear"
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Valentines",
|
name: "Valentines",
|
||||||
@ -239,7 +236,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"valentines.applinForYou",
|
"valentines.applinForYou",
|
||||||
"valentines.thePowerOfLoveIsThreeThirtyBST",
|
"valentines.thePowerOfLoveIsThreeThirtyBST",
|
||||||
"valentines.haveAHeartScale",
|
"valentines.haveAHeartScale",
|
||||||
"valentines.i<3You"
|
"valentines.i<3You",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -279,7 +276,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"aprilFools.nowWithQuickTimeEncounters",
|
"aprilFools.nowWithQuickTimeEncounters",
|
||||||
"aprilFools.timeYourInputsForHigherCatchrate",
|
"aprilFools.timeYourInputsForHigherCatchrate",
|
||||||
"aprilFools.certifiedButtonSimulator",
|
"aprilFools.certifiedButtonSimulator",
|
||||||
"aprilFools.iHopeYouGetSuckerPunched"
|
"aprilFools.iHopeYouGetSuckerPunched",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -293,7 +290,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"halloween.mayContainSpiders",
|
"halloween.mayContainSpiders",
|
||||||
"halloween.spookyScarySkeledirge",
|
"halloween.spookyScarySkeledirge",
|
||||||
"halloween.gourgeistUsedTrickOrTreat",
|
"halloween.gourgeistUsedTrickOrTreat",
|
||||||
"halloween.letsSnuggleForever"
|
"halloween.letsSnuggleForever",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -316,7 +313,7 @@ const seasonalSplashMessages: Season[] = [
|
|||||||
"winterHoliday.tisTheSeasonToBeSpeSpa",
|
"winterHoliday.tisTheSeasonToBeSpeSpa",
|
||||||
"winterHoliday.deckTheHalls",
|
"winterHoliday.deckTheHalls",
|
||||||
"winterHoliday.saveScummingGetsYouOnTheNaughtyList",
|
"winterHoliday.saveScummingGetsYouOnTheNaughtyList",
|
||||||
"winterHoliday.badTrainersGetRolycoly"
|
"winterHoliday.badTrainersGetRolycoly",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { ModifierTypeFunc } from "#app/modifier/modifier-type";
|
|
||||||
import { Mode } from "#app/ui/ui";
|
import { Mode } from "#app/ui/ui";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { BattlerIndex } from "#app/battle";
|
|
||||||
import { BattlerTagLapseType } from "#app/data/battler-tags";
|
import { BattlerTagLapseType } from "#app/data/battler-tags";
|
||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { BattlerIndex } from "#app/battle";
|
|
||||||
import { applyAbAttrs, applyPostSummonAbAttrs, CommanderAbAttr, PostSummonAbAttr } from "#app/data/ability";
|
import { applyAbAttrs, applyPostSummonAbAttrs, CommanderAbAttr, PostSummonAbAttr } from "#app/data/ability";
|
||||||
import { ArenaTrapTag } from "#app/data/arena-tag";
|
import { ArenaTrapTag } from "#app/data/arena-tag";
|
||||||
import { StatusEffect } from "#app/enums/status-effect";
|
import { StatusEffect } from "#app/enums/status-effect";
|
||||||
|
@ -5,8 +5,8 @@ import type BattleScene from "#app/battle-scene";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
|
|
||||||
type FadeIn = typeof FadeIn;
|
type FadeInType = typeof FadeIn;
|
||||||
type FadeOut = typeof FadeOut;
|
type FadeOutType = typeof FadeOut;
|
||||||
|
|
||||||
export function initGameSpeed() {
|
export function initGameSpeed() {
|
||||||
const thisArg = this as BattleScene;
|
const thisArg = this as BattleScene;
|
||||||
@ -101,7 +101,7 @@ export function initGameSpeed() {
|
|||||||
|
|
||||||
const originalFadeOut = SoundFade.fadeOut;
|
const originalFadeOut = SoundFade.fadeOut;
|
||||||
SoundFade.fadeOut = ((_scene: Phaser.Scene, sound: Phaser.Sound.BaseSound, duration: number, destroy?: boolean) =>
|
SoundFade.fadeOut = ((_scene: Phaser.Scene, sound: Phaser.Sound.BaseSound, duration: number, destroy?: boolean) =>
|
||||||
originalFadeOut(globalScene, sound, transformValue(duration), destroy)) as FadeOut;
|
originalFadeOut(globalScene, sound, transformValue(duration), destroy)) as FadeOutType;
|
||||||
|
|
||||||
const originalFadeIn = SoundFade.fadeIn;
|
const originalFadeIn = SoundFade.fadeIn;
|
||||||
SoundFade.fadeIn = ((
|
SoundFade.fadeIn = ((
|
||||||
@ -110,5 +110,5 @@ export function initGameSpeed() {
|
|||||||
duration: number,
|
duration: number,
|
||||||
endVolume?: number,
|
endVolume?: number,
|
||||||
startVolume?: number,
|
startVolume?: number,
|
||||||
) => originalFadeIn(globalScene, sound, transformValue(duration), endVolume, startVolume)) as FadeIn;
|
) => originalFadeIn(globalScene, sound, transformValue(duration), endVolume, startVolume)) as FadeInType;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,6 @@ import { Moves } from "#enums/moves";
|
|||||||
import type { Species } from "#enums/species";
|
import type { Species } from "#enums/species";
|
||||||
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
||||||
import type { PokemonType } from "#enums/pokemon-type";
|
import type { PokemonType } from "#enums/pokemon-type";
|
||||||
import { getSpeciesFormChangeMessage } from "#app/data/pokemon-forms";
|
|
||||||
|
|
||||||
export default class PokemonData {
|
export default class PokemonData {
|
||||||
public id: number;
|
public id: number;
|
||||||
|
@ -950,7 +950,7 @@ export function setSetting(setting: string, value: number): boolean {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Català",
|
label: "Català",
|
||||||
handler: () => changeLocaleHandler("ca-ES")
|
handler: () => changeLocaleHandler("ca-ES"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: i18next.t("settings:back"),
|
label: i18next.t("settings:back"),
|
||||||
|
@ -1150,8 +1150,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
});
|
});
|
||||||
this.blockInput = false;
|
this.blockInput = false;
|
||||||
} else {
|
} else {
|
||||||
ui.revertMode()
|
ui.revertMode().then(() => {
|
||||||
.then(() => {
|
|
||||||
console.log("exitCallback", this.exitCallback);
|
console.log("exitCallback", this.exitCallback);
|
||||||
if (this.exitCallback instanceof Function) {
|
if (this.exitCallback instanceof Function) {
|
||||||
const exitCallback = this.exitCallback;
|
const exitCallback = this.exitCallback;
|
||||||
|
@ -12,7 +12,7 @@ import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUN
|
|||||||
import { catchableSpecies } from "#app/data/balance/biomes";
|
import { catchableSpecies } from "#app/data/balance/biomes";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import type { DexAttrProps, DexEntry, StarterAttributes, StarterPreferences } from "#app/system/game-data";
|
import type { DexAttrProps, DexEntry, StarterAttributes, StarterPreferences } from "#app/system/game-data";
|
||||||
import { AbilityAttr, DexAttr, loadStarterPreferences, saveStarterPreferences } from "#app/system/game-data";
|
import { AbilityAttr, DexAttr, loadStarterPreferences } from "#app/system/game-data";
|
||||||
import MessageUiHandler from "#app/ui/message-ui-handler";
|
import MessageUiHandler from "#app/ui/message-ui-handler";
|
||||||
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler";
|
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler";
|
||||||
import { TextStyle, addTextObject } from "#app/ui/text";
|
import { TextStyle, addTextObject } from "#app/ui/text";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { CandyUpgradeNotificationChangedEvent } from "#app/events/battle-scene";
|
import type { CandyUpgradeNotificationChangedEvent } from "#app/events/battle-scene";
|
||||||
import { BattleSceneEventType } from "#app/events/battle-scene";
|
import { BattleSceneEventType } from "#app/events/battle-scene";
|
||||||
import { pokemonEvolutions, pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
import { pokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import type { Variant } from "#app/data/variant";
|
import type { Variant } from "#app/data/variant";
|
||||||
import { getVariantTint, getVariantIcon } from "#app/data/variant";
|
import { getVariantTint, getVariantIcon } from "#app/data/variant";
|
||||||
import { argbFromRgba } from "@material/material-color-utilities";
|
import { argbFromRgba } from "@material/material-color-utilities";
|
||||||
@ -19,7 +19,7 @@ import { pokemonFormChanges } from "#app/data/pokemon-forms";
|
|||||||
import type { LevelMoves } from "#app/data/balance/pokemon-level-moves";
|
import type { LevelMoves } from "#app/data/balance/pokemon-level-moves";
|
||||||
import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves";
|
import { pokemonFormLevelMoves, pokemonSpeciesLevelMoves } from "#app/data/balance/pokemon-level-moves";
|
||||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||||
import { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, getPokerusStarters } from "#app/data/pokemon-species";
|
import { allSpecies, getPokemonSpeciesForm, getPokerusStarters } from "#app/data/pokemon-species";
|
||||||
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
import { GameModes } from "#app/game-mode";
|
import { GameModes } from "#app/game-mode";
|
||||||
|
@ -135,9 +135,7 @@ describe("Abilities - Desolate Land", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should lift after fleeing from a wild pokemon", async () => {
|
it("should lift after fleeing from a wild pokemon", async () => {
|
||||||
game.override
|
game.override.enemyAbility(Abilities.DESOLATE_LAND).ability(Abilities.BALL_FETCH);
|
||||||
.enemyAbility(Abilities.DESOLATE_LAND)
|
|
||||||
.ability(Abilities.BALL_FETCH);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
||||||
|
|
||||||
|
@ -40,7 +40,13 @@ describe("Abilities - Flower Gift", () => {
|
|||||||
*
|
*
|
||||||
* @returns Two numbers, the first being the damage done to the target without flower gift active, the second being the damage done with flower gift active
|
* @returns Two numbers, the first being the damage done to the target without flower gift active, the second being the damage done with flower gift active
|
||||||
*/
|
*/
|
||||||
const testDamageDealt = async (game: GameManager, move: Moves, allyAttacker: boolean, allyAbility = Abilities.BALL_FETCH, enemyAbility = Abilities.BALL_FETCH): Promise<[number, number]> => {
|
const testDamageDealt = async (
|
||||||
|
game: GameManager,
|
||||||
|
move: Moves,
|
||||||
|
allyAttacker: boolean,
|
||||||
|
allyAbility = Abilities.BALL_FETCH,
|
||||||
|
enemyAbility = Abilities.BALL_FETCH,
|
||||||
|
): Promise<[number, number]> => {
|
||||||
game.override.battleType("double");
|
game.override.battleType("double");
|
||||||
game.override.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]);
|
game.override.moveset([Moves.SPLASH, Moves.SUNNY_DAY, move, Moves.HEAL_PULSE]);
|
||||||
game.override.enemyMoveset([Moves.SPLASH, Moves.HEAL_PULSE]);
|
game.override.enemyMoveset([Moves.SPLASH, Moves.HEAL_PULSE]);
|
||||||
@ -82,7 +88,6 @@ describe("Abilities - Flower Gift", () => {
|
|||||||
return [damageWithoutGift, damageWithGift];
|
return [damageWithoutGift, damageWithGift];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
phaserGame = new Phaser.Game({
|
phaserGame = new Phaser.Game({
|
||||||
type: Phaser.HEADLESS,
|
type: Phaser.HEADLESS,
|
||||||
@ -144,7 +149,13 @@ describe("Abilities - Flower Gift", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not decrease the damage an ally takes from a mold breaker enemy using a special attack", async () => {
|
it("should not decrease the damage an ally takes from a mold breaker enemy using a special attack", async () => {
|
||||||
const [ damageWithoutGift, damageWithGift ] = await testDamageDealt(game, Moves.MUD_SLAP, false, Abilities.BALL_FETCH, Abilities.MOLD_BREAKER);
|
const [damageWithoutGift, damageWithGift] = await testDamageDealt(
|
||||||
|
game,
|
||||||
|
Moves.MUD_SLAP,
|
||||||
|
false,
|
||||||
|
Abilities.BALL_FETCH,
|
||||||
|
Abilities.MOLD_BREAKER,
|
||||||
|
);
|
||||||
expect(damageWithGift).toBe(damageWithoutGift);
|
expect(damageWithGift).toBe(damageWithoutGift);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -160,9 +160,7 @@ describe("Abilities - Neutralizing Gas", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should deactivate after fleeing from a wild pokemon", async () => {
|
it("should deactivate after fleeing from a wild pokemon", async () => {
|
||||||
game.override
|
game.override.enemyAbility(Abilities.NEUTRALIZING_GAS).ability(Abilities.BALL_FETCH);
|
||||||
.enemyAbility(Abilities.NEUTRALIZING_GAS)
|
|
||||||
.ability(Abilities.BALL_FETCH);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP]);
|
await game.classicMode.startBattle([Species.MAGIKARP]);
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined();
|
expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined();
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { allAbilities } from "#app/data/ability";
|
|
||||||
import { allMoves } from "#app/data/moves/move";
|
import { allMoves } from "#app/data/moves/move";
|
||||||
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
|
@ -9,7 +9,7 @@ describe("Data - Splash Messages", () => {
|
|||||||
|
|
||||||
// Make sure to adjust this test if the weight is changed!
|
// Make sure to adjust this test if the weight is changed!
|
||||||
it("should add contain 15 `battlesWon` splash messages", () => {
|
it("should add contain 15 `battlesWon` splash messages", () => {
|
||||||
const battlesWonMessages = getSplashMessages().filter((message) => message === "splashMessages:battlesWon");
|
const battlesWonMessages = getSplashMessages().filter(message => message === "splashMessages:battlesWon");
|
||||||
expect(battlesWonMessages).toHaveLength(15);
|
expect(battlesWonMessages).toHaveLength(15);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -47,12 +47,9 @@ describe("Items - Reviver Seed", () => {
|
|||||||
{ moveType: "Fixed Damage Move", move: Moves.SEISMIC_TOSS },
|
{ moveType: "Fixed Damage Move", move: Moves.SEISMIC_TOSS },
|
||||||
{ moveType: "Final Gambit", move: Moves.FINAL_GAMBIT },
|
{ moveType: "Final Gambit", move: Moves.FINAL_GAMBIT },
|
||||||
{ moveType: "Counter", move: Moves.COUNTER },
|
{ moveType: "Counter", move: Moves.COUNTER },
|
||||||
{ moveType: "OHKO", move: Moves.SHEER_COLD }
|
{ moveType: "OHKO", move: Moves.SHEER_COLD },
|
||||||
])("should activate the holder's reviver seed from a $moveType", async ({ move }) => {
|
])("should activate the holder's reviver seed from a $moveType", async ({ move }) => {
|
||||||
game.override
|
game.override.enemyLevel(100).startingLevel(1).enemyMoveset(move);
|
||||||
.enemyLevel(100)
|
|
||||||
.startingLevel(1)
|
|
||||||
.enemyMoveset(move);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
player.damageAndUpdate(player.hp - 1);
|
player.damageAndUpdate(player.hp - 1);
|
||||||
@ -67,10 +64,7 @@ describe("Items - Reviver Seed", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should activate the holder's reviver seed from confusion self-hit", async () => {
|
it("should activate the holder's reviver seed from confusion self-hit", async () => {
|
||||||
game.override
|
game.override.enemyLevel(1).startingLevel(100).enemyMoveset(Moves.SPLASH);
|
||||||
.enemyLevel(1)
|
|
||||||
.startingLevel(100)
|
|
||||||
.enemyMoveset(Moves.SPLASH);
|
|
||||||
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
await game.classicMode.startBattle([Species.MAGIKARP, Species.FEEBAS]);
|
||||||
const player = game.scene.getPlayerPokemon()!;
|
const player = game.scene.getPlayerPokemon()!;
|
||||||
player.damageAndUpdate(player.hp - 1);
|
player.damageAndUpdate(player.hp - 1);
|
||||||
|
@ -116,11 +116,7 @@ describe("Moves - Revival Blessing", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not summon multiple pokemon to the same slot when reviving the enemy ally in doubles", async () => {
|
it("should not summon multiple pokemon to the same slot when reviving the enemy ally in doubles", async () => {
|
||||||
game.override
|
game.override.battleType("double").enemyMoveset([Moves.REVIVAL_BLESSING]).moveset([Moves.SPLASH]).startingWave(25); // 2nd rival battle - must have 3+ pokemon
|
||||||
.battleType("double")
|
|
||||||
.enemyMoveset([ Moves.REVIVAL_BLESSING ])
|
|
||||||
.moveset([ Moves.SPLASH ])
|
|
||||||
.startingWave(25); // 2nd rival battle - must have 3+ pokemon
|
|
||||||
await game.classicMode.startBattle([Species.ARCEUS, Species.GIRATINA]);
|
await game.classicMode.startBattle([Species.ARCEUS, Species.GIRATINA]);
|
||||||
|
|
||||||
const enemyFainting = game.scene.getEnemyField()[0];
|
const enemyFainting = game.scene.getEnemyField()[0];
|
||||||
|
@ -1,31 +1,25 @@
|
|||||||
/* eslint-disable */
|
// @ts-nocheck - TODO: remove this
|
||||||
// @ts-nocheck
|
|
||||||
import BattleScene, * as battleScene from "#app/battle-scene";
|
import BattleScene, * as battleScene from "#app/battle-scene";
|
||||||
import { MoveAnim } from "#app/data/battle-anims";
|
import { MoveAnim } from "#app/data/battle-anims";
|
||||||
import Pokemon from "#app/field/pokemon";
|
import Pokemon from "#app/field/pokemon";
|
||||||
import * as Utils from "#app/utils";
|
import * as Utils from "#app/utils";
|
||||||
import { blobToString } from "#test/testUtils/gameManagerUtils";
|
import { blobToString } from "#test/testUtils/gameManagerUtils";
|
||||||
import { MockClock } from "#test/testUtils/mocks/mockClock";
|
import { MockClock } from "#test/testUtils/mocks/mockClock";
|
||||||
import { MockConsoleLog } from "#test/testUtils/mocks/mockConsoleLog";
|
|
||||||
import { MockFetch } from "#test/testUtils/mocks/mockFetch";
|
import { MockFetch } from "#test/testUtils/mocks/mockFetch";
|
||||||
import MockLoader from "#test/testUtils/mocks/mockLoader";
|
import MockLoader from "#test/testUtils/mocks/mockLoader";
|
||||||
import { mockLocalStorage } from "#test/testUtils/mocks/mockLocalStorage";
|
|
||||||
import { MockImage } from "#test/testUtils/mocks/mocksContainer/mockImage";
|
|
||||||
import MockTextureManager from "#test/testUtils/mocks/mockTextureManager";
|
import MockTextureManager from "#test/testUtils/mocks/mockTextureManager";
|
||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import InputText from "phaser3-rex-plugins/plugins/inputtext";
|
|
||||||
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
|
||||||
import { vi } from "vitest";
|
import { vi } from "vitest";
|
||||||
|
import { version } from "../../package.json";
|
||||||
import { MockGameObjectCreator } from "./mocks/mockGameObjectCreator";
|
import { MockGameObjectCreator } from "./mocks/mockGameObjectCreator";
|
||||||
|
import { MockTimedEventManager } from "./mocks/mockTimedEventManager";
|
||||||
import InputManager = Phaser.Input.InputManager;
|
import InputManager = Phaser.Input.InputManager;
|
||||||
import KeyboardManager = Phaser.Input.Keyboard.KeyboardManager;
|
import KeyboardManager = Phaser.Input.Keyboard.KeyboardManager;
|
||||||
import KeyboardPlugin = Phaser.Input.Keyboard.KeyboardPlugin;
|
import KeyboardPlugin = Phaser.Input.Keyboard.KeyboardPlugin;
|
||||||
import GamepadPlugin = Phaser.Input.Gamepad.GamepadPlugin;
|
import GamepadPlugin = Phaser.Input.Gamepad.GamepadPlugin;
|
||||||
import EventEmitter = Phaser.Events.EventEmitter;
|
import EventEmitter = Phaser.Events.EventEmitter;
|
||||||
import UpdateList = Phaser.GameObjects.UpdateList;
|
import UpdateList = Phaser.GameObjects.UpdateList;
|
||||||
import { version } from "../../package.json";
|
|
||||||
import { MockTimedEventManager } from "./mocks/mockTimedEventManager";
|
|
||||||
|
|
||||||
window.URL.createObjectURL = (blob: Blob) => {
|
window.URL.createObjectURL = (blob: Blob) => {
|
||||||
blobToString(blob).then((data: string) => {
|
blobToString(blob).then((data: string) => {
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
import type { Variant } from "#app/data/variant";
|
import type { Variant } from "#app/data/variant";
|
||||||
import { Weather } from "#app/data/weather";
|
import { Weather } from "#app/data/weather";
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import * as GameMode from "#app/game-mode";
|
|
||||||
import type { GameModes } from "#app/game-mode";
|
|
||||||
import { getGameMode } from "#app/game-mode";
|
|
||||||
import type { ModifierOverride } from "#app/modifier/modifier-type";
|
import type { ModifierOverride } from "#app/modifier/modifier-type";
|
||||||
import type { BattleStyle } from "#app/overrides";
|
import type { BattleStyle } from "#app/overrides";
|
||||||
import Overrides, { defaultOverrides } from "#app/overrides";
|
import Overrides, { defaultOverrides } from "#app/overrides";
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { off } from "process";
|
|
||||||
import type { MockGameObject } from "../mockGameObject";
|
import type { MockGameObject } from "../mockGameObject";
|
||||||
|
|
||||||
export default class MockRectangle implements MockGameObject {
|
export default class MockRectangle implements MockGameObject {
|
||||||
|
@ -1,17 +1,4 @@
|
|||||||
import "vitest-canvas-mock";
|
import "vitest-canvas-mock";
|
||||||
|
|
||||||
import { initLoggedInUser } from "#app/account";
|
|
||||||
import { initAbilities } from "#app/data/ability";
|
|
||||||
import { initBiomes } from "#app/data/balance/biomes";
|
|
||||||
import { initEggMoves } from "#app/data/balance/egg-moves";
|
|
||||||
import { initPokemonPrevolutions } from "#app/data/balance/pokemon-evolutions";
|
|
||||||
import { initMoves } from "#app/data/moves/move";
|
|
||||||
import { initMysteryEncounters } from "#app/data/mystery-encounters/mystery-encounters";
|
|
||||||
import { initPokemonForms } from "#app/data/pokemon-forms";
|
|
||||||
import { initSpecies } from "#app/data/pokemon-species";
|
|
||||||
import { initAchievements } from "#app/system/achv";
|
|
||||||
import { initVouchers } from "#app/system/voucher";
|
|
||||||
import { initStatsKeys } from "#app/ui/game-stats-ui-handler";
|
|
||||||
import { afterAll, beforeAll, vi } from "vitest";
|
import { afterAll, beforeAll, vi } from "vitest";
|
||||||
|
|
||||||
import { initTestFile } from "./testUtils/testFileInitialization";
|
import { initTestFile } from "./testUtils/testFileInitialization";
|
||||||
@ -20,13 +7,11 @@ import { initTestFile } from "./testUtils/testFileInitialization";
|
|||||||
|
|
||||||
/** Mock the override import to always return default values, ignoring any custom overrides. */
|
/** Mock the override import to always return default values, ignoring any custom overrides. */
|
||||||
vi.mock("#app/overrides", async importOriginal => {
|
vi.mock("#app/overrides", async importOriginal => {
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
||||||
const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>();
|
const { defaultOverrides } = await importOriginal<typeof import("#app/overrides")>();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
default: defaultOverrides,
|
default: defaultOverrides,
|
||||||
defaultOverrides,
|
defaultOverrides,
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
||||||
} satisfies typeof import("#app/overrides");
|
} satisfies typeof import("#app/overrides");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user