Files
spellforge/scripts/autoloads/drop_manager.gd
T
2026-07-20 10:56:52 +08:00

19 lines
531 B
GDScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## DropManager — 掉落物管理(Autoload: DropManager
## S2 范围:敌人死亡时直接发放 XP/金币(无拾取物步骤)
## S3+ 再加入地面拾取物
extends Node
## S2 内置掉落参数
const XP_PER_KILL: int = 5
const GOLD_PER_KILL: int = 2
func _ready() -> void:
EventBus.subscribe(EventID.ENEMY_KILLED, _on_enemy_killed)
func _on_enemy_killed(payload: Dictionary) -> void:
PlayerStats.gain_xp(XP_PER_KILL)
PlayerStats.gain_gold(GOLD_PER_KILL)
func reset() -> void:
pass # 无状态需要重置