Adding to updateGameInfo()

This commit is contained in:
PsychedelicSeal 2024-10-29 13:12:57 -06:00
parent 487deb3f43
commit cb2f2d53ce
3 changed files with 11 additions and 2 deletions

View File

@ -2965,7 +2965,7 @@ export default class BattleScene extends SceneBase {
biome: this.currentBattle ? getBiomeName(this.arena.biomeType) : "",
wave: this.currentBattle?.waveIndex || 0,
party: this.party ? this.party.map(p => {
return { name: p.name, type: p.type[0], level: p.level, currentHP: p.hp, maxHP: p.stats[0], status: p.status };
return { name: p.name, type: p.getTypes(), level: p.level, currentHP: p.hp, maxHP: p.getMaxHp(), status: p.status };
}) : [],
modeChain: this.ui?.getModeChain() ?? [],
};

View File

@ -89,7 +89,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
public exp: integer;
public levelExp: integer;
public gender: Gender;
public hp: integer;
private _hp: number;
public get hp() {
return this._hp;
}
public set hp(hp: number) {
this._hp = hp;
}
public stats: integer[];
public ivs: integer[];
public nature: Nature;
@ -181,6 +187,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
this.exp = dataSource?.exp || getLevelTotalExp(this.level, species.growthRate);
this.levelExp = dataSource?.levelExp || 0;
if (dataSource) {
this.id = dataSource.id;
this.hp = dataSource.hp;

View File

@ -30,6 +30,8 @@ export class CommandPhase extends FieldPhase {
start() {
super.start();
this.scene.updateGameInfo();
const commandUiHandler = this.scene.ui.handlers[Mode.COMMAND];
if (commandUiHandler) {
if (this.scene.currentBattle.turn === 1 || commandUiHandler.getCursor() === Command.POKEMON) {