Survival mode ready
This commit is contained in:
parent
0fff33d196
commit
7614b12076
50 changed files with 586 additions and 81 deletions
|
|
@ -16,6 +16,7 @@ public partial class FloatModifiers : Resource
|
||||||
percentage_value = per,
|
percentage_value = per,
|
||||||
mult_value = mult
|
mult_value = mult
|
||||||
};
|
};
|
||||||
|
mod.ResourceLocalToScene = true;
|
||||||
return mod;
|
return mod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,13 @@ public partial class FloatModsProperty : EditorProperty
|
||||||
if (newValue == null)
|
if (newValue == null)
|
||||||
{
|
{
|
||||||
newValue = new();
|
newValue = new();
|
||||||
|
newValue.ResourceLocalToScene = true;
|
||||||
EmitChanged(GetEditedProperty(), newValue);
|
EmitChanged(GetEditedProperty(), newValue);
|
||||||
}
|
}
|
||||||
|
if (newValue.ResourceLocalToScene == false)
|
||||||
|
{
|
||||||
|
newValue.ResourceLocalToScene = true;
|
||||||
|
}
|
||||||
if (newValue == _currentValue)
|
if (newValue == _currentValue)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
[gd_resource type="AudioBusLayout" format=3 uid="uid://igejanqt2yqf"]
|
[gd_resource type="AudioBusLayout" format=3 uid="uid://igejanqt2yqf"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
|
bus/0/volume_db = -0.130497
|
||||||
bus/1/name = &"MusicBus"
|
bus/1/name = &"MusicBus"
|
||||||
bus/1/solo = false
|
bus/1/solo = false
|
||||||
bus/1/mute = false
|
bus/1/mute = false
|
||||||
bus/1/bypass_fx = false
|
bus/1/bypass_fx = false
|
||||||
bus/1/volume_db = 0.0
|
bus/1/volume_db = -0.526013
|
||||||
bus/1/send = &"Master"
|
bus/1/send = &"Master"
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -1,14 +1,16 @@
|
||||||
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://bf7vjtufjc8kt"]
|
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://bf7vjtufjc8kt"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://d4btl7vqi4v0q" path="res://assets/sprites/plants/aloe.tres" id="1_t4137"]
|
[ext_resource type="Texture2D" uid="uid://d4btl7vqi4v0q" path="res://assets/sprites/plants/aloe.tres" id="1_t4137"]
|
||||||
[ext_resource type="Script" path="res://scripts/resources/PlantResource.cs" id="1_vw2kg"]
|
[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_vw2kg"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bw1w8jp0yeypy" path="res://scenes/entities/plants/aloe.tscn" id="2_6a4ia"]
|
[ext_resource type="PackedScene" uid="uid://bw1w8jp0yeypy" path="res://scenes/entities/plants/aloe.tscn" id="2_6a4ia"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_vw2kg")
|
script = ExtResource("1_vw2kg")
|
||||||
|
display_name = "Aloe"
|
||||||
|
display_description = "Heals plantoids"
|
||||||
Cost = 75
|
Cost = 75
|
||||||
Scene = ExtResource("2_6a4ia")
|
Scene = ExtResource("2_6a4ia")
|
||||||
ReloadTime = 15.0
|
ReloadTime = 15.0
|
||||||
StartReloadTime = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_t4137")
|
Preview = ExtResource("1_t4137")
|
||||||
Layer = 1
|
Layer = 1
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://btkkaow4tyw55"]
|
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://btkkaow4tyw55"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://m8e84blnx7yu" path="res://assets/sprites/plants/garlic.tres" id="1_datic"]
|
[ext_resource type="Texture2D" uid="uid://m8e84blnx7yu" path="res://assets/sprites/plants/garlic.tres" id="1_datic"]
|
||||||
[ext_resource type="Script" path="res://scripts/resources/PlantResource.cs" id="1_e15gf"]
|
[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_e15gf"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bes4e6sksax67" path="res://scenes/entities/plants/garlic.tscn" id="2_81n0p"]
|
[ext_resource type="PackedScene" uid="uid://qq0cw8xtcoj3" path="res://scenes/entities/plants/garlic.tscn" id="2_81n0p"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_e15gf")
|
script = ExtResource("1_e15gf")
|
||||||
|
display_name = "Garlic"
|
||||||
|
display_description = "Redirects zomboids"
|
||||||
Cost = 50
|
Cost = 50
|
||||||
Scene = ExtResource("2_81n0p")
|
Scene = ExtResource("2_81n0p")
|
||||||
ReloadTime = 7.5
|
ReloadTime = 7.5
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,18 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_amvh8")
|
script = ExtResource("1_amvh8")
|
||||||
|
display_name = "Peashooter"
|
||||||
|
display_description = "Shoots peas
|
||||||
|
Shoots peas
|
||||||
|
Shoots peas
|
||||||
|
Shoots peas
|
||||||
|
|
||||||
|
Shoots peas
|
||||||
|
Shoots peas
|
||||||
|
|
||||||
|
Shoots peas
|
||||||
|
Shoots peas
|
||||||
|
Shoots peas"
|
||||||
Cost = 75
|
Cost = 75
|
||||||
Scene = ExtResource("1_rqf2x")
|
Scene = ExtResource("1_rqf2x")
|
||||||
ReloadTime = 5.0
|
ReloadTime = 5.0
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_33j6b")
|
script = ExtResource("1_33j6b")
|
||||||
|
display_name = "Potato mine"
|
||||||
|
display_description = "Blow"
|
||||||
Cost = 25
|
Cost = 25
|
||||||
Scene = ExtResource("2_ig2ti")
|
Scene = ExtResource("2_ig2ti")
|
||||||
ReloadTime = 25.0
|
ReloadTime = 25.0
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://duflq3eexs6m"]
|
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://duflq3eexs6m"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/resources/PlantResource.cs" id="1_0cpi0"]
|
[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_0cpi0"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cu7h8bot6jlug" path="res://assets/sprites/plants/snowpea.tres" id="1_7fyy2"]
|
[ext_resource type="Texture2D" uid="uid://cu7h8bot6jlug" path="res://assets/sprites/plants/snowpea.tres" id="1_7fyy2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b7innrovtmf5u" path="res://scenes/entities/plants/snowpea.tscn" id="2_k47h0"]
|
[ext_resource type="PackedScene" uid="uid://b7innrovtmf5u" path="res://scenes/entities/plants/snowpea.tscn" id="2_k47h0"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_0cpi0")
|
script = ExtResource("1_0cpi0")
|
||||||
|
display_name = "Snowgrave"
|
||||||
|
display_description = "Proceed."
|
||||||
Cost = 175
|
Cost = 175
|
||||||
Scene = ExtResource("2_k47h0")
|
Scene = ExtResource("2_k47h0")
|
||||||
ReloadTime = 5.0
|
ReloadTime = 5.0
|
||||||
StartReloadTime = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_7fyy2")
|
Preview = ExtResource("1_7fyy2")
|
||||||
Layer = 1
|
Layer = 1
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://cas11tg6chiu4"]
|
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://cas11tg6chiu4"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/resources/PlantResource.cs" id="1_0bymo"]
|
[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_0bymo"]
|
||||||
[ext_resource type="Texture2D" uid="uid://baqfahxkcvfe1" path="res://assets/sprites/plants/Spikeweed.tres" id="1_2ol2i"]
|
[ext_resource type="Texture2D" uid="uid://baqfahxkcvfe1" path="res://assets/sprites/plants/Spikeweed.tres" id="1_2ol2i"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bdhod5c6o53ha" path="res://scenes/entities/plants/spikeweed.tscn" id="2_iv8de"]
|
[ext_resource type="PackedScene" uid="uid://bdhod5c6o53ha" path="res://scenes/entities/plants/spikeweed.tscn" id="2_iv8de"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_0bymo")
|
script = ExtResource("1_0bymo")
|
||||||
|
display_name = "Spikeweed"
|
||||||
|
display_description = "Walk"
|
||||||
Cost = 100
|
Cost = 100
|
||||||
Scene = ExtResource("2_iv8de")
|
Scene = ExtResource("2_iv8de")
|
||||||
ReloadTime = 5.0
|
ReloadTime = 5.0
|
||||||
StartReloadTime = 0.0
|
ReloadProgress = 0.0
|
||||||
Preview = ExtResource("1_2ol2i")
|
Preview = ExtResource("1_2ol2i")
|
||||||
Layer = 1
|
Layer = 1
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("3_vt4jc")
|
script = ExtResource("3_vt4jc")
|
||||||
|
display_name = "Sunflower"
|
||||||
|
display_description = "Suns"
|
||||||
Cost = 50
|
Cost = 50
|
||||||
Scene = ExtResource("2_gcyr5")
|
Scene = ExtResource("2_gcyr5")
|
||||||
ReloadTime = 5.0
|
ReloadTime = 5.0
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("3_3lugi")
|
script = ExtResource("3_3lugi")
|
||||||
|
display_name = "Threepeater"
|
||||||
|
display_description = "WIP"
|
||||||
Cost = 300
|
Cost = 300
|
||||||
Scene = ExtResource("2_uqpu0")
|
Scene = ExtResource("2_uqpu0")
|
||||||
ReloadTime = 5.0
|
ReloadTime = 5.0
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://c2e2yj7rgoswi"]
|
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://c2e2yj7rgoswi"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://g2oppl54efja" path="res://assets/sprites/plants/Wallnut.tres" id="1_2akap"]
|
[ext_resource type="Texture2D" uid="uid://g2oppl54efja" path="res://assets/sprites/plants/Wallnut.tres" id="1_2akap"]
|
||||||
[ext_resource type="Script" path="res://scripts/resources/PlantResource.cs" id="1_27l0t"]
|
[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_27l0t"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bq7imkpr2yqyr" path="res://scenes/entities/plants/wallnut.tscn" id="2_rkn3h"]
|
[ext_resource type="PackedScene" uid="uid://bq7imkpr2yqyr" path="res://scenes/entities/plants/wallnut.tscn" id="2_rkn3h"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_27l0t")
|
script = ExtResource("1_27l0t")
|
||||||
|
display_name = "Wallnut"
|
||||||
|
display_description = "Pechenka"
|
||||||
Cost = 50
|
Cost = 50
|
||||||
Scene = ExtResource("2_rkn3h")
|
Scene = ExtResource("2_rkn3h")
|
||||||
ReloadTime = 20.0
|
ReloadTime = 20.0
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_resource type="Theme" load_steps=10 format=3 uid="uid://e8n88g31w7x7"]
|
[gd_resource type="Theme" load_steps=13 format=3 uid="uid://e8n88g31w7x7"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://ci1a150qo2op2" path="res://assets/sprites/gui/ChooseYourSeeds/Panel.tres" id="1_86pbs"]
|
[ext_resource type="Texture2D" uid="uid://ci1a150qo2op2" path="res://assets/sprites/gui/ChooseYourSeeds/Panel.tres" id="1_86pbs"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bj5fouwjk3kum" path="res://assets/sprites/gui/ChooseYourSeeds/InnerPanel.tres" id="2_txg3r"]
|
[ext_resource type="Texture2D" uid="uid://bj5fouwjk3kum" path="res://assets/sprites/gui/ChooseYourSeeds/InnerPanel.tres" id="2_txg3r"]
|
||||||
|
|
@ -19,6 +19,27 @@ texture_margin_top = 6.0
|
||||||
texture_margin_right = 4.0
|
texture_margin_right = 4.0
|
||||||
texture_margin_bottom = 3.0
|
texture_margin_bottom = 3.0
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_qlmyy"]
|
||||||
|
texture = ExtResource("3_gf6bj")
|
||||||
|
texture_margin_left = 4.0
|
||||||
|
texture_margin_top = 7.0
|
||||||
|
texture_margin_right = 4.0
|
||||||
|
texture_margin_bottom = 7.0
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_la16p"]
|
||||||
|
texture = ExtResource("4_xn7o0")
|
||||||
|
texture_margin_left = 4.0
|
||||||
|
texture_margin_top = 4.0
|
||||||
|
texture_margin_right = 4.0
|
||||||
|
texture_margin_bottom = 4.0
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_744lb"]
|
||||||
|
texture = ExtResource("4_xn7o0")
|
||||||
|
texture_margin_left = 4.0
|
||||||
|
texture_margin_top = 4.0
|
||||||
|
texture_margin_right = 4.0
|
||||||
|
texture_margin_bottom = 4.0
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_amjg8"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_amjg8"]
|
||||||
bg_color = Color(0.574582, 0.300953, 0.501998, 1)
|
bg_color = Color(0.574582, 0.300953, 0.501998, 1)
|
||||||
corner_radius_top_left = 4
|
corner_radius_top_left = 4
|
||||||
|
|
@ -43,6 +64,11 @@ texture_margin_bottom = 4.0
|
||||||
[resource]
|
[resource]
|
||||||
Panel/styles/panel = SubResource("StyleBoxTexture_o7bns")
|
Panel/styles/panel = SubResource("StyleBoxTexture_o7bns")
|
||||||
PanelContainer/styles/panel = SubResource("StyleBoxTexture_jrih7")
|
PanelContainer/styles/panel = SubResource("StyleBoxTexture_jrih7")
|
||||||
|
VScrollBar/styles/grabber = SubResource("StyleBoxTexture_qlmyy")
|
||||||
|
VScrollBar/styles/grabber_highlight = SubResource("StyleBoxTexture_qlmyy")
|
||||||
|
VScrollBar/styles/grabber_pressed = SubResource("StyleBoxTexture_qlmyy")
|
||||||
|
VScrollBar/styles/scroll = SubResource("StyleBoxTexture_la16p")
|
||||||
|
VScrollBar/styles/scroll_focus = SubResource("StyleBoxTexture_744lb")
|
||||||
VSlider/icons/grabber = ExtResource("3_gf6bj")
|
VSlider/icons/grabber = ExtResource("3_gf6bj")
|
||||||
VSlider/icons/grabber_disabled = null
|
VSlider/icons/grabber_disabled = null
|
||||||
VSlider/icons/grabber_highlight = ExtResource("3_gf6bj")
|
VSlider/icons/grabber_highlight = ExtResource("3_gf6bj")
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_sngfh")
|
script = ExtResource("1_sngfh")
|
||||||
cost = 7
|
cost = 5.0
|
||||||
scene = ExtResource("1_lhcag")
|
scene = ExtResource("1_lhcag")
|
||||||
metadata/_custom_type_script = "uid://cqxj7o8hdm82n"
|
metadata/_custom_type_script = "uid://cqxj7o8hdm82n"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_sw7hj")
|
script = ExtResource("1_sw7hj")
|
||||||
cost = 3
|
cost = 2.0
|
||||||
scene = ExtResource("1_llf5l")
|
scene = ExtResource("1_llf5l")
|
||||||
metadata/_custom_type_script = "uid://cqxj7o8hdm82n"
|
metadata/_custom_type_script = "uid://cqxj7o8hdm82n"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
script = ExtResource("1_u5qpq")
|
script = ExtResource("1_u5qpq")
|
||||||
cost = 5
|
cost = 7.0
|
||||||
scene = ExtResource("1_4myt6")
|
scene = ExtResource("1_4myt6")
|
||||||
metadata/_custom_type_script = "uid://cqxj7o8hdm82n"
|
metadata/_custom_type_script = "uid://cqxj7o8hdm82n"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
[gd_scene load_steps=5 format=3 uid="uid://xu4i6tmkv00a"]
|
[gd_scene load_steps=8 format=3 uid="uid://xu4i6tmkv00a"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://hhjbqkjqpt7x" path="res://scenes/entities/Zombies/cone_zombie.tscn" id="1_mwqpo"]
|
[ext_resource type="PackedScene" uid="uid://hhjbqkjqpt7x" path="res://scenes/entities/Zombies/cone_zombie.tscn" id="1_mwqpo"]
|
||||||
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_3mrqj"]
|
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_3mrqj"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ce04l60l6mhfk" path="res://assets/sprites/bucket.tres" id="3_0nlp0"]
|
[ext_resource type="Texture2D" uid="uid://ce04l60l6mhfk" path="res://assets/sprites/bucket.tres" id="3_0nlp0"]
|
||||||
|
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="4_1s2fn"]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wdi07"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wdi07"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
|
|
@ -10,6 +11,20 @@ shader = ExtResource("2_3mrqj")
|
||||||
shader_parameter/blend_color = Color(1, 1, 1, 1)
|
shader_parameter/blend_color = Color(1, 1, 1, 1)
|
||||||
shader_parameter/amount = 0.0
|
shader_parameter/amount = 0.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_2bm8y"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
script = ExtResource("4_1s2fn")
|
||||||
|
flat_value = 10.0
|
||||||
|
percentage_value = 0.0
|
||||||
|
mult_value = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_lt6ps"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
script = ExtResource("4_1s2fn")
|
||||||
|
flat_value = 0.2
|
||||||
|
percentage_value = 0.0
|
||||||
|
mult_value = 1.0
|
||||||
|
|
||||||
[node name="BucketZombie" instance=ExtResource("1_mwqpo")]
|
[node name="BucketZombie" instance=ExtResource("1_mwqpo")]
|
||||||
|
|
||||||
[node name="CanvasGroup" parent="." index="0"]
|
[node name="CanvasGroup" parent="." index="0"]
|
||||||
|
|
@ -19,5 +34,11 @@ material = SubResource("ShaderMaterial_wdi07")
|
||||||
position = Vector2(-12, -83)
|
position = Vector2(-12, -83)
|
||||||
texture = ExtResource("3_0nlp0")
|
texture = ExtResource("3_0nlp0")
|
||||||
|
|
||||||
|
[node name="Eatbox" parent="." index="2"]
|
||||||
|
_damage = SubResource("Resource_2bm8y")
|
||||||
|
|
||||||
|
[node name="Mover" parent="." index="5"]
|
||||||
|
_speed = SubResource("Resource_lt6ps")
|
||||||
|
|
||||||
[node name="Armor" parent="." index="7"]
|
[node name="Armor" parent="." index="7"]
|
||||||
_maxHP = 180
|
_maxHP = 385
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
[gd_scene load_steps=6 format=3 uid="uid://hhjbqkjqpt7x"]
|
[gd_scene load_steps=9 format=3 uid="uid://hhjbqkjqpt7x"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_3dq4c"]
|
[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_3dq4c"]
|
||||||
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_2dq8e"]
|
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_2dq8e"]
|
||||||
[ext_resource type="Script" uid="uid://fd4im1fmwc5n" path="res://scripts/components/Armor.cs" id="3_5s7in"]
|
[ext_resource type="Script" uid="uid://fd4im1fmwc5n" path="res://scripts/components/Armor.cs" id="3_5s7in"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ceqvdmude7cgg" path="res://assets/sprites/cone.tres" id="4_qdhik"]
|
[ext_resource type="Texture2D" uid="uid://ceqvdmude7cgg" path="res://assets/sprites/cone.tres" id="4_qdhik"]
|
||||||
|
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="4_qof5v"]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sat5k"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_sat5k"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
|
|
@ -11,6 +12,20 @@ shader = ExtResource("2_2dq8e")
|
||||||
shader_parameter/blend_color = Color(1, 1, 1, 1)
|
shader_parameter/blend_color = Color(1, 1, 1, 1)
|
||||||
shader_parameter/amount = 0.0
|
shader_parameter/amount = 0.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_w70im"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
script = ExtResource("4_qof5v")
|
||||||
|
flat_value = 10.0
|
||||||
|
percentage_value = 0.0
|
||||||
|
mult_value = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_qof5v"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
script = ExtResource("4_qof5v")
|
||||||
|
flat_value = 0.2
|
||||||
|
percentage_value = 0.0
|
||||||
|
mult_value = 1.0
|
||||||
|
|
||||||
[node name="ConeZombie" node_paths=PackedStringArray("_armor") instance=ExtResource("1_3dq4c")]
|
[node name="ConeZombie" node_paths=PackedStringArray("_armor") instance=ExtResource("1_3dq4c")]
|
||||||
_armor = NodePath("Armor")
|
_armor = NodePath("Armor")
|
||||||
|
|
||||||
|
|
@ -21,8 +36,14 @@ material = SubResource("ShaderMaterial_sat5k")
|
||||||
position = Vector2(-12, -88)
|
position = Vector2(-12, -88)
|
||||||
texture = ExtResource("4_qdhik")
|
texture = ExtResource("4_qdhik")
|
||||||
|
|
||||||
|
[node name="Eatbox" parent="." index="2"]
|
||||||
|
_damage = SubResource("Resource_w70im")
|
||||||
|
|
||||||
|
[node name="Mover" parent="." index="5"]
|
||||||
|
_speed = SubResource("Resource_qof5v")
|
||||||
|
|
||||||
[node name="Armor" type="Node" parent="." index="7"]
|
[node name="Armor" type="Node" parent="." index="7"]
|
||||||
script = ExtResource("3_5s7in")
|
script = ExtResource("3_5s7in")
|
||||||
_maxHP = 60
|
_maxHP = 130
|
||||||
|
|
||||||
[connection signal="ArmorLost" from="Armor" to="CanvasGroup/Hat" method="queue_free"]
|
[connection signal="ArmorLost" from="Armor" to="CanvasGroup/Hat" method="queue_free"]
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
[gd_scene load_steps=31 format=3 uid="uid://bgqmwsb6ynm81"]
|
[gd_scene load_steps=34 format=3 uid="uid://bgqmwsb6ynm81"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_fnu7s"]
|
[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_fnu7s"]
|
||||||
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_6qr4h"]
|
[ext_resource type="Shader" uid="uid://d0eo5uuj222c4" path="res://assets/shaders/CG_color_blender.gdshader" id="2_6qr4h"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cse1504ao4g8e" path="res://assets/sprites/atlases/zombies/hobo.png" id="3_6qr4h"]
|
[ext_resource type="Texture2D" uid="uid://cse1504ao4g8e" path="res://assets/sprites/atlases/zombies/hobo.png" id="3_6qr4h"]
|
||||||
[ext_resource type="AnimationLibrary" uid="uid://cuh2kyb21hmkm" path="res://resources/animations/zombies/basic_zombie.res" id="4_02fim"]
|
[ext_resource type="AnimationLibrary" uid="uid://cuh2kyb21hmkm" path="res://resources/animations/zombies/basic_zombie.res" id="4_02fim"]
|
||||||
[ext_resource type="Script" uid="uid://c5v2og85t7s6j" path="res://scripts/components/zombies/behaviours/HoboBehaviour.cs" id="4_5selg"]
|
[ext_resource type="Script" uid="uid://c5v2og85t7s6j" path="res://scripts/components/zombies/behaviours/HoboBehaviour.cs" id="4_5selg"]
|
||||||
|
[ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="4_c1y3b"]
|
||||||
[ext_resource type="Script" uid="uid://fd4im1fmwc5n" path="res://scripts/components/Armor.cs" id="4_w8pya"]
|
[ext_resource type="Script" uid="uid://fd4im1fmwc5n" path="res://scripts/components/Armor.cs" id="4_w8pya"]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_w8pya"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_w8pya"]
|
||||||
|
|
@ -21,6 +22,13 @@ region = Rect2(0, 15, 40, 49)
|
||||||
atlas = ExtResource("3_6qr4h")
|
atlas = ExtResource("3_6qr4h")
|
||||||
region = Rect2(3, 0, 35, 11)
|
region = Rect2(3, 0, 35, 11)
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_qg8rq"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
script = ExtResource("4_c1y3b")
|
||||||
|
flat_value = 10.0
|
||||||
|
percentage_value = 0.0
|
||||||
|
mult_value = 1.0
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_qv5y7"]
|
[sub_resource type="Animation" id="Animation_qv5y7"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
|
|
@ -35,6 +43,18 @@ tracks/0/keys = {
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [Color(1, 1, 1, 1)]
|
"values": [Color(1, 1, 1, 1)]
|
||||||
}
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Mover:_speedControlMult")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.0]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_sq25x"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_sq25x"]
|
||||||
_data = {
|
_data = {
|
||||||
|
|
@ -50,12 +70,9 @@ tracks/0/path = NodePath("Mover")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0, 1.93333),
|
"times": PackedFloat32Array(1.93333),
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"values": [{
|
"values": [{
|
||||||
"args": [0.0],
|
|
||||||
"method": &"SetSpeedMult"
|
|
||||||
}, {
|
|
||||||
"args": [3.0],
|
"args": [3.0],
|
||||||
"method": &"SetSpeedMult"
|
"method": &"SetSpeedMult"
|
||||||
}]
|
}]
|
||||||
|
|
@ -72,22 +89,32 @@ tracks/1/keys = {
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [Color(1, 1, 1, 1), Color(1, 0, 0, 1)]
|
"values": [Color(1, 1, 1, 1), Color(1, 0, 0, 1)]
|
||||||
}
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("Mover:_speedControlMult")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0.0, 1.0]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_5selg"]
|
[sub_resource type="Animation" id="Animation_5selg"]
|
||||||
resource_name = "walk"
|
resource_name = "walk"
|
||||||
tracks/0/type = "method"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("Mover")
|
tracks/0/path = NodePath("Mover:_speedControlMult")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"values": [{
|
"update": 0,
|
||||||
"args": [0.1],
|
"values": [1.0]
|
||||||
"method": &"SetSpeedFlat"
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5selg"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_5selg"]
|
||||||
|
|
@ -165,6 +192,13 @@ states/hobo_zombie_run/position = Vector2(866, 89)
|
||||||
transitions = ["Start", "basic_zombie_idle", SubResource("AnimationNodeStateMachineTransition_vxhht"), "basic_zombie_idle", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_y2ivb"), "basic_zombie_walk", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_7d3k4"), "basic_zombie_idle", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_qg8rq"), "basic_zombie_idle", "hobo_zombie_run", SubResource("AnimationNodeStateMachineTransition_4248q"), "hobo_zombie_run", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_tu6af"), "basic_zombie_eat", "hobo_zombie_run", SubResource("AnimationNodeStateMachineTransition_yalvk"), "hobo_zombie_can_destroy", "basic_zombie_idle", SubResource("AnimationNodeStateMachineTransition_7jlle"), "basic_zombie_eat", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_w1b1s"), "basic_zombie_walk", "hobo_zombie_run", SubResource("AnimationNodeStateMachineTransition_02fim")]
|
transitions = ["Start", "basic_zombie_idle", SubResource("AnimationNodeStateMachineTransition_vxhht"), "basic_zombie_idle", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_y2ivb"), "basic_zombie_walk", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_7d3k4"), "basic_zombie_idle", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_qg8rq"), "basic_zombie_idle", "hobo_zombie_run", SubResource("AnimationNodeStateMachineTransition_4248q"), "hobo_zombie_run", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_tu6af"), "basic_zombie_eat", "hobo_zombie_run", SubResource("AnimationNodeStateMachineTransition_yalvk"), "hobo_zombie_can_destroy", "basic_zombie_idle", SubResource("AnimationNodeStateMachineTransition_7jlle"), "basic_zombie_eat", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_w1b1s"), "basic_zombie_walk", "hobo_zombie_run", SubResource("AnimationNodeStateMachineTransition_02fim")]
|
||||||
graph_offset = Vector2(55, -28)
|
graph_offset = Vector2(55, -28)
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_4248q"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
script = ExtResource("4_c1y3b")
|
||||||
|
flat_value = 0.2
|
||||||
|
percentage_value = 0.0
|
||||||
|
mult_value = 1.0
|
||||||
|
|
||||||
[node name="Hobo" node_paths=PackedStringArray("_armor") instance=ExtResource("1_fnu7s")]
|
[node name="Hobo" node_paths=PackedStringArray("_armor") instance=ExtResource("1_fnu7s")]
|
||||||
_armor = NodePath("CanArmor")
|
_armor = NodePath("CanArmor")
|
||||||
|
|
||||||
|
|
@ -182,6 +216,9 @@ z_index = -1
|
||||||
position = Vector2(-6, -63)
|
position = Vector2(-6, -63)
|
||||||
texture = SubResource("AtlasTexture_5selg")
|
texture = SubResource("AtlasTexture_5selg")
|
||||||
|
|
||||||
|
[node name="Eatbox" parent="." index="2"]
|
||||||
|
_damage = SubResource("Resource_qg8rq")
|
||||||
|
|
||||||
[node name="AnimationPlayer" parent="." index="3"]
|
[node name="AnimationPlayer" parent="." index="3"]
|
||||||
libraries = {
|
libraries = {
|
||||||
&"": SubResource("AnimationLibrary_sq25x"),
|
&"": SubResource("AnimationLibrary_sq25x"),
|
||||||
|
|
@ -195,9 +232,12 @@ speed_scale = 3.0
|
||||||
tree_root = SubResource("AnimationNodeStateMachine_xg3p6")
|
tree_root = SubResource("AnimationNodeStateMachine_xg3p6")
|
||||||
advance_expression_base_node = NodePath("../Behaviour")
|
advance_expression_base_node = NodePath("../Behaviour")
|
||||||
|
|
||||||
|
[node name="Mover" parent="." index="5"]
|
||||||
|
_speed = SubResource("Resource_4248q")
|
||||||
|
|
||||||
[node name="CanArmor" type="Node" parent="." index="7"]
|
[node name="CanArmor" type="Node" parent="." index="7"]
|
||||||
script = ExtResource("4_w8pya")
|
script = ExtResource("4_w8pya")
|
||||||
_maxHP = 100
|
_maxHP = 180
|
||||||
metadata/_custom_type_script = "uid://fd4im1fmwc5n"
|
metadata/_custom_type_script = "uid://fd4im1fmwc5n"
|
||||||
|
|
||||||
[node name="Behaviour" type="Node" parent="." index="8" node_paths=PackedStringArray("_eatBox", "_animationTree")]
|
[node name="Behaviour" type="Node" parent="." index="8" node_paths=PackedStringArray("_eatBox", "_animationTree")]
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ shader_parameter/amount = 0.0
|
||||||
size = Vector2(2, 48)
|
size = Vector2(2, 48)
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_ruqsf"]
|
[sub_resource type="Resource" id="Resource_ruqsf"]
|
||||||
|
resource_local_to_scene = true
|
||||||
script = ExtResource("7_b3p4o")
|
script = ExtResource("7_b3p4o")
|
||||||
flat_value = 10.0
|
flat_value = 10.0
|
||||||
percentage_value = 0.0
|
percentage_value = 0.0
|
||||||
|
|
@ -34,14 +35,14 @@ length = 0.001
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("AnimationTree:parameters/conditions/no_can")
|
tracks/0/path = NodePath("Mover:_speedControlMult")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 1,
|
"update": 0,
|
||||||
"values": [false]
|
"values": [0.0]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_sq25x"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_sq25x"]
|
||||||
|
|
@ -88,15 +89,16 @@ transitions = ["Start", "basic_zombie_idle", SubResource("AnimationNodeStateMach
|
||||||
graph_offset = Vector2(13, 26)
|
graph_offset = Vector2(13, 26)
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_ckb7n"]
|
[sub_resource type="Resource" id="Resource_ckb7n"]
|
||||||
|
resource_local_to_scene = true
|
||||||
script = ExtResource("7_b3p4o")
|
script = ExtResource("7_b3p4o")
|
||||||
flat_value = 0.1
|
flat_value = 0.2
|
||||||
percentage_value = 0.0
|
percentage_value = 0.0
|
||||||
mult_value = 1.0
|
mult_value = 1.0
|
||||||
|
|
||||||
[node name="Zombie" type="Node2D"]
|
[node name="Zombie" type="Node2D"]
|
||||||
y_sort_enabled = true
|
y_sort_enabled = true
|
||||||
script = ExtResource("1_qq3f1")
|
script = ExtResource("1_qq3f1")
|
||||||
_maxHP = 100
|
_maxHP = 70
|
||||||
|
|
||||||
[node name="CanvasGroup" type="CanvasGroup" parent="."]
|
[node name="CanvasGroup" type="CanvasGroup" parent="."]
|
||||||
material = SubResource("ShaderMaterial_63ls2")
|
material = SubResource("ShaderMaterial_63ls2")
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ states/peashooter_shoot/position = Vector2(674, 82)
|
||||||
transitions = ["Start", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_70n3m"), "peashooter_idle", "peashooter_shoot", SubResource("AnimationNodeStateMachineTransition_2lwpg"), "peashooter_shoot", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_k61yr")]
|
transitions = ["Start", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_70n3m"), "peashooter_idle", "peashooter_shoot", SubResource("AnimationNodeStateMachineTransition_2lwpg"), "peashooter_shoot", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_k61yr")]
|
||||||
|
|
||||||
[sub_resource type="SegmentShape2D" id="SegmentShape2D_8iovl"]
|
[sub_resource type="SegmentShape2D" id="SegmentShape2D_8iovl"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r7xnh"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r7xnh"]
|
||||||
size = Vector2(20, 44)
|
size = Vector2(20, 44)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=13 format=3 uid="uid://b7innrovtmf5u"]
|
[gd_scene load_steps=14 format=3 uid="uid://b7innrovtmf5u"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dy41q1kxray5t" path="res://scenes/entities/plants/peashooter.tscn" id="1_lp85e"]
|
[ext_resource type="PackedScene" uid="uid://dy41q1kxray5t" path="res://scenes/entities/plants/peashooter.tscn" id="1_lp85e"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cu0651pvvkmvm" path="res://assets/sprites/atlases/plants/snow_pea.png" id="2_ytrm0"]
|
[ext_resource type="Texture2D" uid="uid://cu0651pvvkmvm" path="res://assets/sprites/atlases/plants/snow_pea.png" id="2_ytrm0"]
|
||||||
|
|
@ -22,7 +22,7 @@ tracks/0/keys = {
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_djmlc"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_djmlc"]
|
||||||
_data = {
|
_data = {
|
||||||
"RESET": SubResource("Animation_pephc")
|
&"RESET": SubResource("Animation_pephc")
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dv2ad"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dv2ad"]
|
||||||
|
|
@ -49,6 +49,9 @@ states/snowpea_shoot/node = SubResource("AnimationNodeAnimation_ptach")
|
||||||
states/snowpea_shoot/position = Vector2(682, 100)
|
states/snowpea_shoot/position = Vector2(682, 100)
|
||||||
transitions = ["snowpea_shoot", "snowpea_idle", SubResource("AnimationNodeStateMachineTransition_8spty"), "Start", "snowpea_idle", SubResource("AnimationNodeStateMachineTransition_lshcr"), "snowpea_idle", "snowpea_shoot", SubResource("AnimationNodeStateMachineTransition_ihul0")]
|
transitions = ["snowpea_shoot", "snowpea_idle", SubResource("AnimationNodeStateMachineTransition_8spty"), "Start", "snowpea_idle", SubResource("AnimationNodeStateMachineTransition_lshcr"), "snowpea_idle", "snowpea_shoot", SubResource("AnimationNodeStateMachineTransition_ihul0")]
|
||||||
|
|
||||||
|
[sub_resource type="SegmentShape2D" id="SegmentShape2D_3oyhk"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
|
||||||
[node name="Snowpea" instance=ExtResource("1_lp85e")]
|
[node name="Snowpea" instance=ExtResource("1_lp85e")]
|
||||||
|
|
||||||
[node name="Sprite2D" parent="." index="0"]
|
[node name="Sprite2D" parent="." index="0"]
|
||||||
|
|
@ -56,8 +59,8 @@ texture = ExtResource("2_ytrm0")
|
||||||
|
|
||||||
[node name="AnimationPlayer" parent="." index="1"]
|
[node name="AnimationPlayer" parent="." index="1"]
|
||||||
libraries = {
|
libraries = {
|
||||||
"": SubResource("AnimationLibrary_djmlc"),
|
&"": SubResource("AnimationLibrary_djmlc"),
|
||||||
"snowpea": ExtResource("4_jvx5y")
|
&"snowpea": ExtResource("4_jvx5y")
|
||||||
}
|
}
|
||||||
autoplay = "snowpea/idle"
|
autoplay = "snowpea/idle"
|
||||||
|
|
||||||
|
|
@ -66,3 +69,6 @@ tree_root = SubResource("AnimationNodeStateMachine_qdmro")
|
||||||
|
|
||||||
[node name="Shooter" parent="." index="3"]
|
[node name="Shooter" parent="." index="3"]
|
||||||
_projectile = ExtResource("5_bv86m")
|
_projectile = ExtResource("5_bv86m")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" parent="Eysight" index="0"]
|
||||||
|
shape = SubResource("SegmentShape2D_3oyhk")
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_bikjn"]
|
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_bikjn"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b3tuidu8dag8u" path="res://assets/sprites/atlases/plants/sunflower.png" id="2_fwcda"]
|
[ext_resource type="Texture2D" uid="uid://b3tuidu8dag8u" path="res://assets/sprites/atlases/plants/sunflower.png" id="2_fwcda"]
|
||||||
[ext_resource type="AnimationLibrary" uid="uid://yjytiuj4u7oh" path="res://resources/animations/plants/sunflower.res" id="3_btsik"]
|
[ext_resource type="AnimationLibrary" uid="uid://yjytiuj4u7oh" path="res://resources/animations/plants/sunflower.res" id="3_btsik"]
|
||||||
[ext_resource type="Script" path="res://scripts/components/plants/PlantSunSpawner.cs" id="3_te0pl"]
|
[ext_resource type="Script" uid="uid://b71gebny84s81" path="res://scripts/components/plants/PlantSunSpawner.cs" id="3_te0pl"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="4_b8hls"]
|
[ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="4_b8hls"]
|
||||||
[ext_resource type="Script" path="res://scripts/components/plants/behaviours/SunflowerBehaviour.cs" id="5_26je0"]
|
[ext_resource type="Script" uid="uid://bth7gah4tn7uj" path="res://scripts/components/plants/behaviours/SunflowerBehaviour.cs" id="5_26je0"]
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_bfx6v"]
|
[sub_resource type="Animation" id="Animation_bfx6v"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
|
|
@ -24,7 +24,7 @@ tracks/0/keys = {
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ek2al"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ek2al"]
|
||||||
_data = {
|
_data = {
|
||||||
"RESET": SubResource("Animation_bfx6v")
|
&"RESET": SubResource("Animation_bfx6v")
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lkpmx"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_lkpmx"]
|
||||||
|
|
@ -60,12 +60,12 @@ size = Vector2(26, 48)
|
||||||
texture = ExtResource("2_fwcda")
|
texture = ExtResource("2_fwcda")
|
||||||
hframes = 9
|
hframes = 9
|
||||||
vframes = 2
|
vframes = 2
|
||||||
frame = 1
|
frame = 2
|
||||||
|
|
||||||
[node name="AnimationPlayer" parent="." index="1"]
|
[node name="AnimationPlayer" parent="." index="1"]
|
||||||
libraries = {
|
libraries = {
|
||||||
"": SubResource("AnimationLibrary_ek2al"),
|
&"": SubResource("AnimationLibrary_ek2al"),
|
||||||
"sunflower": ExtResource("3_btsik")
|
&"sunflower": ExtResource("3_btsik")
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="AnimationTree" parent="." index="2"]
|
[node name="AnimationTree" parent="." index="2"]
|
||||||
|
|
@ -82,7 +82,11 @@ _amountPerSun = 25
|
||||||
script = ExtResource("5_26je0")
|
script = ExtResource("5_26je0")
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="Behaviour" index="0"]
|
[node name="Timer" type="Timer" parent="Behaviour" index="0"]
|
||||||
wait_time = 5.0
|
wait_time = 24.25
|
||||||
|
|
||||||
|
[node name="StartTimer" type="Timer" parent="Behaviour" index="1"]
|
||||||
|
wait_time = 12.0
|
||||||
|
one_shot = true
|
||||||
autostart = true
|
autostart = true
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
|
||||||
|
|
@ -90,3 +94,5 @@ position = Vector2(0, 4)
|
||||||
shape = SubResource("RectangleShape2D_4xs4g")
|
shape = SubResource("RectangleShape2D_4xs4g")
|
||||||
|
|
||||||
[connection signal="timeout" from="Behaviour/Timer" to="Behaviour" method="Timeout"]
|
[connection signal="timeout" from="Behaviour/Timer" to="Behaviour" method="Timeout"]
|
||||||
|
[connection signal="timeout" from="Behaviour/StartTimer" to="Behaviour" method="Timeout"]
|
||||||
|
[connection signal="timeout" from="Behaviour/StartTimer" to="Behaviour/Timer" method="start"]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=11 format=3 uid="uid://eegv1qihfv2q"]
|
[gd_scene load_steps=12 format=3 uid="uid://eegv1qihfv2q"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dy41q1kxray5t" path="res://scenes/entities/plants/peashooter.tscn" id="1_muntu"]
|
[ext_resource type="PackedScene" uid="uid://dy41q1kxray5t" path="res://scenes/entities/plants/peashooter.tscn" id="1_muntu"]
|
||||||
[ext_resource type="Script" uid="uid://djpc0kvagpadv" path="res://scripts/components/plants/ThreepeaterShooter.cs" id="2_ieami"]
|
[ext_resource type="Script" uid="uid://djpc0kvagpadv" path="res://scripts/components/plants/ThreepeaterShooter.cs" id="2_ieami"]
|
||||||
|
|
@ -96,7 +96,11 @@ _data = {
|
||||||
&"shoot": SubResource("Animation_7sohe")
|
&"shoot": SubResource("Animation_7sohe")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="SegmentShape2D" id="SegmentShape2D_j7h7q"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
|
||||||
[sub_resource type="SegmentShape2D" id="SegmentShape2D_yb26d"]
|
[sub_resource type="SegmentShape2D" id="SegmentShape2D_yb26d"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
|
||||||
[node name="Threepeater" instance=ExtResource("1_muntu")]
|
[node name="Threepeater" instance=ExtResource("1_muntu")]
|
||||||
|
|
||||||
|
|
@ -109,6 +113,9 @@ libraries = {
|
||||||
[node name="Shooter" parent="." index="3"]
|
[node name="Shooter" parent="." index="3"]
|
||||||
script = ExtResource("2_ieami")
|
script = ExtResource("2_ieami")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" parent="Eysight" index="0"]
|
||||||
|
shape = SubResource("SegmentShape2D_j7h7q")
|
||||||
|
|
||||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Eysight" index="1"]
|
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Eysight" index="1"]
|
||||||
position = Vector2(0, 60)
|
position = Vector2(0, 60)
|
||||||
shape = SubResource("SegmentShape2D_yb26d")
|
shape = SubResource("SegmentShape2D_yb26d")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=13 format=3 uid="uid://dpxxjfd5lv5sv"]
|
[gd_scene load_steps=15 format=3 uid="uid://dpxxjfd5lv5sv"]
|
||||||
|
|
||||||
[ext_resource type="Theme" uid="uid://e8n88g31w7x7" path="res://resources/themes/ChooseYourSeeds.tres" id="1_bfo8i"]
|
[ext_resource type="Theme" uid="uid://e8n88g31w7x7" path="res://resources/themes/ChooseYourSeeds.tres" id="1_bfo8i"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dr8a0rx42o3qy" path="res://assets/sprites/gui/ChooseYourSeeds/PlantFrame.tres" id="2_so2bw"]
|
[ext_resource type="Texture2D" uid="uid://dr8a0rx42o3qy" path="res://assets/sprites/gui/ChooseYourSeeds/PlantFrame.tres" id="2_so2bw"]
|
||||||
|
|
@ -100,6 +100,13 @@ _data = {
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_rmoaa"]
|
[sub_resource type="ViewportTexture" id="ViewportTexture_rmoaa"]
|
||||||
viewport_path = NodePath("Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame/Previewport")
|
viewport_path = NodePath("Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame/Previewport")
|
||||||
|
|
||||||
|
[sub_resource type="LabelSettings" id="LabelSettings_fmc0y"]
|
||||||
|
font_size = 24
|
||||||
|
font_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
|
[sub_resource type="LabelSettings" id="LabelSettings_ln6r7"]
|
||||||
|
font_color = Color(0, 0, 0, 1)
|
||||||
|
|
||||||
[node name="ChooseYourSeeds" type="Control"]
|
[node name="ChooseYourSeeds" type="Control"]
|
||||||
process_mode = 3
|
process_mode = 3
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
|
|
@ -151,10 +158,12 @@ layout_mode = 2
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
texture = ExtResource("2_so2bw")
|
texture = ExtResource("2_so2bw")
|
||||||
|
|
||||||
[node name="Previewport" type="SubViewport" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame"]
|
[node name="Previewport" type="SubViewport" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame" node_paths=PackedStringArray("title", "description")]
|
||||||
canvas_item_default_texture_filter = 0
|
canvas_item_default_texture_filter = 0
|
||||||
size = Vector2i(65, 65)
|
size = Vector2i(65, 65)
|
||||||
script = ExtResource("3_fmc0y")
|
script = ExtResource("3_fmc0y")
|
||||||
|
title = NodePath("../../PanelContainer/ScrollContainer/VBoxContainer/Title")
|
||||||
|
description = NodePath("../../PanelContainer/ScrollContainer/VBoxContainer/Description")
|
||||||
|
|
||||||
[node name="FrameField" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame/Previewport"]
|
[node name="FrameField" type="Sprite2D" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/Frame/Previewport"]
|
||||||
texture = ExtResource("3_rn5vx")
|
texture = ExtResource("3_rn5vx")
|
||||||
|
|
@ -175,6 +184,25 @@ texture = SubResource("ViewportTexture_rmoaa")
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/PanelContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
horizontal_scroll_mode = 0
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/PanelContainer/ScrollContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="Title" type="Label" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/PanelContainer/ScrollContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
label_settings = SubResource("LabelSettings_fmc0y")
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="Description" type="Label" parent="Panel/MarginContainer/VBoxContainer/HBoxContainer/PanelContainer/ScrollContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "
|
||||||
|
"
|
||||||
|
label_settings = SubResource("LabelSettings_ln6r7")
|
||||||
|
|
||||||
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/MarginContainer/VBoxContainer"]
|
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/MarginContainer/VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
|
|
||||||
6
scenes/level components/left_boundary_marker.tscn
Normal file
6
scenes/level components/left_boundary_marker.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://plc2gus4ppds"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://d2dq6f0bk7pfx" path="res://scripts/components/level/LeftBoundaryMarker.cs" id="1_q4xoc"]
|
||||||
|
|
||||||
|
[node name="LeftBoundaryMarker" type="Marker2D"]
|
||||||
|
script = ExtResource("1_q4xoc")
|
||||||
6
scenes/level components/right_boundary_marker.tscn
Normal file
6
scenes/level components/right_boundary_marker.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://jm7wm08d2mi7"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bymylx25skfot" path="res://scripts/components/level/RightBoundaryMarker.cs" id="1_cf1wn"]
|
||||||
|
|
||||||
|
[node name="right_boundary_marker" type="Marker2D"]
|
||||||
|
script = ExtResource("1_cf1wn")
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"]
|
[gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/components/LinearProjectile.cs" id="1_3kc4s"]
|
[ext_resource type="Script" uid="uid://dxlwvwy3hj56x" path="res://scripts/components/LinearProjectile.cs" id="1_3kc4s"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"]
|
[ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_scene load_steps=5 format=3 uid="uid://domeukw4ucmyr"]
|
[gd_scene load_steps=5 format=3 uid="uid://domeukw4ucmyr"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/components/LinearProjectile.cs" id="1_fkydi"]
|
[ext_resource type="Script" uid="uid://dxlwvwy3hj56x" path="res://scripts/components/LinearProjectile.cs" id="1_fkydi"]
|
||||||
[ext_resource type="Resource" uid="uid://7uj0oe656jfx" path="res://resources/effects/SnowSlow.tres" id="2_fn62x"]
|
[ext_resource type="Resource" uid="uid://7uj0oe656jfx" path="res://resources/effects/SnowSlow.tres" id="2_fn62x"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dn4l67snkx5mr" path="res://assets/sprites/plants/snowpea_projectile.tres" id="2_xt8td"]
|
[ext_resource type="Texture2D" uid="uid://dn4l67snkx5mr" path="res://assets/sprites/plants/snowpea_projectile.tres" id="2_xt8td"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=10 format=3 uid="uid://c1335fke4thpm"]
|
[gd_scene load_steps=15 format=3 uid="uid://c1335fke4thpm"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bndu1h5kgcde8" path="res://scripts/components/level/RuntimeLevelData.cs" id="1_tnxdx"]
|
[ext_resource type="Script" uid="uid://bndu1h5kgcde8" path="res://scripts/components/level/RuntimeLevelData.cs" id="1_tnxdx"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/background_summer.png" id="1_vafkg"]
|
[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/background_summer.png" id="1_vafkg"]
|
||||||
|
|
@ -9,6 +9,23 @@
|
||||||
[ext_resource type="Script" uid="uid://cslqjdd5wq4rc" path="res://scripts/components/level/SunSpawner.cs" id="7_gnb05"]
|
[ext_resource type="Script" uid="uid://cslqjdd5wq4rc" path="res://scripts/components/level/SunSpawner.cs" id="7_gnb05"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="8_8nyym"]
|
[ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="8_8nyym"]
|
||||||
[ext_resource type="Script" uid="uid://bsuw5lvnr3kol" path="res://scripts/components/level/zombe_spawners/ZombieSequencer.cs" id="9_8nyym"]
|
[ext_resource type="Script" uid="uid://bsuw5lvnr3kol" path="res://scripts/components/level/zombe_spawners/ZombieSequencer.cs" id="9_8nyym"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://jm7wm08d2mi7" path="res://scenes/level components/right_boundary_marker.tscn" id="9_q2l3d"]
|
||||||
|
[ext_resource type="Script" uid="uid://nkb6i7lrkl8y" path="res://scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs" id="10_1kjp6"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://plc2gus4ppds" path="res://scenes/level components/left_boundary_marker.tscn" id="10_5h8lk"]
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_1kjp6"]
|
||||||
|
resource_name = "zombiePoints"
|
||||||
|
script/source = "extends Label
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
text = str(get_node(\"../SurvivalAI\").get(\"points\")) + \"\\n\" + str(get_node(\"../SurvivalAI\").time)
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_1kjp6"]
|
||||||
|
_limits = [0.0, 5.0, 0.0, 2000.0]
|
||||||
|
_data = [Vector2(0, 0), 0.0, 0.000634783, 0, 0, Vector2(19.8456, 0.0978518), 0.0, 0.0, 0, 0, Vector2(114.664, 0.12832), 0.0, 0.0, 0, 0, Vector2(213.892, 0.465625), 0.0017272, 0.00230293, 0, 0, Vector2(1499.45, 2.99414), 0.0, 0.00350837, 0, 0, Vector2(2000, 5), 0.00737658, 0.0, 0, 0]
|
||||||
|
point_count = 6
|
||||||
|
|
||||||
[node name="PrototypeSurvival" type="Node2D"]
|
[node name="PrototypeSurvival" type="Node2D"]
|
||||||
|
|
||||||
|
|
@ -21,6 +38,14 @@ position = Vector2(500, 200)
|
||||||
texture = ExtResource("1_vafkg")
|
texture = ExtResource("1_vafkg")
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
z_index = 3465
|
||||||
|
offset_left = 678.0
|
||||||
|
offset_top = 362.0
|
||||||
|
offset_right = 718.0
|
||||||
|
offset_bottom = 379.0
|
||||||
|
script = SubResource("GDScript_1kjp6")
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
position = Vector2(481, 200)
|
position = Vector2(481, 200)
|
||||||
metadata/_edit_lock_ = true
|
metadata/_edit_lock_ = true
|
||||||
|
|
@ -68,15 +93,42 @@ script = ExtResource("7_gnb05")
|
||||||
SunScene = ExtResource("8_8nyym")
|
SunScene = ExtResource("8_8nyym")
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="SunSpawner"]
|
[node name="Timer" type="Timer" parent="SunSpawner"]
|
||||||
wait_time = 15.0
|
wait_time = 10.0
|
||||||
|
autostart = true
|
||||||
|
|
||||||
[node name="ZombieSequencer" type="Node2D" parent="."]
|
[node name="right_boundary_marker" parent="." instance=ExtResource("9_q2l3d")]
|
||||||
|
position = Vector2(755, 376)
|
||||||
|
|
||||||
|
[node name="LeftBoundaryMarker" parent="." instance=ExtResource("10_5h8lk")]
|
||||||
|
position = Vector2(305, 76)
|
||||||
|
|
||||||
|
[node name="ZombieSequencer" type="Node2D" parent="." node_paths=PackedStringArray("spawnTimer", "waveTimer")]
|
||||||
position = Vector2(823, 0)
|
position = Vector2(823, 0)
|
||||||
script = ExtResource("9_8nyym")
|
script = ExtResource("9_8nyym")
|
||||||
|
spawnTimer = NodePath("Timer")
|
||||||
|
waveTimer = NodePath("../SurvivalAI/Timer")
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="ZombieSequencer"]
|
[node name="Timer" type="Timer" parent="ZombieSequencer"]
|
||||||
wait_time = 5.0
|
wait_time = 2.5
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[node name="SurvivalAI" type="Node" parent="."]
|
||||||
|
script = ExtResource("10_1kjp6")
|
||||||
|
supportPool = Array[String](["hobo"])
|
||||||
|
tankPool = Array[String](["conehead", "buckethead", "hobo"])
|
||||||
|
hordePool = Array[String](["basic", "conehead", "buckethead"])
|
||||||
|
velocity_curve = SubResource("Curve_1kjp6")
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="SurvivalAI"]
|
||||||
|
wait_time = 10.0
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="SurvivalAI/Timer"]
|
||||||
|
wait_time = 20.0
|
||||||
|
one_shot = true
|
||||||
autostart = true
|
autostart = true
|
||||||
|
|
||||||
[connection signal="timeout" from="SunSpawner/Timer" to="SunSpawner" method="Spawn"]
|
[connection signal="timeout" from="SunSpawner/Timer" to="SunSpawner" method="Spawn"]
|
||||||
[connection signal="timeout" from="ZombieSequencer/Timer" to="ZombieSequencer" method="FormSquad"]
|
[connection signal="timeout" from="ZombieSequencer/Timer" to="ZombieSequencer" method="FormSquad"]
|
||||||
|
[connection signal="timeout" from="SurvivalAI/Timer" to="SurvivalAI" method="SummonWave"]
|
||||||
|
[connection signal="timeout" from="SurvivalAI/Timer/Timer" to="SurvivalAI" method="SummonWave"]
|
||||||
|
[connection signal="timeout" from="SurvivalAI/Timer/Timer" to="SurvivalAI/Timer" method="start"]
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public partial class DebugZombieSpawner : PopupPanel
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ZombieSequencer.Instance.DebugClearQueue();
|
||||||
for(int i = 0; i < spin.Value; i++)
|
for(int i = 0; i < spin.Value; i++)
|
||||||
{
|
{
|
||||||
ZombieSequencer.Instance.Add(variants[0]);
|
ZombieSequencer.Instance.Add(variants[0]);
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ public class Utility
|
||||||
public const int TileWidth = 50;
|
public const int TileWidth = 50;
|
||||||
public const int TileHeight = 60;
|
public const int TileHeight = 60;
|
||||||
public const int LayersCount = 3;
|
public const int LayersCount = 3;
|
||||||
public static readonly Vector2I LeftFieldBoundary = new(305,76);
|
public static Vector2I LeftFieldBoundary = new(305,76);
|
||||||
public static readonly Vector2I RightFieldBoundary = new(755,376);
|
public static Vector2I RightFieldBoundary = new(755,376);
|
||||||
public static readonly Vector2 Tile = new(TileWidth, TileHeight);
|
public static readonly Vector2 Tile = new(TileWidth, TileHeight);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@ public partial class Previewport : SubViewport
|
||||||
{
|
{
|
||||||
private RuntimePlantData current_display;
|
private RuntimePlantData current_display;
|
||||||
|
|
||||||
|
[Export] private Label title;
|
||||||
|
[Export] private Label description;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
GetParent().GetViewport().GuiFocusChanged += OnFocusChanged;
|
GetParent().GetViewport().GuiFocusChanged += OnFocusChanged;
|
||||||
|
|
@ -28,6 +31,8 @@ public partial class Previewport : SubViewport
|
||||||
current_display.QueueFree();
|
current_display.QueueFree();
|
||||||
}
|
}
|
||||||
current_display = resource.Scene.Instantiate<RuntimePlantData>();
|
current_display = resource.Scene.Instantiate<RuntimePlantData>();
|
||||||
|
title.Text = resource.display_name;
|
||||||
|
description.Text = resource.display_description;
|
||||||
AddChild(current_display);
|
AddChild(current_display);
|
||||||
current_display.DisableBrain();
|
current_display.DisableBrain();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
scripts/components/level/LeftBoundaryMarker.cs
Normal file
12
scripts/components/level/LeftBoundaryMarker.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using Godot;
|
||||||
|
using Newlon;
|
||||||
|
|
||||||
|
public partial class LeftBoundaryMarker : Marker2D
|
||||||
|
{
|
||||||
|
public override void _Ready()
|
||||||
|
{
|
||||||
|
Utility.LeftFieldBoundary = (Vector2I)GlobalPosition;
|
||||||
|
QueueFree();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
1
scripts/components/level/LeftBoundaryMarker.cs.uid
Normal file
1
scripts/components/level/LeftBoundaryMarker.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://d2dq6f0bk7pfx
|
||||||
12
scripts/components/level/RightBoundaryMarker.cs
Normal file
12
scripts/components/level/RightBoundaryMarker.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
using Godot;
|
||||||
|
using Newlon;
|
||||||
|
|
||||||
|
public partial class RightBoundaryMarker : Marker2D
|
||||||
|
{
|
||||||
|
public override void _Ready()
|
||||||
|
{
|
||||||
|
Utility.RightFieldBoundary = (Vector2I)GlobalPosition;
|
||||||
|
QueueFree();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
1
scripts/components/level/RightBoundaryMarker.cs.uid
Normal file
1
scripts/components/level/RightBoundaryMarker.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bymylx25skfot
|
||||||
170
scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs
Normal file
170
scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs
Normal file
|
|
@ -0,0 +1,170 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Godot;
|
||||||
|
using Godot.Collections;
|
||||||
|
|
||||||
|
public partial class SurvivalZombieSpawner : Node
|
||||||
|
{
|
||||||
|
// Zombie pools
|
||||||
|
// Points from pools go in that order: support -> tank -> horde -> bank
|
||||||
|
// Horde pool is allowed to shrink during runtime
|
||||||
|
[Export] private Array<string> supportPool;
|
||||||
|
[Export] private Array<string> tankPool;
|
||||||
|
[Export] private Array<string> hordePool;
|
||||||
|
|
||||||
|
private List<ZombieResource> cachedSupportPool;
|
||||||
|
private List<ZombieResource> cachedTankPool;
|
||||||
|
private List<ZombieResource> cachedHordePool;
|
||||||
|
|
||||||
|
private float minSupportPoints;
|
||||||
|
private float minTankPoints;
|
||||||
|
private float minHordePoints;
|
||||||
|
|
||||||
|
[Export] private float points = 0;
|
||||||
|
[Export] private float huge_wave_points;
|
||||||
|
[Export] private Curve velocity_curve;
|
||||||
|
private float velocity = 0;
|
||||||
|
[Export] private double time = 0.0;
|
||||||
|
private float fin_a;
|
||||||
|
private RandomNumberGenerator rng = new();
|
||||||
|
|
||||||
|
|
||||||
|
public override void _Ready()
|
||||||
|
{
|
||||||
|
rng.Randomize();
|
||||||
|
|
||||||
|
cachedSupportPool = LoadFromRegistry(supportPool);
|
||||||
|
cachedTankPool = LoadFromRegistry(tankPool);
|
||||||
|
cachedHordePool = LoadFromRegistry(hordePool);
|
||||||
|
|
||||||
|
cachedTankPool.Sort((x, y) =>
|
||||||
|
{
|
||||||
|
return (int)(x.cost - y.cost);
|
||||||
|
});
|
||||||
|
cachedHordePool.Sort((x, y) =>
|
||||||
|
{
|
||||||
|
return (int)(x.cost - y.cost);
|
||||||
|
});
|
||||||
|
|
||||||
|
minSupportPoints = cachedSupportPool[0].cost;
|
||||||
|
minTankPoints = cachedTankPool[0].cost;
|
||||||
|
minHordePoints = cachedHordePool[0].cost;
|
||||||
|
|
||||||
|
fin_a = (velocity_curve.Sample(velocity_curve.MaxDomain) - velocity_curve.Sample(velocity_curve.MaxDomain - 0.001f)) / 0.001f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void _Process(double delta)
|
||||||
|
{
|
||||||
|
points += velocity * (float)delta;
|
||||||
|
|
||||||
|
if (time > velocity_curve.MaxDomain)
|
||||||
|
{
|
||||||
|
velocity += fin_a * (float)delta;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
velocity = velocity_curve.Sample((float)time);
|
||||||
|
}
|
||||||
|
time += delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SummonWave()
|
||||||
|
{
|
||||||
|
bool big_wave = false;
|
||||||
|
if ((int)time % 300 == 0)
|
||||||
|
{
|
||||||
|
points += velocity/velocity_curve.Sample((float)time)*huge_wave_points;
|
||||||
|
big_wave = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
float support_points = points * 0.2f;
|
||||||
|
float tank_points = points * 0.5f;
|
||||||
|
float horde_points = points * 0.3f;
|
||||||
|
points = 0;
|
||||||
|
|
||||||
|
List<ZombieResource> wave = [];
|
||||||
|
var remaining = SummonTank(tank_points, wave);
|
||||||
|
support_points += remaining * 0.8f;
|
||||||
|
horde_points += remaining * 0.2f;
|
||||||
|
horde_points += SummonSupport(support_points, wave);
|
||||||
|
points += SummonHorde(horde_points, wave, big_wave);
|
||||||
|
|
||||||
|
wave.Sort((x, y) => { return rng.RandiRange(-1, 1); });
|
||||||
|
|
||||||
|
foreach (var zom in wave)
|
||||||
|
{
|
||||||
|
ZombieSequencer.Instance.Add(zom.internal_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
big_wave = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float SummonSupport(float given_points, List<ZombieResource> wave)
|
||||||
|
{
|
||||||
|
if (cachedSupportPool.Count == 0)
|
||||||
|
{
|
||||||
|
return given_points;
|
||||||
|
}
|
||||||
|
while (given_points >= minSupportPoints)
|
||||||
|
{
|
||||||
|
var chosen_zombie = cachedSupportPool[rng.RandiRange(0, cachedSupportPool.Count - 1)];
|
||||||
|
if (given_points - chosen_zombie.cost >= 0)
|
||||||
|
{
|
||||||
|
wave.Add(chosen_zombie);
|
||||||
|
given_points -= chosen_zombie.cost;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return given_points;
|
||||||
|
}
|
||||||
|
private float SummonTank(float given_points, List<ZombieResource> wave)
|
||||||
|
{
|
||||||
|
if (cachedTankPool.Count == 0)
|
||||||
|
{
|
||||||
|
return given_points;
|
||||||
|
}
|
||||||
|
int zombieIndex = cachedTankPool.Count - 1;
|
||||||
|
while (given_points >= minSupportPoints && zombieIndex > -1)
|
||||||
|
{
|
||||||
|
if (cachedTankPool[zombieIndex].cost > given_points)
|
||||||
|
{
|
||||||
|
zombieIndex--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var chosen_zombie = cachedTankPool[zombieIndex];
|
||||||
|
wave.Add(chosen_zombie);
|
||||||
|
given_points -= chosen_zombie.cost;
|
||||||
|
}
|
||||||
|
return given_points;
|
||||||
|
}
|
||||||
|
private float SummonHorde(float given_points, List<ZombieResource> wave, bool is_big)
|
||||||
|
{
|
||||||
|
if (cachedHordePool.Count == 0)
|
||||||
|
{
|
||||||
|
return given_points;
|
||||||
|
}
|
||||||
|
while (is_big == false && cachedHordePool.Count > 1 && cachedHordePool[1].cost * 15 <= given_points)
|
||||||
|
{
|
||||||
|
cachedHordePool.RemoveAt(0);
|
||||||
|
minHordePoints = cachedHordePool[0].cost;
|
||||||
|
}
|
||||||
|
while (given_points >= minHordePoints)
|
||||||
|
{
|
||||||
|
var chosen_zombie = cachedHordePool[rng.RandiRange(0, cachedHordePool.Count - 1)];
|
||||||
|
if (given_points - chosen_zombie.cost >= 0)
|
||||||
|
{
|
||||||
|
wave.Add(chosen_zombie);
|
||||||
|
given_points -= chosen_zombie.cost;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return given_points;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<ZombieResource> LoadFromRegistry(Array<string> pool)
|
||||||
|
{
|
||||||
|
List<ZombieResource> list = [];
|
||||||
|
foreach (var res in pool)
|
||||||
|
{
|
||||||
|
list.Add(GameRegistry.GetZombieByName(res));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://nkb6i7lrkl8y
|
||||||
|
|
@ -9,11 +9,18 @@ public partial class ZombieSequencer : Node2D
|
||||||
public static ZombieSequencer Instance { get; private set; }
|
public static ZombieSequencer Instance { get; private set; }
|
||||||
private Queue<string> queue = [];
|
private Queue<string> queue = [];
|
||||||
private RandomNumberGenerator rng = new();
|
private RandomNumberGenerator rng = new();
|
||||||
|
private bool turbo = false;
|
||||||
|
|
||||||
|
[Export] private Timer spawnTimer;
|
||||||
|
[Export] private Timer waveTimer;
|
||||||
|
|
||||||
|
private double startSpawnTime;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
rng.Randomize();
|
rng.Randomize();
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
startSpawnTime = spawnTimer.WaitTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -44,7 +51,8 @@ public partial class ZombieSequencer : Node2D
|
||||||
|
|
||||||
foreach (int lane in list)
|
foreach (int lane in list)
|
||||||
{
|
{
|
||||||
Spawn(queue.Dequeue(), lane);
|
if (queue.Count > 0)
|
||||||
|
Spawn(queue.Dequeue(), lane);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,11 +61,30 @@ public partial class ZombieSequencer : Node2D
|
||||||
RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).scene.Instantiate<RuntimeZombieData>();
|
RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).scene.Instantiate<RuntimeZombieData>();
|
||||||
PoolContainer.Instance.Zombies.AddChild(zombie);
|
PoolContainer.Instance.Zombies.AddChild(zombie);
|
||||||
|
|
||||||
zombie.GlobalPosition = new Vector2(GlobalPosition.X, Utility.RightFieldBoundary.Y - (lane-1) * Utility.TileHeight);
|
zombie.GlobalPosition = new Vector2(GlobalPosition.X, Utility.RightFieldBoundary.Y - (lane - 1) * Utility.TileHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Add(string id)
|
public void Add(string id)
|
||||||
{
|
{
|
||||||
queue.Enqueue(id);
|
queue.Enqueue(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void _Process(double delta)
|
||||||
|
{
|
||||||
|
if (turbo == false && queue.Count > waveTimer.WaitTime / startSpawnTime * 5.0)
|
||||||
|
{
|
||||||
|
spawnTimer.WaitTime = waveTimer.WaitTime / queue.Count;
|
||||||
|
turbo = true;
|
||||||
|
}
|
||||||
|
else if(turbo && queue.Count == 0)
|
||||||
|
{
|
||||||
|
spawnTimer.WaitTime = startSpawnTime;
|
||||||
|
turbo = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DebugClearQueue()
|
||||||
|
{
|
||||||
|
queue.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ public partial class PlantEyesightLimiter : CollisionShape2D
|
||||||
{
|
{
|
||||||
if (Shape is SegmentShape2D segment)
|
if (Shape is SegmentShape2D segment)
|
||||||
{
|
{
|
||||||
segment.B = new Vector2(Utility.RightFieldBoundary.X-GlobalPosition.X, 0);
|
segment.B = new Vector2(Utility.RightFieldBoundary.X - GlobalPosition.X, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ public partial class SunflowerBehaviour : Node
|
||||||
|
|
||||||
public void Timeout()
|
public void Timeout()
|
||||||
{
|
{
|
||||||
_tree.Set("parameters/conditions/produce",true);
|
_tree.Set("parameters/conditions/produce", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ public partial class EatBox : Area2D
|
||||||
{
|
{
|
||||||
// Rewrite this class completely when field system will be introduced.
|
// Rewrite this class completely when field system will be introduced.
|
||||||
|
|
||||||
[Export] private FloatModifiers _damage;
|
[Export] public FloatModifiers _damage;
|
||||||
private RuntimePlantData plant;
|
private RuntimePlantData plant;
|
||||||
|
|
||||||
public bool isEating = false;
|
public bool isEating = false;
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,15 @@ public partial class ZombieMover : Node
|
||||||
{
|
{
|
||||||
[Export]
|
[Export]
|
||||||
private FloatModifiers _speed;
|
private FloatModifiers _speed;
|
||||||
|
[Export]
|
||||||
|
private float _speedControlMult;
|
||||||
private Node2D _zombie;
|
private Node2D _zombie;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
_zombie = GetParent<Node2D>();
|
_zombie = GetParent<Node2D>();
|
||||||
_speed = (FloatModifiers)_speed.Duplicate();
|
_speed = (FloatModifiers)_speed.Duplicate();
|
||||||
|
_speed.ChangePercentage((float)GD.RandRange(-0.05,0.05));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void _PhysicsProcess(double delta)
|
public override void _PhysicsProcess(double delta)
|
||||||
|
|
@ -20,7 +23,8 @@ public partial class ZombieMover : Node
|
||||||
* (float)delta
|
* (float)delta
|
||||||
* Utility.TileWidth
|
* Utility.TileWidth
|
||||||
* GetParent<RuntimeZombieData>().LocalTimescale
|
* GetParent<RuntimeZombieData>().LocalTimescale
|
||||||
* _speed.GetValue();
|
* _speed.GetValue()
|
||||||
|
* _speedControlMult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSpeedFlat(float speed)
|
public void SetSpeedFlat(float speed)
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,6 @@ public partial class HoboBehaviour : Node
|
||||||
canDestroyed = true;
|
canDestroyed = true;
|
||||||
((AnimationNodeStateMachinePlayback)_animationTree.Get("parameters/playback")).Travel("hobo_zombie_can_destroy");
|
((AnimationNodeStateMachinePlayback)_animationTree.Get("parameters/playback")).Travel("hobo_zombie_can_destroy");
|
||||||
_animationTree.Set("parameters/eat_Tree/blend/blend_amount", 1.0);
|
_animationTree.Set("parameters/eat_Tree/blend/blend_amount", 1.0);
|
||||||
|
_eatBox._damage.SetMult(3.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,19 @@ namespace Newlon;
|
||||||
[GlobalClass]
|
[GlobalClass]
|
||||||
public partial class PlantResource : Resource
|
public partial class PlantResource : Resource
|
||||||
{
|
{
|
||||||
|
[Export] public string display_name;
|
||||||
|
[Export(PropertyHint.MultilineText)] public string display_description;
|
||||||
[Export]
|
[Export]
|
||||||
public int Cost;
|
public int Cost;
|
||||||
[Export]
|
[Export]
|
||||||
public PackedScene Scene;
|
public PackedScene Scene;
|
||||||
[Export]
|
[Export]
|
||||||
public float ReloadTime;
|
public float ReloadTime;
|
||||||
[Export(PropertyHint.Range,"0,1,0.01")]
|
[Export(PropertyHint.Range, "0,1,0.01")]
|
||||||
public float ReloadProgress;
|
public float ReloadProgress;
|
||||||
[Export]
|
[Export]
|
||||||
public Texture2D Preview;
|
public Texture2D Preview;
|
||||||
[Export] public int Layer = 1;
|
[Export] public int Layer = 1;
|
||||||
|
|
||||||
|
public string internal_id;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ using Godot;
|
||||||
[GlobalClass]
|
[GlobalClass]
|
||||||
public partial class ZombieResource : Resource
|
public partial class ZombieResource : Resource
|
||||||
{
|
{
|
||||||
[Export] public int cost;
|
[Export] public float cost;
|
||||||
[Export] public PackedScene scene;
|
[Export] public PackedScene scene;
|
||||||
|
|
||||||
|
public string internal_id;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,11 @@ public partial class GameRegistry : Node
|
||||||
private const string PLANT_RESOURCE_PATH = "res://resources/plants/";
|
private const string PLANT_RESOURCE_PATH = "res://resources/plants/";
|
||||||
private const string ZOMBIE_RESOURCE_PATH = "res://resources/zombies/";
|
private const string ZOMBIE_RESOURCE_PATH = "res://resources/zombies/";
|
||||||
public static GameRegistry Instance { get; private set; }
|
public static GameRegistry Instance { get; private set; }
|
||||||
private Dictionary<string, PlantResource> PlantDictionary = [];
|
public static readonly Dictionary<string, PlantResource> PlantDictionary = [];
|
||||||
private Dictionary<string, ZombieResource> ZombieDictionary = [];
|
public static readonly Dictionary<string, ZombieResource> ZombieDictionary = [];
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
Instance = this;
|
|
||||||
|
|
||||||
//Plant init
|
//Plant init
|
||||||
string[] plantFiles = DirAccess.GetFilesAt(PLANT_RESOURCE_PATH);
|
string[] plantFiles = DirAccess.GetFilesAt(PLANT_RESOURCE_PATH);
|
||||||
|
|
||||||
|
|
@ -22,6 +20,7 @@ public partial class GameRegistry : Node
|
||||||
if (ResourceLoader.Exists(PLANT_RESOURCE_PATH + file))
|
if (ResourceLoader.Exists(PLANT_RESOURCE_PATH + file))
|
||||||
{
|
{
|
||||||
var plant = ResourceLoader.Load<PlantResource>(PLANT_RESOURCE_PATH + file);
|
var plant = ResourceLoader.Load<PlantResource>(PLANT_RESOURCE_PATH + file);
|
||||||
|
plant.internal_id = file.ToLower().Split('.')[0];
|
||||||
PlantDictionary.Add(file.ToLower().Split('.')[0], plant);
|
PlantDictionary.Add(file.ToLower().Split('.')[0], plant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -34,6 +33,7 @@ public partial class GameRegistry : Node
|
||||||
if (ResourceLoader.Exists(ZOMBIE_RESOURCE_PATH + file))
|
if (ResourceLoader.Exists(ZOMBIE_RESOURCE_PATH + file))
|
||||||
{
|
{
|
||||||
var zombie = ResourceLoader.Load<ZombieResource>(ZOMBIE_RESOURCE_PATH + file);
|
var zombie = ResourceLoader.Load<ZombieResource>(ZOMBIE_RESOURCE_PATH + file);
|
||||||
|
zombie.internal_id = file.ToLower().Split('.')[0];
|
||||||
ZombieDictionary.Add(file.ToLower().Split('.')[0], zombie);
|
ZombieDictionary.Add(file.ToLower().Split('.')[0], zombie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -41,13 +41,13 @@ public partial class GameRegistry : Node
|
||||||
|
|
||||||
public static PlantResource GetPlantByName(string name)
|
public static PlantResource GetPlantByName(string name)
|
||||||
{
|
{
|
||||||
if (Instance.PlantDictionary.ContainsKey(name) == false) return null;
|
if (PlantDictionary.ContainsKey(name) == false) return null;
|
||||||
return Instance.PlantDictionary[name];
|
return PlantDictionary[name];
|
||||||
}
|
}
|
||||||
public static List<string> GetPlantNames()
|
public static List<string> GetPlantNames()
|
||||||
{
|
{
|
||||||
List<string> result = [];
|
List<string> result = [];
|
||||||
foreach (var key in Instance.PlantDictionary.Keys)
|
foreach (var key in PlantDictionary.Keys)
|
||||||
{
|
{
|
||||||
result.Add(key);
|
result.Add(key);
|
||||||
}
|
}
|
||||||
|
|
@ -56,23 +56,26 @@ public partial class GameRegistry : Node
|
||||||
public static List<PlantResource> GetPlants()
|
public static List<PlantResource> GetPlants()
|
||||||
{
|
{
|
||||||
List<PlantResource> result = [];
|
List<PlantResource> result = [];
|
||||||
foreach (var value in Instance.PlantDictionary.Values)
|
foreach (var value in PlantDictionary.Values)
|
||||||
{
|
{
|
||||||
result.Add(value);
|
result.Add(value);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public static int GetPlantCount()
|
||||||
|
{
|
||||||
|
return PlantDictionary.Count;
|
||||||
|
}
|
||||||
|
|
||||||
public static ZombieResource GetZombieByName(string name)
|
public static ZombieResource GetZombieByName(string name)
|
||||||
{
|
{
|
||||||
if (Instance.ZombieDictionary.ContainsKey(name) == false) return null;
|
if (ZombieDictionary.ContainsKey(name) == false) return null;
|
||||||
return Instance.ZombieDictionary[name];
|
return ZombieDictionary[name];
|
||||||
}
|
}
|
||||||
public static List<string> GetZombieNames()
|
public static List<string> GetZombieNames()
|
||||||
{
|
{
|
||||||
List<string> result = [];
|
List<string> result = [];
|
||||||
foreach (var key in Instance.ZombieDictionary.Keys)
|
foreach (var key in ZombieDictionary.Keys)
|
||||||
{
|
{
|
||||||
result.Add(key);
|
result.Add(key);
|
||||||
}
|
}
|
||||||
|
|
@ -81,11 +84,16 @@ public partial class GameRegistry : Node
|
||||||
public static List<ZombieResource> GetZombies()
|
public static List<ZombieResource> GetZombies()
|
||||||
{
|
{
|
||||||
List<ZombieResource> result = [];
|
List<ZombieResource> result = [];
|
||||||
foreach (var value in Instance.ZombieDictionary.Values)
|
foreach (var value in ZombieDictionary.Values)
|
||||||
{
|
{
|
||||||
result.Add(value);
|
result.Add(value);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int GetZombieCount()
|
||||||
|
{
|
||||||
|
return ZombieDictionary.Count;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue