Compare commits

..

38 Commits

Author SHA1 Message Date
Jonathan 628da80ed3 Merge pull request 'feature/entity_rework' (#52) from feature/entity_rework into develop
Reviewed-on: #52
Reviewed-by: Jonathan <cblech@ymail.com>
2026-02-03 18:44:13 +01:00
Katharina Ziolkowski 0dfbd73978 Reverted ItemOnGround to make everything compile again 2026-02-03 17:59:38 +01:00
Katharina Ziolkowski 8a93b00e72 Merge branch 'develop' into feature/entity_rework
# Conflicts:
#	scenes/scene_credits.tscn
#	scenes/scene_farm_outside_2d.tscn
#	scenes/scene_fight_world_room.tscn
#	scenes/scene_indoor_vesnas_room.tscn
#	scenes/scene_outside_beets.tscn
#	scripts/CSharp/Common/Farming/PlantBehaviour2D.cs
2026-02-03 17:53:28 +01:00
Katharina Ziolkowski ba7d550c3f Implemented Save and Load functionality 2026-02-03 17:30:35 +01:00
Katharina Ziolkowski b65a3bbd6d Managed the freeing of entityplacers. Also cleaned up EntityManager 2026-02-03 15:36:59 +01:00
Katharina Ziolkowski bcbc074c86 First adjustments to the Entity System to make it work with different types 2026-02-03 13:55:13 +01:00
jonathan 745f54b375 WIP 2026-01-29 17:42:32 +01:00
kziolkowski 2c8a024528 Merge pull request 'feature/build_0_7' (#49) from feature/build_0_7 into develop
Reviewed-on: #49
Reviewed-by: Jonathan <cblech@ymail.com>
2026-01-27 13:04:21 +01:00
kziolkowski 76eb408a40 Merge branch 'develop' into feature/build_0_7 2026-01-27 13:01:34 +01:00
Katharina Ziolkowski ff143f07e7 deleted unused autosave file 2026-01-27 13:00:38 +01:00
Jonathan b50ca5b919 Merge pull request 'einfügen von Gesichtsausdrücken für Vesna' (#46) from Vesna_Gesichtsausdrücke_einfügen_ into develop
Reviewed-on: #46
Reviewed-by: Jonathan <cblech@ymail.com>
2026-01-13 23:43:46 +01:00
jonathan 59d313d97d Added basic entity scripts 2025-12-18 14:27:27 +01:00
Jonathan 9032272599 Merge pull request 'BlobFighter TargetSelection ColliderShape2D Transform angepasst' (#42) from Enemy_selection_overlap into develop
Reviewed-on: #42
Reviewed-by: Jonathan <cblech@ymail.com>
2025-12-18 13:06:03 +01:00
jlink a2ef3bfaf0 Window angepasst 2025-12-18 13:02:32 +01:00
jlink 1ab1071246 HoverIndicator off 2025-12-17 15:29:58 +01:00
kziolkowski b0ee8c4c58 fixed path strings in scene transitions and added disclaimer and credits back into the flow 2025-12-17 01:07:39 +01:00
kziolkowski 522fdfa365 Added fightworld background and cat dialogue 2025-12-17 00:40:43 +01:00
kziolkowski 4f6c5ab9c1 fixed some layering issues in beetroot scene and added a mock convo with the domovoi 2025-12-17 00:15:42 +01:00
kziolkowski 11e24e249e Fixed Field outline not disappearing when switching tools 2025-12-16 23:29:48 +01:00
kziolkowski f3080df4b7 moved fence door collision shape up to reduce unwanted triggering 2025-12-16 23:13:38 +01:00
kziolkowski f6e83e7fef Added event handlers in Fieldbehaviour to react to watering can state changes 2025-12-16 23:13:09 +01:00
kziolkowski 3bdc8cd03f Deactivated harvestable plant on spawn 2025-12-16 23:06:58 +01:00
kziolkowski f862827d98 Removed Print statements 2025-12-16 23:06:41 +01:00
kziolkowski a401cbe5b9 🐛 fixed field activator self-deactivating on load bug 2025-12-16 22:53:22 +01:00
kziolkowski 48660b167c Merge branch 'feature/bugfixes_polish_II' into feature/build_0_7
# Conflicts:
#	scenes/scene_farm_outside_2d.tscn
2025-12-16 21:59:04 +01:00
Jonathan e5b2b8b8ab Merge pull request 'Connect farming and fighting by making them codependent' (#44) from feature/farm_fight_loop into develop
Reviewed-on: #44
2025-12-16 20:44:26 +01:00
Jonathan 2fa8aa9fbc Merge pull request 'Vesna resets to bed after death' (#47) from Vesna_resets_to_bed_after_dead into develop
Reviewed-on: #47
Reviewed-by: Jonathan <cblech@ymail.com>
2025-12-16 19:37:29 +01:00
Jonathan 6deb6e29fd Merge pull request 'Made attack selection only select alive enemies' (#45) from bug/attack_dead_enemy into develop
Reviewed-on: #45
Reviewed-by: kziolkowski <katharina.ziolkowski@gmail.com>
2025-12-16 19:30:33 +01:00
Jonathan edc133749f Merge pull request 'Randomized who starts the fight' (#41) from randomise_fight_start into develop
Reviewed-on: #41
Reviewed-by: kziolkowski <katharina.ziolkowski@gmail.com>
2025-12-16 19:28:37 +01:00
jonathan 5f75bde317 💄 Made heal button show how many beats are left 2025-12-16 19:24:20 +01:00
jonathan 7310bfbf6e Added flying beet to the ui when used 2025-12-16 19:09:03 +01:00
jonathan fef8380a57 When beetroot is in inventory the player can heal 2025-12-16 19:09:03 +01:00
jonathan f42c2c86b1 Defeated enemygroups now drop a beet_seed 2025-12-16 19:09:03 +01:00
jlink 2ed9dbbc52 Vesna resets to bed after death 2025-12-16 15:34:52 +01:00
jlink 3456340bb7 einfügen von Gesichtsausdrücken für Vesna 2025-12-16 14:30:23 +01:00
jonathan 6375383373 🐛Made attack selection only select alive enemies 2025-12-11 18:49:51 +01:00
jlink 09f55d3aa7 BlobFighter TargetSelection ColliderShape2D Transform angepasst 2025-12-10 15:29:56 +01:00
jonathan a736adaafb Randomized who starts the fight 2025-12-09 15:07:50 +01:00
113 changed files with 8947 additions and 156 deletions
+3
View File
@@ -8,4 +8,7 @@
<Folder Include="prefabs\UI\Inventory\" />
<Folder Include="scripts\CSharp\Low Code\Randomizer\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>
</Project>
Binary file not shown.

After

Width:  |  Height:  |  Size: 652 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dc1xim3mqlj1o"
path="res://.godot/imported/angry.png-e4eff51de743a11598498a3e284ae0a1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/characters/Vesna/angry.png"
dest_files=["res://.godot/imported/angry.png-e4eff51de743a11598498a3e284ae0a1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bhd8ui4bdauoq"
path="res://.godot/imported/sad.png-07f44c713781510c0fa11821d4fa50bc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/characters/Vesna/sad.png"
dest_files=["res://.godot/imported/sad.png-07f44c713781510c0fa11821d4fa50bc.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 649 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://4xvgqwrwh3vw"
path="res://.godot/imported/smile.png-2ef625357927edd0d495bf554ac57e21.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/characters/Vesna/smile.png"
dest_files=["res://.godot/imported/smile.png-2ef625357927edd0d495bf554ac57e21.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 648 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dcxkqut5edp2b"
path="res://.godot/imported/surprise.png-79afea119cbe923f9aa9e4554a23ed80.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/characters/Vesna/surprise.png"
dest_files=["res://.godot/imported/surprise.png-79afea119cbe923f9aa9e4554a23ed80.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 651 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ing4qavovh4r"
path="res://.godot/imported/surprised.png-ab52144d1f41186a697c9a0e1584b3ee.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/characters/Vesna/surprised.png"
dest_files=["res://.godot/imported/surprised.png-ab52144d1f41186a697c9a0e1584b3ee.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
Binary file not shown.

After

Width:  |  Height:  |  Size: 575 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ciaabo8kcx2hw"
path="res://.godot/imported/fightworld_background.png-be6589f7fa4be8e56ee338eabec1ff36.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/fightworld_background.png"
dest_files=["res://.godot/imported/fightworld_background.png-be6589f7fa4be8e56ee338eabec1ff36.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dfp3tpx3fjges"
path="res://.godot/imported/domovoi_single.png-54325e2fb332bab49d527581994f50c7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/indoor/indoor outdoor/domovoi_single.png"
dest_files=["res://.godot/imported/domovoi_single.png-54325e2fb332bab49d527581994f50c7.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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
@@ -4,19 +4,22 @@ importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b3kyrsoobmkhp"
valid=false
path="res://.godot/imported/best_house_blender.blend-ac89c74aef2f275bdf4b4baadee17c0c.scn"
[deps]
source_file="res://art/mockups/3d/best_house_blender.blend"
dest_files=["res://.godot/imported/best_house_blender.blend-ac89c74aef2f275bdf4b4baadee17c0c.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
@@ -31,6 +34,9 @@ animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
blender/nodes/visible=0
blender/nodes/active_collection_only=false
@@ -50,3 +56,4 @@ blender/materials/export_materials=1
blender/animation/limit_playback=true
blender/animation/always_sample=true
blender/animation/group_tracks=true
gltf/naming_version=0
+12 -2
View File
@@ -19,12 +19,22 @@
},
"style": "NPC_narrative"
},
&"default_portrait": "",
&"default_portrait": "default",
&"description": "Yeli's Domovoi",
&"display_name": "Domovoi",
&"mirror": false,
&"nicknames": [""],
&"offset": Vector2(0, 0),
&"portraits": {},
&"portraits": {
"default": {
"export_overrides": {
"image": "\"res://art/indoor/indoor outdoor/domovoi_single.png\""
},
"mirror": false,
"offset": Vector2(0, -300),
"scale": 1.0,
"scene": ""
}
},
&"scale": 1.0
}
+20 -10
View File
@@ -1,19 +1,29 @@
{
"@path": "res://addons/dialogic/Resources/character.gd",
"@subpath": NodePath(""),
"_translation_id": "16",
"color": Color(1, 1, 1, 1),
"custom_info": {
&"_translation_id": "16",
&"color": Color(1, 1, 1, 1),
&"custom_info": {
"sound_mood_default": "",
"sound_moods": {},
"style": ""
},
"default_portrait": "",
"description": "",
"display_name": "Semi Cat",
&"default_portrait": "side",
&"description": "",
&"display_name": "Black Cat",
&"mirror": false,
&"nicknames": [""],
&"offset": Vector2(0, 0),
&"portraits": {
"side": {
"export_overrides": {
"image": "\"res://art/animals/katze.png\""
},
"mirror": false,
"nicknames": [""],
"offset": Vector2(0, 0),
"portraits": {},
"scale": 1.0
"offset": Vector2(0, -300),
"scale": 1.5,
"scene": ""
}
},
&"scale": 1.0
}
+45
View File
@@ -26,6 +26,15 @@
&"nicknames": ["vesna"],
&"offset": Vector2(-300, 0),
&"portraits": {
"angry": {
"export_overrides": {
"image": "\"res://art/characters/Vesna/angry.png\""
},
"mirror": false,
"offset": Vector2(150, 0),
"scale": 0.65,
"scene": ""
},
"front": {
"export_overrides": {
"image": "\"res://art/animation/Vesna2D/Vesna Anims Sequences/F01-Idle/0001.png\""
@@ -52,6 +61,42 @@
"offset": Vector2(0, 0),
"scale": 1.0,
"scene": ""
},
"sad": {
"export_overrides": {
"image": "\"res://art/characters/Vesna/sad.png\""
},
"mirror": false,
"offset": Vector2(150, 0),
"scale": 0.65,
"scene": ""
},
"smile": {
"export_overrides": {
"image": "\"res://art/characters/Vesna/smile.png\""
},
"mirror": false,
"offset": Vector2(150, 0),
"scale": 0.65,
"scene": ""
},
"surprise": {
"export_overrides": {
"image": "\"res://art/characters/Vesna/surprise.png\""
},
"mirror": false,
"offset": Vector2(150, 0),
"scale": 0.65,
"scene": ""
},
"surprised": {
"export_overrides": {
"image": "\"res://art/characters/Vesna/surprised.png\""
},
"mirror": false,
"offset": Vector2(150, 0),
"scale": 0.65,
"scene": ""
}
},
&"scale": 1.0
+5
View File
@@ -0,0 +1,5 @@
join vesna (half side) left
join semi_cat right
vesna: (pets)
semi_cat: mrau!
[end_timeline]
+1
View File
@@ -0,0 +1 @@
uid://clwlhu4lpmyqm
+1 -1
View File
@@ -2,7 +2,7 @@ join vesna left
vesna: Hello!
join Yeli (_side) right
Yeli (_frontal): Welcome to Babushka!
vesna (half side): We are Cozy Raven. This is our first showcase.
vesna (half side): We are Cozy Raven. This is a preview showcase.
Yeli (_part_side): Many of the lofty, idealist, dreamy things that we wanted to implement are still in the backlog, waiting for their turn.
vesna (front): But alas! The deadlines loomed, the bugs were strong with this one, and our days only have 24 hours.
Yeli (_frontal): So please be kind when you test this demo. We poured our hearts and our love for the slavic folklore into this one and will continue to do so.
+2 -2
View File
@@ -1,9 +1,9 @@
join Yeli right
join vesna left
Yeli (_part_side): Wow! So many?
Yeli (_part_side): Good job! Put it in the kettle!
Yeli (_frontal): Good job! Put it in the kettle!
[wait_input]
Yeli (_part_side): Mmmh! This will be something.
Yeli (_part_side): Thank you! I can take everything else from here.
Yeli (_frontal): Thank you! I can take everything else from here.
Yeli (_part_side): See you for dinner!
[end_timeline]
+1 -1
View File
@@ -1,5 +1,5 @@
join Yeli right
join vesna left
join vesna (surprise) left
[quest_complete quest_resource="res://resources/quests/demo/1_talk_yeli_1.tres"]
Yeli (_part_side): Come here, you little quacking beast!
- What a mess!
+1 -1
View File
@@ -1,4 +1,4 @@
join Chuga left
join Chuga center
Chuga: I believe youve seen enough for today.
Chuga: And yes, you too.
Chuga: Thank you for playing!
+1 -1
View File
@@ -2,7 +2,7 @@
join vesna left
join Chuga right
Chuga: Look who it is!
vesna: Your name was Chuga, right? I want to go to the forest!
vesna (half side): Your name was Chuga, right? I want to go to the forest!
Chuga: To the forest? After everything the others told you?
vesna: Will you let me through?
Chuga: Will I?
@@ -1,9 +1,9 @@
join Yeli center
join vesna center
join Yeli left
join vesna right
[quest_complete quest_resource="res://resources/quests/demo/5_talk_yeli_3.tres"]
Yeli (_part_side): Great! Now I need you to plant some tomatoes!
label plant tomatoes
Yeli (_part_side): Use the hoe to break up the soil. Then plant the seeds and water the fields.
Yeli (_frontal): Use the hoe to break up the soil. Then plant the seeds and water the fields.
Yeli (_part_side): Got it?
- Of course!
- Wait … How do I plant the tomatoes again?
@@ -2,11 +2,11 @@ join Yeli right
join vesna left
[quest_complete quest_resource="res://resources/quests/demo/3_talk_yeli_2.tres"]
Yeli (_part_side): Thank you, my child! Your Yeli is not so agile anymore.
vesna: But youre diligent! Youve started with the preparation for dinner.
Yeli (_part_side): Indeed, I have.
vesna (half side): But youre diligent! Youve started with the preparation for dinner.
Yeli (_frontal): Indeed, I have.
Yeli (_part_side): But, oh my, those ducks messed up the tomatos.
Yeli (_part_side): Oh, would you like to assist me?
vesna: What do I have to do?
Yeli (_frontal): Oh, would you like to assist me?
vesna (front): What do I have to do?
Yeli (_part_side): First, take the hoe and watering can over there! Then come back to me!
[quest_activate quest_resource="res://resources/quests/demo/4_collect_tools.tres"]
[end_timeline]
+8
View File
@@ -0,0 +1,8 @@
join Domovoi right
join vesna (half side) left
vesna: Hello?
...
vesna: Is someone home?
(No answer.)
vesna: Hmpf!
[end_timeline]
+1
View File
@@ -0,0 +1 @@
uid://cc1hkf45dtrnj
+2 -2
View File
@@ -247,9 +247,9 @@ script = ExtResource("50_a7v1a")
[connection signal="Talking" from="." to="Dialogic starter" method="open"]
[connection signal="Interacted" from="InteractionArea" to="." method="StartTalking"]
[connection signal="Interacted" from="InteractionArea" to="InteractionArea" method="ToggleActive"]
[connection signal="timelineEnded" from="Dialogic starter" to="." method="StopTalking"]
[connection signal="timelineEnded" from="Dialogic starter" to="InteractionArea" method="ToggleActive"]
[connection signal="timelineEnded" from="Dialogic starter" to="InteractionArea" method="SetActiveTrue"]
[connection signal="timelineStarted" from="Dialogic starter" to="InteractionArea" method="SetActiveFalse"]
[connection signal="timelineEnded" from="DialogicToggle" to="." method="ToggleTalking"]
[connection signal="timelineStarted" from="DialogicToggle" to="SFX/AudioStreamPlayer" method="PlayOneShot"]
+15
View File
@@ -0,0 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://hdfejdnmp8sl"]
[ext_resource type="Script" uid="uid://umop2b1m1qm8" path="res://scripts/CSharp/GameEntity/Management/EntityManager.cs" id="1_2bwns"]
[ext_resource type="Script" uid="uid://bogqp274y1pgr" path="res://scripts/CSharp/GameEntity/Management/EntityNodeCreator.cs" id="2_8m173"]
[ext_resource type="PackedScene" uid="uid://sbf12hin4kes" path="res://prefabs/Interactables/trash_object.tscn" id="3_v3vdc"]
[node name="EntityManager" type="Node" node_paths=PackedStringArray("_nodeCreator")]
script = ExtResource("1_2bwns")
_nodeCreator = NodePath("EntityCreator")
[node name="EntityCreator" type="Node" parent="."]
script = ExtResource("2_8m173")
_entityPrefabs = Dictionary[String, PackedScene]({
"TrashEntity": ExtResource("3_v3vdc")
})
+2 -2
View File
@@ -115,11 +115,11 @@ scale_amount_max = 0.8
color = Color(0.400601, 0.62444, 0.791217, 1)
hue_variation_max = 0.4
[node name="FieldActivator" type="Node2D" parent="." node_paths=PackedStringArray("_field", "_activatorArea") groups=["Saveable"]]
[node name="FieldActivator" type="Node2D" parent="." node_paths=PackedStringArray("_field", "_activatorArea", "_saveIdHolder")]
script = ExtResource("22_57jmp")
_field = NodePath("../FieldBehaviour")
_activatorArea = NodePath("InteractionArea")
metadata/SaveID = "8ac5da1c-3ddd-4b76-94c2-d655a4f369c7"
_saveIdHolder = NodePath("..")
[node name="InteractionArea" parent="FieldActivator" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("7_2eegd")]
_spritesToOutline = [NodePath("../../OutlineSprite")]
+1
View File
@@ -136,6 +136,7 @@ _useOutline = false
shape = SubResource("CircleShape2D_vjw4j")
[node name="ReadyPlantInventoryItem" parent="." instance=ExtResource("6_gdrin")]
process_mode = 4
position = Vector2(0, 2.3)
IsActive = false
_saveToDisk = false
+22 -2
View File
@@ -1,10 +1,30 @@
[gd_scene load_steps=2 format=3 uid="uid://l1hdihubffeg"]
[gd_scene load_steps=3 format=3 uid="uid://l1hdihubffeg"]
[ext_resource type="Script" uid="uid://b5i41b6502xam" path="res://scripts/CSharp/Common/Fight/FighterDamageIndicatorFlyingNumber.cs" id="1_m0ub6"]
[ext_resource type="Texture2D" uid="uid://do0y56t1moi2" path="res://art/mockups/erdbeeren.png" id="2_ctnqp"]
[node name="DamageFlyingNuber" type="Node2D" node_paths=PackedStringArray("_label")]
[node name="DamageFlyingNuber" type="Node2D" node_paths=PackedStringArray("_label", "_sprite")]
script = ExtResource("1_m0ub6")
_label = NodePath("Label")
_sprite = NodePath("TextureRect")
[node name="TextureRect" type="TextureRect" parent="."]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -61.0
offset_top = -61.0
offset_right = 61.0
offset_bottom = 61.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
texture = ExtResource("2_ctnqp")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="."]
custom_minimum_size = Vector2(200, 100)
+3 -3
View File
@@ -4,6 +4,6 @@
[node name="FightSceneSwitcher" type="Node"]
script = ExtResource("1_5dt1r")
_fightRoomScenePath = "res://scenes/Babushka_scene_fight_world_room.tscn"
_fightHappeningScene = "res://scenes/Babushka_scene_fight_happening.tscn"
_nightEndScene = "res://scenes/Babushka_scene_indoor_vesnas_room.tscn"
_fightRoomScenePath = "res://scenes/scene_fight_world_room.tscn"
_fightHappeningScene = "res://scenes/scene_fight_happening.tscn"
_nightEndScene = "res://scenes/scene_credits.tscn"
+5 -1
View File
@@ -1,6 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://n5cj71bxxjkk"]
[gd_scene load_steps=4 format=3 uid="uid://n5cj71bxxjkk"]
[ext_resource type="Script" uid="uid://dqe1i2qmpttwf" path="res://scripts/CSharp/Common/Fight/FightWorld.cs" id="1_tnyce"]
[ext_resource type="Resource" uid="uid://duq7tshxv6uhp" path="res://resources/items/beet_seed.tres" id="2_lxs0o"]
[ext_resource type="Resource" uid="uid://0mnsr4anoaiq" path="res://resources/items/beet.tres" id="3_008v8"]
[node name="FightWorldAutoload" type="Node2D"]
script = ExtResource("1_tnyce")
_itemToDropByEnemyGroup = ExtResource("2_lxs0o")
itemBeetrootToEatForHealth = ExtResource("3_008v8")
@@ -14,5 +14,9 @@ position = Vector2(23, -96)
scale = Vector2(0.547474, 0.547474)
texture = SubResource("AtlasTexture_ane0o")
[node name="CollisionShape2D" parent="TargetSelection/Click" index="0"]
position = Vector2(25.215, -195)
scale = Vector2(0.72370636, 1)
[node name="Sprite2D" parent="TargetSelection/HoverIndicator" index="0"]
position = Vector2(1, -126)
position = Vector2(0.84, -126)
+17
View File
@@ -35,6 +35,7 @@ FightWorldAutoload="*res://prefabs/fight/fight_world_autoload.tscn"
SaveGameManager="*res://scripts/CSharp/Common/Savegame/SaveGameManager.cs"
SettingsSaveController="*res://scripts/CSharp/Common/Savegame/SettingsSaveController.cs"
DayAndNight="*res://prefabs/day_and_night/day_and_night.tscn"
EntityManager="*res://prefabs/entity_system/entity_manager.tscn"
[dialogic]
@@ -48,7 +49,9 @@ directories/dch_directory={
"vesna": "res://dialog/Characters/vesna.dch"
}
directories/dtl_directory={
"cat": "res://dialog/cat.dtl",
"disclaimer": "res://dialog/disclaimer.dtl",
"domovoi_tut": "res://dialog/testing/domovoi_tut.dtl",
"quest1_ducks_end": "res://dialog/quests/ducks/quest1_ducks_end.dtl",
"quest1_ducks_start": "res://dialog/quests/ducks/quest1_ducks_start.dtl",
"quest2_tomatoes_end": "res://dialog/quests/tomatoes/quest2_tomatoes_end.dtl",
@@ -222,6 +225,10 @@ folder_colors={
"res://shader/": "pink"
}
[filesystem]
import/blender/enabled=false
[global_group]
Saveable=""
@@ -308,6 +315,16 @@ NextDayCheat={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
]
}
DebugEntities={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":66,"key_label":0,"unicode":98,"location":0,"echo":false,"script":null)
]
}
SaveGame={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194336,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[internationalization]
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -11,7 +11,7 @@
[node name="BabushkaSceneCredits" type="Node2D"]
script = ExtResource("1_f5860")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_startMenu.tscn")
_sceneNamesToLoad = PackedStringArray("res://scenes/scene_bootstrap.tscn")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(1030, 483)
+1 -1
View File
@@ -8,7 +8,7 @@
[node name="BabushkaSceneDisclaimer" type="Node2D"]
script = ExtResource("1_5otdq")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_farm_outside_2d.tscn")
_sceneNamesToLoad = PackedStringArray("res://scenes/scene_farm_outside_2d.tscn")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
+1 -1
View File
@@ -954,7 +954,7 @@ z_index = 1
y_sort_enabled = true
[node name="Yeli" parent="YSorted" instance=ExtResource("26_vnhck")]
position = Vector2(6403, 3362)
position = Vector2(6385, 3356)
_timelinesToPlay = PackedStringArray("yeli_quest_select")
[node name="Vesna" parent="YSorted" instance=ExtResource("27_6aw34")]
File diff suppressed because it is too large Load Diff
+33 -3
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=3 uid="uid://cjshlwk8ajpnp"]
[gd_scene load_steps=21 format=3 uid="uid://cjshlwk8ajpnp"]
[ext_resource type="Script" uid="uid://cnhpnn8o0gybd" path="res://scripts/CSharp/Common/Fight/FightHappeningSceneSetup.cs" id="1_fiutj"]
[ext_resource type="Script" uid="uid://c76mhhqyk4lgh" path="res://scripts/CSharp/Common/Fight/FightHappening.cs" id="1_gsk03"]
@@ -6,28 +6,41 @@
[ext_resource type="Script" uid="uid://dwsqst8fhhqlc" path="res://scripts/CSharp/Common/Fight/AllFightersVisual.cs" id="2_lu4y4"]
[ext_resource type="PackedScene" uid="uid://bcld43daavmrn" path="res://prefabs/fight/fight_scene_switcher.tscn" id="2_phrlx"]
[ext_resource type="PackedScene" uid="uid://7jsxokx67gpq" path="res://prefabs/fight/fighterVisuals/vesna_fighter_visual.tscn" id="4_qo0gi"]
[ext_resource type="Script" uid="uid://cdrjvgm82pxoj" path="res://scripts/CSharp/Common/Fight/FightHappeningAnimationContext.cs" id="4_v5rv6"]
[ext_resource type="PackedScene" uid="uid://0vm3jb1hnkkb" path="res://prefabs/fight/fighterVisuals/blob_fighter_visual.tscn" id="4_vp8s0"]
[ext_resource type="Script" uid="uid://buiwuf7pjfq8" path="res://scripts/CSharp/Common/Fight/FightHappeningStateReaction.cs" id="4_ydj1i"]
[ext_resource type="PackedScene" uid="uid://bydwj3pbvqrhb" path="res://prefabs/minigame/minigame.tscn" id="8_2b3cf"]
[ext_resource type="Script" uid="uid://byf2ywov34g0x" path="res://scripts/CSharp/Common/Fight/UI/ActionSelectUiSetup.cs" id="8_bkwsr"]
[ext_resource type="Script" uid="uid://bwm0nhvt1083k" path="res://scripts/CSharp/Common/Fight/FightMinigameHandler.cs" id="8_falfe"]
[ext_resource type="Script" uid="uid://d2ugtb3dalrg3" path="res://scripts/CSharp/Common/Fight/FightHappeningStateDebugger.cs" id="8_tv7cl"]
[ext_resource type="Texture2D" uid="uid://ciaabo8kcx2hw" path="res://art/fightworld_background.png" id="9_f4y3h"]
[ext_resource type="Script" uid="uid://2f7rqk50gtdg" path="res://scripts/CSharp/Common/Fight/SwitchSceneOnFightEnd.cs" id="10_qqd8u"]
[ext_resource type="Script" uid="uid://6nniwfxye8ss" path="res://scripts/CSharp/Common/Fight/UsedItemIndicatorVisual.cs" id="14_b4ll5"]
[ext_resource type="Script" uid="uid://71mdwp2m4rta" path="res://scripts/CSharp/Common/Fight/UI/HealButtonVisual.cs" id="14_oy2wu"]
[ext_resource type="Resource" uid="uid://0mnsr4anoaiq" path="res://resources/items/beet.tres" id="15_k4fcr"]
[ext_resource type="PackedScene" uid="uid://l1hdihubffeg" path="res://prefabs/fight/damage_flying_nuber.tscn" id="15_oy2wu"]
[ext_resource type="Texture2D" uid="uid://djewfwrdt4iv3" path="res://art/ui/UI/icons/icon-fruit-beetroot.png" id="16_k4fcr"]
[node name="BabushkaSceneFightHappening" type="Node2D"]
[node name="FightHappening" type="Node" parent="."]
script = ExtResource("1_gsk03")
[node name="ActionAnimationController" type="Node" parent="." node_paths=PackedStringArray("_allFightersVisual")]
[node name="ActionAnimationController" type="Node" parent="." node_paths=PackedStringArray("_allFightersVisual", "_animationContext")]
script = ExtResource("2_7kjgs")
_allFightersVisual = NodePath("../FightVisuals")
_animationContext = NodePath("AnimationContext")
[node name="StateReactionActionAnimation" type="Node" parent="ActionAnimationController"]
script = ExtResource("4_ydj1i")
_fightState = 10
[node name="AnimationContext" type="Node" parent="ActionAnimationController" node_paths=PackedStringArray("useHealItemIndicator")]
script = ExtResource("4_v5rv6")
useHealItemIndicator = NodePath("../../UseItemIndicator")
[node name="Camera2D" type="Camera2D" parent="."]
scale = Vector2(0.71911293, 0.6664279)
[node name="FightSetup" type="Node2D" parent="."]
script = ExtResource("1_fiutj")
@@ -47,6 +60,11 @@ _positionDistanceFromCenter = PackedFloat32Array(300, 550, 800)
[node name="EnvironmentVisuals" type="Node2D" parent="."]
[node name="background" type="Sprite2D" parent="EnvironmentVisuals"]
z_index = -100
scale = Vector2(3, 3)
texture = ExtResource("9_f4y3h")
[node name="MinigameHandler" type="Node2D" parent="." node_paths=PackedStringArray("_minigameController")]
script = ExtResource("8_falfe")
_minigameController = NodePath("Minigame")
@@ -146,7 +164,12 @@ theme_override_constants/margin_bottom = 10
[node name="Talk Button" type="Button" parent="ActionSelect/BottomPanel/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer3"]
layout_mode = 2
theme_override_font_sizes/font_size = 41
text = "Talk"
text = "x19 - Heal"
icon = ExtResource("16_k4fcr")
alignment = 0
expand_icon = true
script = ExtResource("14_oy2wu")
_healItemBlueprint = ExtResource("15_k4fcr")
[node name="MarginContainer4" type="MarginContainer" parent="ActionSelect/BottomPanel/VBoxContainer/MarginContainer/HBoxContainer"]
layout_mode = 2
@@ -207,6 +230,12 @@ offset_right = 794.0
offset_bottom = -472.0
text = "Hello world"
[node name="UseItemIndicator" type="Node2D" parent="."]
position = Vector2(214, 319)
script = ExtResource("14_b4ll5")
_flyingIndicatorPrefab = ExtResource("15_oy2wu")
_itemTexture = ExtResource("16_k4fcr")
[connection signal="SignalTransitionState" from="FightHappening" to="ActionAnimationController/StateReactionActionAnimation" method="FightHappeningStateTransitioned"]
[connection signal="SignalTransitionState" from="FightHappening" to="FightVisuals" method="FightHappeningStateChange"]
[connection signal="SignalTransitionState" from="FightHappening" to="ActionSelect/StateReactionInputActionSelect" method="FightHappeningStateTransitioned"]
@@ -221,4 +250,5 @@ text = "Hello world"
[connection signal="pressed" from="ActionSelect/BottomPanel/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer4/Flee Button" to="ActionSelect" method="SelectAction" binds= [4]]
[connection signal="OnStateEntered" from="ActionSelect/StateReactionInputActionSelect" to="ActionSelect" method="show"]
[connection signal="OnStateEntered" from="ActionSelect/StateReactionInputActionSelect" to="ActionSelect" method="StateEntered"]
[connection signal="OnStateEntered" from="ActionSelect/StateReactionInputActionSelect" to="ActionSelect/BottomPanel/VBoxContainer/MarginContainer/HBoxContainer/MarginContainer3/Talk Button" method="UpdateText"]
[connection signal="OnStateExited" from="ActionSelect/StateReactionInputActionSelect" to="ActionSelect" method="hide"]
+3 -1
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=52 format=3 uid="uid://cacnapfv7w567"]
[gd_scene load_steps=53 format=3 uid="uid://cacnapfv7w567"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="1_pi6ua"]
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_hqa4k"]
@@ -40,6 +40,7 @@
[ext_resource type="Script" uid="uid://dbu8afaiohpdh" path="res://scripts/CSharp/Common/Fight/FightRoomSceneSetup.cs" id="40_cvg1r"]
[ext_resource type="PackedScene" uid="uid://bcld43daavmrn" path="res://prefabs/fight/fight_scene_switcher.tscn" id="40_elhbh"]
[ext_resource type="PackedScene" uid="uid://qfdiudt3vpai" path="res://prefabs/fight/roaming_enemy_group.tscn" id="41_cvg1r"]
[ext_resource type="PackedScene" uid="uid://dpbbroif2tnil" path="res://prefabs/interactions/generic_item_on_ground_2d.tscn" id="41_x3yi1"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ruj2u"]
shader = ExtResource("16_0fard")
@@ -2175,6 +2176,7 @@ _sceneRoot = NodePath("..")
script = ExtResource("40_cvg1r")
_enemyGroupSpawns = [NodePath("../YSorted/EnemyGroupSpawns/Spawn1"), NodePath("../YSorted/EnemyGroupSpawns/Spawn2"), NodePath("../YSorted/EnemyGroupSpawns/Spawn3"), NodePath("../YSorted/EnemyGroupSpawns/Spawn4")]
_roamingEnemyGroupPrefab = ExtResource("41_cvg1r")
_itemOnGroundPrefab = ExtResource("41_x3yi1")
_fightSceneSwitcher = NodePath("../FightSceneSwitcher")
[editable path="YSorted/Vesna"]
+16 -2
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=41 format=3 uid="uid://bm21nqepnwaik"]
[gd_scene load_steps=43 format=3 uid="uid://bm21nqepnwaik"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_3al6t"]
[ext_resource type="Texture2D" uid="uid://cnhsxxps2cw5" path="res://art/indoor/room export/Room_01_table.png" id="2_ufnxe"]
@@ -20,7 +20,9 @@
[ext_resource type="AudioStream" uid="uid://r2f6xmjvyyjv" path="res://audio/sfx/Animals/SFX_Cat_Purr_01.wav" id="18_3oexm"]
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer2D.cs" id="19_a2xrf"]
[ext_resource type="Script" uid="uid://31p67cdowuw4" path="res://scripts/CSharp/Common/Animation/AnimationStarter.cs" id="20_lkkn4"]
[ext_resource type="Script" uid="uid://dnipeibppjirs" path="res://scripts/CSharp/Common/NPC/DialogicOverlayStarter.cs" id="20_pejp6"]
[ext_resource type="Texture2D" uid="uid://ckvytnpi8gcxq" path="res://art/eyes_atlas.png" id="21_m0gmu"]
[ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="21_nc3ef"]
[ext_resource type="Texture2D" uid="uid://bqwhptcgg5ons" path="res://art/indoor/room export/Room_01_dorr_R.png" id="22_ahl31"]
[ext_resource type="Texture2D" uid="uid://da67c7avarwq2" path="res://art/indoor/kitchen_bgAssets.png" id="23_hgs5o"]
[ext_resource type="Texture2D" uid="uid://vyk63d0pgqm5" path="res://art/indoor/room export/Room_01_dioor L.png" id="24_t86aa"]
@@ -357,7 +359,7 @@ region_enabled = true
region_rect = Rect2(1156, 1185, 940, 189)
[node name="Katze" type="Sprite2D" parent="BackWall/Bench"]
z_index = 10
z_index = 15
position = Vector2(61, -87)
scale = Vector2(2, 2)
texture = ExtResource("12_dckqa")
@@ -373,6 +375,14 @@ position = Vector2(-6.5, -44)
scale = Vector2(0.5, 0.5)
_spritesToOutline = [NodePath("..")]
[node name="dialogic overlay starter" type="Node2D" parent="BackWall/Bench/Katze"]
script = ExtResource("20_pejp6")
_timelinesToPlay = PackedStringArray("cat")
_startOnReady = false
[node name="dialogic starter" type="Node" parent="BackWall/Bench/Katze/dialogic overlay starter"]
script = ExtResource("21_nc3ef")
[node name="Bench2" type="Sprite2D" parent="BackWall"]
z_index = -10
position = Vector2(-2906, 243)
@@ -600,6 +610,10 @@ _followNode = NodePath("../Vesna/CharacterBody2D")
[connection signal="Interacted" from="BackWall/Room01PechkaDoor/InteractionArea" to="BackWall/Room01PechkaDoor/InteractionArea" method="ToggleActive"]
[connection signal="Interacted" from="BackWall/Room01PechkaDoor/InteractionArea" to="BackWall/Room assets/hand" method="PlayAnimation"]
[connection signal="Interacted" from="BackWall/Bench/Katze/InteractionArea" to="BackWall/Bench/Katze/AudioStreamPlayer2D" method="PlayOneShot"]
[connection signal="Interacted" from="BackWall/Bench/Katze/InteractionArea" to="BackWall/Bench/Katze/dialogic overlay starter" method="ToggleDialogue"]
[connection signal="Dialogue" from="BackWall/Bench/Katze/dialogic overlay starter" to="BackWall/Bench/Katze/dialogic overlay starter/dialogic starter" method="open"]
[connection signal="timelineEnded" from="BackWall/Bench/Katze/dialogic overlay starter/dialogic starter" to="BackWall/Bench/Katze/InteractionArea" method="SetActiveTrue"]
[connection signal="timelineStarted" from="BackWall/Bench/Katze/dialogic overlay starter/dialogic starter" to="BackWall/Bench/Katze/InteractionArea" method="SetActiveFalse"]
[connection signal="InteractedTool" from="BackWall/Doors/Door_Kitchen/KitchendoorInteraction" to="." method="LoadSceneAtIndex"]
[connection signal="InteractedTool" from="BackWall/Doors/Door_Outside/OutsideDoor" to="." method="LoadSceneAtIndex"]
[connection signal="InteractedTool" from="BackWall/Doors/Door_Bedroom/VesnasRoomDoor" to="." method="LoadSceneAtIndex"]
+26 -9
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=98 format=3 uid="uid://b3ibx4resa1f3"]
[gd_scene load_steps=100 format=3 uid="uid://b3ibx4resa1f3"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_6krrk"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="2_4ktoi"]
@@ -42,7 +42,9 @@
[ext_resource type="PackedScene" uid="uid://dpbbroif2tnil" path="res://prefabs/interactions/generic_item_on_ground_2d.tscn" id="43_dr6bm"]
[ext_resource type="Texture2D" uid="uid://ct7ea8ikor5rf" path="res://art/nature/grass/grass-3.png" id="43_g8k4k"]
[ext_resource type="Texture2D" uid="uid://d3dwl6ph0pu1d" path="res://art/nature/grass/grass-6.png" id="44_jgrpl"]
[ext_resource type="Script" uid="uid://dnipeibppjirs" path="res://scripts/CSharp/Common/NPC/DialogicOverlayStarter.cs" id="44_m6p1o"]
[ext_resource type="Texture2D" uid="uid://dmo21h14toxfu" path="res://art/indoor/indoor outdoor/domovoi.png" id="44_njxly"]
[ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="45_1ly1s"]
[ext_resource type="Texture2D" uid="uid://blb3agipyxnal" path="res://art/farm/farming/farmobjekte/zaun/fence_door.png" id="47_xfjh2"]
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="52_gwhnv"]
[ext_resource type="AudioStream" uid="uid://dku1rq5cocisg" path="res://audio/Music/Farming_90BPM_69Bars.wav" id="53_2tfpr"]
@@ -1237,7 +1239,6 @@ region_enabled = true
region_rect = Rect2(0, 604, 248, 228)
[node name="bush23" type="Sprite2D" parent="YSorted/Farm visuals/Static/greenery/left side"]
z_index = 1
y_sort_enabled = true
material = SubResource("ShaderMaterial_bcdgk")
position = Vector2(15022, 3301)
@@ -1249,7 +1250,7 @@ region_rect = Rect2(1837, 651, 139, 180)
[node name="bush24" type="Sprite2D" parent="YSorted/Farm visuals/Static/greenery/left side"]
modulate = Color(0.8428, 0.8771, 0.98, 1)
z_index = 2
z_index = -1
y_sort_enabled = true
material = SubResource("ShaderMaterial_bcdgk")
position = Vector2(15973, 3380)
@@ -1370,6 +1371,7 @@ region_enabled = true
region_rect = Rect2(130, 0, 201, 278)
[node name="bush17" type="Sprite2D" parent="YSorted/Farm visuals/Static/greenery/right side"]
z_index = 3
material = SubResource("ShaderMaterial_bcdgk")
position = Vector2(5599, 3799)
scale = Vector2(-2.40318, 3.59175)
@@ -1398,13 +1400,13 @@ region_enabled = true
region_rect = Rect2(1837, 651, 139, 180)
[node name="Sonnenblume8" type="Sprite2D" parent="YSorted/Farm visuals/Static/greenery/right side"]
z_index = 1
z_index = -5
y_sort_enabled = true
material = SubResource("ShaderMaterial_618my")
position = Vector2(5146, 1935)
position = Vector2(5187.001, 1864.0001)
scale = Vector2(0.373695, 0.388829)
texture = ExtResource("38_0bsmo")
offset = Vector2(0, -800)
offset = Vector2(-109.7168, -617.4004)
region_enabled = true
region_rect = Rect2(0, 0, 1440, 1576)
@@ -1827,7 +1829,7 @@ z_index = 1
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField3/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
z_index = 0
_state = 2
_state = 3
_field = NodePath("../..")
_daysWatered = 5
@@ -1859,7 +1861,7 @@ z_index = 1
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField4/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
z_index = 0
_state = 2
_state = 3
_field = NodePath("../..")
_daysWatered = 7
@@ -2020,7 +2022,7 @@ _spritesToOutline = [NodePath("Fence Door2")]
_id = 0
[node name="CollisionShape3D" parent="YSorted/Blocker/BackToFarm/Area2D" index="0"]
position = Vector2(-37, -208)
position = Vector2(-37, -303)
shape = SubResource("CircleShape2D_dr6bm")
[node name="Fence Door2" type="Sprite2D" parent="YSorted/Blocker/BackToFarm"]
@@ -2076,6 +2078,17 @@ texture = ExtResource("44_njxly")
region_enabled = true
region_rect = Rect2(65, 149, 223, 375)
[node name="InteractionArea" parent="YSorted/domovoi" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("31_xcb8u")]
_spritesToOutline = [NodePath("..")]
[node name="dialogic overlay starter" type="Node2D" parent="YSorted/domovoi"]
script = ExtResource("44_m6p1o")
_timelinesToPlay = PackedStringArray("domovoi_tut")
_startOnReady = false
[node name="dialogic starter" type="Node" parent="YSorted/domovoi/dialogic overlay starter"]
script = ExtResource("45_1ly1s")
[node name="WateringCan" parent="YSorted" instance=ExtResource("43_dr6bm")]
position = Vector2(5220, 2108)
@@ -2163,6 +2176,10 @@ script = ExtResource("59_njxly")
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[connection signal="InteractedTool" from="YSorted/Blocker/BackToFarm" to="." method="LoadSceneAtIndex"]
[connection signal="Interacted" from="YSorted/domovoi/InteractionArea" to="YSorted/domovoi/dialogic overlay starter" method="ToggleDialogue"]
[connection signal="Dialogue" from="YSorted/domovoi/dialogic overlay starter" to="YSorted/domovoi/dialogic overlay starter/dialogic starter" method="open"]
[connection signal="timelineEnded" from="YSorted/domovoi/dialogic overlay starter/dialogic starter" to="YSorted/domovoi/InteractionArea" method="SetActiveTrue"]
[connection signal="timelineStarted" from="YSorted/domovoi/dialogic overlay starter/dialogic starter" to="YSorted/domovoi/InteractionArea" method="SetActiveFalse"]
[connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"]
[connection signal="tree_entered" from="SceneNameSetter" to="SceneNameSetter" method="Set"]
+1 -1
View File
@@ -7,7 +7,7 @@
[node name="BabushkaSceneStartMenu" type="Node2D"]
script = ExtResource("1_fj2fh")
_sceneNamesToLoad = PackedStringArray("res://scenes/scene_farm_outside_2d.tscn")
_sceneNamesToLoad = PackedStringArray("res://scenes/scene_disclaimer.tscn")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
@@ -19,6 +19,7 @@ public partial class InteractionArea2D : Node2D
[Export] private int _id = -1; // TODO: remove
private Material[] _backupMaterials;
private bool _initializationComplete;
[Signal] public delegate void InteractedToolEventHandler(int id); // TODO: remove
@@ -33,6 +34,8 @@ public partial class InteractionArea2D : Node2D
Visible = value;
_selectionChangeListener.ProcessMode = value ? ProcessModeEnum.Inherit : ProcessModeEnum.Disabled;
_active = value;
if(!_active && _initializationComplete)
ResetHighlight();
}
}
@@ -48,6 +51,7 @@ public partial class InteractionArea2D : Node2D
if (_useOutline)
{
_backupMaterials = _spritesToOutline.Select(s => s.Material).ToArray();
_initializationComplete = true;
}
}
@@ -127,9 +131,20 @@ public partial class InteractionArea2D : Node2D
public void ToggleActive()
{
GD.Print($"Toggle active {GetParent().Name}: {!_active}");
_active = !_active;
_label.Hide();
}
public void SetActiveTrue()
{
IsActive = true;
}
public void SetActiveFalse()
{
IsActive = false;
}
}
@@ -12,6 +12,7 @@ public partial class FieldActivator : Node, ISaveable
{
[Export] private FieldBehaviour2D _field;
[Export] private InteractionArea2D _activatorArea;
[Export] private Node _saveIdHolder;
private bool _used = false;
private bool _rakeInHand;
@@ -65,13 +66,16 @@ public partial class FieldActivator : Node, ISaveable
{ "field_activator_used", _used }
};
string id = GetMeta("SaveID").AsString();
// Building a unique id from the top node's save id and a qualifier to make it new.
string parent_id = _saveIdHolder.GetMeta("SaveID").AsString();
string id = $"{parent_id}_field_activator";
SavegameService.AppendDataToSave( id, payloadData);
}
public void LoadFromSaveData()
{
string id = GetMeta("SaveID").AsString();
string parent_id = _saveIdHolder.GetMeta("SaveID").AsString();
string id = $"{parent_id}_field_activator";
Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
if (save.Count > 0)
@@ -80,6 +84,10 @@ public partial class FieldActivator : Node, ISaveable
{
_used = usedVar.AsBool();
}
else
{
_used = false;
}
}
}
}
@@ -58,7 +58,7 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
private void UpdateInteractionArea()
{
// fieldstate == tilled / watered && samen im Inventar
_canPlant = (FieldState == FieldState.Tilled || FieldState == FieldState.Watered) && _seedsActive;
_canPlant = (FieldState == FieldState.Tilled || FieldState == FieldState.Watered) && _seedsActive && !IsPlanted;
// fieldstate == tilled && watering can ausgewählt
_canWater = (FieldState == FieldState.Tilled || IsPlanted) && _wateringCanActive && WateringCanState.GetFillState() > 0;
@@ -79,9 +79,17 @@ public partial class FieldBehaviour2D : Sprite2D, ISaveable
public override void _EnterTree()
{
WateringCanState.OnFill += UpdateInteractionArea;
WateringCanState.OnEmpty += UpdateInteractionArea;
LoadFromSaveData();
}
public override void _ExitTree()
{
WateringCanState.OnFill -= UpdateInteractionArea;
WateringCanState.OnEmpty -= UpdateInteractionArea;
}
public override void _Ready()
{
if(PlantingPlaceholder.GetChildCount() > 0)
@@ -3,7 +3,6 @@ using System.Diagnostics;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Farming;
@@ -187,6 +186,7 @@ public partial class PlantBehaviour2D : Node2D
private void SetActiveHarvestablePlant(bool active)
{
_harvestablePlant.IsActive = active;
_harvestablePlant.ProcessMode = active ? ProcessModeEnum.Inherit : ProcessModeEnum.Disabled;
_harvestablePlant.UpdateVisuals();
}
@@ -30,6 +30,7 @@ public static class WateringCanState
public static event WateringCanDelegate WateringCanActiveStateChanged;
public static event Action? OnWater;
public static event Action? OnFill;
public static event Action? OnEmpty;
@@ -52,6 +53,11 @@ public static class WateringCanState
_fillstate--;
OnWater?.Invoke();
}
if (_fillstate == 0)
{
OnEmpty?.Invoke();
}
}
/// <summary>
@@ -11,11 +11,11 @@ public partial class ActionAnimationController : Node
#endregion
[Export] private AllFightersVisual _allFightersVisual = null!;
[Export] private FightHappeningAnimationContext _animationContext = null!;
public void StateEnter()
{
_ = HappeningData.actionStaging!.AnimateAction(_allFightersVisual);
_ = HappeningData.actionStaging!.AnimateAction(_allFightersVisual,_animationContext);
}
public void StateExit()
@@ -12,6 +12,7 @@ public class TargetSelectActionDetail : FighterAction.FighterActionDetail
// settings
public required bool selectEnemy;
public required bool selectAlly;
public required bool aliveOnly;
public VisualRange visualRange = VisualRange.Single;
// result
@@ -13,7 +13,8 @@ public class AllyAttackAction : FighterAction
public TargetSelectActionDetail targetSelect = new()
{
selectEnemy = true,
selectAlly = false
selectAlly = false,
aliveOnly = true
};
public MinigameActionDetail minigameDetail = new();
@@ -47,10 +48,11 @@ public class AllyAttackAction : FighterAction
public override void ExecuteAction()
{
var totalDamage = minigameDetail.damageHits!.Sum(dh => dh);
targetSelect.GetTarget().AddHealth(-totalDamage);
targetSelect.GetTarget().ChangeHealth(-totalDamage);
}
public override async Task AnimateAction(AllFightersVisual allFightersVisual)
public override async Task AnimateAction(AllFightersVisual allFightersVisual,
FightHappeningAnimationContext animationContext)
{
var currentFighter = HappeningData.fighterTurn.Current;
var targetFighter = targetSelect.GetTarget();
@@ -63,7 +65,7 @@ public class AllyAttackAction : FighterAction
foreach (var hit in minigameDetail.damageHits!)
{
targetFighterVisual.SpawnDamageIndicatorNumber(hit);
targetFighterVisual.SpawnDamageIndicatorNumber($"-{hit}");
}
await currentFighterVisual.AnimatePosToBase();
@@ -18,10 +18,11 @@ public class BlobAttackAction(int damage = 3) : FighterAction
public override void ExecuteAction()
{
FightWorld.Instance.allyFighters.vesnaFighter.AddHealth(-damage);
FightWorld.Instance.allyFighters.vesnaFighter.ChangeHealth(-damage);
}
public override async Task AnimateAction(AllFightersVisual allFightersVisual)
public override async Task AnimateAction(AllFightersVisual allFightersVisual,
FightHappeningAnimationContext animationContext)
{
var currentFighter = HappeningData.fighterTurn.Current;
var targetFighter = FightWorld.Instance.allyFighters.vesnaFighter;
@@ -31,7 +32,7 @@ public class BlobAttackAction(int damage = 3) : FighterAction
await currentFighterVisual.AnimatePosToTarget(targetFighterVisual);
_ = targetFighterVisual.AnimateHit();
targetFighterVisual.SpawnDamageIndicatorNumber(damage);
targetFighterVisual.SpawnDamageIndicatorNumber($"-{damage}");
await currentFighterVisual.AnimatePosToBase();
}
}
@@ -0,0 +1,48 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Common.Util;
namespace Babushka.scripts.CSharp.Common.Fight.Actions;
public class EatBeetrootAction : FighterAction
{
public override Variant<float, Func<bool>> GetAnimationEnd() => 1;
public override bool NextDetail() => false;
private const int HealAmount = 20;
public override bool ShouldAbort()
{
Debug.Assert(FightWorld.Instance.itemBeetrootToEatForHealth != null,
"Item to eat for health has not been set in the FightWorld autoload");
return !InventoryManager.Instance.playerInventory!.HasItems(new ItemInstance
{ blueprint = FightWorld.Instance.itemBeetrootToEatForHealth });
}
public override async Task AnimateAction(AllFightersVisual allFightersVisual,
FightHappeningAnimationContext animationContext)
{
var fighter = HappeningData.fighterTurn.Current;
var fighterVisual = allFightersVisual.GetVisualForFighter(fighter);
fighterVisual.SpawnDamageIndicatorNumber($"+{HealAmount}");
animationContext.useHealItemIndicator.SpawnIndicator();
await fighterVisual.AnimateHeal();
}
public override void ExecuteAction()
{
var fighter = HappeningData.fighterTurn.Current;
var result = InventoryManager.Instance.playerInventory!.TryRemoveAllItems(
new ItemInstance { blueprint = FightWorld.Instance.itemBeetrootToEatForHealth! });
if (result != InventoryActionResult.Success)
throw new Exception("No Beetroot in inventory. This case should have been handled earlier");
fighter.ChangeHealth(HealAmount);
}
public override AllyActionButton BindToActionButton() => AllyActionButton.Talk; // Temporarily bound to talk button
}
@@ -0,0 +1 @@
uid://b2463q1waqvdu
@@ -117,11 +117,13 @@ public partial class AllFightersVisual : Node
if (targetDetail.selectEnemy)
_fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.enemyFighterFormation))
.Where(kv => !targetDetail.aliveOnly || kv.Key.IsAlive())// if aliveOnly: take where IsAlive
.ForEach(kv => kv.Value.SetTargetSelectionActive(true));
if (targetDetail.selectAlly)
_fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.allyFighterFormation))
.Where(kv => !targetDetail.aliveOnly || kv.Key.IsAlive())// if aliveOnly: take where IsAlive
.ForEach(kv => kv.Value.SetTargetSelectionActive(true));
}
+2 -1
View File
@@ -10,7 +10,8 @@ public class AllyFighters
maxHealth = 60,
availableActions =
[
new AllyAttackAction()
new AllyAttackAction(),
new EatBeetrootAction()
]
};
public FightWorld.Fighter chuhaFighter = new()
+11 -6
View File
@@ -222,9 +222,9 @@ public partial class FightHappening : Node
case FightState.ActionCheckDetails:
RequireNotNull(HappeningData.actionStaging);
if (ActionAbort())
if (ShouldActionAbort())
ChangeState(FightState.InputActionSelect);
else if (ActionNeededDetail())
else if (DoesActionNeededDetail())
ChangeState(FightState.InputActionDetail);
else
ChangeState(FightState.ActionExecute);
@@ -307,6 +307,11 @@ public partial class FightHappening : Node
HappeningData.enemyFighterFormation.SetFighterAtPosition(emptySlotIndex, fighter);
HappeningData.fighterTurn.AddAsLast(fighter);
}
if (GD.RandRange(0, 2) != 0) // 2/3 chance for vesna to start
{
HappeningData.fighterTurn.SpinBack();
}
}
private void ExecuteNextFighter()
@@ -328,13 +333,13 @@ public partial class FightHappening : Node
return HappeningData.actionStaging.GetAnimationEnd();
}
private bool ActionAbort()
private bool ShouldActionAbort()
{
Debug.Assert(HappeningData.actionStaging != null);
return HappeningData.actionStaging.MarkedForAbort();
return HappeningData.actionStaging.ShouldAbort();
}
private bool ActionNeededDetail()
private bool DoesActionNeededDetail()
{
Debug.Assert(HappeningData.actionStaging != null);
return HappeningData.actionStaging.NextDetail();
@@ -344,7 +349,7 @@ public partial class FightHappening : Node
private void ReviveVesna()
{
var vesnaFighter = FightWorld.Instance.allyFighters.vesnaFighter;
vesnaFighter.health = vesnaFighter.maxHealth;
vesnaFighter.Health = vesnaFighter.maxHealth;
GD.Print("Vesna has been revived. This is for the current prototype only");
}
@@ -0,0 +1,8 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class FightHappeningAnimationContext : Node
{
[Export] public UsedItemIndicatorVisual useHealItemIndicator = null!;
}
@@ -0,0 +1 @@
uid://cdrjvgm82pxoj
@@ -1,15 +1,16 @@
using System.Collections.Generic;
using System.Linq;
using Babushka.scripts.CSharp.Common.Util;
using Babushka.scripts.CSharp.Common.Inventory;
using Godot;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class FightRoomSceneSetup : Node
{
[Export(PropertyHint.ArrayType)] private Node2D[] _enemyGroupSpawns;
[Export] private PackedScene _roamingEnemyGroupPrefab;
[Export] private FightSceneSwitcher _fightSceneSwitcher;
[Export(PropertyHint.ArrayType)] private Node2D[] _enemyGroupSpawns = null!;
[Export] private PackedScene _roamingEnemyGroupPrefab = null!;
[Export] private PackedScene _itemOnGroundPrefab = null!;
[Export] private FightSceneSwitcher _fightSceneSwitcher = null!;
public override void _Ready()
@@ -19,11 +20,30 @@ public partial class FightRoomSceneSetup : Node
foreach (var (parent, group) in _enemyGroupSpawns.Zip(room.enemyGroups))
{
if (group.AreAllDead())
continue;
var roamingEnemyGroup = _roamingEnemyGroupPrefab.Instantiate<RoamingEnemyGroup>();
roamingEnemyGroup.Initialize(group, _fightSceneSwitcher);
parent.AddChild(roamingEnemyGroup);
{
SpawnLoot(group, parent);
}
else
{
SpawnEnemies(group, parent);
}
}
}
private void SpawnEnemies(FightWorld.FighterGroup group, Node2D parent)
{
var roamingEnemyGroup = _roamingEnemyGroupPrefab.Instantiate<RoamingEnemyGroup>();
roamingEnemyGroup.Initialize(group, _fightSceneSwitcher);
parent.AddChild(roamingEnemyGroup);
}
private void SpawnLoot(FightWorld.FighterGroup group, Node2D parent)
{
if (group.lootToDrop == null)
return;
var onGroundInstance = _itemOnGroundPrefab.Instantiate<ItemOnGround2D>();
onGroundInstance.itemInstance = group.lootToDrop;
parent.AddChild(onGroundInstance);
}
}
+10 -9
View File
@@ -11,14 +11,15 @@ public static class FightUtils
return self.Where(e => e.IsAlive());
}
public static IEnumerable<FightWorld.Fighter> WhereIsNotInFormation(this IEnumerable<FightWorld.Fighter> self, FighterFormation formation)
public static IEnumerable<FightWorld.Fighter> WhereIsNotInFormation(this IEnumerable<FightWorld.Fighter> self,
FighterFormation formation)
{
return self.Where(e => !e.IsInFormation(formation));
}
public static bool IsAlive(this FightWorld.Fighter self)
{
return self.GetHealth() > 0;
return self.Health > 0;
}
public static bool IsDead(this FightWorld.Fighter self)
@@ -26,14 +27,14 @@ public static class FightUtils
return !self.IsAlive();
}
public static int GetHealth(this FightWorld.Fighter self)
/// <summary>
/// Changes the health of a fighter
/// </summary>
/// <param name="self">The fighter itself</param>
/// <param name="amount">The amount of health to add. Make negative to remove health</param>
public static void ChangeHealth(this FightWorld.Fighter self, int amount)
{
return Math.Max(self.health ?? self.maxHealth, 0);
}
public static void AddHealth(this FightWorld.Fighter self, int addHealth)
{
self.health = self.GetHealth() + addHealth;
self.Health += amount;
}
public static bool IsInFormation(this FightWorld.Fighter self, FighterFormation formation)
+24 -4
View File
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using Babushka.scripts.CSharp.Common.Fight.Actions;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Common.Util;
using Godot;
@@ -19,6 +21,7 @@ public partial class FightWorld : Node
None,
EndOfNight
}
public required Dictionary<int, Room> paths;
public required List<FighterGroup> enemyGroups;
public Special specialRoom = Special.None;
@@ -27,6 +30,7 @@ public partial class FightWorld : Node
public class FighterGroup
{
public required List<Fighter> fighters;
public ItemInstance? lootToDrop = null;
}
public class FightHappeningData
@@ -56,9 +60,17 @@ public partial class FightWorld : Node
public required int maxHealth;
public required List<FighterAction> availableActions;
public const int MaxActionPoints = 1;
public int? health = null; // null => initialize to full health on spawn
public int actionPointsLeft;
private int? _healthBacking = null;
public int Health
{
get => _healthBacking ?? maxHealth;
set => _healthBacking = Math.Clamp(value, 0, maxHealth);
}
public FighterAction AutoSelectAction()
{
return availableActions.Random() ?? new FighterAction.Skip();
@@ -81,6 +93,10 @@ public partial class FightWorld : Node
public FightHappeningData? fightHappeningData = null;
public AllyFighters allyFighters = new();
// settings
[Export] private ItemResource? _itemToDropByEnemyGroup;
[Export] public ItemResource? itemBeetrootToEatForHealth;
public void ResetFightWorld()
{
Generate();
@@ -89,10 +105,10 @@ public partial class FightWorld : Node
public void Generate()
{
world = new Generator().GenerateWorld();
world = new Generator(this).GenerateWorld();
}
private class Generator
private class Generator(FightWorld fightWorld)
{
public World GenerateWorld()
{
@@ -162,6 +178,11 @@ public partial class FightWorld : Node
fighters = []
};
if (fightWorld._itemToDropByEnemyGroup != null)
{
enemyGroup.lootToDrop = new ItemInstance { blueprint = fightWorld._itemToDropByEnemyGroup };
}
var enemyCount = GD.RandRange(2, 3);
for (var i = 0; i < enemyCount; i++)
@@ -189,7 +210,6 @@ public partial class FightWorld : Node
var enemy = new Fighter
{
type = type,
health = null,
maxHealth = GD.RandRange(8, 20),
availableActions =
[
+4 -12
View File
@@ -30,8 +30,6 @@ public abstract class FighterAction
public abstract bool DetailComplete();
}
private bool _abort = false;
#region Shortcuts
protected static FightWorld.FightHappeningData HappeningData =>
@@ -61,19 +59,13 @@ public abstract class FighterAction
/// Animates the action.
/// </summary>
/// <param name="allFightersVisual"></param>
public virtual async Task AnimateAction(AllFightersVisual allFightersVisual)
/// <param name="animationContext"></param>
public virtual async Task AnimateAction(AllFightersVisual allFightersVisual,
FightHappeningAnimationContext animationContext)
{
}
public void MarkAbort()
{
_abort = true;
}
public bool MarkedForAbort()
{
return _abort;
}
public virtual bool ShouldAbort() => false;
/// <summary>
/// Returns the FighterActionDetail, that is currently handled.
@@ -4,13 +4,13 @@ namespace Babushka.scripts.CSharp.Common.Fight;
public partial class FighterDamageIndicatorVisual : Node2D
{
[Export] private PackedScene _flyingNumberPrefab;
[Export] private PackedScene _flyingNumberPrefab = null!;
public void SpawnFlyingNumber(int number)
public void SpawnFlyingNumber(string text)
{
var flyingNumberInstance = _flyingNumberPrefab.Instantiate<FighterDamageIndicatorFlyingNumber>();
var flyingNumberInstance = _flyingNumberPrefab.Instantiate<FlyingIndicator>();
AddChild(flyingNumberInstance);
flyingNumberInstance.Initialize(number);
flyingNumberInstance.Initialize(text);
}
}
@@ -99,6 +99,23 @@ public class FighterTurn : IEnumerable<FightWorld.Fighter>
return false;
}
/// <summary>
/// Sets the current one back
/// This is an expensive operation, because the entire data structure needs to be circled
/// </summary>
public void SpinBack()
{
if (_currentNode == null) return;
var node = _currentNode;
while (node.next != _currentNode)
{
node = node.next;
}
_currentNode = node;
}
public IEnumerator<FightWorld.Fighter> GetEnumerator()
{
if (_currentNode == null) return Enumerable.Empty<FightWorld.Fighter>().GetEnumerator();
+19 -12
View File
@@ -42,7 +42,12 @@ public partial class FighterVisual : Node2D
_boundFighter.IsInFormation(HappeningData.enemyFighterFormation) ? -1 : 1,
_boundFighter.IsDead() ? .3f : 1);
healthBarVisual.UpdateHealth(_boundFighter.GetHealth(), _boundFighter.maxHealth);
UpdateHealthBarVisuals();
}
private void UpdateHealthBarVisuals()
{
healthBarVisual.UpdateHealth(_boundFighter.Health, _boundFighter.maxHealth);
}
public void SetTargetSelectionActive(bool value)
@@ -78,6 +83,7 @@ public partial class FighterVisual : Node2D
public async Task AnimateHit()
{
UpdateHealthBarVisuals();
var tween = GetTree().CreateTween();
tween.TweenProperty(_squashParent, "scale", new Vector2(1.4f, 0.6f), 0.15);
tween.TweenProperty(_squashParent, "scale", new Vector2(1, 1), 0.4)
@@ -85,17 +91,18 @@ public partial class FighterVisual : Node2D
await ToSignal(tween, "finished");
}
// Keep for reference for new Heal animation
//public void HealAnimation()
//{
// EmitSignalHealed();
// var tween = GetTree().CreateTween();
// tween.TweenProperty(this, "scale", new Vector2(0.6f, 1.4f), 0.15);
// tween.TweenProperty(this, "scale", new Vector2(1, 1), 0.4)
// .SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
//}
public void SpawnDamageIndicatorNumber(int number)
public async Task AnimateHeal()
{
_fighterDamageIndicatorVisual.SpawnFlyingNumber(number);
UpdateHealthBarVisuals();
var tween = GetTree().CreateTween();
tween.TweenProperty(_squashParent, "scale", new Vector2(0.6f, 1.4f), 0.15);
tween.TweenProperty(_squashParent, "scale", new Vector2(1, 1), 0.4)
.SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
await ToSignal(tween, "finished");
}
public void SpawnDamageIndicatorNumber(string text)
{
_fighterDamageIndicatorVisual.SpawnFlyingNumber(text);
}
}
@@ -3,13 +3,19 @@ using Godot;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class FighterDamageIndicatorFlyingNumber : Node2D
public partial class FlyingIndicator : Node2D
{
[Export] private Label _label;
[Export] private Label _label = null!;
[Export] private TextureRect _sprite = null!;
public void Initialize(int number)
public void Initialize(string? text = null, Texture2D? icon = null)
{
_label.Text = number.ToString();
_label.Visible = text != null;
_sprite.Visible = icon != null;
if (text != null) _label.Text = text;
if (icon != null) _sprite.Texture = icon;
var tween = CreateTween();
var xMovement = GD.RandRange(-150, 150);
@@ -9,9 +9,15 @@ public partial class SwitchSceneOnFightEnd : Node
public void OnFightStateEnter(FightHappening.FightState to)
{
if (to is FightHappening.FightState.PlayerWin
or FightHappening.FightState.EnemyWin)
if (to is FightHappening.FightState.PlayerWin )
_ = SwitchSceneAfterTime(2.0f);
if (to is FightHappening.FightState.EnemyWin)
{
_fightSceneSwitcher.ExitFight();
_fightSceneSwitcher.ExitFightWorld();
}
}
private async Task SwitchSceneAfterTime(float seconds)
@@ -0,0 +1,15 @@
using Babushka.scripts.CSharp.Common.Inventory;
using Godot;
namespace Babushka.scripts.CSharp.Common.Fight.UI;
public partial class HealButtonVisual : Button
{
[Export] private ItemResource _healItemBlueprint = null!;
public void UpdateText()
{
var healItemsLeft = InventoryManager.Instance.playerInventory!.TotalItemsOfBlueprint(_healItemBlueprint);
Text = $"x{healItemsLeft} - Heal";
}
}
@@ -0,0 +1 @@
uid://71mdwp2m4rta
@@ -0,0 +1,17 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class UsedItemIndicatorVisual : Node2D
{
[Export] private PackedScene _flyingIndicatorPrefab = null!;
[Export] private Texture2D _itemTexture = null!;
public void SpawnIndicator()
{
var flyingNumberInstance = _flyingIndicatorPrefab.Instantiate<FlyingIndicator>();
AddChild(flyingNumberInstance);
flyingNumberInstance.Initialize(icon: _itemTexture);
}
}
@@ -0,0 +1 @@
uid://6nniwfxye8ss
@@ -101,7 +101,8 @@ public partial class InventoryInstance : Node, ISaveable
return InventoryActionResult.DestinationFull;
}
var itemInstance = _slots[slotIndex].itemInstance ?? new ItemInstance { blueprint = newItem.blueprint, amount = 0 };
var itemInstance = _slots[slotIndex].itemInstance ??
new ItemInstance { blueprint = newItem.blueprint, amount = 0 };
var maxStack = itemInstance!.blueprint.maxStack;
var freeOnStack = maxStack - itemInstance.amount;
var moveAmount = Math.Min(freeOnStack, newItem.amount);
@@ -133,7 +134,7 @@ public partial class InventoryInstance : Node, ISaveable
itemInstance.amount -= 1;
if(itemInstance.amount == 0)
if (itemInstance.amount == 0)
_slots[inventorySlot].itemInstance = null;
EmitSignal(SignalName.InventoryContentsChanged);
@@ -145,6 +146,38 @@ public partial class InventoryInstance : Node, ISaveable
return RemoveItem(inventorySlot, out _);
}
public InventoryActionResult TryRemoveAllItems(ItemInstance items)
{
var hasItemsCount = TotalItemsOfBlueprint(items.blueprint);
if (hasItemsCount < items.amount)
return InventoryActionResult.SourceDoesNotExist;
var amountToRemove = items.amount;
foreach (var s in _slots)
{
if (s.IsEmpty() || s.itemInstance!.blueprint != items.blueprint)
continue;
var slotItem = s.itemInstance!;
if (slotItem.amount <= amountToRemove)
{
amountToRemove -= slotItem.amount;
s.itemInstance = null;
}
else
{
slotItem.amount -= amountToRemove;
amountToRemove = 0;
}
if (amountToRemove == 0)
break;
}
EmitSignal(SignalName.InventoryContentsChanged);
return InventoryActionResult.Success;
}
public InventoryActionResult AddItemToSlot(ItemInstance itemInstance, int destinationSlot)
{
if (destinationSlot < 0 || destinationSlot >= _slots.Count)
@@ -175,7 +208,7 @@ public partial class InventoryInstance : Node, ISaveable
return items.All(HasItems);
}
#region SAVE AND LOAD
#region SAVE AND LOAD
public void UpdateSaveData()
{
@@ -189,7 +222,7 @@ public partial class InventoryInstance : Node, ISaveable
string[] value = new string[2];
value[0] = _slots[i].itemInstance.blueprint.ResourcePath;
value[1] = _slots[i].itemInstance.amount.ToString();
payloadData.Add(key,value);
payloadData.Add(key, value);
}
}
@@ -210,7 +243,7 @@ public partial class InventoryInstance : Node, ISaveable
{
string[] savePayload = inventoryItemData.AsStringArray();
ItemResource resource = ResourceLoader.Load<ItemResource>(savePayload[0]);
int _amount = int.Parse(savePayload[1]);
int _amount = int.Parse(savePayload[1]);
ItemInstance instance = new ItemInstance { blueprint = resource, amount = _amount };
AddItem(instance);
@@ -230,5 +263,6 @@ public partial class InventoryInstance : Node, ISaveable
slot.itemInstance = null;
}
}
#endregion
}
@@ -1,12 +1,15 @@
using Babushka.scripts.CSharp.GameEntity.LoadSave;
using Godot;
using Newtonsoft.Json.Linq;
namespace Babushka.scripts.CSharp.Common.Inventory;
// Do not instantiate this resource
// But it has to be a resource because Godot
[GlobalClass]
public partial class ItemInstance: Resource
public partial class ItemInstance : Resource, IJsonSerializable
{
[Export] public ItemResource blueprint;
[Export] public required ItemResource blueprint;
[Export] public int amount = 1;
public ItemInstance Clone()
@@ -17,4 +20,18 @@ public partial class ItemInstance: Resource
amount = amount
};
}
public void LoadFromJson(JObject json)
{
var blueprintPath = json.GetStringValue("blueprint");
blueprint = GD.Load<ItemResource>(blueprintPath);
amount = json.GetIntValue("amount");
}
public JObject SaveToJson()
{
return new(
new JProperty("blueprint", blueprint.ResourcePath),
new JProperty("amount", amount));
}
}
@@ -1,4 +1,6 @@
using Godot;
using Babushka.scripts.CSharp.GameEntity.LoadSave;
using Godot;
using Newtonsoft.Json.Linq;
namespace Babushka.scripts.CSharp.Common.Inventory;
@@ -0,0 +1,27 @@
using System;
using Babushka.scripts.CSharp.GameEntity.LoadSave;
using Newtonsoft.Json.Linq;
namespace Babushka.scripts.CSharp.GameEntity.Entities;
public class Entity
{
public long id;
public virtual string EntityType => "";
public Entity()
{
id = new Random().NextInt64();
}
public virtual void SaveEntity(JObject json)
{
json["id"] = id;
json["type"] = EntityType;
}
public virtual void LoadEntity(JObject json)
{
id = json.GetLongValue("id");
}
}
@@ -0,0 +1 @@
uid://hnmpt23ovfgl
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Transactions;
using Newtonsoft.Json.Linq;
namespace Babushka.scripts.CSharp.GameEntity.Entities;
public class LoadedScenesEntity : Entity
{
private HashSet<string> _loadedScenes = new();
public override string EntityType => OWN_TYPE_NAME;
public const string OWN_TYPE_NAME = "LoadedScenesEntity";
public void AddScene(string sceneName) => _loadedScenes.Add(sceneName);
public bool WasSceneLoaded(string sceneName) => _loadedScenes.Contains(sceneName);
public override void SaveEntity(JObject json)
{
base.SaveEntity(json);
json["scenes"] = new JArray(_loadedScenes);
}
public override void LoadEntity(JObject json)
{
base.LoadEntity(json);
JArray array = (JArray?) json["scenes"] ?? throw new Exception("No scenes found in LoadedScenesEntity.");
_loadedScenes = array.ToObject<HashSet<string>>()!;
}
}
@@ -0,0 +1 @@
uid://rabb1y637cm5
@@ -0,0 +1,32 @@
using Babushka.scripts.CSharp.GameEntity.LoadSave;
using Godot;
using Newtonsoft.Json.Linq;
namespace Babushka.scripts.CSharp.GameEntity.Entities;
public abstract class PositionalEntity : Entity
{
public Vector2 position;
public string sceneName = "none";
public override void SaveEntity(JObject json)
{
base.SaveEntity(json);
json["posx"] = position.X;
json["posy"] = position.Y;
json["scene"] = sceneName;
}
public override void LoadEntity(JObject json)
{
base.LoadEntity(json);
position = new Vector2(
json.GetFloatValue("posx"),
json.GetFloatValue("posy"));
sceneName = json.GetStringValue("scene");
}
// Deals with Instantiation of the node
public abstract void InstantiateEntityNode(Node2D parent);
}
@@ -0,0 +1 @@
uid://bs38dulqv7sop
@@ -0,0 +1,23 @@
using Babushka.scripts.CSharp.GameEntity.Management;
using Godot;
namespace Babushka.scripts.CSharp.GameEntity.Entities;
public class TrashEntity : PositionalEntity
{
public override string EntityType => OWN_TYPE_NAME;
public const string OWN_TYPE_NAME = "TrashEntity";
private EntityNodeCreator _creator;
public TrashEntity()
{
}
public override void InstantiateEntityNode(Node2D parent)
{
if(_creator == null) _creator = EntityManager.Instance.NodeCreator;
var entityNode = _creator.InstantiateNode(EntityType);
parent.AddChild(entityNode);
entityNode.GlobalPosition = position;
}
}
@@ -0,0 +1 @@
uid://c31k34epunk5t
@@ -0,0 +1,16 @@
using Babushka.scripts.CSharp.GameEntity.Entities;
using Godot;
namespace Babushka.scripts.CSharp.GameEntity.EntityNodes;
public partial class TrashEntityNode : Node2D
{
private TrashEntity _trashEntity;
public void Initialize(TrashEntity trashEntity)
{
_trashEntity = trashEntity;
}
}
@@ -0,0 +1 @@
uid://d3n8kwva4pxx5
@@ -0,0 +1,26 @@
using Babushka.scripts.CSharp.GameEntity.Entities;
using Babushka.scripts.CSharp.GameEntity.Management;
using Godot;
namespace Babushka.scripts.CSharp.GameEntity.EntityPlacer;
public partial class TrashEntityPlacer : Node2D
{
private string _trashEntityType = TrashEntity.OWN_TYPE_NAME;
public override void _Ready()
{
string sceneName = EntityManager.Instance.CurrentEntitySceneContainer!.sceneName;
var loadedScenesEntity = EntityManager.Instance.GetUniqueEntity<LoadedScenesEntity>();
if (!loadedScenesEntity.WasSceneLoaded(sceneName))
{
TrashEntity entity = new TrashEntity();
entity.sceneName = sceneName;
entity.position = GlobalPosition;
EntityManager.Instance.AddEntity(entity);
}
QueueFree();
}
}
@@ -0,0 +1 @@
uid://bilg7e33usxuv
@@ -0,0 +1,44 @@
using Newtonsoft.Json.Linq;
namespace Babushka.scripts.CSharp.GameEntity.LoadSave;
public static class EntityLoadSaveUtil
{
private static void AssertTokenType(this JObject json, string key, JTokenType type)
{
var token = json[key];
if (token == null) throw new MalformedJsonException(json, key, "does not exist");
//if (!token.HasValues) throw new MalformedJsonException(json, key, "has no value");
if (token.Type != type) throw new MalformedJsonException(json, key, $"is not of type {type}");
}
public static long GetLongValue(this JObject json, string key)
{
AssertTokenType(json, key, JTokenType.Integer);
return json.Value<long>(key);
}
public static int GetIntValue(this JObject json, string key)
{
AssertTokenType(json, key, JTokenType.Integer);
return json.Value<int>(key);
}
public static float GetFloatValue(this JObject json, string key)
{
AssertTokenType(json, key, JTokenType.Float);
return json.Value<float>(key);
}
public static JObject GetObject(this JObject json, string key)
{
AssertTokenType(json, key, JTokenType.Object);
return json.Value<JObject>(key)!;
}
public static string GetStringValue(this JObject json, string key)
{
AssertTokenType(json, key, JTokenType.String);
return json.Value<string>(key)!;
}
}
@@ -0,0 +1 @@
uid://ccu6p418viliu
@@ -0,0 +1,9 @@
using Newtonsoft.Json.Linq;
namespace Babushka.scripts.CSharp.GameEntity.LoadSave;
public interface IJsonSerializable
{
public void LoadFromJson(JObject json);
public JObject SaveToJson();
}
@@ -0,0 +1 @@
uid://cuma3347l55mb

Some files were not shown because too many files have changed in this diff Show More