well it works
This commit is contained in:
parent
6ff1531662
commit
af9b1a7448
11 changed files with 563 additions and 13 deletions
|
|
@ -3,12 +3,15 @@ using UnityEngine;
|
|||
|
||||
public class PlayerEntity : Entity
|
||||
{
|
||||
[Header("Player Flags")]
|
||||
public bool hasMoved = false;
|
||||
public bool hasAttacked = false;
|
||||
private List<TileObject> moveableTiles = new();
|
||||
[Header("Weaponry")]
|
||||
[SerializeField] private Weapon[] weapons;
|
||||
private List<Weapon> weaponInstances = new();
|
||||
public Weapon currentWeapon;
|
||||
[Header("UI")]
|
||||
[SerializeField] private Transform hpBar;
|
||||
void Start()
|
||||
{
|
||||
foreach (Weapon weapon in weapons)
|
||||
|
|
@ -27,6 +30,16 @@ public class PlayerEntity : Entity
|
|||
|
||||
}
|
||||
|
||||
public override void TakeDamage(float amount)
|
||||
{
|
||||
base.TakeDamage(amount);
|
||||
UpdateHealthUI();
|
||||
}
|
||||
public void UpdateHealthUI()
|
||||
{
|
||||
hpBar.localScale = new Vector3(health/maxHealth, 1f, 1f);
|
||||
}
|
||||
|
||||
public void SkipTurn()
|
||||
{
|
||||
hasMoved = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue