This commit is contained in:
Rendo 2025-07-03 19:34:09 +05:00
commit b932e82555
39 changed files with 575 additions and 78 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

@ -1,3 +1,7 @@
[gd_resource type="AtlasTexture" format=3 uid="uid://drydueofrb448"]
[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)

View file

@ -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)

View file

@ -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)

View file

@ -4,4 +4,4 @@
[resource]
atlas = ExtResource("1_bs0nq")
region = Rect2(77, 1, 14, 11)
region = Rect2(77, 0, 14, 12)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -4,4 +4,4 @@
[resource]
atlas = ExtResource("1_o3v7f")
region = Rect2(0, 0, 77, 77)
region = Rect2(77, 12, 15, 15)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -18,16 +18,16 @@ metadata/_custom_type_script = "uid://3m7xks3xq3hl"
[resource]
script = ExtResource("1_vw2kg")
Layer = 1
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
Cost = 75.0
Scene = ExtResource("2_6a4ia")
ReloadTime = 15.0
ReloadProgress = 0.0
Preview = ExtResource("1_t4137")
Layer = 1
customFrame = SubResource("Resource_5me4i")

View file

@ -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")

View file

@ -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")
display_name = "Basic zombie"
display_description = ""
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"

View file

@ -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")
display_name = "Buckethead zombie"
display_description = ""
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"

View file

@ -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")
display_name = "Conehead zombie"
display_description = ""
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"

View file

@ -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")
display_name = "Garbage can zombie"
display_description = ""
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"

171
scenes/gui/almanach.tscn Normal file
View file

@ -0,0 +1,171 @@
[gd_scene load_steps=7 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://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"]
[sub_resource type="ViewportTexture" id="ViewportTexture_ru62c"]
viewport_path = NodePath("Plants/Infobox/FrameAndTitle/Frame/Previewport")
[sub_resource type="ViewportTexture" id="ViewportTexture_7yl8g"]
viewport_path = NodePath("Zombies/Infobox/FrameAndTitle/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
[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="Frame" type="TextureRect" parent="Plants/Infobox/FrameAndTitle"]
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/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/Frame/Previewport"]
texture = ExtResource("3_oy57w")
[node name="Camera2D" type="Camera2D" parent="Plants/Infobox/FrameAndTitle/Frame/Previewport"]
[node name="Render" type="TextureRect" parent="Plants/Infobox/FrameAndTitle/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="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="Frame" type="TextureRect" parent="Zombies/Infobox/FrameAndTitle"]
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/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/Frame/Previewport"]
texture = ExtResource("3_oy57w")
[node name="Camera2D" type="Camera2D" parent="Zombies/Infobox/FrameAndTitle/Frame/Previewport"]
position = Vector2(0, -45)
[node name="Render" type="TextureRect" parent="Zombies/Infobox/FrameAndTitle/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="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

View file

@ -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();
}

View file

@ -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<PackedScene>("res://scenes/gui/seedpacket.tscn");
if (_zombies)
{
foreach (var resource in GameRegistry.GetZombies())
{
Seedpacket slot = _plantCard.Instantiate<Seedpacket>();
AddChild(slot);
slot.SetResource(resource);
slot.SetHandler(new AlmanachHandler(slot));
}
}
else
{
foreach (var resource in GameRegistry.GetPlants())
{
Seedpacket slot = _plantCard.Instantiate<Seedpacket>();
AddChild(slot);
slot.SetResource(resource);
slot.SetHandler(new AlmanachHandler(slot));
}
}
}
}

View file

@ -0,0 +1 @@
uid://0mvmfvwe1bc7

View file

@ -17,7 +17,7 @@ public partial class GridLoader : GridContainer
Seedpacket slot = _plantCard.Instantiate<Seedpacket>();
AddChild(slot);
slot.SetPlantResource(resource);
slot.SetResource(resource);
slot.SetHandler(new ChoosableHandler(slot));
}
}

View file

@ -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<Control>().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<Sprite2D>("FrameField").Texture = start_Field;
current_display = resource.Scene.Instantiate<RuntimePlantData>();
current_display = resource.Scene.Instantiate();
title.Text = resource.display_name;
description.Text = resource.display_description;
AddChild(current_display);
current_display.DisableBrain();
if (current_display is IEntity entity)
entity.DisableBrain();
}
}

View file

@ -0,0 +1,10 @@
using Godot;
namespace Newlon.Components.GUI.Seedpackets;
public class AlmanachHandler : SeedpacketHandler
{
public AlmanachHandler(Seedpacket owner) : base(owner)
{
}
}

View file

@ -0,0 +1 @@
uid://pse018r220mt

View file

@ -13,7 +13,7 @@ public class ChoosableHandler : SeedpacketHandler, ISeedpacketPress
var hotbarSeedpacket = Seedpacket.Prefab.Instantiate<Seedpacket>();
LevelGUIElements.Instance.SeedpacketsHotbar.AddChild(hotbarSeedpacket);
hotbarSeedpacket.SetPlantResource(_owner.GetPlantResource());
hotbarSeedpacket.SetResource(_owner.GetResource());
var pregameHandler = new HotbarPregameHandler(hotbarSeedpacket);
hotbarSeedpacket.SetHandler(pregameHandler);

View file

@ -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()
{

View file

@ -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;
}

View file

@ -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<ChannelPlayer>("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<Node2D>();
var scene = resource.Scene.Instantiate<Node2D>();
_plantSetter.AddChild(scene);
scene.UseParentMaterial = true;
}
@ -93,7 +93,7 @@ public partial class PlantField : Node2D
var plant = _resource.Scene.Instantiate<RuntimePlantData>();
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);

View file

@ -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<LevelStates> 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;

View file

@ -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;

View file

@ -58,7 +58,7 @@ public partial class ZombieSequencer : Node2D
private void Spawn(string id, int lane)
{
RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).scene.Instantiate<RuntimeZombieData>();
RuntimeZombieData zombie = GameRegistry.GetZombieByName(id).Scene.Instantiate<RuntimeZombieData>();
PoolContainer.Instance.Zombies.AddChild(zombie);
zombie.GlobalPosition = new Vector2(GlobalPosition.X, Utility.RightFieldBoundary.Y - (lane - 1) * Utility.TileHeight);

View file

@ -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>("AnimationPlayer").ProcessMode = ProcessModeEnum.Pausable;
ProcessMode = ProcessModeEnum.Disabled;
}
public void EnableBrain()
{
GetNode<AnimationPlayer>("AnimationPlayer").ProcessMode = ProcessModeEnum.Inherit;
ProcessMode = ProcessModeEnum.Inherit;
}
#endregion
}

View file

@ -0,0 +1,20 @@
using Godot;
public partial class DisplayResource : Resource
{
[Export] public string display_name;
[Export(PropertyHint.MultilineText)] public string display_description;
[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;
}

View file

@ -0,0 +1 @@
uid://j7wr5mj7j81b

View file

@ -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;
}

View file

@ -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;
}