From 8ee836e375d171046a9712cb0a29a5f57dc266f9 Mon Sep 17 00:00:00 2001 From: OfficialCHenry Date: Mon, 25 Apr 2022 22:36:36 -0400 Subject: [PATCH] added player toString --- src/shattered_sword/Player/PlayerController.ts | 15 ++++++++++++++- src/shattered_sword/Scenes/GameLevel.ts | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/shattered_sword/Player/PlayerController.ts b/src/shattered_sword/Player/PlayerController.ts index 246f3a8..81f2caf 100644 --- a/src/shattered_sword/Player/PlayerController.ts +++ b/src/shattered_sword/Player/PlayerController.ts @@ -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; } } \ No newline at end of file diff --git a/src/shattered_sword/Scenes/GameLevel.ts b/src/shattered_sword/Scenes/GameLevel.ts index 8326222..1bff30e 100644 --- a/src/shattered_sword/Scenes/GameLevel.ts +++ b/src/shattered_sword/Scenes/GameLevel.ts @@ -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 = (this.player._ai).toString(); if (this.gameStateStack.peek() === GameState.GAMING) { this.setGameState(GameState.PAUSE); this.pauseLayer.enable();