Spinach
This commit is contained in:
parent
805226d9eb
commit
87f841e8e1
24 changed files with 203 additions and 57 deletions
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_vw2kg")
|
script = ExtResource("1_vw2kg")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "aloe"
|
NameKey = "aloe"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 15.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_t4137")
|
Preview = ExtResource("1_t4137")
|
||||||
Order = 6
|
Order = 6
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ region = Rect2(2, 1, 41, 65)
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_jrx81")
|
script = ExtResource("1_jrx81")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "cucumber"
|
NameKey = "cucumber"
|
||||||
|
|
@ -21,7 +20,4 @@ ReloadTime = 5.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = SubResource("AtlasTexture_3gogt")
|
Preview = SubResource("AtlasTexture_3gogt")
|
||||||
Order = 8
|
Order = 8
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
metadata/_custom_type_script = "uid://cyenlko1knygw"
|
metadata/_custom_type_script = "uid://cyenlko1knygw"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_e15gf")
|
script = ExtResource("1_e15gf")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "garlic"
|
NameKey = "garlic"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 7.5
|
||||||
ReloadProgress = 0.67
|
ReloadProgress = 0.67
|
||||||
Preview = ExtResource("1_datic")
|
Preview = ExtResource("1_datic")
|
||||||
Order = 7
|
Order = 7
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -19,5 +19,5 @@ Scene = ExtResource("2_0i6qf")
|
||||||
ReloadTime = 10.0
|
ReloadTime = 10.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = SubResource("AtlasTexture_ivp5w")
|
Preview = SubResource("AtlasTexture_ivp5w")
|
||||||
Order = 11
|
Order = 10
|
||||||
metadata/_custom_type_script = "uid://cyenlko1knygw"
|
metadata/_custom_type_script = "uid://cyenlko1knygw"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_amvh8")
|
script = ExtResource("1_amvh8")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "peashooter"
|
NameKey = "peashooter"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 5.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_rnq6r")
|
Preview = ExtResource("1_rnq6r")
|
||||||
Order = 0
|
Order = 0
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_33j6b")
|
script = ExtResource("1_33j6b")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "potatomine"
|
NameKey = "potatomine"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 25.0
|
||||||
ReloadProgress = 0.9
|
ReloadProgress = 0.9
|
||||||
Preview = ExtResource("1_xk2pg")
|
Preview = ExtResource("1_xk2pg")
|
||||||
Order = 3
|
Order = 3
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
23
assets/plants/Snipach.tres
Normal file
23
assets/plants/Snipach.tres
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
[gd_resource type="Resource" script_class="PlantResource" load_steps=5 format=3 uid="uid://drb8nk0i3oyyl"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_1eecn"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bmk41n57j7hgx" path="res://scenes/entities/plants/snipach.tscn" id="1_h5ln5"]
|
||||||
|
[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_u5a4p"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_dgfdr"]
|
||||||
|
atlas = ExtResource("1_1eecn")
|
||||||
|
region = Rect2(525, 241, 79, 72)
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_u5a4p")
|
||||||
|
Layer = 1
|
||||||
|
DontRegister = false
|
||||||
|
NameKey = "snipach"
|
||||||
|
DescriptionKey = "snipach_desc"
|
||||||
|
Cost = 400.0
|
||||||
|
Scene = ExtResource("1_h5ln5")
|
||||||
|
ReloadTime = 7.5
|
||||||
|
ReloadProgress = 0.0
|
||||||
|
Preview = SubResource("AtlasTexture_dgfdr")
|
||||||
|
Order = 11
|
||||||
|
metadata/_custom_type_script = "uid://cyenlko1knygw"
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_0cpi0")
|
script = ExtResource("1_0cpi0")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "snowpea"
|
NameKey = "snowpea"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 5.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_7fyy2")
|
Preview = ExtResource("1_7fyy2")
|
||||||
Order = 5
|
Order = 5
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_0bymo")
|
script = ExtResource("1_0bymo")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "spikeweed"
|
NameKey = "spikeweed"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 5.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_2ol2i")
|
Preview = ExtResource("1_2ol2i")
|
||||||
Order = 4
|
Order = 4
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("3_vt4jc")
|
script = ExtResource("3_vt4jc")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "sunflower"
|
NameKey = "sunflower"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 5.0
|
||||||
ReloadProgress = 1.0
|
ReloadProgress = 1.0
|
||||||
Preview = ExtResource("1_8rd5i")
|
Preview = ExtResource("1_8rd5i")
|
||||||
Order = 1
|
Order = 1
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("3_3lugi")
|
script = ExtResource("3_3lugi")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "threepeater"
|
NameKey = "threepeater"
|
||||||
|
|
@ -16,7 +15,4 @@ Scene = ExtResource("2_uqpu0")
|
||||||
ReloadTime = 5.0
|
ReloadTime = 5.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_hinp6")
|
Preview = ExtResource("1_hinp6")
|
||||||
Order = 10
|
Order = 9
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_27l0t")
|
script = ExtResource("1_27l0t")
|
||||||
Tags = []
|
|
||||||
Layer = 1
|
Layer = 1
|
||||||
DontRegister = false
|
DontRegister = false
|
||||||
NameKey = "wallnut"
|
NameKey = "wallnut"
|
||||||
|
|
@ -17,6 +16,3 @@ ReloadTime = 20.0
|
||||||
ReloadProgress = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_2akap")
|
Preview = ExtResource("1_2akap")
|
||||||
Order = 2
|
Order = 2
|
||||||
Parameters = Dictionary[String, float]({
|
|
||||||
"max_hp": 30.0
|
|
||||||
})
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 35 KiB |
|
|
@ -136,6 +136,7 @@ locale/test="en"
|
||||||
2d_physics/layer_3="Plants True"
|
2d_physics/layer_3="Plants True"
|
||||||
2d_physics/layer_4="Zombies Dummy"
|
2d_physics/layer_4="Zombies Dummy"
|
||||||
2d_physics/layer_5="Zombies True"
|
2d_physics/layer_5="Zombies True"
|
||||||
|
2d_physics/layer_6="Projectiles"
|
||||||
2d_physics/layer_7="FallLine"
|
2d_physics/layer_7="FallLine"
|
||||||
2d_physics/layer_8="FallParticles"
|
2d_physics/layer_8="FallParticles"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -868,7 +868,7 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="LeftLowerLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg"]
|
[node name="LeftLowerLeg" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg"]
|
||||||
position = Vector2(-1, 13)
|
position = Vector2(-1, 13)
|
||||||
scale = Vector2(0.999835, 0.999835)
|
scale = Vector2(0.999834, 0.999834)
|
||||||
rest = Transform2D(1, 0, 0, 1, -1, 13)
|
rest = Transform2D(1, 0, 0, 1, -1, 13)
|
||||||
editor_settings/show_bone_gizmo = false
|
editor_settings/show_bone_gizmo = false
|
||||||
|
|
||||||
|
|
@ -922,7 +922,7 @@ editor_settings/show_bone_gizmo = false
|
||||||
|
|
||||||
[node name="RightHand" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm"]
|
[node name="RightHand" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm"]
|
||||||
position = Vector2(-1, 13)
|
position = Vector2(-1, 13)
|
||||||
scale = Vector2(0.999827, 0.999827)
|
scale = Vector2(0.999828, 0.999828)
|
||||||
rest = Transform2D(1, 0, 0, 1, -1, 13)
|
rest = Transform2D(1, 0, 0, 1, -1, 13)
|
||||||
auto_calculate_length_and_angle = false
|
auto_calculate_length_and_angle = false
|
||||||
length = 8.0
|
length = 8.0
|
||||||
|
|
@ -950,7 +950,7 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Tie" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
[node name="Tie" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
||||||
position = Vector2(-9, -21)
|
position = Vector2(-9, -21)
|
||||||
rotation = -0.0584133
|
rotation = -0.151557
|
||||||
skew = -0.000476003
|
skew = -0.000476003
|
||||||
rest = Transform2D(1, 0, 0, 1, -9, -21)
|
rest = Transform2D(1, 0, 0, 1, -9, -21)
|
||||||
auto_calculate_length_and_angle = false
|
auto_calculate_length_and_angle = false
|
||||||
|
|
@ -966,7 +966,7 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Head" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
[node name="Head" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
||||||
position = Vector2(-10, -25)
|
position = Vector2(-10, -25)
|
||||||
scale = Vector2(0.999828, 0.999828)
|
scale = Vector2(0.999829, 0.999829)
|
||||||
rest = Transform2D(1, 0, 0, 1, -10, -25)
|
rest = Transform2D(1, 0, 0, 1, -10, -25)
|
||||||
editor_settings/show_bone_gizmo = false
|
editor_settings/show_bone_gizmo = false
|
||||||
|
|
||||||
|
|
@ -988,7 +988,7 @@ offset = Vector2(-20, -24)
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Right_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
[node name="Right_Eye" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
||||||
position = Vector2(-16, -8.00001)
|
position = Vector2(-16, -8)
|
||||||
texture = SubResource("AtlasTexture_vcc72")
|
texture = SubResource("AtlasTexture_vcc72")
|
||||||
centered = false
|
centered = false
|
||||||
offset = Vector2(-2, -2)
|
offset = Vector2(-2, -2)
|
||||||
|
|
@ -1002,8 +1002,8 @@ offset = Vector2(-2, -2)
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Jaw" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
[node name="Jaw" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head"]
|
||||||
position = Vector2(-2.68751, 2.2458)
|
position = Vector2(-2.81092, 2.54366)
|
||||||
rotation = 0.00598567
|
rotation = -0.107471
|
||||||
scale = Vector2(0.99983, 0.99983)
|
scale = Vector2(0.99983, 0.99983)
|
||||||
texture = SubResource("AtlasTexture_x5uj2")
|
texture = SubResource("AtlasTexture_x5uj2")
|
||||||
centered = false
|
centered = false
|
||||||
|
|
@ -1055,7 +1055,7 @@ remote_path = NodePath("../../HeadParticle/Head/Left_Eye")
|
||||||
|
|
||||||
[node name="LeftUpperArm" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
[node name="LeftUpperArm" type="Bone2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body"]
|
||||||
position = Vector2(-1, -20)
|
position = Vector2(-1, -20)
|
||||||
scale = Vector2(0.999832, 0.999832)
|
scale = Vector2(0.999831, 0.999831)
|
||||||
rest = Transform2D(1, 0, 0, 1, -1, -20)
|
rest = Transform2D(1, 0, 0, 1, -1, -20)
|
||||||
editor_settings/show_bone_gizmo = false
|
editor_settings/show_bone_gizmo = false
|
||||||
|
|
||||||
|
|
@ -1077,8 +1077,8 @@ minTorque = -45.0
|
||||||
maxTorque = 45.0
|
maxTorque = 45.0
|
||||||
|
|
||||||
[node name="Left_Lower_Arm" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile"]
|
[node name="Left_Lower_Arm" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile"]
|
||||||
rotation = 0.0631719
|
rotation = -0.160747
|
||||||
scale = Vector2(0.999997, 0.999997)
|
scale = Vector2(0.999998, 0.999998)
|
||||||
texture = SubResource("AtlasTexture_auqeq")
|
texture = SubResource("AtlasTexture_auqeq")
|
||||||
centered = false
|
centered = false
|
||||||
offset = Vector2(-5, 0)
|
offset = Vector2(-5, 0)
|
||||||
|
|
@ -1086,9 +1086,9 @@ metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Left_Hand" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm"]
|
[node name="Left_Hand" type="Sprite2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm"]
|
||||||
show_behind_parent = true
|
show_behind_parent = true
|
||||||
position = Vector2(-0.99983, 12.9978)
|
position = Vector2(-0.999828, 12.9978)
|
||||||
rotation = -0.123862
|
rotation = -0.133017
|
||||||
scale = Vector2(0.999657, 0.999657)
|
scale = Vector2(0.999656, 0.999656)
|
||||||
texture = SubResource("AtlasTexture_vlvtp")
|
texture = SubResource("AtlasTexture_vlvtp")
|
||||||
centered = false
|
centered = false
|
||||||
offset = Vector2(-4, -1)
|
offset = Vector2(-4, -1)
|
||||||
|
|
@ -1165,7 +1165,7 @@ entity = NodePath("..")
|
||||||
[node name="Mover" type="Node" parent="."]
|
[node name="Mover" type="Node" parent="."]
|
||||||
script = ExtResource("4_u5syx")
|
script = ExtResource("4_u5syx")
|
||||||
_speed = SubResource("Resource_ckb7n")
|
_speed = SubResource("Resource_ckb7n")
|
||||||
_speedControlMult = 2.03653
|
_speedControlMult = 1.02866
|
||||||
|
|
||||||
[node name="HitPlayer" type="Node" parent="."]
|
[node name="HitPlayer" type="Node" parent="."]
|
||||||
script = ExtResource("12_he8da")
|
script = ExtResource("12_he8da")
|
||||||
|
|
|
||||||
85
scenes/entities/plants/snipach.tscn
Normal file
85
scenes/entities/plants/snipach.tscn
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
[gd_scene load_steps=13 format=3 uid="uid://bmk41n57j7hgx"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_ltcu2"]
|
||||||
|
[ext_resource type="Shader" uid="uid://cgc7spjkhsx7c" path="res://assets/shaders/generic_flash.gdshader" id="2_ktw4a"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="3_ktw4a"]
|
||||||
|
[ext_resource type="Script" uid="uid://cu63aiowp5bqd" path="res://scripts/entities/plants/DragAction.cs" id="4_5jowj"]
|
||||||
|
[ext_resource type="Script" uid="uid://co7ttejdo2qot" path="res://scripts/entities/plants/AreaAttack.cs" id="5_twsk4"]
|
||||||
|
[ext_resource type="Script" uid="uid://csgksiyma0h4t" path="res://scripts/entities/plants/behaviours/SnipachBehaviour.cs" id="6_twsk4"]
|
||||||
|
[ext_resource type="Script" uid="uid://c4jy0cnbnx33h" path="res://scripts/TimeScalableTimer.cs" id="7_3hyni"]
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_f4wwx"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("2_ktw4a")
|
||||||
|
shader_parameter/FLASH_COLOR = Color(0.78, 0.78, 0.78, 0.501961)
|
||||||
|
shader_parameter/HIGHLIGHT_COLOR = Color(0.69, 0, 0, 0.282353)
|
||||||
|
shader_parameter/selected = false
|
||||||
|
shader_parameter/blend = 0.0
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_f4wwx"]
|
||||||
|
atlas = ExtResource("3_ktw4a")
|
||||||
|
region = Rect2(525, 241, 79, 72)
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ktw4a"]
|
||||||
|
size = Vector2(37, 66)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_3hyni"]
|
||||||
|
atlas = ExtResource("3_ktw4a")
|
||||||
|
region = Rect2(592, 64, 50, 60)
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5jowj"]
|
||||||
|
size = Vector2(40, 36)
|
||||||
|
|
||||||
|
[node name="Snipach" instance=ExtResource("1_ltcu2")]
|
||||||
|
internal_id = "snipach"
|
||||||
|
MaxHP = 30.0
|
||||||
|
|
||||||
|
[node name="Sprite2D" parent="." index="0"]
|
||||||
|
material = SubResource("ShaderMaterial_f4wwx")
|
||||||
|
position = Vector2(8, -16)
|
||||||
|
texture = SubResource("AtlasTexture_f4wwx")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
|
||||||
|
position = Vector2(-2, -13)
|
||||||
|
shape = SubResource("RectangleShape2D_ktw4a")
|
||||||
|
|
||||||
|
[node name="DragAction" type="Node" parent="Hitbox" index="1"]
|
||||||
|
script = ExtResource("4_5jowj")
|
||||||
|
|
||||||
|
[node name="FlashController" parent="." index="4"]
|
||||||
|
shaderMaterial = SubResource("ShaderMaterial_f4wwx")
|
||||||
|
|
||||||
|
[node name="ShootBox" type="Area2D" parent="." index="5"]
|
||||||
|
visible = false
|
||||||
|
collision_layer = 32
|
||||||
|
collision_mask = 24
|
||||||
|
input_pickable = false
|
||||||
|
script = ExtResource("5_twsk4")
|
||||||
|
_damage = 400
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="ShootBox" index="0"]
|
||||||
|
texture = SubResource("AtlasTexture_3hyni")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="ShootBox" index="1"]
|
||||||
|
shape = SubResource("RectangleShape2D_5jowj")
|
||||||
|
|
||||||
|
[node name="Behaviour" type="Node" parent="." index="6" node_paths=PackedStringArray("attackBox", "timer", "guardTimer")]
|
||||||
|
script = ExtResource("6_twsk4")
|
||||||
|
attackBox = NodePath("../ShootBox")
|
||||||
|
timer = NodePath("Timer")
|
||||||
|
guardTimer = NodePath("GuardTimer")
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="Behaviour" index="0" node_paths=PackedStringArray("entity")]
|
||||||
|
wait_time = 15.0
|
||||||
|
one_shot = true
|
||||||
|
script = ExtResource("7_3hyni")
|
||||||
|
entity = NodePath("../..")
|
||||||
|
|
||||||
|
[node name="GuardTimer" type="Timer" parent="Behaviour" index="1"]
|
||||||
|
wait_time = 0.2
|
||||||
|
one_shot = true
|
||||||
|
autostart = true
|
||||||
|
ignore_time_scale = true
|
||||||
|
|
||||||
|
[connection signal="DragBegin" from="Hitbox/DragAction" to="Behaviour" method="OnDragBegin"]
|
||||||
|
[connection signal="DragEnd" from="Hitbox/DragAction" to="Behaviour" method="OnDragEnd"]
|
||||||
|
|
@ -54,7 +54,6 @@ material = SubResource("ShaderMaterial_yfuxj")
|
||||||
texture = ExtResource("2_ffrjr")
|
texture = ExtResource("2_ffrjr")
|
||||||
hframes = 10
|
hframes = 10
|
||||||
vframes = 2
|
vframes = 2
|
||||||
frame = 1
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" parent="." index="1"]
|
[node name="AnimationPlayer" parent="." index="1"]
|
||||||
libraries = {
|
libraries = {
|
||||||
|
|
|
||||||
32
scripts/entities/plants/DragAction.cs
Normal file
32
scripts/entities/plants/DragAction.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
using Godot;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
|
public partial class DragAction : Node
|
||||||
|
{
|
||||||
|
[Signal] public delegate void DragBeginEventHandler();
|
||||||
|
[Signal] public delegate void DragEndEventHandler();
|
||||||
|
private bool dragging = false;
|
||||||
|
|
||||||
|
public override void _Ready()
|
||||||
|
{
|
||||||
|
GetParent<Area2D>().InputEvent += OnInputEvent;
|
||||||
|
}
|
||||||
|
public void OnInputEvent(Node viewport, InputEvent @event, long shape_index)
|
||||||
|
{
|
||||||
|
if (@event.IsActionPressed("primary_action"))
|
||||||
|
{
|
||||||
|
dragging = true;
|
||||||
|
EmitSignal(SignalName.DragBegin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public override void _Input(InputEvent @event)
|
||||||
|
{
|
||||||
|
if (dragging && @event.IsActionReleased("primary_action"))
|
||||||
|
{
|
||||||
|
dragging = false;
|
||||||
|
EmitSignal(SignalName.DragEnd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
1
scripts/entities/plants/DragAction.cs.uid
Normal file
1
scripts/entities/plants/DragAction.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://cu63aiowp5bqd
|
||||||
36
scripts/entities/plants/behaviours/SnipachBehaviour.cs
Normal file
36
scripts/entities/plants/behaviours/SnipachBehaviour.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
using Godot;
|
||||||
|
|
||||||
|
namespace Newlon.Components.Plants;
|
||||||
|
|
||||||
|
public partial class SnipachBehaviour : BaseBehaviour
|
||||||
|
{
|
||||||
|
[Export] public AreaAttack attackBox;
|
||||||
|
[Export] public Timer timer;
|
||||||
|
[Export] public Timer guardTimer;
|
||||||
|
private bool dragging = false;
|
||||||
|
|
||||||
|
public void OnDragBegin()
|
||||||
|
{
|
||||||
|
if (timer.TimeLeft > 0 || guardTimer.TimeLeft > 0) return;
|
||||||
|
dragging = true;
|
||||||
|
attackBox.Visible = dragging;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDragEnd()
|
||||||
|
{
|
||||||
|
if (dragging == false) return;
|
||||||
|
attackBox.Attack();
|
||||||
|
dragging = false;
|
||||||
|
attackBox.Visible = dragging;
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void _PhysicsProcess(double delta)
|
||||||
|
{
|
||||||
|
if (dragging)
|
||||||
|
{
|
||||||
|
attackBox.GlobalPosition = (attackBox.GetGlobalMousePosition() / FieldParams.Tile).Ceil() * FieldParams.Tile - new Vector2(20, 14);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://csgksiyma0h4t
|
||||||
|
|
@ -83,3 +83,11 @@ Firerate: [color=darkred] {FireTimer.wait_time} seconds[/color].","Он имее
|
||||||
Время перезарядки: [color=darkred]{ReloadTime} секунд[/color].
|
Время перезарядки: [color=darkred]{ReloadTime} секунд[/color].
|
||||||
Урон семечка: [color=darkred] {_damage}[/color].
|
Урон семечка: [color=darkred] {_damage}[/color].
|
||||||
Скорость стрельбы: [color=darkred]{FireTimer.wait_time} секунд[/color]."
|
Скорость стрельбы: [color=darkred]{FireTimer.wait_time} секунд[/color]."
|
||||||
|
snipach,Snipach,Спинат
|
||||||
|
snipach_desc,"Health points: [color=DARK_RED]{MaxHP}[/color]
|
||||||
|
Reload time: [color=DARK_RED]{ReloadTime} seconds[/color].
|
||||||
|
Shot damage: [color=darkred]{_damage}[/color].
|
||||||
|
Ability recharge: [color=darkred]{Timer.wait_time}[/color].","Очки здоровья: [color=DARK_RED]{MaxHP}[/color]
|
||||||
|
Время перезарядки: [color=DARK_RED]{ReloadTime} секунд[/color].
|
||||||
|
Урон за выстрел: [color=darkred]{_damage}[/color].
|
||||||
|
Перезарядка способности: [color=darkred]{Timer.wait_time}[/color]."
|
||||||
|
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue