diff --git a/assets/sprites/atlases/almanach.png b/assets/sprites/atlases/almanach.png new file mode 100644 index 0000000..49c0ee1 Binary files /dev/null and b/assets/sprites/atlases/almanach.png differ diff --git a/assets/sprites/atlases/almanach.png.import b/assets/sprites/atlases/almanach.png.import new file mode 100644 index 0000000..dab95cb --- /dev/null +++ b/assets/sprites/atlases/almanach.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://do8e21lxo0xiu" +path="res://.godot/imported/almanach.png-1b0cb0349d268e403872b63f07361b9a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/atlases/almanach.png" +dest_files=["res://.godot/imported/almanach.png-1b0cb0349d268e403872b63f07361b9a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/sprites/atlases/atlas2.png b/assets/sprites/atlases/atlas2.png index fbc6272..9f5e8fe 100644 Binary files a/assets/sprites/atlases/atlas2.png and b/assets/sprites/atlases/atlas2.png differ diff --git a/assets/sprites/atlases/tile_animations.png b/assets/sprites/atlases/tile_animations.png new file mode 100644 index 0000000..3d0122c Binary files /dev/null and b/assets/sprites/atlases/tile_animations.png differ diff --git a/assets/sprites/atlases/tile_animations.png.import b/assets/sprites/atlases/tile_animations.png.import new file mode 100644 index 0000000..1bdcfcb --- /dev/null +++ b/assets/sprites/atlases/tile_animations.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://k60ylegy845j" +path="res://.godot/imported/tile_animations.png-ebed5638cb5445e829528a589cd85313.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/atlases/tile_animations.png" +dest_files=["res://.godot/imported/tile_animations.png-ebed5638cb5445e829528a589cd85313.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/sprites/gui/almanach/book.tres b/assets/sprites/gui/almanach/book.tres new file mode 100644 index 0000000..38c3363 --- /dev/null +++ b/assets/sprites/gui/almanach/book.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://drydueofrb448"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_hdhpm"] + +[resource] +atlas = ExtResource("1_hdhpm") +region = Rect2(95, 62, 27, 15) diff --git a/assets/sprites/gui/almanach/decrement.tres b/assets/sprites/gui/almanach/decrement.tres new file mode 100644 index 0000000..c68089f --- /dev/null +++ b/assets/sprites/gui/almanach/decrement.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://lg1o4pu0n0u6"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_dv0v8"] + +[resource] +atlas = ExtResource("1_dv0v8") +region = Rect2(130, 92, 15, 15) diff --git a/assets/sprites/gui/almanach/decrement_h.tres b/assets/sprites/gui/almanach/decrement_h.tres new file mode 100644 index 0000000..f566231 --- /dev/null +++ b/assets/sprites/gui/almanach/decrement_h.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cdyfech0howdr"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_ldu2x"] + +[resource] +atlas = ExtResource("1_ldu2x") +region = Rect2(130, 107, 15, 15) diff --git a/assets/sprites/gui/almanach/description_panel.tres b/assets/sprites/gui/almanach/description_panel.tres new file mode 100644 index 0000000..fa7498e --- /dev/null +++ b/assets/sprites/gui/almanach/description_panel.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://blr2uchlakvor"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_bs0nq"] + +[resource] +atlas = ExtResource("1_bs0nq") +region = Rect2(77, 0, 14, 12) diff --git a/assets/sprites/gui/almanach/field.tres b/assets/sprites/gui/almanach/field.tres new file mode 100644 index 0000000..04e5106 --- /dev/null +++ b/assets/sprites/gui/almanach/field.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dijnflg18vcny"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_uiurq"] + +[resource] +atlas = ExtResource("1_uiurq") +region = Rect2(0, 77, 65, 65) diff --git a/assets/sprites/gui/almanach/frame.tres b/assets/sprites/gui/almanach/frame.tres new file mode 100644 index 0000000..4a8d116 --- /dev/null +++ b/assets/sprites/gui/almanach/frame.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bq8n778sk4qnv"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_0oxph"] + +[resource] +atlas = ExtResource("1_0oxph") +region = Rect2(0, 0, 77, 77) diff --git a/assets/sprites/gui/almanach/holder.tres b/assets/sprites/gui/almanach/holder.tres new file mode 100644 index 0000000..f768670 --- /dev/null +++ b/assets/sprites/gui/almanach/holder.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dpfkai158kyfu"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_h0vdo"] + +[resource] +atlas = ExtResource("1_h0vdo") +region = Rect2(145, 78, 6, 14) diff --git a/assets/sprites/gui/almanach/increment.tres b/assets/sprites/gui/almanach/increment.tres new file mode 100644 index 0000000..f47bfb9 --- /dev/null +++ b/assets/sprites/gui/almanach/increment.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://vpuytn3nd6c1"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_6uq3c"] + +[resource] +atlas = ExtResource("1_6uq3c") +region = Rect2(145, 92, 15, 15) diff --git a/assets/sprites/gui/almanach/increment_h.tres b/assets/sprites/gui/almanach/increment_h.tres new file mode 100644 index 0000000..a62ae9d --- /dev/null +++ b/assets/sprites/gui/almanach/increment_h.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cnio0bw2xla23"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_ya6ma"] + +[resource] +atlas = ExtResource("1_ya6ma") +region = Rect2(145, 107, 15, 15) diff --git a/assets/sprites/gui/almanach/menu.tres b/assets/sprites/gui/almanach/menu.tres new file mode 100644 index 0000000..978a980 --- /dev/null +++ b/assets/sprites/gui/almanach/menu.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://4cdp0k17u2l5"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_vdcpr"] + +[resource] +atlas = ExtResource("1_vdcpr") +region = Rect2(152, 77, 4, 14) diff --git a/assets/sprites/gui/almanach/panel.tres b/assets/sprites/gui/almanach/panel.tres new file mode 100644 index 0000000..4cf5060 --- /dev/null +++ b/assets/sprites/gui/almanach/panel.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bpu36d1k7nhlr"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_ssf44"] + +[resource] +atlas = ExtResource("1_ssf44") +region = Rect2(77, 59, 18, 18) diff --git a/assets/sprites/gui/almanach/premium_field.tres b/assets/sprites/gui/almanach/premium_field.tres new file mode 100644 index 0000000..e90c63f --- /dev/null +++ b/assets/sprites/gui/almanach/premium_field.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dhf2opi0brx23"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_f4ggm"] + +[resource] +atlas = ExtResource("1_f4ggm") +region = Rect2(65, 77, 65, 65) diff --git a/assets/sprites/gui/almanach/slider.tres b/assets/sprites/gui/almanach/slider.tres new file mode 100644 index 0000000..f72040e --- /dev/null +++ b/assets/sprites/gui/almanach/slider.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bfvxhx5xfe3n8"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_bhmex"] + +[resource] +atlas = ExtResource("1_bhmex") +region = Rect2(77, 27, 15, 32) diff --git a/assets/sprites/gui/almanach/slider_bg.tres b/assets/sprites/gui/almanach/slider_bg.tres new file mode 100644 index 0000000..2ce91a3 --- /dev/null +++ b/assets/sprites/gui/almanach/slider_bg.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://drvrnblf2fvgk"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_o3v7f"] + +[resource] +atlas = ExtResource("1_o3v7f") +region = Rect2(77, 12, 15, 15) diff --git a/assets/sprites/gui/almanach/slider_h.tres b/assets/sprites/gui/almanach/slider_h.tres new file mode 100644 index 0000000..e4bcd8b --- /dev/null +++ b/assets/sprites/gui/almanach/slider_h.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cc8jaddr5lww3"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_q7xbj"] + +[resource] +atlas = ExtResource("1_q7xbj") +region = Rect2(136, 0, 32, 15) diff --git a/assets/sprites/gui/almanach/tab.tres b/assets/sprites/gui/almanach/tab.tres new file mode 100644 index 0000000..fbf3142 --- /dev/null +++ b/assets/sprites/gui/almanach/tab.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://2bk8ce82cmw"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_a3eui"] + +[resource] +atlas = ExtResource("1_a3eui") +region = Rect2(122, 65, 22, 12) diff --git a/assets/sprites/gui/almanach/tab_disabled.tres b/assets/sprites/gui/almanach/tab_disabled.tres new file mode 100644 index 0000000..13cf564 --- /dev/null +++ b/assets/sprites/gui/almanach/tab_disabled.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dssr8m4gbpks4"] + +[ext_resource type="Texture2D" uid="uid://do8e21lxo0xiu" path="res://assets/sprites/atlases/almanach.png" id="1_4d61d"] + +[resource] +atlas = ExtResource("1_4d61d") +region = Rect2(144, 65, 22, 12) diff --git a/project.godot b/project.godot index cf8af86..0ada405 100644 --- a/project.godot +++ b/project.godot @@ -82,6 +82,10 @@ cheat_zombie_spawn={ ] } +[internationalization] + +locale/translations=PackedStringArray("res://translations/plants.en.translation", "res://translations/plants.ru.translation", "res://translations/zombies.en.translation", "res://translations/zombies.ru.translation", "res://translations/gui.en.translation", "res://translations/gui.ru.translation") + [layer_names] 2d_physics/layer_1="Reserved" diff --git a/resources/animations/zombies/basic_zombie_walk.res b/resources/animations/zombies/basic_zombie_walk.res index afb3fb3..0f6d641 100644 Binary files a/resources/animations/zombies/basic_zombie_walk.res and b/resources/animations/zombies/basic_zombie_walk.res differ diff --git a/resources/plants/Aloe.tres b/resources/plants/Aloe.tres index 0240395..9e2b333 100644 --- a/resources/plants/Aloe.tres +++ b/resources/plants/Aloe.tres @@ -18,16 +18,12 @@ metadata/_custom_type_script = "uid://3m7xks3xq3hl" [resource] script = ExtResource("1_vw2kg") -display_name = "Aloe" -display_description = "[p]Aloe heals injured plants.[/p] -[p]Health points: [color=DARK_RED]3 bites[/color][/p] -[p]Reload time: [color=DARK_RED]15 seconds[/color].[/p] -[p]Ability recharge time: [color=DARK_RED]20 seconds[/color].[/p] -[p]Heals plant when it has [color=DARK_RED]third[/color] of its health.[/p]" -Cost = 75 +name_key = "aloe" +description_key = "aloe_desc" +Cost = 75.0 Scene = ExtResource("2_6a4ia") ReloadTime = 15.0 ReloadProgress = 0.0 Preview = ExtResource("1_t4137") -Layer = 1 customFrame = SubResource("Resource_5me4i") +Layer = 1 diff --git a/resources/plants/Garlic.tres b/resources/plants/Garlic.tres index a2f044e..07baa57 100644 --- a/resources/plants/Garlic.tres +++ b/resources/plants/Garlic.tres @@ -6,11 +6,9 @@ [resource] script = ExtResource("1_e15gf") -display_name = "Garlic" -display_description = "[p]Redirects zombies that bite it.[/p] -[p]Health points: [color=DARK_RED]20 bites[/color][/p] -[p]Reload time: [color=DARK_RED]15 seconds[/color].[/p]" -Cost = 50 +name_key = "garlic" +description_key = "garlic_desc" +Cost = 50.0 Scene = ExtResource("2_81n0p") ReloadTime = 7.5 ReloadProgress = 0.67 diff --git a/resources/plants/Peashooter.tres b/resources/plants/Peashooter.tres index 39b3286..1344b1f 100644 --- a/resources/plants/Peashooter.tres +++ b/resources/plants/Peashooter.tres @@ -6,13 +6,9 @@ [resource] script = ExtResource("1_amvh8") -display_name = "Peashooter" -display_description = "[p]Simply shoots peas at zombies on the lane[/p] -[p]Health points: [color=DARK_RED]3 bites[/color].[/p] -[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] -[p]Pea damage: [color=DARK_RED]1 pea[/color].[/p] -[p]Firerate: [color=DARK_RED]1.5 seconds[/color].[/p]" -Cost = 75 +name_key = "peashooter" +description_key = "peashooter_desc" +Cost = 75.0 Scene = ExtResource("1_rqf2x") ReloadTime = 5.0 ReloadProgress = 0.0 diff --git a/resources/plants/PotatoMine.tres b/resources/plants/PotatoMine.tres index f7c7cc8..776ad20 100644 --- a/resources/plants/PotatoMine.tres +++ b/resources/plants/PotatoMine.tres @@ -6,13 +6,9 @@ [resource] script = ExtResource("1_33j6b") -display_name = "Potato mine" -display_description = "[p]Explodes when stepped on. Needs some time to prime.[/p] -[p]Health points: [color=DARK_RED]2 bites[/color].[/p] -[p]Reload time: [color=DARK_RED]25 seconds[/color].[/p] -[p]Explosion damage: [color=DARK_RED]600 peas[/color].[/p] -[p]Prime time: [color=DARK_RED]15 seconds[/color].[/p]" -Cost = 25 +name_key = "potatomine" +description_key = "potatomine_desc" +Cost = 25.0 Scene = ExtResource("2_ig2ti") ReloadTime = 25.0 ReloadProgress = 0.9 diff --git a/resources/plants/Snowpea.tres b/resources/plants/Snowpea.tres index 77ed9be..93d6bde 100644 --- a/resources/plants/Snowpea.tres +++ b/resources/plants/Snowpea.tres @@ -6,14 +6,9 @@ [resource] script = ExtResource("1_0cpi0") -display_name = "Snowpea" -display_description = "[p]Shoots slowing peas at zombies.[/p] -[p]Health points: [color=DARK_RED]3 bites[/color].[/p] -[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] -[p]Pea damage: [color=DARK_RED]1 pea[/color].[/p] -[p]Firerate: [color=DARK_RED]1.5 seconds[/color].[/p] -[p]Slow percentage: [color=STEEL_BLUE]25%[/color].[/p]" -Cost = 175 +name_key = "snowpea" +description_key = "snowpea_desc" +Cost = 175.0 Scene = ExtResource("2_k47h0") ReloadTime = 5.0 ReloadProgress = 0.0 diff --git a/resources/plants/Spikeweed.tres b/resources/plants/Spikeweed.tres index b82b9a7..cfd319b 100644 --- a/resources/plants/Spikeweed.tres +++ b/resources/plants/Spikeweed.tres @@ -6,12 +6,9 @@ [resource] script = ExtResource("1_0bymo") -display_name = "Spikeweed" -display_description = "[p]Attacks zombies that step on it.[/p] -[p]Health points: [color=DARK_RED]3 bites[/color].[/p] -[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] -[p]Damage per second: [color=DARK_RED]0.9 peas[/color].[/p]" -Cost = 100 +name_key = "spikeweed" +description_key = "spikeweed_desc" +Cost = 100.0 Scene = ExtResource("2_iv8de") ReloadTime = 5.0 ReloadProgress = 0.0 diff --git a/resources/plants/Sunflower.tres b/resources/plants/Sunflower.tres index 8fa5401..7347bf8 100644 --- a/resources/plants/Sunflower.tres +++ b/resources/plants/Sunflower.tres @@ -6,13 +6,9 @@ [resource] script = ExtResource("3_vt4jc") -display_name = "Sunflower" -display_description = "[p]Produces sun over time.[/p] -[p]Health points: [color=DARK_RED]3 bites[/color][/p] -[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] -[p]Initial sun production time: [color=DARK_RED]12 seconds[/color].[/p] -[p]Sun production time: [color=DARK_RED]24 seconds[/color](After first sun produced).[/p]" -Cost = 50 +name_key = "sunflower" +description_key = "sunflower_desc" +Cost = 50.0 Scene = ExtResource("2_gcyr5") ReloadTime = 5.0 ReloadProgress = 1.0 diff --git a/resources/plants/Threepeater.tres b/resources/plants/Threepeater.tres index 42cb5f4..4a62eef 100644 --- a/resources/plants/Threepeater.tres +++ b/resources/plants/Threepeater.tres @@ -6,13 +6,9 @@ [resource] script = ExtResource("3_3lugi") -display_name = "Threepeater" -display_description = "[p]Shoots peas at zombies in three lanes.[/p] -[p]Health points: [color=DARK_RED]3 bites[/color].[/p] -[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] -[p]Pea damage: [color=DARK_RED]1 pea[/color] ([color=DARK_RED]3 pea[/color] when in close quarters).[/p] -[p]Firerate: [color=DARK_RED]1.6 seconds[/color].[/p]" -Cost = 300 +name_key = "threepeater" +description_key = "threepeater_desc" +Cost = 275.0 Scene = ExtResource("2_uqpu0") ReloadTime = 5.0 ReloadProgress = 0.0 diff --git a/resources/plants/Wallnut.tres b/resources/plants/Wallnut.tres index f17f614..63b6271 100644 --- a/resources/plants/Wallnut.tres +++ b/resources/plants/Wallnut.tres @@ -6,11 +6,9 @@ [resource] script = ExtResource("1_27l0t") -display_name = "Wallnut" -display_description = "[p]Absorbs zombie damage. Does nothing special[/p] -[p]Health points: [color=DARK_RED]60 bites[/color][/p] -[p]Reload time: [color=DARK_RED]20 seconds[/color].[/p]" -Cost = 50 +name_key = "wallnut" +description_key = "wallnut_desc" +Cost = 50.0 Scene = ExtResource("2_rkn3h") ReloadTime = 20.0 ReloadProgress = 0.0 diff --git a/resources/themes/GameStyle.tres b/resources/themes/GameStyle.tres index 0233b06..42764e6 100644 --- a/resources/themes/GameStyle.tres +++ b/resources/themes/GameStyle.tres @@ -1,11 +1,22 @@ -[gd_resource type="Theme" load_steps=13 format=3 uid="uid://b8l285cjcgeyi"] +[gd_resource type="Theme" load_steps=40 format=3 uid="uid://b8l285cjcgeyi"] [ext_resource type="FontFile" uid="uid://nbrt5q3t8tud" path="res://assets/fonts/pico12.ttf" id="1_103to"] [ext_resource type="Texture2D" uid="uid://d0yhee0scl7mc" path="res://assets/sprites/gui/ButtonBackground.tres" id="1_y0kbp"] [ext_resource type="Texture2D" uid="uid://dxmg20mrnpt8r" path="res://assets/sprites/gui/SelectionGeneric.tres" id="2_h0nd2"] [ext_resource type="Texture2D" uid="uid://b5skdm3q7tkh3" path="res://assets/sprites/gui/ChooseYourSeeds/Grabber.tres" id="3_i6w8j"] +[ext_resource type="Texture2D" uid="uid://cc8jaddr5lww3" path="res://assets/sprites/gui/almanach/slider_h.tres" id="3_nec55"] [ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="3_yeah5"] [ext_resource type="Texture2D" uid="uid://cv255d4s0qopj" path="res://assets/sprites/gui/ChooseYourSeeds/Slider.tres" id="4_yeah5"] +[ext_resource type="Texture2D" uid="uid://lg1o4pu0n0u6" path="res://assets/sprites/gui/almanach/decrement.tres" id="5_ij6vn"] +[ext_resource type="Texture2D" uid="uid://dssr8m4gbpks4" path="res://assets/sprites/gui/almanach/tab_disabled.tres" id="5_w6b64"] +[ext_resource type="Texture2D" uid="uid://cdyfech0howdr" path="res://assets/sprites/gui/almanach/decrement_h.tres" id="6_nec55"] +[ext_resource type="Texture2D" uid="uid://2bk8ce82cmw" path="res://assets/sprites/gui/almanach/tab.tres" id="6_ygj8j"] +[ext_resource type="Texture2D" uid="uid://blr2uchlakvor" path="res://assets/sprites/gui/almanach/description_panel.tres" id="7_5pe7g"] +[ext_resource type="Texture2D" uid="uid://dpfkai158kyfu" path="res://assets/sprites/gui/almanach/holder.tres" id="7_ls06u"] +[ext_resource type="Texture2D" uid="uid://vpuytn3nd6c1" path="res://assets/sprites/gui/almanach/increment.tres" id="8_csc22"] +[ext_resource type="Texture2D" uid="uid://cnio0bw2xla23" path="res://assets/sprites/gui/almanach/increment_h.tres" id="9_r6ela"] +[ext_resource type="Texture2D" uid="uid://4cdp0k17u2l5" path="res://assets/sprites/gui/almanach/menu.tres" id="10_vatwx"] +[ext_resource type="Texture2D" uid="uid://drvrnblf2fvgk" path="res://assets/sprites/gui/almanach/slider_bg.tres" id="14_3qjha"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_na4u2"] texture = ExtResource("1_y0kbp") @@ -24,6 +35,55 @@ axis_stretch_horizontal = 1 axis_stretch_vertical = 1 draw_center = false +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_csc22"] +texture = ExtResource("3_nec55") +texture_margin_left = 7.0 +texture_margin_top = 4.0 +texture_margin_right = 7.0 +texture_margin_bottom = 4.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_r6ela"] +texture = ExtResource("14_3qjha") +texture_margin_left = 6.0 +texture_margin_top = 6.0 +texture_margin_right = 6.0 +texture_margin_bottom = 6.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_vatwx"] +texture = ExtResource("14_3qjha") +texture_margin_left = 6.0 +texture_margin_top = 6.0 +texture_margin_right = 6.0 +texture_margin_bottom = 6.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ij6vn"] +texture = ExtResource("4_yeah5") +texture_margin_left = 5.0 +texture_margin_top = 5.0 +texture_margin_right = 5.0 +texture_margin_bottom = 5.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_nec55"] +texture = ExtResource("4_yeah5") +texture_margin_left = 5.0 +texture_margin_top = 5.0 +texture_margin_right = 5.0 +texture_margin_bottom = 5.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_ls06u"] +texture = ExtResource("4_yeah5") +texture_margin_left = 5.0 +texture_margin_top = 5.0 +texture_margin_right = 5.0 +texture_margin_bottom = 5.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_jjopa"] +texture = ExtResource("7_5pe7g") +texture_margin_left = 4.0 +texture_margin_top = 5.0 +texture_margin_right = 7.0 +texture_margin_bottom = 4.0 + [sub_resource type="AtlasTexture" id="AtlasTexture_5pe7g"] atlas = ExtResource("3_yeah5") region = Rect2(226, 77, 18, 18) @@ -42,6 +102,62 @@ texture_margin_top = 6.0 texture_margin_right = 6.0 texture_margin_bottom = 6.0 +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_g0cdn"] +texture = SubResource("AtlasTexture_5pe7g") +texture_margin_left = 6.0 +texture_margin_top = 6.0 +texture_margin_right = 6.0 +texture_margin_bottom = 6.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_gl5ke"] +texture = ExtResource("5_w6b64") +texture_margin_left = 8.0 +texture_margin_top = 6.0 +texture_margin_right = 8.0 +texture_margin_bottom = 1.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_xmjd3"] +texture = ExtResource("6_ygj8j") +texture_margin_left = 8.0 +texture_margin_top = 6.0 +texture_margin_right = 8.0 +texture_margin_bottom = 1.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_3qjha"] +texture = SubResource("AtlasTexture_5pe7g") +texture_margin_left = 6.0 +texture_margin_top = 6.0 +texture_margin_right = 6.0 +texture_margin_bottom = 6.0 + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_gvd6y"] +texture = ExtResource("3_i6w8j") +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_epvq8"] +texture = ExtResource("3_i6w8j") +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_lfl2m"] +texture = ExtResource("3_i6w8j") +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_41q1p"] +texture = ExtResource("14_3qjha") +texture_margin_left = 6.0 +texture_margin_top = 6.0 +texture_margin_right = 6.0 +texture_margin_bottom = 6.0 + [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_5pe7g"] texture = ExtResource("4_yeah5") texture_margin_left = 5.0 @@ -49,6 +165,13 @@ texture_margin_top = 5.0 texture_margin_right = 5.0 texture_margin_bottom = 5.0 +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_chra8"] +texture = ExtResource("7_5pe7g") +texture_margin_left = 4.0 +texture_margin_top = 5.0 +texture_margin_right = 7.0 +texture_margin_bottom = 4.0 + [resource] default_font = ExtResource("1_103to") Button/colors/font_color = Color(0, 0, 0, 1) @@ -60,11 +183,53 @@ Button/styles/focus = SubResource("StyleBoxTexture_mv7jy") Button/styles/hover = SubResource("StyleBoxTexture_na4u2") Button/styles/normal = SubResource("StyleBoxTexture_na4u2") Button/styles/pressed = SubResource("StyleBoxTexture_na4u2") +HScrollBar/styles/grabber = SubResource("StyleBoxTexture_csc22") +HScrollBar/styles/grabber_highlight = SubResource("StyleBoxTexture_csc22") +HScrollBar/styles/grabber_pressed = SubResource("StyleBoxTexture_csc22") +HScrollBar/styles/scroll = SubResource("StyleBoxTexture_r6ela") +HScrollBar/styles/scroll_focus = SubResource("StyleBoxTexture_vatwx") +HSlider/icons/grabber = ExtResource("3_nec55") +HSlider/icons/grabber_disabled = ExtResource("3_nec55") +HSlider/icons/grabber_highlight = ExtResource("3_nec55") +HSlider/styles/grabber_area = SubResource("StyleBoxTexture_ij6vn") +HSlider/styles/grabber_area_highlight = SubResource("StyleBoxTexture_nec55") +HSlider/styles/slider = SubResource("StyleBoxTexture_ls06u") +LineEdit/colors/font_color = Color(0, 0, 0, 1) +LineEdit/colors/font_selected_color = Color(0, 0, 0, 1) +LineEdit/colors/font_uneditable_color = Color(0, 0, 0, 0.501961) +LineEdit/styles/focus = SubResource("StyleBoxTexture_jjopa") +LineEdit/styles/normal = SubResource("StyleBoxTexture_jjopa") +LineEdit/styles/read_only = SubResource("StyleBoxTexture_jjopa") Panel/styles/panel = SubResource("StyleBoxTexture_pjyej") PanelContainer/styles/panel = SubResource("StyleBoxTexture_w6b64") +TabContainer/icons/decrement = ExtResource("5_ij6vn") +TabContainer/icons/decrement_highlight = ExtResource("6_nec55") +TabContainer/icons/drop_mark = ExtResource("7_ls06u") +TabContainer/icons/increment = ExtResource("8_csc22") +TabContainer/icons/increment_highlight = ExtResource("9_r6ela") +TabContainer/icons/menu = ExtResource("10_vatwx") +TabContainer/icons/menu_highlight = ExtResource("10_vatwx") +TabContainer/styles/panel = SubResource("StyleBoxTexture_g0cdn") +TabContainer/styles/tab_disabled = SubResource("StyleBoxTexture_gl5ke") +TabContainer/styles/tab_focus = SubResource("StyleBoxTexture_xmjd3") +TabContainer/styles/tab_hovered = SubResource("StyleBoxTexture_xmjd3") +TabContainer/styles/tab_selected = SubResource("StyleBoxTexture_xmjd3") +TabContainer/styles/tab_unselected = SubResource("StyleBoxTexture_gl5ke") +TextEdit/colors/font_color = Color(0, 0, 0, 1) +TextEdit/styles/focus = SubResource("StyleBoxTexture_jjopa") +TextEdit/styles/normal = SubResource("StyleBoxTexture_jjopa") +TextEdit/styles/read_only = SubResource("StyleBoxTexture_jjopa") +Tree/styles/panel = SubResource("StyleBoxTexture_3qjha") +VScrollBar/styles/grabber = SubResource("StyleBoxTexture_gvd6y") +VScrollBar/styles/grabber_highlight = SubResource("StyleBoxTexture_epvq8") +VScrollBar/styles/grabber_pressed = SubResource("StyleBoxTexture_lfl2m") +VScrollBar/styles/scroll = SubResource("StyleBoxTexture_41q1p") +VScrollBar/styles/scroll_focus = SubResource("StyleBoxTexture_41q1p") VSlider/icons/grabber = ExtResource("3_i6w8j") VSlider/icons/grabber_disabled = ExtResource("3_i6w8j") VSlider/icons/grabber_highlight = ExtResource("3_i6w8j") VSlider/styles/grabber_area = SubResource("StyleBoxTexture_5pe7g") VSlider/styles/grabber_area_highlight = SubResource("StyleBoxTexture_5pe7g") VSlider/styles/slider = SubResource("StyleBoxTexture_5pe7g") +description_panel_container/base_type = &"PanelContainer" +description_panel_container/styles/panel = SubResource("StyleBoxTexture_chra8") diff --git a/resources/zombies/basic.tres b/resources/zombies/basic.tres index e26d47f..2c5675a 100644 --- a/resources/zombies/basic.tres +++ b/resources/zombies/basic.tres @@ -1,10 +1,17 @@ -[gd_resource type="Resource" script_class="ZombieResource" load_steps=3 format=3 uid="uid://buvacn56kyy2p"] +[gd_resource type="Resource" script_class="ZombieResource" load_steps=4 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="Texture2D" uid="uid://bwdqbrnn7ygtr" path="res://assets/sprites/atlases/zombies/Зондби.png" id="1_l6de4"] [resource] script = ExtResource("1_k277m") -cost = 1 -scene = ExtResource("1_c2mq3") +name_key = "basic" +description_key = "basic_desc" +Cost = 1.0 +Scene = ExtResource("1_c2mq3") +ReloadTime = 1.0 +ReloadProgress = 0.0 +Preview = ExtResource("1_l6de4") +Layer = 1 metadata/_custom_type_script = "uid://cqxj7o8hdm82n" diff --git a/resources/zombies/buckethead.tres b/resources/zombies/buckethead.tres index 2721cfd..b342cd9 100644 --- a/resources/zombies/buckethead.tres +++ b/resources/zombies/buckethead.tres @@ -1,10 +1,17 @@ -[gd_resource type="Resource" script_class="ZombieResource" load_steps=3 format=3 uid="uid://dkhjlu7u0vny6"] +[gd_resource type="Resource" script_class="ZombieResource" load_steps=4 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="Texture2D" uid="uid://bwdqbrnn7ygtr" path="res://assets/sprites/atlases/zombies/Зондби.png" id="1_ufs7s"] [resource] script = ExtResource("1_sngfh") -cost = 5.0 -scene = ExtResource("1_lhcag") +name_key = "buckethead" +description_key = "buckethead_desc" +Cost = 5.0 +Scene = ExtResource("1_lhcag") +ReloadTime = 1.0 +ReloadProgress = 0.0 +Preview = ExtResource("1_ufs7s") +Layer = 1 metadata/_custom_type_script = "uid://cqxj7o8hdm82n" diff --git a/resources/zombies/conehead.tres b/resources/zombies/conehead.tres index 8e21ed2..36b66d9 100644 --- a/resources/zombies/conehead.tres +++ b/resources/zombies/conehead.tres @@ -1,10 +1,17 @@ -[gd_resource type="Resource" script_class="ZombieResource" load_steps=3 format=3 uid="uid://nceohd32fkxk"] +[gd_resource type="Resource" script_class="ZombieResource" load_steps=4 format=3 uid="uid://nceohd32fkxk"] +[ext_resource type="Texture2D" uid="uid://bwdqbrnn7ygtr" path="res://assets/sprites/atlases/zombies/Зондби.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"] [resource] script = ExtResource("1_sw7hj") -cost = 2.0 -scene = ExtResource("1_llf5l") +name_key = "conehead" +description_key = "conehead_desc" +Cost = 2.0 +Scene = ExtResource("1_llf5l") +ReloadTime = 1.0 +ReloadProgress = 0.0 +Preview = ExtResource("1_f7g7v") +Layer = 1 metadata/_custom_type_script = "uid://cqxj7o8hdm82n" diff --git a/resources/zombies/hobo.tres b/resources/zombies/hobo.tres index 0be10aa..6736d4f 100644 --- a/resources/zombies/hobo.tres +++ b/resources/zombies/hobo.tres @@ -1,10 +1,17 @@ -[gd_resource type="Resource" script_class="ZombieResource" load_steps=3 format=3 uid="uid://c38vfdw5b60xw"] +[gd_resource type="Resource" script_class="ZombieResource" load_steps=4 format=3 uid="uid://c38vfdw5b60xw"] [ext_resource type="PackedScene" uid="uid://bgqmwsb6ynm81" path="res://scenes/entities/Zombies/hobo.tscn" id="1_4myt6"] +[ext_resource type="Texture2D" uid="uid://bwdqbrnn7ygtr" path="res://assets/sprites/atlases/zombies/Зондби.png" id="1_nt7w3"] [ext_resource type="Script" uid="uid://cqxj7o8hdm82n" path="res://scripts/resources/ZombieResource.cs" id="1_u5qpq"] [resource] script = ExtResource("1_u5qpq") -cost = 7.0 -scene = ExtResource("1_4myt6") +name_key = "hobo" +description_key = "hobo_desc" +Cost = 7.0 +Scene = ExtResource("1_4myt6") +ReloadTime = 1.0 +ReloadProgress = 0.0 +Preview = ExtResource("1_nt7w3") +Layer = 1 metadata/_custom_type_script = "uid://cqxj7o8hdm82n" diff --git a/scenes/gui/almanach.gd b/scenes/gui/almanach.gd new file mode 100644 index 0000000..c7e60de --- /dev/null +++ b/scenes/gui/almanach.gd @@ -0,0 +1,5 @@ +extends TabContainer + +func _on_quit_button_pressed() -> void: + visible = false + $ChannelPlayer.call("Play") diff --git a/scenes/gui/almanach.gd.uid b/scenes/gui/almanach.gd.uid new file mode 100644 index 0000000..4a51bc8 --- /dev/null +++ b/scenes/gui/almanach.gd.uid @@ -0,0 +1 @@ +uid://bs1qywtqijyd2 diff --git a/scenes/gui/almanach.tscn b/scenes/gui/almanach.tscn new file mode 100644 index 0000000..f0b6f7c --- /dev/null +++ b/scenes/gui/almanach.tscn @@ -0,0 +1,200 @@ +[gd_scene load_steps=10 format=3 uid="uid://bvpt0q4j6nx18"] + +[ext_resource type="Texture2D" uid="uid://dr8a0rx42o3qy" path="res://assets/sprites/gui/ChooseYourSeeds/PlantFrame.tres" id="1_1hnxi"] +[ext_resource type="Script" uid="uid://bs1qywtqijyd2" path="res://scenes/gui/almanach.gd" id="1_oy57w"] +[ext_resource type="Script" uid="uid://0mvmfvwe1bc7" path="res://scripts/components/gui/almanach/AlmanachGrid.cs" id="1_ru62c"] +[ext_resource type="Script" uid="uid://covbig00p22di" path="res://scripts/components/gui/choose_your_seeds/Previewport.cs" id="2_ru62c"] +[ext_resource type="Texture2D" uid="uid://dycdvvgmgmfu6" path="res://assets/sprites/gui/ChooseYourSeeds/FrameField.tres" id="3_oy57w"] +[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="6_7vo1l"] +[ext_resource type="AudioStream" uid="uid://bdx83fokp6kha" path="res://assets/audio/sfx/buttonclick.mp3" id="7_vvhxq"] + +[sub_resource type="ViewportTexture" id="ViewportTexture_ru62c"] +viewport_path = NodePath("plants/Infobox/FrameAndTitle/VboxContainer/Frame/Previewport") + +[sub_resource type="ViewportTexture" id="ViewportTexture_7yl8g"] +viewport_path = NodePath("zombies/Infobox/FrameAndTitle/VBoxContainer/Frame/Previewport") + +[node name="Almanach" type="TabContainer"] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +tab_alignment = 1 +current_tab = 0 +script = ExtResource("1_oy57w") + +[node name="plants" type="HBoxContainer" parent="."] +layout_mode = 2 +metadata/_tab_index = 0 + +[node name="SeedpacketsContainer" type="ScrollContainer" parent="plants"] +layout_mode = 2 +horizontal_scroll_mode = 0 + +[node name="GridContainer" type="GridContainer" parent="plants/SeedpacketsContainer"] +layout_mode = 2 +columns = 8 +script = ExtResource("1_ru62c") + +[node name="Infobox" type="VBoxContainer" parent="plants"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="FrameAndTitle" type="HBoxContainer" parent="plants/Infobox"] +layout_mode = 2 + +[node name="VboxContainer" type="VBoxContainer" parent="plants/Infobox/FrameAndTitle"] +layout_mode = 2 + +[node name="Frame" type="TextureRect" parent="plants/Infobox/FrameAndTitle/VboxContainer"] +clip_contents = true +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +texture = ExtResource("1_1hnxi") + +[node name="Previewport" type="SubViewport" parent="plants/Infobox/FrameAndTitle/VboxContainer/Frame" node_paths=PackedStringArray("title", "description")] +canvas_item_default_texture_filter = 0 +size = Vector2i(65, 65) +script = ExtResource("2_ru62c") +title = NodePath("../../../Label") +description = NodePath("../../../../Description/ScrollContainer/RichTextLabel") + +[node name="FrameField" type="Sprite2D" parent="plants/Infobox/FrameAndTitle/VboxContainer/Frame/Previewport"] +texture = ExtResource("3_oy57w") + +[node name="Camera2D" type="Camera2D" parent="plants/Infobox/FrameAndTitle/VboxContainer/Frame/Previewport"] + +[node name="Render" type="TextureRect" parent="plants/Infobox/FrameAndTitle/VboxContainer/Frame"] +show_behind_parent = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = SubResource("ViewportTexture_ru62c") + +[node name="QuitButton" type="Button" parent="plants/Infobox/FrameAndTitle/VboxContainer"] +layout_mode = 2 +size_flags_vertical = 4 +text = "exit" + +[node name="Label" type="Label" parent="plants/Infobox/FrameAndTitle"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Description" type="PanelContainer" parent="plants/Infobox"] +layout_mode = 2 +size_flags_vertical = 3 +theme_type_variation = &"description_panel_container" + +[node name="ScrollContainer" type="ScrollContainer" parent="plants/Infobox/Description"] +layout_mode = 2 +horizontal_scroll_mode = 0 + +[node name="RichTextLabel" type="RichTextLabel" parent="plants/Infobox/Description/ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_colors/default_color = Color(0, 0, 0, 1) +theme_override_colors/font_selected_color = Color(0, 0, 0, 1) +bbcode_enabled = true + +[node name="zombies" type="HBoxContainer" parent="."] +visible = false +layout_mode = 2 +metadata/_tab_index = 1 + +[node name="SeedpacketsContainer" type="ScrollContainer" parent="zombies"] +layout_mode = 2 +horizontal_scroll_mode = 0 + +[node name="GridContainer" type="GridContainer" parent="zombies/SeedpacketsContainer"] +layout_mode = 2 +columns = 8 +script = ExtResource("1_ru62c") +_zombies = true + +[node name="Infobox" type="VBoxContainer" parent="zombies"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="FrameAndTitle" type="HBoxContainer" parent="zombies/Infobox"] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="zombies/Infobox/FrameAndTitle"] +layout_mode = 2 + +[node name="Frame" type="TextureRect" parent="zombies/Infobox/FrameAndTitle/VBoxContainer"] +clip_contents = true +layout_mode = 2 +size_flags_horizontal = 0 +size_flags_vertical = 0 +texture = ExtResource("1_1hnxi") + +[node name="Previewport" type="SubViewport" parent="zombies/Infobox/FrameAndTitle/VBoxContainer/Frame" node_paths=PackedStringArray("title", "description")] +canvas_item_default_texture_filter = 0 +size = Vector2i(130, 130) +script = ExtResource("2_ru62c") +title = NodePath("../../../Label") +description = NodePath("../../../../Description/ScrollContainer/RichTextLabel") + +[node name="FrameField" type="Sprite2D" parent="zombies/Infobox/FrameAndTitle/VBoxContainer/Frame/Previewport"] +texture = ExtResource("3_oy57w") + +[node name="Camera2D" type="Camera2D" parent="zombies/Infobox/FrameAndTitle/VBoxContainer/Frame/Previewport"] +position = Vector2(0, -45) + +[node name="Render" type="TextureRect" parent="zombies/Infobox/FrameAndTitle/VBoxContainer/Frame"] +show_behind_parent = true +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = SubResource("ViewportTexture_7yl8g") +expand_mode = 1 + +[node name="QuitButton" type="Button" parent="zombies/Infobox/FrameAndTitle/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 4 +text = "exit" + +[node name="Label" type="Label" parent="zombies/Infobox/FrameAndTitle"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 1 +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="Description" type="PanelContainer" parent="zombies/Infobox"] +layout_mode = 2 +size_flags_vertical = 3 +theme_type_variation = &"description_panel_container" + +[node name="ScrollContainer" type="ScrollContainer" parent="zombies/Infobox/Description"] +layout_mode = 2 +horizontal_scroll_mode = 0 + +[node name="RichTextLabel" type="RichTextLabel" parent="zombies/Infobox/Description/ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +theme_override_colors/default_color = Color(0, 0, 0, 1) +theme_override_colors/font_selected_color = Color(0, 0, 0, 1) +bbcode_enabled = true + +[node name="ChannelPlayer" type="Node" parent="."] +script = ExtResource("6_7vo1l") +audioStream = ExtResource("7_vvhxq") +channel = "button" +metadata/_custom_type_script = "uid://c36bj8u7jghc7" + +[connection signal="pressed" from="plants/Infobox/FrameAndTitle/VboxContainer/QuitButton" to="." method="_on_quit_button_pressed"] +[connection signal="pressed" from="zombies/Infobox/FrameAndTitle/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"] diff --git a/scenes/gui/choose_your_seeds.tscn b/scenes/gui/choose_your_seeds.tscn index 7ee96bc..7279861 100644 --- a/scenes/gui/choose_your_seeds.tscn +++ b/scenes/gui/choose_your_seeds.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://dpxxjfd5lv5sv"] +[gd_scene load_steps=19 format=3 uid="uid://dpxxjfd5lv5sv"] [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"] @@ -7,8 +7,10 @@ [ext_resource type="Script" uid="uid://eq3ecja30mlj" path="res://scripts/components/gui/choose_your_seeds/GridLoader.cs" id="4_i7sou"] [ext_resource type="PackedScene" uid="uid://10b1egek6upx" path="res://scenes/gui/level_run_button.tscn" id="5_n80ic"] [ext_resource type="Script" uid="uid://d26waisd3v488" path="res://scripts/components/gui/choose_your_seeds/LevelRunButton.cs" id="7_k6b6g"] +[ext_resource type="Texture2D" uid="uid://drydueofrb448" path="res://assets/sprites/gui/almanach/book.tres" id="8_hmdmm"] [ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="8_v7xff"] [ext_resource type="AudioStream" uid="uid://bdx83fokp6kha" path="res://assets/audio/sfx/buttonclick.mp3" id="9_v7xff"] +[ext_resource type="PackedScene" uid="uid://bvpt0q4j6nx18" path="res://scenes/gui/almanach.tscn" id="11_nlh6x"] [sub_resource type="Animation" id="Animation_0rps3"] resource_name = "Hide" @@ -106,6 +108,16 @@ viewport_path = NodePath("Panel/MarginContainer/VBoxContainer/HBoxContainer/Fram font_size = 24 font_color = Color(0, 0, 0, 1) +[sub_resource type="GDScript" id="GDScript_hmdmm"] +resource_name = "Almanach" +script/source = "extends Button + + +func _pressed() -> void: + $\"../../Independer/Almanach\".visible = true + $\"../../ChannelPlayer\".call(\"Play\") +" + [node name="ChooseYourSeeds" type="Control"] process_mode = 3 layout_mode = 3 @@ -222,10 +234,27 @@ offset_bottom = -16.016 script = ExtResource("7_k6b6g") _player = NodePath("../../AnimationPlayer") +[node name="AlmanachButton" type="Button" parent="Panel"] +layout_mode = 0 +anchor_left = 1.0 +anchor_top = 0.883929 +anchor_right = 1.14167 +anchor_bottom = 1.0 +offset_bottom = -3.05176e-05 +icon = ExtResource("8_hmdmm") +icon_alignment = 1 +script = SubResource("GDScript_hmdmm") +metadata/_edit_use_anchors_ = true + [node name="ChannelPlayer" type="Node" parent="."] script = ExtResource("8_v7xff") audioStream = ExtResource("9_v7xff") channel = "button" metadata/_custom_type_script = "uid://c36bj8u7jghc7" +[node name="Independer" type="Node" parent="."] + +[node name="Almanach" parent="Independer" instance=ExtResource("11_nlh6x")] +visible = false + [connection signal="pressed" from="Panel/LevelRunButton" to="ChannelPlayer" method="Play"] diff --git a/scenes/gui/pause_menu.tscn b/scenes/gui/pause_menu.tscn index 24b4d52..94787ed 100644 --- a/scenes/gui/pause_menu.tscn +++ b/scenes/gui/pause_menu.tscn @@ -67,7 +67,7 @@ layout_mode = 2 [node name="PAUSED" type="Label" parent="Pause/MarginContainer/Buttons"] layout_mode = 2 -text = "PAUSED" +text = "paused" label_settings = SubResource("LabelSettings_or0he") horizontal_alignment = 1 metadata/_edit_use_anchors_ = true @@ -77,7 +77,7 @@ layout_mode = 2 [node name="Label" type="Label" parent="Pause/MarginContainer/Buttons/SFXVolume"] layout_mode = 2 -text = "SFX" +text = "sfx" [node name="HSlider" type="HSlider" parent="Pause/MarginContainer/Buttons/SFXVolume"] layout_mode = 2 @@ -92,7 +92,7 @@ layout_mode = 2 [node name="Label" type="Label" parent="Pause/MarginContainer/Buttons/MusicVolume"] layout_mode = 2 -text = "Music" +text = "music" [node name="HSlider" type="HSlider" parent="Pause/MarginContainer/Buttons/MusicVolume"] layout_mode = 2 diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn index bba1053..060e4ad 100644 --- a/scenes/main_menu.tscn +++ b/scenes/main_menu.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=3 uid="uid://bfstrli64u23y"] +[gd_scene load_steps=16 format=3 uid="uid://bfstrli64u23y"] [ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_jk1qb"] [ext_resource type="Script" uid="uid://drru785m4eep" path="res://scripts/components/gui/main_menu_rich_text.gd" id="2_5dd4i"] @@ -8,8 +8,10 @@ [ext_resource type="Script" uid="uid://c06k4k3ww48ev" path="res://scripts/components/gui/menu_buttons.gd" id="5_rcqid"] [ext_resource type="Script" uid="uid://6e8n6kc0y11o" path="res://scripts/sacrifice.gd" id="6_1ajci"] [ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="7_7b55j"] +[ext_resource type="Texture2D" uid="uid://drydueofrb448" path="res://assets/sprites/gui/almanach/book.tres" id="7_flqon"] [ext_resource type="AudioStream" uid="uid://bdx83fokp6kha" path="res://assets/audio/sfx/buttonclick.mp3" id="8_5pajh"] [ext_resource type="AudioStream" uid="uid://djgyc7bbwcepp" path="res://assets/audio/music/Александр Зацепин - Увертюра.mp3" id="9_j7ex8"] +[ext_resource type="PackedScene" uid="uid://bvpt0q4j6nx18" path="res://scenes/gui/almanach.tscn" id="12_rcqid"] [sub_resource type="GDScript" id="GDScript_5dd4i"] resource_name = "main_menu" @@ -43,12 +45,13 @@ grow_vertical = 2 script = SubResource("GDScript_5dd4i") [node name="PrototypeWindow" type="AcceptDialog" parent="."] +canvas_item_default_texture_filter = 0 title = "" size = Vector2i(600, 400) unresizable = true borderless = true theme_override_styles/panel = SubResource("StyleBoxTexture_jl0ue") -ok_button_text = "Close" +ok_button_text = "close" dialog_close_on_escape = false script = ExtResource("2_lgwnu") @@ -63,36 +66,25 @@ layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 bbcode_enabled = true -text = "[p][center][wave amp=50.0 freq=5.0 connected=1][font_size=24]WELCOME TO LIBERATION OF NEIGHBOURVILLE PROTOTYPE![/font_size][/wave][/center][/p] -[p]Big thanks from me, Rendo, and our team! We appreciate any feedback, so consider reporting bugs to our [color=cyan][url=https://discord.gg/Y5Wk8H8EBY]discord server[/url][/color].[/p][p][/p] -[p]Liberation of Neighbourville is currently in early stages of development. However, we reached point when all essential systems and mechanics are ready.[/p] -[p][/p] -[p]As for now, you can play survival endless with all currently made plants. Game includes some plants from first Plants versus Zombies, Aloe from sequel, three basic zombies and a hobo zombie.[/p] -[p][/p] -[p]As for 0.2.X version, current roadmap contains:[ul] -[p]Adventure mode[/p] -[p]Almanach[/p] -[p]New plants and zombies, obviously[/p] -[p]More ways to play[/p] -[/ul][/p]" +text = "lon_proto" fit_content = true scroll_active = false script = ExtResource("2_5dd4i") [node name="AboutWindow" type="AcceptDialog" parent="."] +canvas_item_default_texture_filter = 0 title = "" initial_position = 2 size = Vector2i(300, 300) unresizable = true borderless = true -theme_override_styles/panel = SubResource("StyleBoxTexture_jl0ue") -ok_button_text = "Close" +ok_button_text = "close" [node name="ScrollContainer" type="ScrollContainer" parent="AboutWindow"] -offset_left = 6.0 -offset_top = 6.0 -offset_right = 294.0 -offset_bottom = 243.0 +offset_left = 8.0 +offset_top = 8.0 +offset_right = 292.0 +offset_bottom = 241.0 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -100,16 +92,7 @@ size_flags_vertical = 3 layout_mode = 2 size_flags_horizontal = 3 bbcode_enabled = true -text = "[p][center][font_size=24]About[/font_size][/center][/p] -[p]Made in [color=steel_blue]Godot Engine [img=16]res://icon.svg[/img][/color][/p] -[p] -Made by: [ul] -[p]Rendo - programmer, gamedesigner[/p] -[p]Slaimy - graphics designer, gamedesigner[/p] -[p]CaTronick - graphics designer, gamedesigner[/p] -[/ul] -[/p] -[p]All rights for Plants versus Zombies franchise belong to PopCap games[/p]" +text = "about_screen" fit_content = true scroll_active = false @@ -141,11 +124,11 @@ offset_bottom = 275.0 [node name="PlayButton" type="Button" parent="Buttons/GameButtons"] layout_mode = 2 -text = "Play" +text = "play" [node name="ExitButton" type="Button" parent="Buttons/GameButtons"] layout_mode = 2 -text = "Exit" +text = "exit" [node name="InfoButtons" type="VBoxContainer" parent="Buttons"] layout_mode = 0 @@ -154,9 +137,14 @@ offset_top = 188.0 offset_right = 86.0 offset_bottom = 235.0 -[node name="Button" type="Button" parent="Buttons/InfoButtons"] +[node name="AboutButton" type="Button" parent="Buttons/InfoButtons"] layout_mode = 2 -text = "About" +text = "about" + +[node name="AlmanachButton" type="Button" parent="Buttons/InfoButtons"] +layout_mode = 2 +icon = ExtResource("7_flqon") +icon_alignment = 1 [node name="SACRIFICE" type="TextureButton" parent="Buttons"] layout_mode = 0 @@ -186,9 +174,14 @@ volume_db = -20.0 autoplay = true bus = &"MusicBus" +[node name="Almanach" parent="." instance=ExtResource("12_rcqid")] +visible = false +layout_mode = 1 + [connection signal="meta_clicked" from="PrototypeWindow/ScrollContainer/PrototypeNotification" to="PrototypeWindow/ScrollContainer/PrototypeNotification" method="_on_meta_clicked"] [connection signal="pressed" from="Buttons/GameButtons/PlayButton" to="Buttons" method="_on_play_button_pressed"] [connection signal="pressed" from="Buttons/GameButtons/ExitButton" to="Buttons" method="_on_exit_button_pressed"] -[connection signal="pressed" from="Buttons/InfoButtons/Button" to="Buttons" method="_on_button_pressed"] +[connection signal="pressed" from="Buttons/InfoButtons/AboutButton" to="Buttons" method="_on_button_pressed"] +[connection signal="pressed" from="Buttons/InfoButtons/AlmanachButton" to="Buttons" method="_on_almanach_button_pressed"] [connection signal="close_requested" from="Buttons/SACRIFICE/CONFIRM" to="Buttons/SACRIFICE" method="_on_confirm_close_requested"] [connection signal="confirmed" from="Buttons/SACRIFICE/CONFIRM" to="Buttons/SACRIFICE" method="_on_confirm_confirmed"] diff --git a/scripts/components/IEntity.cs b/scripts/components/IEntity.cs index 3a6368e..7446c70 100644 --- a/scripts/components/IEntity.cs +++ b/scripts/components/IEntity.cs @@ -9,7 +9,9 @@ public interface IEntity { public int Hp { get; } public int MaxHp { get; } - public void TakeDamage(int amount,Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL); + public void TakeDamage(int amount, Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL); public void Heal(int amount, Node origin); + public void DisableBrain(); + public void EnableBrain(); } \ No newline at end of file diff --git a/scripts/components/gui/almanach/AlmanachGrid.cs b/scripts/components/gui/almanach/AlmanachGrid.cs new file mode 100644 index 0000000..bc6e3ce --- /dev/null +++ b/scripts/components/gui/almanach/AlmanachGrid.cs @@ -0,0 +1,36 @@ +using Godot; +using Newlon.Components.GUI.Seedpackets; + +public partial class AlmanachGrid : GridContainer +{ + private PackedScene _plantCard; + [Export] + private bool _zombies; + public override void _Ready() + { + _plantCard = ResourceLoader.Load("res://scenes/gui/seedpacket.tscn"); + + if (_zombies) + { + foreach (var resource in GameRegistry.GetZombies()) + { + Seedpacket slot = _plantCard.Instantiate(); + AddChild(slot); + + slot.SetResource(resource); + slot.SetHandler(new AlmanachHandler(slot)); + } + } + else + { + foreach (var resource in GameRegistry.GetPlants()) + { + Seedpacket slot = _plantCard.Instantiate(); + AddChild(slot); + + slot.SetResource(resource); + slot.SetHandler(new AlmanachHandler(slot)); + } + } + } +} diff --git a/scripts/components/gui/almanach/AlmanachGrid.cs.uid b/scripts/components/gui/almanach/AlmanachGrid.cs.uid new file mode 100644 index 0000000..e30ab52 --- /dev/null +++ b/scripts/components/gui/almanach/AlmanachGrid.cs.uid @@ -0,0 +1 @@ +uid://0mvmfvwe1bc7 diff --git a/scripts/components/gui/choose_your_seeds/GridLoader.cs b/scripts/components/gui/choose_your_seeds/GridLoader.cs index 81b04e6..f728588 100644 --- a/scripts/components/gui/choose_your_seeds/GridLoader.cs +++ b/scripts/components/gui/choose_your_seeds/GridLoader.cs @@ -17,7 +17,7 @@ public partial class GridLoader : GridContainer Seedpacket slot = _plantCard.Instantiate(); AddChild(slot); - slot.SetPlantResource(resource); + slot.SetResource(resource); slot.SetHandler(new ChoosableHandler(slot)); } } diff --git a/scripts/components/gui/choose_your_seeds/Previewport.cs b/scripts/components/gui/choose_your_seeds/Previewport.cs index 021718c..bb90799 100644 --- a/scripts/components/gui/choose_your_seeds/Previewport.cs +++ b/scripts/components/gui/choose_your_seeds/Previewport.cs @@ -1,11 +1,12 @@ using Godot; using Newlon; +using Newlon.Components; using Newlon.Components.GUI.Seedpackets; using Newlon.Components.Plants; public partial class Previewport : SubViewport { - private RuntimePlantData current_display; + private Node current_display; private Texture2D start_Field; [Export] private Label title; @@ -19,13 +20,14 @@ public partial class Previewport : SubViewport public void OnFocusChanged(Control node) { + if (GetParent().IsVisibleInTree() == false) return; if (node is Seedpacket packet) { - ChangeDisplay(packet.GetPlantResource()); + ChangeDisplay(packet.GetResource()); } } - private void ChangeDisplay(PlantResource resource) + private void ChangeDisplay(DisplayResource resource) { // Expand with updates if (current_display != null) @@ -38,11 +40,12 @@ public partial class Previewport : SubViewport } else GetNode("FrameField").Texture = start_Field; - current_display = resource.Scene.Instantiate(); - title.Text = resource.display_name; - description.Text = resource.display_description; + current_display = resource.Scene.Instantiate(); + title.Text = Tr(resource.name_key); + description.Text = Tr(resource.description_key); AddChild(current_display); - current_display.DisableBrain(); + if (current_display is IEntity entity) + entity.DisableBrain(); } } diff --git a/scripts/components/gui/main_menu_rich_text.gd b/scripts/components/gui/main_menu_rich_text.gd index 57174b2..6573174 100644 --- a/scripts/components/gui/main_menu_rich_text.gd +++ b/scripts/components/gui/main_menu_rich_text.gd @@ -1,5 +1,4 @@ extends RichTextLabel - func _on_meta_clicked(meta: Variant) -> void: OS.shell_open(meta) diff --git a/scripts/components/gui/menu_buttons.gd b/scripts/components/gui/menu_buttons.gd index e6682e4..9c89ded 100644 --- a/scripts/components/gui/menu_buttons.gd +++ b/scripts/components/gui/menu_buttons.gd @@ -14,3 +14,8 @@ func _on_exit_button_pressed() -> void: func _on_button_pressed() -> void: $"../AboutWindow".popup_centered() $ChannelPlayer.call("Play") + + +func _on_almanach_button_pressed() -> void: + $"../Almanach".visible = true + $ChannelPlayer.call("Play") diff --git a/scripts/components/gui/seedpackets/AlmanachHandler.cs b/scripts/components/gui/seedpackets/AlmanachHandler.cs new file mode 100644 index 0000000..66b96d3 --- /dev/null +++ b/scripts/components/gui/seedpackets/AlmanachHandler.cs @@ -0,0 +1,10 @@ +using Godot; + +namespace Newlon.Components.GUI.Seedpackets; + +public class AlmanachHandler : SeedpacketHandler +{ + public AlmanachHandler(Seedpacket owner) : base(owner) + { + } +} diff --git a/scripts/components/gui/seedpackets/AlmanachHandler.cs.uid b/scripts/components/gui/seedpackets/AlmanachHandler.cs.uid new file mode 100644 index 0000000..7fcdcce --- /dev/null +++ b/scripts/components/gui/seedpackets/AlmanachHandler.cs.uid @@ -0,0 +1 @@ +uid://pse018r220mt diff --git a/scripts/components/gui/seedpackets/ChoosableHandler.cs b/scripts/components/gui/seedpackets/ChoosableHandler.cs index d537b04..306309a 100644 --- a/scripts/components/gui/seedpackets/ChoosableHandler.cs +++ b/scripts/components/gui/seedpackets/ChoosableHandler.cs @@ -13,7 +13,7 @@ public class ChoosableHandler : SeedpacketHandler, ISeedpacketPress var hotbarSeedpacket = Seedpacket.Prefab.Instantiate(); LevelGUIElements.Instance.SeedpacketsHotbar.AddChild(hotbarSeedpacket); - hotbarSeedpacket.SetPlantResource(_owner.GetPlantResource()); + hotbarSeedpacket.SetResource(_owner.GetResource()); var pregameHandler = new HotbarPregameHandler(hotbarSeedpacket); hotbarSeedpacket.SetHandler(pregameHandler); diff --git a/scripts/components/gui/seedpackets/HotbarHandler.cs b/scripts/components/gui/seedpackets/HotbarHandler.cs index dfc90bc..7a20f12 100644 --- a/scripts/components/gui/seedpackets/HotbarHandler.cs +++ b/scripts/components/gui/seedpackets/HotbarHandler.cs @@ -10,13 +10,13 @@ public class HotbarHandler : SeedpacketHandler, ISeedpacketPress, ISeedpacketPro public void Pressed() { - PlantField.Instance.SetPlant(_owner, _owner.GetPlantResource()); + PlantField.Instance.SetPlant(_owner, _owner.GetResource()); AudioSequencer.Play("lift_seed", Seedpacket.LiftStream); } public void Process() { - _owner.disablePacket = RuntimeLevelData.Instance.SunCount < _owner.GetPlantResource().Cost; + _owner.disablePacket = RuntimeLevelData.Instance.SunCount < _owner.GetResource().Cost; } public void OnUnfocused() { diff --git a/scripts/components/gui/seedpackets/Seedpacket.cs b/scripts/components/gui/seedpackets/Seedpacket.cs index 5006b52..30e3691 100644 --- a/scripts/components/gui/seedpackets/Seedpacket.cs +++ b/scripts/components/gui/seedpackets/Seedpacket.cs @@ -8,7 +8,7 @@ public partial class Seedpacket : TextureButton public static AudioStream UntapStream; public static AudioStream LiftStream; private const string PATH_TO_PACKED_SCENE = "res://scenes/gui/seedpacket.tscn"; - private PlantResource _resource; + private DisplayResource _resource; private Label _cost; private TextureRect _icon; private Timer _timer; @@ -50,14 +50,14 @@ public partial class Seedpacket : TextureButton } if (_handler is ISeedpacketProcess processHandler) processHandler.Process(); } - public void SetPlantResource( PlantResource resource ) + public void SetResource(DisplayResource resource ) { _resource = resource; UpdateContents(); } - public PlantResource GetPlantResource() + public DisplayResource GetResource() { return _resource; } diff --git a/scripts/components/level/PlantField.cs b/scripts/components/level/PlantField.cs index a08f074..e82c9b1 100644 --- a/scripts/components/level/PlantField.cs +++ b/scripts/components/level/PlantField.cs @@ -7,7 +7,7 @@ namespace Newlon.Components.Level; public partial class PlantField : Node2D { private Node2D _plantSetter; - private PlantResource _resource; + private DisplayResource _resource; private Seedpacket _slot; private bool _previousCanPlace; private ChannelPlayer player; @@ -21,18 +21,18 @@ public partial class PlantField : Node2D player = GetNode("PlantPlayer"); } - public void SetPlant(Seedpacket slot, PlantResource plant) + public void SetPlant(Seedpacket slot, DisplayResource resource) { - _resource = plant; + _resource = resource; _slot = slot; - if (plant == null) + if (resource == null) { foreach(var child in _plantSetter.GetChildren()) child.QueueFree(); } else { - var scene = plant.Scene.Instantiate(); + var scene = resource.Scene.Instantiate(); _plantSetter.AddChild(scene); scene.UseParentMaterial = true; } @@ -93,7 +93,7 @@ public partial class PlantField : Node2D var plant = _resource.Scene.Instantiate(); PoolContainer.Instance.Plants.AddChild(plant); plant.GlobalPosition = (_plantSetter.GlobalPosition / Utility.Tile).Ceil() * Utility.Tile - new Vector2(20, 14); - plant.Resource = _resource; + plant.Resource = (PlantResource)_resource; PoolContainer.Instance.EntityField[_resource.Layer].Add(plant.GlobalPosition, plant); diff --git a/scripts/components/level/RuntimeLevelData.cs b/scripts/components/level/RuntimeLevelData.cs index 6234d4f..d7fb28c 100644 --- a/scripts/components/level/RuntimeLevelData.cs +++ b/scripts/components/level/RuntimeLevelData.cs @@ -15,7 +15,7 @@ public partial class RuntimeLevelData : Node } [Export] - public int SunCount { get; private set; } = 0; + public float SunCount { get; private set; } = 0; public event Action OnLevelStateChanged; public static RuntimeLevelData Instance { get; private set; } @@ -29,17 +29,17 @@ public partial class RuntimeLevelData : Node } #region Sun - public void AddSun(int amount) + public void AddSun(float amount) { SunCount += amount; } - public void SpendSun(int amount) + public void SpendSun(float amount) { SunCount -= amount; } - public bool CheckSpendSun(int amount) + public bool CheckSpendSun(float amount) { if (SunCount - amount < 0) return false; diff --git a/scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs b/scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs index 992e0e2..1927cbe 100644 --- a/scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs +++ b/scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs @@ -38,16 +38,16 @@ public partial class SurvivalZombieSpawner : Node cachedTankPool.Sort((x, y) => { - return (int)(x.cost - y.cost); + return (int)(x.Cost - y.Cost); }); cachedHordePool.Sort((x, y) => { - return (int)(x.cost - y.cost); + return (int)(x.Cost - y.Cost); }); - minSupportPoints = cachedSupportPool[0].cost; - minTankPoints = cachedTankPool[0].cost; - minHordePoints = cachedHordePool[0].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; } @@ -107,10 +107,10 @@ public partial class SurvivalZombieSpawner : Node while (given_points >= minSupportPoints) { var chosen_zombie = cachedSupportPool[rng.RandiRange(0, cachedSupportPool.Count - 1)]; - if (given_points - chosen_zombie.cost >= 0) + if (given_points - chosen_zombie.Cost >= 0) { wave.Add(chosen_zombie); - given_points -= chosen_zombie.cost; + given_points -= chosen_zombie.Cost; } } return given_points; @@ -124,14 +124,14 @@ public partial class SurvivalZombieSpawner : Node int zombieIndex = cachedTankPool.Count - 1; while (given_points >= minSupportPoints && zombieIndex > -1) { - if (cachedTankPool[zombieIndex].cost > given_points) + if (cachedTankPool[zombieIndex].Cost > given_points) { zombieIndex--; continue; } var chosen_zombie = cachedTankPool[zombieIndex]; wave.Add(chosen_zombie); - given_points -= chosen_zombie.cost; + given_points -= chosen_zombie.Cost; } return given_points; } @@ -141,18 +141,18 @@ public partial class SurvivalZombieSpawner : Node { return given_points; } - while (is_big == false && cachedHordePool.Count > 1 && cachedHordePool[1].cost * 15 <= given_points) + while (is_big == false && cachedHordePool.Count > 1 && cachedHordePool[1].Cost * 15 <= given_points) { cachedHordePool.RemoveAt(0); - minHordePoints = cachedHordePool[0].cost; + 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) + if (given_points - chosen_zombie.Cost >= 0) { wave.Add(chosen_zombie); - given_points -= chosen_zombie.cost; + given_points -= chosen_zombie.Cost; } } return given_points; diff --git a/scripts/components/level/zombe_spawners/ZombieSequencer.cs b/scripts/components/level/zombe_spawners/ZombieSequencer.cs index 5f4b284..7c0f1c6 100644 --- a/scripts/components/level/zombe_spawners/ZombieSequencer.cs +++ b/scripts/components/level/zombe_spawners/ZombieSequencer.cs @@ -58,7 +58,7 @@ public partial class ZombieSequencer : Node2D private void Spawn(string id, int lane) { - RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).scene.Instantiate(); + RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).Scene.Instantiate(); PoolContainer.Instance.Zombies.AddChild(zombie); zombie.GlobalPosition = new Vector2(GlobalPosition.X, Utility.RightFieldBoundary.Y - (lane - 1) * Utility.TileHeight); diff --git a/scripts/components/zombies/RuntimeZombieData.cs b/scripts/components/zombies/RuntimeZombieData.cs index 2faa22d..e0fcef0 100644 --- a/scripts/components/zombies/RuntimeZombieData.cs +++ b/scripts/components/zombies/RuntimeZombieData.cs @@ -146,5 +146,17 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe _activeEffectSlots[slot].Exit(this); _activeEffectSlots[slot] = null; } - #endregion + + public void DisableBrain() + { + GetNode("AnimationPlayer").ProcessMode = ProcessModeEnum.Pausable; + ProcessMode = ProcessModeEnum.Disabled; + } + + public void EnableBrain() + { + GetNode("AnimationPlayer").ProcessMode = ProcessModeEnum.Inherit; + ProcessMode = ProcessModeEnum.Inherit; + } + #endregion } diff --git a/scripts/resources/DisplayResource.cs b/scripts/resources/DisplayResource.cs new file mode 100644 index 0000000..fb98245 --- /dev/null +++ b/scripts/resources/DisplayResource.cs @@ -0,0 +1,20 @@ +using Godot; + +public partial class DisplayResource : 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; + public string internal_id; +} diff --git a/scripts/resources/DisplayResource.cs.uid b/scripts/resources/DisplayResource.cs.uid new file mode 100644 index 0000000..38bfd5f --- /dev/null +++ b/scripts/resources/DisplayResource.cs.uid @@ -0,0 +1 @@ +uid://j7wr5mj7j81b diff --git a/scripts/resources/PlantResource.cs b/scripts/resources/PlantResource.cs index 166af05..834f574 100644 --- a/scripts/resources/PlantResource.cs +++ b/scripts/resources/PlantResource.cs @@ -3,22 +3,6 @@ using Godot; namespace Newlon; [GlobalClass] -public partial class PlantResource : Resource +public partial class PlantResource : DisplayResource { - [Export] public string display_name; - [Export(PropertyHint.MultilineText)] public string display_description; - [Export] - public int 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 int Layer = 1; - [Export] public CustomSeedpacketFrame customFrame; - - public string internal_id; } diff --git a/scripts/resources/ZombieResource.cs b/scripts/resources/ZombieResource.cs index 55e5b4e..bee27b7 100644 --- a/scripts/resources/ZombieResource.cs +++ b/scripts/resources/ZombieResource.cs @@ -1,10 +1,6 @@ using Godot; [GlobalClass] -public partial class ZombieResource : Resource +public partial class ZombieResource : DisplayResource { - [Export] public float cost; - [Export] public PackedScene scene; - - public string internal_id; } diff --git a/translations/gui.csv b/translations/gui.csv new file mode 100644 index 0000000..c0462a2 --- /dev/null +++ b/translations/gui.csv @@ -0,0 +1,55 @@ +keys,en,ru +plants,Plants,Растения +zombies,Zombies,Зомби +lon_proto,"[center][wave amp=50.0 freq=5.0 connected=1][font_size=24]WELCOME TO LIBERATION OF NEIGHBOURVILLE PROTOTYPE![/font_size][/wave][/center] +Big thanks from me, Rendo, and our team! We appreciate any feedback, so consider reporting bugs to our [color=cyan][url=https://discord.gg/Y5Wk8H8EBY]discord server[/url][/color]. + +Liberation of Neighbourville is currently in early stages of development. However, we reached point when all essential systems and mechanics are ready. + +As for now, you can play survival endless with all currently made plants. Game includes some plants from first Plants versus Zombies, Aloe from sequel, three basic zombies and a hobo zombie. + +As for 0.2.X version, current roadmap contains:[ul] +Adventure mode +New plants and zombies, obviously +More ways to play +[/ul]","[center][wave amp=50.0 freq=5.0 connected=1][font_size=24]ДОБРО ПОЖАЛОВАТЬ ПРОТОТИП LIBERATION OF NEIGHBOURVILLE![/font_size][/wave][/center] +Огромное спасибо от меня, Рендо, и нашей команды! Мы рады любому фидбеку, так что присоединяйтесь к нашему [color=cyan][url=https://discord.gg/Y5Wk8H8EBY]дискорд серверу[/url][/color]. + + +Liberation of Neighbourville на данный момент на ранних этапах разработки. Тем не менее, мы достигли момента, когда все необходимые системы и механики готовы. + +Ну, а сейчас вы можете сыграть в бесконечный режим со всеми сделанными на данный момент растениями. Игра включает в себя некоторые растения из первой части, Алоэ из сиквела, три базовых зомби и бездомного зомби. + +На момент версии 0.2.X, дорожная карта содержит:[ul] +Режим приключений +Новые растения и зомби, очевидно +Больше способов играть +[/ul]" +play,Play,Играть +exit,Exit,Выйти +about,About,О нас +restart,Restart,Перезапустить +continue,Continue,Продолжить +about_screen,"[center][font_size=24]About[/font_size][/center] +Made in [color=steel_blue]Godot Engine [img=16]res://icon.svg[/img][/color] + +Made by: [ul] +Rendo - programmer, gamedesigner +Slaimy - graphics designer, gamedesigner +CaTronick - graphics designer, gamedesigner +[/ul] + +All rights for Plants versus Zombies franchise belong to PopCap games","[center][font_size=24]О нас[/font_size][/center] +Сделано в [color=steel_blue]Godot Engine [img=16]res://icon.svg[/img][/color] + +Благодаря: [ul] +Rendo - программист, геймдизайнер +Slaimy - дизайнер графики, геймдизайнер +CaTronick - дизайнер графики, геймдизайнер +[/ul] + +Все права на Plants versus Zombies франшизу принадлежат PopCap games." +close,Close,Закрыть +sfx,SFX,Звуки +music,Music,Музыка +paused,Paused,Игра на паузе diff --git a/translations/gui.csv.import b/translations/gui.csv.import new file mode 100644 index 0000000..3e16be7 --- /dev/null +++ b/translations/gui.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://0pm71mck1ljf" + +[deps] + +files=["res://translations/gui.en.translation", "res://translations/gui.ru.translation"] + +source_file="res://translations/gui.csv" +dest_files=["res://translations/gui.en.translation", "res://translations/gui.ru.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/translations/gui.en.translation b/translations/gui.en.translation new file mode 100644 index 0000000..0c1052f Binary files /dev/null and b/translations/gui.en.translation differ diff --git a/translations/gui.ru.translation b/translations/gui.ru.translation new file mode 100644 index 0000000..ed37c92 Binary files /dev/null and b/translations/gui.ru.translation differ diff --git a/translations/plants.csv b/translations/plants.csv new file mode 100644 index 0000000..f322a3b --- /dev/null +++ b/translations/plants.csv @@ -0,0 +1,83 @@ +keys,en,ru +aloe,Aloe,Алоэ +aloe_desc,"[p]Aloe heals injured plants.[/p] +[p]Health points: [color=DARK_RED]3 bites[/color][/p] +[p]Reload time: [color=DARK_RED]15 seconds[/color].[/p] +[p]Ability recharge time: [color=DARK_RED]20 seconds[/color].[/p] +[p]Heals plant when it has [color=DARK_RED]third[/color] of its health.[/p]","Алоэ лечит израненные растения. +Очки здоровья: [color=dark_red]3 укуса[/color]. +Время перезарядки: [color=dark_red]15 секунд[/color]. +Время перезарядки способности: [color=dark_red]20 секунд[/color]. +Лечит растения [color=DARK_RED]с третью[/color] здоровья." +garlic,Garlic,Чеснок +garlic_desc,"[p]Redirects zombies that bite it.[/p] +[p]Health points: [color=DARK_RED]20 bites[/color][/p] +[p]Reload time: [color=DARK_RED]15 seconds[/color].[/p]","Перенаправляет зомби, которые его кусают. +Очки здоровья: [color=DARK_RED]20 укусов[/color] +Время перезарядки: [color=DARK_RED]15 секунд[/color]." +peashooter,Peashooter,Горохострел +peashooter_desc,"[p]Simply shoots peas at zombies on the lane[/p] +[p]Health points: [color=DARK_RED]3 bites[/color].[/p] +[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] +[p]Pea damage: [color=DARK_RED]1 pea[/color].[/p] +[p]Firerate: [color=DARK_RED]1.5 seconds[/color].[/p]","Просто стреляет в зомби на линии. +Очки здоровья: [color=DARK_RED]3 укуса[/color]. +Время перезарядки: [color=DARK_RED]5 секунд[/color]. +Урон от гороха: [color=DARK_RED]1 горошина[/color]. +Задержка стрельбы: [color=DARK_RED]1.5 секунды[/color]." +potatomine,Potato mine,Картофельная мина +potatomine_desc,"[p]Explodes when stepped on. Needs some time to prime.[/p] +[p]Health points: [color=DARK_RED]2 bites[/color].[/p] +[p]Reload time: [color=DARK_RED]25 seconds[/color].[/p] +[p]Explosion damage: [color=DARK_RED]600 peas[/color].[/p] +[p]Prime time: [color=DARK_RED]15 seconds[/color].[/p]","Взрывается когда на неё наступают. Требует некоторое время для роста. +Очки здоровья: [color=DARK_RED]2 Укуса[/color]. +Время перезарядки: [color=DARK_RED]25 seconds[/color]. +Урон от взрыва: [color=DARK_RED]600 горошин[/color]. +Время роста: [color=DARK_RED]15 seconds[/color]." +snowpea,Snowpea,Снежный горох +snowpea_desc,"[p]Shoots slowing peas at zombies.[/p] +[p]Health points: [color=DARK_RED]3 bites[/color].[/p] +[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] +[p]Pea damage: [color=DARK_RED]1 pea[/color].[/p] +[p]Firerate: [color=DARK_RED]1.5 seconds[/color].[/p] +[p]Slow percentage: [color=STEEL_BLUE]25%[/color].[/p]","Стреляет замедляющими горошинами в зомби. +Очки здоровья: [color=DARK_RED]3 укуса[/color]. +Время перезарядки: [color=DARK_RED]5 секунд[/color]. +Урон от гороха: [color=DARK_RED]1 горошина[/color]. +Задержка стрельбы: [color=DARK_RED]1.5 секунды[/color]. +Процент замедления: [color=STEEL_BLUE]25%[/color]." +spikeweed,Spikeweed,Колючка +spikeweed_desc,"[p]Attacks zombies that step on it.[/p] +[p]Health points: [color=DARK_RED]3 bites[/color].[/p] +[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] +[p]Damage per second: [color=DARK_RED]0.9 peas[/color].[/p]","Атакует наступающих на неё зомби. +Очки здоровья: [color=DARK_RED]3 укуса[/color]. +Время перезарядки: [color=DARK_RED]5 секунд[/color]. +Урон в секунду: [color=DARK_RED]0.9 горошин[/color]." +sunflower,Sunflower,Подсолнух +sunflower_desc,"[p]Produces sun over time.[/p] +[p]Health points: [color=DARK_RED]3 bites[/color][/p] +[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] +[p]Initial sun production time: [color=DARK_RED]12 seconds[/color].[/p] +[p]Sun production time: [color=DARK_RED]24 seconds[/color](After first sun produced).[/p]","Производит солнце время от времени. +Очки здоровья: [color=DARK_RED]3 укуса[/color] +Время перезарядки: [color=DARK_RED]5 секунд[/color]. +Изначальная задержка выработки солнца: [color=DARK_RED]12 секунд[/color]. +Задержка выработки солнца: [color=DARK_RED]24 секунды[/color](После первого солнца)." +threepeater,Threepeater,Тристрел +threepeater_desc,"[p]Shoots peas at zombies in three lanes.[/p] +[p]Health points: [color=DARK_RED]3 bites[/color].[/p] +[p]Reload time: [color=DARK_RED]5 seconds[/color].[/p] +[p]Pea damage: [color=DARK_RED]1 pea[/color] ([color=DARK_RED]3 pea[/color] when in close quarters).[/p] +[p]Firerate: [color=DARK_RED]1.6 seconds[/color].[/p]","Стреляет в зомби по трём линиям. +Очки здоровья: [color=DARK_RED]3 укуса[/color]. +Время перезарядки: [color=DARK_RED]5 секунд[/color]. +Урон от гороха: [color=DARK_RED]1 горошина[/color] ([color=DARK_RED]3 горошины[/color] вблизи). +Задержка стрельбы: [color=DARK_RED]1.6 секунд[/color]." +wallnut,Wallnut,Стенорех +wallnut_desc,"[p]Absorbs zombie damage. Does nothing special[/p] +[p]Health points: [color=DARK_RED]60 bites[/color][/p] +[p]Reload time: [color=DARK_RED]20 seconds[/color].[/p]","Принимает на себя урон от зомби. Ничего интересного. +Очки здоровья: [color=DARK_RED]60 укусов[/color] +Время перезарядки: [color=DARK_RED]20 секунд[/color]." diff --git a/translations/plants.csv.import b/translations/plants.csv.import new file mode 100644 index 0000000..3a2532f --- /dev/null +++ b/translations/plants.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://dw0l3ejdd3xym" + +[deps] + +files=["res://translations/plants.en.translation", "res://translations/plants.ru.translation"] + +source_file="res://translations/plants.csv" +dest_files=["res://translations/plants.en.translation", "res://translations/plants.ru.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/translations/plants.en.translation b/translations/plants.en.translation new file mode 100644 index 0000000..80e6a4e Binary files /dev/null and b/translations/plants.en.translation differ diff --git a/translations/plants.ru.translation b/translations/plants.ru.translation new file mode 100644 index 0000000..5662236 Binary files /dev/null and b/translations/plants.ru.translation differ diff --git a/translations/zombies.csv b/translations/zombies.csv new file mode 100644 index 0000000..fda31d7 --- /dev/null +++ b/translations/zombies.csv @@ -0,0 +1,49 @@ +keys,en,ru +basic,Basic zombie,Обычный зомби +basic_desc,"The most basic zombie that Zomboss has. +Health points: [color=darkred]7 peas[/color]. +Walk speed: [color=darkred]0.2 tiles/second[/color]. +Attack speed: [color=darkred]1 Hz[/color]. +Attack damage: [color=darkred]1 bite[/color]. ","Самый обычный зомби, который есть у Зомбосса. +Очки здоровья: [color=darkred]7 горошин[/color]. +Скорость ходьбы: [color=darkred]0.2 клеток/сек[/color]. +Скорость атаки: [color=darkred]1 Гц[/color]. +Урон от атаки: [color=darkred]1 укус[/color]." +buckethead,Buckethead,Ведроголовый +buckethead_desc,"Wears metal to protect his remaining brains. Equivalent of ~7 zombies. +Health points: [color=darkred]7 peas[/color]. +Armour points: [color=darkred]39 peas[/color]. +Walk speed: [color=darkred]0.2 tiles/second[/color]. +Attack speed: [color=darkred]1 Hz[/color]. +Attack damage: [color=darkred]1 bite[/color]. ","Носит ведро чтобы защитить остатки мозгов. Равен примерно 7 зомби. +Очки здоровья: [color=darkred]7 горошин[/color]. +Очки брони: [color=darkred]39 горошин[/color]. +Скорость ходьбы: [color=darkred]0.2 клеток/сек/color]. +Скорость атаки: [color=darkred]1 Гц[/color]. +Урон от атаки: [color=darkred]1 укус[/color]." +conehead,Conehead,Конусоголовый +conehead_desc,"Armoured version of basic zombie. Equivalent of ~3 zombies. +Health points: [color=darkred]7 peas[/color]. +Armour points: [color=darkred]13 peas[/color]. +Walk speed: [color=darkred]0.2 tiles/second[/color]. +Attack speed: [color=darkred]1 Hz[/color]. +Attack damage: [color=darkred]1 bite[/color]. ","Бронированная версия базового зомби. Равен примерно трём зомби. +Очки здоровья: [color=darkred]7 горошин[/color]. +Очки брони: [color=darkred]13 горошин[/color]. +Скорость ходьбы: [color=darkred]0.2 клеток/сек[/color]. +Скорость атаки: [color=darkred]1 Гц[/color]. +Урон от атаки: [color=darkred]1 укус[/color]." +hobo,Trash can zombie,Зомби в мусорке +hobo_desc,"Some time in the past he met a great conqueror. Hates to live without his can. Equivalent of ~8 zombies. +Health points: [color=darkred]13 peas[/color]. +Armour points: [color=darkred]39 peas[/color]. +Walk speed: [color=darkred]0.2 tiles/second[/color]. +Run speed: [color=darkred]0.6 tiles/second[/color]. +Attack speed: [color=darkred]1 Hz[/color]. +Attack damage: [color=darkred]1 bite[/color]. ","Однажды повстречал великого полководца. Ненавидит жить без своего ведра. Равен примерно 8 зомби. +Очки здоровья: [color=darkred]13 горошин[/color]. +Armour points: [color=darkred]39 горошин[/color]. +Скорость ходьбы: [color=darkred]0.2 клеток/сек[/color]. +Скорость бега: [color=darkred]0.6 клеток/сек[/color]. +Скорость атаки: [color=darkred]1 Гц[/color]. +Урон от атаки: [color=darkred]1 укус[/color]. " diff --git a/translations/zombies.csv.import b/translations/zombies.csv.import new file mode 100644 index 0000000..85f447e --- /dev/null +++ b/translations/zombies.csv.import @@ -0,0 +1,17 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://dfb33ltubix1g" + +[deps] + +files=["res://translations/zombies.en.translation", "res://translations/zombies.ru.translation"] + +source_file="res://translations/zombies.csv" +dest_files=["res://translations/zombies.en.translation", "res://translations/zombies.ru.translation"] + +[params] + +compress=true +delimiter=0 diff --git a/translations/zombies.en.translation b/translations/zombies.en.translation new file mode 100644 index 0000000..45f31c8 Binary files /dev/null and b/translations/zombies.en.translation differ diff --git a/translations/zombies.ru.translation b/translations/zombies.ru.translation new file mode 100644 index 0000000..aa9df63 Binary files /dev/null and b/translations/zombies.ru.translation differ