[gd_scene load_steps=24 format=3 uid="uid://bpur4cpfjskxt"]

[ext_resource type="Script" path="res://game/sabers/particles/particles_saber.gd" id="1"]
[ext_resource type="ArrayMesh" uid="uid://cq3betaoj4fv8" path="res://game/sabers/particles/sword.obj" id="2"]
[ext_resource type="Texture2D" uid="uid://drc5tdiltfqnk" path="res://game/BeepCube/BeepCubeEmission.png" id="2_ffgv8"]
[ext_resource type="AudioStream" uid="uid://20lqjew01h0j" path="res://game/sabers/particles/sword_clash.8a.ogg" id="3"]
[ext_resource type="Texture2D" uid="uid://cg6kwny2mi3wq" path="res://game/data/gradient.png" id="4"]
[ext_resource type="Shader" path="res://game/LightSaber.gdshader" id="5"]
[ext_resource type="AudioStream" uid="uid://bsy5s05go6qg3" path="res://game/sabers/particles/sword_clash.10.ogg" id="6"]
[ext_resource type="PackedScene" uid="uid://buhdimf18mwbo" path="res://game/sabers/default/tail.tscn" id="8_m1jst"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4m7pm"]
albedo_color = Color(0, 0, 0, 1)
emission_enabled = true
emission = Color(0.207843, 0.207843, 0.207843, 1)
emission_energy_multiplier = 0.85
emission_texture = ExtResource("2_ffgv8")
uv1_scale = Vector3(0, 1.725, 1)
uv1_offset = Vector3(-1.25, 0.32, -0.195)

[sub_resource type="CylinderMesh" id="1"]
top_radius = 0.015
bottom_radius = 0.015
height = 0.15

[sub_resource type="Animation" id="3"]
resource_name = "Hide"
length = 0.3
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("tip:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 1.255, 0), Vector3(0, 0.051752, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("LightSaber_Mesh:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.2, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0.079, 0.082, 0.082), Vector3(0, 0, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("LightSaber_Mesh:rotation_degrees")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, -90, -90), Vector3(0, 0, 850)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("LightSaber_Mesh:position")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0.043, 0), Vector3(2.33906e-06, 14.357, 0)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("CPUParticles3D:emitting")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("tail:size")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(0, 0),
"update": 0,
"values": [0.0, 0.0]
}

[sub_resource type="Animation" id="4"]
resource_name = "QuickHide"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("tip:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0.051752, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("LightSaber_Mesh:scale")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0, 0, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("CPUParticles3D:emitting")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("tail:size")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}

[sub_resource type="Animation" id="Animation_y7mm6"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CPUParticles3D:emitting")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("tail:size")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.2]
}

[sub_resource type="Animation" id="5"]
length = 1.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("tip:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.4, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0.051752, 0), Vector3(0, 1.2554, 0)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("LightSaber_Mesh:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.2, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(-1.15453e-15, 62.7816, -28.4656), Vector3(-1.15453e-15, 36.0923, -7.05946), Vector3(-1.15453e-15, 0.0434965, 7.08648e-09)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("LightSaber_Mesh:rotation_degrees")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0, 850), Vector3(0, -90, -90)]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("LightSaber_Mesh:scale")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0, 0.2, 0.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(0.082, 0.082, 0.082), Vector3(0.078669, 0.082, 0.082)]
}
tracks/5/type = "audio"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("AudioStreamPlayer3D")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"clips": [{
"end_offset": 0.0,
"start_offset": 0.0,
"stream": ExtResource("6")
}],
"times": PackedFloat32Array(0.3)
}
tracks/5/use_blend = true
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("CPUParticles3D:emitting")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("tail:size")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(0, 0),
"update": 0,
"values": [0.0, 1.15]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_kyofm"]
_data = {
"Hide": SubResource("3"),
"QuickHide": SubResource("4"),
"RESET": SubResource("Animation_y7mm6"),
"Show": SubResource("5")
}

[sub_resource type="Gradient" id="Gradient_d20e8"]
offsets = PackedFloat32Array(0.638158, 1)
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_fbetx"]
gradient = SubResource("Gradient_d20e8")

[sub_resource type="Curve" id="Curve_k5ros"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.65184, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3

[sub_resource type="CurveTexture" id="CurveTexture_bojj6"]
curve = SubResource("Curve_k5ros")

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ijkly"]
lifetime_randomness = 0.3
emission_shape = 3
emission_box_extents = Vector3(0, 0.515, 0)
direction = Vector3(0, 1, 0)
spread = 34.12
flatness = 0.18
initial_velocity_min = 0.2
initial_velocity_max = 0.2
gravity = Vector3(0, 0, 0)
linear_accel_min = 0.6
linear_accel_max = 1.0
scale_min = 0.0
scale_curve = SubResource("CurveTexture_bojj6")
color_ramp = SubResource("GradientTexture1D_fbetx")
turbulence_enabled = true
turbulence_noise_strength = 20.0
turbulence_noise_scale = 1.57

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8ejbi"]
blend_mode = 1
shading_mode = 0
albedo_texture = ExtResource("4")

[sub_resource type="QuadMesh" id="QuadMesh_ye5bo"]
material = SubResource("StandardMaterial3D_8ejbi")
size = Vector2(0.03, 0.135)

[sub_resource type="ShaderMaterial" id="13"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("5")
shader_parameter/color = Vector4(1, 0, 0, 1)
shader_parameter/center_color = Vector4(0, 0, 0, 1)

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

[node name="Hilt_Mesh" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.03, 0)
layers = 3
material_override = SubResource("StandardMaterial3D_4m7pm")
mesh = SubResource("1")

[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."]
volume_db = -4.0
max_db = 5.0
bus = &"SFX"

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

[node name="base" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.049218, 0)

[node name="tip" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.255, 0)

[node name="CPUParticles3D" type="GPUParticles3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.736082, 0)
emitting = false
amount = 50
lifetime = 1.2
speed_scale = 2.4
randomness = 1.0
visibility_aabb = AABB(-1.01498, -1.44944, -1.5338, 2.02995, 2.89889, 3.06759)
transform_align = 3
process_material = SubResource("ParticleProcessMaterial_ijkly")
draw_pass_1 = SubResource("QuadMesh_ye5bo")

[node name="LightSaber_Mesh" type="MeshInstance3D" parent="."]
transform = Transform3D(1.50944e-16, -3.58433e-09, -0.082, -0.079, -3.58433e-09, 0, -3.4532e-09, 0.082, -3.58433e-09, 0, 0.043, 0)
layers = 3
material_override = SubResource("13")
mesh = ExtResource("2")

[node name="RemoteTransform3D" type="RemoteTransform3D" parent="LightSaber_Mesh"]
transform = Transform3D(2.4869e-14, -12.6557, 0.240074, -5.33065e-07, 0.249189, 12.1928, -12.1951, -1.08924e-08, -5.32962e-07, -0.066, 0, -3.38813e-21)
remote_path = NodePath("../../tail")

[node name="hitsound" type="AudioStreamPlayer3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.753543, 0)
stream = ExtResource("3")
attenuation_model = 3
volume_db = 1.0
bus = &"SFX"

[node name="tail" parent="." instance=ExtResource("8_m1jst")]
transform = Transform3D(0.999998, -6.66134e-16, -1.3145e-13, -5.39704e-17, 0.9998, -0.0189659, -7.10543e-14, 0.0204335, 0.99981, -9.96203e-18, 0.048214, 2.27911e-10)
size = 1.2
