prototype vibe

This commit is contained in:
Marek Lenczewski
2026-04-16 17:20:57 +02:00
parent cf5979803e
commit f21e30eb55
72 changed files with 1330 additions and 70 deletions

19
systems/xp_system.gd Normal file
View File

@@ -0,0 +1,19 @@
extends Node
const XP_PER_ENEMY: int = 3
const XP_PER_BOSS: int = 30
func _ready() -> void:
EventBus.entity_died.connect(_on_entity_died)
func _on_entity_died(entity: Node) -> void:
if not entity or not is_instance_valid(entity):
return
if not entity.is_in_group("enemies"):
return
var is_boss: bool = entity.is_in_group("boss")
var data_source: Node = BossData if is_boss else EnemyData
var scale_val: Variant = data_source.get_stat(entity, "scale")
var scale: float = scale_val if scale_val != null else 1.0
var base_xp: int = XP_PER_BOSS if is_boss else XP_PER_ENEMY
PlayerData.add_xp(int(base_xp * scale))