finally get pathfinding done?

This commit is contained in:
reisenlol 2026-01-10 02:37:44 -08:00
parent 7b151c1a53
commit 7bd61df481
No known key found for this signature in database
23 changed files with 1408 additions and 785 deletions

View file

@ -6,9 +6,19 @@ public class PlayerEntity : Entity
public bool hasMoved = false;
public bool hasAttacked = false;
private List<TileObject> moveableTiles = new();
[SerializeField] private Weapon[] weapons;
private List<Weapon> weaponInstances = new();
public Weapon currentWeapon;
void Start()
{
foreach (Weapon weapon in weapons)
{
Weapon newWeapon = Instantiate(weapon, transform);
newWeapon.thisEntity = this;
newWeapon.tag = tag;
weaponInstances.Add(newWeapon);
}
currentWeapon = weaponInstances[0];
}
// Update is called once per frame
@ -22,13 +32,21 @@ public class PlayerEntity : Entity
hasMoved = true;
hasAttacked = true;
TurnHandler.instance.UpdateTurns();
}
public void Attack()
{
currentWeapon.TryAttack();
}
public void SwitchWeapon()
{
}
private void OnMouseDown()
{
if ((!hasMoved) && !PlayerEntityMovement.instance.isMoving)
{
ActionUIHandler.instance.ShowUI(this);
SkipTurn();
}
}
}