122 lines
4.7 KiB
Text
122 lines
4.7 KiB
Text
[gd_scene load_steps=19 format=3 uid="uid://be1kgukmiu0hs"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://cksryh4w5dbbx" path="res://assets/sprites/atlases/plants/peashooter.png" id="1_cmjrw"]
|
|
[ext_resource type="Script" path="res://scripts/components/plants/RuntimePlantData.cs" id="1_f4h5i"]
|
|
[ext_resource type="AnimationLibrary" uid="uid://bv1dl1g4dmbho" path="res://resources/animations/plants/peashooter.res" id="2_vs0tj"]
|
|
[ext_resource type="Script" path="res://scripts/components/plants/Shooter.cs" id="4_sbggp"]
|
|
[ext_resource type="PackedScene" uid="uid://b2hrv0aqbui7u" path="res://scenes/projectiles/pea.tscn" id="5_66an8"]
|
|
[ext_resource type="Script" path="res://scripts/components/plants/PlantEyesightLimiter.cs" id="6_0812i"]
|
|
[ext_resource type="Script" path="res://scripts/components/plants/behaviours/PeashooterBehaviour.cs" id="6_tdkoh"]
|
|
[ext_resource type="Script" path="res://scripts/components/plants/Eyesight.cs" id="7_fdkt2"]
|
|
|
|
[sub_resource type="Animation" id="Animation_pephc"]
|
|
length = 0.001
|
|
tracks/0/type = "value"
|
|
tracks/0/imported = false
|
|
tracks/0/enabled = true
|
|
tracks/0/path = NodePath("Sprite:frame")
|
|
tracks/0/interp = 1
|
|
tracks/0/loop_wrap = true
|
|
tracks/0/keys = {
|
|
"times": PackedFloat32Array(0),
|
|
"transitions": PackedFloat32Array(1),
|
|
"update": 1,
|
|
"values": [0]
|
|
}
|
|
|
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_djmlc"]
|
|
_data = {
|
|
"RESET": SubResource("Animation_pephc")
|
|
}
|
|
|
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_w1am6"]
|
|
animation = &"peashooter/idle"
|
|
|
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_irqfm"]
|
|
animation = &"peashooter/shoot"
|
|
|
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4oxpj"]
|
|
advance_mode = 2
|
|
|
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_bjldt"]
|
|
advance_mode = 2
|
|
advance_condition = &"ready"
|
|
|
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_srdpm"]
|
|
switch_mode = 2
|
|
advance_mode = 2
|
|
|
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_8qsie"]
|
|
states/Start/position = Vector2(192, 100)
|
|
states/peashooter_idle/node = SubResource("AnimationNodeAnimation_w1am6")
|
|
states/peashooter_idle/position = Vector2(457, 91)
|
|
states/peashooter_shoot/node = SubResource("AnimationNodeAnimation_irqfm")
|
|
states/peashooter_shoot/position = Vector2(660, 91)
|
|
transitions = ["Start", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_4oxpj"), "peashooter_idle", "peashooter_shoot", SubResource("AnimationNodeStateMachineTransition_bjldt"), "peashooter_shoot", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_srdpm")]
|
|
|
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4stx8"]
|
|
size = Vector2(26, 48)
|
|
|
|
[sub_resource type="SegmentShape2D" id="SegmentShape2D_v570y"]
|
|
resource_local_to_scene = true
|
|
b = Vector2(5.865, 0)
|
|
|
|
[node name="Peashooter" type="Node2D"]
|
|
y_sort_enabled = true
|
|
script = ExtResource("1_f4h5i")
|
|
_maxHP = 100
|
|
|
|
[node name="Sprite" type="Sprite2D" parent="."]
|
|
texture = ExtResource("1_cmjrw")
|
|
hframes = 2
|
|
vframes = 10
|
|
|
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
|
libraries = {
|
|
"": SubResource("AnimationLibrary_djmlc"),
|
|
"peashooter": ExtResource("2_vs0tj")
|
|
}
|
|
|
|
[node name="AnimationTree" type="AnimationTree" parent="."]
|
|
tree_root = SubResource("AnimationNodeStateMachine_8qsie")
|
|
anim_player = NodePath("../AnimationPlayer")
|
|
parameters/conditions/ready = false
|
|
|
|
[node name="Hitbox" type="Area2D" parent="."]
|
|
collision_layer = 2
|
|
collision_mask = 0
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
|
position = Vector2(0, 4)
|
|
shape = SubResource("RectangleShape2D_4stx8")
|
|
|
|
[node name="Shooter" type="Node2D" parent="." node_paths=PackedStringArray("_timer")]
|
|
position = Vector2(17, -4)
|
|
script = ExtResource("4_sbggp")
|
|
_projectile = ExtResource("5_66an8")
|
|
_timer = NodePath("Timer")
|
|
|
|
[node name="Timer" type="Timer" parent="Shooter"]
|
|
wait_time = 1.5
|
|
one_shot = true
|
|
|
|
[node name="Behaviour" type="Node" parent="." node_paths=PackedStringArray("_animationTree", "_shootTimer", "_sight")]
|
|
script = ExtResource("6_tdkoh")
|
|
_animationTree = NodePath("../AnimationTree")
|
|
_shootTimer = NodePath("../Shooter/Timer")
|
|
_sight = NodePath("../Eyesight")
|
|
|
|
[node name="Eyesight" type="Area2D" parent="."]
|
|
collision_layer = 0
|
|
collision_mask = 8
|
|
script = ExtResource("7_fdkt2")
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Eyesight"]
|
|
shape = SubResource("SegmentShape2D_v570y")
|
|
script = ExtResource("6_0812i")
|
|
|
|
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
|
|
max_polyphony = 2
|
|
|
|
[connection signal="area_entered" from="Eyesight" to="Eyesight" method="OnAreaEntered"]
|
|
[connection signal="area_exited" from="Eyesight" to="Eyesight" method="OnAreaExited"]
|