První 3 monstra z plánovaných pěti. Kompletní pathfinding i zrcadlení do clienta. Útoky implementované nejsou. Lurk a Neko jsou hardcoded aby útočili na P1.

This commit is contained in:
Perry 2026-03-08 16:55:49 +01:00
parent 4484b127c5
commit 9bfe63a166
27 changed files with 772 additions and 47 deletions

View file

@ -0,0 +1,35 @@
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; }
public abstract int TypeId{ get; }
public int Id { get; }
private static int nextId = 0;
// public static Dictionary<TTile, GlobalEnemy<TTile, TCon>> PresentEnemies = new();
public GlobalEnemy(int difficulty) {
Difficulty = difficulty;
Id = nextId++;
}
public GlobalEnemy(int difficulty, int id) {
Difficulty = difficulty;
Id = id;
}
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}");
}
public virtual void Update() { }
}