[gd_scene load_steps=34 format=3 uid="uid://cy7t2tc4y3b4"]

[ext_resource type="Script" path="res://src/player/shot_setup/shot_setup.gd" id="1_r6ei4"]
[ext_resource type="Script" path="res://src/player/shot_setup/ball_point.gd" id="2_e6i3g"]
[ext_resource type="PackedScene" uid="uid://c2k88ns0h5ie1" path="res://src/ui/3d/arrow/arrow.tscn" id="2_s70wl"]
[ext_resource type="Script" path="res://src/player/shot_setup/shot_sfx.gd" id="3_7vs2d"]
[ext_resource type="PackedScene" uid="uid://1s3gywmoi20e" path="res://src/characters/player_characters/gfolf_girl/gfolf_girl.tscn" id="3_e4aur"]
[ext_resource type="AudioStream" uid="uid://cllhgumv1fkju" path="res://assets/sound/sfx/player/drive1.wav" id="3_em3cj"]
[ext_resource type="AudioStream" uid="uid://c8vouau0488fh" path="res://assets/sound/sfx/player/drive2.wav" id="4_4cajc"]
[ext_resource type="PackedScene" uid="uid://fht6j87o8ecr" path="res://src/ui/3d/projectile_arc/projectile_arc.tscn" id="4_ry2ho"]
[ext_resource type="AudioStream" uid="uid://cskhg5l86yvkw" path="res://assets/sound/sfx/player/drive3.wav" id="5_5lj1j"]
[ext_resource type="AudioStream" uid="uid://bkd8py2e7yfat" path="res://assets/sound/sfx/player/drive4.wav" id="6_1wnu3"]
[ext_resource type="PackedScene" uid="uid://dbdul15c4oblg" path="res://src/ui/3d/projected_target.tscn" id="6_mynqj"]
[ext_resource type="AudioStream" uid="uid://j54ssyodqnn3" path="res://assets/sound/sfx/player/putt1.wav" id="7_niyj5"]
[ext_resource type="Script" path="res://src/player/shot_setup/hitbox.gd" id="7_uh8kn"]
[ext_resource type="Texture2D" uid="uid://2yoipvd107t1" path="res://assets/sprites/dope_explosion/dope_explosion.tres" id="8_5ghmo"]
[ext_resource type="FontFile" uid="uid://dsa0oh7c0h4pu" path="res://assets/fonts/Racing_Sans_One/RacingSansOne-Regular.ttf" id="9_y5iv1"]
[ext_resource type="AudioStream" uid="uid://cvsv02inxvsyw" path="res://assets/sound/sfx/player/explosion.mp3" id="15_fn6g1"]

[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_gh0gi"]
random_pitch = 1.1
streams_count = 1
stream_0/stream = ExtResource("3_em3cj")

[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_7isox"]
random_pitch = 1.1
streams_count = 3
stream_0/stream = ExtResource("4_4cajc")
stream_1/stream = ExtResource("5_5lj1j")
stream_2/stream = ExtResource("6_1wnu3")

[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_wnuop"]
random_pitch = 1.1
streams_count = 1
stream_0/stream = ExtResource("7_niyj5")

[sub_resource type="Animation" id="Animation_ug2a7"]
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(".:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.001, 0.001, 0.001)]
}

[sub_resource type="Animation" id="Animation_3obkd"]
resource_name = "hide"
length = 0.42
step = 0.01
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.42),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:scale")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.42),
"transitions": PackedFloat32Array(1.618, 1),
"update": 0,
"values": [Vector3(1, 1, 1), Vector3(0.001, 0.001, 0.001)]
}

[sub_resource type="Animation" id="Animation_dku72"]
resource_name = "show"
length = 0.42
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(".:scale")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.233333, 0.366667, 0.42),
"transitions": PackedFloat32Array(0.618, 1, 1, 1),
"update": 0,
"values": [Vector3(0.001, 0.001, 0.001), Vector3(1.1, 1.1, 1.1), Vector3(0.95, 0.95, 0.95), Vector3(1, 1, 1)]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_rw0cf"]
_data = {
"RESET": SubResource("Animation_ug2a7"),
"hide": SubResource("Animation_3obkd"),
"show": SubResource("Animation_dku72")
}

[sub_resource type="Animation" id="Animation_oks0y"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
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(".:fov")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [75.0]
}

[sub_resource type="Animation" id="Animation_e65hh"]
resource_name = "shot"
length = 4.0
step = 0.01
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.12, 4),
"transitions": PackedFloat32Array(0.618, 1, 1.618, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(0, 1, -3), Vector3(0, 1, -3), Vector3(0, 0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:fov")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1, 0.12, 4),
"transitions": PackedFloat32Array(0.618, 1, 1.618, 1),
"update": 0,
"values": [75.0, 85.0, 85.0, 75.0]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("%Direction/..")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(2),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"start_shot_track"
}]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_u78hq"]
_data = {
"RESET": SubResource("Animation_oks0y"),
"shoot": SubResource("Animation_e65hh")
}

[sub_resource type="SphereShape3D" id="SphereShape3D_xvvdi"]
radius = 1.5

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4n2rd"]
transparency = 1
shading_mode = 0
albedo_texture = ExtResource("8_5ghmo")
texture_filter = 4
billboard_mode = 1
grow = true
grow_amount = 1.0

[sub_resource type="QuadMesh" id="QuadMesh_t34ji"]
material = SubResource("StandardMaterial3D_4n2rd")
size = Vector2(2.84, 4)

[sub_resource type="Animation" id="Animation_vahxw"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ExplosionMesh:mesh:material:albedo_texture:pause")
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("ExplosionMesh:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = false
tracks/2/path = NodePath("ExplosionMesh/ExplosionSFXPlayer:playing")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="Animation" id="Animation_bv1ov"]
resource_name = "explode"
length = 1.618
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ExplosionMesh:mesh:material:albedo_texture:pause")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1.618),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ExplosionMesh:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 1.618),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("ExplosionMesh/ExplosionSFXPlayer:playing")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_dg262"]
_data = {
"RESET": SubResource("Animation_vahxw"),
"explode": SubResource("Animation_bv1ov")
}

[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_8natr"]
random_pitch = 1.1
streams_count = 1
stream_0/stream = ExtResource("15_fn6g1")

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

[node name="BallPoint" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.08, 0)
script = ExtResource("2_e6i3g")

[node name="ShotSFX" type="Node3D" parent="BallPoint"]
unique_name_in_owner = true
script = ExtResource("3_7vs2d")

[node name="GoodDriveSFXPlayer" type="AudioStreamPlayer3D" parent="BallPoint/ShotSFX"]
unique_name_in_owner = true
stream = SubResource("AudioStreamRandomizer_gh0gi")
volume_db = -3.0
bus = &"SFX"

[node name="BadDriveSFXPlayer" type="AudioStreamPlayer3D" parent="BallPoint/ShotSFX"]
unique_name_in_owner = true
stream = SubResource("AudioStreamRandomizer_7isox")
volume_db = -1.0
bus = &"SFX"

[node name="PuttSFXPlayer" type="AudioStreamPlayer3D" parent="BallPoint/ShotSFX"]
unique_name_in_owner = true
stream = SubResource("AudioStreamRandomizer_wnuop")
bus = &"SFX"

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

[node name="GfolfGirl" parent="PlayerPivot" instance=ExtResource("3_e4aur")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -0.555968, 0, 0.0999683)

[node name="DemoCamera" type="Camera3D" parent="PlayerPivot" groups=["DemoCamera"]]
transform = Transform3D(-0.311543, -0.0687373, 0.947743, 0, 0.99738, 0.0723374, -0.950232, 0.0225362, -0.310727, 0.845792, 0.706621, -0.383459)

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

[node name="DriveRef" type="RayCast3D" parent="Direction"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0.08, 0)
enabled = false
target_position = Vector3(0, 0, -1)
collision_mask = 0
collide_with_bodies = false
debug_shape_thickness = 4

[node name="WedgeRef" type="RayCast3D" parent="Direction"]
unique_name_in_owner = true
transform = Transform3D(0.7, 0, 0, 0, 0.181173, -0.676148, 0, 0.676148, 0.181173, 0, 0.08, 0)
enabled = false
target_position = Vector3(0, 0, -1)
collision_mask = 0
collide_with_bodies = false
debug_shape_thickness = 4

[node name="IronRef" type="RayCast3D" parent="Direction"]
unique_name_in_owner = true
transform = Transform3D(0.7, 0, 0, 0, 0.449952, -0.536231, 0, 0.536231, 0.449952, 0, 0.08, 0)
enabled = false
target_position = Vector3(0, 0, -1)
collision_mask = 0
collide_with_bodies = false
debug_shape_thickness = 4

[node name="PuttRef" type="RayCast3D" parent="Direction"]
unique_name_in_owner = true
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0.08, 0)
enabled = false
target_position = Vector3(0, 0, -1)
collision_mask = 0
collide_with_bodies = false
debug_shape_thickness = 4

[node name="Elevation" type="Node3D" parent="Direction"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.9, 0)

[node name="Pitch" type="Node3D" parent="Direction/Elevation"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.907777, 0.419452, 0, -0.419452, 0.907777, 0, 0, 0)

[node name="Zoom" type="Node3D" parent="Direction/Elevation/Pitch"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 6)

[node name="Camera" type="Camera3D" parent="Direction/Elevation/Pitch/Zoom"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 2.98023e-08, 0, -2.98023e-08, 1, 0, 0, 0)
current = true
far = 8192.0

[node name="ArrowPivot" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0)

[node name="Arrow" type="Node3D" parent="ArrowPivot"]
unique_name_in_owner = true
transform = Transform3D(0.001, 0, 0, 0, 0.001, 0, 0, 0, 0.001, 0, 0, 0)

