()
| 442 | } |
| 443 | |
| 444 | public update(): void{ |
| 445 | // We handle berserk mode |
| 446 | if(this.berserk){ |
| 447 | if(this.berserkDuration > 0){ |
| 448 | this.berserkDuration -= 1; |
| 449 | } |
| 450 | else{ |
| 451 | this.stopBerserk(); |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | // We handle animation |
| 456 | this.handleAnimation(); |
| 457 | |
| 458 | // We handle gravity, and then movement if gravity had no effect |
| 459 | this.noMovementLastUpdate = true; |
| 460 | if(this.handleGravity() == false) |
| 461 | this.handleMovement(); |
| 462 | |
| 463 | // We handle combat |
| 464 | this.handleCombat(); |
| 465 | } |
| 466 | |
| 467 | // Default behaviour of this function : displaying a simple death message in the quest log |
| 468 | public willDie(): void{ |
no test coverage detected