Plant spawn

This commit is contained in:
Rendo 2025-08-03 18:34:54 +05:00
commit 941912d7f1
25 changed files with 281 additions and 40 deletions

View file

@ -5,6 +5,8 @@ class_name Entity
## Maximum health points of an entity. Any heal cannot exceed this value
@export var max_hp : float
## Optional spawn layer for grid interactions
@export var layer : StringName = ""
## Current amount of health points of an entity. Cannot be below 0 or [code]max_hp[/code]
var hp : float = max_hp
@ -67,6 +69,10 @@ func kill(source : Entity):
context.target = self
killed.emit(context)
LevelEventBus.entity_killed.emit(context)
if not layer.is_empty():
LevelEventBus.layer_entity_killed.emit(context)
deconstruct()