[gd_scene load_steps=22 format=3 uid="uid://d2hnxr5l6w2x4"]

[ext_resource type="Script" uid="uid://dv40fyim2g2fa" path="res://src/equipment/wide_spray/wide_spray.gd" id="1_ggkto"]
[ext_resource type="Material" uid="uid://c00gndxoepuqh" path="res://assets/materials/laser_spray.tres" id="2_26efp"]
[ext_resource type="Texture2D" uid="uid://cx28sj02y31kj" path="res://assets/ui/hud/reticle_crosshair.png" id="3_78jy6"]
[ext_resource type="PackedScene" uid="uid://btq11kil0jcql" path="res://src/equipment/beam_sfx/spray_sfx.tscn" id="3_v0jnx"]
[ext_resource type="PackedScene" uid="uid://b8vradbaw61ga" path="res://src/equipment/laser_cast/laser_cast.tscn" id="3_xahet"]
[ext_resource type="Texture2D" uid="uid://carrggw6kp14w" path="res://assets/ui/hud/reticle_left.png" id="4_rotxf"]
[ext_resource type="Texture2D" uid="uid://wp03nuwt8hp5" path="res://assets/ui/hud/reticle_right.png" id="5_xo3vu"]
[ext_resource type="PackedScene" uid="uid://5y7gcq6igjpf" path="res://src/equipment/beam_sfx/beam_sfx.tscn" id="7_hv82w"]
[ext_resource type="Script" uid="uid://b274q7uvn0cvp" path="res://src/ui/rumbler_3d.gd" id="7_ku0nd"]
[ext_resource type="Script" uid="uid://dj2x7x5qkbym1" path="res://src/ui/canvas_projector.gd" id="8_j7ker"]
[ext_resource type="Texture2D" uid="uid://dxjwpai3or1hw" path="res://assets/ui/hud/tools/wide_sprayer.png" id="9_8vo2h"]
[ext_resource type="Texture2D" uid="uid://dmwey2qj77tm0" path="res://assets/ui/hud/tools/tall_sprayer.png" id="10_hv82w"]

[sub_resource type="CylinderMesh" id="CylinderMesh_48buk"]
material = ExtResource("2_26efp")
top_radius = 0.0
bottom_radius = 0.7
radial_segments = 6

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_pr4yq"]
direction = Vector3(0, 0, -1)
spread = 15.0
flatness = 0.82
initial_velocity_min = 3.5
initial_velocity_max = 3.5
gravity = Vector3(0, 0, 0)

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6k0bn"]
vertex_color_use_as_albedo = true
albedo_color = Color(0, 1, 0.301961, 0.392157)
emission_enabled = true
emission = Color(0, 1, 0.301961, 1)
emission_energy_multiplier = 10.0
texture_filter = 2
billboard_mode = 3
billboard_keep_scale = true
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false

[sub_resource type="QuadMesh" id="QuadMesh_trcry"]
material = SubResource("StandardMaterial3D_6k0bn")
size = Vector2(0.005, 0.005)

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_lyk2j"]
direction = Vector3(0, 0, -1)
spread = 15.0
flatness = 0.82
initial_velocity_min = 8.0
initial_velocity_max = 8.0
gravity = Vector3(0, 0, 0)

[sub_resource type="BoxMesh" id="BoxMesh_fmqw2"]
size = Vector3(0.05, 0.05, 0.3)

