Proper firing logic handling

This commit is contained in:
Alexey 2025-07-26 18:10:44 +03:00
commit 6a317d1913
12 changed files with 44 additions and 20 deletions

View file

@ -24,6 +24,8 @@ func _process() -> void:
if _fire():
on_fire()
func _on_fire_end() -> void:
fire_allowed.emit()
## Invoked when cooldown has ended
func on_cooldown_timeout() -> void:

View file

@ -7,6 +7,9 @@ class_name BaseFireMode
var barrel : Barrel
var tree : SceneTree
## Emits when it's possible to request fire from outside
signal fire_allowed
func _init() -> void:
resource_local_to_scene = true

View file

@ -26,3 +26,4 @@ func _on_fire_begin() -> void:
## Invoked when cooldown has ended
func on_cooldown_timeout() -> void:
cooldown = false
fire_allowed.emit()