31 lines
569 B
C#
31 lines
569 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class BattleParticipant
|
|
{
|
|
protected string displayName;
|
|
protected int hp;
|
|
protected int maxHP;
|
|
|
|
public void init() {
|
|
this.hp = this.maxHP;
|
|
}
|
|
|
|
public string getDisplayName() {
|
|
return this.displayName;
|
|
}
|
|
|
|
public int getHP() {
|
|
return this.hp;
|
|
}
|
|
|
|
public int getMaxHP() {
|
|
return this.maxHP;
|
|
}
|
|
|
|
public void dealDamage(int damage) {
|
|
this.hp -= damage;
|
|
if (this.hp < 0) this.hp = 0;
|
|
}
|
|
}
|