diff --git a/NewLON.csproj b/NewLON.csproj index 53cc1f1..8eebc1d 100644 --- a/NewLON.csproj +++ b/NewLON.csproj @@ -1,8 +1,6 @@ - + - net6.0 - net7.0 - net8.0 + net8.0 true \ No newline at end of file diff --git a/NewLON.csproj.old b/NewLON.csproj.old new file mode 100644 index 0000000..53cc1f1 --- /dev/null +++ b/NewLON.csproj.old @@ -0,0 +1,8 @@ + + + net6.0 + net7.0 + net8.0 + true + + \ No newline at end of file diff --git a/assets/audio/music/Александр Зацепин - Увертюра.mp3 b/assets/audio/music/Александр Зацепин - Увертюра.mp3 new file mode 100644 index 0000000..cca00de Binary files /dev/null and b/assets/audio/music/Александр Зацепин - Увертюра.mp3 differ diff --git a/assets/audio/music/Александр Зацепин - Увертюра.mp3.import b/assets/audio/music/Александр Зацепин - Увертюра.mp3.import new file mode 100644 index 0000000..55d8c2c --- /dev/null +++ b/assets/audio/music/Александр Зацепин - Увертюра.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://djgyc7bbwcepp" +path="res://.godot/imported/Александр Зацепин - Увертюра.mp3-e30e81f3fa7e701b0522b5858d773a6d.mp3str" + +[deps] + +source_file="res://assets/audio/music/Александр Зацепин - Увертюра.mp3" +dest_files=["res://.godot/imported/Александр Зацепин - Увертюра.mp3-e30e81f3fa7e701b0522b5858d773a6d.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/fonts/pico12.ttf.import b/assets/fonts/pico12.ttf.import index 9f7f70d..281683e 100644 --- a/assets/fonts/pico12.ttf.import +++ b/assets/fonts/pico12.ttf.import @@ -23,6 +23,7 @@ allow_system_fallback=true force_autohinter=false hinting=1 subpixel_positioning=1 +keep_rounding_remainders=true oversampling=0.0 Fallbacks=null fallbacks=[] diff --git a/assets/shaders/CG_color_blender.gdshader.uid b/assets/shaders/CG_color_blender.gdshader.uid new file mode 100644 index 0000000..ca88a52 --- /dev/null +++ b/assets/shaders/CG_color_blender.gdshader.uid @@ -0,0 +1 @@ +uid://d0eo5uuj222c4 diff --git a/assets/shaders/greyscale.gdshader.uid b/assets/shaders/greyscale.gdshader.uid new file mode 100644 index 0000000..bad2753 --- /dev/null +++ b/assets/shaders/greyscale.gdshader.uid @@ -0,0 +1 @@ +uid://mt7vheq5modk diff --git a/assets/shaders/gui_masking.gdshader.uid b/assets/shaders/gui_masking.gdshader.uid new file mode 100644 index 0000000..d9ef27f --- /dev/null +++ b/assets/shaders/gui_masking.gdshader.uid @@ -0,0 +1 @@ +uid://dcp5tqcec2oi3 diff --git a/assets/shaders/shared_outline.gdshader.uid b/assets/shaders/shared_outline.gdshader.uid new file mode 100644 index 0000000..3a8919a --- /dev/null +++ b/assets/shaders/shared_outline.gdshader.uid @@ -0,0 +1 @@ +uid://bk8uy5se3fo0 diff --git a/assets/sprites/atlases/atlas1.png b/assets/sprites/atlases/atlas1.png index a33fa59..da6a360 100644 Binary files a/assets/sprites/atlases/atlas1.png and b/assets/sprites/atlases/atlas1.png differ diff --git a/assets/sprites/atlases/buttons.png b/assets/sprites/atlases/buttons.png new file mode 100644 index 0000000..97c8243 Binary files /dev/null and b/assets/sprites/atlases/buttons.png differ diff --git a/assets/sprites/atlases/buttons.png.import b/assets/sprites/atlases/buttons.png.import new file mode 100644 index 0000000..9f51d9c --- /dev/null +++ b/assets/sprites/atlases/buttons.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2c1erdy0xhkc" +path="res://.godot/imported/buttons.png-3aeb713c6d839208d95029b5a2b993c9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/atlases/buttons.png" +dest_files=["res://.godot/imported/buttons.png-3aeb713c6d839208d95029b5a2b993c9.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/summertime_saga.png b/assets/sprites/background_summer.png similarity index 100% rename from assets/sprites/summertime_saga.png rename to assets/sprites/background_summer.png diff --git a/assets/sprites/summertime_saga.png.import b/assets/sprites/background_summer.png.import similarity index 69% rename from assets/sprites/summertime_saga.png.import rename to assets/sprites/background_summer.png.import index 612f026..d23f720 100644 --- a/assets/sprites/summertime_saga.png.import +++ b/assets/sprites/background_summer.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://b0tb2hjum40aw" -path="res://.godot/imported/summertime_saga.png-a514e890c4a5a9aa20ec33143673fe69.ctex" +path="res://.godot/imported/background_summer.png-700d604c57ef18a3dd284f06667ad7ba.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/sprites/summertime_saga.png" -dest_files=["res://.godot/imported/summertime_saga.png-a514e890c4a5a9aa20ec33143673fe69.ctex"] +source_file="res://assets/sprites/background_summer.png" +dest_files=["res://.godot/imported/background_summer.png-700d604c57ef18a3dd284f06667ad7ba.ctex"] [params] diff --git a/assets/sprites/bucket.tres b/assets/sprites/bucket.tres new file mode 100644 index 0000000..a788e30 --- /dev/null +++ b/assets/sprites/bucket.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://ce04l60l6mhfk"] + +[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_h38vp"] + +[resource] +atlas = ExtResource("1_h38vp") +region = Rect2(356, 16, 40, 41) diff --git a/docs/ideas/location_ice-extractorium.md b/docs/ideas/location_ice-extractorium.md index fbd3d98..a9ced14 100644 --- a/docs/ideas/location_ice-extractorium.md +++ b/docs/ideas/location_ice-extractorium.md @@ -8,7 +8,7 @@ - Промёрзшая почва не даёт обычным расениям вцепится корнями, заставляя их скользить по поверхности. Зомби могут это использовать в свою пользу. - Вместо защиты отыгрывается нападение. Игроку требуется уничтожить все ледовые экстракторы. Игроки всё ещё могут потерять мозги. - Игрок находится на передвижной базе. (Не влияет на геймплей) -- Снегопад +- Растения может засыпать снегом. ## Растения diff --git a/docs/to-do/codebase.md b/docs/to-do/codebase.md index 49d31c6..db033a1 100644 --- a/docs/to-do/codebase.md +++ b/docs/to-do/codebase.md @@ -1 +1,2 @@ -- level scripting \ No newline at end of file +- level scripting +- !NEVER REMOVE! Documentate \ No newline at end of file diff --git a/project.godot b/project.godot index 937e7bc..91bd447 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ config_version=5 config/name="Liberation of the Neighbourville" run/main_scene="res://scenes/debug_lvl.tscn" -config/features=PackedStringArray("4.3", "C#", "Forward Plus") +config/features=PackedStringArray("4.4", "C#", "Forward Plus") config/icon="res://icon.png" config/windows_native_icon="res://icon.ico" diff --git a/scenes/debug_location.tscn b/scenes/debug_location.tscn new file mode 100644 index 0000000..77dfd92 --- /dev/null +++ b/scenes/debug_location.tscn @@ -0,0 +1,3 @@ +[gd_scene format=3 uid="uid://bu5ryqtgqwjp6"] + +[node name="DebugLocation" type="Node2D"] diff --git a/scenes/debug_lvl.tscn b/scenes/debug_lvl.tscn index 44f0aff..5f43c5d 100644 --- a/scenes/debug_lvl.tscn +++ b/scenes/debug_lvl.tscn @@ -1,14 +1,14 @@ [gd_scene load_steps=10 format=3 uid="uid://crxsvv7drckpw"] [ext_resource type="Script" path="res://scripts/components/level/RuntimeLevelData.cs" id="1_i3bf5"] -[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/summertime_saga.png" id="2_vmxhy"] -[ext_resource type="PackedScene" uid="uid://cg8713v6c5w15" path="res://scenes/pools.tscn" id="3_jv7x4"] +[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/background_summer.png" id="2_vmxhy"] +[ext_resource type="PackedScene" uid="uid://cg8713v6c5w15" path="res://scenes/level components/pools.tscn" id="3_jv7x4"] [ext_resource type="PackedScene" uid="uid://dpxxjfd5lv5sv" path="res://scenes/gui/choose_your_seeds.tscn" id="5_5e78h"] [ext_resource type="PackedScene" uid="uid://devn21c7luf45" path="res://scenes/level components/field_controller.tscn" id="5_lwpg6"] [ext_resource type="PackedScene" uid="uid://cfnmspei3k4p7" path="res://scenes/gui/runtime_gui.tscn" id="6_0baou"] [ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="6_ay12k"] [ext_resource type="Script" path="res://scripts/components/level/SunSpawner.cs" id="6_lkguy"] -[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="9_vwrdf"] +[ext_resource type="PackedScene" uid="uid://xu4i6tmkv00a" path="res://scenes/entities/Zombies/bucket_zombie.tscn" id="9_u7o5c"] [node name="debug_lvl" type="Node2D"] @@ -49,44 +49,7 @@ SunScene = ExtResource("6_ay12k") wait_time = 5.0 autostart = true -[node name="Zombie" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(806, 134) -_line = 3 - -[node name="Zombie2" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(824, 134) -_line = 3 - -[node name="Zombie3" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(779, 134) -_line = 3 - -[node name="Zombie4" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(848, 134) -_line = 3 - -[node name="Zombie5" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(801, 376) -_line = 5 - -[node name="Zombie6" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(819, 376) -_line = 5 - -[node name="Zombie7" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(774, 376) -_line = 5 - -[node name="Zombie8" parent="." instance=ExtResource("9_vwrdf")] -position = Vector2(843, 376) -_line = 5 +[node name="BucketZombie" parent="." instance=ExtResource("9_u7o5c")] +position = Vector2(729, 257) [connection signal="timeout" from="SunSpawner/Timer" to="SunSpawner" method="Spawn"] -[connection signal="OnHPChanged" from="Zombie" to="Zombie/AudioStreamPlayer2D" method="OnHPChanged"] -[connection signal="OnHPChanged" from="Zombie2" to="Zombie2/AudioStreamPlayer2D" method="OnHPChanged"] -[connection signal="OnHPChanged" from="Zombie3" to="Zombie3/AudioStreamPlayer2D" method="OnHPChanged"] -[connection signal="OnHPChanged" from="Zombie4" to="Zombie4/AudioStreamPlayer2D" method="OnHPChanged"] -[connection signal="OnHPChanged" from="Zombie5" to="Zombie5/AudioStreamPlayer2D" method="OnHPChanged"] -[connection signal="OnHPChanged" from="Zombie6" to="Zombie6/AudioStreamPlayer2D" method="OnHPChanged"] -[connection signal="OnHPChanged" from="Zombie7" to="Zombie7/AudioStreamPlayer2D" method="OnHPChanged"] -[connection signal="OnHPChanged" from="Zombie8" to="Zombie8/AudioStreamPlayer2D" method="OnHPChanged"] diff --git a/scenes/entities/Zombies/bucket_zombie.tscn b/scenes/entities/Zombies/bucket_zombie.tscn new file mode 100644 index 0000000..f6be64c --- /dev/null +++ b/scenes/entities/Zombies/bucket_zombie.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=5 format=3 uid="uid://xu4i6tmkv00a"] + +[ext_resource type="PackedScene" uid="uid://hhjbqkjqpt7x" path="res://scenes/entities/Zombies/cone_zombie.tscn" id="1_mwqpo"] +[ext_resource type="Shader" path="res://assets/shaders/CG_color_blender.gdshader" id="2_3mrqj"] +[ext_resource type="Texture2D" uid="uid://ce04l60l6mhfk" path="res://assets/sprites/bucket.tres" id="3_0nlp0"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_wdi07"] +resource_local_to_scene = true +shader = ExtResource("2_3mrqj") +shader_parameter/blend_color = Color(1, 1, 1, 1) +shader_parameter/amount = null + +[node name="BucketZombie" instance=ExtResource("1_mwqpo")] + +[node name="CanvasGroup" parent="." index="0"] +material = SubResource("ShaderMaterial_wdi07") + +[node name="Hat" parent="CanvasGroup" index="1"] +texture = ExtResource("3_0nlp0") + +[node name="Armor" parent="." index="8"] +_maxHP = 180 diff --git a/scenes/entities/Zombies/cone_zombie.tscn b/scenes/entities/Zombies/cone_zombie.tscn new file mode 100644 index 0000000..7c9edc6 --- /dev/null +++ b/scenes/entities/Zombies/cone_zombie.tscn @@ -0,0 +1,28 @@ +[gd_scene load_steps=6 format=3 uid="uid://hhjbqkjqpt7x"] + +[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="1_3dq4c"] +[ext_resource type="Shader" path="res://assets/shaders/CG_color_blender.gdshader" id="2_2dq8e"] +[ext_resource type="Script" path="res://scripts/components/Armor.cs" id="3_5s7in"] +[ext_resource type="Texture2D" uid="uid://ceqvdmude7cgg" path="res://assets/sprites/cone.tres" id="4_qdhik"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_sat5k"] +resource_local_to_scene = true +shader = ExtResource("2_2dq8e") +shader_parameter/blend_color = Color(1, 1, 1, 1) +shader_parameter/amount = null + +[node name="ConeZombie" node_paths=PackedStringArray("_armor") instance=ExtResource("1_3dq4c")] +_armor = NodePath("Armor") + +[node name="CanvasGroup" parent="." index="0"] +material = SubResource("ShaderMaterial_sat5k") + +[node name="Hat" type="Sprite2D" parent="CanvasGroup" index="1"] +position = Vector2(-6, -88) +texture = ExtResource("4_qdhik") + +[node name="Armor" type="Node" parent="." index="8"] +script = ExtResource("3_5s7in") +_maxHP = 60 + +[connection signal="ArmorLost" from="Armor" to="CanvasGroup/Hat" method="queue_free"] diff --git a/scenes/gui/choose_your_seeds.tscn b/scenes/gui/choose_your_seeds.tscn index a0470f2..e64d202 100644 --- a/scenes/gui/choose_your_seeds.tscn +++ b/scenes/gui/choose_your_seeds.tscn @@ -3,9 +3,9 @@ [ext_resource type="Theme" uid="uid://e8n88g31w7x7" path="res://resources/themes/ChooseYourSeeds.tres" id="1_bfo8i"] [ext_resource type="Texture2D" uid="uid://dr8a0rx42o3qy" path="res://assets/sprites/gui/ChooseYourSeeds/PlantFrame.tres" id="2_so2bw"] [ext_resource type="Texture2D" uid="uid://dycdvvgmgmfu6" path="res://assets/sprites/gui/ChooseYourSeeds/FrameField.tres" id="3_rn5vx"] -[ext_resource type="Script" path="res://scripts/components/gui/choose_your_seeds/GridLoader.cs" id="4_i7sou"] +[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" path="res://scripts/components/gui/choose_your_seeds/LevelRunButton.cs" id="7_k6b6g"] +[ext_resource type="Script" uid="uid://d26waisd3v488" path="res://scripts/components/gui/choose_your_seeds/LevelRunButton.cs" id="7_k6b6g"] [sub_resource type="Animation" id="Animation_0rps3"] resource_name = "Hide" @@ -91,9 +91,9 @@ tracks/1/keys = { [sub_resource type="AnimationLibrary" id="AnimationLibrary_tguwa"] _data = { -"Hide": SubResource("Animation_0rps3"), -"RESET": SubResource("Animation_8he0w"), -"Show": SubResource("Animation_omiwq") +&"Hide": SubResource("Animation_0rps3"), +&"RESET": SubResource("Animation_8he0w"), +&"Show": SubResource("Animation_omiwq") } [sub_resource type="ViewportTexture" id="ViewportTexture_rmoaa"] @@ -113,7 +113,7 @@ theme = ExtResource("1_bfo8i") [node name="AnimationPlayer" type="AnimationPlayer" parent="."] root_node = NodePath("../Panel/LevelRunButton") libraries = { -"": SubResource("AnimationLibrary_tguwa") +&"": SubResource("AnimationLibrary_tguwa") } autoplay = "Show" diff --git a/scenes/pools.tscn b/scenes/level components/pools.tscn similarity index 85% rename from scenes/pools.tscn rename to scenes/level components/pools.tscn index 30d031e..81df8d9 100644 --- a/scenes/pools.tscn +++ b/scenes/level components/pools.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://scripts/components/level/PoolContainer.cs" id="1_31ggc"] -[node name="Pools" type="Node" node_paths=PackedStringArray("Zombies", "Plants", "Projectiles", "Structures")] +[node name="Pools" type="Node2D" node_paths=PackedStringArray("Zombies", "Plants", "Projectiles", "Structures")] script = ExtResource("1_31ggc") Zombies = NodePath("Zombies") Plants = NodePath("Plants") diff --git a/scenes/level_button.tscn b/scenes/level_button.tscn new file mode 100644 index 0000000..cb91dac --- /dev/null +++ b/scenes/level_button.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://dylfqmo3d26ce"] + +[ext_resource type="Script" path="res://scripts/LevelButton.cs" id="1_qey5e"] + +[node name="LevelButton" type="TextureRect"] +offset_right = 40.0 +offset_bottom = 40.0 +script = ExtResource("1_qey5e") diff --git a/scenes/summer.tscn b/scenes/summer.tscn new file mode 100644 index 0000000..b1aca74 --- /dev/null +++ b/scenes/summer.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=3 format=3 uid="uid://ccrr8drx0a7gy"] + +[ext_resource type="PackedScene" uid="uid://dd3yegl1xo44m" path="res://scenes/templates/level_template.tscn" id="1_53h7t"] +[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/background_summer.png" id="2_8hj2g"] + +[node name="Summer" instance=ExtResource("1_53h7t")] + +[node name="Sprite2D" type="Sprite2D" parent="." index="1"] +texture = ExtResource("2_8hj2g") diff --git a/scenes/templates/level_template.tscn b/scenes/templates/level_template.tscn index ab15fdf..ffd26b6 100644 --- a/scenes/templates/level_template.tscn +++ b/scenes/templates/level_template.tscn @@ -1,3 +1,31 @@ -[gd_scene format=3 uid="uid://dd3yegl1xo44m"] +[gd_scene load_steps=6 format=3 uid="uid://dd3yegl1xo44m"] + +[ext_resource type="Script" path="res://scripts/components/level/RuntimeLevelData.cs" id="1_31ltw"] +[ext_resource type="PackedScene" uid="uid://devn21c7luf45" path="res://scenes/level components/field_controller.tscn" id="2_w4oj7"] +[ext_resource type="PackedScene" uid="uid://cg8713v6c5w15" path="res://scenes/level components/pools.tscn" id="3_r1g7l"] +[ext_resource type="PackedScene" uid="uid://dpxxjfd5lv5sv" path="res://scenes/gui/choose_your_seeds.tscn" id="3_xy2c6"] +[ext_resource type="PackedScene" uid="uid://cfnmspei3k4p7" path="res://scenes/gui/runtime_gui.tscn" id="4_okro4"] [node name="level_template" type="Node2D"] + +[node name="Camera2D" type="Camera2D" parent="."] + +[node name="RuntimeLevelData" type="Node" parent="."] +script = ExtResource("1_31ltw") + +[node name="Pools" parent="." instance=ExtResource("3_r1g7l")] + +[node name="GameUserInterface" type="CanvasLayer" parent="."] +layer = 10 + +[node name="ChooseYourSeeds" parent="GameUserInterface" instance=ExtResource("3_xy2c6")] +metadata/_edit_lock_ = true + +[node name="RuntimeGUI" parent="GameUserInterface" instance=ExtResource("4_okro4")] + +[node name="OverlayGameobjects" type="CanvasLayer" parent="."] +layer = 6 + +[node name="FieldController" parent="OverlayGameobjects" instance=ExtResource("2_w4oj7")] + +[node name="MainAnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/scripts/Cursor.cs.uid b/scripts/Cursor.cs.uid new file mode 100644 index 0000000..a321807 --- /dev/null +++ b/scripts/Cursor.cs.uid @@ -0,0 +1 @@ +uid://c6ucy48qwaxuc diff --git a/scripts/LevelButton.cs b/scripts/LevelButton.cs index 600120e..b93198d 100644 --- a/scripts/LevelButton.cs +++ b/scripts/LevelButton.cs @@ -7,7 +7,7 @@ namespace Newlon; // Button that contains level to load // -public partial class LevelButton : Node +public partial class LevelButton : TextureButton { [Export] private Script _levelScript; [Export] private PackedScene _levelTileset; diff --git a/scripts/LevelButton.cs.uid b/scripts/LevelButton.cs.uid new file mode 100644 index 0000000..fc3fe99 --- /dev/null +++ b/scripts/LevelButton.cs.uid @@ -0,0 +1 @@ +uid://cn3q18jh2rej7 diff --git a/scripts/LevelController.cs.uid b/scripts/LevelController.cs.uid new file mode 100644 index 0000000..c719e7c --- /dev/null +++ b/scripts/LevelController.cs.uid @@ -0,0 +1 @@ +uid://v8gsvdqhbtml diff --git a/scripts/Sun.cs.uid b/scripts/Sun.cs.uid new file mode 100644 index 0000000..cb80f00 --- /dev/null +++ b/scripts/Sun.cs.uid @@ -0,0 +1 @@ +uid://qgeovvluk8yj diff --git a/scripts/Utility.cs.uid b/scripts/Utility.cs.uid new file mode 100644 index 0000000..0ffdeba --- /dev/null +++ b/scripts/Utility.cs.uid @@ -0,0 +1 @@ +uid://ccaap8m63b62t diff --git a/scripts/components/Armor.cs b/scripts/components/Armor.cs new file mode 100644 index 0000000..ab2a656 --- /dev/null +++ b/scripts/components/Armor.cs @@ -0,0 +1,54 @@ +using Godot; + +namespace Newlon.Components; + +[GlobalClass] +public partial class Armor : Node +{ + [Signal] + public delegate void ArmorDamagedEventHandler(int hp); + [Signal] + public delegate void ArmorLostEventHandler(); + + [Export] + private int _maxHP; + private int _hp; + private bool _lost = false; + + public override void _Ready() + { + _hp = _maxHP; + } + + public int RecieveDamage(int damage) + { + if(_lost) + return damage; + int returnAmount = 0; + _hp -= damage; + if(_hp <= 0) + { + returnAmount = _hp; + _hp = 0; + EmitSignal(SignalName.ArmorLost); + _lost = true; + } + EmitSignal(SignalName.ArmorDamaged,_hp); + return returnAmount; + } + + public int Heal(int amount) + { + if(_lost) + return amount; + int returnAmount = 0; + _hp += amount; + if (_hp >= _maxHP) + { + returnAmount = _hp-_maxHP; + _hp = _maxHP; + } + EmitSignal(SignalName.ArmorDamaged,_hp); + return returnAmount; + } +} diff --git a/scripts/components/Armor.cs.uid b/scripts/components/Armor.cs.uid new file mode 100644 index 0000000..ae22cc3 --- /dev/null +++ b/scripts/components/Armor.cs.uid @@ -0,0 +1 @@ +uid://fd4im1fmwc5n diff --git a/scripts/components/FlashComponent.cs.uid b/scripts/components/FlashComponent.cs.uid new file mode 100644 index 0000000..c0f482d --- /dev/null +++ b/scripts/components/FlashComponent.cs.uid @@ -0,0 +1 @@ +uid://c5vfccegyy01t diff --git a/scripts/components/IEntity.cs.uid b/scripts/components/IEntity.cs.uid new file mode 100644 index 0000000..c16d5f4 --- /dev/null +++ b/scripts/components/IEntity.cs.uid @@ -0,0 +1 @@ +uid://cjdeq452vk2ll diff --git a/scripts/components/ILocalTimescale.cs.uid b/scripts/components/ILocalTimescale.cs.uid new file mode 100644 index 0000000..48a6d9b --- /dev/null +++ b/scripts/components/ILocalTimescale.cs.uid @@ -0,0 +1 @@ +uid://bxu6ljkmmlgd5 diff --git a/scripts/components/IProjectile.cs.uid b/scripts/components/IProjectile.cs.uid new file mode 100644 index 0000000..6848eee --- /dev/null +++ b/scripts/components/IProjectile.cs.uid @@ -0,0 +1 @@ +uid://blbiq5r0w17hf diff --git a/scripts/components/LevelGUIElements.cs.uid b/scripts/components/LevelGUIElements.cs.uid new file mode 100644 index 0000000..5bc1a3c --- /dev/null +++ b/scripts/components/LevelGUIElements.cs.uid @@ -0,0 +1 @@ +uid://cwa1eydeiy3y4 diff --git a/scripts/components/LinearProjectile.cs.uid b/scripts/components/LinearProjectile.cs.uid new file mode 100644 index 0000000..4df9b6f --- /dev/null +++ b/scripts/components/LinearProjectile.cs.uid @@ -0,0 +1 @@ +uid://dxlwvwy3hj56x diff --git a/scripts/components/gui/FastForwardButton.cs.uid b/scripts/components/gui/FastForwardButton.cs.uid new file mode 100644 index 0000000..ac44d85 --- /dev/null +++ b/scripts/components/gui/FastForwardButton.cs.uid @@ -0,0 +1 @@ +uid://cwn3bd2k7mdq6 diff --git a/scripts/components/gui/ShovelButton.cs.uid b/scripts/components/gui/ShovelButton.cs.uid new file mode 100644 index 0000000..9d9a083 --- /dev/null +++ b/scripts/components/gui/ShovelButton.cs.uid @@ -0,0 +1 @@ +uid://d4dbg0us5ngxy diff --git a/scripts/components/gui/SunCounter.cs.uid b/scripts/components/gui/SunCounter.cs.uid new file mode 100644 index 0000000..b8b7372 --- /dev/null +++ b/scripts/components/gui/SunCounter.cs.uid @@ -0,0 +1 @@ +uid://dwxohya1exdkh diff --git a/scripts/components/gui/VeilResizer.cs.uid b/scripts/components/gui/VeilResizer.cs.uid new file mode 100644 index 0000000..1a8f177 --- /dev/null +++ b/scripts/components/gui/VeilResizer.cs.uid @@ -0,0 +1 @@ +uid://ddi84kmmq1qla diff --git a/scripts/components/gui/choose_your_seeds/GridLoader.cs.uid b/scripts/components/gui/choose_your_seeds/GridLoader.cs.uid new file mode 100644 index 0000000..c6a4b42 --- /dev/null +++ b/scripts/components/gui/choose_your_seeds/GridLoader.cs.uid @@ -0,0 +1 @@ +uid://eq3ecja30mlj diff --git a/scripts/components/gui/choose_your_seeds/LevelRunButton.cs.uid b/scripts/components/gui/choose_your_seeds/LevelRunButton.cs.uid new file mode 100644 index 0000000..a16b379 --- /dev/null +++ b/scripts/components/gui/choose_your_seeds/LevelRunButton.cs.uid @@ -0,0 +1 @@ +uid://d26waisd3v488 diff --git a/scripts/components/gui/seedpackets/ChoosableHandler.cs.uid b/scripts/components/gui/seedpackets/ChoosableHandler.cs.uid new file mode 100644 index 0000000..ae78fc7 --- /dev/null +++ b/scripts/components/gui/seedpackets/ChoosableHandler.cs.uid @@ -0,0 +1 @@ +uid://b3sut12n56w1y diff --git a/scripts/components/gui/seedpackets/HotbarHandler.cs.uid b/scripts/components/gui/seedpackets/HotbarHandler.cs.uid new file mode 100644 index 0000000..55bf04e --- /dev/null +++ b/scripts/components/gui/seedpackets/HotbarHandler.cs.uid @@ -0,0 +1 @@ +uid://gvgt14v1hndn diff --git a/scripts/components/gui/seedpackets/HotbarPregameHandler.cs.uid b/scripts/components/gui/seedpackets/HotbarPregameHandler.cs.uid new file mode 100644 index 0000000..4bc1c70 --- /dev/null +++ b/scripts/components/gui/seedpackets/HotbarPregameHandler.cs.uid @@ -0,0 +1 @@ +uid://bnygd8pcmoewp diff --git a/scripts/components/gui/seedpackets/ISeedpacketPress.cs.uid b/scripts/components/gui/seedpackets/ISeedpacketPress.cs.uid new file mode 100644 index 0000000..69fae63 --- /dev/null +++ b/scripts/components/gui/seedpackets/ISeedpacketPress.cs.uid @@ -0,0 +1 @@ +uid://o0ly38oqcuwu diff --git a/scripts/components/gui/seedpackets/ISeedpacketProcess.cs.uid b/scripts/components/gui/seedpackets/ISeedpacketProcess.cs.uid new file mode 100644 index 0000000..86120b4 --- /dev/null +++ b/scripts/components/gui/seedpackets/ISeedpacketProcess.cs.uid @@ -0,0 +1 @@ +uid://q2r43hym7s82 diff --git a/scripts/components/gui/seedpackets/ISeedpacketUnfocus.cs.uid b/scripts/components/gui/seedpackets/ISeedpacketUnfocus.cs.uid new file mode 100644 index 0000000..682c53a --- /dev/null +++ b/scripts/components/gui/seedpackets/ISeedpacketUnfocus.cs.uid @@ -0,0 +1 @@ +uid://mdm8cepvvo4t diff --git a/scripts/components/gui/seedpackets/Seedpacket.cs.uid b/scripts/components/gui/seedpackets/Seedpacket.cs.uid new file mode 100644 index 0000000..d1e23cc --- /dev/null +++ b/scripts/components/gui/seedpackets/Seedpacket.cs.uid @@ -0,0 +1 @@ +uid://cn6ddajdtf4ep diff --git a/scripts/components/gui/seedpackets/SeedpacketHandler.cs.uid b/scripts/components/gui/seedpackets/SeedpacketHandler.cs.uid new file mode 100644 index 0000000..243fe0c --- /dev/null +++ b/scripts/components/gui/seedpackets/SeedpacketHandler.cs.uid @@ -0,0 +1 @@ +uid://cr774updc04fu diff --git a/scripts/components/level/PlantField.cs b/scripts/components/level/PlantField.cs index f5ec69b..f8bbc11 100644 --- a/scripts/components/level/PlantField.cs +++ b/scripts/components/level/PlantField.cs @@ -25,7 +25,8 @@ public partial class PlantField : Node2D _slot = slot; if (plant == null) { - _plantSetter.GetChild(0).QueueFree(); + foreach(var child in _plantSetter.GetChildren()) + child.QueueFree(); } else { diff --git a/scripts/components/level/PlantField.cs.uid b/scripts/components/level/PlantField.cs.uid new file mode 100644 index 0000000..4496205 --- /dev/null +++ b/scripts/components/level/PlantField.cs.uid @@ -0,0 +1 @@ +uid://bj7rw2f6qu1lg diff --git a/scripts/components/level/PoolContainer.cs.uid b/scripts/components/level/PoolContainer.cs.uid new file mode 100644 index 0000000..bb5b09c --- /dev/null +++ b/scripts/components/level/PoolContainer.cs.uid @@ -0,0 +1 @@ +uid://bso32xkw738sy diff --git a/scripts/components/level/RuntimeLevelData.cs.uid b/scripts/components/level/RuntimeLevelData.cs.uid new file mode 100644 index 0000000..0e99437 --- /dev/null +++ b/scripts/components/level/RuntimeLevelData.cs.uid @@ -0,0 +1 @@ +uid://bndu1h5kgcde8 diff --git a/scripts/components/level/SunSpawner.cs.uid b/scripts/components/level/SunSpawner.cs.uid new file mode 100644 index 0000000..ad6ffd5 --- /dev/null +++ b/scripts/components/level/SunSpawner.cs.uid @@ -0,0 +1 @@ +uid://cslqjdd5wq4rc diff --git a/scripts/components/plants/AreaAttack.cs.uid b/scripts/components/plants/AreaAttack.cs.uid new file mode 100644 index 0000000..2c8cfca --- /dev/null +++ b/scripts/components/plants/AreaAttack.cs.uid @@ -0,0 +1 @@ +uid://co7ttejdo2qot diff --git a/scripts/components/plants/ExplosionComponent.cs.uid b/scripts/components/plants/ExplosionComponent.cs.uid new file mode 100644 index 0000000..81501a4 --- /dev/null +++ b/scripts/components/plants/ExplosionComponent.cs.uid @@ -0,0 +1 @@ +uid://bhl6o2m3fn4xg diff --git a/scripts/components/plants/Eyesight.cs.uid b/scripts/components/plants/Eyesight.cs.uid new file mode 100644 index 0000000..7933517 --- /dev/null +++ b/scripts/components/plants/Eyesight.cs.uid @@ -0,0 +1 @@ +uid://dn53jvpjyg63l diff --git a/scripts/components/plants/PlantEyesightLimiter.cs.uid b/scripts/components/plants/PlantEyesightLimiter.cs.uid new file mode 100644 index 0000000..21a60a3 --- /dev/null +++ b/scripts/components/plants/PlantEyesightLimiter.cs.uid @@ -0,0 +1 @@ +uid://hccb0aee0x0o diff --git a/scripts/components/plants/PlantSunSpawner.cs.uid b/scripts/components/plants/PlantSunSpawner.cs.uid new file mode 100644 index 0000000..55d10dc --- /dev/null +++ b/scripts/components/plants/PlantSunSpawner.cs.uid @@ -0,0 +1 @@ +uid://b71gebny84s81 diff --git a/scripts/components/plants/ReturnEffect.cs.uid b/scripts/components/plants/ReturnEffect.cs.uid new file mode 100644 index 0000000..7a02632 --- /dev/null +++ b/scripts/components/plants/ReturnEffect.cs.uid @@ -0,0 +1 @@ +uid://bmtukcq10m8wo diff --git a/scripts/components/plants/RuntimePlantData.cs.uid b/scripts/components/plants/RuntimePlantData.cs.uid new file mode 100644 index 0000000..07d0448 --- /dev/null +++ b/scripts/components/plants/RuntimePlantData.cs.uid @@ -0,0 +1 @@ +uid://dli2i6albvugt diff --git a/scripts/components/plants/Shooter.cs.uid b/scripts/components/plants/Shooter.cs.uid new file mode 100644 index 0000000..43979d1 --- /dev/null +++ b/scripts/components/plants/Shooter.cs.uid @@ -0,0 +1 @@ +uid://ceprqkraw3v6m diff --git a/scripts/components/plants/ThreepeaterShooter.cs.uid b/scripts/components/plants/ThreepeaterShooter.cs.uid new file mode 100644 index 0000000..9314942 --- /dev/null +++ b/scripts/components/plants/ThreepeaterShooter.cs.uid @@ -0,0 +1 @@ +uid://djpc0kvagpadv diff --git a/scripts/components/plants/behaviours/AloeBehaviour.cs.uid b/scripts/components/plants/behaviours/AloeBehaviour.cs.uid new file mode 100644 index 0000000..9eb6922 --- /dev/null +++ b/scripts/components/plants/behaviours/AloeBehaviour.cs.uid @@ -0,0 +1 @@ +uid://cljytsmqac0w7 diff --git a/scripts/components/plants/behaviours/BaseBehaviour.cs.uid b/scripts/components/plants/behaviours/BaseBehaviour.cs.uid new file mode 100644 index 0000000..d23f061 --- /dev/null +++ b/scripts/components/plants/behaviours/BaseBehaviour.cs.uid @@ -0,0 +1 @@ +uid://3dbmgnr7qxee diff --git a/scripts/components/plants/behaviours/HpBasedBehaviour.cs.uid b/scripts/components/plants/behaviours/HpBasedBehaviour.cs.uid new file mode 100644 index 0000000..b3a7b81 --- /dev/null +++ b/scripts/components/plants/behaviours/HpBasedBehaviour.cs.uid @@ -0,0 +1 @@ +uid://btkmd86pn828y diff --git a/scripts/components/plants/behaviours/PeashooterBehaviour.cs.uid b/scripts/components/plants/behaviours/PeashooterBehaviour.cs.uid new file mode 100644 index 0000000..c83a83b --- /dev/null +++ b/scripts/components/plants/behaviours/PeashooterBehaviour.cs.uid @@ -0,0 +1 @@ +uid://bdk5iqtw4xbkl diff --git a/scripts/components/plants/behaviours/PotatomineBehaviour.cs.uid b/scripts/components/plants/behaviours/PotatomineBehaviour.cs.uid new file mode 100644 index 0000000..5e9971d --- /dev/null +++ b/scripts/components/plants/behaviours/PotatomineBehaviour.cs.uid @@ -0,0 +1 @@ +uid://c7qfh4py0uulo diff --git a/scripts/components/plants/behaviours/SpikeweedBehaviour.cs.uid b/scripts/components/plants/behaviours/SpikeweedBehaviour.cs.uid new file mode 100644 index 0000000..e035e12 --- /dev/null +++ b/scripts/components/plants/behaviours/SpikeweedBehaviour.cs.uid @@ -0,0 +1 @@ +uid://dqquodxaijmem diff --git a/scripts/components/plants/behaviours/SunflowerBehaviour.cs.uid b/scripts/components/plants/behaviours/SunflowerBehaviour.cs.uid new file mode 100644 index 0000000..3e1957d --- /dev/null +++ b/scripts/components/plants/behaviours/SunflowerBehaviour.cs.uid @@ -0,0 +1 @@ +uid://bth7gah4tn7uj diff --git a/scripts/components/zombies/AudioDamage.cs.uid b/scripts/components/zombies/AudioDamage.cs.uid new file mode 100644 index 0000000..958b64c --- /dev/null +++ b/scripts/components/zombies/AudioDamage.cs.uid @@ -0,0 +1 @@ +uid://bsg4utgc0u0vo diff --git a/scripts/components/zombies/EatBox.cs.uid b/scripts/components/zombies/EatBox.cs.uid new file mode 100644 index 0000000..6bf3c25 --- /dev/null +++ b/scripts/components/zombies/EatBox.cs.uid @@ -0,0 +1 @@ +uid://dqyony6jxt2p0 diff --git a/scripts/components/zombies/RuntimeZombieData.cs b/scripts/components/zombies/RuntimeZombieData.cs index 17893f6..49f0b21 100644 --- a/scripts/components/zombies/RuntimeZombieData.cs +++ b/scripts/components/zombies/RuntimeZombieData.cs @@ -16,14 +16,13 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe [Export] private int _maxHP; [Export] - private int _line; + private Armor _armor; + private float _localTimescale = 1.0f; public int Hp => _hp; - public int MaxHp => _maxHP; - - public int Line => _line; + public int MaxHp => _maxHP; public bool AbleToEat = true; @@ -54,8 +53,14 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe public void Heal(int amount,Node origin) { - _hp += amount; + if(_armor != null) + { + _hp += _armor.Heal(amount); + } + else + _hp += amount; EmitSignal(SignalName.OnHPChanged,amount,origin); + if (MaxHp > 0) { @@ -65,7 +70,12 @@ public partial class RuntimeZombieData : Node2D, IEntity, ILocalTimescale, IEffe public void TakeDamage(int amount, Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL) { - _hp -= amount; + if(_armor != null) + { + _hp -= _armor.RecieveDamage(amount); + } + else + _hp -= amount; EmitSignal(SignalName.OnHPChanged,-amount, origin); if (_hp <= 0) diff --git a/scripts/components/zombies/RuntimeZombieData.cs.uid b/scripts/components/zombies/RuntimeZombieData.cs.uid new file mode 100644 index 0000000..a532fda --- /dev/null +++ b/scripts/components/zombies/RuntimeZombieData.cs.uid @@ -0,0 +1 @@ +uid://dildme6epx8l4 diff --git a/scripts/components/zombies/ZombieMover.cs.uid b/scripts/components/zombies/ZombieMover.cs.uid new file mode 100644 index 0000000..9ed6584 --- /dev/null +++ b/scripts/components/zombies/ZombieMover.cs.uid @@ -0,0 +1 @@ +uid://7hdj2k14lfe4 diff --git a/scripts/components/zombies/behaviours/BasicZombieBehaviour.cs.uid b/scripts/components/zombies/behaviours/BasicZombieBehaviour.cs.uid new file mode 100644 index 0000000..b6dc54c --- /dev/null +++ b/scripts/components/zombies/behaviours/BasicZombieBehaviour.cs.uid @@ -0,0 +1 @@ +uid://cgf61r46dgh4m diff --git a/scripts/debug/Cheats.cs.uid b/scripts/debug/Cheats.cs.uid new file mode 100644 index 0000000..a53b15b --- /dev/null +++ b/scripts/debug/Cheats.cs.uid @@ -0,0 +1 @@ +uid://cb8n22kkqa8ig diff --git a/scripts/debug/Clock.cs.uid b/scripts/debug/Clock.cs.uid new file mode 100644 index 0000000..259b59a --- /dev/null +++ b/scripts/debug/Clock.cs.uid @@ -0,0 +1 @@ +uid://d2aq2wjq0gt7x diff --git a/scripts/resources/PlantResource.cs.uid b/scripts/resources/PlantResource.cs.uid new file mode 100644 index 0000000..e2f2360 --- /dev/null +++ b/scripts/resources/PlantResource.cs.uid @@ -0,0 +1 @@ +uid://cyenlko1knygw diff --git a/scripts/systems/effects/Effect.cs.uid b/scripts/systems/effects/Effect.cs.uid new file mode 100644 index 0000000..2f6e368 --- /dev/null +++ b/scripts/systems/effects/Effect.cs.uid @@ -0,0 +1 @@ +uid://bcc7skl7ts6sh diff --git a/scripts/systems/effects/GarlicEffect.cs b/scripts/systems/effects/GarlicEffect.cs index d48a60a..9ef375f 100644 --- a/scripts/systems/effects/GarlicEffect.cs +++ b/scripts/systems/effects/GarlicEffect.cs @@ -47,7 +47,6 @@ public partial class GarlicEffect : Effect tween.TweenProperty(zombieData,"position:y",zombieData.GlobalPosition.Y + Utility.TileHeight * mult, 1.0); tween.TweenCallback(Callable.From(() => {zombieData.AbleToEat = true;})); } - } public override void Process(Node target) diff --git a/scripts/systems/effects/GarlicEffect.cs.uid b/scripts/systems/effects/GarlicEffect.cs.uid new file mode 100644 index 0000000..2aab27d --- /dev/null +++ b/scripts/systems/effects/GarlicEffect.cs.uid @@ -0,0 +1 @@ +uid://bb6lv1djnqjaw diff --git a/scripts/systems/effects/IEffectHandler.cs.uid b/scripts/systems/effects/IEffectHandler.cs.uid new file mode 100644 index 0000000..8c581ef --- /dev/null +++ b/scripts/systems/effects/IEffectHandler.cs.uid @@ -0,0 +1 @@ +uid://eeqk3fvjwg31 diff --git a/scripts/systems/effects/SlownessEffect.cs.uid b/scripts/systems/effects/SlownessEffect.cs.uid new file mode 100644 index 0000000..e4e32c8 --- /dev/null +++ b/scripts/systems/effects/SlownessEffect.cs.uid @@ -0,0 +1 @@ +uid://dyc7fc5bfkdii