[gd_scene format=3 uid="uid://6athlweutl2g"]

[ext_resource type="PackedScene" uid="uid://uyl0s1e67x6s" path="res://Entities/Characters/Player/sprite.tscn" id="1_27cb7"]
[ext_resource type="PackedScene" uid="uid://c2ydbmmvnfca6" path="res://Entities/Characters/Player/state_machine.tscn" id="1_lyjr2"]
[ext_resource type="Script" uid="uid://dacvayqstkvws" path="res://Entities/Characters/Player/Scripts/player.gd" id="1_qqvsf"]
[ext_resource type="Script" uid="uid://b0l02v61if6k8" path="res://Scripts/Components/facing_direction_component.gd" id="1_siygm"]
[ext_resource type="Script" uid="uid://dwclkwbig1uii" path="res://Entities/Characters/Player/Scripts/movement_component.gd" id="4_apx8m"]
[ext_resource type="Script" uid="uid://dkmc1t43gomdb" path="res://Entities/Characters/Player/Scripts/States/idle_state.gd" id="4_dxcao"]
[ext_resource type="Script" uid="uid://ckn7gmtc23b8l" path="res://Entities/Characters/Player/Scripts/States/using_item_a_state.gd" id="5_1mdwi"]
[ext_resource type="Script" uid="uid://bwmmah30t3m0u" path="res://Entities/Characters/Player/Scripts/States/walking_state.gd" id="5_cscr0"]
[ext_resource type="Script" uid="uid://brlisuoocwehh" path="res://Entities/Characters/Player/Scripts/interact_scanner.gd" id="6_fu1fx"]
[ext_resource type="Script" uid="uid://bnp1vowmu15lg" path="res://Entities/Characters/Player/Scripts/States/drawing_bow_state.gd" id="7_cscr0"]
[ext_resource type="Script" uid="uid://cd2ewadcm8oi5" path="res://Entities/Characters/Player/Scripts/States/firing_arrow_state.gd" id="8_plevq"]
[ext_resource type="Script" uid="uid://bx1a35al4yiej" path="res://Entities/Characters/Player/Scripts/States/sitting_state.gd" id="9_sdxbo"]
[ext_resource type="Script" uid="uid://bnontuqj3cnom" path="res://Entities/Characters/Player/Scripts/States/cutscene_state.gd" id="10_p06rw"]
[ext_resource type="Script" uid="uid://wfdtd3xlgrvm" path="res://Entities/Characters/Player/Scripts/States/play_animation_state.gd" id="12_aencf"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_apx8m"]
size = Vector2(10, 5)

[sub_resource type="CircleShape2D" id="CircleShape2D_plevq"]
radius = 12.0

[sub_resource type="RectangleShape2D" id="RectangleShape2D_fu1fx"]
size = Vector2(6, 5)

[node name="Player" type="CharacterBody2D" unique_id=1502234578 node_paths=PackedStringArray("player_sprite", "state_machine", "interact_scanner") groups=["Player Group"]]
y_sort_enabled = true
script = ExtResource("1_qqvsf")
player_sprite = NodePath("Player Sprite")
state_machine = NodePath("State Machine")
interact_scanner = NodePath("Marker2D/InteractScanner")

[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=495465356]
position = Vector2(0, 4.5)
shape = SubResource("RectangleShape2D_apx8m")

[node name="Components" type="Node" parent="." unique_id=567893784]

[node name="FacingDirectionComponent" type="Node" parent="Components" unique_id=408127032]
script = ExtResource("1_siygm")

[node name="MovementComponent" type="Node" parent="Components" unique_id=1773880772 node_paths=PackedStringArray("body")]
script = ExtResource("4_apx8m")
body = NodePath("../..")

[node name="State Machine" parent="." unique_id=732559774 node_paths=PackedStringArray("states_container", "current_state") instance=ExtResource("1_lyjr2")]
states_container = NodePath("States")
current_state = NodePath("States/Idle State")

[node name="States" type="Node" parent="State Machine" unique_id=1171587216]

[node name="Idle State" type="Node" parent="State Machine/States" unique_id=2017409248 node_paths=PackedStringArray("movement_component", "state_machine")]
script = ExtResource("4_dxcao")
movement_component = NodePath("../../../Components/MovementComponent")
state_machine = NodePath("../..")

[node name="Walking State" type="Node" parent="State Machine/States" unique_id=1661048365 node_paths=PackedStringArray("movement_component", "direction_component", "body", "state_machine")]
script = ExtResource("5_cscr0")
movement_component = NodePath("../../../Components/MovementComponent")
direction_component = NodePath("../../../Components/FacingDirectionComponent")
body = NodePath("../../..")
state_machine = NodePath("../..")

[node name="Using Item A State" type="Node" parent="State Machine/States" unique_id=1017153142 node_paths=PackedStringArray("body", "direction_component", "state_machine")]
script = ExtResource("5_1mdwi")
body = NodePath("../../..")
direction_component = NodePath("../../../Components/FacingDirectionComponent")
state_machine = NodePath("../..")

[node name="Drawing Bow State" type="Node" parent="State Machine/States" unique_id=317681716 node_paths=PackedStringArray("movement_componenent", "body", "state_machine")]
script = ExtResource("7_cscr0")
movement_componenent = NodePath("../../../Components/MovementComponent")
body = NodePath("../../..")
state_machine = NodePath("../..")

[node name="Firing Arrow State" type="Node" parent="State Machine/States" unique_id=2129772816 node_paths=PackedStringArray("direction_component", "arrow_spawn_marker", "state_machine")]
script = ExtResource("8_plevq")
direction_component = NodePath("../../../Components/FacingDirectionComponent")
arrow_spawn_marker = NodePath("../../../Marker2D")
state_machine = NodePath("../..")

[node name="Sitting State" type="Node" parent="State Machine/States" unique_id=1774602333 node_paths=PackedStringArray("state_machine")]
script = ExtResource("9_sdxbo")
state_machine = NodePath("../..")

[node name="Cutscene State" type="Node" parent="State Machine/States" unique_id=1722986400 node_paths=PackedStringArray("state_machine")]
script = ExtResource("10_p06rw")
state_machine = NodePath("../..")

[node name="Play Animation State" type="Node" parent="State Machine/States" unique_id=1357816619 node_paths=PackedStringArray("state_machine")]
script = ExtResource("12_aencf")
state_machine = NodePath("../..")

[node name="Occlusion Culling Area" type="Area2D" parent="." unique_id=1195961806]
collision_layer = 8
collision_mask = 0

[node name="CollisionShape2D" type="CollisionShape2D" parent="Occlusion Culling Area" unique_id=1162272029]
shape = SubResource("CircleShape2D_plevq")

[node name="Player Sprite" parent="." unique_id=1169131604 node_paths=PackedStringArray("state_machine", "direction_component") instance=ExtResource("1_27cb7")]
state_machine = NodePath("../State Machine")
direction_component = NodePath("../Components/FacingDirectionComponent")

[node name="Marker2D" type="Marker2D" parent="." unique_id=2003544808]

[node name="InteractScanner" type="Area2D" parent="Marker2D" unique_id=408353807 node_paths=PackedStringArray("parent", "direction_component")]
collision_layer = 0
collision_mask = 2
script = ExtResource("6_fu1fx")
parent = NodePath("..")
direction_component = NodePath("../../Components/FacingDirectionComponent")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Marker2D/InteractScanner" unique_id=1274307485]
position = Vector2(0, 9.5)
shape = SubResource("RectangleShape2D_fu1fx")
debug_color = Color(0.79959095, 0.41617078, 0.18507844, 0.41960785)

[connection signal="SitOnFurnitureTriggered" from="." to="State Machine/States/Idle State" method="OnSitOnFurnitureTriggered"]
[connection signal="DirectionChanged" from="Components/FacingDirectionComponent" to="Player Sprite" method="UpdateSprite"]
[connection signal="DirectionChanged" from="Components/FacingDirectionComponent" to="Marker2D/InteractScanner" method="OnDirectionChanged"]
[connection signal="PlayerBecameIdle" from="State Machine/States/Idle State" to="Player Sprite" method="UpdateSprite"]
[connection signal="StartedWalking" from="State Machine/States/Walking State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerBeganDrawingBow" from="State Machine/States/Drawing Bow State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayerBeganFiringArrow" from="State Machine/States/Firing Arrow State" to="Player Sprite" method="UpdateSprite"]
[connection signal="PlayAnimation" from="State Machine/States/Play Animation State" to="Player Sprite" method="PlaySpecifiedAnimation"]
[connection signal="AnimationFinished" from="Player Sprite" to="State Machine/States/Play Animation State" method="OnAnimationFinished"]
[connection signal="DrawingBowAnimationFinished" from="Player Sprite" to="State Machine/States/Drawing Bow State" method="OnDrawingBowAnimationFinished"]
[connection signal="FiringArrowAnimationFinished" from="Player Sprite" to="State Machine/States/Firing Arrow State" method="OnFiringArrowAnimationFinished"]
[connection signal="InteractionActionTriggered" from="Marker2D/InteractScanner" to="." method="_on_interaction_action_triggered"]
[connection signal="area_entered" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_area_entered"]
[connection signal="area_exited" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_area_exited"]
[connection signal="body_entered" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_body_entered"]
[connection signal="body_exited" from="Marker2D/InteractScanner" to="." method="_on_interact_scanner_body_exited"]
