[gd_scene load_steps=17 format=2]

[ext_resource path="res://scripts/Player.gd" type="Script" id=1]
[ext_resource path="res://assets/dungman/DungMan.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/icons/stomach.png" type="Texture" id=3]

[sub_resource type="AnimationNodeAnimation" id=10]
animation = "Blink"

[sub_resource type="AnimationNodeOneShot" id=11]
filter_enabled = true
filters = [ "Armature/Skeleton:Ear.L", "Armature/Skeleton:Ear.R", "Armature/Skeleton:Eye.L", "Armature/Skeleton:Eye.R", "Armature/Skeleton:Head", "Armature/Skeleton:Item" ]
mix_mode = 1

[sub_resource type="AnimationNodeAnimation" id=12]
animation = "Idle-loop"

[sub_resource type="AnimationNodeAnimation" id=13]
animation = "Run-loop"

[sub_resource type="AnimationNodeStateMachineTransition" id=14]
xfade_time = 0.3

[sub_resource type="AnimationNodeStateMachineTransition" id=15]
xfade_time = 0.1

[sub_resource type="AnimationNodeStateMachine" id=16]
states/idle/node = SubResource( 12 )
states/idle/position = Vector2( 357, 120.556 )
states/run/node = SubResource( 13 )
states/run/position = Vector2( 589, 121.667 )
transitions = [ "idle", "run", SubResource( 14 ), "run", "idle", SubResource( 15 ) ]
start_node = "idle"
graph_offset = Vector2( -115, -38 )

[sub_resource type="AnimationNodeBlendTree" id=9]
graph_offset = Vector2( -451.163, 81.2997 )
nodes/Animation/node = SubResource( 10 )
nodes/Animation/position = Vector2( -200, 506.667 )
nodes/Blink/node = SubResource( 11 )
nodes/Blink/position = Vector2( 53.3333, 386.667 )
nodes/Move/node = SubResource( 16 )
nodes/Move/position = Vector2( -226.667, 240 )
nodes/output/position = Vector2( 546.667, 200 )
node_connections = [ "Blink", 0, "Move", "Blink", 1, "Animation", "output", 0, "Blink" ]

[sub_resource type="AnimationNodeStateMachinePlayback" id=17]

[sub_resource type="BoxShape" id=3]
extents = Vector3( 0.25, 0.25, 1 )

[sub_resource type="CapsuleShape" id=2]
radius = 0.210213
height = 0.85525

[sub_resource type="Gradient" id=4]
offsets = PoolRealArray( 0, 0.776119, 1 )
colors = PoolColorArray( 0, 0, 0, 1, 0, 0, 0, 0.429105, 0, 0, 0, 0 )

[sub_resource type="GradientTexture2D" id=5]
gradient = SubResource( 4 )
fill_to = Vector2( 0, 1 )

[node name="Player" type="KinematicBody" groups=["player"]]
axis_lock_motion_y = true
move_lock_y = true
script = ExtResource( 1 )

[node name="DungMan" parent="." instance=ExtResource( 2 )]

[node name="head_bone" type="BoneAttachment" parent="DungMan/Armature/Skeleton" index="1"]
transform = Transform( -0.756986, -0.653402, 0.00625127, -0.014915, 0.0268422, 0.999528, -0.653261, 0.756536, -0.0300646, -0.318138, -0.0110466, -0.986237 )
bone_name = "Arm.R"

[node name="ItemSpawn" type="Spatial" parent="DungMan/Armature/Skeleton/head_bone"]
unique_name_in_owner = true
transform = Transform( 1, 1.48483e-18, -3.14288e-18, -1.61955e-18, 0.999062, -0.0432985, 3.07563e-18, 0.0432985, 0.999062, 1.03227e-16, 0.573877, 0.107031 )

[node name="AnimationTree" type="AnimationTree" parent="DungMan"]
tree_root = SubResource( 9 )
anim_player = NodePath("../AnimationPlayer")
active = true
parameters/Blink/active = false
parameters/Move/playback = SubResource( 17 )

[node name="TriggerVolume" type="Area" parent="DungMan"]
unique_name_in_owner = true
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.630386 )
collision_layer = 4
collision_mask = 8

[node name="CollisionShape" type="CollisionShape" parent="DungMan/TriggerVolume"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.778807, 0.291356 )
shape = SubResource( 3 )

[node name="blink_timer" type="Timer" parent="DungMan"]
autostart = true

[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.641703, 0 )
shape = SubResource( 2 )

[node name="hitbox" type="Area" parent="."]
collision_layer = 2
collision_mask = 16

[node name="CollisionShape" type="CollisionShape" parent="hitbox"]
shape = SubResource( 2 )

[node name="UI" type="CanvasLayer" parent="."]

[node name="Control" type="Control" parent="UI"]
margin_right = 40.0
margin_bottom = 40.0

[node name="TextureRect" type="TextureRect" parent="UI/Control"]
margin_right = 565.0
margin_bottom = 164.0
texture = SubResource( 5 )
expand = true

[node name="MarginContainer" type="MarginContainer" parent="UI/Control"]
custom_constants/margin_right = 16
custom_constants/margin_top = 16
custom_constants/margin_left = 16
custom_constants/margin_bottom = 16

[node name="stomachs" type="HBoxContainer" parent="UI/Control/MarginContainer"]
unique_name_in_owner = true
margin_left = 16.0
margin_top = 16.0
margin_right = 540.0
margin_bottom = 144.0

[node name="stomach0" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
margin_right = 128.0
margin_bottom = 128.0
texture = ExtResource( 3 )

[node name="stomach1" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
margin_left = 132.0
margin_right = 260.0
margin_bottom = 128.0
texture = ExtResource( 3 )

[node name="stomach2" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
margin_left = 264.0
margin_right = 392.0
margin_bottom = 128.0
texture = ExtResource( 3 )

[node name="stomach3" type="TextureRect" parent="UI/Control/MarginContainer/stomachs"]
margin_left = 396.0
margin_right = 524.0
margin_bottom = 128.0
texture = ExtResource( 3 )

[connection signal="timeout" from="DungMan/blink_timer" to="." method="_on_blink_timer_timeout"]

[editable path="DungMan"]
