Prikoliki
This commit is contained in:
parent
74e37f8a18
commit
66fbad750c
22 changed files with 11192 additions and 42 deletions
|
|
@ -1,5 +1,7 @@
|
|||
extends Node
|
||||
|
||||
@export var player: Player
|
||||
|
||||
@export var starting_pistol: PackedScene
|
||||
@export var starting_knife: PackedScene
|
||||
@export var weapon_system: WeaponSystem
|
||||
|
|
@ -9,6 +11,12 @@ func _ready() -> void:
|
|||
|
||||
func deferred_ready() -> void:
|
||||
if is_multiplayer_authority():
|
||||
weapon_system.add(starting_pistol.instantiate(),"secondary")
|
||||
var saved_slots = Session.player_data[player.player_id].saved_slots
|
||||
if saved_slots != {}:
|
||||
for slot in saved_slots:
|
||||
var weapon = Registry.weapons[saved_slots[slot]]
|
||||
weapon_system.add(weapon.weapon_system_scene.instantiate(),weapon.slot)
|
||||
else:
|
||||
weapon_system.add(starting_pistol.instantiate(),"secondary")
|
||||
weapon_system.add(starting_knife.instantiate(),"knife")
|
||||
queue_free()
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ func can_add(slot: StringName) -> bool:
|
|||
func add(state: WeaponSubStateMachine, slot: StringName) -> void:
|
||||
if not multiplayer.is_server():
|
||||
return
|
||||
if slot == "ability":
|
||||
slot = get_empty_ability_slot()
|
||||
if can_add(slot) == false:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue