well it works

This commit is contained in:
reisenlol 2026-01-11 21:27:27 -08:00
parent 6ff1531662
commit af9b1a7448
No known key found for this signature in database
11 changed files with 563 additions and 13 deletions

View file

@ -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;