[gd_scene load_steps=27 format=3 uid="uid://b5x35v3w2u8dx"]

[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_dj7ul"]
[ext_resource type="Texture2D" uid="uid://c77o6ba0mw7a3" path="res://assets/sprites/atlases/plants/potato_mine.png" id="2_sneas"]
[ext_resource type="Script" uid="uid://bhl6o2m3fn4xg" path="res://scripts/plants/ExplosionComponent.cs" id="3_2hd5y"]
[ext_resource type="AnimationLibrary" uid="uid://bjlbdvr6f0r7e" path="res://resources/animations/plants/potato_mine.res" id="3_7tqmj"]
[ext_resource type="Script" uid="uid://c7qfh4py0uulo" path="res://scripts/plants/behaviours/PotatomineBehaviour.cs" id="4_twx65"]
[ext_resource type="PackedScene" uid="uid://ckanq33rao1ur" path="res://scenes/particles/potato_explosion.tscn" id="5_px4r0"]
[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="7_b1j2f"]
[ext_resource type="AudioStream" uid="uid://dltjtpyfr1so0" path="res://assets/audio/sfx/potato_mine.mp3" id="8_3vqdc"]
[ext_resource type="Script" uid="uid://c4jy0cnbnx33h" path="res://scripts/TimeScalableTimer.cs" id="8_824aq"]
[ext_resource type="AudioStream" uid="uid://b27om1bw1x04e" path="res://assets/audio/sfx/dirt_rise.mp3" id="9_3vqdc"]

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

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6uutc"]
animation = &"potato_mine/explode"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_qdgub"]
animation = &"potato_mine/idle_primed"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_cohta"]
animation = &"potato_mine/idle_unprimed"

[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_j42h1"]
animation = &"potato_mine/prime"

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

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8nvnf"]
advance_mode = 2
advance_condition = &"primed"

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

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

[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_lqd1d"]
advance_mode = 2
advance_condition = &"explode"

[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_nfn7b"]
states/End/position = Vector2(1104, 75.168)
states/Start/position = Vector2(46, 130)
states/potato_mine_explode/node = SubResource("AnimationNodeAnimation_6uutc")
states/potato_mine_explode/position = Vector2(934.656, 75.168)
states/potato_mine_idle_primed/node = SubResource("AnimationNodeAnimation_qdgub")
states/potato_mine_idle_primed/position = Vector2(703.656, 75.168)
states/potato_mine_idle_unprimed/node = SubResource("AnimationNodeAnimation_cohta")
states/potato_mine_idle_unprimed/position = Vector2(271.656, 75.168)
states/potato_mine_prime/node = SubResource("AnimationNodeAnimation_j42h1")
states/potato_mine_prime/position = Vector2(490.656, 75.168)
transitions = ["Start", "potato_mine_idle_unprimed", SubResource("AnimationNodeStateMachineTransition_ttnxb"), "potato_mine_idle_unprimed", "potato_mine_prime", SubResource("AnimationNodeStateMachineTransition_8nvnf"), "potato_mine_explode", "End", SubResource("AnimationNodeStateMachineTransition_q0arb"), "potato_mine_prime", "potato_mine_idle_primed", SubResource("AnimationNodeStateMachineTransition_dikhn"), "potato_mine_idle_primed", "potato_mine_explode", SubResource("AnimationNodeStateMachineTransition_lqd1d")]
graph_offset = Vector2(-16.3438, -67.832)

[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_824aq"]
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_3vqdc")
nodes/TimeScale/position = Vector2(100, 120)
nodes/Tree/node = SubResource("AnimationNodeStateMachine_nfn7b")
nodes/Tree/position = Vector2(-260, 140)
node_connections = [&"TimeScale", 0, &"Tree", &"output", 0, &"TimeScale"]

[sub_resource type="CircleShape2D" id="CircleShape2D_824aq"]
radius = 17.0

[sub_resource type="CircleShape2D" id="CircleShape2D_wvns6"]
radius = 25.0

[sub_resource type="RectangleShape2D" id="RectangleShape2D_qfqko"]
size = Vector2(15, 27)

[sub_resource type="RectangleShape2D" id="RectangleShape2D_ti2g4"]
size = Vector2(22, 19)

[node name="Potato mine" instance=ExtResource("1_dj7ul")]
MaxHP = 20.0

[node name="Sprite2D" parent="." index="0"]
texture = ExtResource("2_sneas")
hframes = 7
vframes = 4
frame = 8

[node name="AnimationPlayer" parent="." index="1"]
libraries = {
&"potato_mine": ExtResource("3_7tqmj")
}
autoplay = "idle_unprimed"

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

[node name="Detectionbox" type="Area2D" parent="." index="3"]
collision_layer = 0
collision_mask = 8

[node name="CollisionShape2D" type="CollisionShape2D" parent="Detectionbox" index="0"]
position = Vector2(0, 9)
shape = SubResource("CircleShape2D_824aq")

[node name="ExplosionBox" type="Area2D" parent="." index="4"]
collision_layer = 0
collision_mask = 8
script = ExtResource("3_2hd5y")
damage = 6000
particles = ExtResource("5_px4r0")

[node name="CollisionShape2D" type="CollisionShape2D" parent="ExplosionBox" index="0"]
position = Vector2(0, 9)
shape = SubResource("CircleShape2D_wvns6")

[node name="ExplosionPlayer" type="Node" parent="ExplosionBox" index="1"]
script = ExtResource("7_b1j2f")
audioStream = ExtResource("8_3vqdc")
channel = "explosion"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"

[node name="PrimeTimer" type="Timer" parent="." index="5" node_paths=PackedStringArray("entity")]
wait_time = 15.0
one_shot = true
autostart = true
script = ExtResource("8_824aq")
entity = NodePath("..")

[node name="Behaviour" type="Node" parent="." index="6" node_paths=PackedStringArray("_hitbox", "detectionBox", "_unprimedShape", "_primedShape")]
script = ExtResource("4_twx65")
_hitbox = NodePath("../Hitbox")
detectionBox = NodePath("../Detectionbox")
_unprimedShape = NodePath("../Hitbox/Unprimed")
_primedShape = NodePath("../Hitbox/Primed")

[node name="Unprimed" type="CollisionShape2D" parent="Hitbox" index="0"]
position = Vector2(-0.5, 14.5)
shape = SubResource("RectangleShape2D_qfqko")

[node name="Primed" type="CollisionShape2D" parent="Hitbox" index="1"]
position = Vector2(0, 16.5)
shape = SubResource("RectangleShape2D_ti2g4")
disabled = true

[node name="ChannelPlayer" type="Node" parent="." index="8"]
script = ExtResource("7_b1j2f")
audioStream = ExtResource("9_3vqdc")
channel = "plant_rise"
metadata/_custom_type_script = "uid://c36bj8u7jghc7"

[connection signal="area_entered" from="Detectionbox" to="Behaviour" method="OnAreaEntered"]
[connection signal="timeout" from="PrimeTimer" to="Behaviour" method="Prime"]
