apply spawn effect

This commit is contained in:
ktyl 2022-12-17 23:27:21 +00:00
parent 8c55e2131f
commit 1bbb11b042
3 changed files with 9 additions and 0 deletions

View File

@ -53,6 +53,7 @@ public class WorldGrid : Node2D
var tile = _tileGrid[idx]; var tile = _tileGrid[idx];
tile.type = tileType; tile.type = tileType;
tile = tileType.ApplySpawneffect(tile);
_tileGrid[x, y] = tile; _tileGrid[x, y] = tile;
} }
#endregion #endregion

View File

@ -17,4 +17,6 @@ public class TileType : Resource
public float HeatGeneration { get; private set; } public float HeatGeneration { get; private set; }
public override string ToString() => Name; public override string ToString() => Name;
public virtual Tile ApplySpawneffect(Tile tile) => tile;
} }

View File

@ -4,4 +4,10 @@ public class Wild : TileType, IDamageable
{ {
[Export] [Export]
public float Threshold { get; private set; } public float Threshold { get; private set; }
public override Tile ApplySpawneffect(Tile tile)
{
tile.currentHealth = 0;
return tile;
}
} }