Compare commits

..

59 Commits

Author SHA1 Message Date
jlink 7696271727 fight log no longer visible and door interactable 2025-12-04 17:31:31 +01:00
kziolkowski f32033cb5f Merge pull request 'Made the fight world completable' (#33) from feature/night_to_day into develop
Reviewed-on: #33
2025-11-26 15:11:13 +01:00
kziolkowski 1ad463ccb0 🔥 removed unused code 2025-11-26 14:43:55 +01:00
kziolkowski 451ea82706 Merge pull request 'feature/save_and_loaaaaaad' (#32) from feature/save_and_loaaaaaad into develop
Reviewed-on: #32
2025-11-26 14:41:29 +01:00
jonathan 3f4dfccbc6 🐛Make the FightWorld reset when sleeping in the bed 2025-11-25 18:43:48 +01:00
jonathan 3c370e30a0 Added end of night scene 2025-11-25 18:07:21 +01:00
jonathan 073a74bb22 🚸Rebalanded fight to make it more likely to win 2025-11-25 17:32:27 +01:00
kziolkowski 75e4bdd7fd ♻️ removed Print statements 2025-11-25 17:20:58 +01:00
kziolkowski f37f7c7ceb added saving and loading support to collectable inventory items 2025-11-25 17:14:30 +01:00
kziolkowski 70383fc16e Implemented load check for unique inventory items 2025-11-25 17:00:50 +01:00
kziolkowski 88f3c90eec ♻️ inventory works 2025-11-25 16:13:17 +01:00
kziolkowski 9d818e5079 ♻️ refactored field code to work with the new id system 2025-11-25 15:29:36 +01:00
kziolkowski e9cd4ce276 ♻️ reworked and debugged the SaveSystem. Removed unnecessary scene reference. 2025-11-25 14:39:31 +01:00
kziolkowski 638ebaff46 📝 Added documentation 2025-11-25 13:46:46 +01:00
kziolkowski b4013b1ff2 :feature: made GetComponent nullable in NodeExtension 2025-11-25 13:34:22 +01:00
kziolkowski c695115a4a :feature: implemented saving and loading for ducks, 🔥 removed save implementation from interactionArea 2025-11-25 13:33:53 +01:00
kziolkowski c68727aebe 🚧 intermediate state with homework 2025-11-23 22:50:32 +01:00
kziolkowski bee6249c6f 🚧 implemented interaction area loading 2025-11-23 22:25:59 +01:00
kziolkowski fda2b95b38 Savesystem rework 2025-11-23 21:02:40 +01:00
kziolkowski 4bbaab1a2a Created ISaveable interface and made existing saveable classes inherit from it. 2025-11-23 20:10:42 +01:00
kziolkowski 4ed6f4e7d9 Reworked existing save system for user data: Made path steam-compatible, added Versioning and try/catch to save 2025-11-21 21:04:37 +01:00
kziolkowski ce29711614 ❇️ Added Settings classes to save and load local configurations 2025-11-21 20:33:52 +01:00
kziolkowski 2947011a1a working intermediate state of the save system 2025-11-21 17:27:46 +01:00
kziolkowski 2a4425b9db Added Save and load support to the inventory 2025-11-19 15:18:33 +01:00
kziolkowski 72079044bd 🚧 WIP implementing save and load for the inventory 2025-11-18 18:30:17 +01:00
Jonathan b205e45096 Merge pull request 'feature/farming_bugfixes_and_magic_word' (#30) from feature/farming_bugfixes_and_magic_word into develop
Reviewed-on: #30
2025-11-18 17:25:59 +01:00
kziolkowski d17e58bcd3 🐛 removed stub code and unused signal from FarmingControls2D 2025-11-18 17:17:42 +01:00
kziolkowski 02cbc761bc reverted changed start scene in project godot 2025-11-18 16:41:55 +01:00
Jonathan fb6a42a874 Merge pull request 'Added damage fly number' (#29) from feature/damage_feedback into develop
Reviewed-on: #29
2025-11-18 16:07:32 +01:00
kziolkowski c5f8b157ad 🐛 changed savegame location to user-space instead of project-space 2025-11-18 15:55:31 +01:00
kziolkowski 093546f3e4 Merge branch 'develop' into feature/farming_bugfixes_and_magic_word
# Conflicts:
#	scenes/Babushka_scene_farm_outside_2d.tscn
#	scenes/Babushka_scene_indoor_vesnas_room.tscn
#	scripts/CSharp/Common/CharacterControls/InteractionArea2D.cs
2025-11-18 15:24:45 +01:00
kziolkowski c9f97c2571 📝 added documentation comments 2025-11-15 22:27:26 +01:00
kziolkowski 6613e54658 Implemented Loading function on fields and plants 2025-11-15 22:15:10 +01:00
kziolkowski 3fcb34c04d 🚧 saving of field parameters as json implemented 2025-11-12 18:46:30 +01:00
kziolkowski 5cc65bc3f4 🔧 filled up main outdoor scene with fields 2025-11-12 15:20:21 +01:00
kziolkowski 443741f5f1 🐛 added preset fields to main outdoor scene and made them farmable 2025-11-12 15:14:10 +01:00
kziolkowski 554a319428 🚧 farming rework part 2: you can now kinda "create" fields 2025-11-11 16:39:47 +01:00
jonathan 3bb4fcd129 Added damage fly number 2025-11-11 15:55:41 +01:00
kziolkowski 4705d1ee2f 🐛 can no longer water fields when watering can is empty 2025-11-11 15:54:09 +01:00
kziolkowski b00b466045 🚧 watering fields kinda works now 2025-11-11 15:51:15 +01:00
kziolkowski d51cc461f7 🚧 made preplaced fields show plants 2025-11-11 14:27:56 +01:00
kziolkowski 55f0d2a77e 🚧 reworked farming system to work with indices instead of positions 2025-11-11 14:02:03 +01:00
kziolkowski 97dcadf07a Added sceneprovider reference to field scripts and made them register on ready. Also added VariableSetter. 2025-11-11 12:15:30 +01:00
kziolkowski fe1dd2bcc1 Added inventorylistener for watering can 2025-11-07 20:37:59 +01:00
kziolkowski 6e833a0735 added InventoryListener and made field interaction area activate only when the right item (seed) is in the inventory 2025-11-07 20:29:05 +01:00
kziolkowski c52bfc8017 🐛 fixed field outline 2025-11-07 19:47:23 +01:00
kziolkowski 58c2be1db8 plants no longer grow when just interacting with them 2025-11-07 18:27:21 +01:00
kziolkowski c7c6e184d6 🐛 adjusted field positions 2025-11-07 18:24:52 +01:00
kziolkowski 6a2355cf97 🐛 fixed never more than 10 fields bug 2025-11-07 18:18:05 +01:00
kziolkowski 1d7f656ec4 🚧 WIP trying to fix a bug that won't let me have more than 9 fields. Dont ask me why. 2025-11-05 19:25:46 +01:00
kziolkowski 1c5b585b3d 🔥 removed print statements used for debugging 2025-11-05 16:50:41 +01:00
kziolkowski f1b980cdb6 🐛 field creation at the same spot no longer possible, also watering works now. 2025-11-05 16:48:45 +01:00
kziolkowski 8b77ca9bc5 ♻️ migrated the InteractionAreas currently used to the new format and removed the old code 2025-11-04 17:20:15 +01:00
kziolkowski 8d616735f4 🚚 moved Animationfix script 2025-11-04 16:40:19 +01:00
kziolkowski 66848af8bf Merge branch 'develop' into feature/farming_bugfixes_and_magic_word 2025-11-04 11:24:51 +01:00
kziolkowski 6ba26c360d 🚧 reworking Fieldservice 2025-10-31 14:08:55 +01:00
kziolkowski 63fd81e54d 🔥 removed no longer needed scene call group 2025-10-31 12:38:48 +01:00
kziolkowski b54f784d51 🎨 Replaced pickup animation group call with event 2025-10-31 12:36:08 +01:00
kziolkowski 6194988bf0 🎨 removed plant growing call group and replaced it with an event call. Made FarmingAnimation play on event. 2025-10-31 12:07:05 +01:00
103 changed files with 2045 additions and 424 deletions
+9
View File
@@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="GdSdk" type="GdScript">
<CLASSES />
<JAVADOC />
<SOURCES>
<root url="file://$APPLICATION_PLUGINS_DIR$/GdScript/extracted/Master" />
</SOURCES>
</library>
</component>
-10
View File
@@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="GdSdk Master" type="GdScript">
<properties path="$USER_HOME$/.cache/JetBrains/Rider2025.1/projects/.idea.babushka.a4de4632/sdk/GdSdk Master" version="Master" date="2024-06-01T15:14:16.000+02:00" />
<CLASSES />
<JAVADOC />
<SOURCES>
<root url="file://$USER_HOME$/.cache/JetBrains/Rider2025.1/projects/.idea.babushka.a4de4632/sdk/GdSdk Master" />
</SOURCES>
</library>
</component>
+1
View File
@@ -17,6 +17,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACount_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Ffe5a7cee5a1771b89077bd73292de84439b4f816799e2ad6c2615c6ff5bd748e_003FCount_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003Fhome_003Fjonathan_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003Fd4_003Fbd338aeb_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExportToolButtonAttribute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003F31_003F3e05ef15_003FExportToolButtonAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGD_005Fconstants_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fdf61b6148ca71eef8cf4e56545a9319fd2647f05d2f959dad42d9fcbe95192_003FGD_005Fconstants_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMustBeVariantAttribute_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe37dc1faf08a4d5ea030ad59bdf77522523400_003Fda_003Fbb06d681_003FMustBeVariantAttribute_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AGD_005Fconstants_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F4ef0bac6437b6a9567d44f62ae567d854fa7b8513ef7139ef349b49768bc9df_003FGD_005Fconstants_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANode_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Ff1d69ec2da76ccf9bc8a75c8e0fdca9a7ba1adf8c8c9d5047e2fa5991c02eca_003FNode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bovypw2hsn2nq"
path="res://.godot/imported/field_outline_1_outline.png-45f43538274c8b9489711c885b999170.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/masks/field_outline_1_outline.png"
dest_files=["res://.godot/imported/field_outline_1_outline.png-45f43538274c8b9489711c885b999170.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: 6.7 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://50qn027e5lvh"
path="res://.godot/imported/field_outline_2_outline.png-866d5c097a49b7c63eee72f4455558ee.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/masks/field_outline_2_outline.png"
dest_files=["res://.godot/imported/field_outline_2_outline.png-866d5c097a49b7c63eee72f4455558ee.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: 7.6 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://wjtvno2jj4nl"
path="res://.godot/imported/field_outline_3_outline.png-00e4af97c20bd898c6461491100baa4e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://art/masks/field_outline_3_outline.png"
dest_files=["res://.godot/imported/field_outline_3_outline.png-00e4af97c20bd898c6461491100baa4e.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
@@ -10,9 +10,8 @@ script = ExtResource("1_cu47d")
_interactionArea = NodePath("InteractionArea")
_itemsToReactTo = Array[Object]([ExtResource("2_s5peo")])
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("3_wsetd")]
_active = false
_spriteToOutline = NodePath("../Sprite2D")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("3_wsetd")]
_spritesToOutline = [NodePath("../Sprite2D")]
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.5, 0.5)
+10 -6
View File
@@ -1,8 +1,7 @@
[gd_scene load_steps=16 format=3 uid="uid://sbf12hin4kes"]
[gd_scene load_steps=17 format=3 uid="uid://sbf12hin4kes"]
[ext_resource type="Texture2D" uid="uid://bylgmr0skwtrs" path="res://art/farm/farming/farmobjekte/broken tools atlas.png" id="1_k4ca3"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="2_gcgfd"]
[ext_resource type="Script" uid="uid://dkk1vjijvgrd7" path="res://scripts/CSharp/Common/Items/NonInventoryPickup.cs" id="2_ic616"]
[ext_resource type="AudioStream" uid="uid://be6g8b3v3u1ai" path="res://audio/sfx/Kitchen/SFX_Cooking_Knife_PickUp_01.wav" id="3_ktmp7"]
[ext_resource type="AudioStream" uid="uid://cgjsajsdrrn0j" path="res://audio/sfx/Kitchen/SFX_Cooking_Knife_PutDown_01.wav" id="4_ic616"]
[ext_resource type="AudioStream" uid="uid://br4drgupled6c" path="res://audio/sfx/Kitchen/SFX_Cooking_Pot_01.wav" id="5_dx175"]
@@ -14,6 +13,8 @@
[ext_resource type="AudioStream" uid="uid://bc216pfieuc8h" path="res://audio/sfx/Kitchen/SFX_Cutlery_04.wav" id="11_kb03l"]
[ext_resource type="AudioStream" uid="uid://dp6qen84ptlvx" path="res://audio/sfx/Kitchen/SFX_Cutlery_05.wav" id="12_kka6u"]
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer2D.cs" id="13_wswkg"]
[ext_resource type="Script" uid="uid://b5dotkx17gvxg" path="res://scripts/CSharp/Low Code/Events/EventRaiser.cs" id="14_dx175"]
[ext_resource type="Resource" uid="uid://78t0o27g6aq6" path="res://resources/low code/interactables/event_PickedUpInteractable.tres" id="15_u7jgg"]
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_dich4"]
streams_count = 10
@@ -35,11 +36,10 @@ texture = ExtResource("1_k4ca3")
offset = Vector2(1, -215)
region_enabled = true
region_rect = Rect2(44, 479, 356, 503)
script = ExtResource("2_ic616")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("2_gcgfd")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("2_gcgfd")]
position = Vector2(0, -172)
_spriteToOutline = NodePath("..")
_spritesToOutline = [NodePath("..")]
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = SubResource("AudioStreamRandomizer_dich4")
@@ -47,6 +47,10 @@ bus = &"SFX"
playback_type = 2
script = ExtResource("13_wswkg")
[node name="PickupAnimationEventRaiser" type="Node" parent="."]
script = ExtResource("14_dx175")
_eventResources = Array[Object]([ExtResource("15_u7jgg")])
[connection signal="Interacted" from="InteractionArea" to="." method="queue_free"]
[connection signal="Interacted" from="InteractionArea" to="." method="PlayPickupAnimation"]
[connection signal="Interacted" from="InteractionArea" to="AudioStreamPlayer2D" method="PlayOneShot"]
[connection signal="Interacted" from="InteractionArea" to="PickupAnimationEventRaiser" method="RaiseEvents"]
+3 -5
View File
@@ -1,9 +1,8 @@
[gd_scene load_steps=9 format=3 uid="uid://ddpl8cbck7e6s"]
[gd_scene load_steps=8 format=3 uid="uid://ddpl8cbck7e6s"]
[ext_resource type="Script" uid="uid://d0kgxh4ykuv23" path="res://scripts/CSharp/Common/NPC/TalkingCharacter.cs" id="1_xix7p"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="2_udjjv"]
[ext_resource type="Texture2D" uid="uid://bgba1uv0muxat" path="res://art/characters/chugeist_tmp.png" id="3_42og6"]
[ext_resource type="Material" uid="uid://blch5kdhkbj75" path="res://art/materials/simple_interactable_outline.tres" id="3_kd44q"]
[ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="43_xooq4"]
[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="44_v6w16"]
@@ -21,11 +20,10 @@ z_index = 1
y_sort_enabled = true
script = ExtResource("1_xix7p")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("2_udjjv")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("2_udjjv")]
position = Vector2(0, -450)
scale = Vector2(2.805, 2.805)
_outlineMaterial = ExtResource("3_kd44q")
_spriteToOutline = NodePath("../TalkingControl/Visual")
_spritesToOutline = [NodePath("../TalkingControl/Visual")]
[node name="CollisionShape3D" parent="InteractionArea/Area2D" index="0"]
position = Vector2(-4.99109, 63.4581)
+26 -35
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=482 format=3 uid="uid://c25udixd5m6l0"]
[gd_scene load_steps=485 format=3 uid="uid://c25udixd5m6l0"]
[ext_resource type="Script" uid="uid://b05uyj001ehwi" path="res://scripts/CSharp/Common/Farming/VesnaBehaviour2D.cs" id="1_yd5ep"]
[ext_resource type="Script" uid="uid://cjbclkxesh3hc" path="res://scripts/CSharp/Common/CharacterControls/PlayerMovement.cs" id="2_1vqmv"]
@@ -272,16 +272,19 @@
[ext_resource type="Texture2D" uid="uid://vahac0df0dhj" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0008.png" id="464_pbc3r"]
[ext_resource type="PackedScene" uid="uid://pflu0uaig7vv" path="res://prefabs/interactions/detection_cross.tscn" id="466_e04c3"]
[ext_resource type="Texture2D" uid="uid://b37lpqrsjjuc0" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0010.png" id="466_pw1ip"]
[ext_resource type="Script" uid="uid://bc6uaaxsx5k5p" path="res://scripts/CSharp/Low Code/Events/EventListener.cs" id="467_8hbu5"]
[ext_resource type="Script" uid="uid://er03dkj8axlr" path="res://scripts/CSharp/Common/UI/WateringCanUi.cs" id="467_j4m0f"]
[ext_resource type="Texture2D" uid="uid://oi11ax6tml6j" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0012.png" id="468_08021"]
[ext_resource type="Resource" uid="uid://b4hawvsc7cmkn" path="res://resources/low code/farming/event_newPlantCreated.tres" id="468_t1d6r"]
[ext_resource type="Resource" uid="uid://78t0o27g6aq6" path="res://resources/low code/interactables/event_PickedUpInteractable.tres" id="469_t1d6r"]
[ext_resource type="Texture2D" uid="uid://dsjj23763pej5" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0014.png" id="470_bmmei"]
[ext_resource type="AudioStream" uid="uid://ce5mxs2yrwgrh" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_01_R.wav" id="470_dnm27"]
[ext_resource type="Script" uid="uid://dx25g14a7xi4w" path="res://scripts/CSharp/Common/Audio/AudioPlayer.cs" id="471_2f15g"]
[ext_resource type="Resource" uid="uid://tt3d166mntmi" path="res://resources/low code/farming/var_sceneNameProvider.tres" id="471_83c4i"]
[ext_resource type="AudioStream" uid="uid://fihv17va3r58" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_02_R.wav" id="471_e04c3"]
[ext_resource type="AudioStream" uid="uid://cvvjd2i6x047n" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_03_R.wav" id="472_g32y8"]
[ext_resource type="Texture2D" uid="uid://blh0t2ofqj2uq" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0016.png" id="472_wdxsr"]
[ext_resource type="AudioStream" uid="uid://dymoalptxmge" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_04_R.wav" id="473_8hbu5"]
[ext_resource type="Texture2D" uid="uid://l5ym7gi82l1b" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-6.png" id="473_g32y8"]
[ext_resource type="AudioStream" uid="uid://4555a4w30tda" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_05_R.wav" id="474_t1d6r"]
[ext_resource type="Texture2D" uid="uid://3t1m2xi4ks75" path="res://art/animation/Vesna2D/Vesna Anims Tools/F01-Idle-Gießkanne/0018.png" id="474_tu801"]
[ext_resource type="AudioStream" uid="uid://dpqvnogggvgea" path="res://audio/sfx/Footsteps/Single/Gravel/Reverb/SFX_Footstep_Gravel_06_R.wav" id="475_83c4i"]
@@ -290,6 +293,7 @@
[ext_resource type="Texture2D" uid="uid://d3rdsclnqbx7" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0001.png" id="477_qko58"]
[ext_resource type="Texture2D" uid="uid://dqubvx1a08kn4" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0002.png" id="478_5myrm"]
[ext_resource type="Texture2D" uid="uid://dystt4hyqad74" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0004.png" id="480_wnay3"]
[ext_resource type="Resource" uid="uid://cmqapbvv0hev2" path="res://resources/low code/farming/event_watering.tres" id="481_t1d6r"]
[ext_resource type="Texture2D" uid="uid://bopxv06co1osl" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0006.png" id="482_wfdif"]
[ext_resource type="Texture2D" uid="uid://coyggdfwgkeru" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0008.png" id="484_32thn"]
[ext_resource type="Texture2D" uid="uid://du6x1h42smp6m" path="res://art/animation/Vesna2D/Vesna Anims Sequences/F02-Walk/0010.png" id="486_kobao"]
@@ -476,7 +480,6 @@
[ext_resource type="Texture2D" uid="uid://b0v61all3tsny" path="res://art/animation/Vesna2D/Vesna Anims Tools/S02-Walk-Gießkanne/0018.png" id="812_sf8kv"]
[ext_resource type="Texture2D" uid="uid://cao7vqax8cblo" path="res://art/animation/Vesna2D/Vesna Anims Tools/S02-Walk-Gießkanne/0020.png" id="814_3uq4g"]
[ext_resource type="Script" uid="uid://bcskt5ckh3rqa" path="res://scripts/CSharp/Common/Farming/FarmingControls2D.cs" id="817_6nrw3"]
[ext_resource type="PackedScene" uid="uid://b1d2e7ely6hyw" path="res://prefabs/farm/base_field.tscn" id="818_16w6h"]
[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="819_4na52"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ssqtd"]
@@ -2103,11 +2106,10 @@ position = Vector2(-24, -13)
shape = SubResource("CircleShape2D_ssqtd")
debug_color = Color(0.923708, 0.202722, 0.475262, 0.42)
[node name="visuals" type="Node2D" parent="CharacterBody2D" node_paths=PackedStringArray("_sprite", "_wateringParticles") groups=["Pickup", "PlantGrowing"]]
[node name="visuals" type="Node2D" parent="CharacterBody2D" node_paths=PackedStringArray("_sprite")]
position = Vector2(0, -374)
script = ExtResource("3_f6xmn")
_sprite = NodePath("Animated Sprites")
_wateringParticles = NodePath("../../pouring water vfx")
[node name="Animated Sprites" type="AnimatedSprite2D" parent="CharacterBody2D/visuals"]
position = Vector2(0, 450)
@@ -2142,35 +2144,20 @@ scrollable = false
[node name="DetectionCross" parent="CharacterBody2D" instance=ExtResource("466_e04c3")]
position = Vector2(0, -200)
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_movingPlayer", "_wateringParticles")]
[node name="PlantCreatedEventListener" type="Node" parent="CharacterBody2D"]
script = ExtResource("467_8hbu5")
_eventResources = Array[Object]([ExtResource("468_t1d6r")])
[node name="PickedUpInteractableListener" type="Node" parent="CharacterBody2D"]
script = ExtResource("467_8hbu5")
_eventResources = Array[Object]([ExtResource("469_t1d6r")])
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_movingPlayer")]
script = ExtResource("817_6nrw3")
_fieldPrefab = ExtResource("818_16w6h")
_sceneKeyProvider = ExtResource("471_83c4i")
_movingPlayer = NodePath("../CharacterBody2D")
_wateringParticles = NodePath("../pouring water vfx")
_wateringCanParticlesVerticalOffset = -100.0
[node name="dialogic toggle" type="Node2D" parent="."]
position = Vector2(0, 374)
script = ExtResource("819_4na52")
[node name="pouring water vfx" type="CPUParticles2D" parent="."]
position = Vector2(-652, -599)
rotation = -0.333807
emitting = false
amount = 20
texture = ExtResource("473_g32y8")
lifetime = 0.5
randomness = 1.0
local_coords = true
draw_order = 1
emission_shape = 2
emission_sphere_radius = 128.0
linear_accel_min = 44.07
linear_accel_max = 78.81
scale_amount_min = 0.4
scale_amount_max = 0.8
color = Color(0.400601, 0.62444, 0.791217, 1)
hue_variation_max = 0.4
_fieldOffsetVector = Vector2i(735, 600)
[node name="DialogicToggle" type="Node2D" parent="." node_paths=PackedStringArray("itemToToggle")]
scale = Vector2(0.7, 0.7)
@@ -2187,14 +2174,18 @@ script = ExtResource("471_2f15g")
[node name="Timer" type="Timer" parent="SFX/FootstepsAudio"]
wait_time = 0.5
[node name="WateringEventListener" type="Node" parent="."]
script = ExtResource("467_8hbu5")
_eventResources = Array[Object]([ExtResource("481_t1d6r")])
[connection signal="FilledWateringCan" from="." to="CharacterBody2D/WateringCanUI" method="Refill"]
[connection signal="InventorySelectionChanged" from="." to="CharacterBody2D/WateringCanUI" method="IsWateringCanActive"]
[connection signal="PickedUpTool" from="." to="CharacterBody2D/visuals" method="ActivateTool"]
[connection signal="PickedUpTool" from="." to="CharacterBody2D/WateringCanUI" method="IsWateringCanActive"]
[connection signal="LookDirection" from="CharacterBody2D/visuals" to="CharacterBody2D/DetectionCross" method="SetDirection"]
[connection signal="WateringField" from="FarmingControls" to="CharacterBody2D/visuals" method="PlayWateringAnimation"]
[connection signal="WateringField" from="FarmingControls" to="CharacterBody2D/WateringCanUI" method="Water"]
[connection signal="timelineEnded" from="dialogic toggle" to="." method="EnableMovement"]
[connection signal="timelineStarted" from="dialogic toggle" to="." method="DisableMovement"]
[connection signal="EventRaised" from="CharacterBody2D/PlantCreatedEventListener" to="CharacterBody2D/visuals" method="PlayFarmingAnimation"]
[connection signal="EventRaised" from="CharacterBody2D/PickedUpInteractableListener" to="CharacterBody2D/visuals" method="PlayPickUpAnimation"]
[connection signal="timelineStarted" from="DialogicToggle" to="SFX/FootstepsAudio/Timer" method="stop"]
[connection signal="timeout" from="SFX/FootstepsAudio/Timer" to="SFX/FootstepsAudio" method="PlayOneShot"]
[connection signal="EventRaised" from="WateringEventListener" to="CharacterBody2D/visuals" method="PlayWateringAnimation"]
[connection signal="EventRaised" from="WateringEventListener" to="CharacterBody2D/WateringCanUI" method="Water"]
+2 -2
View File
@@ -206,9 +206,9 @@ y_sort_enabled = true
script = ExtResource("1_hn8at")
_sprite = NodePath("TalkingControl/AnimatedSprite")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("42_ahrat")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("42_ahrat")]
position = Vector2(0, -450)
_spriteToOutline = NodePath("../TalkingControl/AnimatedSprite")
_spritesToOutline = [NodePath("../TalkingControl/AnimatedSprite")]
[node name="CollisionShape3D" parent="InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_at1n1")
+10 -8
View File
@@ -1,7 +1,8 @@
[gd_scene load_steps=24 format=3 uid="uid://muuxxgvx33fp"]
[gd_scene load_steps=25 format=3 uid="uid://muuxxgvx33fp"]
[ext_resource type="Script" uid="uid://7m1rt7agb6rm" path="res://scripts/CSharp/Common/Temp/MVPDuck.cs" id="1_54k4r"]
[ext_resource type="Texture2D" uid="uid://hvchk6t0xe7j" path="res://art/animals/Ente.png" id="1_cgxhx"]
[ext_resource type="Resource" uid="uid://tt3d166mntmi" path="res://resources/low code/farming/var_sceneNameProvider.tres" id="2_fdf3t"]
[ext_resource type="AudioStream" uid="uid://qv0aubjeyi0u" path="res://audio/sfx/Animals/SFX_Duck_Quack_01.wav" id="3_kjie1"]
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer2D.cs" id="3_rdn2q"]
[ext_resource type="AudioStream" uid="uid://da84l8e44scwh" path="res://audio/sfx/Animals/SFX_Duck_Quack_02.wav" id="4_54k4r"]
@@ -138,10 +139,11 @@ radius = 200.0
[sub_resource type="ViewportTexture" id="ViewportTexture_4830j"]
viewport_path = NodePath("SubViewport")
[node name="Duck" type="Node2D" node_paths=PackedStringArray("_animationPlayer")]
[node name="Duck" type="Node2D" node_paths=PackedStringArray("_animationPlayer") groups=["Saveable"]]
z_index = 1
y_sort_enabled = true
script = ExtResource("1_54k4r")
_sceneKeyProvider = ExtResource("2_fdf3t")
_transferDelayMs = 1000
_animationPlayer = NodePath("AnimationPlayer")
@@ -160,11 +162,11 @@ libraries = {
&"": SubResource("AnimationLibrary_54k4r")
}
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("15_uo3dh")]
[node name="duck interaction" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("15_uo3dh")]
position = Vector2(18, -250)
_spriteToOutline = NodePath("../Duck rendered")
_spritesToOutline = [NodePath("../Duck rendered")]
[node name="CollisionShape3D" parent="InteractionArea/Area2D" index="0"]
[node name="CollisionShape3D" parent="duck interaction/Area2D" index="0"]
shape = SubResource("CircleShape2D_uo3dh")
[node name="Duck rendered" type="Sprite2D" parent="."]
@@ -321,7 +323,7 @@ offset = Vector2(40, 40)
region_enabled = true
region_rect = Rect2(246, 393, 111, 111)
[connection signal="Interacted" from="InteractionArea" to="." method="TransferToTargetAfterDelay"]
[connection signal="Interacted" from="InteractionArea" to="Audio/NakNak" method="PlayOneShot"]
[connection signal="Interacted" from="duck interaction" to="." method="TransferToTargetAfterDelay"]
[connection signal="Interacted" from="duck interaction" to="Audio/NakNak" method="PlayOneShot"]
[editable path="InteractionArea"]
[editable path="duck interaction"]
+104 -8
View File
@@ -1,28 +1,65 @@
[gd_scene load_steps=9 format=3 uid="uid://b1d2e7ely6hyw"]
[gd_scene load_steps=25 format=3 uid="uid://b1d2e7ely6hyw"]
[ext_resource type="Script" uid="uid://j2mhvb45egej" path="res://scripts/CSharp/Low Code/Variables/VariableNode.cs" id="1_4mg73"]
[ext_resource type="Script" uid="uid://bdffon388rkty" path="res://scripts/CSharp/Common/Farming/FieldBehaviour2D.cs" id="1_qa01x"]
[ext_resource type="Texture2D" uid="uid://cgmu3qlovdr22" path="res://art/masks/field_outline_1.png" id="2_w8caw"]
[ext_resource type="Texture2D" uid="uid://50qn027e5lvh" path="res://art/masks/field_outline_2_outline.png" id="3_2eegd"]
[ext_resource type="Texture2D" uid="uid://eg5ej0mtuac" path="res://art/masks/field_outline_2.png" id="3_c014y"]
[ext_resource type="Texture2D" uid="uid://wjtvno2jj4nl" path="res://art/masks/field_outline_3_outline.png" id="4_svbd7"]
[ext_resource type="Texture2D" uid="uid://djpigvoyadvjs" path="res://art/masks/field_outline_3.png" id="4_teirr"]
[ext_resource type="Texture2D" uid="uid://c2pirgay3jfnn" path="res://art/farm/tilable grounds/böden/trockene farming erde.png" id="5_wx561"]
[ext_resource type="Texture2D" uid="uid://ctvdxwgmfaj5c" path="res://art/farm/tilable grounds/böden/nasse farming erde.png" id="6_7m4xq"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="7_2eegd"]
[ext_resource type="Resource" uid="uid://d284vxftxhym0" path="res://resources/itemRepository.tres" id="7_w8caw"]
[ext_resource type="Script" uid="uid://b5dotkx17gvxg" path="res://scripts/CSharp/Low Code/Events/EventRaiser.cs" id="9_teirr"]
[ext_resource type="Texture2D" uid="uid://bovypw2hsn2nq" path="res://art/masks/field_outline_1_outline.png" id="9_wx561"]
[ext_resource type="Resource" uid="uid://b4hawvsc7cmkn" path="res://resources/low code/farming/event_newPlantCreated.tres" id="10_wx561"]
[ext_resource type="Resource" uid="uid://tt3d166mntmi" path="res://resources/low code/farming/var_sceneNameProvider.tres" id="11_cjahb"]
[ext_resource type="Resource" uid="uid://cmqapbvv0hev2" path="res://resources/low code/farming/event_watering.tres" id="14_57jmp"]
[ext_resource type="Script" uid="uid://3t0af586fimq" path="res://scripts/CSharp/Common/Inventory/InventoryListener.cs" id="14_w08sx"]
[ext_resource type="Resource" uid="uid://d1uuxp1lp4aro" path="res://resources/items/tomato_seed.tres" id="15_i4qwg"]
[ext_resource type="Resource" uid="uid://duq7tshxv6uhp" path="res://resources/items/beet_seed.tres" id="16_i4qwg"]
[ext_resource type="Resource" uid="uid://cndd64batns31" path="res://resources/items/wateringcan.tres" id="17_1mi0u"]
[ext_resource type="Texture2D" uid="uid://l5ym7gi82l1b" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-6.png" id="21_4mg73"]
[ext_resource type="Resource" uid="uid://dlcmqfjvgphqu" path="res://resources/items/rake.tres" id="21_68xcd"]
[ext_resource type="Script" uid="uid://dlbjjgbs0n4b0" path="res://scripts/CSharp/Common/Farming/FieldActivator.cs" id="22_57jmp"]
[node name="BaseField" type="Node2D"]
[sub_resource type="CircleShape2D" id="CircleShape2D_57jmp"]
resource_local_to_scene = true
radius = 325.2599
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "PlantingInteraction", "PlantingPlaceholder")]
[node name="BaseField" type="Node2D" groups=["Saveable"]]
script = ExtResource("1_4mg73")
Payload = 0
[node name="OutlineSprite" type="Sprite2D" parent="."]
self_modulate = Color(1, 1, 1, 0)
z_index = 1
scale = Vector2(1.3499999, 1.5)
texture = ExtResource("9_wx561")
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldIndex", "_saveIdHolder", "_fieldSprite", "_maskSprite", "_outlineSprite", "PlantingInteraction", "FieldInteractionArea", "PlantingPlaceholder", "_wateringParticles")]
visible = false
z_index = -1
scale = Vector2(0.9, 1)
script = ExtResource("1_qa01x")
_fieldIndex = NodePath("..")
_saveIdHolder = NodePath("..")
_sceneKeyProvider = ExtResource("11_cjahb")
FieldState = 0
_fieldSprite = NodePath("MaskedField/FieldTexture")
_maskSprite = NodePath("MaskedField")
_outlineSprite = NodePath("../OutlineSprite")
_maskOutlineTextures = Array[Texture2D]([ExtResource("9_wx561"), ExtResource("3_2eegd"), ExtResource("4_svbd7")])
_maskTexture = Array[Texture2D]([ExtResource("2_w8caw"), ExtResource("3_c014y"), ExtResource("4_teirr")])
Tilled = ExtResource("5_wx561")
Watered = ExtResource("6_7m4xq")
PlantingInteraction = NodePath("../InteractionArea")
PlantingInteraction = NodePath("InteractionArea")
FieldInteractionArea = NodePath("InteractionArea")
PlantingPlaceholder = NodePath("PlantPlaceholder")
ItemRepository = ExtResource("7_w8caw")
_wateringParticles = NodePath("../pouring water vfx")
_wateringEvent = ExtResource("14_57jmp")
[node name="MaskedField" type="Sprite2D" parent="FieldBehaviour"]
clip_children = 1
@@ -34,9 +71,68 @@ texture = ExtResource("5_wx561")
[node name="PlantPlaceholder" type="Node2D" parent="FieldBehaviour"]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("7_2eegd")]
position = Vector2(-16, -54)
[node name="InteractionArea" parent="FieldBehaviour" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("7_2eegd")]
position = Vector2(-28.88889, -57)
scale = Vector2(1.1111112, 1)
_active = false
_spriteToOutline = NodePath("../FieldBehaviour/MaskedField/FieldTexture")
_spritesToOutline = [NodePath("../../OutlineSprite")]
_showLabel = false
[connection signal="Interacted" from="InteractionArea" to="FieldBehaviour" method="Farm"]
[node name="PlantCreationEventRaiser" type="Node" parent="."]
script = ExtResource("9_teirr")
_eventResources = Array[Object]([ExtResource("10_wx561")])
[node name="InventoryListener Seeds" type="Node" parent="."]
script = ExtResource("14_w08sx")
_itemResourcesToListenFor = Array[Object]([ExtResource("15_i4qwg"), ExtResource("16_i4qwg")])
[node name="InventoryListener watering can" type="Node" parent="."]
script = ExtResource("14_w08sx")
_itemResourcesToListenFor = Array[Object]([ExtResource("17_1mi0u")])
[node name="InventoryListener rake" type="Node" parent="."]
script = ExtResource("14_w08sx")
_itemResourcesToListenFor = Array[Object]([ExtResource("21_68xcd")])
[node name="pouring water vfx" type="CPUParticles2D" parent="."]
position = Vector2(0, -300)
emitting = false
amount = 25
texture = ExtResource("21_4mg73")
one_shot = true
randomness = 1.0
local_coords = true
draw_order = 1
emission_shape = 2
emission_sphere_radius = 128.0
gravity = Vector2(0, 500)
linear_accel_min = 44.07
linear_accel_max = 78.81
scale_amount_min = 0.4
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")]
script = ExtResource("22_57jmp")
_field = NodePath("../FieldBehaviour")
_activatorArea = NodePath("InteractionArea")
[node name="InteractionArea" parent="FieldActivator" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("7_2eegd")]
_spritesToOutline = [NodePath("../../OutlineSprite")]
[node name="CollisionShape3D" parent="FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_57jmp")
[node name="Marker2D" type="Marker2D" parent="."]
gizmo_extents = 157.0
[connection signal="Planted" from="FieldBehaviour" to="PlantCreationEventRaiser" method="RaiseEvents"]
[connection signal="Interacted" from="FieldBehaviour/InteractionArea" to="FieldBehaviour" method="Farm"]
[connection signal="ItemInstanceActivated" from="InventoryListener Seeds" to="FieldBehaviour" method="ActivatedSeedInInventory"]
[connection signal="ItemInstanceActivated" from="InventoryListener watering can" to="FieldBehaviour" method="ActivateWateringCanInInventory"]
[connection signal="ItemInstanceActivated" from="InventoryListener rake" to="FieldActivator" method="RakeActivated"]
[connection signal="Interacted" from="FieldActivator/InteractionArea" to="FieldActivator" method="ActivateField"]
[connection signal="Interacted" from="FieldActivator/InteractionArea" to="FieldActivator/InteractionArea" method="ToggleActive"]
[editable path="FieldActivator/InteractionArea"]
-2
View File
@@ -38,7 +38,6 @@ _bigPlants = [NodePath("BigPlant/01"), NodePath("BigPlant/02"), NodePath("BigPla
_readyPlants = [NodePath("ReadyPlantInventoryItem/ReadyPlant/01"), NodePath("ReadyPlantInventoryItem/ReadyPlant/02"), NodePath("ReadyPlantInventoryItem/ReadyPlant/03")]
_harvestablePlant = NodePath("ReadyPlantInventoryItem")
_magicEffect = NodePath("magic vfx")
_magicWordNeeded = false
[node name="Seeds" type="Node2D" parent="."]
position = Vector2(0, 0.5)
@@ -130,7 +129,6 @@ region_rect = Rect2(5416, 136, 647, 895)
[node name="GrowingInteractionArea" parent="." instance=ExtResource("5_3j24b")]
position = Vector2(0, 2.3)
_useOutline = false
_useSprite = false
[node name="CollisionShape3D" parent="GrowingInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_vjw4j")
+5 -1
View File
@@ -12,7 +12,8 @@ radius = 300.0
resource_local_to_scene = true
radius = 300.0
[node name="Beet2" instance=ExtResource("1_2u3jr")]
[node name="Beet" instance=ExtResource("1_2u3jr")]
_prefabPath = "res://prefabs/farm/plants/beet_plant.tscn"
[node name="Seed1" parent="Seeds" index="0"]
texture = ExtResource("2_agmuy")
@@ -47,6 +48,9 @@ shape = SubResource("CircleShape2D_hiixr")
[node name="SpawnWithItem" parent="ReadyPlantInventoryItem" index="0"]
_blueprint = ExtResource("3_agmuy")
[node name="PickupInteractionArea" parent="ReadyPlantInventoryItem" index="3"]
_active = false
[node name="CollisionShape3D" parent="ReadyPlantInventoryItem/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_ae08q")
+1
View File
@@ -12,6 +12,7 @@ resource_local_to_scene = true
radius = 300.0
[node name="TomatoPlant" instance=ExtResource("1_ooshk")]
_prefabPath = "res://prefabs/farm/plants/tomato_plant.tscn"
[node name="Seed1" parent="Seeds" index="0"]
texture = ExtResource("2_gdicx")
+18
View File
@@ -0,0 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://l1hdihubffeg"]
[ext_resource type="Script" uid="uid://b5i41b6502xam" path="res://scripts/CSharp/Common/Fight/FighterDamageIndicatorFlyingNumber.cs" id="1_m0ub6"]
[node name="DamageFlyingNuber" type="Node2D" node_paths=PackedStringArray("_label")]
script = ExtResource("1_m0ub6")
_label = NodePath("Label")
[node name="Label" type="Label" parent="."]
custom_minimum_size = Vector2(200, 100)
offset_left = -100.0
offset_top = -50.0
offset_right = 100.0
offset_bottom = 50.0
theme_override_font_sizes/font_size = 56
text = "888"
horizontal_alignment = 1
vertical_alignment = 1
+1
View File
@@ -6,3 +6,4 @@
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"
@@ -9,7 +9,7 @@ region = Rect2(1133.19, 93.65, 460.526, 347.391)
[node name="BlobFighterVisual" instance=ExtResource("1_80xdf")]
[node name="Sprite2D" parent="Visuals" index="0"]
[node name="Sprite2D" parent="SquashParent/Visuals" index="0"]
position = Vector2(23, -96)
scale = Vector2(0.547474, 0.547474)
texture = SubResource("AtlasTexture_ane0o")
@@ -1,10 +1,12 @@
[gd_scene load_steps=9 format=3 uid="uid://7jsxokx67gpq"]
[gd_scene load_steps=11 format=3 uid="uid://7jsxokx67gpq"]
[ext_resource type="Script" uid="uid://by88f32fou7lh" path="res://scripts/CSharp/Common/Fight/FighterVisual.cs" id="1_hai27"]
[ext_resource type="Texture2D" uid="uid://f7htcxiwvuup" path="res://art/animation/vesna/Side/S01-Idle/0001.png" id="2_6l7g5"]
[ext_resource type="Script" uid="uid://boprnfciqgixf" path="res://scripts/CSharp/Common/Fight/UI/TargetSelectionClick.cs" id="3_wil2y"]
[ext_resource type="Texture2D" uid="uid://qlfwuakhe57t" path="res://art/ui/UI/attack_select_wheel.png" id="4_8ldlc"]
[ext_resource type="Script" uid="uid://b2dx06p6i7pu0" path="res://scripts/CSharp/Common/Fight/UI/FighterHealthBarVisual.cs" id="5_xv37w"]
[ext_resource type="Script" uid="uid://c250yp2mdq83e" path="res://scripts/CSharp/Common/Fight/FighterDamageIndicatorVisual.cs" id="6_0qs42"]
[ext_resource type="PackedScene" uid="uid://l1hdihubffeg" path="res://prefabs/fight/damage_flying_nuber.tscn" id="7_y6dyb"]
[sub_resource type="AtlasTexture" id="AtlasTexture_wil2y"]
atlas = ExtResource("2_6l7g5")
@@ -17,25 +19,41 @@ size = Vector2(250, 401)
radius = 173.0
height = 588.0
[node name="VesnaFighterVisual" type="Node2D" node_paths=PackedStringArray("_visualParent", "_targetSelectionParent", "healthBarVisual")]
[node name="VesnaFighterVisual" type="Node2D" node_paths=PackedStringArray("_visualParent", "_targetSelectionParent", "_squashParent", "healthBarVisual", "_fighterDamageIndicatorVisual")]
script = ExtResource("1_hai27")
_visualParent = NodePath("Visuals")
_visualParent = NodePath("SquashParent/Visuals")
_targetSelectionParent = NodePath("TargetSelection")
healthBarVisual = NodePath("HealthBar")
_squashParent = NodePath("SquashParent")
healthBarVisual = NodePath("SquashParent/HealthBar")
_fighterDamageIndicatorVisual = NodePath("DamageIndicator")
[node name="Visuals" type="Node2D" parent="."]
[node name="SquashParent" type="Node2D" parent="."]
[node name="Sprite2D" type="Sprite2D" parent="Visuals"]
[node name="Visuals" type="Node2D" parent="SquashParent"]
[node name="Sprite2D" type="Sprite2D" parent="SquashParent/Visuals"]
position = Vector2(-31, -199)
scale = Vector2(0.451719, 0.451719)
texture = SubResource("AtlasTexture_wil2y")
[node name="ChacacterSizeIndicator" type="CollisionShape2D" parent="Visuals"]
[node name="ChacacterSizeIndicator" type="CollisionShape2D" parent="SquashParent/Visuals"]
editor_description = "This is a reference to the space, a normal sized humanoid character should occupy"
visible = false
position = Vector2(0, -200.5)
shape = SubResource("RectangleShape2D_6l7g5")
[node name="HealthBar" type="Node2D" parent="SquashParent" node_paths=PackedStringArray("_tmpHealthLabel")]
script = ExtResource("5_xv37w")
_tmpHealthLabel = NodePath("tmpLabel")
[node name="tmpLabel" type="Label" parent="SquashParent/HealthBar"]
offset_left = -110.0
offset_top = -528.0
offset_right = 111.0
offset_bottom = -431.0
theme_override_font_sizes/font_size = 71
text = "xx / xx"
[node name="TargetSelection" type="Node2D" parent="."]
process_mode = 4
visible = false
@@ -55,17 +73,10 @@ position = Vector2(-3, -227)
scale = Vector2(1.65625, 1.65625)
texture = ExtResource("4_8ldlc")
[node name="HealthBar" type="Node2D" parent="." node_paths=PackedStringArray("_tmpHealthLabel")]
script = ExtResource("5_xv37w")
_tmpHealthLabel = NodePath("tmpLabel")
[node name="tmpLabel" type="Label" parent="HealthBar"]
offset_left = -110.0
offset_top = -528.0
offset_right = 111.0
offset_bottom = -431.0
theme_override_font_sizes/font_size = 71
text = "xx / xx"
[node name="DamageIndicator" type="Node2D" parent="."]
position = Vector2(3, -190)
script = ExtResource("6_0qs42")
_flyingNumberPrefab = ExtResource("7_y6dyb")
[connection signal="TargetSelected" from="TargetSelection/Click" to="." method="ClickedTarget"]
[connection signal="mouse_entered" from="TargetSelection/Click" to="TargetSelection/HoverIndicator" method="show"]
+1 -1
View File
@@ -6,7 +6,7 @@
[node name="DetectionCross" type="Node2D" node_paths=PackedStringArray("_detector")]
script = ExtResource("1_va8tx")
_detector = NodePath("detector")
_xOffset = 300.0
_xOffset = 400.0
_yOffset = 300.0
[node name="detector" parent="." instance=ExtResource("2_8hh05")]
+1 -1
View File
@@ -3,7 +3,7 @@
[ext_resource type="Script" uid="uid://c3pd60biootsx" path="res://scripts/CSharp/Common/CharacterControls/Detector.cs" id="1_6pib0"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qwv4c"]
size = Vector2(100, 200)
size = Vector2(100, 400)
[node name="detector" type="Area2D"]
collision_layer = 4
@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://dpbbroif2tnil"]
[gd_scene load_steps=17 format=3 uid="uid://dpbbroif2tnil"]
[ext_resource type="Script" uid="uid://btusf04xnywhm" path="res://scripts/CSharp/Common/Inventory/ItemOnGround2D.cs" id="1_tlhp6"]
[ext_resource type="Script" uid="uid://c8suoi3i6kqai" path="res://scripts/CSharp/Common/Inventory/ItemOnGroundSpawnWith.cs" id="3_xu8me"]
@@ -10,6 +10,8 @@
[ext_resource type="AudioStream" uid="uid://bqm6rchwtelxj" path="res://audio/sfx/UI/SFX_ItemPickUp_03.wav" id="8_kflfw"]
[ext_resource type="AudioStream" uid="uid://brsufnpmig5fv" path="res://audio/sfx/UI/SFX_ItemPickUp_04.wav" id="9_dltn0"]
[ext_resource type="Script" uid="uid://dx25g14a7xi4w" path="res://scripts/CSharp/Common/Audio/AudioPlayer.cs" id="10_clbey"]
[ext_resource type="Script" uid="uid://b5dotkx17gvxg" path="res://scripts/CSharp/Low Code/Events/EventRaiser.cs" id="11_kflfw"]
[ext_resource type="Resource" uid="uid://78t0o27g6aq6" path="res://resources/low code/interactables/event_PickedUpInteractable.tres" id="12_dltn0"]
[sub_resource type="Theme" id="Theme_tlhp6"]
default_font_size = 80
@@ -28,10 +30,11 @@ stream_1/stream = ExtResource("7_edjam")
stream_2/stream = ExtResource("8_kflfw")
stream_3/stream = ExtResource("9_dltn0")
[node name="GenericItemOnGround" type="Node2D"]
[node name="GenericItemOnGround" type="Node2D" groups=["Saveable"]]
z_index = 1
y_sort_enabled = true
script = ExtResource("1_tlhp6")
metadata/SaveID = ""
[node name="SpawnWithItem" type="Node" parent="."]
script = ExtResource("3_xu8me")
@@ -55,9 +58,9 @@ theme = SubResource("Theme_harr4")
text = "thewe waf a pwoblem wiph picking up te item UWU"
autowrap_mode = 3
[node name="PickupInteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("4_xu8me")]
[node name="PickupInteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("4_xu8me")]
_outlineMaterial = ExtResource("4_harr4")
_spriteToOutline = NodePath("../Icon")
_spritesToOutline = [NodePath("../Icon")]
[node name="CollisionShape3D" parent="PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tlhp6")
@@ -74,6 +77,10 @@ bus = &"SFX"
playback_type = 2
script = ExtResource("10_clbey")
[node name="PickUpEventRaiser" type="Node" parent="."]
script = ExtResource("11_kflfw")
_eventResources = Array[Object]([ExtResource("12_dltn0")])
[connection signal="Interacted" from="PickupInteractionArea" to="." method="TryPickUp"]
[connection signal="Interacted" from="PickupInteractionArea" to="SFX/PickUpSound" method="PlayOneShot"]
+13 -7
View File
@@ -32,6 +32,8 @@ InputService="*res://scripts/CSharp/Common/Services/InputService.cs"
QuestManager="*res://prefabs/quests/quest_manager_autoload.tscn"
Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd"
FightWorldAutoload="*res://prefabs/fight/fight_world_autoload.tscn"
SaveGameManager="*res://scripts/CSharp/Common/Savegame/SaveGameManager.cs"
SettingsSaveController="*res://scripts/CSharp/Common/Savegame/SettingsSaveController.cs"
[dialogic]
@@ -144,8 +146,11 @@ directories/tres_directory={
"default_bus_layout": "res://audio/default_bus_layout.tres",
"default_stylebox": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/default_stylebox.tres",
"default_vn_style": "res://addons/dialogic/Modules/DefaultLayoutParts/Style_VN_Default/default_vn_style.tres",
"event_PickedUpInteractable": "res://resources/low code/interactables/event_PickedUpInteractable.tres",
"event_colorButtonClicked": "res://resources/low code/test/event_colorButtonClicked.tres",
"event_newPlantCreated": "res://resources/low code/farming/event_newPlantCreated.tres",
"event_textLabelClicked": "res://resources/low code/test/event_textLabelClicked.tres",
"event_watering": "res://resources/low code/farming/event_watering.tres",
"farming_equipment_glossary": "res://dialog/farming_equipment_glossary.tres",
"hoe": "res://resources/items/hoe.tres",
"inventory_interactable_outline": "res://art/materials/inventory_interactable_outline.tres",
@@ -170,6 +175,8 @@ directories/tres_directory={
"unselected_stylebox": "res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres",
"var_ColorTestValue": "res://resources/low code/test/var_ColorTestValue.tres",
"var_Counter": "res://resources/low code/test/var_Counter.tres",
"var_sceneNameProvider": "res://resources/low code/farming/var_sceneNameProvider.tres",
"var_wateredFieldPosition": "res://resources/low code/farming/var_wateredFieldPosition.tres",
"vesna_style": "res://addons/dialogic/vesna_style.tres",
"vn_textbox_default_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_default_panel.tres",
"vn_textbox_name_label_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_name_label_panel.tres",
@@ -205,18 +212,17 @@ folder_colors={
"res://audio/": "yellow",
"res://dialog/": "green",
"res://fonts/": "green",
"res://logos/": "green",
"res://prefabs/": "teal",
"res://resources/": "teal",
"res://scenes/": "blue",
"res://scripts/": "purple",
"res://logos/": "blue",
"res://prefabs/": "purple",
"res://resources/": "purple",
"res://scenes/": "purple",
"res://scripts/": "pink",
"res://shader/": "pink"
}
[global_group]
PlantGrowing=""
Pickup=""
Saveable=""
[input]
+1
View File
@@ -13,4 +13,5 @@ name = "Hoe"
color = Color(0.751421, 0.329615, 0.570911, 1)
icon = SubResource("AtlasTexture_i5wdx")
maxStack = 1
isUnique = true
metadata/_custom_type_script = "uid://cbskymrxs6ksu"
+1
View File
@@ -13,4 +13,5 @@ name = "Can"
color = Color(0.336269, 0.489145, 0.825324, 1)
icon = SubResource("AtlasTexture_tqw18")
maxStack = 1
isUnique = true
metadata/_custom_type_script = "uid://cbskymrxs6ksu"
@@ -0,0 +1,7 @@
[gd_resource type="Resource" script_class="EventResource" load_steps=2 format=3 uid="uid://b4hawvsc7cmkn"]
[ext_resource type="Script" uid="uid://ci3t5mvnopntg" path="res://scripts/CSharp/Low Code/Events/EventResource.cs" id="1_o6pnj"]
[resource]
script = ExtResource("1_o6pnj")
metadata/_custom_type_script = "uid://ci3t5mvnopntg"
@@ -0,0 +1,7 @@
[gd_resource type="Resource" script_class="EventResource" load_steps=2 format=3 uid="uid://cmqapbvv0hev2"]
[ext_resource type="Script" uid="uid://ci3t5mvnopntg" path="res://scripts/CSharp/Low Code/Events/EventResource.cs" id="1_qophu"]
[resource]
script = ExtResource("1_qophu")
metadata/_custom_type_script = "uid://ci3t5mvnopntg"
@@ -0,0 +1,8 @@
[gd_resource type="Resource" script_class="VariableResource" load_steps=2 format=3 uid="uid://tt3d166mntmi"]
[ext_resource type="Script" uid="uid://dtvx2cakx0bey" path="res://scripts/CSharp/Low Code/Variables/VariableResource.cs" id="1_m5pb0"]
[resource]
script = ExtResource("1_m5pb0")
Payload = "farmOutside"
metadata/_custom_type_script = "uid://dtvx2cakx0bey"
@@ -0,0 +1,8 @@
[gd_resource type="Resource" script_class="VariableResource" load_steps=2 format=3 uid="uid://svfgwtb3xosj"]
[ext_resource type="Script" uid="uid://dtvx2cakx0bey" path="res://scripts/CSharp/Low Code/Variables/VariableResource.cs" id="1_qoiop"]
[resource]
script = ExtResource("1_qoiop")
Payload = Vector2(0, 0)
metadata/_custom_type_script = "uid://dtvx2cakx0bey"
@@ -0,0 +1,7 @@
[gd_resource type="Resource" script_class="EventResource" load_steps=2 format=3 uid="uid://78t0o27g6aq6"]
[ext_resource type="Script" uid="uid://ci3t5mvnopntg" path="res://scripts/CSharp/Low Code/Events/EventResource.cs" id="1_acx84"]
[resource]
script = ExtResource("1_acx84")
metadata/_custom_type_script = "uid://ci3t5mvnopntg"
+5 -2
View File
@@ -1,10 +1,13 @@
[gd_scene load_steps=2 format=3 uid="uid://bopv10dqm1knc"]
[gd_scene load_steps=3 format=3 uid="uid://bopv10dqm1knc"]
[ext_resource type="PackedScene" uid="uid://c6wnoif01ltld" path="res://scenes/Babushka_scene_startMenu.tscn" id="1_15ton"]
[ext_resource type="Script" uid="uid://bbp0dyddwdbl8" path="res://scripts/CSharp/Common/Savegame/WindowSettingsSync.cs" id="2_d3jfo"]
[node name="BabushkaSceneBootstrap" type="Node2D"]
[node name="BabushkaSceneStartMenu" parent="." instance=ExtResource("1_15ton")]
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_farm_outside_2d.tscn")
[node name="SceneParent" type="Node" parent="."]
[node name="WindowSettings" type="Node" parent="."]
script = ExtResource("2_d3jfo")
+213 -61
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=117 format=3 uid="uid://gigb28qk8t12"]
[gd_scene load_steps=118 format=3 uid="uid://gigb28qk8t12"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="1_7wfwe"]
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
@@ -28,7 +28,6 @@
[ext_resource type="Texture2D" uid="uid://dg7rlugnq0t45" path="res://art/farm/farming/farmobjekte/brünnen.png" id="21_ualyd"]
[ext_resource type="Texture2D" uid="uid://bcw6oeovkmiup" path="res://art/nature/baum märz 2025/sonnenblumeseamless.png" id="23_d77e7"]
[ext_resource type="PackedScene" uid="uid://dfvgp1my5rydh" path="res://prefabs/characters/Yeli.tscn" id="24_wtdui"]
[ext_resource type="Script" uid="uid://dhxtdhfqx3bte" path="res://scripts/CSharp/Common/Farming/FieldService2D.cs" id="25_0qu0h"]
[ext_resource type="PackedScene" uid="uid://dpbbroif2tnil" path="res://prefabs/interactions/generic_item_on_ground_2d.tscn" id="25_hukxv"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="27_klb81"]
[ext_resource type="Resource" uid="uid://dlcmqfjvgphqu" path="res://resources/items/rake.tres" id="28_6b2nr"]
@@ -39,7 +38,6 @@
[ext_resource type="Resource" uid="uid://d1uuxp1lp4aro" path="res://resources/items/tomato_seed.tres" id="35_64mdn"]
[ext_resource type="Texture2D" uid="uid://65e44yde224q" path="res://art/farm/Babushka_house_01.png" id="36_e5b7x"]
[ext_resource type="Resource" uid="uid://duq7tshxv6uhp" path="res://resources/items/beet_seed.tres" id="36_fv1t2"]
[ext_resource type="Texture2D" uid="uid://cyyxqmphcrjj" path="res://art/farm/farming/farmobjekte/tomaten/tomaten_template.png" id="36_l7ekk"]
[ext_resource type="AudioStream" uid="uid://cfqg50am0swb7" path="res://audio/Music/Farming_90BPM_69Bars_Loop.wav" id="37_8ey8m"]
[ext_resource type="AudioStream" uid="uid://dku1rq5cocisg" path="res://audio/Music/Farming_90BPM_69Bars.wav" id="37_di1ed"]
[ext_resource type="Shader" uid="uid://braevmqauoek7" path="res://shader/swaying_plant.gdshader" id="37_taxvr"]
@@ -75,8 +73,13 @@
[ext_resource type="Resource" uid="uid://5t8g0firdif0" path="res://resources/quests/demo/5_talk_yeli_3.tres" id="69_l4wxt"]
[ext_resource type="Script" uid="uid://bhbldab74vmhy" path="res://scripts/CSharp/Common/QuestBehaviour/DetectFieldWork.cs" id="74_fv1t2"]
[ext_resource type="Resource" uid="uid://h05jgxqtq37m" path="res://resources/quests/demo/6_till_and_water.tres" id="75_l7ekk"]
[ext_resource type="Script" uid="uid://dfpyjxivcuidr" path="res://scripts/CSharp/Low Code/Variables/VariableSetter.cs" id="76_l7ekk"]
[ext_resource type="Resource" uid="uid://byjqeukpibkvi" path="res://resources/quests/demo/7_talk_yeli_inside_1.tres" id="76_xcwle"]
[ext_resource type="Script" uid="uid://dih1b0opgc3f7" path="res://scripts/GdScript/dialogic_start_specific.gd" id="77_l7ekk"]
[ext_resource type="Resource" uid="uid://tt3d166mntmi" path="res://resources/low code/farming/var_sceneNameProvider.tres" id="77_xcwle"]
[ext_resource type="PackedScene" uid="uid://b1d2e7ely6hyw" path="res://prefabs/farm/base_field.tscn" id="78_xcwle"]
[ext_resource type="Script" uid="uid://iquhbkr7pqeg" path="res://scripts/CSharp/Common/Savegame/SaveCheats.cs" id="79_065st"]
[ext_resource type="Script" uid="uid://ca4s0algeij1h" path="res://scripts/CSharp/Common/Savegame/SaveIDProviderTool.cs" id="80_w1kgo"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wtdui"]
shader = ExtResource("13_7p0hq")
@@ -211,13 +214,6 @@ shader_parameter/tiling_scale = Vector2(1, 20)
shader = ExtResource("13_kt1wx")
shader_parameter/tiling_scale = Vector2(1, 25)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2nee2"]
size = Vector2(5782, 1176)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_p6n74"]
resource_local_to_scene = true
size = Vector2(7150, 1192)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lwk6t"]
shader = ExtResource("13_7p0hq")
shader_parameter/hue_shift = 0.0
@@ -1036,16 +1032,16 @@ position = Vector2(6403, 3362)
_timelinesToPlay = PackedStringArray("yeli_quest_select")
_retriggerSameTimeline = true
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("1_7wfwe")]
[node name="Vesna" parent="YSorted" instance=ExtResource("1_7wfwe")]
z_index = 1
position = Vector2(9322, 2018)
_fieldParent = NodePath("../Farm visuals/FieldParent")
_hoe = ExtResource("28_6b2nr")
[node name="FarmingControls" parent="YSorted/Vesna" index="1" node_paths=PackedStringArray("_camera")]
[node name="FarmingControls" parent="YSorted/Vesna" index="1" node_paths=PackedStringArray("_camera", "_fieldParent")]
_camera = NodePath("../../../Camera2D")
_fieldParent = NodePath("../../FieldParent")
[node name="Brünnen" type="Sprite2D" parent="YSorted" node_paths=PackedStringArray("_interactionArea")]
[node name="Well" type="Sprite2D" parent="YSorted" node_paths=PackedStringArray("_interactionArea")]
z_index = 1
y_sort_enabled = true
material = SubResource("ShaderMaterial_2vojv")
@@ -1057,28 +1053,32 @@ region_rect = Rect2(0, 0, 1504, 1686)
script = ExtResource("32_lbnqo")
_interactionArea = NodePath("InteractionArea")
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Brünnen"]
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Well"]
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Brünnen/StaticBody2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Well/StaticBody2D"]
position = Vector2(145.5, -224)
shape = SubResource("RectangleShape2D_0sfl7")
[node name="InteractionArea" parent="YSorted/Brünnen" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("27_klb81")]
_active = false
_spriteToOutline = NodePath("..")
_id = 1
[node name="InteractionArea" parent="YSorted/Well" instance=ExtResource("27_klb81")]
metadata/SaveID = "b8f7b7fe-e057-4974-ba12-9134722998de"
[node name="CollisionShape3D" parent="YSorted/Brünnen/InteractionArea/Area2D" index="0"]
[node name="CollisionShape3D" parent="YSorted/Well/InteractionArea/Area2D" index="0"]
position = Vector2(146, -130)
shape = SubResource("CircleShape2D_p6n74")
[node name="CanGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(8192, 3507)
metadata/SaveID = "5a823507-8107-40ce-8b32-6d0f81a3c44e"
[node name="SpawnWithItem" parent="YSorted/CanGenericPickup" index="0"]
_blueprint = ExtResource("28_ipqaa")
[node name="PickupInteractionArea" parent="YSorted/CanGenericPickup" index="3" node_paths=PackedStringArray("_spritesToOutline")]
_outlineMaterial = null
_spritesToOutline = []
metadata/SaveID = "0c006f5c-c472-4f89-908b-d8f34503ba37"
[node name="CollisionShape3D" parent="YSorted/CanGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_2065p")
@@ -1087,44 +1087,190 @@ offset = Vector2(0, -50)
[node name="RakeGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(8391, 2060)
metadata/SaveID = "e13886b1-2131-4072-bc06-7d8abb19357b"
[node name="SpawnWithItem" parent="YSorted/RakeGenericPickup" index="0"]
_blueprint = ExtResource("28_6b2nr")
[node name="PickupInteractionArea" parent="YSorted/RakeGenericPickup" index="3" node_paths=PackedStringArray("_spritesToOutline")]
_outlineMaterial = null
_spritesToOutline = []
metadata/SaveID = "c148aa78-114b-4770-a040-8498483edb1d"
[node name="CollisionShape3D" parent="YSorted/RakeGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tm0yg")
[node name="SeedPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(9927, 2257)
_infiniteSupply = true
_finiteSupply = 3
metadata/SaveID = "e1bbe13f-0622-42b8-97f3-87a8af369dc0"
[node name="SpawnWithItem" parent="YSorted/SeedPickup" index="0"]
_blueprint = ExtResource("35_64mdn")
[node name="PickupInteractionArea" parent="YSorted/SeedPickup" index="3"]
metadata/SaveID = "ad152c51-3631-42c1-9aa4-4df896b35d8c"
[node name="CollisionShape3D" parent="YSorted/SeedPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tm0yg")
[node name="Icon" parent="YSorted/SeedPickup" index="4"]
scale = Vector2(1, 1)
[node name="Sprite2D" type="Sprite2D" parent="YSorted/SeedPickup"]
texture = ExtResource("36_l7ekk")
region_enabled = true
[node name="SeedPickup2" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(10705, 2257)
_finiteSupply = 3
metadata/SaveID = "77972c50-63a7-461a-bc7d-6fa46333bc5c"
[node name="SpawnWithItem" parent="YSorted/SeedPickup2" index="0"]
_blueprint = ExtResource("36_fv1t2")
[node name="PickupInteractionArea" parent="YSorted/SeedPickup2" index="3"]
metadata/SaveID = "09e115e7-1d21-485a-be3e-b3fff9c83e78"
[node name="CollisionShape3D" parent="YSorted/SeedPickup2/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tm0yg")
[node name="Icon" parent="YSorted/SeedPickup2" index="4"]
scale = Vector2(1, 1)
[node name="FieldParent" type="Node2D" parent="YSorted"]
position = Vector2(0, -200)
[node name="right" type="Node2D" parent="YSorted/FieldParent"]
[node name="BaseField" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(8807, 3061)
metadata/SaveID = "533e356b-386b-49c9-beb1-4484f2a5164f"
[node name="BaseField2" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(9335, 3562)
Payload = 1
metadata/SaveID = "79084490-9e12-4153-9ae8-6162b5348c37"
[node name="BaseField3" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(9854, 3071)
Payload = 2
metadata/SaveID = "7332aadf-2583-468b-889c-ccbad96137f8"
[node name="BaseField4" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(10361, 3536)
Payload = 3
metadata/SaveID = "493f7b1f-3d01-4d66-b668-6014ef9b3c15"
[node name="BaseField5" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(10948, 3025)
Payload = 4
metadata/SaveID = "ba9d21eb-7c31-4459-bd90-ae23e9a09eb1"
[node name="BaseField6" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(11296, 3607)
Payload = 5
metadata/SaveID = "e6a3367e-afe1-4c5d-abd9-153cc365dce0"
[node name="BaseField7" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(11869, 3026)
Payload = 6
metadata/SaveID = "08de526f-e22f-42a4-a3f9-549d2dc15b5d"
[node name="BaseField8" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(12353, 3554)
Payload = 7
metadata/SaveID = "9fd46633-8028-48e6-9176-ffe8c7a26a2e"
[node name="BaseField9" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(12828, 2999)
Payload = 8
metadata/SaveID = "82e139eb-47f4-4ce4-962f-f72d22f9fe45"
[node name="BaseField10" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(13285, 3536)
Payload = 9
metadata/SaveID = "03ff923a-614a-4fc9-8865-f5290ec16169"
[node name="BaseField11" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(13733, 2990)
Payload = 10
metadata/SaveID = "1347c031-e8c0-44f9-9d42-80084ae9bc29"
[node name="BaseField12" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(14261, 3474)
Payload = 11
metadata/SaveID = "c0b02859-bd5c-4780-8ca7-80b4234ee1d7"
[node name="BaseField13" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(14753, 2982)
Payload = 12
metadata/SaveID = "bee82b2a-a437-4d3a-b003-dac55dfd24aa"
[node name="BaseField14" parent="YSorted/FieldParent/right" instance=ExtResource("78_xcwle")]
position = Vector2(15201, 3519)
Payload = 13
metadata/SaveID = "4750a191-6902-46d4-9b2e-964c1aa0a29c"
[node name="left" type="Node2D" parent="YSorted/FieldParent"]
position = Vector2(-8661, -143)
[node name="BaseField" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(8807, 3061)
Payload = 14
metadata/SaveID = "b44ef2e7-898a-40d0-975b-ba75d7df4601"
[node name="BaseField2" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(9227, 3562)
Payload = 15
metadata/SaveID = "5705ba02-f444-4f2b-b527-b95578132b87"
[node name="BaseField3" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(9756, 3111)
Payload = 16
metadata/SaveID = "bca9073b-0b2f-4371-a645-a37aa04f4e23"
[node name="BaseField4" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(10322, 3536)
Payload = 17
metadata/SaveID = "f636a1ef-016d-4361-9b6e-1d59262a8c04"
[node name="BaseField5" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(10810, 3055)
Payload = 18
metadata/SaveID = "d074a30d-3f52-4788-879a-4ea8c5818c32"
[node name="BaseField6" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(11266, 3607)
Payload = 19
metadata/SaveID = "8296a15c-be4a-4127-b0f7-8a330dd2a843"
[node name="BaseField7" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(11741, 3026)
Payload = 20
metadata/SaveID = "02468d9f-0120-42ff-806d-0aaa351f055c"
[node name="BaseField8" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(12255, 3593)
Payload = 21
metadata/SaveID = "803f7df5-23a8-424a-8389-08371ea80101"
[node name="BaseField9" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(12690, 3019)
Payload = 22
metadata/SaveID = "88efb617-5e57-4b16-8ceb-c45c56463690"
[node name="BaseField10" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(13216, 3556)
Payload = 23
metadata/SaveID = "ca6c1e3d-2c4e-4977-a89e-55d265f65faf"
[node name="BaseField11" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(13684, 3000)
Payload = 24
metadata/SaveID = "262fbec5-597d-432e-8dd0-50d53fd51b59"
[node name="BaseField12" parent="YSorted/FieldParent/left" instance=ExtResource("78_xcwle")]
position = Vector2(14143, 3523)
Payload = 25
metadata/SaveID = "05389ea3-d19b-42fc-8bf0-b0755437ec10"
[node name="Farm visuals" type="Node2D" parent="YSorted"]
position = Vector2(-60, 122)
@@ -1146,11 +1292,11 @@ collision_mask = 6
position = Vector2(-252.56, 231.32)
polygon = PackedVector2Array(247.227, 43.5123, 44.7822, 43.5123, -87.2178, 45.123, -104.329, -55.2797, -154.107, -73.5347, -160.107, -380.38, -175.44, -400.783, -63.44, -512.461, 97.8934, -541.991, 261.671, -599.172, 374.782, -526.421, 502.338, -526.421, 637.893, -396.488, 598.56, -360.783, 596.338, -58.2327, 528.782, -58.2327, 501.449, 45.9283)
[node name="EnterHouseInteraction" parent="YSorted/Farm visuals/Static" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("27_klb81")]
[node name="EnterHouseInteraction" parent="YSorted/Farm visuals/Static" instance=ExtResource("27_klb81")]
position = Vector2(5834, 2354)
scale = Vector2(2.425, 2.425)
_spriteToOutline = NodePath("DoorSprite")
_id = 0
metadata/SaveID = "5a93071f-c1ab-4b4b-b74e-a6324d44ddf8"
[node name="DoorSprite" type="Sprite2D" parent="YSorted/Farm visuals/Static/EnterHouseInteraction"]
position = Vector2(0.412364, -33.1959)
@@ -1856,7 +2002,7 @@ region_rect = Rect2(332, 194, 179, 154)
[node name="grass3" type="Sprite2D" parent="YSorted/Farm visuals/Static/greenery/grass"]
modulate = Color(0.954868, 0.882599, 0.798501, 1)
z_index = -5
position = Vector2(18189, 1960)
position = Vector2(18165, 1966)
scale = Vector2(5.77602, 3.87779)
texture = ExtResource("42_loeum")
region_enabled = true
@@ -2101,27 +2247,6 @@ rotation = 1.5708
scale = Vector2(0.1, 10.8)
texture = ExtResource("21_if5vh")
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals" node_paths=PackedStringArray("fields", "_allowedArea")]
position = Vector2(53, 20)
scale = Vector2(1, 0.993819)
script = ExtResource("25_0qu0h")
fields = {}
_allowedArea = NodePath("Area2D")
metadata/_custom_type_script = "uid://dhxtdhfqx3bte"
[node name="Area2D" type="Area2D" parent="YSorted/Farm visuals/FieldParent"]
position = Vector2(-48, -16)
collision_mask = 5
collision_priority = 10.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Farm visuals/FieldParent/Area2D"]
position = Vector2(2896, 2949)
shape = SubResource("RectangleShape2D_2nee2")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="YSorted/Farm visuals/FieldParent/Area2D"]
position = Vector2(11914, 2960)
shape = SubResource("RectangleShape2D_p6n74")
[node name="Blocker" type="Node2D" parent="YSorted"]
[node name="Fence Door2" type="Sprite2D" parent="YSorted/Blocker"]
@@ -2139,10 +2264,11 @@ collision_mask = 4
position = Vector2(-106.663, 182.891)
shape = SubResource("RectangleShape2D_ycj14")
[node name="InteractionArea" parent="YSorted/Blocker" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("27_klb81")]
[node name="InteractionArea" parent="YSorted/Blocker" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("27_klb81")]
position = Vector2(11234, 1850)
_spriteToOutline = NodePath("Fence Door")
_spritesToOutline = [NodePath("Fence Door")]
_id = 1
metadata/SaveID = "6ee77256-42af-49c9-a3f2-cf167853f6fb"
[node name="CollisionShape3D" parent="YSorted/Blocker/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_l7ekk")
@@ -2173,12 +2299,14 @@ z_index = 0
y_sort_enabled = false
position = Vector2(4374, 2652)
_penTarget = NodePath("../../pen/penSlot1")
metadata/SaveID = "348bd0e3-1da5-4f10-84ab-b0444e99d541"
[node name="Duck3" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("62_i36hd")]
z_index = 0
y_sort_enabled = false
position = Vector2(9259, 3194)
_penTarget = NodePath("../../pen/penSlot2")
metadata/SaveID = "94c8a740-2745-4162-91e7-66f36b8681e0"
[node name="Duck4" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("62_i36hd")]
z_index = 0
@@ -2187,6 +2315,7 @@ position = Vector2(13441, 3612)
rotation = 3.14159
scale = Vector2(1, -1)
_penTarget = NodePath("../../pen/penSlot3")
metadata/SaveID = "b3508312-eb61-4520-8349-e49e0e5328d3"
[node name="Duck5" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("62_i36hd")]
z_index = 0
@@ -2195,12 +2324,14 @@ position = Vector2(15330, 2487)
rotation = 3.14159
scale = Vector2(1, -1)
_penTarget = NodePath("../../pen/penSlot4")
metadata/SaveID = "b73895c2-6366-4c7e-b5e2-23f3dc9485f2"
[node name="Duck6" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("62_i36hd")]
z_index = 0
y_sort_enabled = false
position = Vector2(232, 2862)
_penTarget = NodePath("../../pen/penSlot5")
metadata/SaveID = "a963b9d2-862f-458b-be2c-9a54ec1bde90"
[node name="Duck7" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("62_i36hd")]
z_index = 0
@@ -2209,6 +2340,7 @@ position = Vector2(2409, 3958)
rotation = 3.14159
scale = Vector2(1, -1)
_penTarget = NodePath("../../pen/penSlot6")
metadata/SaveID = "748aff78-10eb-4a4e-bb6d-a8ee25d472d1"
[node name="DialogicToggle" type="Node2D" parent="YSorted/ducks"]
script = ExtResource("51_uxa2m")
@@ -2239,6 +2371,7 @@ position = Vector2(-4659, 2897)
position = Vector2(-5016, 3361)
[node name="trash" type="Node2D" parent="YSorted"]
visible = false
z_index = 1
y_sort_enabled = true
@@ -2254,8 +2387,10 @@ position = Vector2(3183, 2369)
offset = Vector2(1, -50)
region_rect = Rect2(207, 1184, 149, 142)
[node name="InteractionArea" parent="YSorted/trash/trashObject2" index="0"]
[node name="InteractionArea" parent="YSorted/trash/trashObject2" index="0" node_paths=PackedStringArray("_spritesToOutline")]
position = Vector2(-9, -46)
_spritesToOutline = []
metadata/SaveID = "549bbcf4-ea57-4b8f-80b1-b13ca648559b"
[node name="trashObject3" parent="YSorted/trash" instance=ExtResource("53_ycj14")]
z_index = 0
@@ -2264,8 +2399,10 @@ position = Vector2(4724, 3519)
offset = Vector2(1, -50)
region_rect = Rect2(400, 1053, 163, 141)
[node name="InteractionArea" parent="YSorted/trash/trashObject3" index="0"]
[node name="InteractionArea" parent="YSorted/trash/trashObject3" index="0" node_paths=PackedStringArray("_spritesToOutline")]
position = Vector2(-13, -53)
_spritesToOutline = []
metadata/SaveID = "29874314-50c1-4a21-9494-18f936d6e097"
[node name="trashObject4" parent="YSorted/trash" instance=ExtResource("53_ycj14")]
z_index = 0
@@ -2274,8 +2411,10 @@ position = Vector2(5385, 3391)
offset = Vector2(1, -50)
region_rect = Rect2(1048, 1092, 348, 106)
[node name="InteractionArea" parent="YSorted/trash/trashObject4" index="0"]
[node name="InteractionArea" parent="YSorted/trash/trashObject4" index="0" node_paths=PackedStringArray("_spritesToOutline")]
position = Vector2(0, -59)
_spritesToOutline = []
metadata/SaveID = "7ccaa831-5526-40ed-8ca3-31ba2ad929a6"
[node name="trashObject5" parent="YSorted/trash" instance=ExtResource("53_ycj14")]
z_index = 0
@@ -2311,8 +2450,10 @@ rotation = 1.77025
offset = Vector2(0, 0)
region_rect = Rect2(1048, 1092, 348, 106)
[node name="InteractionArea" parent="YSorted/trash/trashObject9" index="0"]
[node name="InteractionArea" parent="YSorted/trash/trashObject9" index="0" node_paths=PackedStringArray("_spritesToOutline")]
position = Vector2(22.40873, 25.05658)
_spritesToOutline = []
metadata/SaveID = "7bf227d6-3844-41e9-a9cd-524052aced3b"
[node name="CanvasLayer" parent="." instance=ExtResource("32_2nee2")]
@@ -2422,16 +2563,26 @@ _toNextQuest = ExtResource("76_xcwle")
script = ExtResource("77_l7ekk")
timeline = "quest2_tomatoes_end"
[node name="SceneNameSetter" type="Node" parent="."]
script = ExtResource("76_l7ekk")
_variableResource = ExtResource("77_xcwle")
_payloadToSet = "farmOutside"
[node name="SaveSystem" type="Node" parent="."]
[node name="SaveGameCheat" type="Node" parent="SaveSystem"]
script = ExtResource("79_065st")
[node name="SaveIDProvider" type="Node" parent="SaveSystem"]
script = ExtResource("80_w1kgo")
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="WateringField" from="YSorted/Vesna/FarmingControls" to="Audio/SFX/Watering SFX" method="PlayOneShot"]
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[connection signal="InteractedTool" from="YSorted/Well/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[connection signal="SuccessfulPickUp" from="YSorted/CanGenericPickup" to="YSorted/Vesna" method="HandlePickUp"]
[connection signal="SuccessfulPickUp" from="YSorted/RakeGenericPickup" to="YSorted/Vesna" method="HandlePickUp"]
[connection signal="SuccessfulPickUp" from="YSorted/SeedPickup" to="YSorted/Vesna" method="HandlePickUp"]
[connection signal="SuccessfulPickUp" from="YSorted/SeedPickup2" to="YSorted/Vesna" method="HandlePickUp"]
[connection signal="InteractedTool" from="YSorted/Farm visuals/Static/EnterHouseInteraction" to="." method="LoadSceneAtIndex"]
[connection signal="FieldCreated" from="YSorted/Farm visuals/FieldParent" to="Audio/SFX/Farming SFX" method="PlayOneShot"]
[connection signal="input_event" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Vesna/FarmingControls" method="InputEventPressedOn"]
[connection signal="InteractedTool" from="YSorted/Blocker/InteractionArea" to="." method="LoadSceneAtIndex"]
[connection signal="GoalReached" from="YSorted/ducks" to="YSorted/ducks/DialogicToggle" method="ToggleDialogue"]
[connection signal="DuckCollected" from="YSorted/ducks/Duck2" to="YSorted/ducks" method="Increment"]
@@ -2444,9 +2595,10 @@ timeline = "quest2_tomatoes_end"
[connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"]
[connection signal="ready" from="SpecialQuestTrigger/QuestInstantStart" to="SpecialQuestTrigger/QuestInstantStart/QuestTrigger" method="Trigger"]
[connection signal="OnFulfilled" from="SpecialQuestTrigger/FieldWorkTrigger" to="SpecialQuestTrigger/FieldWorkTrigger/StartDialog" method="open"]
[connection signal="tree_entered" from="SceneNameSetter" to="SceneNameSetter" method="Set"]
[editable path="YSorted/Vesna"]
[editable path="YSorted/Brünnen/InteractionArea"]
[editable path="YSorted/Well/InteractionArea"]
[editable path="YSorted/CanGenericPickup"]
[editable path="YSorted/CanGenericPickup/PickupInteractionArea"]
[editable path="YSorted/RakeGenericPickup"]
@@ -2248,7 +2248,6 @@ playback_type = 2
script = ExtResource("59_0knno")
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="WateringField" from="YSorted/Vesna/FarmingControls" to="Audio/SFX/Watering SFX" method="PlayOneShot"]
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[connection signal="SuccessfulPickUp" from="YSorted/CanGenericPickup" to="YSorted/Vesna" method="HandlePickUp"]
[connection signal="SuccessfulPickUp" from="YSorted/RakeGenericPickup" to="YSorted/Vesna" method="HandlePickUp"]
@@ -190,6 +190,7 @@ _label = NodePath("Label")
_current = NodePath("Current")
[node name="Label" type="Label" parent="StateMachineDebugger"]
visible = false
offset_left = -982.0
offset_top = -497.0
offset_right = -893.0
@@ -197,6 +198,7 @@ offset_bottom = -474.0
text = "Hello world"
[node name="Current" type="Label" parent="StateMachineDebugger"]
visible = false
offset_left = 705.0
offset_top = -495.0
offset_right = 794.0
@@ -2202,7 +2202,6 @@ makeActive = true
[connection signal="FightStarted" from="Fight2/FightBaseScene" to="YSorted/Vesna" method="DisableMovement"]
[connection signal="timelineEnded" from="YSorted/Chuga/Dialogic starter/DialogicToggle" to="YSorted/Chuga" method="set_position" binds= [Vector2(14579, 2951)]]
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="WateringField" from="YSorted/Vesna/FarmingControls" to="Audio/SFX/Watering SFX" method="PlayOneShot"]
[connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"]
[connection signal="ready" from="SpecialQuestNodes/InstantStartQuest" to="SpecialQuestNodes/InstantStartQuest" method="Trigger"]
@@ -309,10 +309,10 @@ texture = ExtResource("6_blyw3")
region_enabled = true
region_rect = Rect2(3161, 313, 679, 1050)
[node name="OutsideDoor" parent="BackWall/Room01DorrR" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
[node name="OutsideDoor" parent="BackWall/Room01DorrR" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(-7, 248)
scale = Vector2(1.5, 1.5)
_spriteToOutline = NodePath("..")
_spritesToOutline = [NodePath("..")]
_id = 1
[node name="Room01DoorL" type="Sprite2D" parent="BackWall"]
@@ -322,9 +322,9 @@ texture = ExtResource("7_yd2gv")
region_enabled = true
region_rect = Rect2(0, 0, 3840, 2160)
[node name="VesnasRoomDoor" parent="BackWall/Room01DoorL" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
[node name="VesnasRoomDoor" parent="BackWall/Room01DoorL" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(-1559, -16)
_spriteToOutline = NodePath("..")
_spritesToOutline = [NodePath("..")]
_id = 0
[node name="CollisionShape3D" parent="BackWall/Room01DoorL/VesnasRoomDoor/Area2D" index="0"]
@@ -358,9 +358,9 @@ texture = ExtResource("10_xcryd")
region_enabled = true
region_rect = Rect2(2360, 864, 356, 251)
[node name="InteractionArea" parent="BackWall/Room01PechkaDoor" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
[node name="InteractionArea" parent="BackWall/Room01PechkaDoor" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(0, -3)
_spriteToOutline = NodePath("..")
_spritesToOutline = [NodePath("..")]
[node name="CollisionShape3D" parent="BackWall/Room01PechkaDoor/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_gpagp")
@@ -407,10 +407,10 @@ stream = SubResource("AudioStreamRandomizer_b6vf7")
bus = &"SFX"
script = ExtResource("22_tggq2")
[node name="InteractionArea" parent="BackWall/Katze" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
[node name="InteractionArea" parent="BackWall/Katze" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(-6.5, -44)
scale = Vector2(0.5, 0.5)
_spriteToOutline = NodePath("..")
_spritesToOutline = [NodePath("..")]
[node name="Room assets" type="Node" parent="BackWall"]
@@ -1,10 +1,11 @@
[gd_scene load_steps=14 format=3 uid="uid://ceaa2qj2bmw43"]
[gd_scene load_steps=15 format=3 uid="uid://ceaa2qj2bmw43"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_c6eln"]
[ext_resource type="Texture2D" uid="uid://cugtxcfuds31r" path="res://art/indoor/Babushka_bg_01.png" id="2_j25a2"]
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="8_j25a2"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="8_phqdf"]
[ext_resource type="Resource" uid="uid://csj15gnlx1jmx" path="res://resources/quests/demo/8_goto_bed.tres" id="9_heyef"]
[ext_resource type="Script" uid="uid://puw74w6lmcvl" path="res://scripts/CSharp/Common/Fight/NightStarter.cs" id="10_j25a2"]
[ext_resource type="Texture2D" uid="uid://cop1vjvhwlsec" path="res://art/indoor/room export/Room_01_shelf.png" id="13_11fdt"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="18_3gevq"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="23_408bg"]
@@ -120,9 +121,14 @@ _id = 0
[node name="CollisionShape3D" parent="DoorInteraction/Area2D" index="0"]
shape = SubResource("CircleShape2D_2spkc")
[node name="NightStarter" type="Node" parent="."]
script = ExtResource("10_j25a2")
_sceneIndexToLoad = 1
[connection signal="Interacted" from="BedInteraction" to="BedInteraction/QuestCompleter" method="Trigger"]
[connection signal="InteractedTool" from="BedInteraction" to="." method="LoadSceneAtIndex"]
[connection signal="Interacted" from="BedInteraction" to="NightStarter" method="StartNight"]
[connection signal="Interacted" from="DoorInteraction" to="." method="LoadScene"]
[connection signal="LoadScene" from="NightStarter" to="." method="LoadSceneAtIndex"]
[editable path="Vesna"]
[editable path="BedInteraction"]
+189 -30
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=85 format=3 uid="uid://b3ibx4resa1f3"]
[gd_scene load_steps=98 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,16 +42,19 @@
[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://dhxtdhfqx3bte" path="res://scripts/CSharp/Common/Farming/FieldService2D.cs" id="46_xkmgh"]
[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"]
[ext_resource type="Script" uid="uid://clxb3n668oud3" path="res://scripts/CSharp/Common/Audio/AudioDebugger.cs" id="54_pn8sy"]
[ext_resource type="AudioStream" uid="uid://cfqg50am0swb7" path="res://audio/Music/Farming_90BPM_69Bars_Loop.wav" id="55_aq24k"]
[ext_resource type="Script" uid="uid://dfpyjxivcuidr" path="res://scripts/CSharp/Low Code/Variables/VariableSetter.cs" id="56_34r5t"]
[ext_resource type="AudioStream" uid="uid://vcftvrpi6c7k" path="res://audio/sfx/Farming/SFX_Harke_03_Solo.wav" id="56_vojpc"]
[ext_resource type="AudioStream" uid="uid://bxh5m04vdo0sr" path="res://audio/sfx/Farming/SFX_Harke_04_Solo.wav" id="57_euap5"]
[ext_resource type="Resource" uid="uid://tt3d166mntmi" path="res://resources/low code/farming/var_sceneNameProvider.tres" id="57_hpgl7"]
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer2D.cs" id="58_m3hs4"]
[ext_resource type="Script" uid="uid://iquhbkr7pqeg" path="res://scripts/CSharp/Common/Savegame/SaveCheats.cs" id="58_qavgq"]
[ext_resource type="AudioStream" uid="uid://dapsknn486aee" path="res://audio/sfx/Farming/SFX_WateringPlants_01.wav" id="59_km2vg"]
[ext_resource type="Script" uid="uid://ca4s0algeij1h" path="res://scripts/CSharp/Common/Savegame/SaveIDProviderTool.cs" id="59_njxly"]
[ext_resource type="AudioStream" uid="uid://dnyne8wov50so" path="res://audio/sfx/Farming/SFX_WateringPlants_02.wav" id="60_qi2gu"]
[ext_resource type="AudioStream" uid="uid://fsiypqhql67w" path="res://audio/sfx/Farming/SFX_GettingWater_01.wav" id="61_wy1mx"]
[ext_resource type="AudioStream" uid="uid://foyw26hq1qp5" path="res://audio/sfx/Farming/SFX_GettingWater_02.wav" id="62_kmjnt"]
@@ -169,6 +172,42 @@ shader_parameter/offset = 0.0
shader = ExtResource("24_anpd4")
shader_parameter/tiling_scale = Vector2(1, 20)
[sub_resource type="CircleShape2D" id="CircleShape2D_qavgq"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_njxly"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_54ty3"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_gbxtf"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_6krrk"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_4ktoi"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_aaup4"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_v10dc"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_4pibb"]
resource_local_to_scene = true
radius = 325.2599
[sub_resource type="CircleShape2D" id="CircleShape2D_dr6bm"]
resource_local_to_scene = true
radius = 335.72162
@@ -184,6 +223,10 @@ shader_parameter/contrast_mult = 1.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ycj14"]
size = Vector2(707.116, 604.111)
[sub_resource type="CircleShape2D" id="CircleShape2D_hpgl7"]
resource_local_to_scene = true
radius = 294.02722
[sub_resource type="AudioStreamPlaylist" id="AudioStreamPlaylist_ceriq"]
loop = false
stream_count = 1
@@ -205,7 +248,7 @@ stream_0/stream = ExtResource("61_wy1mx")
stream_1/stream = ExtResource("62_kmjnt")
stream_2/stream = ExtResource("63_td2xu")
[node name="BabushkaSceneFarmOutside2d" type="Node2D"]
[node name="BabushkaSceneBeets" type="Node2D"]
script = ExtResource("1_6krrk")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_farm_outside_2d.tscn")
@@ -918,10 +961,9 @@ shape = SubResource("RectangleShape2D_0qu0h")
z_index = 1
y_sort_enabled = true
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("27_qtaxr")]
[node name="Vesna" parent="YSorted" instance=ExtResource("27_qtaxr")]
z_index = 1
position = Vector2(2693, 1876)
_fieldParent = NodePath("../Farm visuals/FieldParent")
_hoe = ExtResource("28_le48k")
[node name="Animated Sprites" parent="YSorted/Vesna/CharacterBody2D/visuals" index="0"]
@@ -956,8 +998,8 @@ collision_mask = 4
position = Vector2(145.5, -224)
shape = SubResource("RectangleShape2D_0sfl7")
[node name="InteractionArea" parent="YSorted/Brünnen" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("31_xcb8u")]
_spriteToOutline = NodePath("..")
[node name="InteractionArea" parent="YSorted/Brünnen" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("31_xcb8u")]
_spritesToOutline = [NodePath("..")]
_id = 1
[node name="CollisionShape3D" parent="YSorted/Brünnen/InteractionArea/Area2D" index="0"]
@@ -1702,117 +1744,199 @@ rotation = 1.5708
scale = Vector2(0.1, 8.7)
texture = ExtResource("26_bwvai")
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals" node_paths=PackedStringArray("fields")]
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals"]
position = Vector2(53, 20)
scale = Vector2(1, 0.993819)
script = ExtResource("46_xkmgh")
fields = {}
metadata/_custom_type_script = "uid://dhxtdhfqx3bte"
[node name="BaseField" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(651, 2630.26)
scale = Vector2(1, 1.00622)
metadata/SaveID = "b3b47e69-6115-4405-8da6-508b783823d2"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField" index="1"]
visible = true
metadata/SaveID = "7a8210bf-479d-4b4c-9758-98d23e59d5d7"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_qavgq")
[node name="BaseField2" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(1226, 3098.15)
scale = Vector2(1, 1.00622)
Payload = 1
metadata/SaveID = "f536efd3-3da8-4ef5-a520-570220e6c19f"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField2" index="0"]
FieldState = 3
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField2" index="1"]
visible = true
metadata/SaveID = "a1d8a0a2-c51c-4410-83c3-0edb31cbf2de"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField2/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 1
_state = 2
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField2" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField2/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_njxly")
[node name="BaseField3" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(1782, 2606.11)
scale = Vector2(1, 1.00622)
Payload = 2
metadata/SaveID = "14ce64d5-8a4d-43b9-a8ff-3a57725c4dc8"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField3" index="0"]
FieldState = 3
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField3" index="1"]
visible = true
metadata/SaveID = "79a65532-cb2b-4268-8eb0-8c41a3935cbb"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField3/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField3" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField3/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_54ty3")
[node name="BaseField4" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(2559, 2624.22)
scale = Vector2(1, 1.00622)
Payload = 3
metadata/SaveID = "6872ce5d-6f42-47d7-97e2-a7214ff3b08c"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField4" index="0"]
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField4" index="1"]
visible = true
FieldState = 3
metadata/SaveID = "13fa64a3-01dc-4fd8-822e-0839c0da3163"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField4/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField4" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField4/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_gbxtf")
[node name="BaseField5" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(3305, 2624.22)
scale = Vector2(1, 1.00622)
Payload = 4
metadata/SaveID = "f163c38d-9ee0-4844-9def-479833febb4e"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField5" index="0"]
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField5" index="1"]
visible = true
FieldState = 3
metadata/SaveID = "414ecdb9-f3c4-4fb9-81bd-6ca575784f78"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField5/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField5" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField5/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_6krrk")
[node name="BaseField6" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(4033, 2618.18)
scale = Vector2(1, 1.00622)
Payload = 5
metadata/SaveID = "da691381-ee82-4f86-abf3-dda2c9f19337"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField6" index="0"]
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField6" index="1"]
visible = true
FieldState = 3
metadata/SaveID = "b235febb-b231-4f8c-94e9-1f9d9f115b08"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField6/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 1
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField6" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField6/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_4ktoi")
[node name="BaseField7" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(4755, 2630.26)
scale = Vector2(1, 1.00622)
Payload = 6
metadata/SaveID = "8116fa8b-b164-4d39-a1ed-6cd476d18f94"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField7" index="0"]
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField7" index="1"]
visible = true
FieldState = 3
metadata/SaveID = "9ccdba91-812a-4c13-9ee0-12472e174fc9"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField7/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField7" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField7/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_aaup4")
[node name="BaseField8" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(4418, 3226.95)
scale = Vector2(1, 1.00622)
Payload = 7
metadata/SaveID = "5298f423-4c3b-45b5-94fb-d4aef36bac21"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField8" index="0"]
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField8" index="1"]
visible = true
FieldState = 3
metadata/SaveID = "da44e54a-0b76-4888-ad8b-782a9d146fa3"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField8/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField8" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField8/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_v10dc")
[node name="BaseField9" parent="YSorted/Farm visuals/FieldParent" instance=ExtResource("40_efblm")]
position = Vector2(5317, 3208.83)
scale = Vector2(1, 1.00622)
Payload = 8
metadata/SaveID = "0de8dc13-5851-4471-be35-309cd6687ebc"
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField9" index="0"]
FieldState = 3
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField9" index="1"]
visible = true
metadata/SaveID = "9919b294-04a1-4a16-9783-38c8aa0e291c"
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField9/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 1
_field = NodePath("../..")
[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField9" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField9/FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_4pibb")
[node name="Blocker" type="Node2D" parent="YSorted"]
[node name="BackToFarm" parent="YSorted/Blocker" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("31_xcb8u")]
[node name="BackToFarm" parent="YSorted/Blocker" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("31_xcb8u")]
position = Vector2(3774, 2025)
_spriteToOutline = NodePath("Fence Door2")
_spritesToOutline = [NodePath("Fence Door2")]
_id = 0
[node name="CollisionShape3D" parent="YSorted/Blocker/BackToFarm/Area2D" index="0"]
position = Vector2(-37, -208)
shape = SubResource("CircleShape2D_dr6bm")
[node name="Fence Door2" type="Sprite2D" parent="YSorted/Blocker/BackToFarm"]
@@ -1848,6 +1972,18 @@ position = Vector2(14423, 5123)
scale = Vector2(1.89667, 1)
texture = ExtResource("23_s4721")
[node name="RakeGenericPickup" parent="YSorted" instance=ExtResource("43_dr6bm")]
position = Vector2(6401, 2602)
[node name="SpawnWithItem" parent="YSorted/RakeGenericPickup" index="0"]
_blueprint = ExtResource("28_le48k")
[node name="PickupInteractionArea" parent="YSorted/RakeGenericPickup" index="3"]
_id = 0
[node name="CollisionShape3D" parent="YSorted/RakeGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_hpgl7")
[node name="CanvasLayer" parent="." instance=ExtResource("52_gwhnv")]
[node name="Inventory" parent="CanvasLayer" index="1"]
@@ -1910,25 +2046,48 @@ max_distance = 20000000.0
playback_type = 2
script = ExtResource("58_m3hs4")
[node name="SceneNameSetter" type="Node" parent="."]
script = ExtResource("56_34r5t")
_variableResource = ExtResource("57_hpgl7")
_payloadToSet = "beetRootScene"
[node name="SaveSystem" type="Node" parent="."]
[node name="SaveGameCheat" type="Node" parent="SaveSystem"]
script = ExtResource("58_qavgq")
[node name="SaveIDProvider" type="Node" parent="SaveSystem"]
script = ExtResource("59_njxly")
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="WateringField" from="YSorted/Vesna/FarmingControls" to="Audio/SFX/Watering SFX" method="PlayOneShot"]
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[connection signal="FieldCreated" from="YSorted/Farm visuals/FieldParent" to="Audio/SFX/Farming SFX" method="PlayOneShot"]
[connection signal="InteractedTool" from="YSorted/Blocker/BackToFarm" to="." method="LoadSceneAtIndex"]
[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"]
[editable path="YSorted/Vesna"]
[editable path="YSorted/Vesna/GenericItemOnGround"]
[editable path="YSorted/Vesna/GenericItemOnGround/PickupInteractionArea"]
[editable path="YSorted/Brünnen/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField2"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField2/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField3"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField3/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField4"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField4/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField5"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField5/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField6"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField6/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField7"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField7/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField8"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField8/FieldActivator/InteractionArea"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField9"]
[editable path="YSorted/Farm visuals/FieldParent/BaseField9/FieldActivator/InteractionArea"]
[editable path="YSorted/Blocker/BackToFarm"]
[editable path="YSorted/RakeGenericPickup"]
[editable path="YSorted/RakeGenericPickup/PickupInteractionArea"]
[editable path="CanvasLayer"]
+1 -1
View File
@@ -6,7 +6,7 @@
[node name="BabushkaSceneStartMenu" type="Node2D"]
script = ExtResource("1_fj2fh")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_disclaimer.tscn")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_farm_outside_2d.tscn")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
@@ -8,7 +8,6 @@ namespace Babushka.scripts.CSharp.Common.Animation;
public partial class VesnaAnimations : Node
{
[Export] private AnimatedSprite2D _sprite;
[Export] private CpuParticles2D _wateringParticles;
private bool anyActionPressed;
private string _toolString;
@@ -144,7 +143,6 @@ public partial class VesnaAnimations : Node
_sprite.Animation = "diagonal wateringcan";
_sprite.Play();
InputService.Instance.InputEnabled = false;
_wateringParticles.Emitting = true;
Task.Run(DelayedInputHandlerReset);
}
}
@@ -152,7 +150,6 @@ public partial class VesnaAnimations : Node
private async Task DelayedInputHandlerReset()
{
await Task.Delay(1000);
_wateringParticles.Emitting = false;
InputService.Instance.InputEnabled = true;
}
@@ -1,4 +1,3 @@
using System;
using System.Linq;
using Babushka.scripts.CSharp.Common.Services;
using Godot;
@@ -7,12 +6,12 @@ namespace Babushka.scripts.CSharp.Common.CharacterControls;
public partial class InteractionArea2D : Node2D
{
[ExportGroup("Settings")]
[Export] private Area2D _area;
[Export] private Label _label;
[Export] private bool _active = true;
[Export] private bool _useOutline = true;
[Export] private ShaderMaterial _outlineMaterial;
[Export] private CanvasItem? _spriteToOutline; // keep to not break old usages. TODO: remove later
[Export] private CanvasItem[] _spritesToOutline = [];
[Export] private bool _showLabel = true;
[Export] private int _id = -1; // TODO: remove
@@ -38,25 +37,10 @@ public partial class InteractionArea2D : Node2D
{
if (_useOutline)
{
try
{
// support old implementations of the script. If the sprite to outline is set, add it to the array
if (_spriteToOutline != null)
{
Array.Resize(ref _spritesToOutline, _spritesToOutline.Length + 1);
_spritesToOutline[^1] = _spriteToOutline;
}
_backupMaterials = _spritesToOutline.Select(s => s.Material).ToArray();
}
catch (Exception exception)
{
GD.PrintErr($"No sprite to outline found on: {GetParent().Name}" + exception.Message);
}
_backupMaterials = _spritesToOutline.Select(s => s.Material).ToArray();
}
}
public void OnPlayerEntered(Node2D player)
{
if (!_active || !InputService.Instance.InputEnabled)
@@ -76,9 +60,6 @@ public partial class InteractionArea2D : Node2D
public void OnPlayerExited(Node2D player)
{
if (!_active)
return;
_label.Hide();
if (!_useOutline)
@@ -121,15 +102,18 @@ public partial class InteractionArea2D : Node2D
sprite.Material = _backupMaterials[i];
}
}
EmitSignal(SignalName.InteractedTool, _id);
EmitSignal(SignalName.Interacted);
Interact();
}
}
private void Interact()
{
EmitSignal(SignalName.InteractedTool, _id);
EmitSignal(SignalName.Interacted);
}
public void SetSpriteActiveState(bool success, int id) // TODO: remove
{
GD.PrintErr("SetSpriteActiveState is being called.");
if (!_active)
return;
}
@@ -139,4 +123,5 @@ public partial class InteractionArea2D : Node2D
_active = !_active;
_label.Hide();
}
}
@@ -1,3 +1,5 @@
using System;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
using Godot.Collections;
@@ -6,19 +8,17 @@ namespace Babushka.scripts.CSharp.Common.Farming;
[GlobalClass]
public partial class FarmingControls2D : Node2D
{
[Export] private PackedScene _fieldPrefab;
[Export] private VariableResource _sceneKeyProvider;
[Export] private Node2D _movingPlayer;
[Export] private Camera2D _camera;
[Export] private CpuParticles2D _wateringParticles;
[Export] private float _wateringCanParticlesVerticalOffset = 50f;
public FieldService2D FieldService;
[Export] private float _wateringCanParticlesVerticalOffset = 50f;
[Export] private Vector2I _fieldOffsetVector = new Vector2I(735, 651);
[Export] private Node2D _fieldParent;
private int _toolId = -1;
private bool _wateringCanFilled = false;
[Signal] public delegate void WateringFieldEventHandler();
#region Tools
@@ -49,59 +49,19 @@ public partial class FarmingControls2D : Node2D
}
#endregion
public override void _Input(InputEvent @event)
{
if (@event.IsActionPressed("click")
&& _toolId == WateringCanState.WATERING_CAN_ID
&& WateringCanState.GetFillState() > 0)
{
Vector2I adjustedPosition = GetAdjustedMousePosition();
WaterTheField(adjustedPosition);
}
}
private Vector2I GetAdjustedMousePosition()
{
Vector2 mousePosition = _camera.GetGlobalMousePosition();
Vector2I mousePositionInteger = (Vector2I) mousePosition;
Vector2I adjustedPosition = AdjustValue(mousePositionInteger, new Vector2I(735, 651));
Vector2I adjustedPosition = AdjustValue(mousePositionInteger, _fieldOffsetVector);
return adjustedPosition;
}
/// <summary>
/// Called by the allowed farming area collision area 2d.
/// </summary>
/// <param name="node"></param>
/// <param name="inputEvent"></param>
/// <param name="shapeIndex"></param>
public void InputEventPressedOn(Node node, InputEvent inputEvent, int shapeIndex)
private Vector2I AdjustValue(Vector2I input, Vector2I step)
{
if (!inputEvent.IsPressed())
{
return;
}
if (!inputEvent.IsActionPressed("click"))
return;
if (inputEvent is InputEventMouseButton inputEventMouseButton)
{
if (!inputEventMouseButton.Pressed)
{
return;
}
}
else
{
return;
}
if (_toolId == 0)
{
Vector2I adjustedPosition = GetAdjustedMousePosition();
MakeField(adjustedPosition);
}
return input.Snapped(step);
}
#region WATERING
@@ -112,57 +72,7 @@ public partial class FarmingControls2D : Node2D
WateringCanState.Fill();
}
}
private void WaterTheField(Vector2I fieldPosition)
{
FieldBehaviour2D field = FieldService.Get(fieldPosition);
if (field == null || field.FieldState == FieldState.Watered)
return;
field.Water();
_wateringParticles.GlobalPosition = new Vector2(field.GlobalPosition.X, field.GlobalPosition.Y + _wateringCanParticlesVerticalOffset);
WateringCanState.Water();
EmitSignal(SignalName.WateringField);
}
#endregion
#region FIELD CREATION
private void MakeField(Vector2I fieldPosition)
{
if(FieldService == null || _fieldPrefab == null)
return;
// only instantiate a field if there isn't one already.
if(FieldService.Get(fieldPosition) == null)
{
Node fieldInstance = _fieldPrefab.Instantiate();
if (fieldInstance is Node2D field2d)
{
// add dictionary entry for the field
Array<Node> fields = field2d.FindChildren("*", nameof(FieldBehaviour2D));
if (fields.Count > 0)
FieldService.TryAddEntry(fieldPosition, fields[0] as FieldBehaviour2D);
// reposition and reparent the instance
field2d.Position = new Vector2(fieldPosition.X, fieldPosition.Y);;
FieldService.AddChild(fieldInstance);
}
}
}
private int AdjustValue(float value)
{
float adjustedValue = value / 500;
adjustedValue = Mathf.RoundToInt(adjustedValue);
adjustedValue *= 500;
return (int)adjustedValue;
}
private Vector2I AdjustValue(Vector2I input, Vector2I step)
{
return input.Snapped(step);
}
#endregion
}
@@ -0,0 +1,54 @@
using Babushka.scripts.CSharp.Common.CharacterControls;
using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
/// <summary>
/// Enables a preset field in the scene sothat it can be used for farming.
/// </summary>
public partial class FieldActivator : Node
{
[Export] private FieldBehaviour2D _field;
[Export] private InteractionArea2D _activatorArea;
private bool _used = false;
private bool _rakeInHand;
[Signal] public delegate void FieldCreatedEventHandler();
public override void _Ready()
{
ToggleInteractionArea();
}
/// <summary>
/// Activates the fieldbehaviour node and sets it to the tilled state.
/// </summary>
public void ActivateField()
{
if (!_used && _rakeInHand)
{
_field.Visible = true;
_field.UpdateFieldState(FieldState.Tilled);
EmitSignal(SignalName.FieldCreated, _field);
_used = true;
}
}
/// <summary>
/// Reacts to changes in the inventory.
/// If setup correctly, the field activator interactable should only trigger when using the rake.
/// </summary>
/// <param name="activated"></param>
public void RakeActivated(bool activated)
{
_rakeInHand = activated;
ToggleInteractionArea();
}
private void ToggleInteractionArea()
{
_activatorArea.IsActive = !_used && _rakeInHand;
}
}
@@ -0,0 +1 @@
uid://dlbjjgbs0n4b0
+170 -23
View File
@@ -1,31 +1,86 @@
using System;
using Babushka.scripts.CSharp.Common.CharacterControls;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Common.Savegame;
using Babushka.scripts.CSharp.Low_Code.Events;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Farming;
/// <summary>
/// Defines the behaviour of the field, i.e. interactions, states and effects.
/// </summary>
[GlobalClass]
public partial class FieldBehaviour2D : Sprite2D
public partial class FieldBehaviour2D : Sprite2D, ISaveable
{
[ExportGroup("Persistence")]
[Export] private VariableNode _fieldIndex;
[Export] private Node _saveIdHolder;
[Export] public VariableResource _sceneKeyProvider;
[Export] public FieldState FieldState = FieldState.Tilled;
[ExportGroup("Field Visuals")]
[Export] private Sprite2D _fieldSprite;
[Export] private Sprite2D _maskSprite;
[Export] private Sprite2D _outlineSprite;
[Export] private Texture2D[] _maskOutlineTextures;
[Export] private Texture2D[] _maskTexture;
[Export] private Texture2D Tilled;
[Export] private Texture2D Watered;
[Export] public FieldState FieldState = FieldState.Tilled;
[ExportGroup("Field Interactions")]
[Export] public InteractionArea2D PlantingInteraction;
[Export] public InteractionArea2D FieldInteractionArea;
[ExportGroup("Configuration")]
[Export] public Node2D PlantingPlaceholder;
[Export] public ItemRepository ItemRepository;
[Export] private CpuParticles2D _wateringParticles;
[Export] private EventResource _wateringEvent;
private bool _seedsActive;
private bool _wateringCanActive;
public Vector2 FieldPosition;
private bool _canPlant;
private bool _canWater;
private PlantBehaviour2D? _currentPlant;
[Signal] public delegate void PlantedEventHandler();
private void UpdateInteractionArea()
{
// fieldstate == tilled / watered && samen im Inventar
_canPlant = (FieldState == FieldState.Tilled || FieldState == FieldState.Watered) && _seedsActive;
// fieldstate == tilled && watering can ausgewählt
_canWater = (FieldState == FieldState.Tilled || FieldState == FieldState.Planted) && _wateringCanActive;
FieldInteractionArea.IsActive = _canPlant || _canWater;
}
public void ActivatedSeedInInventory(bool activated)
{
_seedsActive = activated;
UpdateInteractionArea();
}
public void ActivateWateringCanInInventory(bool activated)
{
_wateringCanActive = activated;
UpdateInteractionArea();
}
public override void _Ready()
{
LoadFromSaveData();
if(PlantingPlaceholder.GetChildCount() > 0)
_currentPlant = PlantingPlaceholder.GetChild<PlantBehaviour2D>(0);
UpdateFieldState(FieldState);
int randomIndex = new Random().Next(0, _maskTexture.Length);
_maskSprite.Texture = _maskTexture[randomIndex];
_outlineSprite.Texture = _maskOutlineTextures[randomIndex];
base._Ready();
}
@@ -56,22 +111,36 @@ public partial class FieldBehaviour2D : Sprite2D
FieldState = FieldState.NotFound;
break;
}
UpdateInteractionArea();
UpdateSaveData();
}
public void Water()
{
UpdateFieldState(FieldState.Watered);
if (WateringCanState.GetFillState() > 0)
{
UpdateFieldState(FieldState.Watered);
_wateringParticles.Emitting = true;
WateringCanState.Water();
_wateringEvent.Raise();
}
}
/// <summary>
/// Called when the player enters the field's interaction area and presses <E>.
/// Called when the player enters the field's interaction area and presses <E> or clicks.
/// </summary>
public void Farm()
{
if (TryPlant())
if (_canPlant && TryPlant())
{
EmitSignal(SignalName.Planted);
UpdateFieldState(FieldState.Planted);
}
if (_canWater)
{
UpdateFieldState(FieldState.Planted);
Water();
}
}
@@ -80,30 +149,108 @@ public partial class FieldBehaviour2D : Sprite2D
bool success = false;
int currentSlotIndex = InventoryManager.Instance.CurrentSelectedSlotIndex;
ItemInstance? item = InventoryManager.Instance.playerInventory.Slots[currentSlotIndex].itemInstance;
if (item == null || PlantingPlaceholder.GetChildCount() > 0 || item.amount == 0)
return success;
string prefabPath = ItemRepository.TryGetPrefabPath(item.blueprint);
string plantPrefabPath = ItemRepository.TryGetPrefabPath(item.blueprint);
if (prefabPath != null)
if (!string.IsNullOrEmpty(plantPrefabPath))
{
PackedScene prefab = ResourceLoader.Load<PackedScene>(prefabPath, nameof(PackedScene));
Node2D plant2d = prefab.Instantiate<Node2D>();
PlantingPlaceholder.AddChild(plant2d);
plant2d.GlobalPosition = PlantingPlaceholder.GlobalPosition;
PlantBehaviour2D? plantBehaviour = plant2d as PlantBehaviour2D;
if (plantBehaviour != null)
{
plantBehaviour.Field = this;
}
PlantPrefab(plantPrefabPath);
InventoryManager.Instance.playerInventory.RemoveItem(currentSlotIndex);
success = true;
}
return success;
}
}
private void PlantPrefab(string prefabPath)
{
PackedScene prefab = ResourceLoader.Load<PackedScene>(prefabPath, nameof(PackedScene));
Node2D plant2d = prefab.Instantiate<Node2D>();
PlantingPlaceholder.AddChild(plant2d);
plant2d.GlobalPosition = PlantingPlaceholder.GlobalPosition;
_currentPlant = plant2d as PlantBehaviour2D;
if (_currentPlant != null)
{
_currentPlant.Field = this;
}
}
#region SAVE AND LOAD
public void UpdateSaveData()
{
var payloadData = new Dictionary<string, Variant>
{
{ "field_state", (int)FieldState }
};
if (_currentPlant != null)
{
payloadData.Add(
"plant_data", new Dictionary<string, Variant>()
{
{ "prefab_path", _currentPlant.PrefabPath },
{ "plant_state", (int)_currentPlant.State },
{ "plant_days_growing", _currentPlant.DaysGrowing }
}
);
}
string id = _saveIdHolder.GetMeta("SaveID").AsString();
SavegameService.AppendDataToSave(id, payloadData);
}
public void LoadFromSaveData()
{
string id = _saveIdHolder.GetMeta("SaveID").AsString();
Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
if (save.Count > 0)
{
if (save.TryGetValue("field_state", out Variant fieldStateVar))
{
int fieldStateInt = fieldStateVar.AsInt32();
FieldState = (FieldState) fieldStateInt;
if (fieldStateInt != 0)
{
Visible = true;
UpdateFieldState(FieldState);
}
}
if (save.TryGetValue("plant_data", out Variant plantDataVar))
{
Dictionary<string, Variant> plantDataDict = plantDataVar.AsGodotDictionary<string, Variant>();
if (plantDataDict.TryGetValue("prefab_path", out Variant prefabPathVar))
{
PlantPrefab(prefabPathVar.AsString());
}
else
{
return;
}
if (plantDataDict.TryGetValue("plant_state", out Variant plantStateVar) && _currentPlant != null)
{
_currentPlant.State = (PlantState) plantStateVar.AsInt32();
_currentPlant.GrowPlant();
}
if (plantDataDict.TryGetValue("plant_days_growing", out Variant plantDaysGrowingVar) && _currentPlant != null)
{
_currentPlant.DaysGrowing = plantDaysGrowingVar.AsInt32();
}
}
}
}
#endregion
}
@@ -1,17 +1,15 @@
using System;
using Babushka.scripts.CSharp.Common.Animation;
using Babushka.scripts.CSharp.Common.Inventory;
using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
/// <summary>
/// Determines the behaviour of a plant in Babushka.
/// </summary>
public partial class PlantBehaviour2D : Node2D
{
[Export] private string _prefabPath;
[Export] private Sprite2D[] _seeds;
[Export] private Sprite2D[] _smallPlants;
[Export] private Sprite2D[] _bigPlants;
@@ -23,8 +21,19 @@ public partial class PlantBehaviour2D : Node2D
[Export] private bool _magicWordNeeded = true;
private string _magicWordDialogicEventName = "MagicWord";
private Sprite2D _currentPlantSprite = null;
private Sprite2D? _currentPlantSprite = null;
private bool _magicWordSaid = false;
private bool _calledOnReady = false;
public PlantState State
{
get => _state;
set => _state = value;
}
public int DaysGrowing { get; set; }
public string PrefabPath => _prefabPath;
/// <summary>
/// public accessor for the field reference
@@ -39,20 +48,19 @@ public partial class PlantBehaviour2D : Node2D
{
if (_state == PlantState.None)
{
GetTree().CallGroup("PlantGrowing", VesnaAnimations.MethodName.PlayFarmingAnimation);
_state = PlantState.Planted;
_currentPlantSprite = GetRandomSprite(_seeds);
_currentPlantSprite.Visible = true;
}
else
{
_calledOnReady = true;
GrowPlant();
}
}
public void Grow()
{
GetTree().CallGroup("PlantGrowing", VesnaAnimations.MethodName.PlayFarmingAnimation);
GrowPlant();
}
@@ -62,8 +70,11 @@ public partial class PlantBehaviour2D : Node2D
/// </summary>
public void GrowPlant()
{
if (_field.FieldState != FieldState.Watered || _magicWordSaid != _magicWordNeeded)
return;
if (!_calledOnReady)
{
if (_field.FieldState != FieldState.Watered || _magicWordSaid != _magicWordNeeded)
return;
}
switch (_state)
{
@@ -107,6 +118,7 @@ public partial class PlantBehaviour2D : Node2D
_field.UpdateFieldState(FieldState.Tilled);
_magicWordSaid = false;
_calledOnReady = false;
}
private Sprite2D GetRandomSprite(Sprite2D[] sprites)
@@ -9,7 +9,6 @@ namespace Babushka.scripts.CSharp.Common.Farming;
public partial class VesnaBehaviour2D : Node
{
[ExportGroup("Farming")]
[Export] private FieldService2D _fieldParent;
[Export] private FarmingControls2D _farmingControls;
[Export] private PlayerMovement _player2d;
[Export] private VesnaAnimations _vesnaAnimations;
@@ -26,7 +25,6 @@ public partial class VesnaBehaviour2D : Node
public override void _Ready()
{
_farmingControls.FieldService = _fieldParent;
_inventoryManager = InventoryManager.Instance;
_inventoryInstance = _inventoryManager.playerInventory;
_inventoryManager.SlotIndexChanged += HandleInventorySelectedSlotIndexChanged;
@@ -60,6 +60,12 @@ public class AllyAttackAction : FighterAction
await currentFighterVisual.AnimatePosToTarget(targetFighterVisual);
_ = targetFighterVisual.AnimateHit();
foreach (var hit in minigameDetail.damageHits!)
{
targetFighterVisual.SpawnDamageIndicatorNumber(hit);
}
await currentFighterVisual.AnimatePosToBase();
}
}
@@ -4,7 +4,7 @@ using Babushka.scripts.CSharp.Common.Util;
namespace Babushka.scripts.CSharp.Common.Fight.Actions;
public class BlobAttackAction : FighterAction
public class BlobAttackAction(int damage = 3) : FighterAction
{
public override Variant<float, Func<bool>> GetAnimationEnd()
{
@@ -18,7 +18,7 @@ public class BlobAttackAction : FighterAction
public override void ExecuteAction()
{
FightWorld.Instance.allyFighters.vesnaFighter.AddHealth(-3);
FightWorld.Instance.allyFighters.vesnaFighter.AddHealth(-damage);
}
public override async Task AnimateAction(AllFightersVisual allFightersVisual)
@@ -31,6 +31,7 @@ public class BlobAttackAction : FighterAction
await currentFighterVisual.AnimatePosToTarget(targetFighterVisual);
_ = targetFighterVisual.AnimateHit();
targetFighterVisual.SpawnDamageIndicatorNumber(damage);
await currentFighterVisual.AnimatePosToBase();
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ public class AllyFighters
public FightWorld.Fighter vesnaFighter = new()
{
type = FightWorld.Fighter.Type.Vesna,
maxHealth = 20,
maxHealth = 60,
availableActions =
[
new AllyAttackAction()
@@ -11,6 +11,7 @@ public partial class FightSceneSwitcher : Node
[Export] private Node _sceneRoot = null!;
[Export] private string _fightRoomScenePath = null!;
[Export] private string _fightHappeningScene = null!;
[Export] private string _nightEndScene = null!;
private void LoadNext()
{
@@ -36,6 +37,12 @@ public partial class FightSceneSwitcher : Node
if (!FightWorld.Instance.currentRoom.paths.TryGetValue(pathIndex, out var nextRoom))
throw new Exception("Trying to go down a non-existent path");
if (nextRoom.specialRoom == FightWorld.Room.Special.EndOfNight)
{
ExitFightWorld();
return;
}
FightWorld.Instance.currentRoom = nextRoom;
LoadNext();
}
@@ -60,4 +67,10 @@ public partial class FightSceneSwitcher : Node
FightWorld.Instance.fightHappeningData = null;
LoadNext();
}
public void ExitFightWorld()
{
SceneTransitionThreaded.Instance.ChangeSceneToFile(_nightEndScene);
_ = UnloadAfterDelay();
}
}
+18 -6
View File
@@ -14,8 +14,14 @@ public partial class FightWorld : Node
public class Room
{
public enum Special
{
None,
EndOfNight
}
public required Dictionary<int, Room> paths;
public required List<FighterGroup> enemyGroups;
public Special specialRoom = Special.None;
}
public class FighterGroup
@@ -66,7 +72,6 @@ public partial class FightWorld : Node
public override void _EnterTree()
{
Instance = this;
MyEnterTree();
}
#endregion
@@ -76,7 +81,7 @@ public partial class FightWorld : Node
public FightHappeningData? fightHappeningData = null;
public AllyFighters allyFighters = new();
public void MyEnterTree()
public void ResetFightWorld()
{
Generate();
currentRoom = world!.rooms[0];
@@ -108,6 +113,13 @@ public partial class FightWorld : Node
{
rooms.Add(GenerateDisconnectedRoom());
}
rooms.Add(new Room
{
paths = [],
enemyGroups = [],
specialRoom = Room.Special.EndOfNight
});
// Connect rooms linearly
for (var i = 0; i < rooms.Count - 1; i++)
@@ -133,7 +145,7 @@ public partial class FightWorld : Node
{
var enemyGroups = new List<FighterGroup>();
var enemyGroupCount = GD.RandRange(1, 3);
var enemyGroupCount = GD.RandRange(1, 2);
for (var i = 0; i < enemyGroupCount; i++)
{
@@ -150,7 +162,7 @@ public partial class FightWorld : Node
fighters = []
};
var enemyCount = GD.RandRange(1, 3);
var enemyCount = GD.RandRange(2, 3);
for (var i = 0; i < enemyCount; i++)
{
@@ -178,10 +190,10 @@ public partial class FightWorld : Node
{
type = type,
health = null,
maxHealth = 12,
maxHealth = GD.RandRange(8, 20),
availableActions =
[
new BlobAttackAction()
new BlobAttackAction(GD.RandRange(2, 5))
]
};
@@ -0,0 +1,22 @@
using System;
using Godot;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class FighterDamageIndicatorFlyingNumber : Node2D
{
[Export] private Label _label;
public void Initialize(int number)
{
_label.Text = number.ToString();
var tween = CreateTween();
var xMovement = GD.RandRange(-150, 150);
var yMovement = GD.RandRange(-400, -250);
tween.Parallel().TweenProperty(this, "position:x", xMovement, .6);
tween.Parallel().TweenProperty(this, "position:y", yMovement, .6)
.SetEase(Tween.EaseType.Out).SetTrans(Tween.TransitionType.Quad);
tween.Chain().TweenCallback(Callable.From(QueueFree));
}
}
@@ -0,0 +1 @@
uid://b5i41b6502xam
@@ -0,0 +1,16 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class FighterDamageIndicatorVisual : Node2D
{
[Export] private PackedScene _flyingNumberPrefab;
public void SpawnFlyingNumber(int number)
{
var flyingNumberInstance = _flyingNumberPrefab.Instantiate<FighterDamageIndicatorFlyingNumber>();
AddChild(flyingNumberInstance);
flyingNumberInstance.Initialize(number);
}
}
@@ -0,0 +1 @@
uid://c250yp2mdq83e
+10 -2
View File
@@ -19,7 +19,11 @@ public partial class FighterVisual : Node2D
[ExportCategory("References")]
[Export] private Node2D _visualParent = null!;
[Export] private Node2D _targetSelectionParent = null!;
[Export] private Node2D _squashParent = null!;
[Export] public FighterHealthBarVisual healthBarVisual = null!;
[Export] private FighterDamageIndicatorVisual _fighterDamageIndicatorVisual;
private FightWorld.Fighter _boundFighter;
@@ -75,8 +79,8 @@ public partial class FighterVisual : Node2D
public async Task AnimateHit()
{
var tween = GetTree().CreateTween();
tween.TweenProperty(this, "scale", new Vector2(1.4f, 0.6f), 0.15);
tween.TweenProperty(this, "scale", new Vector2(1, 1), 0.4)
tween.TweenProperty(_squashParent, "scale", new Vector2(1.4f, 0.6f), 0.15);
tween.TweenProperty(_squashParent, "scale", new Vector2(1, 1), 0.4)
.SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
await ToSignal(tween, "finished");
}
@@ -90,4 +94,8 @@ public partial class FighterVisual : Node2D
// tween.TweenProperty(this, "scale", new Vector2(1, 1), 0.4)
// .SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
//}
public void SpawnDamageIndicatorNumber(int number)
{
_fighterDamageIndicatorVisual.SpawnFlyingNumber(number);
}
}
@@ -0,0 +1,16 @@
using Godot;
using System;
using Babushka.scripts.CSharp.Common.Fight;
public partial class NightStarter : Node
{
[Export] private int _sceneIndexToLoad;
[Signal] public delegate void LoadSceneEventHandler(int index);
public void StartNight()
{
FightWorld.Instance.ResetFightWorld();
EmitSignalLoadScene(_sceneIndexToLoad);
}
}
@@ -0,0 +1 @@
uid://puw74w6lmcvl
@@ -3,10 +3,11 @@ using System;
using Godot;
using System.Collections.Generic;
using System.Linq;
using Babushka.scripts.CSharp.Common.Savegame;
namespace Babushka.scripts.CSharp.Common.Inventory;
public partial class InventoryInstance : Node
public partial class InventoryInstance : Node, ISaveable
{
private List<InventorySlot> _slots = new();
public IReadOnlyList<InventorySlot> Slots => _slots;
@@ -16,6 +17,8 @@ public partial class InventoryInstance : Node
[Signal]
public delegate void InventoryContentsChangedEventHandler();
public static string ID = "inventoryInstance";
/// <summary>
/// The total amount of Inventoryslots in the inventory (empty and occupied).
@@ -42,6 +45,19 @@ public partial class InventoryInstance : Node
}
}
public override void _EnterTree()
{
LoadFromSaveData();
InventoryContentsChanged += UpdateSaveData;
SlotAmountChanged += UpdateSaveData;
}
public override void _ExitTree()
{
InventoryContentsChanged -= UpdateSaveData;
SlotAmountChanged -= UpdateSaveData;
}
public InventoryActionResult AddItem(ItemInstance newItem)
{
var result = AddItemAndStackRecursive(newItem, 0);
@@ -156,4 +172,49 @@ public partial class InventoryInstance : Node
{
return items.All(HasItems);
}
#region SAVE AND LOAD
public void UpdateSaveData()
{
var payloadData = new Godot.Collections.Dictionary<string, Variant>();
for (int i = 0; i < _slots.Count; i++)
{
if (!_slots[i].IsEmpty())
{
string key = i.ToString();
string[] value = new string[2];
value[0] = _slots[i].itemInstance.blueprint.ResourcePath;
value[1] = _slots[i].itemInstance.amount.ToString();
payloadData.Add(key,value);
}
}
SavegameService.AppendDataToSave(ID, payloadData);
}
public void LoadFromSaveData()
{
var id = ID;
Godot.Collections.Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
if (save.Count > 0)
{
for (int i = 0; i < _slots.Count; i++)
{
if (save.TryGetValue(i.ToString(), out Variant inventoryItemData))
{
string[] savePayload = inventoryItemData.AsStringArray();
ItemResource resource = ResourceLoader.Load<ItemResource>(savePayload[0]);
int _amount = int.Parse(savePayload[1]);
ItemInstance instance = new ItemInstance { blueprint = resource, amount = _amount };
AddItem(instance);
}
}
}
}
#endregion
}
@@ -0,0 +1,48 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Inventory;
public partial class InventoryListener : Node
{
[Export] private ItemResource[] _itemResourcesToListenFor;
[Signal] public delegate void ItemInstanceActivatedEventHandler(bool activated);
public override void _Ready()
{
InventoryManager.Instance.playerInventory.InventoryContentsChanged += HandleNewItemInInventory;
InventoryManager.Instance.SlotIndexChanged += HandleNewItemInInventory;
}
public override void _ExitTree()
{
InventoryManager.Instance.playerInventory.InventoryContentsChanged -= HandleNewItemInInventory;
InventoryManager.Instance.SlotIndexChanged -= HandleNewItemInInventory;
}
private void HandleNewItemInInventory(int newIndex)
{
HandleNewItemInInventory();
}
private void HandleNewItemInInventory()
{
int currentSlotIndex = InventoryManager.Instance.CurrentSelectedSlotIndex;
ItemInstance? instance = InventoryManager.Instance.playerInventory.Slots[currentSlotIndex].itemInstance;
if (instance != null)
{
ItemResource? item = instance.blueprint;
foreach (var res in _itemResourcesToListenFor)
{
if (item == res)
{
EmitSignal(SignalName.ItemInstanceActivated, true);
return;
}
}
}
EmitSignal(SignalName.ItemInstanceActivated, false);
}
}
@@ -0,0 +1 @@
uid://3t0af586fimq
@@ -23,7 +23,7 @@ public partial class InventoryManager : Node
}
}
public InventoryInstance playerInventory = new InventoryInstance();
public InventoryInstance? playerInventory;
private int _currentSelectedSlotIndex = 0;
@@ -34,7 +34,9 @@ public partial class InventoryManager : Node
public override void _Ready()
{
playerInventory = new InventoryInstance();
playerInventory.SlotAmount = 37;
AddChild(playerInventory);
}
public InventoryActionResult CreateItem(
@@ -18,7 +18,6 @@ public partial class InventoryUi : Control
public override void _Ready()
{
GD.Print("Ready inventory ui");
_playerInventory = InventoryManager.Instance.playerInventory;
//PopulateSlots();
SubscribeSlots();
@@ -1,8 +1,10 @@
using Babushka.scripts.CSharp.Common.Savegame;
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Inventory;
public partial class ItemOnGround2D : Node
public partial class ItemOnGround2D : Node, ISaveable
{
private ItemInstance _itemInstance;
@@ -30,6 +32,7 @@ public partial class ItemOnGround2D : Node
public override void _Ready()
{
LoadFromSaveData();
UpdateVisuals();
_pickupErrorLabel.Text = "";
}
@@ -43,24 +46,36 @@ public partial class ItemOnGround2D : Node
EmitSignal(SignalName.SuccessfulPickUp);
if (result == InventoryActionResult.Success)
{
if (!_infiniteSupply)
{
pickUpCounter++;
if (pickUpCounter >= _finiteSupply)
{
QueueFree();
}
}
Pickup();
}
else
{
_pickupErrorLabel.Text = "Inventory Full";
var tween = GetTree().CreateTween();
tween.TweenInterval(2);
tween.TweenCallback(Callable.From(() => _pickupErrorLabel.Text = ""));
FailToPickup();
}
}
private void Pickup()
{
if (!_infiniteSupply)
{
pickUpCounter++;
if (pickUpCounter >= _finiteSupply)
{
QueueFree();
}
UpdateSaveData();
}
}
private void FailToPickup()
{
_pickupErrorLabel.Text = "Inventory Full";
var tween = GetTree().CreateTween();
tween.TweenInterval(2);
tween.TweenCallback(Callable.From(() => _pickupErrorLabel.Text = ""));
}
public void UpdateVisuals()
{
if (!IsActive)
@@ -76,4 +91,62 @@ public partial class ItemOnGround2D : Node
_itemLabel.Text = "";
}
}
public void UpdateSaveData()
{
var payloadData = new Dictionary<string, Variant>
{
{"pickupCounter", pickUpCounter}
};
string id = GetMeta("SaveID").AsString();
SavegameService.AppendDataToSave( id, payloadData);
}
public void LoadFromSaveData()
{
if (_infiniteSupply)
return;
// standard check: how many times has this item been collected?
string id = GetMeta("SaveID").AsString();
Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
if (save.Count > 0)
{
if(save.TryGetValue("pickupCounter", out Variant countVar))
{
int count = countVar.AsInt32();
for (int i = 0; i < count; i++)
{
Pickup();
}
}
}
//separate check for unique items: If already in inventory, delete this instance.
ItemResource itemResource = itemInstance.blueprint;
Dictionary<string, Variant> savegameData = SavegameService.GetSaveData(InventoryInstance.ID);
if (savegameData.Count > 0)
{
foreach (var kvp in savegameData)
{
// if it's a unique item, then it can only exist once in the world (either as a pickup OR in the inventory)
if (itemInstance.blueprint.isUnique)
{
//comparing resource path to identify the item
string[] valuePair = kvp.Value.AsStringArray();
if (valuePair[0] == itemResource.ResourcePath)
{
int amountInInventory = int.Parse(valuePair[1]);
// comparing amount to see if it's all in the inventory now.
if (amountInInventory > 0)
{
Pickup();
}
}
}
}
}
}
}
@@ -17,6 +17,9 @@ public partial class ItemResource : Resource
[Export]
public int maxStack;
[Export]
public bool isUnique;
public ItemResource()
{
name = "";
@@ -1,13 +0,0 @@
using Babushka.scripts.CSharp.Common.Animation;
using Godot;
namespace Babushka.scripts.CSharp.Common.Items;
public partial class NonInventoryPickup : Node2D
{
public void PlayPickupAnimation()
{
// todo: replace with EventBus implementation as soon as this is possible
GetTree().CallGroup("Pickup", VesnaAnimations.MethodName.PlayPickUpAnimation);
}
}
@@ -1 +0,0 @@
uid://dkk1vjijvgrd7
@@ -12,8 +12,6 @@ public partial class QuestTrigger : Node
public void Trigger()
{
GD.Print("trigger");
if (questResource == null)
throw new Exception("QuestResource is not set on QuestTrigger node.");
@@ -0,0 +1,19 @@
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// Defines the behaviour of Nodes that have fields that should save / load to disk.
/// When implementing new Saveable objects, please beware: Please check if object instances need to be identified separately.
/// If so, make sure to give them a proper ID. You can use the <see cref="SaveIDProvider"/> tool for that.
/// </summary>
public interface ISaveable
{
/// <summary>
/// Adds or updates the field data that shall be stored to disk.
/// </summary>
public void UpdateSaveData();
/// <summary>
/// Loads the field data from disk.
/// </summary>
public void LoadFromSaveData();
}
@@ -0,0 +1 @@
uid://bqapxuprxuj20
@@ -0,0 +1,15 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Savegame;
[Tool]
public partial class SaveCheats : Node
{
[ExportToolButton("ResetSave")] Callable _raiseAction => Callable.From(Reset);
public void Reset()
{
SavegameService.Reset();
}
}
@@ -0,0 +1 @@
uid://iquhbkr7pqeg
@@ -0,0 +1,28 @@
using System;
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// Central structure for SaveData entries.
/// SceneName and ID are later combined and used as keys for the save system.
/// </summary>
[Serializable]
public class SaveData
{
// for future use in case the structure changes.
public const int VERSION = 1;
public int version { get; set; } = VERSION;
public bool IsVersionValid()
{
return VERSION == version;
}
public string Id;
public string JsonPayload;
public string ToString()
{
return Id + " " + JsonPayload;
}
}
@@ -0,0 +1 @@
uid://bkftl5mj33eah
@@ -0,0 +1,22 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// This class manages the loading of the savegame throughout the gameplay flow.
/// </summary>
public partial class SaveGameManager : Node
{
public static string USER_DATA_FILE_PATH = "user://save_data/userData.json";
public static SaveGameManager? Instance { get; private set; } = null!;
public override void _EnterTree()
{
Instance = this;
USER_DATA_FILE_PATH = ProjectSettings.GlobalizePath(USER_DATA_FILE_PATH);
SavegameService.SavePath = USER_DATA_FILE_PATH;
SavegameService.Load();
}
}
@@ -0,0 +1 @@
uid://c1srnefvhigef
@@ -0,0 +1,34 @@
using System;
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// And editor tool that lives in the scene scope and iterates over saveable nodes and assigns them unique IDs where necessary.
/// It only works if the object (prefab) in question has been added to the "Saveable"-group beforehand.
/// </summary>
[Tool]
public partial class SaveIDProviderTool : Node
{
/// <summary>
/// Creates an inspector button that calls the AssignIDs method.
/// </summary>
[ExportToolButton("Assign IDs")] private Callable assignIDs => Callable.From(AssignIDs);
private void AssignIDs()
{
Array<Node> saveables = GetTree().GetNodesInGroup("Saveable");
foreach (var node in saveables)
{
GD.Print($"Checking {node.Name}.");
if (!node.HasMeta("SaveID") || string.IsNullOrEmpty(node.GetMeta("SaveID").AsString()))
{
string saveID = Guid.NewGuid().ToString();
node.SetMeta("SaveID", saveID);
GD.Print($"Setting Save ID for node {node.Name}: " + saveID);
}
}
}
}
@@ -0,0 +1 @@
uid://ca4s0algeij1h
@@ -0,0 +1,134 @@
using System;
using Godot;
using Godot.Collections;
using FileAccess = Godot.FileAccess;
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// Handles the saving and loading of game states.
/// Holds the central SaveData object that serves as a temporary SaveFile.
/// Automatically writes to disk on every scene change.
/// Uses the Godot Json Serializer, which may implicitly convert integers to floats, so be careful when extending!
/// </summary>
public static class SavegameService
{
public static string SavePath = "";
public static Dictionary<string, string> SaveDatas = new ();
public static bool _loaded = false;
public static void AppendDataToSave( string id, Dictionary<string, Variant> payload)
{
var saveData = new SaveData();
saveData.Id = id;
saveData.JsonPayload = Json.Stringify(payload, indent: "\t");
AppendSave(saveData);
}
/// <summary>
/// Adds or overwrites an entry in the SaveData dictionary.
/// </summary>
/// <param name="saveData"></param>
private static void AppendSave(SaveData saveData)
{
if (SaveDatas.TryGetValue(saveData.Id, out var value))
{
SaveDatas[saveData.Id] = saveData.JsonPayload;
}
else
{
SaveDatas.Add(saveData.Id, saveData.JsonPayload);
}
}
/// <summary>
/// Checks the SaveData dictionary for an entry and returns the jsondata as a string for it.
/// Requires the scenename and object ID for lookup.
/// </summary>
/// <param name="sceneName"></param>
/// <param name="id"></param>
/// <returns></returns>
public static Dictionary<string, Variant> GetSaveData(string id)
{
Dictionary<string, Variant> saveData = new();
string saveDataString = "";
if (!_loaded)
{
return saveData;
}
if (SaveDatas.ContainsKey(id))
{
saveDataString = SaveDatas[id];
saveData = Json.ParseString(saveDataString).AsGodotDictionary<string, Variant>();
}
return saveData;
}
/// <summary>
/// Writes the contents of the current SaveData dictionary to disk as a json file.
/// </summary>
public static void Save()
{
string json = Json.Stringify(SaveDatas, indent: "\t");
// create cloud directory
CreateSaveDirectory();
try
{
using var file = FileAccess.Open(SavePath, FileAccess.ModeFlags.Write);
file.StoreString(json);
}
catch (Exception e)
{
GD.Print(e.Message);
}
}
private static void CreateSaveDirectory()
{
System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(SavePath) ?? "");
}
/// <summary>
/// Loads the current savegame file from disk and parses it into the SaveData dictionary.
/// </summary>
public static void Load()
{
try
{
if (!System.IO.File.Exists(SavePath))
{
SaveDatas = new();
CreateSaveDirectory();
}
string saveDataJson = FileAccess.GetFileAsString(SavePath);
if(!string.IsNullOrEmpty(saveDataJson))
SaveDatas = Json.ParseString(saveDataJson).AsGodotDictionary<string, string>();
}
catch(Exception e)
{
GD.PrintRich(e.Message);
return;
}
_loaded = true;
}
public static void Reset()
{
SaveDatas = new ();
Save();
}
}
@@ -0,0 +1 @@
uid://rm23q50boqe5
@@ -0,0 +1,31 @@
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// Data structure for device-specific settings that should be saved / loaded to disk.
/// Will not be synced across devices.
/// </summary>
public class SettingsData
{
/// <summary>
/// To be incremented (and migrated) on modification.
/// </summary>
public const int VERSION = 1;
public int version { get; set; } = VERSION;
public bool IsVersionValid()
{
return VERSION == version;
}
public double runtimeSeconds { get; set; }
public int windowSizeX { get; set; } = 800;
public int windowSizeY { get; set; } = 600;
public int windowPositionX { get; set; } = 100;
public int windowPositionY { get; set; } = 100;
public bool windowBorderless { get; set; }
public float volumeMaster { get; set; } = 1.0f;
public float volumeFx { get; set; } = 1.0f;
public float volumeMusic { get; set; } = 1.0f;
}
@@ -0,0 +1 @@
uid://ol8xw1ekx0c2
@@ -0,0 +1,108 @@
using System;
using System.Text.Json;
using Godot;
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// Handles the saving and loading of local settings data.
/// </summary>
[GlobalClass]
public partial class SettingsSaveController : Node
{
public static string SETTINGS_FILE_PATH = "user://userSettings.json";
public static SettingsSaveController Instance;
public SettingsData? settings = new SettingsData();
public SettingsData settingsDefault = new SettingsData();
public event Action OnSettingsReloaded;
private bool _loadedData;
private DateTime _readyTime;
public bool LoadedData => _loadedData;
public override void _EnterTree()
{
SETTINGS_FILE_PATH = ProjectSettings.GlobalizePath(SETTINGS_FILE_PATH);
_readyTime = DateTime.Now;
Instance = this;
LoadSettings();
}
public override void _ExitTree()
{
if (settings != null)
settings.runtimeSeconds += (DateTime.Now - _readyTime).TotalSeconds;
SaveSettings();
Instance = null;
}
/// <summary>
/// Saves Settings Data onto disk.
/// </summary>
public void SaveSettings()
{
try
{
string jsonString = JsonSerializer.Serialize(
settings,
new JsonSerializerOptions() { WriteIndented = true}
);
System.IO.File.WriteAllText(SETTINGS_FILE_PATH, jsonString);
}
catch (Exception e)
{
GD.PrintErr("Error Saving Settings:", e);
Console.WriteLine(e);
}
}
/// <summary>
/// Loads Settings data from disk.
/// </summary>
public void LoadSettings()
{
_loadedData = false;
try
{
if (!System.IO.File.Exists(SETTINGS_FILE_PATH))
{
settings = new SettingsData();
}
else
{
string jsonString = System.IO.File.ReadAllText(SETTINGS_FILE_PATH);
SettingsData? loadedSettings = JsonSerializer.Deserialize<SettingsData>(jsonString);
if (loadedSettings != null && !loadedSettings.IsVersionValid())
{
_loadedData = false;
}
else
{
settings = loadedSettings;
_loadedData = true;
}
}
}
catch (Exception e)
{
GD.PrintErr("Loading Error:", e);
Console.WriteLine(e);
}
}
/// <summary>
/// Resets Settings to default.
/// </summary>
public void ResetSettings()
{
settings = JsonSerializer.Deserialize<SettingsData>(JsonSerializer.Serialize<SettingsData>(settingsDefault));
OnSettingsReloaded?.Invoke();
}
}
@@ -0,0 +1 @@
uid://cc7gnydmbcft7
@@ -0,0 +1,101 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Savegame;
/// <summary>
/// Tracks important window settings and communicates with the <see cref="SettingsSaveController"/> to save/load them.
/// </summary>
public partial class WindowSettingsSync : Node
{
private Window window;
public override void _Ready()
{
window = GetWindow();
window.SizeChanged += SaveWindowSize;
SyncSettings();
SettingsSaveController.Instance.OnSettingsReloaded += SyncSettings;
}
public override void _ExitTree()
{
SaveWindowPosition();
SaveWindowBorderless();
SaveWindowSize();
SettingsSaveController.Instance.SaveSettings();
}
/// <summary>
/// Tries to get previous settings from settings-savefile, if available.
/// </summary>
public void SyncSettings()
{
if (!SettingsSaveController.Instance.LoadedData)
{
SaveWindowPosition();
SaveWindowSize();
SaveWindowBorderless();
return;
}
SettingsData? settingsData = SettingsSaveController.Instance.settings;
if (settingsData != null)
{
window.Position = new Vector2I(settingsData.windowPositionX, settingsData.windowPositionY);
ValidateWindowPosition();
window.Size = new Vector2I(settingsData.windowSizeX, settingsData.windowSizeY);
window.Borderless = settingsData.windowBorderless;
}
}
private void ValidateWindowPosition()
{
bool validWindowPosition = false;
foreach (Rect2I displayRect in DisplayServer.GetDisplayCutouts())
{
if (displayRect.HasPoint(window.Position))
{
validWindowPosition = true;
break;
}
}
if (!validWindowPosition)
{
window.MoveToCenter();
SaveWindowPosition();
}
}
private void SaveWindowPosition()
{
SettingsData? settingsData = SettingsSaveController.Instance.settings;
if (settingsData != null)
{
settingsData.windowPositionX = window.Position.X;
settingsData.windowPositionY = window.Position.Y;
}
}
private void SaveWindowSize()
{
SettingsData? settingsData = SettingsSaveController.Instance.settings;
if (settingsData != null)
{
settingsData.windowSizeX = window.Size.X;
settingsData.windowSizeY = window.Size.Y;
}
}
private void SaveWindowBorderless()
{
SettingsData? settingsData = SettingsSaveController.Instance.settings;
if (settingsData != null)
settingsData.windowBorderless = window.Borderless;
}
}
@@ -0,0 +1 @@
uid://bbp0dyddwdbl8
+3
View File
@@ -1,3 +1,4 @@
using Babushka.scripts.CSharp.Common.Savegame;
using Babushka.scripts.CSharp.Common.SceneManagement;
using Godot;
@@ -16,6 +17,7 @@ public partial class SceneTransition : Node
public void LoadSceneAtIndex(int index)
{
SavegameService.Save();
string sceneName = _sceneNamesToLoad[index];
SceneTransitionThreaded.Instance.ChangeSceneToFileThreaded(sceneName);
UnloadAfterDelay();
@@ -32,6 +34,7 @@ public partial class SceneTransition : Node
public void Quit()
{
SettingsSaveController.Instance.SaveSettings();
GetTree().Quit();
}
+54 -2
View File
@@ -1,13 +1,17 @@
using System.Threading.Tasks;
using Babushka.scripts.CSharp.Common.Savegame;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Temp;
/// <summary>
/// Temporary Duck behaviour to make sure we can use them in the first showcase
/// </summary>
public partial class MVPDuck : Node2D
public partial class MVPDuck : Node2D, ISaveable
{
[ExportGroup("Animation")]
[Export] private Node2D _penTarget;
[Export] private int _transferDelayMs;
[Export] private AnimationPlayer _animationPlayer;
@@ -17,6 +21,11 @@ public partial class MVPDuck : Node2D
[Signal] public delegate void DuckCollectedEventHandler();
public override void _Ready()
{
LoadFromSaveData();
}
public void TransferToTargetAfterDelay()
{
if (!_collected)
@@ -25,7 +34,6 @@ public partial class MVPDuck : Node2D
PlayAnimation();
_collected = true;
}
}
private void PlayAnimation()
@@ -40,7 +48,51 @@ public partial class MVPDuck : Node2D
if(!_penTarget.Equals(null))
Position = _penTarget.GlobalPosition;
EmitSignal(SignalName.DuckCollected);
UpdateSaveData();
}
#region SAVE AND LOAD
/// <summary>
// Saves duck position.
/// </summary>
public void UpdateSaveData()
{
var payloadData = new Dictionary<string, Variant>
{
{ "globalPositionX", GlobalPosition.X },
{ "globalPositionY", GlobalPosition.Y },
};
string id = GetMeta("SaveID").AsString();
SavegameService.AppendDataToSave( id, payloadData);
}
/// <summary>
/// Loads duck position.
/// </summary>
public void LoadFromSaveData()
{
string id = GetMeta("SaveID").AsString();
Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
if (save.Count > 0)
{
float xPos = 0;
float yPos = 0;
if (save.TryGetValue("globalPositionX", out Variant xPosVar))
{
xPos = xPosVar.AsSingle();
}
if (save.TryGetValue("globalPositionY", out Variant yPosVar))
{
yPos = yPosVar.AsSingle();
}
GlobalPosition = new Vector2(xPos, yPos);
}
}
#endregion
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Godot;
namespace Babushka.scripts.CSharp.Common.Util;
@@ -23,4 +24,54 @@ public static class NodeExtension
}
throw new Exception($"Parent of type {typeof(T)} not found for node {self.Name}");
}
//acts like Unity's GetComponent<T> / GetComponentInChildren<T>
// only works with Godot's built-in types.
public static T GetChildByType<T>(this Node node, bool recursive = true)
where T : Node
{
int childCount = node.GetChildCount();
for (int i = 0; i < childCount; i++)
{
Node child = node.GetChild(i);
if (child is T childT)
return childT;
if (recursive && child.GetChildCount() > 0)
{
T recursiveResult = child.GetChildByType<T>(true);
if (recursiveResult != null)
return recursiveResult;
}
}
return null;
}
/// <summary>
/// Another reimplementation of Unity's GetComponent<T>.
/// Verified to work with all types, also derived ones, but only when used from within a scene and at runtime.
/// </summary>
/// <param name="node"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static T? GetComponent<T>(Node node)
{
if (node is T)
{
return (T)(object)node;
}
foreach (Node child in node.GetChildren())
{
if (child is T)
{
return (T)(object)child;
}
}
return (T)(object)null;
}
}
@@ -0,0 +1,11 @@
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
/// <summary>
/// A Node type that carries a Variant payload.
/// </summary>
public partial class VariableNode : Node
{
[Export] public Variant Payload { get; set; }
}
@@ -0,0 +1 @@
uid://j2mhvb45egej
@@ -0,0 +1,14 @@
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
public partial class VariableSetter : Node
{
[Export] private VariableResource _variableResource;
[Export] private Variant _payloadToSet;
public void Set()
{
_variableResource.Payload = _payloadToSet;
}
}

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