[sub_resource type="Animation" id="Animation_ku0nd"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Muzzle/Pivot:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("HUDTool:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("HUDTool/Rumbler/NozzleMarker/HUDElement/WideNozzle:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("HUDTool/Rumbler/NozzleMarker/HUDElement/TallNozzle:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="Animation" id="Animation_ay2b7"]
resource_name = "rotate"
length = 0.1
step = 0.01
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Muzzle/Pivot:rotation")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1.618, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(0, 0, 1.5708)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("HUDTool:rotation")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.05, 0.1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(-1.5708, 0, 0), Vector3(0, 0, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("HUDTool/Rumbler/NozzleMarker/HUDElement/WideNozzle:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.04, 0.05, 0.1),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [true, true, false, false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("HUDTool/Rumbler/NozzleMarker/HUDElement/TallNozzle:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.04, 0.05, 0.1),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [false, false, true, true]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_fmqw2"]
_data = {
&"RESET": SubResource("Animation_ku0nd"),
&"rotate": SubResource("Animation_ay2b7")
}

[node name="WideSpray" type="Node3D"]
script = ExtResource("1_ggkto")

[node name="Muzzle" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.997564, -0.0697565, 0, 0.0697565, 0.997564, 0, 0, -0.15)

[node name="Pivot" type="Node3D" parent="Muzzle"]

[node name="SprayCasts" type="Node3D" parent="Muzzle/Pivot"]
unique_name_in_owner = true

[node name="LaserCast" parent="Muzzle/Pivot/SprayCasts" node_paths=PackedStringArray("parent_tool") instance=ExtResource("3_xahet")]
target_position = Vector3(-0.5, 0, -2)
parent_tool = NodePath("../../../..")

[node name="LaserCast2" parent="Muzzle/Pivot/SprayCasts" node_paths=PackedStringArray("parent_tool") instance=ExtResource("3_xahet")]
target_position = Vector3(-0.333, 0, -2)
parent_tool = NodePath("../../../..")

[node name="LaserCast3" parent="Muzzle/Pivot/SprayCasts" node_paths=PackedStringArray("parent_tool") instance=ExtResource("3_xahet")]
target_position = Vector3(-0.167, 0, -2)
parent_tool = NodePath("../../../..")

[node name="LaserCast4" parent="Muzzle/Pivot/SprayCasts" node_paths=PackedStringArray("parent_tool") instance=ExtResource("3_xahet")]
parent_tool = NodePath("../../../..")

[node name="SpraySFX" parent="Muzzle/Pivot/SprayCasts/LaserCast4" instance=ExtResource("3_v0jnx")]
unique_name_in_owner = true
attenuation_model = 0

[node name="LaserCast5" parent="Muzzle/Pivot/SprayCasts" node_paths=PackedStringArray("parent_tool") instance=ExtResource("3_xahet")]
target_position = Vector3(0.167, 0, -2)
parent_tool = NodePath("../../../..")

[node name="LaserCast6" parent="Muzzle/Pivot/SprayCasts" node_paths=PackedStringArray("parent_tool") instance=ExtResource("3_xahet")]
target_position = Vector3(0.333, 0, -2)
parent_tool = NodePath("../../../..")

[node name="LaserCast7" parent="Muzzle/Pivot/SprayCasts" node_paths=PackedStringArray("parent_tool") instance=ExtResource("3_xahet")]
target_position = Vector3(0.5, 0, -2)
parent_tool = NodePath("../../../..")

[node name="SprayEffect" type="MeshInstance3D" parent="Muzzle/Pivot"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -0.15, 0, 1, -6.55671e-09, 0, 0, -1)
layers = 2
sorting_offset = 3.0
mesh = SubResource("CylinderMesh_48buk")
skeleton = NodePath("../../..")

[node name="ReticleDecals" type="Node3D" parent="Muzzle/Pivot"]

[node name="CrosshairDecal" type="Decal" parent="Muzzle/Pivot/ReticleDecals"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -1)
size = Vector3(0.2, 2, 0.2)
texture_albedo = ExtResource("3_78jy6")
texture_emission = ExtResource("3_78jy6")
cull_mask = 1048573

[node name="LeftPivot" type="Node3D" parent="Muzzle/Pivot/ReticleDecals"]
transform = Transform3D(0.970296, 0, 0.241922, 0, 1, 0, -0.241922, 0, 0.970296, 0, 0, 0)

[node name="LeftDecal" type="Decal" parent="Muzzle/Pivot/ReticleDecals/LeftPivot"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -1)
size = Vector3(0.2, 2, 0.2)
texture_albedo = ExtResource("4_rotxf")
texture_emission = ExtResource("4_rotxf")
cull_mask = 1048573

[node name="RightPivot" type="Node3D" parent="Muzzle/Pivot/ReticleDecals"]
transform = Transform3D(0.970296, 0, -0.241922, 0, 1, 0, 0.241922, 0, 0.970296, 0, 0, 0)

[node name="RightDecal" type="Decal" parent="Muzzle/Pivot/ReticleDecals/RightPivot"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -1)
size = Vector3(0.2, 2, 0.2)
texture_albedo = ExtResource("5_xo3vu")
texture_emission = ExtResource("5_xo3vu")
cull_mask = 1048573

[node name="BeamParticles1" type="GPUParticles3D" parent="Muzzle/Pivot"]
unique_name_in_owner = true
layers = 2
cast_shadow = 0
amount = 16
lifetime = 0.5
local_coords = true
process_material = SubResource("ParticleProcessMaterial_pr4yq")
draw_pass_1 = SubResource("QuadMesh_trcry")

[node name="BeamParticles2" type="GPUParticles3D" parent="Muzzle/Pivot"]
unique_name_in_owner = true
layers = 2
cast_shadow = 0
lifetime = 0.2
local_coords = true
process_material = SubResource("ParticleProcessMaterial_lyk2j")
draw_pass_1 = SubResource("QuadMesh_trcry")

[node name="BeamSFX" parent="Muzzle" instance=ExtResource("7_hv82w")]
unique_name_in_owner = true

[node name="HUDTool" type="Node3D" parent="."]
unique_name_in_owner = true
top_level = true

[node name="Rumbler" type="Node3D" parent="HUDTool"]
unique_name_in_owner = true
script = ExtResource("7_ku0nd")

[node name="SprayNozzle" type="MeshInstance3D" parent="HUDTool/Rumbler"]
visible = false
layers = 2
mesh = SubResource("BoxMesh_fmqw2")
skeleton = NodePath("../../../..")

[node name="NozzleMarker" type="Marker3D" parent="HUDTool/Rumbler"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.15)
script = ExtResource("8_j7ker")

[node name="HUDElement" type="Control" parent="HUDTool/Rumbler/NozzleMarker"]
layout_mode = 3
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2

[node name="WideNozzle" type="TextureRect" parent="HUDTool/Rumbler/NozzleMarker/HUDElement"]
texture_filter = 3
layout_mode = 0
offset_left = -256.0
offset_top = -186.0
offset_right = -192.0
offset_bottom = -122.0
scale = Vector2(10, 10)
texture = ExtResource("9_8vo2h")

[node name="TallNozzle" type="TextureRect" parent="HUDTool/Rumbler/NozzleMarker/HUDElement"]
visible = false
texture_filter = 3
layout_mode = 0
offset_left = -256.0
offset_top = -186.0
offset_right = -192.0
offset_bottom = -122.0
scale = Vector2(10, 10)
texture = ExtResource("10_hv82w")

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

[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_finished"]
