Add WiP logic for daily run and fix some performance issues
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 103 B After Width: | Height: | Size: 103 B |
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
Before Width: | Height: | Size: 106 B After Width: | Height: | Size: 106 B |
|
@ -53,12 +53,16 @@ import PokemonSpriteSparkleHandler from './field/pokemon-sprite-sparkle-handler'
|
|||
import CharSprite from './ui/char-sprite';
|
||||
import DamageNumberHandler from './field/damage-number-handler';
|
||||
import PokemonInfoContainer from './ui/pokemon-info-container';
|
||||
import { biomeDepths } from './data/biomes';
|
||||
|
||||
export const bypassLogin = false;
|
||||
export const startingLevel = 5;
|
||||
export const startingWave = 1;
|
||||
export const startingBiome = Biome.TOWN;
|
||||
export const startingMoney = 1000;
|
||||
|
||||
export const STARTING_LEVEL_OVERRIDE = 0;
|
||||
export const STARTING_WAVE_OVERRIDE = 0;
|
||||
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
||||
export const STARTING_MONEY_OVERRIDE = 0;
|
||||
|
||||
export const startingWave = STARTING_WAVE_OVERRIDE || 1;
|
||||
|
||||
const expSpriteKeys: string[] = [];
|
||||
|
||||
|
@ -146,6 +150,7 @@ export default class BattleScene extends Phaser.Scene {
|
|||
|
||||
public seed: string;
|
||||
public waveSeed: string;
|
||||
public waveCycleOffset: integer;
|
||||
|
||||
public damageNumberHandler: DamageNumberHandler
|
||||
private spriteSparkleHandler: PokemonSpriteSparkleHandler;
|
||||
|
@ -298,11 +303,12 @@ export default class BattleScene extends Phaser.Scene {
|
|||
this.loadImage(`summary_tabs_${t}`, 'ui');
|
||||
|
||||
this.loadImage('starter_select_bg', 'ui');
|
||||
this.loadImage('starter_select_cursor', 'ui');
|
||||
this.loadImage('starter_select_cursor_highlight', 'ui');
|
||||
this.loadImage('starter_select_cursor_pokerus', 'ui');
|
||||
this.loadImage('starter_select_gen_cursor', 'ui');
|
||||
this.loadImage('starter_select_gen_cursor_highlight', 'ui');
|
||||
this.loadImage('select_cursor', 'ui');
|
||||
this.loadImage('select_cursor_highlight', 'ui');
|
||||
this.loadImage('select_cursor_highlight_thick', 'ui');
|
||||
this.loadImage('select_cursor_pokerus', 'ui');
|
||||
this.loadImage('select_gen_cursor', 'ui');
|
||||
this.loadImage('select_gen_cursor_highlight', 'ui');
|
||||
|
||||
this.loadImage('default_bg', 'arenas');
|
||||
|
||||
|
@ -744,13 +750,18 @@ export default class BattleScene extends Phaser.Scene {
|
|||
return pokemon;
|
||||
}
|
||||
|
||||
setSeed(seed: string): void {
|
||||
this.seed = seed;
|
||||
this.waveCycleOffset = this.getGenerateWaveCycleOffset();
|
||||
}
|
||||
|
||||
reset(clearScene?: boolean): void {
|
||||
this.seed = Utils.randomString(16);
|
||||
this.setSeed(Utils.randomString(16));
|
||||
console.log('Seed:', this.seed);
|
||||
|
||||
this.gameMode = gameModes[GameModes.CLASSIC];
|
||||
|
||||
this.money = startingMoney;
|
||||
this.money = 0;
|
||||
|
||||
this.pokeballCounts = Object.fromEntries(Utils.getEnumValues(PokeballType).filter(p => p <= PokeballType.MASTER_BALL).map(t => [ t, 0 ]));
|
||||
this.pokeballCounts[PokeballType.POKEBALL] += 5;
|
||||
|
@ -767,13 +778,14 @@ export default class BattleScene extends Phaser.Scene {
|
|||
p.destroy();
|
||||
|
||||
this.currentBattle = null;
|
||||
|
||||
this.waveCountText.setText(startingWave.toString());
|
||||
this.waveCountText.setVisible(false);
|
||||
|
||||
this.updateMoneyText();
|
||||
this.moneyText.setVisible(false);
|
||||
|
||||
this.newArena(startingBiome, true);
|
||||
this.newArena(STARTING_BIOME_OVERRIDE || Biome.TOWN, true);
|
||||
|
||||
this.arenaBgTransition.setPosition(0, 0);
|
||||
this.arenaPlayer.setPosition(300, 0);
|
||||
|
@ -1009,7 +1021,7 @@ export default class BattleScene extends Phaser.Scene {
|
|||
return this.arena.getSpeciesFormIndex(species);
|
||||
}
|
||||
|
||||
getWaveCycleOffset(): integer {
|
||||
private getGenerateWaveCycleOffset(): integer {
|
||||
let ret = 0;
|
||||
this.executeWithSeedOffset(() => {
|
||||
ret = Utils.randSeedInt(8) * 5;
|
||||
|
@ -1170,6 +1182,29 @@ export default class BattleScene extends Phaser.Scene {
|
|||
return filteredSpecies[Utils.randSeedInt(filteredSpecies.length)];
|
||||
}
|
||||
|
||||
generateRandomBiome(waveIndex: integer): Biome {
|
||||
const relWave = waveIndex % 250;
|
||||
const biomes = Utils.getEnumValues(Biome).slice(1, Utils.getEnumValues(Biome).filter(b => b >= 40).length * -1);
|
||||
const maxDepth = biomeDepths[Biome.END][0] - 2;
|
||||
const depthWeights = new Array(maxDepth + 1).fill(null)
|
||||
.map((_, i: integer) => ((1 - Math.min(Math.abs((i / (maxDepth - 1)) - (relWave / 250)) + 0.25, 1)) / 0.75) * 250);
|
||||
const biomeThresholds: integer[] = [];
|
||||
let totalWeight = 0;
|
||||
for (let biome of biomes) {
|
||||
totalWeight += Math.ceil(depthWeights[biomeDepths[biome][0] - 1] / biomeDepths[biome][1]);
|
||||
biomeThresholds.push(totalWeight);
|
||||
}
|
||||
|
||||
const randInt = Utils.randSeedInt(totalWeight);
|
||||
|
||||
for (let biome of biomes) {
|
||||
if (randInt < biomeThresholds[biome])
|
||||
return biome;
|
||||
}
|
||||
|
||||
return biomes[Utils.randSeedInt(biomes.length)];
|
||||
}
|
||||
|
||||
checkInput(): boolean {
|
||||
if (this.blockInput)
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
import BattleScene from "../battle-scene";
|
||||
import { PlayerPokemon } from "../field/pokemon";
|
||||
import { GameModes, gameModes } from "../game-mode";
|
||||
import { Starter } from "../ui/starter-select-ui-handler";
|
||||
import * as Utils from "../utils";
|
||||
import { Species } from "./enums/species";
|
||||
import { getPokemonSpecies, speciesStarters } from "./pokemon-species";
|
||||
|
||||
export interface DailyRunConfig {
|
||||
seed: integer;
|
||||
starters: Starter;
|
||||
}
|
||||
|
||||
export function getDailyRunSeed(scene: BattleScene): string {
|
||||
return 'Test';//Utils.randomString(16)
|
||||
}
|
||||
|
||||
export function getDailyRunStarters(scene: BattleScene): Starter[] {
|
||||
const seed = getDailyRunSeed(scene);
|
||||
const starters: Starter[] = [];
|
||||
|
||||
scene.executeWithSeedOffset(() => {
|
||||
const starterWeights = [];
|
||||
starterWeights.push(Math.round(3.5 + Math.abs(Utils.randSeedGauss(1))));
|
||||
starterWeights.push(Utils.randSeedInt(9 - starterWeights[0], 1));
|
||||
starterWeights.push(10 - (starterWeights[0] + starterWeights[1]));
|
||||
|
||||
for (let s = 0; s < starterWeights.length; s++) {
|
||||
const weight = starterWeights[s];
|
||||
const weightSpecies = Object.keys(speciesStarters)
|
||||
.map(s => parseInt(s) as Species)
|
||||
.filter(s => speciesStarters[s] === weight);
|
||||
const starterSpecies = getPokemonSpecies(Phaser.Math.RND.pick(weightSpecies));
|
||||
const pokemon = new PlayerPokemon(scene, starterSpecies, gameModes[GameModes.DAILY].getStartingLevel(), undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
const starter: Starter = {
|
||||
species: starterSpecies,
|
||||
dexAttr: pokemon.getDexAttr(),
|
||||
nature: pokemon.nature,
|
||||
pokerus: pokemon.pokerus
|
||||
};
|
||||
starters.push(starter);
|
||||
pokemon.destroy();
|
||||
}
|
||||
}, 0, seed);
|
||||
|
||||
return starters;
|
||||
}
|
|
@ -11,7 +11,6 @@ import { Type } from "../data/type";
|
|||
import Move from "../data/move";
|
||||
import { ArenaTag, ArenaTagSide, getArenaTag } from "../data/arena-tag";
|
||||
import { ArenaTagType } from "../data/enums/arena-tag-type";
|
||||
import { GameModes } from "../game-mode";
|
||||
import { TrainerType } from "../data/enums/trainer-type";
|
||||
import { BattlerIndex } from "../battle";
|
||||
import { Moves } from "../data/enums/moves";
|
||||
|
@ -357,7 +356,7 @@ export class Arena {
|
|||
return TimeOfDay.NIGHT;
|
||||
}
|
||||
|
||||
const waveCycle = ((this.scene.currentBattle?.waveIndex || 0) + this.scene.getWaveCycleOffset()) % 40;
|
||||
const waveCycle = ((this.scene.currentBattle?.waveIndex || 0) + this.scene.waveCycleOffset) % 40;
|
||||
|
||||
if (waveCycle < 15)
|
||||
return TimeOfDay.DAY;
|
||||
|
|
|
@ -1932,7 +1932,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
}
|
||||
|
||||
destroy(): void {
|
||||
this.battleInfo.destroy();
|
||||
this.battleInfo?.destroy();
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
@ -2046,8 +2046,10 @@ export class PlayerPokemon extends Pokemon {
|
|||
this.abilityIndex = abilityCount - 1;
|
||||
this.compatibleTms.splice(0, this.compatibleTms.length);
|
||||
this.generateCompatibleTms();
|
||||
this.scene.gameData.setPokemonSeen(this, false);
|
||||
this.scene.gameData.setPokemonCaught(this, false);
|
||||
if (!this.scene.gameMode.isDaily || this.metBiome > -1) {
|
||||
this.scene.gameData.setPokemonSeen(this, false);
|
||||
this.scene.gameData.setPokemonCaught(this, false);
|
||||
}
|
||||
this.loadAssets().then(() => {
|
||||
this.calculateStats();
|
||||
this.updateInfo(true).then(() => resolve());
|
||||
|
@ -2091,8 +2093,10 @@ export class PlayerPokemon extends Pokemon {
|
|||
this.abilityIndex = abilityCount - 1;
|
||||
this.compatibleTms.splice(0, this.compatibleTms.length);
|
||||
this.generateCompatibleTms();
|
||||
this.scene.gameData.setPokemonSeen(this, false);
|
||||
this.scene.gameData.setPokemonCaught(this, false);
|
||||
if (!this.scene.gameMode.isDaily || this.metBiome > -1) {
|
||||
this.scene.gameData.setPokemonSeen(this, false);
|
||||
this.scene.gameData.setPokemonCaught(this, false);
|
||||
}
|
||||
this.loadAssets().then(() => {
|
||||
this.calculateStats();
|
||||
this.scene.updateModifiers(true, true);
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import BattleScene, { STARTING_BIOME_OVERRIDE, STARTING_LEVEL_OVERRIDE, STARTING_MONEY_OVERRIDE } from "./battle-scene";
|
||||
import { Biome } from "./data/enums/biome";
|
||||
|
||||
export enum GameModes {
|
||||
CLASSIC,
|
||||
ENDLESS,
|
||||
|
@ -32,6 +35,30 @@ export class GameMode implements GameModeConfig {
|
|||
Object.assign(this, config);
|
||||
}
|
||||
|
||||
getStartingLevel(): integer {
|
||||
if (STARTING_LEVEL_OVERRIDE)
|
||||
return STARTING_LEVEL_OVERRIDE;
|
||||
switch (this.modeId) {
|
||||
case GameModes.DAILY:
|
||||
return 20;
|
||||
default:
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
getStartingMoney(): integer {
|
||||
return STARTING_MONEY_OVERRIDE || 1000;
|
||||
}
|
||||
|
||||
getStartingBiome(scene: BattleScene): Biome {
|
||||
switch (this.modeId) {
|
||||
case GameModes.DAILY:
|
||||
return scene.generateRandomBiome(this.getWaveForDifficulty(1));
|
||||
default:
|
||||
return STARTING_BIOME_OVERRIDE || Biome.TOWN;
|
||||
}
|
||||
}
|
||||
|
||||
getWaveForDifficulty(waveIndex: integer): integer {
|
||||
switch (this.modeId) {
|
||||
case GameModes.DAILY:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import BattleScene, { bypassLogin, startingLevel, startingWave } from "./battle-scene";
|
||||
import BattleScene, { STARTING_BIOME_OVERRIDE, bypassLogin, startingWave } from "./battle-scene";
|
||||
import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon";
|
||||
import * as Utils from './utils';
|
||||
import { Moves } from "./data/enums/moves";
|
||||
|
@ -16,7 +16,7 @@ import EvolutionSceneHandler from "./ui/evolution-scene-handler";
|
|||
import { EvolutionPhase } from "./evolution-phase";
|
||||
import { Phase } from "./phase";
|
||||
import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "./data/battle-stat";
|
||||
import { biomeDepths, biomeLinks } from "./data/biomes";
|
||||
import { biomeLinks } from "./data/biomes";
|
||||
import { Biome } from "./data/enums/biome";
|
||||
import { ModifierTier } from "./modifier/modifier-tier";
|
||||
import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, RememberMoveModifierType, TmModifierType, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptionsForWave, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type";
|
||||
|
@ -53,6 +53,8 @@ import { Tutorial, handleTutorial } from "./tutorial";
|
|||
import { TerrainType } from "./data/terrain";
|
||||
import { OptionSelectConfig, OptionSelectItem } from "./ui/abstact-option-select-ui-handler";
|
||||
import { SaveSlotUiMode } from "./ui/save-slot-select-ui-handler";
|
||||
import { getDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
|
||||
import { GameModes, gameModes } from "./game-mode";
|
||||
|
||||
export class LoginPhase extends Phase {
|
||||
private showText: boolean;
|
||||
|
@ -159,7 +161,7 @@ export class TitlePhase extends Phase {
|
|||
}
|
||||
},
|
||||
{
|
||||
label: 'Load',
|
||||
label: 'Load Game',
|
||||
handler: () => this.scene.ui.setOverlayMode(Mode.SAVE_SLOT, SaveSlotUiMode.LOAD,
|
||||
(slotId: integer) => {
|
||||
if (slotId === -1)
|
||||
|
@ -167,13 +169,10 @@ export class TitlePhase extends Phase {
|
|||
this.loadSaveSlot(slotId);
|
||||
}
|
||||
)
|
||||
},
|
||||
/*{
|
||||
}/*,
|
||||
{
|
||||
label: 'Daily Run',
|
||||
handler: () => {
|
||||
//this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.ui.showText('This feature is not available yet.\nPlease check back soon!', null, () => this.scene.ui.clearText(), Utils.fixedInt(1000));
|
||||
},
|
||||
handler: () => this.initDailyRun(),
|
||||
keepOpen: true
|
||||
}*/);
|
||||
const config: OptionSelectConfig = {
|
||||
|
@ -198,13 +197,57 @@ export class TitlePhase extends Phase {
|
|||
});
|
||||
}
|
||||
|
||||
initDailyRun(): void {
|
||||
this.scene.ui.setMode(Mode.SAVE_SLOT, SaveSlotUiMode.SAVE, (slotId: integer) => {
|
||||
this.scene.clearPhaseQueue();
|
||||
if (slotId === -1) {
|
||||
this.scene.pushPhase(new TitlePhase(this.scene));
|
||||
return this.end();
|
||||
}
|
||||
this.scene.sessionSlotId = slotId;
|
||||
this.scene.setSeed(getDailyRunSeed(this.scene));
|
||||
|
||||
this.scene.gameMode = gameModes[GameModes.DAILY];
|
||||
this.scene.money = this.scene.gameMode.getStartingMoney();
|
||||
|
||||
const starters = getDailyRunStarters(this.scene);
|
||||
|
||||
const party = this.scene.getParty();
|
||||
const loadPokemonAssets: Promise<void>[] = [];
|
||||
for (let starter of starters) {
|
||||
const starterProps = this.scene.gameData.getSpeciesDexAttrProps(starter.species, starter.dexAttr);
|
||||
const starterFormIndex = Math.min(starterProps.formIndex, Math.max(starter.species.forms.length - 1, 0));
|
||||
const starterGender = starter.species.malePercent !== null
|
||||
? !starterProps.female ? Gender.MALE : Gender.FEMALE
|
||||
: Gender.GENDERLESS;
|
||||
const starterIvs = this.scene.gameData.dexData[starter.species.speciesId].ivs.slice(0);
|
||||
const starterPokemon = this.scene.addPlayerPokemon(starter.species, this.scene.gameMode.getStartingLevel(), starterProps.abilityIndex, starterFormIndex, starterGender, starterProps.shiny, starterIvs, starter.nature);
|
||||
if (starter.moveset)
|
||||
starterPokemon.tryPopulateMoveset(starter.moveset);
|
||||
starterPokemon.setVisible(false);
|
||||
party.push(starterPokemon);
|
||||
loadPokemonAssets.push(starterPokemon.loadAssets());
|
||||
}
|
||||
Promise.all(loadPokemonAssets).then(() => {
|
||||
this.scene.time.delayedCall(500, () => this.scene.playBgm());
|
||||
this.scene.gameData.gameStats.dailyRunSessionsPlayed++;
|
||||
this.scene.newBattle();
|
||||
this.scene.sessionPlayTime = 0;
|
||||
this.end();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
end(): void {
|
||||
if (!this.loaded) {
|
||||
if (!this.loaded && !this.scene.gameMode.isDaily) {
|
||||
this.scene.arena.preloadBgm();
|
||||
this.scene.pushPhase(new SelectStarterPhase(this.scene));
|
||||
} else
|
||||
this.scene.playBgm();
|
||||
|
||||
if (!this.loaded)
|
||||
this.scene.newArena(this.scene.gameMode.getStartingBiome(this.scene), true);
|
||||
|
||||
this.scene.pushPhase(new EncounterPhase(this.scene, this.loaded));
|
||||
|
||||
if (this.loaded) {
|
||||
|
@ -338,7 +381,7 @@ export class SelectStarterPhase extends Phase {
|
|||
? !starterProps.female ? Gender.MALE : Gender.FEMALE
|
||||
: Gender.GENDERLESS;
|
||||
const starterIvs = this.scene.gameData.dexData[starter.species.speciesId].ivs.slice(0);
|
||||
const starterPokemon = this.scene.addPlayerPokemon(starter.species, startingLevel, starterProps.abilityIndex, starterFormIndex, starterGender, starterProps.shiny, starterIvs, starter.nature);
|
||||
const starterPokemon = this.scene.addPlayerPokemon(starter.species, this.scene.gameMode.getStartingLevel(), starterProps.abilityIndex, starterFormIndex, starterGender, starterProps.shiny, starterIvs, starter.nature);
|
||||
starterPokemon.tryPopulateMoveset(starter.moveset);
|
||||
if (starter.pokerus)
|
||||
starterPokemon.pokerus = true;
|
||||
|
@ -869,28 +912,7 @@ export class SelectBiomePhase extends BattlePhase {
|
|||
generateNextBiome(): Biome {
|
||||
if (!(this.scene.currentBattle.waveIndex % 50))
|
||||
return Biome.END;
|
||||
else {
|
||||
const relWave = this.scene.currentBattle.waveIndex % 250;
|
||||
const biomes = Utils.getEnumValues(Biome).slice(1, Utils.getEnumValues(Biome).filter(b => b >= 40).length * -1);
|
||||
const maxDepth = biomeDepths[Biome.END][0] - 2;
|
||||
const depthWeights = new Array(maxDepth + 1).fill(null)
|
||||
.map((_, i: integer) => ((1 - Math.min(Math.abs((i / (maxDepth - 1)) - (relWave / 250)) + 0.25, 1)) / 0.75) * 250);
|
||||
const biomeThresholds: integer[] = [];
|
||||
let totalWeight = 0;
|
||||
for (let biome of biomes) {
|
||||
totalWeight += Math.ceil(depthWeights[biomeDepths[biome][0] - 1] / biomeDepths[biome][1]);
|
||||
biomeThresholds.push(totalWeight);
|
||||
}
|
||||
|
||||
const randInt = Utils.randSeedInt(totalWeight);
|
||||
|
||||
for (let biome of biomes) {
|
||||
if (randInt < biomeThresholds[biome])
|
||||
return biome;
|
||||
}
|
||||
|
||||
return biomes[Utils.randSeedInt(biomes.length)];
|
||||
}
|
||||
return this.scene.generateRandomBiome(this.scene.currentBattle.waveIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ export default class FieldSpritePipeline extends Phaser.Renderer.WebGL.Pipelines
|
|||
const terrainColorRatio = data['terrainColorRatio'] as number || 0;
|
||||
|
||||
let time = scene.currentBattle?.waveIndex
|
||||
? ((scene.currentBattle.waveIndex + scene.getWaveCycleOffset()) % 40) / 40 // ((new Date().getSeconds() * 1000 + new Date().getMilliseconds()) % 10000) / 10000
|
||||
? ((scene.currentBattle.waveIndex + scene.waveCycleOffset) % 40) / 40 // ((new Date().getSeconds() * 1000 + new Date().getMilliseconds()) % 10000) / 10000
|
||||
: Utils.getCurrentTime();
|
||||
this.set1f('time', time);
|
||||
this.set1i('ignoreTimeTint', ignoreTimeTint ? 1 : 0);
|
||||
|
|
|
@ -537,7 +537,7 @@ export class GameData {
|
|||
this.getSession(slotId).then(async sessionData => {
|
||||
console.debug(sessionData);
|
||||
|
||||
scene.seed = sessionData.seed || scene.game.config.seed[0];
|
||||
scene.setSeed(sessionData.seed || scene.game.config.seed[0]);
|
||||
scene.resetSeed();
|
||||
|
||||
scene.sessionPlayTime = sessionData.playTime || 0;
|
||||
|
|
|
@ -6,6 +6,8 @@ export class GameStats {
|
|||
public battles: integer;
|
||||
public classicSessionsPlayed: integer;
|
||||
public sessionsWon: integer;
|
||||
public dailyRunSessionsPlayed: integer;
|
||||
public dailyRunSessionsWon: integer;
|
||||
public endlessSessionsPlayed: integer;
|
||||
public highestEndlessWave: integer;
|
||||
public highestLevel: integer;
|
||||
|
@ -38,6 +40,8 @@ export class GameStats {
|
|||
this.battles = source?.battles || 0;
|
||||
this.classicSessionsPlayed = source?.classicSessionsPlayed || 0;
|
||||
this.sessionsWon = source?.sessionsWon || 0;
|
||||
this.dailyRunSessionsPlayed = source?.dailyRunSessionsPlayed || 0;
|
||||
this.dailyRunSessionsWon = source?.dailyRunSessionsWon || 0;
|
||||
this.endlessSessionsPlayed = source?.endlessSessionsPlayed || 0;
|
||||
this.highestEndlessWave = source?.highestEndlessWave || 0;
|
||||
this.highestLevel = source?.highestLevel || 0;
|
||||
|
|
|
@ -185,7 +185,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
|
|||
let updateAchv = ret;
|
||||
|
||||
if (!this.cursorObj) {
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'starter_select_cursor_highlight', null, 16, 16, 1, 1, 1, 1);
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'select_cursor_highlight', null, 16, 16, 1, 1, 1, 1);
|
||||
this.cursorObj.setOrigin(0, 0);
|
||||
this.achvIconsContainer.add(this.cursorObj);
|
||||
updateAchv = true;
|
||||
|
|
|
@ -66,7 +66,7 @@ export default class EggListUiHandler extends MessageUiHandler {
|
|||
this.eggListIconContainer = this.scene.add.container(115, 9);
|
||||
this.eggListContainer.add(this.eggListIconContainer);
|
||||
|
||||
this.cursorObj = this.scene.add.image(0, 0, 'starter_select_cursor');
|
||||
this.cursorObj = this.scene.add.image(0, 0, 'select_cursor');
|
||||
this.cursorObj.setOrigin(0, 0);
|
||||
this.eggListContainer.add(this.cursorObj);
|
||||
|
||||
|
|
|
@ -70,9 +70,11 @@ const displayStats: DisplayStats = {
|
|||
return `${caughtCount} (${Math.floor((caughtCount / dexKeys.length) * 1000) / 10}%)`;
|
||||
}
|
||||
},
|
||||
classicSessionsPlayed: 'Runs (Classic)',
|
||||
sessionsWon: 'Wins (Classic)',
|
||||
endlessSessionsPlayed: 'Runs (Endless)?',
|
||||
classicSessionsPlayed: 'Classic Runs',
|
||||
sessionsWon: 'Classic Wins',
|
||||
dailyRunSessionsPlayed: 'Daily Run Attempts',
|
||||
dailyRunSessionsWon: 'Daily Run Wins',
|
||||
endlessSessionsPlayed: 'Endless Runs?',
|
||||
highestEndlessWave: 'Highest Wave (Endless)?',
|
||||
highestMoney: 'Highest Money',
|
||||
highestDamage: 'Highest Damage',
|
||||
|
|
|
@ -172,7 +172,7 @@ export default class SaveSlotSelectUiHandler extends MessageUiHandler {
|
|||
let changed = super.setCursor(cursor);
|
||||
|
||||
if (!this.cursorObj) {
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'starter_select_cursor_highlight', null, 296, 44, 1, 1, 1, 1);
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'select_cursor_highlight_thick', null, 296, 44, 2, 2, 2, 2);
|
||||
this.cursorObj.setOrigin(0, 0);
|
||||
this.sessionSlotsContainer.add(this.cursorObj);
|
||||
}
|
||||
|
@ -254,6 +254,8 @@ class SessionSlot extends Phaser.GameObjects.Container {
|
|||
iconContainer.add(text);
|
||||
|
||||
pokemonIconsContainer.add(iconContainer);
|
||||
|
||||
pokemon.destroy();
|
||||
});
|
||||
|
||||
this.add(pokemonIconsContainer);
|
||||
|
|
|
@ -156,7 +156,7 @@ export default class SettingsUiHandler extends UiHandler {
|
|||
const ret = super.setCursor(cursor);
|
||||
|
||||
if (!this.cursorObj) {
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'starter_select_cursor_highlight', null, (this.scene.game.canvas.width / 6) - 10, 16, 1, 1, 1, 1);
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'select_cursor_highlight', null, (this.scene.game.canvas.width / 6) - 10, 16, 1, 1, 1, 1);
|
||||
this.cursorObj.setOrigin(0, 0);
|
||||
this.optionsContainer.add(this.cursorObj);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ export interface Starter {
|
|||
species: PokemonSpecies;
|
||||
dexAttr: bigint;
|
||||
nature: Nature;
|
||||
moveset: StarterMoveset;
|
||||
moveset?: StarterMoveset;
|
||||
pokerus: boolean;
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
});
|
||||
|
||||
this.pokerusCursorObjs = new Array(3).fill(null).map(() => {
|
||||
const cursorObj = this.scene.add.image(0, 0, 'starter_select_cursor_pokerus');
|
||||
const cursorObj = this.scene.add.image(0, 0, 'select_cursor_pokerus');
|
||||
cursorObj.setVisible(false);
|
||||
cursorObj.setOrigin(0, 0);
|
||||
this.starterSelectContainer.add(cursorObj);
|
||||
|
@ -222,22 +222,22 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
});
|
||||
|
||||
this.starterCursorObjs = new Array(6).fill(null).map(() => {
|
||||
const cursorObj = this.scene.add.image(0, 0, 'starter_select_cursor_highlight');
|
||||
const cursorObj = this.scene.add.image(0, 0, 'select_cursor_highlight');
|
||||
cursorObj.setVisible(false);
|
||||
cursorObj.setOrigin(0, 0);
|
||||
this.starterSelectContainer.add(cursorObj);
|
||||
return cursorObj;
|
||||
});
|
||||
|
||||
this.cursorObj = this.scene.add.image(0, 0, 'starter_select_cursor');
|
||||
this.cursorObj = this.scene.add.image(0, 0, 'select_cursor');
|
||||
this.cursorObj.setOrigin(0, 0);
|
||||
this.starterSelectContainer.add(this.cursorObj);
|
||||
|
||||
this.genCursorHighlightObj = this.scene.add.image(111, 5, 'starter_select_gen_cursor_highlight');
|
||||
this.genCursorHighlightObj = this.scene.add.image(111, 5, 'select_gen_cursor_highlight');
|
||||
this.genCursorHighlightObj.setOrigin(0, 0);
|
||||
this.starterSelectContainer.add(this.genCursorHighlightObj);
|
||||
|
||||
this.genCursorObj = this.scene.add.image(111, 5, 'starter_select_gen_cursor');
|
||||
this.genCursorObj = this.scene.add.image(111, 5, 'select_gen_cursor');
|
||||
this.genCursorObj.setVisible(false);
|
||||
this.genCursorObj.setOrigin(0, 0);
|
||||
this.starterSelectContainer.add(this.genCursorObj);
|
||||
|
@ -250,7 +250,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
startLabel.setOrigin(0.5, 0);
|
||||
this.starterSelectContainer.add(startLabel);
|
||||
|
||||
this.startCursorObj = this.scene.add.nineslice(111, 160, 'starter_select_cursor', null, 26, 15, 1, 1, 1, 1);
|
||||
this.startCursorObj = this.scene.add.nineslice(111, 160, 'select_cursor', null, 26, 15, 1, 1, 1, 1);
|
||||
this.startCursorObj.setVisible(false);
|
||||
this.startCursorObj.setOrigin(0, 0);
|
||||
this.starterSelectContainer.add(this.startCursorObj);
|
||||
|
@ -1212,6 +1212,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
ui.setModeWithoutClear(Mode.CONFIRM, () => {
|
||||
const startRun = (gameMode: GameModes) => {
|
||||
this.scene.gameMode = gameModes[gameMode];
|
||||
this.scene.money = this.scene.gameMode.getStartingMoney();
|
||||
ui.setMode(Mode.STARTER_SELECT);
|
||||
const thisObj = this;
|
||||
const originalStarterSelectCallback = this.starterSelectCallback;
|
||||
|
|
|
@ -183,7 +183,7 @@ export default class VouchersUiHandler extends MessageUiHandler {
|
|||
let updateVoucher = ret;
|
||||
|
||||
if (!this.cursorObj) {
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'starter_select_cursor_highlight', null, 16, 16, 1, 1, 1, 1);
|
||||
this.cursorObj = this.scene.add.nineslice(0, 0, 'select_cursor_highlight', null, 16, 16, 1, 1, 1, 1);
|
||||
this.cursorObj.setOrigin(0, 0);
|
||||
this.voucherIconsContainer.add(this.cursorObj);
|
||||
updateVoucher = true;
|
||||
|
|