diff --git a/maps/dev_map.tscn b/maps/dev_map.tscn index 30c6f43..6d7f067 100644 --- a/maps/dev_map.tscn +++ b/maps/dev_map.tscn @@ -16,6 +16,8 @@ [sub_resource type="BoxMesh" id="BoxMesh_yf5fn"] +[sub_resource type="PrismMesh" id="PrismMesh_fm80t"] + [sub_resource type="BoxShape3D" id="BoxShape3D_57qmd"] size = Vector3(20.447998, 11.038544, 1) @@ -54,7 +56,7 @@ shape = SubResource("BoxShape3D_yf5fn") [node name="MeshInstance3D" type="MeshInstance3D" parent="TestObjectGrabbable" unique_id=1899834557] mesh = SubResource("BoxMesh_yf5fn") -[node name="TestObjectEquippable" type="RigidBody3D" parent="." unique_id=1086000939] +[node name="TestObjectEquippable" type="RigidBody3D" parent="." unique_id=1086000939 groups=["equippable"]] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.874709, 1.0290127, -3.1515453) collision_layer = 17 collision_mask = 17 @@ -65,6 +67,17 @@ shape = SubResource("BoxShape3D_yf5fn") [node name="MeshInstance3D" type="MeshInstance3D" parent="TestObjectEquippable" unique_id=1967579265] mesh = SubResource("BoxMesh_yf5fn") +[node name="TestObjectEquippable2" type="RigidBody3D" parent="." unique_id=1583455063 groups=["equippable"]] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.874709, 1.0290127, -0.18258262) +collision_layer = 17 +collision_mask = 17 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="TestObjectEquippable2" unique_id=1155644968] +shape = SubResource("BoxShape3D_yf5fn") + +[node name="MeshInstance3D" type="MeshInstance3D" parent="TestObjectEquippable2" unique_id=976512750] +mesh = SubResource("PrismMesh_fm80t") + [node name="Player" parent="." unique_id=423228143 instance=ExtResource("1_s8b7j")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.77974355, 1.137004) diff --git a/project.godot b/project.godot index 0ade2f1..1ae7db5 100644 --- a/project.godot +++ b/project.godot @@ -29,6 +29,7 @@ Console="*uid://bojihx1fwf426" PlayerConsts="*uid://l2rc674shj03" Sounds="*uid://c4vhdhbi2yu8i" LoadingScreen="*uid://br8pa51piwxuy" +GrabbableBase="*uid://csj6ipagcwmeu" [display] @@ -57,6 +58,7 @@ folder_colors={ [global_group] grabbable="this object can be grabbed" +equippable="the item is equippable" [input] @@ -115,41 +117,74 @@ ui_text_submit={ forward={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null) ] } backward={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null) ] } left={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null) ] } right={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null) +] +} +look_up={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null) +] +} +look_down={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) +] +} +look_left={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null) +] +} +look_right={ +"deadzone": 0.2, +"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null) ] } jump={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null) ] } crouch={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194326,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":true,"script":null) ] } sprint={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":7,"pressure":0.0,"pressed":true,"script":null) ] } open_menu={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":true,"script":null) +] +} +equip={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) ] } select_item_1={ @@ -180,31 +215,37 @@ select_item_5={ next_item={ "deadzone": 0.2, "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":8,"position":Vector2(139, 22),"global_position":Vector2(148, 70),"factor":1.0,"button_index":4,"canceled":false,"pressed":true,"double_click":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":true,"script":null) ] } prev_item={ "deadzone": 0.2, "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":16,"position":Vector2(101, 21),"global_position":Vector2(110, 69),"factor":1.0,"button_index":5,"canceled":false,"pressed":true,"double_click":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":13,"pressure":0.0,"pressed":true,"script":null) ] } lean_left={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":true,"script":null) ] } lean_right={ "deadzone": 0.2, "events": [null, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":null) ] } flashlight={ "deadzone": 0.2, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":3,"pressure":0.0,"pressed":true,"script":null) ] } grab={ "deadzone": 0.2, "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(316, 15),"global_position":Vector2(325, 63),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null) ] } toggle_console={ diff --git a/scenes/grabbable_base/grabbable_base.gd b/scenes/grabbable_base/grabbable_base.gd index 5aeb37f..5dce96e 100644 --- a/scenes/grabbable_base/grabbable_base.gd +++ b/scenes/grabbable_base/grabbable_base.gd @@ -1,9 +1,10 @@ -extends RigidBody3D +extends Node3D @onready var viewport = %SubViewport @onready var mesh_instance = %GrabbableBaseMesh func create_icon_from_mesh(target_mesh: Mesh) -> Texture2D: + self.visible = true # 1. Put the grabbable item's mesh into our hidden photo booth mesh_instance.mesh = target_mesh @@ -23,5 +24,6 @@ func create_icon_from_mesh(target_mesh: Mesh) -> Texture2D: # Clear the mesh so the generator is clean for the next item mesh_instance.mesh = null + self.visible = false return final_texture diff --git a/scenes/grabbable_base/grabbable_base.tscn b/scenes/grabbable_base/grabbable_base.tscn index 9e0a313..487e94d 100644 --- a/scenes/grabbable_base/grabbable_base.tscn +++ b/scenes/grabbable_base/grabbable_base.tscn @@ -2,15 +2,14 @@ [ext_resource type="Script" uid="uid://cg6uae2pbr7eq" path="res://scenes/grabbable_base/grabbable_base.gd" id="1_rs3u4"] -[sub_resource type="BoxShape3D" id="BoxShape3D_1r4x2"] - [sub_resource type="PrismMesh" id="PrismMesh_60a4j"] -[node name="GrabbableBase" type="RigidBody3D" unique_id=1244645162] +[node name="GrabbableBase" type="Node3D" unique_id=1116744401] script = ExtResource("1_rs3u4") [node name="SubViewport" type="SubViewport" parent="." unique_id=174206665] unique_name_in_owner = true +own_world_3d = true transparent_bg = true size = Vector2i(128, 128) render_target_update_mode = 1 @@ -21,12 +20,10 @@ current = true fov = 73.3 near = 0.106 -[node name="GrabbableBaseCollider" type="CollisionShape3D" parent="." unique_id=5194036] -shape = SubResource("BoxShape3D_1r4x2") - -[node name="GrabbableBaseMesh" type="MeshInstance3D" parent="." unique_id=191136965] +[node name="GrabbableBaseMesh" type="MeshInstance3D" parent="SubViewport" unique_id=191136965] unique_name_in_owner = true mesh = SubResource("PrismMesh_60a4j") -[node name="AreaLight3D" type="AreaLight3D" parent="." unique_id=283063489] -transform = Transform3D(0.74197584, -0.40812987, 0.53188515, 0, 0.7933533, 0.6087614, -0.6704266, -0.45168626, 0.588649, 0.8652531, 0.7732402, 0.9565933) +[node name="AreaLight3D" type="AreaLight3D" parent="SubViewport" unique_id=283063489] +transform = Transform3D(0.74197584, -0.40812987, 0.5318852, 0, 0.7933533, 0.6087615, -0.6704266, -0.45168626, 0.58864903, 0.8652531, 0.7732402, 0.9565933) +area_range = 544.72 diff --git a/scenes/player/input_controller_component.gd b/scenes/player/input_controller_component.gd index b1ba536..158f885 100644 --- a/scenes/player/input_controller_component.gd +++ b/scenes/player/input_controller_component.gd @@ -26,54 +26,6 @@ func toggle_flashlight(): flashlight.visible = !flashlight.visible sound_controller.play_flashlight_sound() -func _input(event): - if not Console.toggled: - if Input.is_action_just_pressed("open_menu"): - ui_handler.toggle_menu() - - if Input.is_action_just_pressed("select_item_1"): - player_manager.select_item(0) - - if Input.is_action_just_pressed("select_item_2"): - player_manager.select_item(1) - - if Input.is_action_just_pressed("select_item_3"): - player_manager.select_item(2) - - if Input.is_action_just_pressed("select_item_4"): - player_manager.select_item(3) - - if Input.is_action_just_pressed("select_item_5"): - player_manager.select_item(4) - - if not player_state.in_menu: - if event is InputEventMouseMotion: - if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED: - mouse_motion += event.relative - mouse_motion_delta = event.relative - - if Input.is_action_just_pressed("flashlight"): - toggle_flashlight() - - if Input.is_action_just_released("jump") or Input.is_action_just_released("sprint"): - stamina_reset.start() - - if Input.is_action_just_pressed("grab"): - if cursor_raycast.is_colliding(): - var hit_object = cursor_raycast.get_collider() - - if hit_object is RigidBody3D and hit_object.is_in_group("grabbable"): - held_object = hit_object - held_object.gravity_scale = 0.0 - held_object.angular_damp = 5.0 - popup_panels.visible = false - - if Input.is_action_just_released("grab") and held_object != null: - held_object.gravity_scale = 1.0 - held_object.angular_damp = 0.0 - held_object = null - popup_panels.visible = true - func _physics_process(_delta: float) -> void: #handle grabbed object if held_object != null: @@ -95,7 +47,27 @@ func _physics_process(_delta: float) -> void: held_object.angular_velocity = axis * angle * PlayerConsts.GRAB_ROTATION_POWER +func handle_joypad_movement(delta: float): + var controller_look_vector = Input.get_vector("look_left", "look_right", "look_up", "look_down") * 50 + + if controller_look_vector.length() > 0: + mouse_motion += controller_look_vector + mouse_motion_delta = controller_look_vector + +func equip_object(object: RigidBody3D): + player_manager.add_item(object) + +func _input(event: InputEvent) -> void: + if not player_state.in_menu: + if event is InputEventMouseMotion: + if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED: + mouse_motion += event.relative + mouse_motion_delta = event.relative + func _process(delta: float) -> void: + if !Console.toggled: + handle_joypad_movement(delta) + mouse_motion.y = clamp(mouse_motion.y, -1560, 1560) player.transform.basis = Basis.from_euler(Vector3(0, mouse_motion.x * -0.001 * PlayerConsts.LOOK_SENSITIVITY, 0)) camera.transform.basis = lerp(camera.transform.basis, Basis.from_euler(Vector3(mouse_motion.y * -0.001 * PlayerConsts.LOOK_SENSITIVITY, 0, 0)), delta * 10) @@ -106,6 +78,53 @@ func _process(delta: float) -> void: if Input.is_action_just_pressed("prev_item"): player_manager.prev_item() + + if Input.is_action_just_pressed("open_menu"): + ui_handler.toggle_menu() + + if Input.is_action_just_pressed("select_item_1"): + player_manager.select_item(0) + + if Input.is_action_just_pressed("select_item_2"): + player_manager.select_item(1) + + if Input.is_action_just_pressed("select_item_3"): + player_manager.select_item(2) + + if Input.is_action_just_pressed("select_item_4"): + player_manager.select_item(3) + + if Input.is_action_just_pressed("select_item_5"): + player_manager.select_item(4) + + if Input.is_action_just_pressed("flashlight"): + toggle_flashlight() + + if Input.is_action_just_released("jump") or Input.is_action_just_released("sprint"): + stamina_reset.start() + + if Input.is_action_just_pressed("grab"): + if cursor_raycast.is_colliding(): + var hit_object = cursor_raycast.get_collider() + + if hit_object is RigidBody3D and hit_object.is_in_group("grabbable"): + held_object = hit_object + held_object.gravity_scale = 0.0 + held_object.angular_damp = 5.0 + popup_panels.visible = false + + if Input.is_action_just_released("grab") and held_object != null: + held_object.gravity_scale = 1.0 + held_object.angular_damp = 0.0 + held_object = null + popup_panels.visible = true + + if Input.is_action_just_pressed("equip"): + if cursor_raycast.is_colliding(): + var hit_object = cursor_raycast.get_collider() + + if hit_object is RigidBody3D and hit_object.is_in_group("equippable"): + equip_object(hit_object) #func _unhandled_input(event: InputEvent) -> void: #if event is InputEventMouseMotion: diff --git a/scenes/player/player.tscn b/scenes/player/player.tscn index b5f88c7..6e01488 100644 --- a/scenes/player/player.tscn +++ b/scenes/player/player.tscn @@ -1,216 +1,17 @@ [gd_scene format=3 uid="uid://kqq30y24c6kd"] [ext_resource type="Script" uid="uid://bawpnca3v51gv" path="res://scenes/player/player.gd" id="1_76ube"] -[ext_resource type="AudioStream" uid="uid://he4huk3fb0vm" path="res://assets/sounds/walking/normal/normal walk-001.wav" id="2_32hag"] [ext_resource type="PackedScene" uid="uid://bsccbqq04umeg" path="res://scenes/player/player_ui.tscn" id="2_rkbax"] [ext_resource type="PackedScene" uid="uid://y5f3db7clptv" path="res://scenes/player/in_game_menu.tscn" id="3_g1dw6"] -[ext_resource type="AudioStream" uid="uid://db5upx7hn27qe" path="res://assets/sounds/walking/normal/normal walk-002.wav" id="3_tqiix"] -[ext_resource type="AudioStream" uid="uid://b00bi5iffp5lf" path="res://assets/sounds/walking/normal/normal walk-003.wav" id="4_e7oew"] -[ext_resource type="AudioStream" uid="uid://6slw3x6cnmim" path="res://assets/sounds/walking/normal/normal walk-004.wav" id="5_c35mf"] -[ext_resource type="AudioStream" uid="uid://cbi4ej24sjoho" path="res://assets/sounds/walking/normal/normal walk-005.wav" id="6_65viv"] -[ext_resource type="AudioStream" uid="uid://bjs2o6l53l0vi" path="res://assets/sounds/walking/normal/normal walk-006.wav" id="7_x7c3f"] -[ext_resource type="AudioStream" uid="uid://c68qrr5057go2" path="res://assets/sounds/walking/normal/normal walk-007.wav" id="8_bjvpn"] -[ext_resource type="AudioStream" uid="uid://dgbbjrqihuf8r" path="res://assets/sounds/walking/normal/normal walk-008.wav" id="9_s7qer"] -[ext_resource type="AudioStream" uid="uid://6rrb5d1xhvwb" path="res://assets/sounds/walking/normal/normal walk-009.wav" id="10_g4c7l"] -[ext_resource type="AudioStream" uid="uid://xh26crutjmm" path="res://assets/sounds/walking/normal/normal walk-010.wav" id="11_knn7v"] -[ext_resource type="AudioStream" uid="uid://cckmu66u5dmkr" path="res://assets/sounds/walking/normal/normal walk-011.wav" id="12_7pqkx"] -[ext_resource type="AudioStream" uid="uid://bayicbs3w8rp3" path="res://assets/sounds/walking/normal/normal walk-012.wav" id="13_uw77l"] -[ext_resource type="AudioStream" uid="uid://bv53c27ead2iv" path="res://assets/sounds/walking/normal/normal walk-013.wav" id="14_rptt4"] -[ext_resource type="AudioStream" uid="uid://bogmfvsfsswut" path="res://assets/sounds/walking/heavy/heavy walk (running)-001.wav" id="15_n0b8q"] -[ext_resource type="AudioStream" uid="uid://bii8vhogk3ngt" path="res://assets/sounds/walking/heavy/heavy walk (running)-002.wav" id="16_jfgyi"] -[ext_resource type="AudioStream" uid="uid://gq6omth013bk" path="res://assets/sounds/walking/heavy/heavy walk (running)-003.wav" id="17_237xx"] -[ext_resource type="AudioStream" uid="uid://b6gta2gvonu0y" path="res://assets/sounds/walking/heavy/heavy walk (running)-004.wav" id="18_wpyo2"] -[ext_resource type="AudioStream" uid="uid://bn6neny4irlb0" path="res://assets/sounds/walking/heavy/heavy walk (running)-005.wav" id="19_7crtr"] -[ext_resource type="AudioStream" uid="uid://6fv6pcu7mu8k" path="res://assets/sounds/walking/heavy/heavy walk (running)-006.wav" id="20_vgvch"] -[ext_resource type="AudioStream" uid="uid://chd0ckcavb4uy" path="res://assets/sounds/walking/heavy/heavy walk (running)-007.wav" id="21_a1u5o"] -[ext_resource type="AudioStream" uid="uid://c7f67h6nku648" path="res://assets/sounds/walking/heavy/heavy walk (running)-008.wav" id="22_3dxkp"] -[ext_resource type="AudioStream" uid="uid://c8u0gtqif3l8r" path="res://assets/sounds/walking/heavy/heavy walk (running)-009.wav" id="23_6wior"] -[ext_resource type="AudioStream" uid="uid://ctcakfvx6yigv" path="res://assets/sounds/walking/heavy/heavy walk (running)-010.wav" id="24_p5tca"] -[ext_resource type="AudioStream" uid="uid://1gvocom5hcqb" path="res://assets/sounds/walking/heavy/heavy walk (running)-011.wav" id="25_jbx34"] -[ext_resource type="AudioStream" uid="uid://eem1vc06eh2m" path="res://assets/sounds/walking/heavy/heavy walk (running)-012.wav" id="26_s3g0c"] -[ext_resource type="AudioStream" uid="uid://dus2sgrtq31fe" path="res://assets/sounds/walking/heavy/heavy walk (running)-013.wav" id="27_35wys"] -[ext_resource type="AudioStream" uid="uid://dlw5s82kg8bax" path="res://assets/sounds/walking/heavy/heavy walk (running)-014.wav" id="28_pjwc4"] -[ext_resource type="AudioStream" uid="uid://bfhcv3jnnpf7e" path="res://assets/sounds/walking/heavy/heavy walk (running)-015.wav" id="29_or4qq"] -[ext_resource type="AudioStream" uid="uid://dtb44117yp5pf" path="res://assets/sounds/walking/heavy/heavy walk (running)-016.wav" id="30_hggc2"] -[ext_resource type="AudioStream" uid="uid://d11n1qlwjjtgk" path="res://assets/sounds/walking/light/light walk-001.wav" id="31_b2j0d"] -[ext_resource type="AudioStream" uid="uid://bt6fd43j67a7a" path="res://assets/sounds/walking/light/light walk-002.wav" id="32_7l6ig"] -[ext_resource type="AudioStream" uid="uid://byltouohmnamp" path="res://assets/sounds/walking/light/light walk-003.wav" id="33_j3r50"] -[ext_resource type="AudioStream" uid="uid://bttnajyewet2i" path="res://assets/sounds/walking/light/light walk-004.wav" id="34_utr5e"] -[ext_resource type="AudioStream" uid="uid://djnn2ndppw6n8" path="res://assets/sounds/walking/light/light walk-005.wav" id="35_kewli"] -[ext_resource type="AudioStream" uid="uid://bd37wmum0boqa" path="res://assets/sounds/walking/light/light walk-006.wav" id="36_do7qw"] -[ext_resource type="AudioStream" uid="uid://bv8puyd54wmly" path="res://assets/sounds/walking/light/light walk-007.wav" id="37_2h6tc"] -[ext_resource type="AudioStream" uid="uid://dbnek0vsfwyk5" path="res://assets/sounds/walking/light/light walk-008.wav" id="38_8rogd"] -[ext_resource type="AudioStream" uid="uid://cav2wgpvselrg" path="res://assets/sounds/walking/light/light walk-009.wav" id="39_48p26"] -[ext_resource type="AudioStream" uid="uid://bsqgdsmwt1ovp" path="res://assets/sounds/walking/light/light walk-010.wav" id="40_anp34"] -[ext_resource type="AudioStream" uid="uid://hr4k5gsmbqgj" path="res://assets/sounds/walking/light/light walk-011.wav" id="41_jdjat"] -[ext_resource type="AudioStream" uid="uid://d17j6w4t2qkai" path="res://assets/sounds/walking/light/light walk-012.wav" id="42_j420s"] -[ext_resource type="AudioStream" uid="uid://b3dynes8om0be" path="res://assets/sounds/walking/light/light walk-013.wav" id="43_kcq4v"] -[ext_resource type="AudioStream" uid="uid://bw8dt5rd8j50y" path="res://assets/sounds/walking/shuffle/csoszogás-001.wav" id="44_qavcc"] -[ext_resource type="AudioStream" uid="uid://dkxliin18sua2" path="res://assets/sounds/walking/shuffle/csoszogás-002.wav" id="45_bd26m"] -[ext_resource type="AudioStream" uid="uid://cijtqpij23hyd" path="res://assets/sounds/walking/shuffle/csoszogás-003.wav" id="46_lufic"] -[ext_resource type="AudioStream" uid="uid://tmflo6rp0cu4" path="res://assets/sounds/walking/shuffle/csoszogás-004.wav" id="47_nxclr"] -[ext_resource type="AudioStream" uid="uid://c3bl5rkqf1dn7" path="res://assets/sounds/walking/shuffle/csoszogás-005.wav" id="48_onxu2"] -[ext_resource type="AudioStream" uid="uid://cueon12gi7jeh" path="res://assets/sounds/walking/shuffle/csoszogás-006.wav" id="49_gci7n"] -[ext_resource type="AudioStream" uid="uid://ccospbyrg6sb1" path="res://assets/sounds/walking/shuffle/csoszogás-007.wav" id="50_tcwf7"] -[ext_resource type="AudioStream" uid="uid://bii7gnp5a2ytj" path="res://assets/sounds/flashlight/flashlight-click-001.wav" id="51_pjwc4"] -[ext_resource type="AudioStream" uid="uid://dpydqsettcowx" path="res://assets/sounds/flashlight/flashlight-click-002.wav" id="52_or4qq"] -[ext_resource type="AudioStream" uid="uid://dumse20g0tt21" path="res://assets/sounds/flashlight/flashlight-click-003.wav" id="53_hggc2"] -[ext_resource type="AudioStream" uid="uid://bxebqhgkkeqhp" path="res://assets/sounds/flashlight/flashlight-click-005.wav" id="55_7l6ig"] -[ext_resource type="AudioStream" uid="uid://ctmut3x6w0sj1" path="res://assets/sounds/flashlight/flashlight-click-006.wav" id="56_j3r50"] -[ext_resource type="AudioStream" uid="uid://dsgr417h5gcn0" path="res://assets/sounds/flashlight/flashlight-click-009.wav" id="59_do7qw"] -[ext_resource type="PackedScene" uid="uid://c02fkimxlbrje" path="res://scenes/player/grab_prompt.tscn" id="59_p5tca"] [ext_resource type="Script" uid="uid://dr2lwciaohf6f" path="res://scenes/player/movement_component.gd" id="60_s3g0c"] -[ext_resource type="AudioStream" uid="uid://b8ppwr5vwhej0" path="res://assets/sounds/flashlight/flashlight-click-011.wav" id="61_8rogd"] [ext_resource type="Script" uid="uid://cjk6a0da11ge6" path="res://scenes/player/procedural_camera_mover_component.gd" id="61_hggc2"] -[ext_resource type="AudioStream" uid="uid://dlyhi0c2bw5b2" path="res://assets/sounds/flashlight/flashlight-click-012.wav" id="62_48p26"] [ext_resource type="Script" uid="uid://v8er7yn0hdh8" path="res://scenes/player/sound_controller_component.gd" id="62_b2j0d"] [ext_resource type="Script" uid="uid://y8x4svl5kej2" path="res://addons/spatial_audio_3d/spatial_audio_3d.gd" id="62_jbx34"] [ext_resource type="Script" uid="uid://7aa26wi66kqq" path="res://scenes/player/ui_handler_component.gd" id="63_7l6ig"] -[ext_resource type="AudioStream" uid="uid://m8l0dbbt7ijs" path="res://assets/sounds/walking/jump_landing/Jump-landing-001.wav" id="63_pkjeu"] -[ext_resource type="AudioStream" uid="uid://b5dxawp2qd8ps" path="res://assets/sounds/walking/jump_landing/Jump-landing-002.wav" id="64_0epl4"] [ext_resource type="Script" uid="uid://bvvwwkswavy5x" path="res://scenes/player/input_controller_component.gd" id="64_j3r50"] -[ext_resource type="AudioStream" uid="uid://c1wt8hmiv44oe" path="res://assets/sounds/walking/jump_landing/Jump-landing-003.wav" id="65_3r8w6"] [ext_resource type="Script" uid="uid://7hmwhf7acwpj" path="res://scenes/player/state_handler_component.gd" id="65_kssj8"] [ext_resource type="Script" uid="uid://cbdvyelf7nb1u" path="res://scenes/player/player_manager.gd" id="66_8lfxt"] -[ext_resource type="AudioStream" uid="uid://bv4npi51e2gww" path="res://assets/sounds/walking/jump_landing/Jump-landing-004.wav" id="66_i816j"] -[ext_resource type="AudioStream" uid="uid://cv4ojt7yvqtac" path="res://assets/sounds/walking/jump_landing/Jump-landing-005.wav" id="67_laqvq"] -[ext_resource type="AudioStream" uid="uid://wy8m1rr6delh" path="res://assets/sounds/walking/jump_landing/Jump-landing-006.wav" id="68_aq51r"] -[ext_resource type="AudioStream" uid="uid://26iqrpcn335f" path="res://assets/sounds/walking/jump_landing/Jump-landing-007.wav" id="69_q3ejk"] -[ext_resource type="AudioStream" uid="uid://du6cufwedemx6" path="res://assets/sounds/walking/jump_landing/Jump-landing-008.wav" id="70_2dxln"] -[ext_resource type="AudioStream" uid="uid://mb8r848krfcd" path="res://assets/sounds/walking/jump_landing/Jump-landing-009.wav" id="71_gsldg"] -[ext_resource type="AudioStream" uid="uid://6t8udlewh5po" path="res://assets/sounds/walking/jump_landing/Jump-landing-010.wav" id="72_rrrpt"] -[ext_resource type="AudioStream" uid="uid://2d1jvlj0qsfm" path="res://assets/sounds/walking/jump_landing/Jump-landing-011.wav" id="73_us45u"] -[ext_resource type="AudioStream" uid="uid://cvxbp8e5muvsi" path="res://assets/sounds/walking/jump_landing/Jump-landing-012.wav" id="74_wvv85"] -[ext_resource type="AudioStream" uid="uid://dmr7k5icpmbuj" path="res://assets/sounds/walking/jump_landing/Jump-landing-013.wav" id="75_hxu4r"] -[ext_resource type="AudioStream" uid="uid://ds1xgblkwfbbr" path="res://assets/sounds/walking/jump_starting/Jump-starting-001.wav" id="76_i6dto"] -[ext_resource type="AudioStream" uid="uid://dtd5vh23bin1q" path="res://assets/sounds/walking/jump_starting/Jump-starting-002.wav" id="77_4d8j4"] -[ext_resource type="AudioStream" uid="uid://cbyjyjrq3hyt8" path="res://assets/sounds/walking/jump_starting/Jump-starting-003.wav" id="78_s27sh"] -[ext_resource type="AudioStream" uid="uid://cro4b8arxnujq" path="res://assets/sounds/walking/jump_starting/Jump-starting-004.wav" id="79_1vi86"] -[ext_resource type="AudioStream" uid="uid://wwqh277vcf0s" path="res://assets/sounds/walking/jump_starting/Jump-starting-005.wav" id="80_beayq"] -[ext_resource type="AudioStream" uid="uid://drcu5bga2jkcs" path="res://assets/sounds/walking/jump_starting/Jump-starting-006.wav" id="81_12j61"] -[ext_resource type="AudioStream" uid="uid://bsvbvqhqrem76" path="res://assets/sounds/walking/jump_starting/Jump-starting-007.wav" id="82_kthys"] -[ext_resource type="AudioStream" uid="uid://doplej8ls8dm7" path="res://assets/sounds/walking/jump_starting/Jump-starting-008.wav" id="83_48o5h"] -[ext_resource type="AudioStream" uid="uid://cklsdk5055xmt" path="res://assets/sounds/walking/jump_starting/Jump-starting-009.wav" id="84_xum3i"] -[ext_resource type="AudioStream" uid="uid://cihklhhsqw8gv" path="res://assets/sounds/walking/jump_starting/Jump-starting-010.wav" id="85_ct4wv"] -[ext_resource type="AudioStream" uid="uid://dgoyg4wk6f0dq" path="res://assets/sounds/walking/jump_starting/Jump-starting-011.wav" id="86_teg5g"] -[ext_resource type="AudioStream" uid="uid://cm8pl8cmk3g6t" path="res://assets/sounds/walking/jump_starting/Jump-starting-012.wav" id="87_vcxk4"] -[ext_resource type="AudioStream" uid="uid://neoc2pa1syt4" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-001.wav" id="88_x6bw1"] -[ext_resource type="AudioStream" uid="uid://8j7il8h57mah" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-002.wav" id="89_e1bru"] -[ext_resource type="AudioStream" uid="uid://clf0pe72466c2" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-003.wav" id="90_63x2c"] -[ext_resource type="AudioStream" uid="uid://cafdbjgdsx3sp" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-004.wav" id="91_arxfr"] -[ext_resource type="AudioStream" uid="uid://dowbrvsjxkwb6" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-005.wav" id="92_5ecds"] -[ext_resource type="AudioStream" uid="uid://dgfrrdq0i2ypm" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-006.wav" id="93_nssm8"] -[ext_resource type="AudioStream" uid="uid://s1kgrff6yex5" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-007.wav" id="94_ei0bd"] -[ext_resource type="AudioStream" uid="uid://c8wxsbm4tcg7u" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-008.wav" id="95_wwa77"] -[ext_resource type="AudioStream" uid="uid://dq6dxohfpwxbe" path="res://assets/sounds/breathing/jump_landing/Jump-landing-breath-009.wav" id="96_tdwly"] -[ext_resource type="AudioStream" uid="uid://c8jctl7rnt2be" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-001.wav" id="97_fmlco"] -[ext_resource type="AudioStream" uid="uid://ygcl230au0p6" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-002.wav" id="98_duoik"] -[ext_resource type="AudioStream" uid="uid://dea8ndg1asyk" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-003.wav" id="99_6qclm"] -[ext_resource type="AudioStream" uid="uid://bpsnlo1kacuo0" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-004.wav" id="100_mtkxs"] -[ext_resource type="AudioStream" uid="uid://btrjiosx6bsuj" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-005.wav" id="101_pxyg8"] -[ext_resource type="AudioStream" uid="uid://c3ehcborefxxh" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-006.wav" id="102_xm1em"] -[ext_resource type="AudioStream" uid="uid://w66w8tfhw8d5" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-007.wav" id="103_6ix8p"] -[ext_resource type="AudioStream" uid="uid://djtweftr6pqq6" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-008.wav" id="104_fntve"] -[ext_resource type="AudioStream" uid="uid://068u3u51j1mr" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-009.wav" id="105_a2vma"] -[ext_resource type="AudioStream" uid="uid://18hrvhk3i5ay" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-010.wav" id="106_b63cp"] -[ext_resource type="AudioStream" uid="uid://dhtudndpsy06f" path="res://assets/sounds/breathing/jump_starting/Jump-starting-breath-011.wav" id="107_l2ov3"] -[ext_resource type="AudioStream" uid="uid://ckff6hj147vel" path="res://assets/sounds/breathing/breathe_in/breathe_in_calm/Breathe-in-calm-001.mp3" id="108_76ube"] -[ext_resource type="AudioStream" uid="uid://br8wnwv76bdxw" path="res://assets/sounds/breathing/breathe_in/breathe_in_calm/Breathe-in-calm-002.mp3" id="109_agxve"] -[ext_resource type="AudioStream" uid="uid://bxjuiklnicjas" path="res://assets/sounds/breathing/breathe_in/breathe_in_calm/Breathe-in-calm-003.mp3" id="110_8ue2q"] -[ext_resource type="AudioStream" uid="uid://lc51pt12tqoa" path="res://assets/sounds/breathing/breathe_in/breathe_in_calm/Breathe-in-calm-004.mp3" id="111_p0pgs"] -[ext_resource type="AudioStream" uid="uid://du2h647hymjxb" path="res://assets/sounds/breathing/breathe_in/breathe_in_calm/Breathe-in-calm-005.mp3" id="112_uru8s"] -[ext_resource type="AudioStream" uid="uid://bcdtnx6gcuh5" path="res://assets/sounds/breathing/breathe_in/breathe_in_low/Breathe-in-low-001.mp3" id="113_mqtqs"] -[ext_resource type="AudioStream" uid="uid://d1r4ybjwmqxsw" path="res://assets/sounds/breathing/breathe_in/breathe_in_low/Breathe-in-low-002.mp3" id="114_mje2k"] -[ext_resource type="AudioStream" uid="uid://cx6eiff56ww2a" path="res://assets/sounds/breathing/breathe_in/breathe_in_low/Breathe-in-low-003.mp3" id="115_c0t4m"] -[ext_resource type="AudioStream" uid="uid://5okgfhekv4l6" path="res://assets/sounds/breathing/breathe_in/breathe_in_low/Breathe-in-low-004.mp3" id="116_axrhj"] -[ext_resource type="AudioStream" uid="uid://b8imcfuqa228f" path="res://assets/sounds/breathing/breathe_in/breathe_in_low/Breathe-in-low-005.mp3" id="117_14dna"] -[ext_resource type="AudioStream" uid="uid://hom1n0yqdqhl" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-001.mp3" id="118_dtvgl"] -[ext_resource type="AudioStream" uid="uid://clxgeypjw0cnu" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-002.mp3" id="119_oa6rg"] -[ext_resource type="AudioStream" uid="uid://c2wdahp1wyaj3" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-003.mp3" id="120_qnksm"] -[ext_resource type="AudioStream" uid="uid://h7s43su7guj4" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-004.mp3" id="121_u6low"] -[ext_resource type="AudioStream" uid="uid://bp0vntm8alsu6" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-005.mp3" id="122_lqiud"] -[ext_resource type="AudioStream" uid="uid://53excusm7nmr" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-006.mp3" id="123_m1x1w"] -[ext_resource type="AudioStream" uid="uid://c1s3pij2eo8yi" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-007.mp3" id="124_pewko"] -[ext_resource type="AudioStream" uid="uid://dyv485tit88uy" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-008.mp3" id="125_oq118"] -[ext_resource type="AudioStream" uid="uid://cnowvw3l2xh5o" path="res://assets/sounds/breathing/breathe_in/breathe_in_mid/Breathe-in-mid-009.mp3" id="126_cw82d"] -[ext_resource type="AudioStream" uid="uid://dl5swalfuq3ju" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-001.mp3" id="127_g11hh"] -[ext_resource type="AudioStream" uid="uid://dvjajoo73m2m0" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-002.mp3" id="128_mcl3m"] -[ext_resource type="AudioStream" uid="uid://cojxamnp2jgbq" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-003.mp3" id="129_s46af"] -[ext_resource type="AudioStream" uid="uid://fl5f6vyomtgw" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-004.mp3" id="130_rpy06"] -[ext_resource type="AudioStream" uid="uid://b13ec1itp5m1f" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-005.mp3" id="131_f4fcx"] -[ext_resource type="AudioStream" uid="uid://cd3ioy8cev6o2" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-006.mp3" id="132_auu8a"] -[ext_resource type="AudioStream" uid="uid://bdycd08rs5lto" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-007.mp3" id="133_lkwya"] -[ext_resource type="AudioStream" uid="uid://bvip6wkxnje7k" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-008.mp3" id="134_et857"] -[ext_resource type="AudioStream" uid="uid://c6lskxqw74giq" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-009.mp3" id="135_7yw2v"] -[ext_resource type="AudioStream" uid="uid://d3icuggu6j03f" path="res://assets/sounds/breathing/breathe_in/breathe_in_heavy/Breathe-in-heavy-010.mp3" id="136_eb5ts"] -[ext_resource type="AudioStream" uid="uid://xsxqu5t0p1db" path="res://assets/sounds/breathing/breathe_in/breathe_in_max/Breathe-in-max-001.mp3" id="137_ui8rx"] -[ext_resource type="AudioStream" uid="uid://d3detm67ixuab" path="res://assets/sounds/breathing/breathe_in/breathe_in_max/Breathe-in-max-002.mp3" id="138_fild8"] -[ext_resource type="AudioStream" uid="uid://bbgnw8bvwko1l" path="res://assets/sounds/breathing/breathe_in/breathe_in_max/Breathe-in-max-003.mp3" id="139_oyq3u"] -[ext_resource type="AudioStream" uid="uid://qvwvaolik7w4" path="res://assets/sounds/breathing/breathe_in/breathe_in_max/Breathe-in-max-004.mp3" id="140_q53ni"] -[ext_resource type="AudioStream" uid="uid://cbmqas7bomxd6" path="res://assets/sounds/breathing/breathe_in/breathe_in_max/Breathe-in-max-005.mp3" id="141_4v6xr"] -[ext_resource type="AudioStream" uid="uid://bp2bqy7li7fhe" path="res://assets/sounds/breathing/breathe_in/breathe_in_max/Breathe-in-max-006.mp3" id="142_o8ce2"] -[ext_resource type="AudioStream" uid="uid://do345lm7e30my" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-001.mp3" id="143_s6fkf"] -[ext_resource type="AudioStream" uid="uid://c7phfwf26bby2" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-002.mp3" id="144_7kgw3"] -[ext_resource type="AudioStream" uid="uid://dysxdat6c51fl" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-003.mp3" id="145_mu3ts"] -[ext_resource type="AudioStream" uid="uid://cxn86pp58r0vn" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-004.mp3" id="146_ewv0n"] -[ext_resource type="AudioStream" uid="uid://bu50pqieqh0b3" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-005.mp3" id="147_lbifn"] -[ext_resource type="AudioStream" uid="uid://bce34osfwdmqx" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-006.mp3" id="148_rm8dy"] -[ext_resource type="AudioStream" uid="uid://bn3cpslh1wofv" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-007.mp3" id="149_f8aoj"] -[ext_resource type="AudioStream" uid="uid://gapq7qgi2snm" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-008.mp3" id="150_s2tgi"] -[ext_resource type="AudioStream" uid="uid://b7r17q7iskrxj" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-009.mp3" id="151_il3lm"] -[ext_resource type="AudioStream" uid="uid://dau2i3g34nngy" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-010.mp3" id="152_gdkqs"] -[ext_resource type="AudioStream" uid="uid://dcwbtf8cj76a6" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-011.mp3" id="153_utlgu"] -[ext_resource type="AudioStream" uid="uid://di8gmywgwug23" path="res://assets/sounds/breathing/breathe_in/breathe_in_exhausted/Breathe-in-exhausted-012.mp3" id="154_w3io3"] -[ext_resource type="AudioStream" uid="uid://df1p8i0run5rb" path="res://assets/sounds/breathing/breathe_out/breathe_out_calm/Breathe-out-calm-002.mp3" id="156_hgc6s"] -[ext_resource type="AudioStream" uid="uid://d0julp7xqyr5n" path="res://assets/sounds/breathing/breathe_out/breathe_out_calm/Breathe-out-calm-003.mp3" id="157_6m11j"] -[ext_resource type="AudioStream" uid="uid://bleld3ult64go" path="res://assets/sounds/breathing/breathe_out/breathe_out_calm/Breathe-out-calm-004.mp3" id="158_mfbti"] -[ext_resource type="AudioStream" uid="uid://dm7aok7jhnv4" path="res://assets/sounds/breathing/breathe_out/breathe_out_calm/Breathe-out-calm-005.mp3" id="159_rekon"] -[ext_resource type="AudioStream" uid="uid://bb734uxmqcr8u" path="res://assets/sounds/breathing/breathe_out/breathe_out_calm/Breathe-out-calm-006.mp3" id="160_tol08"] -[ext_resource type="AudioStream" uid="uid://qj85gkjwlswl" path="res://assets/sounds/breathing/breathe_out/breathe_out_calm/Breathe-out-calm-007.mp3" id="161_5ghxp"] -[ext_resource type="AudioStream" uid="uid://ctysfxkteyols" path="res://assets/sounds/breathing/breathe_out/breathe_out_low/Breathe-out-low-001.mp3" id="162_n54tq"] -[ext_resource type="AudioStream" uid="uid://drjrhsgm7sx3n" path="res://assets/sounds/breathing/breathe_out/breathe_out_low/Breathe-out-low-002.mp3" id="163_3fiag"] -[ext_resource type="AudioStream" uid="uid://d0eyxdccg0m8v" path="res://assets/sounds/breathing/breathe_out/breathe_out_low/Breathe-out-low-003.mp3" id="164_elpd3"] -[ext_resource type="AudioStream" uid="uid://dgsxkkyl0twyv" path="res://assets/sounds/breathing/breathe_out/breathe_out_low/Breathe-out-low-004.mp3" id="165_4q6hw"] -[ext_resource type="AudioStream" uid="uid://bqt3kfmoav03b" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-001.mp3" id="166_2qmd4"] -[ext_resource type="AudioStream" uid="uid://cnmcge2om4782" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-002.mp3" id="167_h0ugi"] -[ext_resource type="AudioStream" uid="uid://cns438dqcip7" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-003.mp3" id="168_afk8h"] -[ext_resource type="AudioStream" uid="uid://b6t4hqi0pupvk" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-004.mp3" id="169_1wu6y"] -[ext_resource type="AudioStream" uid="uid://5a21wbtn5cga" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-005.mp3" id="170_yfygc"] -[ext_resource type="AudioStream" uid="uid://dqkpx7nayisf" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-006.mp3" id="171_sf660"] -[ext_resource type="AudioStream" uid="uid://qpg6rx01c21k" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-007.mp3" id="172_7ijij"] -[ext_resource type="AudioStream" uid="uid://cstmv5ve8nufu" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-008.mp3" id="173_kjnhu"] -[ext_resource type="AudioStream" uid="uid://150bt0xtbgfa" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-009.mp3" id="174_m8hjx"] -[ext_resource type="AudioStream" uid="uid://cdrw7vscc0xdp" path="res://assets/sounds/breathing/breathe_out/breathe_out_mid/Breathe-out-mid-010.mp3" id="175_skt8w"] -[ext_resource type="AudioStream" uid="uid://ca2as7g6td2wj" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-001.mp3" id="176_xb8ft"] -[ext_resource type="AudioStream" uid="uid://d2c8ycx38ot1f" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-002.mp3" id="177_mro88"] -[ext_resource type="AudioStream" uid="uid://bswsj6q1vco62" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-003.mp3" id="178_ya4ln"] -[ext_resource type="AudioStream" uid="uid://bwfaqqq6hpy4" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-004.mp3" id="179_yopjo"] -[ext_resource type="AudioStream" uid="uid://cud6dpvq3qf61" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-005.mp3" id="180_wtqmm"] -[ext_resource type="AudioStream" uid="uid://ckwbj0jo734jb" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-006.mp3" id="181_7cqnf"] -[ext_resource type="AudioStream" uid="uid://cuy7xs0odtm08" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-007.mp3" id="182_q07wn"] -[ext_resource type="AudioStream" uid="uid://ysa23wix0xrk" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-008.mp3" id="183_72ejc"] -[ext_resource type="AudioStream" uid="uid://dtxgfj8eq5l31" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-009.mp3" id="184_m1gsv"] -[ext_resource type="AudioStream" uid="uid://dbx6bj01mb7l1" path="res://assets/sounds/breathing/breathe_out/breathe_out_heavy/Breathe-out-heavy-010.mp3" id="185_2yvq7"] -[ext_resource type="AudioStream" uid="uid://ds3glu4nqhdbh" path="res://assets/sounds/breathing/breathe_out/breathe_out_max/Breathe-out-max-001.mp3" id="186_7qaaa"] -[ext_resource type="AudioStream" uid="uid://bajagb8gdrorr" path="res://assets/sounds/breathing/breathe_out/breathe_out_max/Breathe-out-max-002.mp3" id="187_yoiq4"] -[ext_resource type="AudioStream" uid="uid://dnve10ipdw44l" path="res://assets/sounds/breathing/breathe_out/breathe_out_max/Breathe-out-max-003.mp3" id="188_4anq4"] -[ext_resource type="AudioStream" uid="uid://d3mmjb1sspbro" path="res://assets/sounds/breathing/breathe_out/breathe_out_max/Breathe-out-max-004.mp3" id="189_mkwaq"] -[ext_resource type="AudioStream" uid="uid://bp4rmahq4wpkp" path="res://assets/sounds/breathing/breathe_out/breathe_out_max/Breathe-out-max-005.mp3" id="190_0falv"] -[ext_resource type="AudioStream" uid="uid://c5sjq0em24hb1" path="res://assets/sounds/breathing/breathe_out/breathe_out_max/Breathe-out-max-006.mp3" id="191_wvqjg"] -[ext_resource type="AudioStream" uid="uid://bv4xhgwylcxfg" path="res://assets/sounds/breathing/breathe_out/breathe_out_max/Breathe-out-max-007.mp3" id="192_xwj34"] -[ext_resource type="AudioStream" uid="uid://4fgsklkfb0yp" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-001.mp3" id="193_2ggvy"] -[ext_resource type="AudioStream" uid="uid://c5wc8id1qc6yn" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-002.mp3" id="194_hvgvr"] -[ext_resource type="AudioStream" uid="uid://8v015hgrewud" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-003.mp3" id="195_c63qf"] -[ext_resource type="AudioStream" uid="uid://bn3wdx3vc6un7" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-004.mp3" id="196_nqymb"] -[ext_resource type="AudioStream" uid="uid://dds4em4a5bbtb" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-005.mp3" id="197_n2wjg"] -[ext_resource type="AudioStream" uid="uid://cgpkael8dcffr" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-006.mp3" id="198_vh6pe"] -[ext_resource type="AudioStream" uid="uid://dtg6sp12wi7h2" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-007.mp3" id="199_0b2jo"] -[ext_resource type="AudioStream" uid="uid://ofhlbc8ywo2i" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-008.mp3" id="200_4ttds"] -[ext_resource type="AudioStream" uid="uid://c8sksdmrqxcs1" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-009.mp3" id="201_8ri8i"] -[ext_resource type="AudioStream" uid="uid://c1h0kurf2ly1k" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-010.mp3" id="202_vlfn3"] -[ext_resource type="AudioStream" uid="uid://dkj34tqoqppml" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-011.mp3" id="203_klwgm"] [ext_resource type="AudioStream" uid="uid://0q6nhlhgnxu2" path="res://assets/sounds/whitenoise.mp3" id="204_76ube"] -[ext_resource type="AudioStream" uid="uid://bwsj7yir6tced" path="res://assets/sounds/breathing/breathe_out/breathe_out_exhausted/Breathe-out-exhausted-012.mp3" id="204_xfldr"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_g4v7s"] @@ -252,33 +53,10 @@ script = ExtResource("61_hggc2") [node name="SoundController" type="Node" parent="Components" unique_id=1286506274] unique_name_in_owner = true script = ExtResource("62_b2j0d") -NORMAL_FOOTSTEP_SOUNDS = Array[AudioStreamWAV]([ExtResource("2_32hag"), ExtResource("3_tqiix"), ExtResource("4_e7oew"), ExtResource("5_c35mf"), ExtResource("6_65viv"), ExtResource("7_x7c3f"), ExtResource("8_bjvpn"), ExtResource("9_s7qer"), ExtResource("10_g4c7l"), ExtResource("11_knn7v"), ExtResource("12_7pqkx"), ExtResource("13_uw77l"), ExtResource("14_rptt4")]) -HEAVY_FOOTSTEP_SOUNDS = Array[AudioStreamWAV]([ExtResource("15_n0b8q"), ExtResource("16_jfgyi"), ExtResource("17_237xx"), ExtResource("18_wpyo2"), ExtResource("19_7crtr"), ExtResource("20_vgvch"), ExtResource("21_a1u5o"), ExtResource("22_3dxkp"), ExtResource("23_6wior"), ExtResource("24_p5tca"), ExtResource("25_jbx34"), ExtResource("26_s3g0c"), ExtResource("27_35wys"), ExtResource("28_pjwc4"), ExtResource("29_or4qq"), ExtResource("30_hggc2")]) -LIGHT_FOOTSTEP_SOUNDS = Array[AudioStreamWAV]([ExtResource("31_b2j0d"), ExtResource("32_7l6ig"), ExtResource("33_j3r50"), ExtResource("34_utr5e"), ExtResource("35_kewli"), ExtResource("36_do7qw"), ExtResource("37_2h6tc"), ExtResource("38_8rogd"), ExtResource("39_48p26"), ExtResource("40_anp34"), ExtResource("41_jdjat"), ExtResource("42_j420s"), ExtResource("43_kcq4v")]) -FLASHLIGHT_CLICK_SOUNDS = Array[AudioStreamWAV]([ExtResource("51_pjwc4"), ExtResource("52_or4qq"), ExtResource("53_hggc2"), ExtResource("55_7l6ig"), ExtResource("56_j3r50"), ExtResource("59_do7qw"), ExtResource("61_8rogd"), ExtResource("62_48p26")]) -SHUFFLE_FOOTSTEP_SOUNDS = Array[AudioStreamWAV]([ExtResource("44_qavcc"), ExtResource("45_bd26m"), ExtResource("46_lufic"), ExtResource("47_nxclr"), ExtResource("48_onxu2"), ExtResource("49_gci7n"), ExtResource("50_tcwf7")]) -JUMP_LANDING_SOUNDS = Array[AudioStream]([ExtResource("63_pkjeu"), ExtResource("64_0epl4"), ExtResource("65_3r8w6"), ExtResource("66_i816j"), ExtResource("67_laqvq"), ExtResource("68_aq51r"), ExtResource("69_q3ejk"), ExtResource("70_2dxln"), ExtResource("71_gsldg"), ExtResource("72_rrrpt"), ExtResource("73_us45u"), ExtResource("74_wvv85"), ExtResource("75_hxu4r")]) -JUMP_STARTING_SOUNDS = Array[AudioStream]([ExtResource("76_i6dto"), ExtResource("77_4d8j4"), ExtResource("78_s27sh"), ExtResource("79_1vi86"), ExtResource("80_beayq"), ExtResource("81_12j61"), ExtResource("82_kthys"), ExtResource("83_48o5h"), ExtResource("84_xum3i"), ExtResource("85_ct4wv"), ExtResource("86_teg5g"), ExtResource("87_vcxk4")]) -JUMP_LANDING_BREATH_SOUNDS = Array[AudioStream]([ExtResource("88_x6bw1"), ExtResource("89_e1bru"), ExtResource("90_63x2c"), ExtResource("91_arxfr"), ExtResource("92_5ecds"), ExtResource("93_nssm8"), ExtResource("94_ei0bd"), ExtResource("95_wwa77"), ExtResource("96_tdwly")]) -JUMP_STARTING_BREATH_SOUNDS = Array[AudioStream]([ExtResource("97_fmlco"), ExtResource("98_duoik"), ExtResource("99_6qclm"), ExtResource("100_mtkxs"), ExtResource("101_pxyg8"), ExtResource("102_xm1em"), ExtResource("103_6ix8p"), ExtResource("104_fntve"), ExtResource("105_a2vma"), ExtResource("106_b63cp"), ExtResource("107_l2ov3")]) -BREATHE_IN_CALM = Array[AudioStream]([ExtResource("108_76ube"), ExtResource("109_agxve"), ExtResource("110_8ue2q"), ExtResource("111_p0pgs"), ExtResource("112_uru8s")]) -BREATHE_IN_LOW = Array[AudioStream]([ExtResource("113_mqtqs"), ExtResource("114_mje2k"), ExtResource("115_c0t4m"), ExtResource("116_axrhj"), ExtResource("117_14dna")]) -BREATHE_IN_MID = Array[AudioStream]([ExtResource("118_dtvgl"), ExtResource("119_oa6rg"), ExtResource("120_qnksm"), ExtResource("121_u6low"), ExtResource("122_lqiud"), ExtResource("123_m1x1w"), ExtResource("124_pewko"), ExtResource("125_oq118"), ExtResource("126_cw82d")]) -BREATHE_IN_HEAVY = Array[AudioStream]([ExtResource("127_g11hh"), ExtResource("128_mcl3m"), ExtResource("129_s46af"), ExtResource("130_rpy06"), ExtResource("131_f4fcx"), ExtResource("132_auu8a"), ExtResource("133_lkwya"), ExtResource("134_et857"), ExtResource("135_7yw2v"), ExtResource("136_eb5ts")]) -BREATHE_IN_MAX = Array[AudioStream]([ExtResource("137_ui8rx"), ExtResource("138_fild8"), ExtResource("139_oyq3u"), ExtResource("140_q53ni"), ExtResource("141_4v6xr"), ExtResource("142_o8ce2")]) -BREATHE_IN_EXHAUSTED = Array[AudioStream]([ExtResource("143_s6fkf"), ExtResource("144_7kgw3"), ExtResource("145_mu3ts"), ExtResource("146_ewv0n"), ExtResource("147_lbifn"), ExtResource("148_rm8dy"), ExtResource("149_f8aoj"), ExtResource("150_s2tgi"), ExtResource("151_il3lm"), ExtResource("152_gdkqs"), ExtResource("153_utlgu"), ExtResource("154_w3io3")]) -BREATHE_OUT_CALM = Array[AudioStream]([ExtResource("156_hgc6s"), ExtResource("157_6m11j"), ExtResource("158_mfbti"), ExtResource("159_rekon"), ExtResource("160_tol08"), ExtResource("161_5ghxp")]) -BREATHE_OUT_LOW = Array[AudioStream]([ExtResource("162_n54tq"), ExtResource("163_3fiag"), ExtResource("164_elpd3"), ExtResource("165_4q6hw")]) -BREATHE_OUT_MID = Array[AudioStream]([ExtResource("166_2qmd4"), ExtResource("167_h0ugi"), ExtResource("168_afk8h"), ExtResource("169_1wu6y"), ExtResource("170_yfygc"), ExtResource("171_sf660"), ExtResource("172_7ijij"), ExtResource("173_kjnhu"), ExtResource("174_m8hjx"), ExtResource("175_skt8w")]) -BREATHE_OUT_HEAVY = Array[AudioStream]([ExtResource("176_xb8ft"), ExtResource("177_mro88"), ExtResource("178_ya4ln"), ExtResource("179_yopjo"), ExtResource("180_wtqmm"), ExtResource("181_7cqnf"), ExtResource("182_q07wn"), ExtResource("183_72ejc"), ExtResource("184_m1gsv"), ExtResource("185_2yvq7")]) -BREATHE_OUT_MAX = Array[AudioStream]([ExtResource("186_7qaaa"), ExtResource("187_yoiq4"), ExtResource("188_4anq4"), ExtResource("189_mkwaq"), ExtResource("190_0falv"), ExtResource("191_wvqjg"), ExtResource("192_xwj34")]) -BREATHE_OUT_EXHAUSTED = Array[AudioStream]([ExtResource("193_2ggvy"), ExtResource("194_hvgvr"), ExtResource("195_c63qf"), ExtResource("196_nqymb"), ExtResource("197_n2wjg"), ExtResource("198_vh6pe"), ExtResource("199_0b2jo"), ExtResource("200_4ttds"), ExtResource("201_8ri8i"), ExtResource("202_vlfn3"), ExtResource("203_klwgm"), ExtResource("204_xfldr")]) -WHITENOISE = ExtResource("204_76ube") [node name="UiHandler" type="Node" parent="Components" unique_id=1264775993] unique_name_in_owner = true script = ExtResource("63_7l6ig") -GRAB_PANEL = ExtResource("59_p5tca") [node name="InputController" type="Node" parent="Components" unique_id=1680856401] unique_name_in_owner = true @@ -344,6 +122,10 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.5698267) transform = Transform3D(1, 0, 0, 0, -4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, -1) shape = SubResource("CylinderShape3D_g4v7s") +[node name="SelectedItemPosition" type="Marker3D" parent="CameraPivot/PlayerCamera" unique_id=923365491] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5117141, -0.34773195, -0.8300779) + [node name="PlayerListener" type="AudioListener3D" parent="CameraPivot" unique_id=1468948553] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.7621309, 0) doppler_tracking = 2 @@ -434,6 +216,6 @@ unique_name_in_owner = true stream = ExtResource("204_76ube") bus = &"wind" -[connection signal="body_entered" from="CameraPivot/PlayerCamera/GrabbableFinder" to="Components/UiHandler" method="_on_grabbable_finder_body_entered"] -[connection signal="body_exited" from="CameraPivot/PlayerCamera/GrabbableFinder" to="Components/UiHandler" method="_on_grabbable_finder_body_exited"] +[connection signal="body_entered" from="CameraPivot/PlayerCamera/GrabbableFinder" to="Components/UiHandler" method="_on_action_finder_body_entered"] +[connection signal="body_exited" from="CameraPivot/PlayerCamera/GrabbableFinder" to="Components/UiHandler" method="_on_action_finder_body_exited"] [connection signal="timeout" from="StaminaReset" to="Components/PlayerManager" method="_on_stamina_reset_timeout"] diff --git a/scenes/player/player_manager.gd b/scenes/player/player_manager.gd index db972b3..c7cdaa0 100644 --- a/scenes/player/player_manager.gd +++ b/scenes/player/player_manager.gd @@ -3,31 +3,90 @@ extends Node var stamina: float = 100.0 var flashlight_power: float = 100.0 var selected_item: int = 0 +var prev_selected_item: int = 0 var stamina_recharge: bool = true -var inventory: Array[PackedScene] = [null,null] +var inventory: Array[RigidBody3D] = [null,null] @onready var ui: Control = %PlayerUi @onready var flashlight: SpotLight3D = %Flashlight +@onready var selected_item_position: Marker3D = %SelectedItemPosition + +var selected_item_object: RigidBody3D = null func next_item(): + prev_selected_item = selected_item if selected_item + 1 > len(inventory) - 1: selected_item = 0 else: selected_item += 1 - select_item(selected_item) + select_item() func prev_item(): + prev_selected_item = selected_item if selected_item - 1 < 0: selected_item = len(inventory) - 1 else: selected_item -= 1 - select_item(selected_item) + select_item() -func select_item(index:int): - selected_item = index - ui.select_item(index) +func select_item(index:int = selected_item): + if index >= 0 and index < len(inventory): + ui.select_item(index) + + #selecting empty slot makes all inventory items invisible + if inventory[index] == null: + for c in selected_item_position.get_children(): + c.visible = false + return + + else: + #deselect item --> hide currently equipped item object + #show newly selected item, since its not null because of the else statement it shouldnt crash + #if called from outside, sets the selected item to the index called from the argument + if index != selected_item: + prev_selected_item = selected_item + if inventory[prev_selected_item] != null: + inventory[prev_selected_item].visible = false + else: + if inventory[prev_selected_item] != null: + inventory[prev_selected_item].visible = false + selected_item = index + inventory[index].visible = true -func get_selected_item() -> PackedScene: +func add_item(item: RigidBody3D): + #add item to current equipped slot if empty + if inventory[selected_item] == null: + inventory[selected_item] = item + ui.add_item(selected_item, item) + item.reparent(selected_item_position) + item.position = Vector3.ZERO + item.scale = Vector3(0.2, 0.2, 0.2) + item.collision_layer = 0 + return + + #add item to first empty slot if currently equipped slot is full + for i in range(0, len(inventory)): + if inventory[i] == null: + inventory[i] = item + ui.add_item(i, item) + item.reparent(selected_item_position) + item.position = Vector3.ZERO + item.scale = Vector3(0.2, 0.2, 0.2) + item.collision_layer = 0 + item.visible = false + return + + #dont equip item if inventory full + +func remove_current_item(): + remove_item(selected_item) + +func remove_item(index: int): + add_child(inventory[index]) + inventory[index] = null + ui.remove_item(index) + +func get_selected_item() -> RigidBody3D: return inventory[selected_item] func stamina_recharge_off(): @@ -39,9 +98,29 @@ func _on_stamina_reset_timeout() -> void: func _ready() -> void: get_tree().create_timer(0.1).timeout.connect(func (): select_item(0)) +#func _physics_process(_delta: float) -> void: + #handle equipped object + #if selected_item_object != null: + #var target_pos = selected_item_position.global_position + #var current_pos = selected_item_object.global_position + #var direction = target_pos - current_pos + # + #selected_item_object.linear_velocity = direction * PlayerConsts.GRAB_POWER + # + #var current_quat = selected_item_object.global_transform.basis.get_rotation_quaternion() + #var target_quat = selected_item_position.global_transform.basis.get_rotation_quaternion() + # + #var delta_quat = target_quat * current_quat.inverse() + #var angle = delta_quat.get_angle() + #var axis = delta_quat.get_axis() + # + #if angle > PI: + #angle -= TAU + # + #selected_item_object.angular_velocity = axis * angle * PlayerConsts.GRAB_ROTATION_POWER + func _process(_delta: float) -> void: if stamina_recharge: stamina = move_toward(stamina, 100, .5) if flashlight.visible: flashlight_power = move_toward(flashlight_power, 0, .2) - diff --git a/scenes/player/sound_controller_component.gd b/scenes/player/sound_controller_component.gd index 15cd433..55a4b91 100644 --- a/scenes/player/sound_controller_component.gd +++ b/scenes/player/sound_controller_component.gd @@ -143,43 +143,43 @@ func play_breath_sound(breathe_in:bool = true): while play_sound == _current_breath_in_sound: match player_state.breathing_mode: player_state.breath.calm: - play_sound = Sounds.BREATHE_IN_CALM.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_IN_CALM) player_state.breath.low: - play_sound = Sounds.BREATHE_IN_LOW.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_IN_LOW) player_state.breath.mid: - play_sound = Sounds.BREATHE_IN_MID.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_IN_MID) player_state.breath.heavy: - play_sound = Sounds.BREATHE_IN_HEAVY.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_IN_HEAVY) player_state.breath.max: - play_sound = Sounds.BREATHE_IN_MAX.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_IN_MAX) player_state.breath.exhausted: - play_sound = Sounds.BREATHE_IN_EXHAUSTED.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_IN_EXHAUSTED) _current_breath_in_sound = play_sound else: play_sound = _current_breath_out_sound while play_sound == _current_breath_out_sound: match player_state.breathing_mode: player_state.breath.calm: - play_sound = Sounds.BREATHE_OUT_CALM.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_OUT_CALM) player_state.breath.low: - play_sound = Sounds.BREATHE_OUT_LOW.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_OUT_LOW) player_state.breath.mid: - play_sound = Sounds.BREATHE_OUT_MID.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_OUT_MID) player_state.breath.heavy: - play_sound = Sounds.BREATHE_OUT_HEAVY.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_OUT_HEAVY) player_state.breath.max: - play_sound = Sounds.BREATHE_OUT_MAX.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_OUT_MAX) player_state.breath.exhausted: - play_sound = Sounds.BREATHE_OUT_EXHAUSTED.pick_random() + play_sound = Sounds.get_random_sound(Sounds.BREATHE_OUT_EXHAUSTED) _current_breath_out_sound = play_sound play_stream_on_player(head, play_sound) func play_flashlight_sound(): - var play_sound = Sounds.FLASHLIGHT_CLICK_SOUNDS.pick_random() + var play_sound = Sounds.get_random_sound(Sounds.FLASHLIGHT_CLICK_SOUNDS) while play_sound == _current_flashlight_sound: - play_sound = Sounds.FLASHLIGHT_CLICK_SOUNDS.pick_random() + play_sound = Sounds.get_random_sound(Sounds.FLASHLIGHT_CLICK_SOUNDS) play_stream_on_player(head_texture, play_sound) _current_flashlight_sound = play_sound @@ -194,15 +194,15 @@ func play_jump_sound(start:bool = true): match start: true: while sound_to_play_foot == _current_jump_start_sound: - sound_to_play_foot = Sounds.JUMP_STARTING_SOUNDS.pick_random() + sound_to_play_foot = Sounds.get_random_sound(Sounds.JUMP_STARTING_SOUNDS) while sound_to_play_breath == _current_jump_start_breath_sound: - sound_to_play_breath = Sounds.JUMP_STARTING_BREATH_SOUNDS.pick_random() + sound_to_play_breath = Sounds.get_random_sound(Sounds.JUMP_STARTING_BREATH_SOUNDS) false: print(volume) while sound_to_play_foot == _current_jump_land_sound: - sound_to_play_foot = Sounds.JUMP_LANDING_SOUNDS.pick_random() + sound_to_play_foot = Sounds.get_random_sound(Sounds.JUMP_LANDING_SOUNDS) while sound_to_play_breath == _current_jump_land_breath_sound: - sound_to_play_breath = Sounds.JUMP_LANDING_BREATH_SOUNDS.pick_random() + sound_to_play_breath = Sounds.get_random_sound(Sounds.JUMP_LANDING_BREATH_SOUNDS) play_stream_on_player(head, sound_to_play_breath, randf_range(.8, 1.2), volume) play_stream_on_player(is_right_leg.call(), sound_to_play_foot) @@ -210,19 +210,19 @@ func play_jump_sound(start:bool = true): func play_footstep_sound(): var sound_to_play:AudioStream if player_state.walking: - sound_to_play = Sounds.NORMAL_FOOTSTEP_SOUNDS.pick_random() + sound_to_play = Sounds.get_random_sound(Sounds.NORMAL_FOOTSTEP_SOUNDS) while sound_to_play == _current_footstep_sound: - sound_to_play = Sounds.NORMAL_FOOTSTEP_SOUNDS.pick_random() + sound_to_play = Sounds.get_random_sound(Sounds.NORMAL_FOOTSTEP_SOUNDS) elif player_state.running: - sound_to_play = Sounds.HEAVY_FOOTSTEP_SOUNDS.pick_random() + sound_to_play = Sounds.get_random_sound(Sounds.HEAVY_FOOTSTEP_SOUNDS) while sound_to_play == _current_footstep_sound: - sound_to_play = Sounds.HEAVY_FOOTSTEP_SOUNDS.pick_random() + sound_to_play = Sounds.get_random_sound(Sounds.HEAVY_FOOTSTEP_SOUNDS) if randf_range(1, 100) > 100 - PlayerConsts.SHUFFLE_CHANCE: - play_stream_on_player(is_right_leg.call().get_child(0), Sounds.SHUFFLE_FOOTSTEP_SOUNDS.pick_random()) + play_stream_on_player(is_right_leg.call().get_child(0), Sounds.get_random_sound(Sounds.SHUFFLE_FOOTSTEP_SOUNDS)) elif player_state.crouching: - sound_to_play = Sounds.LIGHT_FOOTSTEP_SOUNDS.pick_random() + sound_to_play = Sounds.get_random_sound(Sounds.LIGHT_FOOTSTEP_SOUNDS) while sound_to_play == _current_footstep_sound: - sound_to_play = Sounds.LIGHT_FOOTSTEP_SOUNDS.pick_random() + sound_to_play = Sounds.get_random_sound(Sounds.LIGHT_FOOTSTEP_SOUNDS) _current_footstep_sound = sound_to_play diff --git a/scenes/player/ui_handler_component.gd b/scenes/player/ui_handler_component.gd index 5f0dcec..dfc53b4 100644 --- a/scenes/player/ui_handler_component.gd +++ b/scenes/player/ui_handler_component.gd @@ -6,7 +6,8 @@ extends Node @export var UI_MOVEMENT_SPEED = 15.0 ##how fast the UI moves when you move the camera @export var UI_MOVEMENT_VELOCITY_MULTIPLIER = 2.0 ##how much the ui leans when walking or strafing -@export var GRAB_PANEL: PackedScene +@export var GRAB_PANEL: PackedScene = preload("res://scenes/player/grab_prompt.tscn") +@export var EQUIP_PANEL: PackedScene = preload("res://scenes/player/equip_prompt.tscn") @onready var in_game_menu: Control = %InGameMenu @onready var ui: Control = %PlayerUi @@ -20,25 +21,29 @@ extends Node const SELECTED_COLOR = 0xcfcfcf78 const UNSELECTED_COLOR = 0x3d3d3d78 -var grabbable_panel = null -var grabbable_panel_body = null +var action_panel = null +var action_panel_body = null -func _on_grabbable_finder_body_entered(body: Node3D) -> void: - if body.is_in_group("grabbable"): - grabbable_panel = GRAB_PANEL.instantiate() - popup_panels.add_child(grabbable_panel) - grabbable_panel_body = body +func _on_action_finder_body_entered(body: Node3D) -> void: + if body != null: + if body.is_in_group("grabbable"): + action_panel = GRAB_PANEL.instantiate() + if body.is_in_group("equippable"): + action_panel = EQUIP_PANEL.instantiate() + + popup_panels.add_child(action_panel) + action_panel_body = body -func _on_grabbable_finder_body_exited(body: Node3D) -> void: - if body == grabbable_panel_body: - popup_panels.remove_child(grabbable_panel) - grabbable_panel = null - grabbable_panel_body = null +func _on_action_finder_body_exited(body: Node3D) -> void: + if body != null and body == action_panel_body: + popup_panels.remove_child(action_panel) + action_panel = null + action_panel_body = null func _process(delta: float) -> void: - if grabbable_panel != null: - var target_position = cursor.position - player_camera.unproject_position(grabbable_panel_body.global_position) - grabbable_panel.position = grabbable_panel.position.lerp(-target_position / 2, delta * 50) + if action_panel != null: + var target_position = cursor.position - player_camera.unproject_position(action_panel_body.global_position) + action_panel.position = action_panel.position.lerp(-target_position / 2, delta * 50) func toggle_menu(): if !in_game_menu.visible: @@ -55,9 +60,6 @@ func toggle_menu(): cursor.visible = true Input.mouse_mode = Input.MOUSE_MODE_CAPTURED player_state.in_menu = false - -func put_item(index: int, item: PackedScene): - player_manager.inventory[index] = item func set_ui_scale(scale:float) -> void: pass diff --git a/scenes/player/ui_manager_scene.gd b/scenes/player/ui_manager_scene.gd index 9e11fda..5dca202 100644 --- a/scenes/player/ui_manager_scene.gd +++ b/scenes/player/ui_manager_scene.gd @@ -30,7 +30,7 @@ func remove_inventory_slot() -> bool: return false func remove_inventory_slot_console(): - Console.print_to_console(false, "Success" if remove_inventory_slot() else "Failed") + Console.print_to_console(false, "Success " if remove_inventory_slot() else "Failed ") const SELECTED_COLOR = 0xcfcfcf78 @@ -46,13 +46,25 @@ func _ready(): Console.remove_inventory.connect(remove_inventory_slot_console) func select_item(index): - if inventory_slots_panels != [] and index >= 0 and index < len(player_manager.inventory): - print("selected item ", index) + if index >= 0 and index < len(player_manager.inventory): for i in inventory_slots_panels: i.add_theme_stylebox_override("panel", unselected_stylebox) if index >= 0 and index < len(player_manager.inventory): inventory_slots_panels[index].add_theme_stylebox_override("panel", selected_stylebox) +func add_item(index: int, object: RigidBody3D): + if index >= 0 and index < len(player_manager.inventory): + var meshes = object.get_children() + var texture = null + for i in meshes: + if i is MeshInstance3D: + texture = await GrabbableBase.create_icon_from_mesh(i.mesh) + + var texture_rect = TextureRect.new() + texture_rect.texture = texture + + inventory_slots_panels[index].add_child(texture_rect) + func _process(delta: float) -> void: if player_manager != null: stamina_bar.value = lerpf(stamina_bar.value, player_manager.stamina, delta * 5) diff --git a/scenes/ui/console/console.gd b/scenes/ui/console/console.gd index 5ab4693..9c28dd1 100644 --- a/scenes/ui/console/console.gd +++ b/scenes/ui/console/console.gd @@ -9,6 +9,7 @@ extends Control var context = {} var spaces: Dictionary = {"player" : "everything that is to do with the player", "level" : "everything that is to do with the level", "server" : "everything that is to do with the server"} var player_commands: Dictionary = {"add_inventory_slot" : "add a slot to your inventory. max inv slots = 5", "remove_inventory_slot" : "remove a slot from your inventory. min inv slots = 2"} +var level_commands: Dictionary = {"reset": "resets the current level"} var avaliable_commands: Dictionary = { "help" : "print the available commands. \"help player\" prints the available commands for the player", "clear" : "clear the console", @@ -24,6 +25,11 @@ func print_to_console_from_console(...str:Array): console_log.add_text("\n\n") console_input.clear() +func print_command_not_found(command:String): + print(command) + print_to_console_from_console("\"", command, "\" command not found. Type \"help\" for a list of available commands.") + + func print_to_console(new_line:bool = false, ...str:Array, ): for x in str: console_log.add_text(str(x)) @@ -36,6 +42,10 @@ func print_help(space:String = ""): for x in player_commands: help_text += x + " - " + player_commands[x] help_text += "\n" + "level": + for x in level_commands: + help_text += x + " - " + player_commands[x] + help_text += "\n" _: for x in avaliable_commands: help_text += x + " - " + avaliable_commands[x] @@ -74,6 +84,7 @@ func fill_from_suggestion(): console_input.grab_focus() console_input.caret_column = console_input.text.length() selected_suggestion = 0 + suggestions_list.clear() func show_space_suggestions(current_string:String): for space: String in spaces: @@ -92,6 +103,10 @@ func show_space_commands_suggestions(space:String, command:String): for player_command: String in player_commands: if command in player_command: suggestions_list.add_item(player_command + " - " + player_commands[player_command]) + "level": + for player_command: String in level_commands: + if command in player_command: + suggestions_list.add_item(player_command + " - " + level_commands[player_command]) func show_suggestions(current_string: String): suggestions_list.clear() @@ -119,9 +134,8 @@ func parsed_command(command:String): "clear": clear_console() _: - print(command) - print_to_console_from_console("\"", command, "\" command not found. Type \"help\" for a list of available commands.") - + print_command_not_found(command) + else: match space[0]: "player": @@ -132,6 +146,18 @@ func parsed_command(command:String): "remove_inventory_slot": emit_signal("remove_inventory") print_to_console_from_console("Removed inventory slot.") + _: + print_command_not_found(command) + "level": + match space[1]: + "reset": + get_tree().reload_current_scene() + _: + print_command_not_found(command) + _: + print_command_not_found(command) + + console_input.text = "" signal add_inventory signal remove_inventory diff --git a/scenes/ui/loading_screen.gd b/scenes/ui/loading_screen.gd index ab018c5..e81c5c4 100644 --- a/scenes/ui/loading_screen.gd +++ b/scenes/ui/loading_screen.gd @@ -2,9 +2,11 @@ extends CanvasLayer func sound_loading(): + print("loading screen shown") show() func sound_loading_done(): + print("loading screen hidden") hide() # Called when the node enters the scene tree for the first time. diff --git a/scripts/autoload/sounds.gd b/scripts/autoload/sounds.gd index f8a3647..5369620 100644 --- a/scripts/autoload/sounds.gd +++ b/scripts/autoload/sounds.gd @@ -78,6 +78,8 @@ func load_sound_from_directory_to_var(path: String, sound_type: Array[AudioStrea pending_files[full_path] = sound_type ResourceLoader.load_threaded_request(full_path) + + print("loading: ", full_path) filename = dir.get_next() else: @@ -98,8 +100,8 @@ func load_step_sounds(): load_sound_from_directory_to_var(dir_part+type, SHUFFLE_FOOTSTEP_SOUNDS) func load_breath_sounds(): - var in_path_part = sound_dir_path + "/breathe_in" - var out_path_part = sound_dir_path + "/breathe_out" + var in_path_part = sound_dir_path + "/breathing/breathe_in/breathe_in" + var out_path_part = sound_dir_path + "/breathing/breathe_out/breathe_out" for type in _breath: var in_path = in_path_part + type @@ -142,7 +144,7 @@ func load_jumping_sounds(): "landing": load_sound_from_directory_to_var(breath_dir_path_part + type, JUMP_LANDING_BREATH_SOUNDS) load_sound_from_directory_to_var(foot_dir_path_part + type, JUMP_LANDING_SOUNDS) - + func start_loading(): emit_signal("loading_sounds") @@ -174,10 +176,12 @@ func _process(delta: float) -> void: elif status == ResourceLoader.THREAD_LOAD_LOADED: var stream = ResourceLoader.load_threaded_get(path) - if pending_files.get(path) is Array[AudioStream]: - pending_files.get(path).append(stream) + var target_array = pending_files[path] + target_array.append(stream) files_to_remove.append(path) + + print("loaded: ", path) elif status == ResourceLoader.THREAD_LOAD_FAILED: print("failed to load audio: ", path)