mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Extras
This commit is contained in:
parent
48ff515269
commit
324c92024b
@ -1374,7 +1374,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
this.rngSeedOverride = seedOverride || "";
|
this.rngSeedOverride = seedOverride || "";
|
||||||
func();
|
func();
|
||||||
Phaser.Math.RND.state(state);
|
Phaser.Math.RND.state(state);
|
||||||
this.setScoreText("RNG: " + tempRngCounter + " (Last sim: " + this.rngCounter + ")")
|
//this.setScoreText("RNG: " + tempRngCounter + " (Last sim: " + this.rngCounter + ")")
|
||||||
this.rngCounter = tempRngCounter;
|
this.rngCounter = tempRngCounter;
|
||||||
this.rngOffset = tempRngOffset;
|
this.rngOffset = tempRngOffset;
|
||||||
this.rngSeedOverride = tempRngSeedOverride;
|
this.rngSeedOverride = tempRngSeedOverride;
|
||||||
|
@ -74,6 +74,7 @@ import PokemonData from "./system/pokemon-data"
|
|||||||
import * as LoggerTools from "./logger"
|
import * as LoggerTools from "./logger"
|
||||||
import { getNatureName } from "./data/nature";
|
import { getNatureName } from "./data/nature";
|
||||||
import { GameDataType } from "./enums/game-data-type";
|
import { GameDataType } from "./enums/game-data-type";
|
||||||
|
import { Session } from "inspector";
|
||||||
|
|
||||||
const { t } = i18next;
|
const { t } = i18next;
|
||||||
|
|
||||||
@ -340,6 +341,16 @@ export class TitlePhase extends Phase {
|
|||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setBiomeByType(biome: Biome): void {
|
||||||
|
this.scene.arenaBg.setTexture(`${getBiomeKey(biome)}_bg`);
|
||||||
|
}
|
||||||
|
setBiomeByName(biome: string): void {
|
||||||
|
this.scene.arenaBg.setTexture(`${getBiomeKey(Utils.getEnumValues(Biome)[Utils.getEnumKeys(Biome).indexOf(biome)])}_bg`);
|
||||||
|
}
|
||||||
|
setBiomeByFile(sessionData: SessionSaveData): void {
|
||||||
|
this.scene.arenaBg.setTexture(`${getBiomeKey(sessionData.arena.biome)}_bg`);
|
||||||
|
}
|
||||||
|
|
||||||
start(): void {
|
start(): void {
|
||||||
super.start();
|
super.start();
|
||||||
console.log(LoggerTools.importDocument(JSON.stringify(LoggerTools.newDocument())))
|
console.log(LoggerTools.importDocument(JSON.stringify(LoggerTools.newDocument())))
|
||||||
@ -349,12 +360,13 @@ export class TitlePhase extends Phase {
|
|||||||
|
|
||||||
this.scene.playBgm("title", true);
|
this.scene.playBgm("title", true);
|
||||||
|
|
||||||
|
this.scene.biomeChangeMode = false
|
||||||
|
|
||||||
this.scene.gameData.getSession(loggedInUser.lastSessionSlot).then(sessionData => {
|
this.scene.gameData.getSession(loggedInUser.lastSessionSlot).then(sessionData => {
|
||||||
if (sessionData) {
|
if (sessionData) {
|
||||||
this.lastSessionData = sessionData;
|
this.lastSessionData = sessionData;
|
||||||
const biomeKey = getBiomeKey(sessionData.arena.biome);
|
//this.setBiomeByFile(sessionData)
|
||||||
const bgTexture = `${biomeKey}_bg`;
|
this.setBiomeByType(Biome.END)
|
||||||
this.scene.arenaBg.setTexture(bgTexture);
|
|
||||||
}
|
}
|
||||||
this.showOptions();
|
this.showOptions();
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
@ -394,6 +406,20 @@ export class TitlePhase extends Phase {
|
|||||||
if (saves == undefined) return undefined;
|
if (saves == undefined) return undefined;
|
||||||
return saves.map(f => f[1]);
|
return saves.map(f => f[1]);
|
||||||
}
|
}
|
||||||
|
getSavesUnsorted(log?: boolean, dailyOnly?: boolean): SessionSaveData[] {
|
||||||
|
var saves: Array<Array<any>> = [];
|
||||||
|
for (var i = 0; i < 5; i++) {
|
||||||
|
var s = parseSlotData(i);
|
||||||
|
if (s != undefined) {
|
||||||
|
if (!dailyOnly || s.gameMode == GameModes.DAILY) {
|
||||||
|
saves.push([i, s, s.timestamp]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (log) console.log(saves)
|
||||||
|
if (saves == undefined) return undefined;
|
||||||
|
return saves.map(f => f[1]);
|
||||||
|
}
|
||||||
|
|
||||||
callEnd(): boolean {
|
callEnd(): boolean {
|
||||||
this.scene.clearPhaseQueue();
|
this.scene.clearPhaseQueue();
|
||||||
@ -445,6 +471,7 @@ export class TitlePhase extends Phase {
|
|||||||
logRenameMenu(): boolean {
|
logRenameMenu(): boolean {
|
||||||
const options: OptionSelectItem[] = [];
|
const options: OptionSelectItem[] = [];
|
||||||
LoggerTools.getLogs()
|
LoggerTools.getLogs()
|
||||||
|
this.setBiomeByType(Biome.FACTORY)
|
||||||
for (var i = 0; i < LoggerTools.logs.length; i++) {
|
for (var i = 0; i < LoggerTools.logs.length; i++) {
|
||||||
if (localStorage.getItem(LoggerTools.logs[i][1]) != null) {
|
if (localStorage.getItem(LoggerTools.logs[i][1]) != null) {
|
||||||
options.push(LoggerTools.generateEditOption(this.scene, i, this.getSaves(), this) as OptionSelectItem)
|
options.push(LoggerTools.generateEditOption(this.scene, i, this.getSaves(), this) as OptionSelectItem)
|
||||||
@ -479,6 +506,7 @@ export class TitlePhase extends Phase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showOptions(): void {
|
showOptions(): void {
|
||||||
|
this.scene.biomeChangeMode = true
|
||||||
const options: OptionSelectItem[] = [];
|
const options: OptionSelectItem[] = [];
|
||||||
if (false)
|
if (false)
|
||||||
if (loggedInUser.lastSessionSlot > -1) {
|
if (loggedInUser.lastSessionSlot > -1) {
|
||||||
@ -494,6 +522,7 @@ export class TitlePhase extends Phase {
|
|||||||
// If there are no daily runs, it instead shows the most recently saved run
|
// If there are no daily runs, it instead shows the most recently saved run
|
||||||
// If this fails too, there are no saves, and the option does not appear
|
// If this fails too, there are no saves, and the option does not appear
|
||||||
var lastsaves = this.getSaves(false, true);
|
var lastsaves = this.getSaves(false, true);
|
||||||
|
//lastsaves = this.getSavesUnsorted()
|
||||||
if (lastsaves != undefined && lastsaves.length > 0) {
|
if (lastsaves != undefined && lastsaves.length > 0) {
|
||||||
lastsaves.forEach(lastsave => {
|
lastsaves.forEach(lastsave => {
|
||||||
options.push({
|
options.push({
|
||||||
@ -531,6 +560,8 @@ export class TitlePhase extends Phase {
|
|||||||
options.push({
|
options.push({
|
||||||
label: i18next.t("menu:newGame"),
|
label: i18next.t("menu:newGame"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
|
this.scene.biomeChangeMode = false
|
||||||
|
this.setBiomeByType(Biome.TOWN)
|
||||||
const setModeAndEnd = (gameMode: GameModes) => {
|
const setModeAndEnd = (gameMode: GameModes) => {
|
||||||
this.gameMode = gameMode;
|
this.gameMode = gameMode;
|
||||||
this.scene.ui.setMode(Mode.MESSAGE);
|
this.scene.ui.setMode(Mode.MESSAGE);
|
||||||
@ -591,12 +622,14 @@ export class TitlePhase extends Phase {
|
|||||||
}, {
|
}, {
|
||||||
label: "Manage Logs",
|
label: "Manage Logs",
|
||||||
handler: () => {
|
handler: () => {
|
||||||
|
this.scene.biomeChangeMode = false
|
||||||
return this.logRenameMenu()
|
return this.logRenameMenu()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
options.push({
|
options.push({
|
||||||
label: i18next.t("menu:loadGame"),
|
label: i18next.t("menu:loadGame"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
|
this.scene.biomeChangeMode = false
|
||||||
this.scene.ui.setOverlayMode(Mode.SAVE_SLOT, SaveSlotUiMode.LOAD,
|
this.scene.ui.setOverlayMode(Mode.SAVE_SLOT, SaveSlotUiMode.LOAD,
|
||||||
(slotId: integer, autoSlot: integer) => {
|
(slotId: integer, autoSlot: integer) => {
|
||||||
if (slotId === -1) {
|
if (slotId === -1) {
|
||||||
@ -610,6 +643,7 @@ export class TitlePhase extends Phase {
|
|||||||
options.push({
|
options.push({
|
||||||
label: i18next.t("menu:dailyRun"),
|
label: i18next.t("menu:dailyRun"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
|
this.scene.biomeChangeMode = false
|
||||||
this.setupDaily();
|
this.setupDaily();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -618,6 +652,7 @@ export class TitlePhase extends Phase {
|
|||||||
{
|
{
|
||||||
label: i18next.t("menu:settings"),
|
label: i18next.t("menu:settings"),
|
||||||
handler: () => {
|
handler: () => {
|
||||||
|
this.scene.biomeChangeMode = false
|
||||||
this.scene.ui.setOverlayMode(Mode.SETTINGS);
|
this.scene.ui.setOverlayMode(Mode.SETTINGS);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@ -760,6 +795,7 @@ export class TitlePhase extends Phase {
|
|||||||
confirmSlot("Select a slot to replace.", () => true, slotId => this.scene.gameData.importData(GameDataType.SESSION, slotId));
|
confirmSlot("Select a slot to replace.", () => true, slotId => this.scene.gameData.importData(GameDataType.SESSION, slotId));
|
||||||
}
|
}
|
||||||
end(): void {
|
end(): void {
|
||||||
|
this.scene.biomeChangeMode = false
|
||||||
if (!this.loaded && !this.scene.gameMode.isDaily) {
|
if (!this.loaded && !this.scene.gameMode.isDaily) {
|
||||||
this.scene.arena.preloadBgm();
|
this.scene.arena.preloadBgm();
|
||||||
this.scene.gameMode = getGameMode(this.gameMode);
|
this.scene.gameMode = getGameMode(this.gameMode);
|
||||||
@ -2374,7 +2410,7 @@ export class TurnInitPhase extends FieldPhase {
|
|||||||
|
|
||||||
this.scene.arenaFlyout.updateFieldText()
|
this.scene.arenaFlyout.updateFieldText()
|
||||||
|
|
||||||
this.scene.setScoreText(txt.join("/"))
|
this.scene.setScoreText(txt.join(" / "))
|
||||||
|
|
||||||
this.end();
|
this.end();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user