added player toString
This commit is contained in:
		
							parent
							
								
									a03c33d07c
								
							
						
					
					
						commit
						8ee836e375
					
				| 
						 | 
				
			
			@ -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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user