feat(mana): PlayerManager 换杖置蓝池 + 每帧回蓝
This commit is contained in:
@@ -28,6 +28,7 @@ func _ready() -> void:
|
|||||||
EventBus.subscribe(EventID.ENEMY_KILLED, _on_enemy_killed)
|
EventBus.subscribe(EventID.ENEMY_KILLED, _on_enemy_killed)
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
|
PlayerStats.regen_mana(delta)
|
||||||
_handle_movement(delta)
|
_handle_movement(delta)
|
||||||
_handle_charge_state(delta)
|
_handle_charge_state(delta)
|
||||||
_handle_auto_cast(delta)
|
_handle_auto_cast(delta)
|
||||||
@@ -85,6 +86,10 @@ func equip_wand(core: CoreDefinition, compiled: CompiledDeck) -> void:
|
|||||||
_equipped_compiled = compiled
|
_equipped_compiled = compiled
|
||||||
_cast_interval = core.cast_interval if core else 0.5
|
_cast_interval = core.cast_interval if core else 0.5
|
||||||
_cast_timer = 0.0
|
_cast_timer = 0.0
|
||||||
|
if core:
|
||||||
|
PlayerStats.set_mana_pool(core.base_mana_max, core.base_mana_regen)
|
||||||
|
else:
|
||||||
|
PlayerStats.set_mana_pool(100.0, 5.0)
|
||||||
|
|
||||||
func get_position() -> Vector2:
|
func get_position() -> Vector2:
|
||||||
return _position
|
return _position
|
||||||
|
|||||||
Reference in New Issue
Block a user