Všechna monstra, dynamický targeting. Bugfixy u monster.
This commit is contained in:
parent
55fd052072
commit
4fdff0a0cc
18 changed files with 345 additions and 43 deletions
|
|
@ -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() { }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue