[gd_scene load_steps=15 format=3 uid="uid://dpsr6ug3pkb40"]

[ext_resource type="Script" uid="uid://3dphlay25fih" path="res://scripts/player/player.gd" id="1_g2els"]
[ext_resource type="Script" uid="uid://dalwlndejfdhm" path="res://scripts/player/crosshair.gd" id="3_dqkch"]
[ext_resource type="Script" uid="uid://bjhbdh6xsjgnn" path="res://scripts/player/player_camera.gd" id="3_qhqgy"]
[ext_resource type="PackedScene" uid="uid://c3hg4ux4j76j2" path="res://models/molikman_hands.glb" id="4_dqkch"]
[ext_resource type="Script" uid="uid://6c14qse4vnra" path="res://scripts/player/player_raycast.gd" id="4_fjrip"]
[ext_resource type="Script" uid="uid://bmecgup3kcua7" path="res://scripts/weapon_system/weapon_system.gd" id="4_qlg0r"]
[ext_resource type="PackedScene" uid="uid://djwjl8xll53vn" path="res://scenes/weapons/starting_pistol.tscn" id="7_fjrip"]

[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_u8vuu"]

[sub_resource type="Animation" id="Animation_g2els"]
resource_name = "Crouch"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape3D:shape:height")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [2.0, 1.5]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape3D:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 1, 0), Vector3(0, 0.75, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Camera3D:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 2, 0), Vector3(0, 1.5, 0)]
}

[sub_resource type="Animation" id="Animation_dqkch"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CollisionShape3D:shape:height")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [2.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CollisionShape3D:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 1, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Camera3D:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 2, 0)]
}

[sub_resource type="Animation" id="Animation_qhqgy"]
resource_name = "Stand"

[sub_resource type="AnimationLibrary" id="AnimationLibrary_qlg0r"]
_data = {
&"Crouch": SubResource("Animation_g2els"),
&"RESET": SubResource("Animation_dqkch"),
&"Stand": SubResource("Animation_qhqgy")
}

[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_g2els"]
height = 1.2958984

[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_qhqgy"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath(".:rotation")
properties/1/spawn = true
properties/1/replication_mode = 1
properties/2/path = NodePath("Camera3D:rotation")
properties/2/spawn = true
properties/2/replication_mode = 1
properties/3/path = NodePath(".:crouched")
properties/3/spawn = true
properties/3/replication_mode = 1
properties/4/path = NodePath(".:hp")
properties/4/spawn = true
properties/4/replication_mode = 1

[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("animation_player", "stand_up_area")]
collision_layer = 2
script = ExtResource("1_g2els")
animation_player = NodePath("AnimationPlayer")
stand_up_area = NodePath("StandArea")
CROUCH_TIME = 0.1

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
shape = SubResource("CapsuleShape3D_u8vuu")

[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 2, 0)
cull_mask = 1048573
fov = 90.0
script = ExtResource("3_qhqgy")
compensation_time = 0.1
compensation_delay = 0.2

[node name="molikman_hands" parent="Camera3D" instance=ExtResource("4_dqkch")]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, -1, 0)

[node name="Skeleton3D" parent="Camera3D/molikman_hands/Hands" index="0"]
bones/1/position = Vector3(0.16239367, 0.7620353, -0.22555673)
bones/1/rotation = Quaternion(-0.013897974, 0.25458142, 0.93291974, 0.25427514)
bones/2/rotation = Quaternion(0.48351443, 0.011421198, -0.101050004, 0.8694092)
bones/3/rotation = Quaternion(-0.21969835, 0.9295987, -0.14384198, -0.25862813)
bones/4/rotation = Quaternion(-0.228779, -0.029572416, 0.054699976, 0.9714905)
bones/5/rotation = Quaternion(-0.0041055745, -0.00432046, 0.08434049, 0.99641925)
bones/6/rotation = Quaternion(0.0052072993, 0.00027607038, 0.0044955458, 0.99997634)
bones/7/rotation = Quaternion(-0.1004904, -0.0019074425, 0.13231255, 0.98609906)
bones/8/rotation = Quaternion(0.024437865, -0.009641473, 0.2161158, 0.97601426)
bones/9/rotation = Quaternion(0.026062598, -0.010100163, 0.3215908, 0.94646615)
bones/10/rotation = Quaternion(-0.053834017, -0.032078788, 0.06392841, 0.995985)
bones/11/rotation = Quaternion(0.04591663, -0.010990316, 0.29229766, 0.9551613)
bones/12/rotation = Quaternion(-0.008413597, 0.0025515698, 0.3356365, 0.9419506)
bones/13/rotation = Quaternion(-0.035504643, -0.11951073, 0.017020436, 0.99205184)
bones/14/rotation = Quaternion(0.07038061, -0.042397514, 0.3243001, 0.9423792)
bones/15/rotation = Quaternion(0.010458748, -0.003636818, 0.33499107, 0.9421562)
bones/16/rotation = Quaternion(0.023548108, -0.1841245, 0.118893534, 0.9754015)
bones/17/rotation = Quaternion(0.07007245, -0.05591666, 0.21599722, 0.9722697)
bones/18/rotation = Quaternion(-0.007437984, 0.00025136053, 0.082008004, 0.9966039)
bones/19/rotation = Quaternion(-0.228779, -0.029572409, 0.05469998, 0.9714905)
bones/20/rotation = Quaternion(-0.10049036, -0.0019074364, 0.13231257, 0.9860992)
bones/21/rotation = Quaternion(-0.053834017, -0.032078788, 0.06392841, 0.995985)
bones/22/rotation = Quaternion(-0.035504643, -0.11951072, 0.017020464, 0.99205184)
bones/23/rotation = Quaternion(0.023548096, -0.18412448, 0.11889355, 0.97540146)
bones/24/position = Vector3(-0.35145342, -0.009178132, -0.18038769)
bones/25/position = Vector3(0.16239375, 0.7620353, -0.22555672)
bones/25/rotation = Quaternion(0.98640305, 0.115810655, 0.1158104, -0.013596949)
bones/26/position = Vector3(-0.16605523, 0.503459, 0.34819144)
bones/26/rotation = Quaternion(0.80184454, 0.012367124, -0.00014036377, 0.5974047)
bones/27/rotation = Quaternion(0.02130827, -0.010780271, 0.9870714, 0.15849292)
bones/28/rotation = Quaternion(0.83065116, -0.0069491817, 0.17359851, 0.5289934)
bones/29/rotation = Quaternion(0.154159, 0.96413255, -0.21364379, -0.032244705)
bones/30/rotation = Quaternion(-0.2385772, -0.09427333, -0.5218142, 0.81357443)
bones/31/rotation = Quaternion(0.22222735, 0.37126783, 0.41440633, 0.8006513)
bones/32/rotation = Quaternion(-0.21135177, -0.40205637, 0.31771636, 0.83230853)
bones/33/rotation = Quaternion(-0.05823014, 0.07767168, -0.03485695, 0.99466646)
bones/34/rotation = Quaternion(0.025301827, 0.0070700953, -0.11431894, 0.9930967)
bones/35/rotation = Quaternion(0.027933404, -0.0009984301, 0.077792086, 0.9965778)
bones/36/rotation = Quaternion(0.06419258, 0.10893227, 0.010188486, 0.9919221)
bones/37/rotation = Quaternion(0.04615016, 0.009964154, -0.27093482, 0.9614392)
bones/38/rotation = Quaternion(-0.008443102, -0.0024520692, -0.3244902, 0.9458482)
bones/39/rotation = Quaternion(0.027152644, 0.0043768333, 0.076968625, 0.9966541)
bones/40/rotation = Quaternion(0.06997402, 0.04306513, -0.3332506, 0.9392513)
bones/41/rotation = Quaternion(0.009862088, 0.005034929, -0.46087027, 0.88739854)
bones/42/rotation = Quaternion(0.14311673, 0.16402356, -0.04056179, 0.9751763)
bones/43/rotation = Quaternion(0.07528415, 0.04867352, -0.11827113, 0.9889263)
bones/44/rotation = Quaternion(-0.007426173, 0.000489381, 0.017473433, 0.99981964)
bones/45/rotation = Quaternion(-0.2385772, -0.09427333, -0.52181435, 0.81357443)
bones/46/rotation = Quaternion(-0.058230132, 0.0776717, -0.034856908, 0.9946665)
bones/47/rotation = Quaternion(0.06419257, 0.10893226, 0.010188487, 0.9919221)
bones/48/rotation = Quaternion(0.027152658, 0.0043768324, 0.07696863, 0.9966541)
bones/49/rotation = Quaternion(0.14311673, 0.16402358, -0.040561832, 0.9751763)
bones/51/rotation = Quaternion(0.9864031, -0.11581065, -0.115810156, -0.013596978)
bones/52/position = Vector3(-0.24780756, 0.5192058, 0.3484822)
bones/52/rotation = Quaternion(0.73236954, 0.00991537, -0.022315646, 0.6804694)

[node name="Skeleton3D" parent="Camera3D/molikman_hands/GunArm" index="0"]
bones/0/position = Vector3(-0.22279283, 0.7100338, -0.19202478)
bones/0/rotation = Quaternion(-0.006717509, 0.6971531, 0.71686494, -0.0060944925)
bones/1/position = Vector3(5.970651e-08, 0.06469957, 0.06380712)

[node name="RayCast3D" type="RayCast3D" parent="Camera3D"]
target_position = Vector3(0, 0, -1000)
collision_mask = 2
script = ExtResource("4_fjrip")

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_qlg0r")
}

[node name="StandArea" type="Area3D" parent="."]
collision_layer = 0

[node name="CollisionShape3D" type="CollisionShape3D" parent="StandArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3520508, 0)
shape = SubResource("CapsuleShape3D_g2els")
debug_color = Color(0.9878064, 0, 0.31407458, 0.41960785)
debug_fill = false

[node name="HUD" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Crosshair" type="Control" parent="HUD"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("3_dqkch")
crosses_width = 2.0
crosses_length = 6.0
crosses_offset = 3.0

[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
replication_config = SubResource("SceneReplicationConfig_qhqgy")

[node name="WeaponSystem" type="Node" parent="." node_paths=PackedStringArray("default_pistol", "animation_player", "camera")]
script = ExtResource("4_qlg0r")
default_pistol = NodePath("StartingPistol")
animation_player = NodePath("../Camera3D/molikman_hands/AnimationPlayer")
camera = NodePath("../Camera3D")

[node name="StartingPistol" parent="WeaponSystem" instance=ExtResource("7_fjrip")]

[node name="Shoot" parent="WeaponSystem/StartingPistol" index="1" node_paths=PackedStringArray("raycast")]
raycast = NodePath("../../../Camera3D/RayCast3D")

[editable path="Camera3D/molikman_hands"]
[editable path="WeaponSystem/StartingPistol"]
