[gd_scene load_steps=21 format=3 uid="uid://bw1w8jp0yeypy"]

[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_n25yi"]
[ext_resource type="Texture2D" uid="uid://b6tyoa5htapir" path="res://assets/sprites/atlases/plants/aloe.png" id="2_iup5p"]
[ext_resource type="AnimationLibrary" uid="uid://bgutjc3ruq27s" path="res://resources/animations/plants/aloe.res" id="3_3sp3b"]
[ext_resource type="Script" uid="uid://cljytsmqac0w7" path="res://scripts/plants/behaviours/AloeBehaviour.cs" id="4_55asm"]
[ext_resource type="Script" uid="uid://c4jy0cnbnx33h" path="res://scripts/TimeScalableTimer.cs" id="5_gfy6j"]

[sub_resource type="Animation" id="Animation_vknky"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationTree:parameters/Tree/conditions/heal")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_wlien"]
_data = {
&"RESET": SubResource("Animation_vknky")
}

[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_qtb3p"]

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_c25ew"]
animation = &"aloe/heal"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6dmta"]
animation = &"aloe/idle"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7tkf5"]
animation = &"aloe/idle_used"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8bc4q"]
animation = &"aloe/recharge"

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gi6e0"]
advance_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_l1t7h"]
switch_mode = 2
advance_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_cut4s"]
switch_mode = 2
advance_mode = 2

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_um4ov"]
advance_mode = 2
advance_condition = &"heal"

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4kdc0"]
advance_mode = 2
advance_condition = &"charged"

[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_bldox"]
states/aloe_heal/node = SubResource("AnimationNodeAnimation_c25ew")
states/aloe_heal/position = Vector2(530, 41)
states/aloe_idle/node = SubResource("AnimationNodeAnimation_6dmta")
states/aloe_idle/position = Vector2(359, 100)
states/aloe_idle_used/node = SubResource("AnimationNodeAnimation_7tkf5")
states/aloe_idle_used/position = Vector2(710, 105)
states/aloe_recharge/node = SubResource("AnimationNodeAnimation_8bc4q")
states/aloe_recharge/position = Vector2(530, 171)
transitions = ["Start", "aloe_idle", SubResource("AnimationNodeStateMachineTransition_gi6e0"), "aloe_heal", "aloe_idle_used", SubResource("AnimationNodeStateMachineTransition_l1t7h"), "aloe_recharge", "aloe_idle", SubResource("AnimationNodeStateMachineTransition_cut4s"), "aloe_idle", "aloe_heal", SubResource("AnimationNodeStateMachineTransition_um4ov"), "aloe_idle_used", "aloe_recharge", SubResource("AnimationNodeStateMachineTransition_4kdc0")]
graph_offset = Vector2(-78.082, -71.7578)

[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_gfy6j"]
graph_offset = Vector2(-383, 84)
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_qtb3p")
nodes/TimeScale/position = Vector2(120, 120)
nodes/Tree/node = SubResource("AnimationNodeStateMachine_bldox")
nodes/Tree/position = Vector2(-140, 160)
node_connections = [&"TimeScale", 0, &"Tree", &"output", 0, &"TimeScale"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_oe0dc"]
size = Vector2(22, 32)

[node name="Aloe" instance=ExtResource("1_n25yi")]
MaxHP = 30.0

[node name="Sprite2D" parent="." index="0"]
position = Vector2(9, -14)
texture = ExtResource("2_iup5p")
hframes = 8
vframes = 4

[node name="AnimationPlayer" parent="." index="1"]
libraries = {
&"": SubResource("AnimationLibrary_wlien"),
&"aloe": ExtResource("3_3sp3b")
}

[node name="AnimationTree" parent="." index="2"]
tree_root = SubResource("AnimationNodeBlendTree_gfy6j")
parameters/TimeScale/scale = 1.0
parameters/Tree/conditions/charged = false
parameters/Tree/conditions/heal = false

[node name="Behaviour" type="Node" parent="." index="3"]
script = ExtResource("4_55asm")
_hpTreshold = 0.33

[node name="Timer" type="Timer" parent="Behaviour" index="0" node_paths=PackedStringArray("entity")]
wait_time = 20.0
one_shot = true
script = ExtResource("5_gfy6j")
entity = NodePath("../..")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
shape = SubResource("RectangleShape2D_oe0dc")

[connection signal="timeout" from="Behaviour/Timer" to="Behaviour" method="OnTimeout"]
