[gd_scene load_steps=12 format=3 uid="uid://cs8c570bxh6u"]

[ext_resource type="Script" path="res://src/lib/player_character.gd" id="1_sba4x"]
[ext_resource type="PackedScene" uid="uid://tdsbo3e5ic86" path="res://src/ingame/water_bomb.tscn" id="2_naek4"]
[ext_resource type="AudioStream" uid="uid://3dlhs18w1fa2" path="res://assets/sfx/boom.wav" id="3_u2hxa"]
[ext_resource type="Shader" path="res://scenes/interactivity_outline.gdshader" id="4_a2qfj"]
[ext_resource type="PackedScene" uid="uid://s2a1pry5fw8f" path="res://scenes/water_bomb_model.tscn" id="4_bfvih"]

[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_2xotl"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath(".:id")
properties/1/spawn = true
properties/1/replication_mode = 0
properties/2/path = NodePath(".:rotation")
properties/2/spawn = true
properties/2/replication_mode = 1
properties/3/path = NodePath(".:input_dir")
properties/3/spawn = true
properties/3/replication_mode = 1
properties/4/path = NodePath(".:input_jumped")
properties/4/spawn = true
properties/4/replication_mode = 2
properties/5/path = NodePath("ShotSound:playing")
properties/5/spawn = true
properties/5/replication_mode = 2

[sub_resource type="CapsuleMesh" id="CapsuleMesh_hi8jw"]

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

[sub_resource type="SphereShape3D" id="SphereShape3D_rsfjy"]

[sub_resource type="ShaderMaterial" id="ShaderMaterial_nch7m"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("4_a2qfj")
shader_parameter/color = Color(1, 1, 1, 0)
shader_parameter/size = 1.24

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x7r08"]
resource_local_to_scene = true
render_priority = 1
next_pass = SubResource("ShaderMaterial_nch7m")
no_depth_test = true
albedo_color = Color(0.0936238, 0.825356, 1, 1)
metallic = 0.8
roughness = 0.4

[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("_projectile_holder", "_projectile_point", "_camera_pivot", "_camera", "_line_of_sight", "_shot_sound")]
collision_layer = 2
script = ExtResource("1_sba4x")
_projectile_scene = ExtResource("2_naek4")
_projectile_holder = NodePath("ProjectileHolder")
_projectile_point = NodePath("ProjectilePoint")
_camera_pivot = NodePath("CameraPivot")
_camera = NodePath("CameraPivot/Camera3D")
_line_of_sight = NodePath("CameraPivot/LineOfSight")
_shot_sound = NodePath("ShotSound")

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

[node name="ProjectileSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("res://src/ingame/water_bomb.tscn")
spawn_path = NodePath("../ProjectileHolder")

[node name="ProjectileHolder" type="Node" parent="."]

[node name="ProjectilePoint" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, -0.095)

[node name="Model" type="MeshInstance3D" parent="."]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
mesh = SubResource("CapsuleMesh_hi8jw")

[node name="CSGBox3D" type="CSGBox3D" parent="Model"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5)
size = Vector3(0.8, 0.8, 0.8)

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_f4jjl")

[node name="CameraPivot" type="Node3D" parent="."]

[node name="Camera3D" type="Camera3D" parent="CameraPivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0)

[node name="LineOfSight" type="ShapeCast3D" parent="CameraPivot"]
shape = SubResource("SphereShape3D_rsfjy")
target_position = Vector3(0, 0, -2)
collision_mask = 16
collide_with_areas = true
collide_with_bodies = false
debug_shape_custom_color = Color(0.628721, 0, 0.256939, 1)

[node name="HeldViewmodel" type="Node3D" parent="CameraPivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, -1)
visible = false

[node name="Model" parent="CameraPivot/HeldViewmodel" instance=ExtResource("4_bfvih")]
material_override = SubResource("StandardMaterial3D_x7r08")

[node name="ShotSound" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource("3_u2hxa")
bus = &"SoundEffects"

[node name="Nickname" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.14713, 0)
visible = false
billboard = 1
text = "hello"