[node name="ArrowAnimation" type="AnimationPlayer" parent="ArrowPivot/Arrow"]
unique_name_in_owner = true
libraries = {
"": SubResource("AnimationLibrary_rw0cf")
}
autoplay = "show"

[node name="DriveArrow" type="Node3D" parent="ArrowPivot/Arrow"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0, 0)
visible = false

[node name="ArrowMesh" parent="ArrowPivot/Arrow/DriveArrow" instance=ExtResource("2_s70wl")]
transform = Transform3D(0.2, 0, 0, 0, -1.74846e-08, 0.2, 0, -0.4, -8.74228e-09, 0, 0, -1)
loop_animation = 1

[node name="WedgeArrow" type="Node3D" parent="ArrowPivot/Arrow"]
unique_name_in_owner = true
transform = Transform3D(0.7, 0, 0, 0, 0.181173, -0.676148, 0, 0.676148, 0.181173, 0, 0, 0)
visible = false

[node name="ArrowMesh" parent="ArrowPivot/Arrow/WedgeArrow" instance=ExtResource("2_s70wl")]
transform = Transform3D(0.2, 0, 0, 0, -1.74846e-08, 0.2, 0, -0.4, -8.74228e-09, 0, 0, -1)
loop_animation = 1

[node name="IronArrow" type="Node3D" parent="ArrowPivot/Arrow"]
unique_name_in_owner = true
transform = Transform3D(0.7, 0, 0, 0, 0.449952, -0.536231, 0, 0.536231, 0.449952, 0, 0, 0)
visible = false

[node name="ArrowMesh" parent="ArrowPivot/Arrow/IronArrow" instance=ExtResource("2_s70wl")]
transform = Transform3D(0.2, 0, 0, 0, -1.74846e-08, 0.2, 0, -0.4, -8.74228e-09, 0, 0, -1)
loop_animation = 1

[node name="PuttArrow" type="Node3D" parent="ArrowPivot/Arrow"]
unique_name_in_owner = true
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
visible = false

[node name="ArrowMesh" parent="ArrowPivot/Arrow/PuttArrow" instance=ExtResource("2_s70wl")]
transform = Transform3D(0.2, 0, 0, 0, -1.74846e-08, 0.2, 0, -0.4, -8.74228e-09, 0, 0, -1)
loop_animation = 1

[node name="ShotProjection" parent="ArrowPivot" instance=ExtResource("4_ry2ho")]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, 0, -0.02, 0)
visible = false
initial_speed = 50.0
time_step = 0.01
max_steps = 800

[node name="ProjectedTarget" parent="ArrowPivot/ShotProjection" instance=ExtResource("6_mynqj")]

[node name="ShotAnimation" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
root_node = NodePath("../Direction/Elevation/Pitch/Zoom/Camera")
libraries = {
"": SubResource("AnimationLibrary_u78hq")
}

[node name="DownswingTimer" type="Timer" parent="."]
unique_name_in_owner = true
wait_time = 0.42
one_shot = true

[node name="BallReturnTimer" type="Timer" parent="."]
unique_name_in_owner = true
one_shot = true

[node name="Hitbox" type="Area3D" parent="."]
script = ExtResource("7_uh8kn")

[node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"]
shape = SubResource("SphereShape3D_xvvdi")

[node name="ExplosionMesh" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
visible = false
mesh = SubResource("QuadMesh_t34ji")

[node name="ExplosionAnimation" type="AnimationPlayer" parent="ExplosionMesh"]
unique_name_in_owner = true
root_node = NodePath("../..")
libraries = {
"": SubResource("AnimationLibrary_dg262")
}

[node name="ExplosionSFXPlayer" type="AudioStreamPlayer3D" parent="ExplosionMesh"]
stream = SubResource("AudioStreamRandomizer_8natr")
unit_size = 60.0
bus = &"SFX"

[node name="PlayerLabel" type="Label3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0)
visibility_range_begin = 50.0
visibility_range_begin_margin = 3.0
visibility_range_fade_mode = 1
pixel_size = 0.001
billboard = 1
no_depth_test = true
fixed_size = true
texture_filter = 5
render_priority = 4
outline_render_priority = 3
text = "Player Name"
font = ExtResource("9_y5iv1")
font_size = 36
outline_size = 10
line_spacing = -16.0
autowrap_mode = 2
width = 120.0

[connection signal="ball_changed" from="BallPoint" to="." method="_on_game_ball_changed"]
[connection signal="timeout" from="DownswingTimer" to="." method="finish_downswing"]
[connection signal="timeout" from="BallReturnTimer" to="." method="_on_ball_return_timer_timeout"]
[connection signal="ball_collision" from="Hitbox" to="." method="_on_hitbox_ball_collision"]
[connection signal="body_entered" from="Hitbox" to="Hitbox" method="_on_body_entered"]
