State machine rework

This commit is contained in:
Rendo 2025-12-09 22:34:17 +05:00
commit 87919ed890
25 changed files with 102 additions and 76 deletions

View file

@ -8,13 +8,40 @@ signal return_to_previous
var machine: WeaponSubStateMachine
func _use_begin() -> void:
pass
@rpc("authority","call_remote","reliable")
func use_begin() -> void:
_use_begin()
if is_multiplayer_authority():
use_begin.rpc()
func _use_end():
pass
@rpc("authority","call_remote","reliable")
func use_end() -> void:
_use_end()
if is_multiplayer_authority():
use_end.rpc()
func _alternate_state() -> void:
pass
@rpc("authority","call_remote","reliable")
func alternate_state() -> void:
pass
_alternate_state()
if is_multiplayer_authority():
alternate_state.rpc()
# Need to clarify naming; Switch mode like firemode. For different states use
# alternate_state
func switch_mode() -> void:
func _switch_mode():
pass
@rpc("authority","call_remote","reliable")
func switch_mode() -> void:
_switch_mode()
if is_multiplayer_authority():
switch_mode.rpc()