Start of rewind system

This commit is contained in:
Rendo 2025-12-21 02:22:41 +05:00
commit 42c95820d7
16 changed files with 55 additions and 33 deletions

View file

@ -11,7 +11,7 @@ func _exit() -> void:
if is_multiplayer_authority():
machine.player.get_node("PlayerInput").reload.disconnect(init_reload)
func _use_begin() -> void:
func _use_begin(timestamp: float) -> void:
if machine.ammo > 0:
transition.emit("Shoot")

View file

@ -14,6 +14,7 @@ extends WeaponState
@export var fire_timer: Timer
var bullets_shot: int = 0
var cached_timestamp: float = 0
func _enter() -> void:
fire()
@ -27,9 +28,10 @@ func on_animation_finished(animation):
if animation == machine.animation_prefix + with_morphems("shoot"):
transition.emit("Idle")
func _use_begin() -> void:
func _use_begin(timestamp: float) -> void:
if fire_timer.time_left > 0:
return
cached_timestamp = timestamp
fire()
func fire() -> void:

View file

@ -26,7 +26,7 @@ func on_animation_finished(animation):
if animation == machine.animation_prefix + with_morphems("shoot"):
transition.emit("Idle")
func _use_begin() -> void:
func _use_begin(timestamp: float) -> void:
if fire_timer.time_left > 0:
return
fire()