[gd_scene load_steps=23 format=3 uid="uid://cjoyh54cpjla7"]

[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_65f4u"]
[ext_resource type="Texture2D" uid="uid://bt76iudw2qgnv" path="res://assets/sprites/atlases/plants/cumbucer.png" id="2_ig0op"]
[ext_resource type="Script" uid="uid://dn53jvpjyg63l" path="res://scripts/plants/Eyesight.cs" id="3_d45iq"]
[ext_resource type="Script" uid="uid://ceprqkraw3v6m" path="res://scripts/plants/Shooter.cs" id="4_sckvu"]
[ext_resource type="PackedScene" uid="uid://c1ig40gtdcb60" path="res://scenes/projectiles/cucumber_projectile.tscn" id="5_sckvu"]
[ext_resource type="Script" uid="uid://c4jy0cnbnx33h" path="res://scripts/TimeScalableTimer.cs" id="6_xwpd6"]
[ext_resource type="Script" uid="uid://bdk5iqtw4xbkl" path="res://scripts/plants/behaviours/PeashooterBehaviour.cs" id="7_q31qc"]

[sub_resource type="Animation" id="Animation_n1xkd"]
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": [10]
}

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

[sub_resource type="Animation" id="Animation_ig0op"]
length = 0.666675
loop_mode = 2
step = 0.0833333
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, 0.166667, 0.333333, 0.5, 0.666667),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 1,
"values": [10, 11, 12, 13, 14]
}

[sub_resource type="Animation" id="Animation_d45iq"]
length = 0.833342
step = 0.0833333
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, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666667, 0.75),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Shooter")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.5),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"Shoot"
}]
}

[sub_resource type="AnimationLibrary" id="AnimationLibrary_n1xkd"]
_data = {
&"attack": SubResource("Animation_d45iq"),
&"idle": SubResource("Animation_ig0op")
}

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

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_d45iq"]
animation = &"cucumber/attack"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_n1xkd"]
animation = &"cucumber/idle"

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

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ie74j"]
advance_mode = 2
advance_condition = &"ready"

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

[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_jbggv"]
states/cucumber_attack/node = SubResource("AnimationNodeAnimation_d45iq")
states/cucumber_attack/position = Vector2(628, 100)
states/cucumber_idle/node = SubResource("AnimationNodeAnimation_n1xkd")
states/cucumber_idle/position = Vector2(374, 100)
transitions = ["Start", "cucumber_idle", SubResource("AnimationNodeStateMachineTransition_gogcg"), "cucumber_idle", "cucumber_attack", SubResource("AnimationNodeStateMachineTransition_ie74j"), "cucumber_attack", "cucumber_idle", SubResource("AnimationNodeStateMachineTransition_sckvu")]
graph_offset = Vector2(137, -3)

[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_xwpd6"]
graph_offset = Vector2(-370, 72)
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_ig0op")
nodes/TimeScale/position = Vector2(60, 140)
nodes/Tree/node = SubResource("AnimationNodeStateMachine_jbggv")
nodes/Tree/position = Vector2(-260, 140)
node_connections = [&"TimeScale", 0, &"Tree", &"output", 0, &"TimeScale"]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ig0op"]
radius = 13.0
height = 48.0

[sub_resource type="RectangleShape2D" id="RectangleShape2D_n1xkd"]
size = Vector2(26, 600)

[node name="Cucumber" instance=ExtResource("1_65f4u")]
MaxHP = 30.0

[node name="Sprite2D" parent="." index="0"]
texture = ExtResource("2_ig0op")
hframes = 10
vframes = 2
frame = 10

[node name="AnimationPlayer" parent="." index="1"]
libraries = {
&"": SubResource("AnimationLibrary_gogcg"),
&"cucumber": SubResource("AnimationLibrary_n1xkd")
}

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

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

[node name="Eysight" type="Area2D" parent="." index="4"]
collision_layer = 4
collision_mask = 8
script = ExtResource("3_d45iq")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Eysight" index="0"]
shape = SubResource("RectangleShape2D_n1xkd")

[node name="Shooter" type="Marker2D" parent="." index="5" node_paths=PackedStringArray("_timer")]
script = ExtResource("4_sckvu")
_projectile = ExtResource("5_sckvu")
_timer = NodePath("Timer")

[node name="Timer" type="Timer" parent="Shooter" index="0" node_paths=PackedStringArray("entity")]
wait_time = 5.0
one_shot = true
script = ExtResource("6_xwpd6")
entity = NodePath("../..")

[node name="Behaviour" type="Node" parent="." index="6" node_paths=PackedStringArray("_shootTimer", "_sight")]
script = ExtResource("7_q31qc")
_shootTimer = NodePath("../Shooter/Timer")
_sight = NodePath("../Eysight")
