This commit is contained in:
Rendo 2025-12-09 12:27:04 +05:00
commit cd20f952ce
6 changed files with 116 additions and 68 deletions

View file

@ -71,6 +71,15 @@ func add(state: WeaponSubStateMachine, slot: StringName,ignore_parent: bool = fa
ammo_updated.emit(current_state.ammo,current_state.remaining_ammo)
state.enter.call_deferred()
func get_empty_ability_slot() -> StringName:
if slots["ability_first"] == null:
return "ability_first"
elif slots["ability_second"] == null:
return "ability_second"
elif slots["ability_third"] == null:
return "ability_third"
return "ability_first"
@rpc("authority","call_remote","reliable")
func switch(to: StringName, exit: bool = true):
if slots.has(to) == false or slots[to] == null or slots[to] == current_state or (multiplayer.get_remote_sender_id() != 1 and is_multiplayer_authority() == false):