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

@ -7,6 +7,6 @@ func _enter() -> void:
func _exit() -> void:
pass
func _use_begin() -> void:
func _use_begin(_timestamp: float) -> void:
if Session.is_on_site(machine.player.player_id):
transition.emit("Plant")

View file

@ -26,7 +26,7 @@ func on_animation_finished(animation: StringName):
machine.ammo -= 1
return_to_previous.emit()
func use_end() -> void:
func use_end(_timestamp: float) -> void:
if is_multiplayer_authority() == false:
return
transition.emit("Idle")

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()

View file

@ -24,8 +24,8 @@ func on_animation_finished(animation):
attack()
machine.animation_player.play(machine.animation_prefix + "attack")
func _use_begin() -> void:
func _use_begin(_timestamp: float) -> void:
end_it = false
func _use_end() -> void:
func _use_end(_timestamp: float) -> void:
end_it = true

View file

@ -6,7 +6,7 @@ func _enter() -> void:
func _exit() -> void:
pass
func _use_begin() -> void:
func _use_begin(_timestamp: float) -> void:
transition.emit("Attack")
func _alternate_state() -> void:

View file

@ -6,6 +6,6 @@ func _enter() -> void:
func _exit() -> void:
pass
func _use_begin() -> void:
func _use_begin(timestamp: float) -> void:
if machine.ammo > 0:
transition.emit("Throw")