diff --git a/addons/pvzadventure/AdventureLevelResource.cs b/addons/pvzadventure/AdventureLevelResource.cs index c228916..7f712b4 100644 --- a/addons/pvzadventure/AdventureLevelResource.cs +++ b/addons/pvzadventure/AdventureLevelResource.cs @@ -1,5 +1,6 @@ using Godot; using Godot.Collections; +using Newlon.Resources; [GlobalClass] [Tool] diff --git a/addons/pvzadventure/RowSpawn.cs b/addons/pvzadventure/RowSpawn.cs index 0ba3e96..90cade3 100644 --- a/addons/pvzadventure/RowSpawn.cs +++ b/addons/pvzadventure/RowSpawn.cs @@ -1,5 +1,6 @@ using Godot; using Godot.Collections; +using Newlon.Resources; [Tool] [GlobalClass] diff --git a/addons/pvzadventure/scripts/ZE_AssetBrowser.cs b/addons/pvzadventure/scripts/ZE_AssetBrowser.cs index 16cf34f..3b69e1d 100644 --- a/addons/pvzadventure/scripts/ZE_AssetBrowser.cs +++ b/addons/pvzadventure/scripts/ZE_AssetBrowser.cs @@ -1,4 +1,5 @@ using Godot; +using Newlon.Resources; [Tool] diff --git a/addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs b/addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs index c306323..0405c3e 100644 --- a/addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs +++ b/addons/pvzadventure/scripts/ZE_AssetBrowserButton.cs @@ -1,4 +1,6 @@ using Godot; +using Newlon.Resources; + [Tool] public partial class ZE_AssetBrowserButton : PanelContainer diff --git a/addons/pvzadventure/scripts/ZE_GridItem.cs b/addons/pvzadventure/scripts/ZE_GridItem.cs index 557a73e..26fbc95 100644 --- a/addons/pvzadventure/scripts/ZE_GridItem.cs +++ b/addons/pvzadventure/scripts/ZE_GridItem.cs @@ -1,4 +1,5 @@ using Godot; +using Newlon.Resources; [Tool] diff --git a/addons/pvzadventure/scripts/ZE_RowEditor.cs b/addons/pvzadventure/scripts/ZE_RowEditor.cs index dcdd97e..43c7b80 100644 --- a/addons/pvzadventure/scripts/ZE_RowEditor.cs +++ b/addons/pvzadventure/scripts/ZE_RowEditor.cs @@ -1,4 +1,6 @@ using Godot; +using Newlon.Resources; + [Tool] public partial class ZE_RowEditor : VBoxContainer diff --git a/assets/levels/balance_and_spawn_test.tres b/assets/levels/balance_and_spawn_test.tres index 67c67ec..5ff7aae 100644 --- a/assets/levels/balance_and_spawn_test.tres +++ b/assets/levels/balance_and_spawn_test.tres @@ -5,7 +5,7 @@ [ext_resource type="Script" uid="uid://cw7yc3i2lgcja" path="res://addons/pvzadventure/WaveEvent.cs" id="2_otfbt"] [ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="3_cugtx"] [ext_resource type="Script" uid="uid://dl12rj75tk2qi" path="res://addons/pvzadventure/RowSpawn.cs" id="4_y1e37"] -[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="5_uatri"] +[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/entities/ZombieResource.cs" id="5_uatri"] [ext_resource type="Resource" uid="uid://buvacn56kyy2p" path="res://assets/zombies/basic.tres" id="6_qsvr4"] [ext_resource type="Resource" uid="uid://nceohd32fkxk" path="res://assets/zombies/conehead.tres" id="7_qsvr4"] diff --git a/assets/levels/video_level.tres b/assets/levels/video_level.tres index bc6e646..e9942cd 100644 --- a/assets/levels/video_level.tres +++ b/assets/levels/video_level.tres @@ -5,7 +5,7 @@ [ext_resource type="Script" uid="uid://cw7yc3i2lgcja" path="res://addons/pvzadventure/WaveEvent.cs" id="3_icaa5"] [ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="4_kc7t2"] [ext_resource type="Script" uid="uid://dl12rj75tk2qi" path="res://addons/pvzadventure/RowSpawn.cs" id="5_66y5q"] -[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="6_66y5q"] +[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/entities/ZombieResource.cs" id="6_66y5q"] [ext_resource type="Resource" uid="uid://buvacn56kyy2p" path="res://assets/zombies/basic.tres" id="7_c21si"] [ext_resource type="Resource" uid="uid://nceohd32fkxk" path="res://assets/zombies/conehead.tres" id="8_c21si"] [ext_resource type="Resource" uid="uid://dkhjlu7u0vny6" path="res://assets/zombies/buckethead.tres" id="9_tuvrx"] diff --git a/assets/levels/win_test.tres b/assets/levels/win_test.tres index ee80513..7c662e7 100644 --- a/assets/levels/win_test.tres +++ b/assets/levels/win_test.tres @@ -5,7 +5,7 @@ [ext_resource type="Script" uid="uid://cw7yc3i2lgcja" path="res://addons/pvzadventure/WaveEvent.cs" id="2_pkoaj"] [ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="3_mtsmf"] [ext_resource type="Script" uid="uid://dl12rj75tk2qi" path="res://addons/pvzadventure/RowSpawn.cs" id="4_tpjav"] -[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="5_tpjav"] +[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/entities/ZombieResource.cs" id="5_tpjav"] [ext_resource type="Resource" uid="uid://buvacn56kyy2p" path="res://assets/zombies/basic.tres" id="6_swlbc"] [ext_resource type="Resource" uid="uid://nceohd32fkxk" path="res://assets/zombies/conehead.tres" id="7_swlbc"] diff --git a/assets/plants/Aloe.tres b/assets/plants/Aloe.tres index 1058daf..7805a86 100644 --- a/assets/plants/Aloe.tres +++ b/assets/plants/Aloe.tres @@ -1,13 +1,13 @@ [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="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_vw2kg"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_vw2kg"] [ext_resource type="PackedScene" uid="uid://bw1w8jp0yeypy" path="res://scenes/entities/plants/aloe.tscn" id="2_6a4ia"] [resource] script = ExtResource("1_vw2kg") -name_key = "aloe" -description_key = "aloe_desc" +NameKey = "aloe" +DescriptionKey = "aloe_desc" Cost = 75.0 Scene = ExtResource("2_6a4ia") ReloadTime = 15.0 diff --git a/assets/plants/Cucumber.tres b/assets/plants/Cucumber.tres index ba71dcf..0d0ac30 100644 --- a/assets/plants/Cucumber.tres +++ b/assets/plants/Cucumber.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="PlantResource" load_steps=5 format=3 uid="uid://ciewunnfalrbb"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_jrx81"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_jrx81"] [ext_resource type="Texture2D" uid="uid://bt76iudw2qgnv" path="res://assets/sprites/atlases/plants/cumbucer.png" id="1_tdg4d"] [ext_resource type="PackedScene" uid="uid://cjoyh54cpjla7" path="res://scenes/entities/plants/cucumber.tscn" id="2_0mr6r"] @@ -10,8 +10,8 @@ region = Rect2(2, 1, 41, 65) [resource] script = ExtResource("1_jrx81") -name_key = "cucumber" -description_key = "cucumber_desc" +NameKey = "cucumber" +DescriptionKey = "cucumber_desc" Cost = 75.0 Scene = ExtResource("2_0mr6r") ReloadTime = 5.0 diff --git a/assets/plants/Garlic.tres b/assets/plants/Garlic.tres index 0ad4a9a..ca8b342 100644 --- a/assets/plants/Garlic.tres +++ b/assets/plants/Garlic.tres @@ -1,13 +1,13 @@ [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="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_e15gf"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_e15gf"] [ext_resource type="PackedScene" uid="uid://qq0cw8xtcoj3" path="res://scenes/entities/plants/garlic.tscn" id="2_81n0p"] [resource] script = ExtResource("1_e15gf") -name_key = "garlic" -description_key = "garlic_desc" +NameKey = "garlic" +DescriptionKey = "garlic_desc" Cost = 50.0 Scene = ExtResource("2_81n0p") ReloadTime = 7.5 diff --git a/assets/plants/Nerdus.tres b/assets/plants/Nerdus.tres index 3f8c8a5..4af49e2 100644 --- a/assets/plants/Nerdus.tres +++ b/assets/plants/Nerdus.tres @@ -2,7 +2,7 @@ [ext_resource type="Texture2D" uid="uid://b06e8xhdy77d1" path="res://assets/sprites/atlases/plants/nerdus.png" id="1_of51r"] [ext_resource type="PackedScene" uid="uid://k5aj2slxar7w" path="res://scenes/entities/plants/nerdus.tscn" id="2_0i6qf"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="3_30qd0"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="3_30qd0"] [sub_resource type="AtlasTexture" id="AtlasTexture_ivp5w"] atlas = ExtResource("1_of51r") @@ -10,8 +10,8 @@ region = Rect2(477, 9, 60, 59) [resource] script = ExtResource("3_30qd0") -name_key = "nerdus" -description_key = "nerdus_desc" +NameKey = "nerdus" +DescriptionKey = "nerdus_desc" Cost = 125.0 Scene = ExtResource("2_0i6qf") ReloadTime = 10.0 diff --git a/assets/plants/Peashooter.tres b/assets/plants/Peashooter.tres index 1344b1f..4cc0bc6 100644 --- a/assets/plants/Peashooter.tres +++ b/assets/plants/Peashooter.tres @@ -1,13 +1,13 @@ [gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://c8rr1dc7mjr3d"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_amvh8"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_amvh8"] [ext_resource type="Texture2D" uid="uid://ot1n4nval86w" path="res://assets/sprites/plants/peashooter.tres" id="1_rnq6r"] [ext_resource type="PackedScene" uid="uid://dy41q1kxray5t" path="res://scenes/entities/plants/peashooter.tscn" id="1_rqf2x"] [resource] script = ExtResource("1_amvh8") -name_key = "peashooter" -description_key = "peashooter_desc" +NameKey = "peashooter" +DescriptionKey = "peashooter_desc" Cost = 75.0 Scene = ExtResource("1_rqf2x") ReloadTime = 5.0 diff --git a/assets/plants/PotatoMine.tres b/assets/plants/PotatoMine.tres index 6c6f453..0c1f22c 100644 --- a/assets/plants/PotatoMine.tres +++ b/assets/plants/PotatoMine.tres @@ -1,13 +1,13 @@ [gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://bu25xgjd68gv8"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_33j6b"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_33j6b"] [ext_resource type="Texture2D" uid="uid://bhmnt3x5aj1l8" path="res://assets/sprites/plants/potatomine.tres" id="1_xk2pg"] [ext_resource type="PackedScene" uid="uid://b5x35v3w2u8dx" path="res://scenes/entities/plants/potato_mine.tscn" id="2_ig2ti"] [resource] script = ExtResource("1_33j6b") -name_key = "potatomine" -description_key = "potatomine_desc" +NameKey = "potatomine" +DescriptionKey = "potatomine_desc" Cost = 25.0 Scene = ExtResource("2_ig2ti") ReloadTime = 25.0 diff --git a/assets/plants/Snowpea.tres b/assets/plants/Snowpea.tres index 51db90a..fb6203b 100644 --- a/assets/plants/Snowpea.tres +++ b/assets/plants/Snowpea.tres @@ -1,13 +1,13 @@ [gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://duflq3eexs6m"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_0cpi0"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/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="PackedScene" uid="uid://b7innrovtmf5u" path="res://scenes/entities/plants/snowpea.tscn" id="2_k47h0"] [resource] script = ExtResource("1_0cpi0") -name_key = "snowpea" -description_key = "snowpea_desc" +NameKey = "snowpea" +DescriptionKey = "snowpea_desc" Cost = 175.0 Scene = ExtResource("2_k47h0") ReloadTime = 5.0 diff --git a/assets/plants/Spikeweed.tres b/assets/plants/Spikeweed.tres index 977223b..e5953b5 100644 --- a/assets/plants/Spikeweed.tres +++ b/assets/plants/Spikeweed.tres @@ -1,13 +1,13 @@ [gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://cas11tg6chiu4"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_0bymo"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/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="PackedScene" uid="uid://bdhod5c6o53ha" path="res://scenes/entities/plants/spikeweed.tscn" id="2_iv8de"] [resource] script = ExtResource("1_0bymo") -name_key = "spikeweed" -description_key = "spikeweed_desc" +NameKey = "spikeweed" +DescriptionKey = "spikeweed_desc" Cost = 100.0 Scene = ExtResource("2_iv8de") ReloadTime = 5.0 diff --git a/assets/plants/Sunflower.tres b/assets/plants/Sunflower.tres index 5d05e64..6fdb68c 100644 --- a/assets/plants/Sunflower.tres +++ b/assets/plants/Sunflower.tres @@ -2,12 +2,12 @@ [ext_resource type="Texture2D" uid="uid://iw75j816gbc" path="res://assets/sprites/plants/sunflower.tres" id="1_8rd5i"] [ext_resource type="PackedScene" uid="uid://bg7lomiorxo2c" path="res://scenes/entities/plants/sunflower.tscn" id="2_gcyr5"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="3_vt4jc"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="3_vt4jc"] [resource] script = ExtResource("3_vt4jc") -name_key = "sunflower" -description_key = "sunflower_desc" +NameKey = "sunflower" +DescriptionKey = "sunflower_desc" Cost = 50.0 Scene = ExtResource("2_gcyr5") ReloadTime = 5.0 diff --git a/assets/plants/Threepeater.tres b/assets/plants/Threepeater.tres index d8f8fcb..575c299 100644 --- a/assets/plants/Threepeater.tres +++ b/assets/plants/Threepeater.tres @@ -2,12 +2,12 @@ [ext_resource type="Texture2D" uid="uid://8se1nscal0em" path="res://assets/sprites/plants/threepeater.tres" id="1_hinp6"] [ext_resource type="PackedScene" uid="uid://eegv1qihfv2q" path="res://scenes/entities/plants/threepeater.tscn" id="2_uqpu0"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="3_3lugi"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="3_3lugi"] [resource] script = ExtResource("3_3lugi") -name_key = "threepeater" -description_key = "threepeater_desc" +NameKey = "threepeater" +DescriptionKey = "threepeater_desc" Cost = 275.0 Scene = ExtResource("2_uqpu0") ReloadTime = 5.0 diff --git a/assets/plants/Wallnut.tres b/assets/plants/Wallnut.tres index ea3bcaa..9943152 100644 --- a/assets/plants/Wallnut.tres +++ b/assets/plants/Wallnut.tres @@ -1,13 +1,13 @@ [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="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_27l0t"] +[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_27l0t"] [ext_resource type="PackedScene" uid="uid://bq7imkpr2yqyr" path="res://scenes/entities/plants/wallnut.tscn" id="2_rkn3h"] [resource] script = ExtResource("1_27l0t") -name_key = "wallnut" -description_key = "wallnut_desc" +NameKey = "wallnut" +DescriptionKey = "wallnut_desc" Cost = 50.0 Scene = ExtResource("2_rkn3h") ReloadTime = 20.0 diff --git a/assets/zombies/basic.tres b/assets/zombies/basic.tres index 7239564..e508dcc 100644 --- a/assets/zombies/basic.tres +++ b/assets/zombies/basic.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="ZombieResource" load_steps=5 format=3 uid="uid://buvacn56kyy2p"] [ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_c2mq3"] -[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="1_k277m"] +[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/entities/ZombieResource.cs" id="1_k277m"] [ext_resource type="Texture2D" uid="uid://5gpf2sodhn6e" path="res://assets/sprites/zombies/previews.png" id="1_l6de4"] [sub_resource type="AtlasTexture" id="AtlasTexture_wu2q8"] @@ -10,8 +10,8 @@ region = Rect2(0, 0, 43, 88) [resource] script = ExtResource("1_k277m") -name_key = "basic" -description_key = "basic_desc" +NameKey = "basic" +DescriptionKey = "basic_desc" Cost = 1.0 Scene = ExtResource("1_c2mq3") ReloadTime = 1.0 diff --git a/assets/zombies/buckethead.tres b/assets/zombies/buckethead.tres index 02c4457..380c271 100644 --- a/assets/zombies/buckethead.tres +++ b/assets/zombies/buckethead.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="ZombieResource" load_steps=5 format=3 uid="uid://dkhjlu7u0vny6"] [ext_resource type="PackedScene" uid="uid://xu4i6tmkv00a" path="res://scenes/entities/Zombies/bucket_zombie.tscn" id="1_lhcag"] -[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="1_sngfh"] +[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/entities/ZombieResource.cs" id="1_sngfh"] [ext_resource type="Texture2D" uid="uid://5gpf2sodhn6e" path="res://assets/sprites/zombies/previews.png" id="1_ufs7s"] [sub_resource type="AtlasTexture" id="AtlasTexture_drksh"] @@ -10,8 +10,8 @@ region = Rect2(137, 0, 47, 101) [resource] script = ExtResource("1_sngfh") -name_key = "buckethead" -description_key = "buckethead_desc" +NameKey = "buckethead" +DescriptionKey = "buckethead_desc" Cost = 5.0 Scene = ExtResource("1_lhcag") ReloadTime = 1.0 diff --git a/assets/zombies/conehead.tres b/assets/zombies/conehead.tres index bbf134c..eca5d45 100644 --- a/assets/zombies/conehead.tres +++ b/assets/zombies/conehead.tres @@ -2,7 +2,7 @@ [ext_resource type="Texture2D" uid="uid://5gpf2sodhn6e" path="res://assets/sprites/zombies/previews.png" id="1_f7g7v"] [ext_resource type="PackedScene" uid="uid://hhjbqkjqpt7x" path="res://scenes/entities/Zombies/cone_zombie.tscn" id="1_llf5l"] -[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="1_sw7hj"] +[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/entities/ZombieResource.cs" id="1_sw7hj"] [sub_resource type="AtlasTexture" id="AtlasTexture_q44xp"] atlas = ExtResource("1_f7g7v") @@ -10,8 +10,8 @@ region = Rect2(92, 0, 45, 106) [resource] script = ExtResource("1_sw7hj") -name_key = "conehead" -description_key = "conehead_desc" +NameKey = "conehead" +DescriptionKey = "conehead_desc" Cost = 2.0 Scene = ExtResource("1_llf5l") ReloadTime = 1.0 diff --git a/assets/zombies/hobo.tres b/assets/zombies/hobo.tres index 38c432e..5f72aea 100644 --- a/assets/zombies/hobo.tres +++ b/assets/zombies/hobo.tres @@ -2,7 +2,7 @@ [ext_resource type="PackedScene" uid="uid://bgqmwsb6ynm81" path="res://scenes/entities/Zombies/hobo.tscn" id="1_4myt6"] [ext_resource type="Texture2D" uid="uid://5gpf2sodhn6e" path="res://assets/sprites/zombies/previews.png" id="1_nt7w3"] -[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="1_u5qpq"] +[ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/entities/ZombieResource.cs" id="1_u5qpq"] [sub_resource type="AtlasTexture" id="AtlasTexture_73ahc"] atlas = ExtResource("1_nt7w3") @@ -10,8 +10,8 @@ region = Rect2(43, 0, 49, 95) [resource] script = ExtResource("1_u5qpq") -name_key = "hobo" -description_key = "hobo_desc" +NameKey = "hobo" +DescriptionKey = "hobo_desc" Cost = 7.0 Scene = ExtResource("1_4myt6") ReloadTime = 1.0 diff --git a/scenes/sun.tscn b/scenes/sun.tscn index cd7a8c9..9b1fa01 100644 --- a/scenes/sun.tscn +++ b/scenes/sun.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=15 format=3 uid="uid://bpekho7leatr5"] [ext_resource type="Shader" uid="uid://bk8uy5se3fo0" path="res://assets/shaders/shared_outline.gdshader" id="1_jcu1f"] -[ext_resource type="Script" uid="uid://qgeovvluk8yj" path="res://scripts/Sun.cs" id="2_m8xcj"] +[ext_resource type="Script" uid="uid://qgeovvluk8yj" path="res://scripts/projectiles/Sun.cs" id="2_m8xcj"] [ext_resource type="Texture2D" uid="uid://bkmphus5wjadi" path="res://assets/sprites/atlases/sun_atlas.png" id="2_phn3y"] [ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="4_t1pnj"] [ext_resource type="AudioStream" uid="uid://c0cq80nvld37p" path="res://assets/audio/sfx/sun.mp3" id="5_i8fpp"] diff --git a/scripts/Cursor.cs b/scripts/Cursor.cs index 6d384bb..8d83fcf 100644 --- a/scripts/Cursor.cs +++ b/scripts/Cursor.cs @@ -1,5 +1,4 @@ using Godot; -using System; namespace Newlon; diff --git a/scripts/SaveSerializer.cs b/scripts/SaveSerializer.cs index 584b3bd..5a66922 100644 --- a/scripts/SaveSerializer.cs +++ b/scripts/SaveSerializer.cs @@ -1,9 +1,11 @@ using Godot; -using Godot.Collections; -using Newlon; + +using Newlon.Resources; using System.Text.Json; using System.Collections.Generic; +namespace Newlon; + public partial class SaveSerializer : Node { const string SAVE_PATH = "user://save.json"; @@ -24,21 +26,21 @@ public partial class SaveSerializer : Node public static void SaveGame() { var access = FileAccess.Open(SAVE_PATH, FileAccess.ModeFlags.Write); - var playerProgress = PlayerProgress.Instance; - var save = new SaveData - { + var playerProgress = PlayerProgress.Instance; + var save = new SaveData + { - SFXVolume = (float)Settings.SFX, - MusicVolume = (float)Settings.Music, - SplashSeen = Settings.Splash, - Money = playerProgress.Money, - SeedpacketSlots = playerProgress.MaxSeedpackets, - PlayerPlants = [], + SFXVolume = (float)Settings.SFX, + MusicVolume = (float)Settings.Music, + SplashSeen = Settings.Splash, + Money = playerProgress.Money, + SeedpacketSlots = playerProgress.MaxSeedpackets, + PlayerPlants = [], - SaveGameVersion = (string)ProjectSettings.GetSetting("application/config/version") - }; + SaveGameVersion = (string)ProjectSettings.GetSetting("application/config/version") + }; - foreach (var plant in playerProgress.PlayerPlants) + foreach (var plant in playerProgress.PlayerPlants) { save.PlayerPlants.Add(plant.internal_id); } diff --git a/scripts/droppable-items/DropMover.cs b/scripts/droppable-items/DropMover.cs index 12dbbdd..3b3d426 100644 --- a/scripts/droppable-items/DropMover.cs +++ b/scripts/droppable-items/DropMover.cs @@ -1,5 +1,7 @@ using Godot; +namespace Newlon.Components.Droppables; + public partial class DropMover : Node { public float ySpeed = -200.0f; @@ -16,7 +18,7 @@ public partial class DropMover : Node stop_y = ((parent.GlobalPosition / FieldParams.Tile).Ceil() * FieldParams.Tile).Y; gravity = (float)ProjectSettings.GetSetting("physics/2d/default_gravity"); - velocity = new Vector2((GD.Randf()-0.5f)*xSpeed,ySpeed); + velocity = new Vector2((GD.Randf() - 0.5f) * xSpeed, ySpeed); } public override void _Process(double delta) { @@ -25,6 +27,6 @@ public partial class DropMover : Node velocity += Vector2.Down * gravity * (float)delta; parent.GlobalPosition += velocity * (float)delta; - } + } } diff --git a/scripts/droppable-items/DroppableItem.cs b/scripts/droppable-items/DroppableItem.cs index 2281cfe..a79427c 100644 --- a/scripts/droppable-items/DroppableItem.cs +++ b/scripts/droppable-items/DroppableItem.cs @@ -1,5 +1,6 @@ using Godot; +namespace Newlon.Components.Droppables; [GlobalClass] public partial class DroppableItem : Area2D diff --git a/scripts/droppable-items/DroppableSeedpacket.cs b/scripts/droppable-items/DroppableSeedpacket.cs index acc952f..03f4938 100644 --- a/scripts/droppable-items/DroppableSeedpacket.cs +++ b/scripts/droppable-items/DroppableSeedpacket.cs @@ -1,5 +1,7 @@ using Godot; -using Newlon; +using Newlon.Resources; + +namespace Newlon.Components.Droppables; public partial class DroppableSeedpacket : DroppableItem { @@ -11,10 +13,10 @@ public partial class DroppableSeedpacket : DroppableItem { _cost.Text = plant.Cost.ToString(); _icon.Texture = plant.Preview; - if (plant.customFrame != null) + if (plant.CustomFrame != null) { - _packet.Texture = plant.customFrame.frame; - _cost.LabelSettings = plant.customFrame.font; + _packet.Texture = plant.CustomFrame.frame; + _cost.LabelSettings = plant.CustomFrame.font; } } } diff --git a/scripts/entities/plants/PlantSunSpawner.cs b/scripts/entities/plants/PlantSunSpawner.cs index 2cbefc5..76ea9b3 100644 --- a/scripts/entities/plants/PlantSunSpawner.cs +++ b/scripts/entities/plants/PlantSunSpawner.cs @@ -1,5 +1,7 @@ using Godot; +using Newlon.Projectiles; using Newlon.Components.Level; +using Newlon.Components.Droppables; namespace Newlon.Components.Plants; diff --git a/scripts/entities/plants/RuntimePlantData.cs b/scripts/entities/plants/RuntimePlantData.cs index d5b8b7b..dd0b42e 100644 --- a/scripts/entities/plants/RuntimePlantData.cs +++ b/scripts/entities/plants/RuntimePlantData.cs @@ -1,5 +1,6 @@ using Godot; using Newlon.Components.Level; +using Newlon.Resources; namespace Newlon.Components.Plants; diff --git a/scripts/gui/PlantHotbarSize.cs b/scripts/gui/PlantHotbarSize.cs index 61be9dc..d3ec72e 100644 --- a/scripts/gui/PlantHotbarSize.cs +++ b/scripts/gui/PlantHotbarSize.cs @@ -1,6 +1,6 @@ using Godot; using Newlon.Components.Level; -using System; +using Newlon; public partial class PlantHotbarSize : PanelContainer { diff --git a/scripts/gui/RewardScene.cs b/scripts/gui/RewardScene.cs index f359cd8..d6856a5 100644 --- a/scripts/gui/RewardScene.cs +++ b/scripts/gui/RewardScene.cs @@ -1,7 +1,7 @@ using Godot; using Newlon; using Newlon.Components; -using Newlon.Components.Plants; +using Newlon.Resources; public partial class RewardScene : Node { @@ -18,9 +18,9 @@ public partial class RewardScene : Node descriptionLabel.Text = Tr(reward.Description); continueButton.Pressed += LevelController.Instance.ReturnToInitiator; - if (reward is PlantReward plantReward && plantReward.Plant.customFrame != null) + if (reward is PlantReward plantReward && plantReward.Plant.CustomFrame != null) { - field.Texture = plantReward.Plant.customFrame.almanachField; + field.Texture = plantReward.Plant.CustomFrame.almanachField; } var rewardedObject = reward.GetPreview().Instantiate(); diff --git a/scripts/gui/ZombieLevelPreviewer.cs b/scripts/gui/ZombieLevelPreviewer.cs index 32eed45..35fd598 100644 --- a/scripts/gui/ZombieLevelPreviewer.cs +++ b/scripts/gui/ZombieLevelPreviewer.cs @@ -1,6 +1,7 @@ using Godot; using Newlon.Components.Zombies; using System.Collections.Generic; +using Newlon.Resources; namespace Newlon.Components.Level; diff --git a/scripts/gui/almanach/AlmanachGrid.cs b/scripts/gui/almanach/AlmanachGrid.cs index 4173054..eb54ae2 100644 --- a/scripts/gui/almanach/AlmanachGrid.cs +++ b/scripts/gui/almanach/AlmanachGrid.cs @@ -1,4 +1,5 @@ using Godot; +using Newlon; using Newlon.Components.GUI.Seedpackets; public partial class AlmanachGrid : GridContainer @@ -20,7 +21,7 @@ public partial class AlmanachGrid : GridContainer Seedpacket slot = _plantCard.Instantiate(); AddChild(slot); - slot.SetResource(resource); + slot.SetResource(resource.ToGridEntity()); slot.SetHandler(new AlmanachHandler(slot)); } } diff --git a/scripts/gui/choose_your_seeds/Previewport.cs b/scripts/gui/choose_your_seeds/Previewport.cs index ec162b7..126e791 100644 --- a/scripts/gui/choose_your_seeds/Previewport.cs +++ b/scripts/gui/choose_your_seeds/Previewport.cs @@ -33,15 +33,15 @@ public partial class Previewport : SubViewport { current_display.QueueFree(); } - if (resource.customFrame != null && resource.customFrame.almanachField != null) + if (resource.CustomFrame != null && resource.CustomFrame.almanachField != null) { - _frameField.Texture = resource.customFrame.almanachField; + _frameField.Texture = resource.CustomFrame.almanachField; } else _frameField.Texture = start_Field; current_display = resource.Scene.Instantiate(); - title.Text = Tr(resource.name_key); - description.Text = Tr("rwd_"+resource.name_key)+"\n"+ Tr(resource.description_key); + title.Text = Tr(resource.NameKey); + description.Text = Tr("rwd_"+resource.NameKey)+"\n"+ Tr(resource.DescriptionKey); AddChild(current_display); if (current_display is Entity entity) entity.DisableBrain(); diff --git a/scripts/gui/seedpackets/Seedpacket.cs b/scripts/gui/seedpackets/Seedpacket.cs index 98b37e3..e408f8c 100644 --- a/scripts/gui/seedpackets/Seedpacket.cs +++ b/scripts/gui/seedpackets/Seedpacket.cs @@ -1,4 +1,5 @@ using Godot; +using Newlon.Resources; namespace Newlon.Components.GUI.Seedpackets; @@ -8,7 +9,7 @@ public partial class Seedpacket : TextureButton public static AudioStream UntapStream = ResourceLoader.Load("res://assets/audio/gui/tap2.mp3"); public static AudioStream LiftStream = ResourceLoader.Load("res://assets/audio/gui/seedlift.mp3"); private const string PATH_TO_PACKED_SCENE = "res://scenes/gui/seedpacket.tscn"; - private EntityResource _resource; + private GridEntityResource _resource; private Label _cost; private TextureRect _icon; private Timer _timer; @@ -46,14 +47,14 @@ public partial class Seedpacket : TextureButton } if (_handler is ISeedpacketProcess processHandler) processHandler.Process(); } - public void SetResource(EntityResource resource) + public void SetResource(GridEntityResource resource) { _resource = resource; UpdateContents(); } - public EntityResource GetResource() + public GridEntityResource GetResource() { return _resource; } @@ -69,10 +70,10 @@ public partial class Seedpacket : TextureButton _cost.Text = _resource.Cost.ToString(); _icon.Texture = _resource.Preview; _timer.WaitTime = _resource.ReloadTime; - if (_resource.customFrame != null) + if (_resource.CustomFrame != null) { - TextureNormal = _resource.customFrame.frame; - _cost.LabelSettings = _resource.customFrame.font; + TextureNormal = _resource.CustomFrame.frame; + _cost.LabelSettings = _resource.CustomFrame.font; } } diff --git a/scripts/level/InitialPackedSceneSpawner.cs b/scripts/level/InitialPackedSceneSpawner.cs index 85480ac..98dad91 100644 --- a/scripts/level/InitialPackedSceneSpawner.cs +++ b/scripts/level/InitialPackedSceneSpawner.cs @@ -1,5 +1,6 @@ using Godot; using Newlon; +using Newlon.Resources; using Newlon.Components; using Newlon.Components.Level; using Newlon.Components.Plants; diff --git a/scripts/level/LevelController.cs b/scripts/level/LevelController.cs index 4c7705f..4b1091e 100644 --- a/scripts/level/LevelController.cs +++ b/scripts/level/LevelController.cs @@ -1,5 +1,6 @@ using Godot; using Newlon.Components.Level; +using Newlon.Resources; namespace Newlon; diff --git a/scripts/level/LevelRunner.cs b/scripts/level/LevelRunner.cs index 77fa28d..0f19293 100644 --- a/scripts/level/LevelRunner.cs +++ b/scripts/level/LevelRunner.cs @@ -1,6 +1,8 @@ using Godot; using Newlon.Components.Zombies; using System.Collections.Generic; +using Newlon.Resources; +using Newlon.Components.Droppables; namespace Newlon.Components.Level; diff --git a/scripts/level/PlantField.cs b/scripts/level/PlantField.cs index 20a2a6f..bd47041 100644 --- a/scripts/level/PlantField.cs +++ b/scripts/level/PlantField.cs @@ -1,18 +1,19 @@ using Godot; using Newlon.Components.GUI.Seedpackets; using Newlon.Components.Plants; +using Newlon.Resources; namespace Newlon.Components.Level; public partial class PlantField : Node2D { private Node2D _plantSetter; - private EntityResource _resource; + private GridEntityResource _resource; private Seedpacket _slot; private bool _previousCanPlace; private ChannelPlayer player; [Export] private PackedScene particles; - public static PlantField Instance {get; private set;} + public static PlantField Instance { get; private set; } public override void _Ready() { @@ -21,13 +22,13 @@ public partial class PlantField : Node2D player = GetNode("PlantPlayer"); } - public void SetPlant(Seedpacket slot, EntityResource resource) + public void SetPlant(Seedpacket slot, GridEntityResource resource) { _resource = resource; _slot = slot; if (resource == null) { - foreach(var child in _plantSetter.GetChildren()) + foreach (var child in _plantSetter.GetChildren()) child.QueueFree(); } else @@ -40,7 +41,7 @@ public partial class PlantField : Node2D public void ResetPlant() { - SetPlant(null,null); + SetPlant(null, null); } public override void _Process(double delta) @@ -99,7 +100,7 @@ public partial class PlantField : Node2D RuntimeLevelData.Instance.SpendSun((int)_resource.Cost); - PoolContainer.Instance.SpawnParticles(particles, plant.GlobalPosition + Vector2.Down * FieldParams.TileHeight/2.0f); + PoolContainer.Instance.SpawnParticles(particles, plant.GlobalPosition + Vector2.Down * FieldParams.TileHeight / 2.0f); player.Play(); diff --git a/scripts/level/PoolContainer.cs b/scripts/level/PoolContainer.cs index 18d6ff8..4be8269 100644 --- a/scripts/level/PoolContainer.cs +++ b/scripts/level/PoolContainer.cs @@ -1,5 +1,6 @@ using Godot; using System.Collections.Generic; +using Newlon.Particles; namespace Newlon.Components.Level; diff --git a/scripts/level/SunSpawner.cs b/scripts/level/SunSpawner.cs index f83b721..9398a0c 100644 --- a/scripts/level/SunSpawner.cs +++ b/scripts/level/SunSpawner.cs @@ -1,4 +1,5 @@ using Godot; +using Newlon.Projectiles; namespace Newlon.Components.Level; diff --git a/scripts/level/zombe_spawners/RowSpawner.cs b/scripts/level/zombe_spawners/RowSpawner.cs index 27699a6..d2be8b7 100644 --- a/scripts/level/zombe_spawners/RowSpawner.cs +++ b/scripts/level/zombe_spawners/RowSpawner.cs @@ -2,6 +2,7 @@ using Godot; using System.Collections.Generic; using Newlon.Components.Zombies; using Godot.Collections; +using Newlon.Resources; namespace Newlon.Components.Level; diff --git a/scripts/level/zombe_spawners/SurvivalZombieSpawner.cs b/scripts/level/zombe_spawners/SurvivalZombieSpawner.cs index f87cf55..b2af6a6 100644 --- a/scripts/level/zombe_spawners/SurvivalZombieSpawner.cs +++ b/scripts/level/zombe_spawners/SurvivalZombieSpawner.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using Godot; using Godot.Collections; +using Newlon; +using Newlon.Resources; public partial class SurvivalZombieSpawner : Node { diff --git a/scripts/particles/FallFloor.cs b/scripts/particles/FallFloor.cs index b562fc0..5f2850c 100644 --- a/scripts/particles/FallFloor.cs +++ b/scripts/particles/FallFloor.cs @@ -2,6 +2,8 @@ using System; using Godot; using Godot.Collections; +namespace Newlon.Particles; + public partial class FallFloor : Node2D { private static FallFloor Instance; diff --git a/scripts/particles/FallParticle.cs b/scripts/particles/FallParticle.cs index 0c71d23..f37b6eb 100644 --- a/scripts/particles/FallParticle.cs +++ b/scripts/particles/FallParticle.cs @@ -2,7 +2,7 @@ using Godot; using Newlon.Components.Level; using Newlon.Components.Zombies; -namespace Newlon.Components; +namespace Newlon.Particles; [GlobalClass] public partial class FallParticle : RigidBody2D diff --git a/scripts/particles/StandardParticles.cs b/scripts/particles/StandardParticles.cs index bad26a8..cb39b2d 100644 --- a/scripts/particles/StandardParticles.cs +++ b/scripts/particles/StandardParticles.cs @@ -1,5 +1,7 @@ using Godot; +namespace Newlon.Particles; + public partial class StandardParticles : Node2D { private int counter = 0; diff --git a/scripts/projectiles/IProjectile.cs b/scripts/projectiles/IProjectile.cs index 19b212c..f4044ac 100644 --- a/scripts/projectiles/IProjectile.cs +++ b/scripts/projectiles/IProjectile.cs @@ -1,4 +1,4 @@ -namespace Newlon.Components; +namespace Newlon.Projectiles; // // Base interface for entities diff --git a/scripts/projectiles/LinearProjectile.cs b/scripts/projectiles/LinearProjectile.cs index d1e88cb..1995751 100644 --- a/scripts/projectiles/LinearProjectile.cs +++ b/scripts/projectiles/LinearProjectile.cs @@ -1,8 +1,9 @@ using Godot; using Newlon.Components.Level; using Newlon.Systems.Effects; +using Newlon.Components; -namespace Newlon.Components; +namespace Newlon.Projectiles; // // Projectile that travels from left to right diff --git a/scripts/Sun.cs b/scripts/projectiles/Sun.cs similarity index 98% rename from scripts/Sun.cs rename to scripts/projectiles/Sun.cs index 9892ceb..c95b8a3 100644 --- a/scripts/Sun.cs +++ b/scripts/projectiles/Sun.cs @@ -3,7 +3,7 @@ using Newlon.Components.GUI; using Newlon.Components.Level; -namespace Newlon; +namespace Newlon.Projectiles; public partial class Sun : Area2D { diff --git a/scripts/Sun.cs.uid b/scripts/projectiles/Sun.cs.uid similarity index 100% rename from scripts/Sun.cs.uid rename to scripts/projectiles/Sun.cs.uid diff --git a/scripts/resources/EntityResource.cs b/scripts/resources/EntityResource.cs deleted file mode 100644 index 1e61f35..0000000 --- a/scripts/resources/EntityResource.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Godot; - -[Tool] -public partial class EntityResource : Resource -{ - [Export] public string name_key; - [Export] public string description_key; - [Export] - public float Cost; - [Export] - public PackedScene Scene; - [Export] - public float ReloadTime; - [Export(PropertyHint.Range, "0,1,0.01")] - public float ReloadProgress; - [Export] - public Texture2D Preview; - [Export] public CustomSeedpacketFrame customFrame; - [Export] public int Layer = 1; - [Export] public int Order = 0; - public string internal_id; -} diff --git a/scripts/resources/MoneyReward.cs b/scripts/resources/MoneyReward.cs index a87ca82..a9caf04 100644 --- a/scripts/resources/MoneyReward.cs +++ b/scripts/resources/MoneyReward.cs @@ -1,5 +1,7 @@ using Godot; +namespace Newlon.Resources; + [GlobalClass] [Tool] public partial class MoneyReward : RewardResource diff --git a/scripts/resources/PlantResource.cs b/scripts/resources/PlantResource.cs deleted file mode 100644 index b6923d6..0000000 --- a/scripts/resources/PlantResource.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Godot; - -namespace Newlon; - -[GlobalClass] -[Tool] -public partial class PlantResource : EntityResource -{ -} diff --git a/scripts/resources/PlantReward.cs b/scripts/resources/PlantReward.cs index 1ea5d19..0e05386 100644 --- a/scripts/resources/PlantReward.cs +++ b/scripts/resources/PlantReward.cs @@ -1,5 +1,6 @@ using Godot; -using Newlon; + +namespace Newlon.Resources; [GlobalClass] [Tool] diff --git a/scripts/resources/RewardResource.cs b/scripts/resources/RewardResource.cs index e1a4bbb..7c66816 100644 --- a/scripts/resources/RewardResource.cs +++ b/scripts/resources/RewardResource.cs @@ -1,5 +1,7 @@ using Godot; +namespace Newlon.Resources; + [GlobalClass] [Tool] public abstract partial class RewardResource : Resource diff --git a/scripts/resources/ZombieResource.cs b/scripts/resources/ZombieResource.cs deleted file mode 100644 index 29f8804..0000000 --- a/scripts/resources/ZombieResource.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Godot; - -[GlobalClass] -[Tool] -public partial class ZombieResource : EntityResource -{ -} diff --git a/scripts/resources/entities/EntityResource.cs b/scripts/resources/entities/EntityResource.cs new file mode 100644 index 0000000..bbd654d --- /dev/null +++ b/scripts/resources/entities/EntityResource.cs @@ -0,0 +1,16 @@ +using Godot; + +[Tool] +public partial class EntityResource : Resource +{ + [Export] public string NameKey; + [Export] public string DescriptionKey; + [Export] public float Cost; + [Export] public PackedScene Scene; + [Export] public float ReloadTime; + [Export(PropertyHint.Range, "0,1,0.01")] public float ReloadProgress; + [Export] public Texture2D Preview; + [Export] public CustomSeedpacketFrame CustomFrame; + [Export] public int Order = 0; + public string internal_id; +} diff --git a/scripts/resources/EntityResource.cs.uid b/scripts/resources/entities/EntityResource.cs.uid similarity index 100% rename from scripts/resources/EntityResource.cs.uid rename to scripts/resources/entities/EntityResource.cs.uid diff --git a/scripts/resources/entities/GridEntityResource.cs b/scripts/resources/entities/GridEntityResource.cs new file mode 100644 index 0000000..ae234e4 --- /dev/null +++ b/scripts/resources/entities/GridEntityResource.cs @@ -0,0 +1,11 @@ +using Godot; + +namespace Newlon.Resources; + +[GlobalClass] +[Tool] +public partial class GridEntityResource : EntityResource +{ + [Export] public int Layer = 1; + [Export] public bool DontRegister = false; +} diff --git a/scripts/resources/entities/GridEntityResource.cs.uid b/scripts/resources/entities/GridEntityResource.cs.uid new file mode 100644 index 0000000..525f3d8 --- /dev/null +++ b/scripts/resources/entities/GridEntityResource.cs.uid @@ -0,0 +1 @@ +uid://bwjyra0xvhde5 diff --git a/scripts/resources/entities/PlantResource.cs b/scripts/resources/entities/PlantResource.cs new file mode 100644 index 0000000..7cb7f24 --- /dev/null +++ b/scripts/resources/entities/PlantResource.cs @@ -0,0 +1,9 @@ +using Godot; + +namespace Newlon.Resources; + +[GlobalClass] +[Tool] +public partial class PlantResource : GridEntityResource +{ +} diff --git a/scripts/resources/PlantResource.cs.uid b/scripts/resources/entities/PlantResource.cs.uid similarity index 100% rename from scripts/resources/PlantResource.cs.uid rename to scripts/resources/entities/PlantResource.cs.uid diff --git a/scripts/resources/entities/ZombieResource.cs b/scripts/resources/entities/ZombieResource.cs new file mode 100644 index 0000000..1a2e934 --- /dev/null +++ b/scripts/resources/entities/ZombieResource.cs @@ -0,0 +1,28 @@ +using Godot; + +namespace Newlon.Resources; + +[GlobalClass] +[Tool] +public partial class ZombieResource : EntityResource +{ + public GridEntityResource ToGridEntity() + { + GridEntityResource result = new(); + + result.NameKey = NameKey; + result.DescriptionKey = DescriptionKey; + result.Cost = Cost; + result.Scene = Scene; + result.ReloadTime = ReloadTime; + result.ReloadProgress = ReloadProgress; + result.Preview = Preview; + result.CustomFrame = CustomFrame; + result.Order = Order; + + result.Layer = 1; + result.DontRegister = true; + + return result; + } +} diff --git a/scripts/resources/ZombieResource.cs.uid b/scripts/resources/entities/ZombieResource.cs.uid similarity index 100% rename from scripts/resources/ZombieResource.cs.uid rename to scripts/resources/entities/ZombieResource.cs.uid diff --git a/scripts/systems/GameRegistry.cs b/scripts/systems/GameRegistry.cs index f6dbc63..372af94 100644 --- a/scripts/systems/GameRegistry.cs +++ b/scripts/systems/GameRegistry.cs @@ -1,7 +1,9 @@ using Godot; -using Newlon; +using Newlon.Resources; using System.Collections.Generic; +namespace Newlon; + public partial class GameRegistry : Node { private const string PLANT_RESOURCE_PATH = "res://assets/plants/"; diff --git a/scripts/systems/static-data/FieldParams.cs b/scripts/systems/static-data/FieldParams.cs index 170681c..4eca66e 100644 --- a/scripts/systems/static-data/FieldParams.cs +++ b/scripts/systems/static-data/FieldParams.cs @@ -1,4 +1,7 @@ using Godot; + +namespace Newlon; + public class FieldParams { public const int TileWidth = 50; diff --git a/scripts/systems/static-data/PlayerProgress.cs b/scripts/systems/static-data/PlayerProgress.cs index a6306b8..989ca48 100644 --- a/scripts/systems/static-data/PlayerProgress.cs +++ b/scripts/systems/static-data/PlayerProgress.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using Godot; -using Newlon; +using Newlon.Resources; + +namespace Newlon; public partial class PlayerProgress : Node { diff --git a/scripts/systems/static-data/Settings.cs b/scripts/systems/static-data/Settings.cs index 43dd1d9..89343c4 100644 --- a/scripts/systems/static-data/Settings.cs +++ b/scripts/systems/static-data/Settings.cs @@ -1,5 +1,6 @@ using Godot; -using System; + +namespace Newlon; public partial class Settings : Node {