Guns and Reviving added - Other minor Bugfixes.

This commit is contained in:
Patrick 2024-12-19 17:41:41 +01:00
parent 8c90c4e744
commit 139e9a5134
11 changed files with 317 additions and 47 deletions

View file

@ -25,8 +25,7 @@ func _on_body_entered(body: Node) -> void:
Networking.pick_up_sync_call(carried_by, self)
if body is Player and carried:
Networking.set_down_sync_call(carried_by, self)
(body as Player).incapacitate()
Networking.incapacitate_sync_call(body as Player)
func _physics_process(_delta: float) -> void:
if Networking.isManager and sleeping and !carried:

16
scripts/maps/guncase.gd Normal file
View file

@ -0,0 +1,16 @@
class_name Guncase
extends StaticBody3D
var held: bool = false
func _ready() -> void:
if ($Area3D as Area3D).body_entered.connect(_on_body_entered):
pass
func _on_body_entered(body: Node3D) -> void:
if body is Player:
if held:
if (body as Player).carrying_gun:
(body as Player).gun_chance()
else:
(body as Player).gun_chance()