Merge branch 'beta' into move/tar_shot

This commit is contained in:
Adrian T. 2024-09-08 15:24:33 +08:00 committed by GitHub
commit 387ebcf862
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
130 changed files with 802 additions and 627 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,3 +1,3 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
export type ConditionFn = (scene: BattleScene, args?: any[]) => boolean; export type ConditionFn = (scene: BattleScene, args?: any[]) => boolean;

View File

@ -1,4 +1,4 @@
import { type enConfig } from "#app/locales/en/config.js"; import { type enConfig } from "#app/locales/en/config";
import { TOptions } from "i18next"; import { TOptions } from "i18next";
//TODO: this needs to be type properly in the future //TODO: this needs to be type properly in the future

View File

@ -63,7 +63,7 @@ import { Moves } from "#enums/moves";
import { PlayerGender } from "#enums/player-gender"; import { PlayerGender } from "#enums/player-gender";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { UiTheme } from "#enums/ui-theme"; import { UiTheme } from "#enums/ui-theme";
import { TimedEventManager } from "#app/timed-event-manager.js"; import { TimedEventManager } from "#app/timed-event-manager";
import i18next from "i18next"; import i18next from "i18next";
import { TrainerType } from "#enums/trainer-type"; import { TrainerType } from "#enums/trainer-type";
import { battleSpecDialogue } from "./data/dialogue"; import { battleSpecDialogue } from "./data/dialogue";

View File

@ -1,4 +1,4 @@
import {SettingGamepad} from "#app/system/settings/settings-gamepad.js"; import {SettingGamepad} from "#app/system/settings/settings-gamepad";
import {Button} from "#enums/buttons"; import {Button} from "#enums/buttons";
/** /**

View File

@ -1,18 +1,18 @@
import * as Utils from "../utils"; import * as Utils from "../utils";
import i18next from "i18next"; import i18next from "i18next";
import { defaultStarterSpecies, DexAttrProps, GameData } from "#app/system/game-data.js"; import { defaultStarterSpecies, DexAttrProps, GameData } from "#app/system/game-data";
import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm, speciesStarters } from "./pokemon-species"; import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm, speciesStarters } from "./pokemon-species";
import Pokemon, { PokemonMove } from "#app/field/pokemon.js"; import Pokemon, { PokemonMove } from "#app/field/pokemon";
import { BattleType, FixedBattleConfig } from "#app/battle.js"; import { BattleType, FixedBattleConfig } from "#app/battle";
import Trainer, { TrainerVariant } from "#app/field/trainer.js"; import Trainer, { TrainerVariant } from "#app/field/trainer";
import { GameMode } from "#app/game-mode.js"; import { GameMode } from "#app/game-mode";
import { Type } from "./type"; import { Type } from "./type";
import { Challenges } from "#enums/challenges"; import { Challenges } from "#enums/challenges";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { TrainerType } from "#enums/trainer-type"; import { TrainerType } from "#enums/trainer-type";
import { Nature } from "./nature"; import { Nature } from "./nature";
import { Moves } from "#app/enums/moves.js"; import { Moves } from "#app/enums/moves";
import { TypeColor, TypeShadow } from "#app/enums/color.js"; import { TypeColor, TypeShadow } from "#app/enums/color";
import { pokemonEvolutions } from "./pokemon-evolutions"; import { pokemonEvolutions } from "./pokemon-evolutions";
import { pokemonFormChanges } from "./pokemon-forms"; import { pokemonFormChanges } from "./pokemon-forms";

View File

@ -8,7 +8,7 @@ import { PlayerPokemon } from "#app/field/pokemon";
import i18next from "i18next"; import i18next from "i18next";
import { EggTier } from "#enums/egg-type"; import { EggTier } from "#enums/egg-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { EggSourceType } from "#app/enums/egg-source-types.js"; import { EggSourceType } from "#app/enums/egg-source-types";
export const EGG_SEED = 1073741824; export const EGG_SEED = 1073741824;

View File

@ -8,7 +8,7 @@ import { Abilities } from "#enums/abilities";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { TimeOfDay } from "#enums/time-of-day"; import { TimeOfDay } from "#enums/time-of-day";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import i18next from "i18next"; import i18next from "i18next";
import { WeatherType } from "./weather"; import { WeatherType } from "./weather";

View File

@ -4,7 +4,7 @@ import { Type } from "./type";
import * as Utils from "../utils"; import * as Utils from "../utils";
import { ChangeMovePriorityAbAttr, applyAbAttrs } from "./ability"; import { ChangeMovePriorityAbAttr, applyAbAttrs } from "./ability";
import { ProtectAttr } from "./move"; import { ProtectAttr } from "./move";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import i18next from "i18next"; import i18next from "i18next";
export enum TerrainType { export enum TerrainType {

View File

@ -1,4 +1,4 @@
import { VariantTier } from "#app/enums/variant-tier.js"; import { VariantTier } from "#app/enums/variant-tier";
export type Variant = 0 | 1 | 2; export type Variant = 0 | 1 | 2;

View File

@ -1,7 +1,7 @@
import { ArenaTagSide } from "#app/data/arena-tag.js"; import { ArenaTagSide } from "#app/data/arena-tag";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";
import { TerrainType } from "#app/data/terrain.js"; import { TerrainType } from "#app/data/terrain";
import { WeatherType } from "#app/data/weather.js"; import { WeatherType } from "#app/data/weather";
/** Alias for all {@linkcode ArenaEvent} type strings */ /** Alias for all {@linkcode ArenaEvent} type strings */
export enum ArenaEventType { export enum ArenaEventType {

View File

@ -60,7 +60,7 @@ export class Arena {
this.scene.arenaBg.setTexture(`${biomeKey}_bg`); this.scene.arenaBg.setTexture(`${biomeKey}_bg`);
this.scene.arenaBgTransition.setTexture(`${biomeKey}_bg`); this.scene.arenaBgTransition.setTexture(`${biomeKey}_bg`);
// Redo this on initialise because during save/load the current wave isn't always // Redo this on initialize because during save/load the current wave isn't always
// set correctly during construction // set correctly during construction
this.updatePoolsForTimeOfDay(); this.updatePoolsForTimeOfDay();
} }
@ -289,7 +289,7 @@ export class Arena {
/** /**
* Sets weather to the override specified in overrides.ts * Sets weather to the override specified in overrides.ts
* @param weather new weather to set of type WeatherType * @param weather new {@linkcode WeatherType} to set
* @returns true to force trySetWeather to return true * @returns true to force trySetWeather to return true
*/ */
trySetWeatherOverride(weather: WeatherType): boolean { trySetWeatherOverride(weather: WeatherType): boolean {
@ -301,8 +301,8 @@ export class Arena {
/** /**
* Attempts to set a new weather to the battle * Attempts to set a new weather to the battle
* @param weather new weather to set of type WeatherType * @param weather {@linkcode WeatherType} new {@linkcode WeatherType} to set
* @param hasPokemonSource is the new weather from a pokemon * @param hasPokemonSource boolean if the new weather is from a pokemon
* @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use * @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use
*/ */
trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean { trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean {
@ -573,6 +573,12 @@ export class Arena {
this.ignoreAbilities = ignoreAbilities; this.ignoreAbilities = ignoreAbilities;
} }
/**
* Applies each `ArenaTag` in this Arena, based on which side (self, enemy, or both) is passed in as a parameter
* @param tagType Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply
* @param side {@linkcode ArenaTagSide} which side's arena tags to apply
* @param args array of parameters that the called upon tags may need
*/
applyTagsForSide(tagType: ArenaTagType | Constructor<ArenaTag>, side: ArenaTagSide, ...args: unknown[]): void { applyTagsForSide(tagType: ArenaTagType | Constructor<ArenaTag>, side: ArenaTagSide, ...args: unknown[]): void {
let tags = typeof tagType === "string" let tags = typeof tagType === "string"
? this.tags.filter(t => t.tagType === tagType) ? this.tags.filter(t => t.tagType === tagType)
@ -583,11 +589,28 @@ export class Arena {
tags.forEach(t => t.apply(this, args)); tags.forEach(t => t.apply(this, args));
} }
/**
* Applies the specified tag to both sides (ie: both user and trainer's tag that match the Tag specified)
* by calling {@linkcode applyTagsForSide()}
* @param tagType Either an {@linkcode ArenaTagType} string, or an actual {@linkcode ArenaTag} class to filter which ones to apply
* @param args array of parameters that the called upon tags may need
*/
applyTags(tagType: ArenaTagType | Constructor<ArenaTag>, ...args: unknown[]): void { applyTags(tagType: ArenaTagType | Constructor<ArenaTag>, ...args: unknown[]): void {
this.applyTagsForSide(tagType, ArenaTagSide.BOTH, ...args); this.applyTagsForSide(tagType, ArenaTagSide.BOTH, ...args);
} }
addTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves | undefined, sourceId: integer, side: ArenaTagSide = ArenaTagSide.BOTH, quiet: boolean = false, targetIndex?: BattlerIndex): boolean { /**
* Adds a new tag to the arena
* @param tagType {@linkcode ArenaTagType} the tag being added
* @param turnCount How many turns the tag lasts
* @param sourceMove {@linkcode Moves} the move the tag came from, or `undefined` if not from a move
* @param sourceId The ID of the pokemon in play the tag came from (see {@linkcode BattleScene.getPokemonById})
* @param side {@linkcode ArenaTagSide} which side(s) the tag applies to
* @param quiet If a message should be queued on screen to announce the tag being added
* @param targetIndex The {@linkcode BattlerIndex} of the target pokemon
* @returns `false` if there already exists a tag of this type in the Arena
*/
addTag(tagType: ArenaTagType, turnCount: number, sourceMove: Moves | undefined, sourceId: number, side: ArenaTagSide = ArenaTagSide.BOTH, quiet: boolean = false, targetIndex?: BattlerIndex): boolean {
const existingTag = this.getTagOnSide(tagType, side); const existingTag = this.getTagOnSide(tagType, side);
if (existingTag) { if (existingTag) {
existingTag.onOverlap(this); existingTag.onOverlap(this);
@ -600,6 +623,7 @@ export class Arena {
return false; return false;
} }
// creates a new tag object
const newTag = getArenaTag(tagType, turnCount || 0, sourceMove, sourceId, targetIndex, side); const newTag = getArenaTag(tagType, turnCount || 0, sourceMove, sourceId, targetIndex, side);
if (newTag) { if (newTag) {
this.tags.push(newTag); this.tags.push(newTag);
@ -613,6 +637,11 @@ export class Arena {
return true; return true;
} }
/**
* Attempts to get a tag from the Arena via {@linkcode getTagOnSide} that applies to both sides
* @param tagType The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get
* @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there
*/
getTag(tagType: ArenaTagType | Constructor<ArenaTag>): ArenaTag | undefined { getTag(tagType: ArenaTagType | Constructor<ArenaTag>): ArenaTag | undefined {
return this.getTagOnSide(tagType, ArenaTagSide.BOTH); return this.getTagOnSide(tagType, ArenaTagSide.BOTH);
} }
@ -621,16 +650,35 @@ export class Arena {
return !!this.getTag(tagType); return !!this.getTag(tagType);
} }
/**
* Attempts to get a tag from the Arena from a specific side (the tag passed in has to either apply to both sides, or the specific side only)
*
* eg: `MIST` only applies to the user's side, while `MUD_SPORT` applies to both user and enemy side
* @param tagType The {@linkcode ArenaTagType} or {@linkcode ArenaTag} to get
* @param side The {@linkcode ArenaTagSide} to look at
* @returns either the {@linkcode ArenaTag}, or `undefined` if it isn't there
*/
getTagOnSide(tagType: ArenaTagType | Constructor<ArenaTag>, side: ArenaTagSide): ArenaTag | undefined { getTagOnSide(tagType: ArenaTagType | Constructor<ArenaTag>, side: ArenaTagSide): ArenaTag | undefined {
return typeof(tagType) === "string" return typeof(tagType) === "string"
? this.tags.find(t => t.tagType === tagType && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side)) ? this.tags.find(t => t.tagType === tagType && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side))
: this.tags.find(t => t instanceof tagType && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side)); : this.tags.find(t => t instanceof tagType && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side));
} }
/**
* Uses {@linkcode findTagsOnSide} to filter (using the parameter function) for specific tags that apply to both sides
* @param tagPredicate a function mapping {@linkcode ArenaTag}s to `boolean`s
* @returns array of {@linkcode ArenaTag}s from which the Arena's tags return true and apply to both sides
*/
findTags(tagPredicate: (t: ArenaTag) => boolean): ArenaTag[] { findTags(tagPredicate: (t: ArenaTag) => boolean): ArenaTag[] {
return this.findTagsOnSide(tagPredicate, ArenaTagSide.BOTH); return this.findTagsOnSide(tagPredicate, ArenaTagSide.BOTH);
} }
/**
* Returns specific tags from the arena that pass the `tagPredicate` function passed in as a parameter, and apply to the given side
* @param tagPredicate a function mapping {@linkcode ArenaTag}s to `boolean`s
* @param side The {@linkcode ArenaTagSide} to look at
* @returns array of {@linkcode ArenaTag}s from which the Arena's tags return `true` and apply to the given side
*/
findTagsOnSide(tagPredicate: (t: ArenaTag) => boolean, side: ArenaTagSide): ArenaTag[] { findTagsOnSide(tagPredicate: (t: ArenaTag) => boolean, side: ArenaTagSide): ArenaTag[] {
return this.tags.filter(t => tagPredicate(t) && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side)); return this.tags.filter(t => tagPredicate(t) && (side === ArenaTagSide.BOTH || t.side === ArenaTagSide.BOTH || t.side === side));
} }

View File

@ -1431,22 +1431,26 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
let multiplier = types.map(defType => { let multiplier = types.map(defType => {
const multiplier = new Utils.NumberHolder(getTypeDamageMultiplier(moveType, defType));
applyChallenges(this.scene.gameMode, ChallengeType.TYPE_EFFECTIVENESS, multiplier);
if (source) { if (source) {
const ignoreImmunity = new Utils.BooleanHolder(false); const ignoreImmunity = new Utils.BooleanHolder(false);
if (source.isActive(true) && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) { if (source.isActive(true) && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) {
applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, simulated, moveType, defType); applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, simulated, moveType, defType);
} }
if (ignoreImmunity.value) { if (ignoreImmunity.value) {
if (multiplier.value === 0) {
return 1; return 1;
} }
}
const exposedTags = this.findTags(tag => tag instanceof ExposedTag) as ExposedTag[]; const exposedTags = this.findTags(tag => tag instanceof ExposedTag) as ExposedTag[];
if (exposedTags.some(t => t.ignoreImmunity(defType, moveType))) { if (exposedTags.some(t => t.ignoreImmunity(defType, moveType))) {
if (multiplier.value === 0) {
return 1; return 1;
} }
} }
const multiplier = new Utils.NumberHolder(getTypeDamageMultiplier(moveType, defType)); }
applyChallenges(this.scene.gameMode, ChallengeType.TYPE_EFFECTIVENESS, multiplier);
return multiplier.value; return multiplier.value;
}).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier; }).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier;
@ -4505,6 +4509,7 @@ export interface AttackMoveResult {
} }
export class PokemonSummonData { export class PokemonSummonData {
/** [Atk, Def, SpAtk, SpDef, Spd, Acc, Eva] */
public statStages: number[] = [ 0, 0, 0, 0, 0, 0, 0 ]; public statStages: number[] = [ 0, 0, 0, 0, 0, 0, 0 ];
public moveQueue: QueuedMove[] = []; public moveQueue: QueuedMove[] = [];
public tags: BattlerTag[] = []; public tags: BattlerTag[] = [];

View File

@ -16,7 +16,7 @@ import {
getIconForLatestInput, swap, getIconForLatestInput, swap,
} from "#app/configs/inputs/configHandler"; } from "#app/configs/inputs/configHandler";
import BattleScene from "./battle-scene"; import BattleScene from "./battle-scene";
import {SettingGamepad} from "#app/system/settings/settings-gamepad.js"; import {SettingGamepad} from "#app/system/settings/settings-gamepad";
import {SettingKeyboard} from "#app/system/settings/settings-keyboard"; import {SettingKeyboard} from "#app/system/settings/settings-keyboard";
import TouchControl from "#app/touch-controls"; import TouchControl from "#app/touch-controls";
import { Button } from "#enums/buttons"; import { Button } from "#enums/buttons";

View File

@ -4,8 +4,8 @@ import InvertPostFX from "./pipelines/invert";
import { version } from "../package.json"; import { version } from "../package.json";
import UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin"; import UIPlugin from "phaser3-rex-plugins/templates/ui/ui-plugin";
import BBCodeTextPlugin from "phaser3-rex-plugins/plugins/bbcodetext-plugin"; import BBCodeTextPlugin from "phaser3-rex-plugins/plugins/bbcodetext-plugin";
import InputTextPlugin from "phaser3-rex-plugins/plugins/inputtext-plugin.js"; import InputTextPlugin from "phaser3-rex-plugins/plugins/inputtext-plugin";
import TransitionImagePackPlugin from "phaser3-rex-plugins/templates/transitionimagepack/transitionimagepack-plugin.js"; import TransitionImagePackPlugin from "phaser3-rex-plugins/templates/transitionimagepack/transitionimagepack-plugin";
import { LoadingScene } from "./loading-scene"; import { LoadingScene } from "./loading-scene";

View File

@ -25,7 +25,7 @@ import { BattlerTagType } from "#enums/battler-tag-type";
import { BerryType } from "#enums/berry-type"; import { BerryType } from "#enums/berry-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { PermanentStat, TEMP_BATTLE_STATS, TempBattleStat, Stat, getStatKey } from "#app/enums/stat"; import { PermanentStat, TEMP_BATTLE_STATS, TempBattleStat, Stat, getStatKey } from "#app/enums/stat";
const outputModifierData = false; const outputModifierData = false;

View File

@ -26,9 +26,9 @@ import i18next from "i18next";
import { allMoves } from "#app/data/move"; import { allMoves } from "#app/data/move";
import { Abilities } from "#app/enums/abilities"; import { Abilities } from "#app/enums/abilities";
import { LearnMovePhase } from "#app/phases/learn-move-phase.js"; import { LearnMovePhase } from "#app/phases/learn-move-phase";
import { LevelUpPhase } from "#app/phases/level-up-phase.js"; import { LevelUpPhase } from "#app/phases/level-up-phase";
import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase.js"; import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase";
export type ModifierPredicate = (modifier: Modifier) => boolean; export type ModifierPredicate = (modifier: Modifier) => boolean;

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { ModifierTier } from "#app/modifier/modifier-tier.js"; import { ModifierTier } from "#app/modifier/modifier-tier";
import { regenerateModifierPoolThresholds, ModifierPoolType, getEnemyBuffModifierForWave } from "#app/modifier/modifier-type.js"; import { regenerateModifierPoolThresholds, ModifierPoolType, getEnemyBuffModifierForWave } from "#app/modifier/modifier-type";
import { EnemyPersistentModifier } from "#app/modifier/modifier.js"; import { EnemyPersistentModifier } from "#app/modifier/modifier";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
export class AddEnemyBuffModifierPhase extends Phase { export class AddEnemyBuffModifierPhase extends Phase {
constructor(scene: BattleScene) { constructor(scene: BattleScene) {

View File

@ -1,17 +1,17 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { getPokeballCatchMultiplier, getPokeballAtlasKey, getPokeballTintColor, doPokeballBounceAnim } from "#app/data/pokeball.js"; import { getPokeballCatchMultiplier, getPokeballAtlasKey, getPokeballTintColor, doPokeballBounceAnim } from "#app/data/pokeball";
import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect.js"; import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
import { PokeballType } from "#app/enums/pokeball.js"; import { PokeballType } from "#app/enums/pokeball";
import { StatusEffect } from "#app/enums/status-effect.js"; import { StatusEffect } from "#app/enums/status-effect";
import { addPokeballOpenParticles, addPokeballCaptureStars } from "#app/field/anims.js"; import { addPokeballOpenParticles, addPokeballCaptureStars } from "#app/field/anims";
import { EnemyPokemon } from "#app/field/pokemon.js"; import { EnemyPokemon } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { PokemonHeldItemModifier } from "#app/modifier/modifier.js"; import { PokemonHeldItemModifier } from "#app/modifier/modifier";
import { achvs } from "#app/system/achv.js"; import { achvs } from "#app/system/achv";
import { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler.js"; import { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler";
import { SummaryUiMode } from "#app/ui/summary-ui-handler.js"; import { SummaryUiMode } from "#app/ui/summary-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
import { VictoryPhase } from "./victory-phase"; import { VictoryPhase } from "./victory-phase";

View File

@ -28,7 +28,7 @@ export class AttemptRunPhase extends PokemonPhase {
applyAbAttrs(RunSuccessAbAttr, playerPokemon, null, false, escapeChance); applyAbAttrs(RunSuccessAbAttr, playerPokemon, null, false, escapeChance);
if (Utils.randSeedInt(100) < escapeChance.value) { if (playerPokemon.randSeedInt(100) < escapeChance.value) {
this.scene.playSound("se/flee"); this.scene.playSound("se/flee");
this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500); this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500);

View File

@ -1,5 +1,5 @@
import { applyPostBattleAbAttrs, PostBattleAbAttr } from "#app/data/ability.js"; import { applyPostBattleAbAttrs, PostBattleAbAttr } from "#app/data/ability";
import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier.js"; import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { GameOverPhase } from "./game-over-phase"; import { GameOverPhase } from "./game-over-phase";

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { TrainerSlot } from "#app/data/trainer-config.js"; import { TrainerSlot } from "#app/data/trainer-config";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
export class BattlePhase extends Phase { export class BattlePhase extends Phase {
constructor(scene: BattleScene) { constructor(scene: BattleScene) {

View File

@ -1,10 +1,10 @@
import { applyAbAttrs, PreventBerryUseAbAttr, HealFromBerryUseAbAttr } from "#app/data/ability.js"; import { applyAbAttrs, PreventBerryUseAbAttr, HealFromBerryUseAbAttr } from "#app/data/ability";
import { CommonAnim } from "#app/data/battle-anims.js"; import { CommonAnim } from "#app/data/battle-anims";
import { BerryUsedEvent } from "#app/events/battle-scene.js"; import { BerryUsedEvent } from "#app/events/battle-scene";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { BerryModifier } from "#app/modifier/modifier.js"; import { BerryModifier } from "#app/modifier/modifier";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";
import { CommonAnimPhase } from "./common-anim-phase"; import { CommonAnimPhase } from "./common-anim-phase";

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattleStyle } from "#app/enums/battle-style.js"; import { BattleStyle } from "#app/enums/battle-style";
import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { BattlerTagType } from "#app/enums/battler-tag-type";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { PostSummonPhase } from "./post-summon-phase"; import { PostSummonPhase } from "./post-summon-phase";

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims.js"; import { CommonAnim, CommonBattleAnim } from "#app/data/battle-anims";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class CommonAnimPhase extends PokemonPhase { export class CommonAnimPhase extends PokemonPhase {

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { BattleSpec } from "#app/enums/battle-spec.js"; import { BattleSpec } from "#app/enums/battle-spec";
import { DamageResult, HitResult } from "#app/field/pokemon.js"; import { DamageResult, HitResult } from "#app/field/pokemon";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class DamagePhase extends PokemonPhase { export class DamagePhase extends PokemonPhase {

View File

@ -1,7 +1,7 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { PlayerGender } from "#app/enums/player-gender.js"; import { PlayerGender } from "#app/enums/player-gender";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { addTextObject, TextStyle } from "#app/ui/text.js"; import { addTextObject, TextStyle } from "#app/ui/text";
import i18next from "i18next"; import i18next from "i18next";
export class EndCardPhase extends Phase { export class EndCardPhase extends Phase {

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
export class EndEvolutionPhase extends Phase { export class EndEvolutionPhase extends Phase {

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { EnemyPokemon } from "#app/field/pokemon.js"; import { EnemyPokemon } from "#app/field/pokemon";
import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase";
export abstract class EnemyPartyMemberPokemonPhase extends PartyMemberPokemonPhase { export abstract class EnemyPartyMemberPokemonPhase extends PartyMemberPokemonPhase {

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { ExpBoosterModifier } from "#app/modifier/modifier.js"; import { ExpBoosterModifier } from "#app/modifier/modifier";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";
import { LevelUpPhase } from "./level-up-phase"; import { LevelUpPhase } from "./level-up-phase";

View File

@ -1,4 +1,4 @@
import Pokemon from "#app/field/pokemon.js"; import Pokemon from "#app/field/pokemon";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
type PokemonFunc = (pokemon: Pokemon) => void; type PokemonFunc = (pokemon: Pokemon) => void;

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { ModifierTypeFunc } from "#app/modifier/modifier-type.js"; import { ModifierTypeFunc } from "#app/modifier/modifier-type";
import { Mode } from "#app/ui/ui.js"; 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";

View File

@ -1,4 +1,4 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class HidePartyExpBarPhase extends BattlePhase { export class HidePartyExpBarPhase extends BattlePhase {

View File

@ -1,12 +1,12 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims.js"; import { initMoveAnim, loadMoveAnimAssets } from "#app/data/battle-anims";
import { allMoves } from "#app/data/move.js"; import { allMoves } from "#app/data/move";
import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms.js"; import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms";
import { Moves } from "#app/enums/moves.js"; import { Moves } from "#app/enums/moves";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import EvolutionSceneHandler from "#app/ui/evolution-scene-handler.js"; import EvolutionSceneHandler from "#app/ui/evolution-scene-handler";
import { SummaryUiMode } from "#app/ui/summary-ui-handler.js"; import { SummaryUiMode } from "#app/ui/summary-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";

View File

@ -1,11 +1,11 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { ExpNotification } from "#app/enums/exp-notification.js"; import { ExpNotification } from "#app/enums/exp-notification";
import { EvolutionPhase } from "#app/phases/evolution-phase.js"; import { EvolutionPhase } from "#app/phases/evolution-phase";
import { PlayerPokemon } from "#app/field/pokemon.js"; import { PlayerPokemon } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { LevelAchv } from "#app/system/achv.js"; import { LevelAchv } from "#app/system/achv";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";
import { LearnMovePhase } from "./learn-move-phase"; import { LearnMovePhase } from "./learn-move-phase";

View File

@ -1,10 +1,10 @@
import { updateUserInfo } from "#app/account.js"; import { updateUserInfo } from "#app/account";
import BattleScene, { bypassLogin } from "#app/battle-scene.js"; import BattleScene, { bypassLogin } from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { handleTutorial, Tutorial } from "#app/tutorial.js"; import { handleTutorial, Tutorial } from "#app/tutorial";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next, { t } from "i18next"; import i18next, { t } from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { SelectGenderPhase } from "./select-gender-phase"; import { SelectGenderPhase } from "./select-gender-phase";
import { UnavailablePhase } from "./unavailable-phase"; import { UnavailablePhase } from "./unavailable-phase";

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
export class MessagePhase extends Phase { export class MessagePhase extends Phase {
private text: string; private text: string;

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { ModifierType, ModifierTypeFunc, getModifierType } from "#app/modifier/modifier-type.js"; import { ModifierType, ModifierTypeFunc, getModifierType } from "#app/modifier/modifier-type";
import i18next from "i18next"; import i18next from "i18next";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { ArenaTagType } from "#app/enums/arena-tag-type";
import { MoneyMultiplierModifier } from "#app/modifier/modifier.js"; import { MoneyMultiplierModifier } from "#app/modifier/modifier";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class MoneyRewardPhase extends BattlePhase { export class MoneyRewardPhase extends BattlePhase {

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { initMoveAnim, loadMoveAnimAssets, MoveAnim } from "#app/data/battle-anims.js"; import { initMoveAnim, loadMoveAnimAssets, MoveAnim } from "#app/data/battle-anims";
import { allMoves, SelfStatusMove } from "#app/data/move.js"; import { allMoves, SelfStatusMove } from "#app/data/move";
import { Moves } from "#app/enums/moves.js"; import { Moves } from "#app/enums/moves";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class MoveAnimTestPhase extends BattlePhase { export class MoveAnimTestPhase extends BattlePhase {

View File

@ -1,18 +1,18 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { applyPreAttackAbAttrs, AddSecondStrikeAbAttr, IgnoreMoveEffectsAbAttr, applyPostDefendAbAttrs, PostDefendAbAttr, applyPostAttackAbAttrs, PostAttackAbAttr, MaxMultiHitAbAttr, AlwaysHitAbAttr } from "#app/data/ability.js"; import { applyPreAttackAbAttrs, AddSecondStrikeAbAttr, IgnoreMoveEffectsAbAttr, applyPostDefendAbAttrs, PostDefendAbAttr, applyPostAttackAbAttrs, PostAttackAbAttr, MaxMultiHitAbAttr, AlwaysHitAbAttr } from "#app/data/ability";
import { ArenaTagSide, ConditionalProtectTag } from "#app/data/arena-tag.js"; import { ArenaTagSide, ConditionalProtectTag } from "#app/data/arena-tag";
import { MoveAnim } from "#app/data/battle-anims.js"; import { MoveAnim } from "#app/data/battle-anims";
import { BattlerTagLapseType, ProtectedTag, SemiInvulnerableTag } from "#app/data/battler-tags.js"; import { BattlerTagLapseType, ProtectedTag, SemiInvulnerableTag } from "#app/data/battler-tags";
import { MoveTarget, applyMoveAttrs, OverrideMoveEffectAttr, MultiHitAttr, AttackMove, FixedDamageAttr, VariableTargetAttr, MissEffectAttr, MoveFlags, applyFilteredMoveAttrs, MoveAttr, MoveEffectAttr, MoveEffectTrigger, ChargeAttr, MoveCategory, NoEffectAttr, HitsTagAttr } from "#app/data/move.js"; import { MoveTarget, applyMoveAttrs, OverrideMoveEffectAttr, MultiHitAttr, AttackMove, FixedDamageAttr, VariableTargetAttr, MissEffectAttr, MoveFlags, applyFilteredMoveAttrs, MoveAttr, MoveEffectAttr, MoveEffectTrigger, ChargeAttr, MoveCategory, NoEffectAttr, HitsTagAttr } from "#app/data/move";
import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms.js"; import { SpeciesFormChangePostMoveTrigger } from "#app/data/pokemon-forms";
import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { BattlerTagType } from "#app/enums/battler-tag-type";
import { Moves } from "#app/enums/moves.js"; import { Moves } from "#app/enums/moves";
import Pokemon, { PokemonMove, MoveResult, HitResult } from "#app/field/pokemon.js"; import Pokemon, { PokemonMove, MoveResult, HitResult } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { PokemonMultiHitModifier, FlinchChanceModifier, EnemyAttackStatusEffectChanceModifier, ContactHeldItemTransferChanceModifier, HitHealModifier } from "#app/modifier/modifier.js"; import { PokemonMultiHitModifier, FlinchChanceModifier, EnemyAttackStatusEffectChanceModifier, ContactHeldItemTransferChanceModifier, HitHealModifier } from "#app/modifier/modifier";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class MoveEffectPhase extends PokemonPhase { export class MoveEffectPhase extends PokemonPhase {

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { BattlerTagLapseType } from "#app/data/battler-tags.js"; import { BattlerTagLapseType } from "#app/data/battler-tags";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class MoveEndPhase extends PokemonPhase { export class MoveEndPhase extends PokemonPhase {

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { applyMoveAttrs, MoveHeaderAttr } from "#app/data/move.js"; import { applyMoveAttrs, MoveHeaderAttr } from "#app/data/move";
import Pokemon, { PokemonMove } from "#app/field/pokemon.js"; import Pokemon, { PokemonMove } from "#app/field/pokemon";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class MoveHeaderPhase extends BattlePhase { export class MoveHeaderPhase extends BattlePhase {

View File

@ -1,21 +1,21 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { applyAbAttrs, applyPostMoveUsedAbAttrs, applyPreAttackAbAttrs, BlockRedirectAbAttr, IncreasePpAbAttr, PokemonTypeChangeAbAttr, PostMoveUsedAbAttr, RedirectMoveAbAttr } from "#app/data/ability.js"; import { applyAbAttrs, applyPostMoveUsedAbAttrs, applyPreAttackAbAttrs, BlockRedirectAbAttr, IncreasePpAbAttr, PokemonTypeChangeAbAttr, PostMoveUsedAbAttr, RedirectMoveAbAttr } from "#app/data/ability";
import { CommonAnim } from "#app/data/battle-anims.js"; import { CommonAnim } from "#app/data/battle-anims";
import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags.js"; import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags";
import { allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, ChargeAttr, CopyMoveAttr, HealStatusEffectAttr, MoveFlags, PreMoveMessageAttr } from "#app/data/move.js"; import { allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, ChargeAttr, CopyMoveAttr, HealStatusEffectAttr, MoveFlags, PreMoveMessageAttr } from "#app/data/move";
import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms.js"; import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms";
import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect.js"; import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect";
import { Type } from "#app/data/type.js"; import { Type } from "#app/data/type";
import { getTerrainBlockMessage } from "#app/data/weather.js"; import { getTerrainBlockMessage } from "#app/data/weather";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities";
import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { BattlerTagType } from "#app/enums/battler-tag-type";
import { Moves } from "#app/enums/moves.js"; import { Moves } from "#app/enums/moves";
import { StatusEffect } from "#app/enums/status-effect.js"; import { StatusEffect } from "#app/enums/status-effect";
import { MoveUsedEvent } from "#app/events/battle-scene.js"; import { MoveUsedEvent } from "#app/events/battle-scene";
import Pokemon, { MoveResult, PokemonMove, TurnMove } from "#app/field/pokemon.js"; import Pokemon, { MoveResult, PokemonMove, TurnMove } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import i18next from "i18next"; import i18next from "i18next";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { CommonAnimPhase } from "./common-anim-phase"; import { CommonAnimPhase } from "./common-anim-phase";

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { applyAbAttrs, PostBiomeChangeAbAttr } from "#app/data/ability.js"; import { applyAbAttrs, PostBiomeChangeAbAttr } from "#app/data/ability";
import { getRandomWeatherType } from "#app/data/weather.js"; import { getRandomWeatherType } from "#app/data/weather";
import { NextEncounterPhase } from "./next-encounter-phase"; import { NextEncounterPhase } from "./next-encounter-phase";
export class NewBiomeEncounterPhase extends NextEncounterPhase { export class NewBiomeEncounterPhase extends NextEncounterPhase {

View File

@ -1,4 +1,4 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { EncounterPhase } from "./encounter-phase"; import { EncounterPhase } from "./encounter-phase";
export class NextEncounterPhase extends EncounterPhase { export class NextEncounterPhase extends EncounterPhase {

View File

@ -1,10 +1,10 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims.js"; import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims";
import { getStatusEffectObtainText, getStatusEffectOverlapText } from "#app/data/status-effect.js"; import { getStatusEffectObtainText, getStatusEffectOverlapText } from "#app/data/status-effect";
import { StatusEffect } from "#app/enums/status-effect.js"; import { StatusEffect } from "#app/enums/status-effect";
import Pokemon from "#app/field/pokemon.js"; import Pokemon from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
import { PostTurnStatusEffectPhase } from "./post-turn-status-effect-phase"; import { PostTurnStatusEffectPhase } from "./post-turn-status-effect-phase";

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
export class OutdatedPhase extends Phase { export class OutdatedPhase extends Phase {
constructor(scene: BattleScene) { constructor(scene: BattleScene) {

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class PartyHealPhase extends BattlePhase { export class PartyHealPhase extends BattlePhase {

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import Pokemon from "#app/field/pokemon.js"; import Pokemon from "#app/field/pokemon";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";
export abstract class PartyMemberPokemonPhase extends FieldPhase { export abstract class PartyMemberPokemonPhase extends FieldPhase {

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Abilities } from "#app/enums/abilities.js"; import { Abilities } from "#app/enums/abilities";
import Pokemon from "#app/field/pokemon.js"; import Pokemon from "#app/field/pokemon";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { ShowAbilityPhase } from "./show-ability-phase"; import { ShowAbilityPhase } from "./show-ability-phase";

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { PlayerPokemon } from "#app/field/pokemon.js"; import { PlayerPokemon } from "#app/field/pokemon";
import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase";
export abstract class PlayerPartyMemberPokemonPhase extends PartyMemberPokemonPhase { export abstract class PlayerPartyMemberPokemonPhase extends PartyMemberPokemonPhase {

View File

@ -1,14 +1,14 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { CommonAnim } from "#app/data/battle-anims.js"; import { CommonAnim } from "#app/data/battle-anims";
import { getStatusEffectHealText } from "#app/data/status-effect.js"; import { getStatusEffectHealText } from "#app/data/status-effect";
import { StatusEffect } from "#app/enums/status-effect.js"; import { StatusEffect } from "#app/enums/status-effect";
import { HitResult, DamageResult } from "#app/field/pokemon.js"; import { HitResult, DamageResult } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { HealingBoosterModifier } from "#app/modifier/modifier.js"; import { HealingBoosterModifier } from "#app/modifier/modifier";
import { HealAchv } from "#app/system/achv.js"; import { HealAchv } from "#app/system/achv";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { CommonAnimPhase } from "./common-anim-phase"; import { CommonAnimPhase } from "./common-anim-phase";
export class PokemonHealPhase extends CommonAnimPhase { export class PokemonHealPhase extends CommonAnimPhase {

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import Pokemon from "#app/field/pokemon.js"; import Pokemon from "#app/field/pokemon";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";
export abstract class PokemonPhase extends FieldPhase { export abstract class PokemonPhase extends FieldPhase {

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { EndCardPhase } from "./end-card-phase"; import { EndCardPhase } from "./end-card-phase";
import { TitlePhase } from "./title-phase"; import { TitlePhase } from "./title-phase";

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { applyPostSummonAbAttrs, PostSummonAbAttr } from "#app/data/ability.js"; import { applyPostSummonAbAttrs, PostSummonAbAttr } from "#app/data/ability";
import { ArenaTrapTag } from "#app/data/arena-tag.js"; import { ArenaTrapTag } from "#app/data/arena-tag";
import { StatusEffect } from "#app/enums/status-effect.js"; import { StatusEffect } from "#app/enums/status-effect";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class PostSummonPhase extends PokemonPhase { export class PostSummonPhase extends PokemonPhase {

View File

@ -1,12 +1,12 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { applyAbAttrs, BlockNonDirectDamageAbAttr, BlockStatusDamageAbAttr, ReduceBurnDamageAbAttr } from "#app/data/ability.js"; import { applyAbAttrs, BlockNonDirectDamageAbAttr, BlockStatusDamageAbAttr, ReduceBurnDamageAbAttr } from "#app/data/ability";
import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims.js"; import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims";
import { getStatusEffectActivationText } from "#app/data/status-effect.js"; import { getStatusEffectActivationText } from "#app/data/status-effect";
import { BattleSpec } from "#app/enums/battle-spec.js"; import { BattleSpec } from "#app/enums/battle-spec";
import { StatusEffect } from "#app/enums/status-effect.js"; import { StatusEffect } from "#app/enums/status-effect";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class PostTurnStatusEffectPhase extends PokemonPhase { export class PostTurnStatusEffectPhase extends PokemonPhase {

View File

@ -1,10 +1,10 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { SemiInvulnerableTag } from "#app/data/battler-tags.js"; import { SemiInvulnerableTag } from "#app/data/battler-tags";
import { SpeciesFormChange, getSpeciesFormChangeMessage } from "#app/data/pokemon-forms.js"; import { SpeciesFormChange, getSpeciesFormChangeMessage } from "#app/data/pokemon-forms";
import { getTypeRgb } from "#app/data/type.js"; import { getTypeRgb } from "#app/data/type";
import { BattleSpec } from "#app/enums/battle-spec.js"; import { BattleSpec } from "#app/enums/battle-spec";
import Pokemon, { EnemyPokemon } from "#app/field/pokemon.js"; import Pokemon, { EnemyPokemon } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { MovePhase } from "./move-phase"; import { MovePhase } from "./move-phase";
import { PokemonHealPhase } from "./pokemon-heal-phase"; import { PokemonHealPhase } from "./pokemon-heal-phase";

View File

@ -1,7 +1,7 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
export class ReloadSessionPhase extends Phase { export class ReloadSessionPhase extends Phase {
private systemDataStr: string | null; private systemDataStr: string | null;

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms.js"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
import { SwitchSummonPhase } from "./switch-summon-phase"; import { SwitchSummonPhase } from "./switch-summon-phase";
export class ReturnPhase extends SwitchSummonPhase { export class ReturnPhase extends SwitchSummonPhase {

View File

@ -1,7 +1,7 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import PokemonSpecies from "#app/data/pokemon-species.js"; import PokemonSpecies from "#app/data/pokemon-species";
import { ModifierTypeFunc } from "#app/modifier/modifier-type.js"; import { ModifierTypeFunc } from "#app/modifier/modifier-type";
import { Mode } from "#app/ui/ui.js"; 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";

View File

@ -1,10 +1,10 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims.js"; import { CommonBattleAnim, CommonAnim } from "#app/data/battle-anims";
import { Stat } from "#app/enums/stat.js"; import { Stat } from "#app/enums/stat";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { getTextColor, TextStyle } from "#app/ui/text.js"; import { getTextColor, TextStyle } from "#app/ui/text";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";

View File

@ -1,11 +1,11 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { biomeLinks, getBiomeName } from "#app/data/biomes.js"; import { biomeLinks, getBiomeName } from "#app/data/biomes";
import { Biome } from "#app/enums/biome.js"; import { Biome } from "#app/enums/biome";
import { MoneyInterestModifier, MapModifier } from "#app/modifier/modifier.js"; import { MoneyInterestModifier, MapModifier } from "#app/modifier/modifier";
import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler.js"; import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { PartyHealPhase } from "./party-heal-phase"; import { PartyHealPhase } from "./party-heal-phase";
import { SwitchBiomePhase } from "./switch-biome-phase"; import { SwitchBiomePhase } from "./switch-biome-phase";

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
export class SelectChallengePhase extends Phase { export class SelectChallengePhase extends Phase {
constructor(scene: BattleScene) { constructor(scene: BattleScene) {

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { PlayerGender } from "#app/enums/player-gender.js"; import { PlayerGender } from "#app/enums/player-gender";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { SettingKeys } from "#app/system/settings/settings.js"; import { SettingKeys } from "#app/system/settings/settings";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
export class SelectGenderPhase extends Phase { export class SelectGenderPhase extends Phase {

View File

@ -1,12 +1,12 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { ModifierTier } from "#app/modifier/modifier-tier.js"; import { ModifierTier } from "#app/modifier/modifier-tier";
import { regenerateModifierPoolThresholds, ModifierTypeOption, ModifierType, getPlayerShopModifierTypeOptionsForWave, PokemonModifierType, FusePokemonModifierType, PokemonMoveModifierType, TmModifierType, RememberMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, ModifierPoolType, getPlayerModifierTypeOptions } from "#app/modifier/modifier-type.js"; import { regenerateModifierPoolThresholds, ModifierTypeOption, ModifierType, getPlayerShopModifierTypeOptionsForWave, PokemonModifierType, FusePokemonModifierType, PokemonMoveModifierType, TmModifierType, RememberMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, ModifierPoolType, getPlayerModifierTypeOptions } from "#app/modifier/modifier-type";
import { ExtraModifierModifier, Modifier, PokemonHeldItemModifier } from "#app/modifier/modifier.js"; import { ExtraModifierModifier, Modifier, PokemonHeldItemModifier } from "#app/modifier/modifier";
import ModifierSelectUiHandler, { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/modifier-select-ui-handler.js"; import ModifierSelectUiHandler, { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/modifier-select-ui-handler";
import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler.js"; import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";

View File

@ -1,15 +1,15 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; import { applyChallenges, ChallengeType } from "#app/data/challenge";
import { Gender } from "#app/data/gender.js"; import { Gender } from "#app/data/gender";
import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms.js"; import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms";
import { getPokemonSpecies } from "#app/data/pokemon-species.js"; import { getPokemonSpecies } from "#app/data/pokemon-species";
import { Species } from "#app/enums/species.js"; import { Species } from "#app/enums/species";
import { PlayerPokemon } from "#app/field/pokemon.js"; import { PlayerPokemon } from "#app/field/pokemon";
import { overrideModifiers, overrideHeldItems } from "#app/modifier/modifier.js"; import { overrideModifiers, overrideHeldItems } from "#app/modifier/modifier";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler.js"; import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler";
import { Starter } from "#app/ui/starter-select-ui-handler.js"; import { Starter } from "#app/ui/starter-select-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
import { TitlePhase } from "./title-phase"; import { TitlePhase } from "./title-phase";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";

View File

@ -1,7 +1,7 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { Command } from "#app/ui/command-ui-handler.js"; import { Command } from "#app/ui/command-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import { CommandPhase } from "./command-phase"; import { CommandPhase } from "./command-phase";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class ShinySparklePhase extends PokemonPhase { export class ShinySparklePhase extends PokemonPhase {

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { PokemonPhase } from "./pokemon-phase"; import { PokemonPhase } from "./pokemon-phase";
export class ShowAbilityPhase extends PokemonPhase { export class ShowAbilityPhase extends PokemonPhase {

View File

@ -1,7 +1,7 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { ExpNotification } from "#app/enums/exp-notification.js"; import { ExpNotification } from "#app/enums/exp-notification";
import { ExpBoosterModifier } from "#app/modifier/modifier.js"; import { ExpBoosterModifier } from "#app/modifier/modifier";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { HidePartyExpBarPhase } from "./hide-party-exp-bar-phase"; import { HidePartyExpBarPhase } from "./hide-party-exp-bar-phase";
import { LevelUpPhase } from "./level-up-phase"; import { LevelUpPhase } from "./level-up-phase";
import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase"; import { PlayerPartyMemberPokemonPhase } from "./player-party-member-pokemon-phase";

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { PlayerGender } from "#app/enums/player-gender.js"; import { PlayerGender } from "#app/enums/player-gender";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class ShowTrainerPhase extends BattlePhase { export class ShowTrainerPhase extends BattlePhase {

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import i18next from "i18next"; import i18next from "i18next";
import { SummonPhase } from "./summon-phase"; import { SummonPhase } from "./summon-phase";

View File

@ -1,12 +1,12 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattleType } from "#app/battle.js"; import { BattleType } from "#app/battle";
import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball.js"; import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball";
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms.js"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
import { TrainerSlot } from "#app/data/trainer-config.js"; import { TrainerSlot } from "#app/data/trainer-config";
import { PlayerGender } from "#app/enums/player-gender.js"; import { PlayerGender } from "#app/enums/player-gender";
import { addPokeballOpenParticles } from "#app/field/anims.js"; import { addPokeballOpenParticles } from "#app/field/anims";
import Pokemon, { FieldPosition } from "#app/field/pokemon.js"; import Pokemon, { FieldPosition } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import i18next from "i18next"; import i18next from "i18next";
import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase"; import { PartyMemberPokemonPhase } from "./party-member-pokemon-phase";
import { PostSummonPhase } from "./post-summon-phase"; import { PostSummonPhase } from "./post-summon-phase";

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Biome } from "#app/enums/biome.js"; import { Biome } from "#app/enums/biome";
import { getBiomeKey } from "#app/field/arena.js"; import { getBiomeKey } from "#app/field/arena";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class SwitchBiomePhase extends BattlePhase { export class SwitchBiomePhase extends BattlePhase {

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler.js"; import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { SwitchSummonPhase } from "./switch-summon-phase"; import { SwitchSummonPhase } from "./switch-summon-phase";

View File

@ -1,13 +1,13 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr } from "#app/data/ability.js"; import { applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr } from "#app/data/ability";
import { allMoves, ForceSwitchOutAttr } from "#app/data/move.js"; import { allMoves, ForceSwitchOutAttr } from "#app/data/move";
import { getPokeballTintColor } from "#app/data/pokeball.js"; import { getPokeballTintColor } from "#app/data/pokeball";
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms.js"; import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
import { TrainerSlot } from "#app/data/trainer-config.js"; import { TrainerSlot } from "#app/data/trainer-config";
import Pokemon from "#app/field/pokemon.js"; import Pokemon from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { SwitchEffectTransferModifier } from "#app/modifier/modifier.js"; import { SwitchEffectTransferModifier } from "#app/modifier/modifier";
import { Command } from "#app/ui/command-ui-handler.js"; import { Command } from "#app/ui/command-ui-handler";
import i18next from "i18next"; import i18next from "i18next";
import { PostSummonPhase } from "./post-summon-phase"; import { PostSummonPhase } from "./post-summon-phase";
import { SummonPhase } from "./summon-phase"; import { SummonPhase } from "./summon-phase";

View File

@ -1,4 +1,4 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { MessagePhase } from "./message-phase"; import { MessagePhase } from "./message-phase";
export class TestMessagePhase extends MessagePhase { export class TestMessagePhase extends MessagePhase {

View File

@ -1,21 +1,21 @@
import { loggedInUser } from "#app/account.js"; import { loggedInUser } from "#app/account";
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattleType } from "#app/battle.js"; import { BattleType } from "#app/battle";
import { getDailyRunStarters, fetchDailyRunSeed } from "#app/data/daily-run.js"; import { getDailyRunStarters, fetchDailyRunSeed } from "#app/data/daily-run";
import { Gender } from "#app/data/gender.js"; import { Gender } from "#app/data/gender";
import { getBiomeKey } from "#app/field/arena.js"; import { getBiomeKey } from "#app/field/arena";
import { GameModes, GameMode, getGameMode } from "#app/game-mode.js"; import { GameModes, GameMode, getGameMode } from "#app/game-mode";
import { regenerateModifierPoolThresholds, ModifierPoolType, modifierTypes, getDailyRunStarterModifiers } from "#app/modifier/modifier-type.js"; import { regenerateModifierPoolThresholds, ModifierPoolType, modifierTypes, getDailyRunStarterModifiers } from "#app/modifier/modifier-type";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { SessionSaveData } from "#app/system/game-data.js"; import { SessionSaveData } from "#app/system/game-data";
import { Unlockables } from "#app/system/unlockables.js"; import { Unlockables } from "#app/system/unlockables";
import { vouchers } from "#app/system/voucher.js"; import { vouchers } from "#app/system/voucher";
import { OptionSelectItem, OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler.js"; import { OptionSelectItem, OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handler";
import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler.js"; import { SaveSlotUiMode } from "#app/ui/save-slot-select-ui-handler";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { Modifier } from "#app/modifier/modifier.js"; import { Modifier } from "#app/modifier/modifier";
import { CheckSwitchPhase } from "./check-switch-phase"; import { CheckSwitchPhase } from "./check-switch-phase";
import { EncounterPhase } from "./encounter-phase"; import { EncounterPhase } from "./encounter-phase";
import { SelectChallengePhase } from "./select-challenge-phase"; import { SelectChallengePhase } from "./select-challenge-phase";

View File

@ -1,5 +1,5 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { FieldPosition } from "#app/field/pokemon.js"; import { FieldPosition } from "#app/field/pokemon";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
export class ToggleDoublePositionPhase extends BattlePhase { export class ToggleDoublePositionPhase extends BattlePhase {

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { trainerConfigs } from "#app/data/trainer-config.js"; import { trainerConfigs } from "#app/data/trainer-config";
import { TrainerType } from "#app/enums/trainer-type.js"; import { TrainerType } from "#app/enums/trainer-type";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { TestMessagePhase } from "./test-message-phase"; import { TestMessagePhase } from "./test-message-phase";

View File

@ -1,10 +1,10 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { getCharVariantFromDialogue } from "#app/data/dialogue.js"; import { getCharVariantFromDialogue } from "#app/data/dialogue";
import { TrainerType } from "#app/enums/trainer-type.js"; import { TrainerType } from "#app/enums/trainer-type";
import { modifierTypes } from "#app/modifier/modifier-type.js"; import { modifierTypes } from "#app/modifier/modifier-type";
import { vouchers } from "#app/system/voucher.js"; import { vouchers } from "#app/system/voucher";
import i18next from "i18next"; import i18next from "i18next";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import { BattlePhase } from "./battle-phase"; import { BattlePhase } from "./battle-phase";
import { ModifierRewardPhase } from "./modifier-reward-phase"; import { ModifierRewardPhase } from "./modifier-reward-phase";
import { MoneyRewardPhase } from "./money-reward-phase"; import { MoneyRewardPhase } from "./money-reward-phase";

View File

@ -1,12 +1,12 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/ability.js"; import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/ability";
import { BattlerTagLapseType } from "#app/data/battler-tags.js"; import { BattlerTagLapseType } from "#app/data/battler-tags";
import { TerrainType } from "#app/data/terrain.js"; import { TerrainType } from "#app/data/terrain";
import { WeatherType } from "#app/enums/weather-type.js"; import { WeatherType } from "#app/enums/weather-type";
import { TurnEndEvent } from "#app/events/battle-scene.js"; import { TurnEndEvent } from "#app/events/battle-scene";
import Pokemon from "#app/field/pokemon.js"; import Pokemon from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages.js"; import { getPokemonNameWithAffix } from "#app/messages";
import { TurnHealModifier, EnemyTurnHealModifier, EnemyStatusEffectHealChanceModifier, TurnStatusEffectModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier.js"; import { TurnHealModifier, EnemyTurnHealModifier, EnemyStatusEffectHealChanceModifier, TurnStatusEffectModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier";
import i18next from "i18next"; import i18next from "i18next";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";
import { PokemonHealPhase } from "./pokemon-heal-phase"; import { PokemonHealPhase } from "./pokemon-heal-phase";

View File

@ -1,7 +1,7 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex } from "#app/battle.js"; import { BattlerIndex } from "#app/battle";
import { TurnInitEvent } from "#app/events/battle-scene.js"; import { TurnInitEvent } from "#app/events/battle-scene";
import { PlayerPokemon } from "#app/field/pokemon.js"; import { PlayerPokemon } from "#app/field/pokemon";
import i18next from "i18next"; import i18next from "i18next";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";
import { ToggleDoublePositionPhase } from "./toggle-double-position-phase"; import { ToggleDoublePositionPhase } from "./toggle-double-position-phase";

View File

@ -1,6 +1,6 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import { LoginPhase } from "./login-phase"; import { LoginPhase } from "./login-phase";
export class UnavailablePhase extends Phase { export class UnavailablePhase extends Phase {

View File

@ -1,7 +1,7 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { Phase } from "#app/phase.js"; import { Phase } from "#app/phase";
import { Unlockables, getUnlockableName } from "#app/system/unlockables.js"; import { Unlockables, getUnlockableName } from "#app/system/unlockables";
import { Mode } from "#app/ui/ui.js"; import { Mode } from "#app/ui/ui";
import i18next from "i18next"; import i18next from "i18next";
export class UnlockPhase extends Phase { export class UnlockPhase extends Phase {

View File

@ -1,8 +1,8 @@
import BattleScene from "#app/battle-scene.js"; import BattleScene from "#app/battle-scene";
import { BattlerIndex, BattleType } from "#app/battle.js"; import { BattlerIndex, BattleType } from "#app/battle";
import { modifierTypes } from "#app/modifier/modifier-type.js"; import { modifierTypes } from "#app/modifier/modifier-type";
import { ExpShareModifier, ExpBalanceModifier, MultipleParticipantExpBonusModifier, PokemonExpBoosterModifier } from "#app/modifier/modifier.js"; import { ExpShareModifier, ExpBalanceModifier, MultipleParticipantExpBonusModifier, PokemonExpBoosterModifier } from "#app/modifier/modifier";
import * as Utils from "#app/utils.js"; import * as Utils from "#app/utils";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";
import { BattleEndPhase } from "./battle-end-phase"; import { BattleEndPhase } from "./battle-end-phase";
import { NewBattlePhase } from "./new-battle-phase"; import { NewBattlePhase } from "./new-battle-phase";

View File

@ -2,7 +2,7 @@ import BattleScene from "#app/battle-scene";
import { applyPreWeatherEffectAbAttrs, SuppressWeatherEffectAbAttr, PreWeatherDamageAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr } from "#app/data/ability.js"; import { applyPreWeatherEffectAbAttrs, SuppressWeatherEffectAbAttr, PreWeatherDamageAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPostWeatherLapseAbAttrs, PostWeatherLapseAbAttr } from "#app/data/ability.js";
import { CommonAnim } from "#app/data/battle-anims"; import { CommonAnim } from "#app/data/battle-anims";
import { Weather, getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weather"; import { Weather, getWeatherDamageMessage, getWeatherLapseMessage } from "#app/data/weather";
import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { BattlerTagType } from "#app/enums/battler-tag-type";
import { WeatherType } from "#app/enums/weather-type"; import { WeatherType } from "#app/enums/weather-type";
import Pokemon, { HitResult } from "#app/field/pokemon"; import Pokemon, { HitResult } from "#app/field/pokemon";
import * as Utils from "#app/utils"; import * as Utils from "#app/utils";

View File

@ -2,17 +2,17 @@ import i18next from "i18next";
import LanguageDetector from "i18next-browser-languagedetector"; import LanguageDetector from "i18next-browser-languagedetector";
import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor"; import processor, { KoreanPostpositionProcessor } from "i18next-korean-postposition-processor";
import { caEsConfig} from "#app/locales/ca_ES/config.js"; import { caEsConfig} from "#app/locales/ca_ES/config";
import { deConfig } from "#app/locales/de/config.js"; import { deConfig } from "#app/locales/de/config";
import { enConfig } from "#app/locales/en/config.js"; import { enConfig } from "#app/locales/en/config";
import { esConfig } from "#app/locales/es/config.js"; import { esConfig } from "#app/locales/es/config";
import { frConfig } from "#app/locales/fr/config.js"; import { frConfig } from "#app/locales/fr/config";
import { itConfig } from "#app/locales/it/config.js"; import { itConfig } from "#app/locales/it/config";
import { koConfig } from "#app/locales/ko/config.js"; import { koConfig } from "#app/locales/ko/config";
import { jaConfig } from "#app/locales/ja/config.js"; import { jaConfig } from "#app/locales/ja/config";
import { ptBrConfig } from "#app/locales/pt_BR/config.js"; import { ptBrConfig } from "#app/locales/pt_BR/config";
import { zhCnConfig } from "#app/locales/zh_CN/config.js"; import { zhCnConfig } from "#app/locales/zh_CN/config";
import { zhTwConfig } from "#app/locales/zh_TW/config.js"; import { zhTwConfig } from "#app/locales/zh_TW/config";
interface LoadingFontFaceProperty { interface LoadingFontFaceProperty {
face: FontFace, face: FontFace,

View File

@ -2,7 +2,7 @@ import { Arena } from "../field/arena";
import { ArenaTag } from "../data/arena-tag"; import { ArenaTag } from "../data/arena-tag";
import { Biome } from "#enums/biome"; import { Biome } from "#enums/biome";
import { Weather } from "../data/weather"; import { Weather } from "../data/weather";
import { Terrain } from "#app/data/terrain.js"; import { Terrain } from "#app/data/terrain";
export default class ArenaData { export default class ArenaData {
public biome: Biome; public biome: Biome;

View File

@ -1,4 +1,4 @@
import { Challenge, copyChallenge } from "#app/data/challenge.js"; import { Challenge, copyChallenge } from "#app/data/challenge";
export default class ChallengeData { export default class ChallengeData {
public id: integer; public id: integer;

View File

@ -2,7 +2,7 @@ import { EggTier } from "#enums/egg-type";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { VariantTier } from "#enums/variant-tiers"; import { VariantTier } from "#enums/variant-tiers";
import { EGG_SEED, Egg } from "../data/egg"; import { EGG_SEED, Egg } from "../data/egg";
import { EggSourceType } from "#app/enums/egg-source-types.js"; import { EggSourceType } from "#app/enums/egg-source-types";
export default class EggData { export default class EggData {
public id: integer; public id: integer;

View File

@ -1,7 +1,7 @@
import i18next from "i18next"; import i18next from "i18next";
import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene"; import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene";
import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon";
import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions"; import { pokemonPrevolutions } from "../data/pokemon-evolutions";
import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species"; import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species";
import * as Utils from "../utils"; import * as Utils from "../utils";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";
@ -27,24 +27,25 @@ import { Tutorial } from "../tutorial";
import { speciesEggMoves } from "../data/egg-moves"; import { speciesEggMoves } from "../data/egg-moves";
import { allMoves } from "../data/move"; import { allMoves } from "../data/move";
import { TrainerVariant } from "../field/trainer"; import { TrainerVariant } from "../field/trainer";
import { Variant, variantData } from "#app/data/variant"; import { Variant } from "#app/data/variant";
import {setSettingGamepad, SettingGamepad, settingGamepadDefaults} from "./settings/settings-gamepad"; import {setSettingGamepad, SettingGamepad, settingGamepadDefaults} from "./settings/settings-gamepad";
import {setSettingKeyboard, SettingKeyboard} from "#app/system/settings/settings-keyboard"; import {setSettingKeyboard, SettingKeyboard} from "#app/system/settings/settings-keyboard";
import { TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena.js"; import { TerrainChangedEvent, WeatherChangedEvent } from "#app/events/arena";
import { EnemyAttackStatusEffectChanceModifier } from "../modifier/modifier"; import * as Modifier from "../modifier/modifier";
import { StatusEffect } from "#app/data/status-effect.js"; import { StatusEffect } from "#app/data/status-effect";
import ChallengeData from "./challenge-data"; import ChallengeData from "./challenge-data";
import { Device } from "#enums/devices"; import { Device } from "#enums/devices";
import { GameDataType } from "#enums/game-data-type"; import { GameDataType } from "#enums/game-data-type";
import { Moves } from "#enums/moves"; import { Moves } from "#enums/moves";
import { PlayerGender } from "#enums/player-gender"; import { PlayerGender } from "#enums/player-gender";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { applyChallenges, ChallengeType } from "#app/data/challenge.js"; import { applyChallenges, ChallengeType } from "#app/data/challenge";
import { WeatherType } from "#app/enums/weather-type.js"; import { WeatherType } from "#app/enums/weather-type";
import { TerrainType } from "#app/data/terrain.js"; import { TerrainType } from "#app/data/terrain";
import { OutdatedPhase } from "#app/phases/outdated-phase.js"; import { OutdatedPhase } from "#app/phases/outdated-phase";
import { ReloadSessionPhase } from "#app/phases/reload-session-phase.js"; import { ReloadSessionPhase } from "#app/phases/reload-session-phase";
import { RUN_HISTORY_LIMIT } from "#app/ui/run-history-ui-handler"; import { RUN_HISTORY_LIMIT } from "#app/ui/run-history-ui-handler";
import { applySessionDataPatches, applySettingsDataPatches, applySystemDataPatches } from "./version-converter";
export const defaultStarterSpecies: Species[] = [ export const defaultStarterSpecies: Species[] = [
Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE,
@ -93,7 +94,7 @@ export function decrypt(data: string, bypassLogin: boolean): string {
: (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8))(data); : (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8))(data);
} }
interface SystemSaveData { export interface SystemSaveData {
trainerId: integer; trainerId: integer;
secretId: integer; secretId: integer;
gender: PlayerGender; gender: PlayerGender;
@ -456,17 +457,14 @@ export class GameData {
localStorage.setItem(`data_${loggedInUser?.username}`, encrypt(systemDataStr, bypassLogin)); localStorage.setItem(`data_${loggedInUser?.username}`, encrypt(systemDataStr, bypassLogin));
/*const versions = [ this.scene.game.config.gameVersion, data.gameVersion || '0.0.0' ];
if (versions[0] !== versions[1]) {
const [ versionNumbers, oldVersionNumbers ] = versions.map(ver => ver.split('.').map(v => parseInt(v)));
}*/
const lsItemKey = `runHistoryData_${loggedInUser?.username}`; const lsItemKey = `runHistoryData_${loggedInUser?.username}`;
const lsItem = localStorage.getItem(lsItemKey); const lsItem = localStorage.getItem(lsItemKey);
if (!lsItem) { if (!lsItem) {
localStorage.setItem(lsItemKey, ""); localStorage.setItem(lsItemKey, "");
} }
applySystemDataPatches(systemData);
this.trainerId = systemData.trainerId; this.trainerId = systemData.trainerId;
this.secretId = systemData.secretId; this.secretId = systemData.secretId;
@ -474,9 +472,7 @@ export class GameData {
this.saveSetting(SettingKeys.Player_Gender, systemData.gender === PlayerGender.FEMALE ? 1 : 0); this.saveSetting(SettingKeys.Player_Gender, systemData.gender === PlayerGender.FEMALE ? 1 : 0);
const initStarterData = !systemData.starterData; if (!systemData.starterData) {
if (initStarterData) {
this.initStarterData(); this.initStarterData();
if (systemData["starterMoveData"]) { if (systemData["starterMoveData"]) {
@ -494,25 +490,20 @@ export class GameData {
} }
this.migrateStarterAbilities(systemData, this.starterData); this.migrateStarterAbilities(systemData, this.starterData);
const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species);
for (const s of starterIds) {
this.starterData[s].candyCount += this.dexData[s].caughtCount;
this.starterData[s].candyCount += this.dexData[s].hatchedCount * 2;
if (this.dexData[s].caughtAttr & DexAttr.SHINY) {
this.starterData[s].candyCount += 4;
}
}
} else { } else {
if ([ "1.0.0", "1.0.1" ].includes(systemData.gameVersion)) {
this.migrateStarterAbilities(systemData);
}
//this.fixVariantData(systemData);
this.fixStarterData(systemData);
// Migrate ability starter data if empty for caught species
Object.keys(systemData.starterData).forEach(sd => {
if (systemData.dexData[sd].caughtAttr && !systemData.starterData[sd].abilityAttr) {
systemData.starterData[sd].abilityAttr = 1;
}
});
this.starterData = systemData.starterData; this.starterData = systemData.starterData;
} }
if (systemData.gameStats) { if (systemData.gameStats) {
if (systemData.gameStats.legendaryPokemonCaught !== undefined && systemData.gameStats.subLegendaryPokemonCaught === undefined) {
this.fixLegendaryStats(systemData);
}
this.gameStats = systemData.gameStats; this.gameStats = systemData.gameStats;
} }
@ -558,17 +549,6 @@ export class GameData {
this.consolidateDexData(this.dexData); this.consolidateDexData(this.dexData);
this.defaultDexData = null; this.defaultDexData = null;
if (initStarterData) {
const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species);
for (const s of starterIds) {
this.starterData[s].candyCount += this.dexData[s].caughtCount;
this.starterData[s].candyCount += this.dexData[s].hatchedCount * 2;
if (this.dexData[s].caughtAttr & DexAttr.SHINY) {
this.starterData[s].candyCount += 4;
}
}
}
resolve(true); resolve(true);
} catch (err) { } catch (err) {
console.error(err); console.error(err);
@ -747,6 +727,7 @@ export class GameData {
setSetting(this.scene, setting, valueIndex); setSetting(this.scene, setting, valueIndex);
settings[setting] = valueIndex; settings[setting] = valueIndex;
settings["gameVersion"] = this.scene.game.config.gameVersion;
localStorage.setItem("settings", JSON.stringify(settings)); localStorage.setItem("settings", JSON.stringify(settings));
@ -857,13 +838,7 @@ export class GameData {
const settings = JSON.parse(localStorage.getItem("settings")!); // TODO: is this bang correct? const settings = JSON.parse(localStorage.getItem("settings")!); // TODO: is this bang correct?
// TODO: Remove this block after save migration is implemented applySettingsDataPatches(settings);
if (settings.hasOwnProperty("REROLL_TARGET") && !settings.hasOwnProperty(SettingKeys.Shop_Cursor_Target)) {
settings[SettingKeys.Shop_Cursor_Target] = settings["REROLL_TARGET"];
delete settings["REROLL_TARGET"];
localStorage.setItem("settings", JSON.stringify(settings));
}
// End of block to remove
for (const setting of Object.keys(settings)) { for (const setting of Object.keys(settings)) {
setSetting(this.scene, setting, settings[setting]); setSetting(this.scene, setting, settings[setting]);
@ -1090,10 +1065,8 @@ export class GameData {
// TODO // TODO
//scene.arena.tags = sessionData.arena.tags; //scene.arena.tags = sessionData.arena.tags;
const modifiersModule = await import("../modifier/modifier");
for (const modifierData of sessionData.modifiers) { for (const modifierData of sessionData.modifiers) {
const modifier = modifierData.toModifier(scene, modifiersModule[modifierData.className]); const modifier = modifierData.toModifier(scene, Modifier[modifierData.className]);
if (modifier) { if (modifier) {
scene.addModifier(modifier, true); scene.addModifier(modifier, true);
} }
@ -1102,7 +1075,7 @@ export class GameData {
scene.updateModifiers(true); scene.updateModifiers(true);
for (const enemyModifierData of sessionData.enemyModifiers) { for (const enemyModifierData of sessionData.enemyModifiers) {
const modifier = enemyModifierData.toModifier(scene, modifiersModule[enemyModifierData.className]); const modifier = enemyModifierData.toModifier(scene, Modifier[enemyModifierData.className]);
if (modifier) { if (modifier) {
scene.addEnemyModifier(modifier, true); scene.addEnemyModifier(modifier, true);
} }
@ -1226,7 +1199,7 @@ export class GameData {
} }
parseSessionData(dataStr: string): SessionSaveData { parseSessionData(dataStr: string): SessionSaveData {
return JSON.parse(dataStr, (k: string, v: any) => { const sessionData = JSON.parse(dataStr, (k: string, v: any) => {
/*const versions = [ scene.game.config.gameVersion, sessionData.gameVersion || '0.0.0' ]; /*const versions = [ scene.game.config.gameVersion, sessionData.gameVersion || '0.0.0' ];
if (versions[0] !== versions[1]) { if (versions[0] !== versions[1]) {
@ -1258,7 +1231,7 @@ export class GameData {
if (md?.className === "ExpBalanceModifier") { // Temporarily limit EXP Balance until it gets reworked if (md?.className === "ExpBalanceModifier") { // Temporarily limit EXP Balance until it gets reworked
md.stackCount = Math.min(md.stackCount, 4); md.stackCount = Math.min(md.stackCount, 4);
} }
if (md instanceof EnemyAttackStatusEffectChanceModifier && md.effect === StatusEffect.FREEZE || md.effect === StatusEffect.SLEEP) { if (md instanceof Modifier.EnemyAttackStatusEffectChanceModifier && md.effect === StatusEffect.FREEZE || md.effect === StatusEffect.SLEEP) {
continue; continue;
} }
ret.push(new PersistentModifierData(md, player)); ret.push(new PersistentModifierData(md, player));
@ -1283,6 +1256,10 @@ export class GameData {
return v; return v;
}) as SessionSaveData; }) as SessionSaveData;
applySessionDataPatches(sessionData);
return sessionData;
} }
saveAll(scene: BattleScene, skipVerification: boolean = false, sync: boolean = false, useCachedSession: boolean = false, useCachedSystem: boolean = false): Promise<boolean> { saveAll(scene: BattleScene, skipVerification: boolean = false, sync: boolean = false, useCachedSession: boolean = false, useCachedSystem: boolean = false): Promise<boolean> {
@ -1885,75 +1862,4 @@ export class GameData {
} }
} }
} }
fixVariantData(systemData: SystemSaveData): void {
const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species);
const starterData = systemData.starterData;
const dexData = systemData.dexData;
if (starterIds.find(id => (dexData[id].caughtAttr & DexAttr.VARIANT_2 || dexData[id].caughtAttr & DexAttr.VARIANT_3) && !variantData[id])) {
for (const s of starterIds) {
const species = getPokemonSpecies(s);
if (variantData[s]) {
const tempCaughtAttr = dexData[s].caughtAttr;
let seenVariant2 = false;
let seenVariant3 = false;
const checkEvoSpecies = (es: Species) => {
seenVariant2 ||= !!(dexData[es].seenAttr & DexAttr.VARIANT_2);
seenVariant3 ||= !!(dexData[es].seenAttr & DexAttr.VARIANT_3);
if (pokemonEvolutions.hasOwnProperty(es)) {
for (const pe of pokemonEvolutions[es]) {
checkEvoSpecies(pe.speciesId);
}
}
};
checkEvoSpecies(s);
if (dexData[s].caughtAttr & DexAttr.VARIANT_2 && !seenVariant2) {
dexData[s].caughtAttr ^= DexAttr.VARIANT_2;
}
if (dexData[s].caughtAttr & DexAttr.VARIANT_3 && !seenVariant3) {
dexData[s].caughtAttr ^= DexAttr.VARIANT_3;
}
starterData[s].abilityAttr = (tempCaughtAttr & DexAttr.DEFAULT_VARIANT ? AbilityAttr.ABILITY_1 : 0)
| (tempCaughtAttr & DexAttr.VARIANT_2 && species.ability2 ? AbilityAttr.ABILITY_2 : 0)
| (tempCaughtAttr & DexAttr.VARIANT_3 && species.abilityHidden ? AbilityAttr.ABILITY_HIDDEN : 0);
} else {
const tempCaughtAttr = dexData[s].caughtAttr;
if (dexData[s].caughtAttr & DexAttr.VARIANT_2) {
dexData[s].caughtAttr ^= DexAttr.VARIANT_2;
}
if (dexData[s].caughtAttr & DexAttr.VARIANT_3) {
dexData[s].caughtAttr ^= DexAttr.VARIANT_3;
}
starterData[s].abilityAttr = (tempCaughtAttr & DexAttr.DEFAULT_VARIANT ? AbilityAttr.ABILITY_1 : 0)
| (tempCaughtAttr & DexAttr.VARIANT_2 && species.ability2 ? AbilityAttr.ABILITY_2 : 0)
| (tempCaughtAttr & DexAttr.VARIANT_3 && species.abilityHidden ? AbilityAttr.ABILITY_HIDDEN : 0);
}
}
}
}
fixStarterData(systemData: SystemSaveData): void {
for (const starterId of defaultStarterSpecies) {
systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
systemData.dexData[starterId].caughtAttr |= DexAttr.FEMALE;
}
}
fixLegendaryStats(systemData: SystemSaveData): void {
systemData.gameStats.subLegendaryPokemonSeen = 0;
systemData.gameStats.subLegendaryPokemonCaught = 0;
systemData.gameStats.subLegendaryPokemonHatched = 0;
allSpecies.filter(s => s.subLegendary).forEach(s => {
const dexEntry = systemData.dexData[s.speciesId];
systemData.gameStats.subLegendaryPokemonSeen += dexEntry.seenCount;
systemData.gameStats.legendaryPokemonSeen = Math.max(systemData.gameStats.legendaryPokemonSeen - dexEntry.seenCount, 0);
systemData.gameStats.subLegendaryPokemonCaught += dexEntry.caughtCount;
systemData.gameStats.legendaryPokemonCaught = Math.max(systemData.gameStats.legendaryPokemonCaught - dexEntry.caughtCount, 0);
systemData.gameStats.subLegendaryPokemonHatched += dexEntry.hatchedCount;
systemData.gameStats.legendaryPokemonHatched = Math.max(systemData.gameStats.legendaryPokemonHatched - dexEntry.hatchedCount, 0);
});
systemData.gameStats.subLegendaryPokemonSeen = Math.max(systemData.gameStats.subLegendaryPokemonSeen, systemData.gameStats.subLegendaryPokemonCaught);
systemData.gameStats.legendaryPokemonSeen = Math.max(systemData.gameStats.legendaryPokemonSeen, systemData.gameStats.legendaryPokemonCaught);
systemData.gameStats.mythicalPokemonSeen = Math.max(systemData.gameStats.mythicalPokemonSeen, systemData.gameStats.mythicalPokemonCaught);
}
} }

View File

@ -3,11 +3,11 @@ import { PersistentModifier } from "../modifier/modifier";
import { GeneratedPersistentModifierType, ModifierType, ModifierTypeGenerator, getModifierTypeFuncById } from "../modifier/modifier-type"; import { GeneratedPersistentModifierType, ModifierType, ModifierTypeGenerator, getModifierTypeFuncById } from "../modifier/modifier-type";
export default class ModifierData { export default class ModifierData {
private player: boolean; public player: boolean;
private typeId: string; public typeId: string;
private typePregenArgs: any[]; public typePregenArgs: any[];
private args: any[]; public args: any[];
private stackCount: integer; public stackCount: integer;
public className: string; public className: string;

View File

@ -8,7 +8,7 @@ import SettingsUiHandler from "#app/ui/settings/settings-ui-handler";
import { EaseType } from "#enums/ease-type"; import { EaseType } from "#enums/ease-type";
import { MoneyFormat } from "#enums/money-format"; import { MoneyFormat } from "#enums/money-format";
import { PlayerGender } from "#enums/player-gender"; import { PlayerGender } from "#enums/player-gender";
import { getIsInitialized, initI18n } from "#app/plugins/i18n.js"; import { getIsInitialized, initI18n } from "#app/plugins/i18n";
import { ShopCursorTarget } from "#app/enums/shop-cursor-target"; import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
function getTranslation(key: string): string { function getTranslation(key: string): string {

View File

@ -0,0 +1,137 @@
import { allSpecies } from "#app/data/pokemon-species.js";
import { AbilityAttr, defaultStarterSpecies, DexAttr, SessionSaveData, SystemSaveData } from "./game-data";
import { SettingKeys } from "./settings/settings";
const LATEST_VERSION = "1.0.5";
export function applySessionDataPatches(data: SessionSaveData) {
const curVersion = data.gameVersion;
if (curVersion !== LATEST_VERSION) {
switch (curVersion) {
case "1.0.0":
case "1.0.1":
case "1.0.2":
case "1.0.3":
case "1.0.4":
// --- PATCHES ---
// Fix Battle Items, Vitamins, and Lures
data.modifiers.forEach((m) => {
if (m.className === "PokemonBaseStatModifier") {
m.className = "BaseStatModifier";
} else if (m.className === "PokemonResetNegativeStatStageModifier") {
m.className = "ResetNegativeStatStageModifier";
} else if (m.className === "TempBattleStatBoosterModifier") {
m.className = "TempStatStageBoosterModifier";
m.typeId = "TEMP_STAT_STAGE_BOOSTER";
// Migration from TempBattleStat to Stat
const newStat = m.typePregenArgs[0] + 1;
m.typePregenArgs[0] = newStat;
// From [ stat, battlesLeft ] to [ stat, maxBattles, battleCount ]
m.args = [ newStat, 5, m.args[1] ];
} else if (m.className === "DoubleBattleChanceBoosterModifier") {
let maxBattles: number;
switch (m.typeId) {
case "MAX_LURE":
maxBattles = 30;
break;
case "SUPER_LURE":
maxBattles = 15;
break;
default:
maxBattles = 10;
break;
}
// From [ battlesLeft ] to [ maxBattles, battleCount ]
m.args = [ maxBattles, m.args[0] ];
}
});
data.enemyModifiers.forEach((m) => {
if (m.className === "PokemonBaseStatModifier") {
m.className = "BaseStatModifier";
}
});
}
data.gameVersion = LATEST_VERSION;
}
}
export function applySystemDataPatches(data: SystemSaveData) {
const curVersion = data.gameVersion;
if (curVersion !== LATEST_VERSION) {
switch (curVersion) {
case "1.0.0":
case "1.0.1":
case "1.0.2":
case "1.0.3":
case "1.0.4":
// --- LEGACY PATCHES ---
if (data.starterData) {
// Migrate ability starter data if empty for caught species
Object.keys(data.starterData).forEach(sd => {
if (data.dexData[sd].caughtAttr && !data.starterData[sd].abilityAttr) {
data.starterData[sd].abilityAttr = 1;
}
});
}
// Fix Legendary Stats
if (data.gameStats && (data.gameStats.legendaryPokemonCaught !== undefined && data.gameStats.subLegendaryPokemonCaught === undefined)) {
data.gameStats.subLegendaryPokemonSeen = 0;
data.gameStats.subLegendaryPokemonCaught = 0;
data.gameStats.subLegendaryPokemonHatched = 0;
allSpecies.filter(s => s.subLegendary).forEach(s => {
const dexEntry = data.dexData[s.speciesId];
data.gameStats.subLegendaryPokemonSeen += dexEntry.seenCount;
data.gameStats.legendaryPokemonSeen = Math.max(data.gameStats.legendaryPokemonSeen - dexEntry.seenCount, 0);
data.gameStats.subLegendaryPokemonCaught += dexEntry.caughtCount;
data.gameStats.legendaryPokemonCaught = Math.max(data.gameStats.legendaryPokemonCaught - dexEntry.caughtCount, 0);
data.gameStats.subLegendaryPokemonHatched += dexEntry.hatchedCount;
data.gameStats.legendaryPokemonHatched = Math.max(data.gameStats.legendaryPokemonHatched - dexEntry.hatchedCount, 0);
});
data.gameStats.subLegendaryPokemonSeen = Math.max(data.gameStats.subLegendaryPokemonSeen, data.gameStats.subLegendaryPokemonCaught);
data.gameStats.legendaryPokemonSeen = Math.max(data.gameStats.legendaryPokemonSeen, data.gameStats.legendaryPokemonCaught);
data.gameStats.mythicalPokemonSeen = Math.max(data.gameStats.mythicalPokemonSeen, data.gameStats.mythicalPokemonCaught);
}
// --- PATCHES ---
// Fix Starter Data
if (data.gameVersion) {
for (const starterId of defaultStarterSpecies) {
data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
data.dexData[starterId].caughtAttr |= DexAttr.FEMALE;
}
}
}
data.gameVersion = LATEST_VERSION;
}
}
export function applySettingsDataPatches(settings: Object) {
const curVersion = settings.hasOwnProperty("gameVersion") ? settings["gameVersion"] : "1.0.0";
if (curVersion !== LATEST_VERSION) {
switch (curVersion) {
case "1.0.0":
case "1.0.1":
case "1.0.2":
case "1.0.3":
case "1.0.4":
// --- PATCHES ---
// Fix Reward Cursor Target
if (settings.hasOwnProperty("REROLL_TARGET") && !settings.hasOwnProperty(SettingKeys.Shop_Cursor_Target)) {
settings[SettingKeys.Shop_Cursor_Target] = settings["REROLL_TARGET"];
delete settings["REROLL_TARGET"];
localStorage.setItem("settings", JSON.stringify(settings));
}
}
// Note that the current game version will be written at `saveSettings`
}
}

View File

@ -3,8 +3,8 @@ import i18next from "i18next";
import { AchvTier, achvs, getAchievementDescription } from "./achv"; import { AchvTier, achvs, getAchievementDescription } from "./achv";
import { PlayerGender } from "#enums/player-gender"; import { PlayerGender } from "#enums/player-gender";
import { TrainerType } from "#enums/trainer-type"; import { TrainerType } from "#enums/trainer-type";
import { ConditionFn } from "#app/@types/common.js"; import { ConditionFn } from "#app/@types/common";
import { trainerConfigs } from "#app/data/trainer-config.js"; import { trainerConfigs } from "#app/data/trainer-config";
export enum VoucherType { export enum VoucherType {
REGULAR, REGULAR,

View File

@ -1,7 +1,7 @@
import { Abilities } from "#app/enums/abilities"; import { Abilities } from "#app/enums/abilities";
import { Moves } from "#app/enums/moves"; import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species"; import { Species } from "#app/enums/species";
import { HitResult } from "#app/field/pokemon.js"; import { HitResult } from "#app/field/pokemon";
import GameManager from "#test/utils/gameManager"; import GameManager from "#test/utils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

View File

@ -1,4 +1,4 @@
import { DamagePhase } from "#app/phases/damage-phase.js"; import { DamagePhase } from "#app/phases/damage-phase";
import { toDmgValue } from "#app/utils"; import { toDmgValue } from "#app/utils";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { ArenaTagType } from "#enums/arena-tag-type"; import { ArenaTagType } from "#enums/arena-tag-type";

Some files were not shown because too many files have changed in this diff Show More