Add Hunter NPC and Teleporter features with associated prefabs and effects

This commit is contained in:
2025-12-13 00:01:29 +01:00
parent c0fb207768
commit d8b0583fac
32 changed files with 823 additions and 217 deletions

View File

@@ -6,21 +6,23 @@ namespace Core.Domain
{
public string Id { get; }
public int Floor { get; }
public TileType Type { get; }
public TileState CurrentState { get; private set; }
private readonly float _warningDuration;
private readonly float _fallingDuration;
private float _stateTimer;
public event Action<Tile> OnStateChanged;
public Tile(string id, int floor, float warningDuration, float fallingDuration)
public Tile(string id, int floor, float warningDuration, float fallingDuration, TileType type = TileType.Normal)
{
Id = id;
Floor = floor;
Type = type;
_warningDuration = warningDuration;
_fallingDuration = fallingDuration;
CurrentState = TileState.Stable;
@@ -30,16 +32,23 @@ namespace Core.Domain
{
if (CurrentState == TileState.Stable)
{
TransitionTo(TileState.Warning);
if (Type == TileType.Fragile)
{
TransitionTo(TileState.Falling);
}
else
{
TransitionTo(TileState.Warning);
}
}
}
public void Tick(float deltaTime)
{
if (CurrentState == TileState.Stable || CurrentState == TileState.Destroyed) return;
_stateTimer += deltaTime;
if (CurrentState == TileState.Warning && _stateTimer >= _warningDuration)
{
TransitionTo(TileState.Falling);