Round system
This commit is contained in:
parent
bcb42f8d16
commit
3df8247a84
32 changed files with 573 additions and 123 deletions
|
|
@ -8,6 +8,7 @@ class_name WeaponSystem
|
|||
|
||||
var current_state: WeaponSubStateMachine
|
||||
var last_slot: StringName
|
||||
var disabled: bool
|
||||
|
||||
var slots: Dictionary[StringName,WeaponSubStateMachine] = {
|
||||
"primary": null,
|
||||
|
|
@ -151,18 +152,21 @@ func check_for_empty() -> void:
|
|||
func on_ammo_updated() -> void:
|
||||
ammo_updated.emit(current_state.ammo,current_state.remaining_ammo)
|
||||
|
||||
func disable() -> void:
|
||||
disabled = true
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if current_state == null:
|
||||
if current_state == null or disabled:
|
||||
return
|
||||
current_state.update(delta)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if current_state == null:
|
||||
if current_state == null or disabled:
|
||||
return
|
||||
current_state.physics_update(delta)
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if is_multiplayer_authority() == false: return
|
||||
if is_multiplayer_authority() == false or disabled or Session.round_state == Session.ROUND_STATES.BUY: return
|
||||
|
||||
if current_state != null:
|
||||
current_state.state_input(event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue