Round system
This commit is contained in:
parent
bcb42f8d16
commit
3df8247a84
32 changed files with 573 additions and 123 deletions
|
|
@ -4,7 +4,8 @@ var plant: StringName
|
|||
|
||||
func _ready() -> void:
|
||||
if multiplayer.is_server():
|
||||
$Timer.timeout.connect(on_timeout)
|
||||
Session.bomb_timer.timeout.connect(on_timeout)
|
||||
Session.begin_bomb_stage()
|
||||
|
||||
func on_timeout():
|
||||
if multiplayer.is_server() == false:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ func exit():
|
|||
machine.speed_modifier = 1.0
|
||||
|
||||
func on_animation_finished(animation: StringName):
|
||||
if is_multiplayer_authority() == false:
|
||||
return
|
||||
if animation == machine.animation_prefix + "plant":
|
||||
|
||||
Session.spawn({"scene": active_bomb, "position": machine.player_camera.get_parent().global_position,"plant": Session.get_site().name})
|
||||
|
|
@ -20,5 +22,7 @@ func on_animation_finished(animation: StringName):
|
|||
return_to_previous.emit()
|
||||
|
||||
func state_input(event: InputEvent) -> void:
|
||||
if is_multiplayer_authority() == false:
|
||||
return
|
||||
if event.is_action_released("plr_bomb"):
|
||||
transition.emit("Idle")
|
||||
|
|
|
|||
|
|
@ -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