This commit is contained in:
Marek Lenczewski
2026-04-04 00:00:15 +02:00
parent 3488856b91
commit f1d34ebf1d
104 changed files with 1912 additions and 1789 deletions

View File

@@ -1,53 +0,0 @@
extends Node
var entities: Dictionary = {}
var player_cache: Dictionary = {}
func register(entity: Node, base: BaseStats) -> void:
if entity.is_in_group("player") and not player_cache.is_empty():
entities[entity] = player_cache.duplicate()
entities[entity]["base_stats"] = base
player_cache.clear()
else:
entities[entity] = {
"base_stats": base,
"health": base.max_health,
"max_health": base.max_health,
"health_regen": base.health_regen,
"shield": base.max_shield,
"max_shield": base.max_shield,
"shield_regen_delay": base.shield_regen_delay,
"shield_regen_time": base.shield_regen_time,
"shield_regen_timer": 0.0,
"alive": true,
"buff_damage": 1.0,
"buff_heal": 1.0,
"buff_shield": 1.0,
}
func deregister(entity: Node) -> void:
if entity.is_in_group("player") and entity in entities:
player_cache = entities[entity].duplicate()
entities.erase(entity)
func clear_player_cache() -> void:
player_cache.clear()
func get_stat(entity: Node, key: String) -> Variant:
if entity in entities:
return entities[entity].get(key)
return null
func set_stat(entity: Node, key: String, value: Variant) -> void:
if entity in entities:
entities[entity][key] = value
func get_base(entity: Node) -> BaseStats:
if entity in entities:
return entities[entity]["base_stats"]
return null
func is_alive(entity: Node) -> bool:
if entity in entities:
return entities[entity]["alive"]
return false

View File

@@ -1 +0,0 @@
uid://cyxmpeib7pcw7