mirror of
https://github.com/MartinKral/Slash-The-Hordes
synced 2026-02-14 12:22:42 +00:00
heal anim
This commit is contained in:
@@ -28,12 +28,12 @@ export class UnitHealth {
|
||||
|
||||
public heal(points: number): void {
|
||||
this.healthPoints = Math.min(this.maxHealthPoints, this.healthPoints + points);
|
||||
this.healthPointsChangeEvent.trigger(this.healthPoints);
|
||||
this.healthPointsChangeEvent.trigger(points);
|
||||
}
|
||||
|
||||
public damage(points: number): void {
|
||||
this.healthPoints -= points;
|
||||
this.healthPointsChangeEvent.trigger(this.healthPoints);
|
||||
this.healthPointsChangeEvent.trigger(-points);
|
||||
}
|
||||
|
||||
public setMaxHealth(maxHealth: number): void {
|
||||
|
||||
Reference in New Issue
Block a user