added player toString

This commit is contained in:
OfficialCHenry 2022-04-25 22:36:36 -04:00
parent a03c33d07c
commit 8ee836e375
2 changed files with 16 additions and 1 deletions

View File

@ -625,7 +625,20 @@ export default class PlayerController extends StateMachineAI implements BattlerA
toString(): string{
return "";
let s = "HP: " + this.CURRENT_HP +"/"+this.MAX_HP+
"\nATK: " + this.CURRENT_ATK +
"\nSpeed: " + this.speed +
"\nDamage Ratio: " + this.damage_multiplier +
"\nEnemies Killed: " + this.enemiesKilled +
"\nSword Effects:" +
(this.hasBleed ? "\n Bleed," : " ") +
(this.hasBurn ? " Burn," : "") +
(this.hasPoison ? " Poison," : "") +
(this.hasShield ? " Shield," :"") +
(this.fullHpBonus ? " FullHealth deal x10 Dmg" : "") +
(this.hasLifesteal ? " Lifesteal," : "") +
(this.hasOneShot ? " Atk x 100, maxhp set to 1" : "") ;
return s;
}
}

View File

@ -237,6 +237,7 @@ export default class GameLevel extends Scene {
updateScene(deltaT: number){
if (this.gameStateStack.peek() === GameState.GAMING) {
if (this.gameStarted) {
GameLevel.gameTimer += deltaT;
@ -420,6 +421,7 @@ export default class GameLevel extends Scene {
}
}
if (InputWrapper.isPauseJustPressed()) {
this.pauseText.text = (<PlayerController>this.player._ai).toString();
if (this.gameStateStack.peek() === GameState.GAMING) {
this.setGameState(GameState.PAUSE);
this.pauseLayer.enable();