19 lines
531 B
GDScript
19 lines
531 B
GDScript
## 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 # 无状态需要重置
|