Všechna monstra, dynamický targeting. Bugfixy u monster.

This commit is contained in:
Perry 2026-03-17 20:14:29 +01:00
parent 55fd052072
commit 4fdff0a0cc
18 changed files with 345 additions and 43 deletions

View file

@ -1,7 +1,6 @@
namespace GlobalClassLib;
public abstract class GlobalEnemy<TTile, TCon> where TTile : GlobalMapTile<TCon, TTile> where TCon : GlobalTileConnector<TTile, TCon> {
public int Difficulty { get; set; }
public TTile? Location { get; set; }
public bool Visible { get; set; }
public abstract string Name{ get; }
@ -14,20 +13,19 @@ public abstract class GlobalEnemy<TTile, TCon> where TTile : GlobalMapTile<TCon,
// public static Dictionary<TTile, GlobalEnemy<TTile, TCon>> PresentEnemies = new();
public GlobalEnemy(int difficulty) {
Difficulty = difficulty;
public GlobalEnemy() {
Id = nextId++;
}
public GlobalEnemy(int difficulty, int id) {
Difficulty = difficulty;
public GlobalEnemy(int id) {
Id = id;
}
public virtual void Spawn(TTile location) {
public virtual void Spawn(TTile? location) {
// PresentEnemies.Add(location, this);
Location = location;
Visible = true;
Console.WriteLine($"Enemy {Id} ({Name}) spawned at {location.Id} {location.GridPosition}");
Console.WriteLine($"Enemy {Id} ({Name}) spawned at {(location == null ? "" : location.Id)} {(location == null ? "" : location.GridPosition)}");
}
public virtual void Update() { }