mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Bug Fixes
I heard you liked bug fixes so I gave you bug fixes with your bug fixes
This commit is contained in:
parent
2cf8a75609
commit
98dd5ea09b
@ -122,7 +122,8 @@ export default class BattleScene extends SceneBase {
|
||||
public enableRetries: boolean = false;
|
||||
public damageDisplay: string = "Off";
|
||||
public lazyReloads: boolean = false;
|
||||
public menuChangesBiome: boolean;
|
||||
public menuChangesBiome: boolean = false;
|
||||
public showAutosaves: boolean = false;
|
||||
/**
|
||||
* Determines the condition for a notification should be shown for Candy Upgrades
|
||||
* - 0 = 'Off'
|
||||
|
@ -363,6 +363,7 @@ export default class Battle {
|
||||
const ret = Utils.randSeedInt(range, min);
|
||||
this.battleSeedState = Phaser.Math.RND.state();
|
||||
Phaser.Math.RND.state(state);
|
||||
//scene.setScoreText("RNG: " + tempRngCounter + " (Last sim: " + this.rngCounter + ")")
|
||||
scene.rngCounter = tempRngCounter;
|
||||
scene.rngSeedOverride = tempSeedOverride;
|
||||
return ret;
|
||||
|
@ -108,6 +108,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
|
||||
private shinySparkle: Phaser.GameObjects.Sprite;
|
||||
|
||||
public partyslot: integer;
|
||||
|
||||
constructor(scene: BattleScene, x: number, y: number, species: PokemonSpecies, level: integer, abilityIndex?: integer, formIndex?: integer, gender?: Gender, shiny?: boolean, variant?: Variant, ivs?: integer[], nature?: Nature, dataSource?: Pokemon | PokemonData) {
|
||||
super(scene, x, y);
|
||||
|
||||
|
@ -87,6 +87,8 @@ export function getLogs() {
|
||||
* @returns The name of the game mode, for use in naming a game log.
|
||||
*/
|
||||
export function getMode(scene: BattleScene) {
|
||||
if (scene.gameMode == undefined)
|
||||
return "???"
|
||||
switch (scene.gameMode.modeId) {
|
||||
case GameModes.CLASSIC:
|
||||
return "Classic"
|
||||
@ -625,6 +627,16 @@ export function logShop(scene: BattleScene, floor: integer, action: string) {
|
||||
console.log(drpd)
|
||||
localStorage.setItem(getLogID(scene), JSON.stringify(drpd))
|
||||
}
|
||||
export function logCapture(scene: BattleScene, floor: integer, target: EnemyPokemon) {
|
||||
//if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run")))
|
||||
var drpd = getDRPD(scene)
|
||||
console.log("Log Capture", drpd)
|
||||
var wv: Wave = getWave(drpd, floor, scene)
|
||||
var pkslot = target.partyslot
|
||||
wv.pokemon[pkslot].captured = true;
|
||||
console.log(drpd)
|
||||
localStorage.setItem(getLogID(scene), JSON.stringify(drpd))
|
||||
}
|
||||
/**
|
||||
* Retrieves a wave from the DRPD. If the wave doesn't exist, it creates a new one.
|
||||
* @param drpd The document to read from.
|
||||
@ -804,6 +816,8 @@ export function logPokemon(scene: BattleScene, floor: integer = undefined, slot:
|
||||
console.log("Log Enemy Pokemon", drpd)
|
||||
var wv: Wave = getWave(drpd, floor, scene)
|
||||
var pk: PokeData = exportPokemon(pokemon, encounterRarity)
|
||||
pk.source = pokemon
|
||||
pokemon.partyslot = slot;
|
||||
if (wv.pokemon[slot] != undefined) {
|
||||
if (encounterRarity == "" || encounterRarity == undefined) {
|
||||
if (wv.pokemon[slot].rarity != undefined && wv.pokemon[slot].rarity != "???") pk.rarity = wv.pokemon[slot].rarity
|
||||
@ -1124,7 +1138,7 @@ function printWave(inData: string, indent: string, wave: Wave): string {
|
||||
inData += indent + " ]"
|
||||
}
|
||||
} else {
|
||||
inData += ",\n" + indent + " \"actions\": []"
|
||||
inData += ",\n" + indent + " \"actions\": [\"[No actions?]\"]"
|
||||
}
|
||||
inData += ",\n " + indent + "\"shop\": \"" + wave.shop + "\""
|
||||
inData += ",\n " + indent + "\"biome\": \"" + wave.biome + "\""
|
||||
|
@ -5717,7 +5717,6 @@ export class AttemptCapturePhase extends PokemonPhase {
|
||||
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => {
|
||||
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||
if (slotIndex < 6) {
|
||||
LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, "Release " + LoggerTools.playerPokeName(this.scene, slotIndex))
|
||||
addToParty();
|
||||
} else {
|
||||
promptRelease();
|
||||
|
@ -101,7 +101,8 @@ export const SettingKeys = {
|
||||
Show_BGM_Bar: "SHOW_BGM_BAR",
|
||||
Damage_Display: "DAMAGE_DISPLAY",
|
||||
LazyReloads: "FLAG_EVERY_RESET_AS_RELOAD",
|
||||
FancyBiome: "FANCY_BIOMES"
|
||||
FancyBiome: "FANCY_BIOMES",
|
||||
ShowAutosaves: "SHOW_AUTOSAVES"
|
||||
};
|
||||
|
||||
/**
|
||||
@ -543,6 +544,19 @@ export const Setting: Array<Setting> = [
|
||||
type: SettingType.DISPLAY,
|
||||
requireReload: true
|
||||
},
|
||||
{
|
||||
key: SettingKeys.ShowAutosaves,
|
||||
label: "Show Autosaves",
|
||||
options: [{
|
||||
label: "Off",
|
||||
value: "Off"
|
||||
}, {
|
||||
label: "On",
|
||||
value: "On"
|
||||
}],
|
||||
default: 0,
|
||||
type: SettingType.DISPLAY,
|
||||
},
|
||||
{
|
||||
key: SettingKeys.Master_Volume,
|
||||
label: i18next.t("settings:masterVolume"),
|
||||
@ -656,6 +670,8 @@ export function setSetting(scene: BattleScene, setting: string, value: integer):
|
||||
scene.lazyReloads = Setting[index].options[value].value == "On"
|
||||
case SettingKeys.FancyBiome:
|
||||
scene.menuChangesBiome = Setting[index].options[value].value == "On"
|
||||
case SettingKeys.ShowAutosaves:
|
||||
scene.showAutosaves = Setting[index].options[value].value == "On"
|
||||
case SettingKeys.Skip_Seen_Dialogues:
|
||||
scene.skipSeenDialogues = Setting[index].options[value].value === "On";
|
||||
break;
|
||||
|
@ -22,6 +22,7 @@ enum MenuOptions {
|
||||
MANAGE_DATA,
|
||||
COMMUNITY,
|
||||
SAVE_AND_QUIT,
|
||||
SAVE_AND_REFRESH,
|
||||
LOG_OUT
|
||||
}
|
||||
|
||||
@ -356,6 +357,23 @@ export default class MenuUiHandler extends MessageUiHandler {
|
||||
error = true;
|
||||
}
|
||||
break;
|
||||
case MenuOptions.SAVE_AND_REFRESH:
|
||||
if (this.scene.currentBattle) {
|
||||
success = true;
|
||||
if (this.scene.currentBattle.turn > 1) {
|
||||
ui.showText(i18next.t("menuUiHandler:losingProgressionWarning"), null, () => {
|
||||
ui.setOverlayMode(Mode.CONFIRM, () => this.scene.gameData.saveAll(this.scene, true, true, true, true).then(() => this.scene.reset(true)), () => {
|
||||
ui.revertMode();
|
||||
ui.showText(null, 0);
|
||||
}, false, -98);
|
||||
});
|
||||
} else {
|
||||
this.scene.gameData.saveAll(this.scene, true, true, true, true).then(() => this.scene.reset(true));
|
||||
}
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
break;
|
||||
case MenuOptions.LOG_OUT:
|
||||
success = true;
|
||||
const doLogout = () => {
|
||||
|
@ -21,6 +21,7 @@ import MoveInfoOverlay from "./move-info-overlay";
|
||||
import i18next from "i18next";
|
||||
import BBCodeText from "phaser3-rex-plugins/plugins/bbcodetext";
|
||||
import { Moves } from "#enums/moves";
|
||||
import * as LoggerTools from "../logger";
|
||||
|
||||
const defaultMessage = i18next.t("partyUiHandler:choosePokemon");
|
||||
|
||||
@ -932,6 +933,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
this.clearPartySlots();
|
||||
this.scene.removePartyMemberModifiers(slotIndex);
|
||||
const releasedPokemon = this.scene.getParty().splice(slotIndex, 1)[0];
|
||||
LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, `Release ${releasedPokemon.name} (Slot ${slotIndex + 1})`)
|
||||
releasedPokemon.destroy();
|
||||
this.populatePartySlots();
|
||||
if (this.cursor >= this.scene.getParty().length) {
|
||||
|
@ -206,7 +206,7 @@ export default class SaveSlotSelectUiHandler extends MessageUiHandler {
|
||||
this.scene.add.existing(sessionSlot);
|
||||
this.sessionSlotsContainer.add(sessionSlot);
|
||||
this.sessionSlots.push(sessionSlot);
|
||||
if (this.uiMode != SaveSlotUiMode.SAVE) {
|
||||
if (this.uiMode != SaveSlotUiMode.SAVE && this.scene.showAutosaves) {
|
||||
for (var j = 0; j < LoggerTools.autoCheckpoints.length; j++) {
|
||||
var k = "sessionData" + (s ? s : "") + "_Guest_auto" + j
|
||||
if (localStorage.getItem(k) != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user