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

[ext_resource type="Script" path="res://src/player/shot_setup/shot_setup.gd" id="1_r6ei4"]
[ext_resource type="PackedScene" uid="uid://dfttci386ohip" path="res://src/equipment/balls/physics_ball/physics_ball.tscn" id="2_1i5j5"]
[ext_resource type="PackedScene" uid="uid://c2k88ns0h5ie1" path="res://src/ui/3d/arrow/arrow.tscn" id="2_s70wl"]
[ext_resource type="PackedScene" uid="uid://1s3gywmoi20e" path="res://src/characters/player_characters/gfolf_girl/gfolf_girl.tscn" id="3_e4aur"]
[ext_resource type="PackedScene" uid="uid://fht6j87o8ecr" path="res://src/ui/3d/projectile_arc/projectile_arc.tscn" id="4_ry2ho"]
[ext_resource type="PackedScene" uid="uid://dbdul15c4oblg" path="res://src/ui/3d/projected_target.tscn" id="6_mynqj"]
[ext_resource type="Script" path="res://src/player/shot_setup/hitbox.gd" id="7_uh8kn"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lnol1"]
albedo_color = Color(0, 0.537255, 1, 1)

[sub_resource type="CylinderMesh" id="CylinderMesh_ql2ui"]
material = SubResource("StandardMaterial3D_lnol1")
top_radius = 0.02
bottom_radius = 0.02
height = 1.0

[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="Animation" id="Animation_u8k07"]
resource_name = "swing_delay"
length = 0.0667
step = 0.01
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("%Direction/..")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.0667),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"finish_downswing"
}]
}

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

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

[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)

[node name="PhysicsBall" parent="BallPoint" instance=ExtResource("2_1i5j5")]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
freeze = true

[node name="BallImpulseDebug" type="Node3D" parent="BallPoint"]
unique_name_in_owner = true
visible = false

[node name="MeshInstance3D" type="MeshInstance3D" parent="BallPoint/BallImpulseDebug"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, -0.5)
mesh = SubResource("CylinderMesh_ql2ui")
skeleton = NodePath("../..")

[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="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" node_paths=PackedStringArray("excluded_bodies") 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
excluded_bodies = [NodePath("../../BallPoint/PhysicsBall")]

[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="BallReturnTimer" type="Timer" parent="."]
unique_name_in_owner = true
one_shot = true

[node name="Hitbox" type="Area3D" parent="." node_paths=PackedStringArray("ignored_balls")]
script = ExtResource("7_uh8kn")
ignored_balls = [NodePath("../BallPoint/PhysicsBall")]

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

[connection signal="body_entered" from="BallPoint/PhysicsBall" to="." method="_on_physics_ball_body_entered"]
[connection signal="entered_water" from="BallPoint/PhysicsBall" to="." method="_on_ball_entered_water"]
[connection signal="sleeping_state_changed" from="BallPoint/PhysicsBall" to="." method="_on_physics_ball_sleeping_state_changed"]
[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"]
