Compare commits

..

6 Commits

58 changed files with 353 additions and 852 deletions
-1
View File
@@ -17,7 +17,6 @@
<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.

Before

Width:  |  Height:  |  Size: 5.9 KiB

@@ -1,40 +0,0 @@
[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.

Before

Width:  |  Height:  |  Size: 6.7 KiB

@@ -1,40 +0,0 @@
[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.

Before

Width:  |  Height:  |  Size: 7.6 KiB

@@ -1,40 +0,0 @@
[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,8 +10,9 @@ script = ExtResource("1_cu47d")
_interactionArea = NodePath("InteractionArea")
_itemsToReactTo = Array[Object]([ExtResource("2_s5peo")])
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("3_wsetd")]
_spritesToOutline = [NodePath("../Sprite2D")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("3_wsetd")]
_active = false
_spriteToOutline = NodePath("../Sprite2D")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.5, 0.5)
+6 -10
View File
@@ -1,7 +1,8 @@
[gd_scene load_steps=17 format=3 uid="uid://sbf12hin4kes"]
[gd_scene load_steps=16 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"]
@@ -13,8 +14,6 @@
[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
@@ -36,10 +35,11 @@ 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("_spritesToOutline") instance=ExtResource("2_gcgfd")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("2_gcgfd")]
position = Vector2(0, -172)
_spritesToOutline = [NodePath("..")]
_spriteToOutline = NodePath("..")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
stream = SubResource("AudioStreamRandomizer_dich4")
@@ -47,10 +47,6 @@ 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"]
+5 -3
View File
@@ -1,8 +1,9 @@
[gd_scene load_steps=8 format=3 uid="uid://ddpl8cbck7e6s"]
[gd_scene load_steps=9 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"]
@@ -20,10 +21,11 @@ z_index = 1
y_sort_enabled = true
script = ExtResource("1_xix7p")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("2_udjjv")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("2_udjjv")]
position = Vector2(0, -450)
scale = Vector2(2.805, 2.805)
_spritesToOutline = [NodePath("../TalkingControl/Visual")]
_outlineMaterial = ExtResource("3_kd44q")
_spriteToOutline = NodePath("../TalkingControl/Visual")
[node name="CollisionShape3D" parent="InteractionArea/Area2D" index="0"]
position = Vector2(-4.99109, 63.4581)
+35 -26
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=485 format=3 uid="uid://c25udixd5m6l0"]
[gd_scene load_steps=482 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,19 +272,16 @@
[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"]
@@ -293,7 +290,6 @@
[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"]
@@ -480,6 +476,7 @@
[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"]
@@ -2106,10 +2103,11 @@ 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")]
[node name="visuals" type="Node2D" parent="CharacterBody2D" node_paths=PackedStringArray("_sprite", "_wateringParticles") groups=["Pickup", "PlantGrowing"]]
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)
@@ -2144,20 +2142,35 @@ scrollable = false
[node name="DetectionCross" parent="CharacterBody2D" instance=ExtResource("466_e04c3")]
position = Vector2(0, -200)
[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")]
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_movingPlayer", "_wateringParticles")]
script = ExtResource("817_6nrw3")
_sceneKeyProvider = ExtResource("471_83c4i")
_fieldPrefab = ExtResource("818_16w6h")
_movingPlayer = NodePath("../CharacterBody2D")
_wateringParticles = NodePath("../pouring water vfx")
_wateringCanParticlesVerticalOffset = -100.0
_fieldOffsetVector = Vector2i(735, 600)
[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
[node name="DialogicToggle" type="Node2D" parent="." node_paths=PackedStringArray("itemToToggle")]
scale = Vector2(0.7, 0.7)
@@ -2174,18 +2187,14 @@ 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="EventRaised" from="CharacterBody2D/PlantCreatedEventListener" to="CharacterBody2D/visuals" method="PlayFarmingAnimation"]
[connection signal="EventRaised" from="CharacterBody2D/PickedUpInteractableListener" to="CharacterBody2D/visuals" method="PlayPickUpAnimation"]
[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="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("_spritesToOutline") instance=ExtResource("42_ahrat")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("42_ahrat")]
position = Vector2(0, -450)
_spritesToOutline = [NodePath("../TalkingControl/AnimatedSprite")]
_spriteToOutline = NodePath("../TalkingControl/AnimatedSprite")
[node name="CollisionShape3D" parent="InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_at1n1")
+2 -2
View File
@@ -160,9 +160,9 @@ libraries = {
&"": SubResource("AnimationLibrary_54k4r")
}
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("15_uo3dh")]
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("15_uo3dh")]
position = Vector2(18, -250)
_spritesToOutline = [NodePath("../Duck rendered")]
_spriteToOutline = NodePath("../Duck rendered")
[node name="CollisionShape3D" parent="InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_uo3dh")
+5 -93
View File
@@ -1,56 +1,28 @@
[gd_scene load_steps=25 format=3 uid="uid://b1d2e7ely6hyw"]
[gd_scene load_steps=9 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"]
[sub_resource type="CircleShape2D" id="CircleShape2D_57jmp"]
resource_local_to_scene = true
radius = 325.2599
[node name="BaseField" type="Node2D"]
script = ExtResource("1_4mg73")
Payload = 0
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "_outlineSprite", "PlantingInteraction", "PlantingPlaceholder", "FieldInteractionArea", "_fieldIndex", "_wateringParticles")]
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "PlantingInteraction", "PlantingPlaceholder")]
z_index = -1
scale = Vector2(0.9, 1)
script = ExtResource("1_qa01x")
_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")
PlantingPlaceholder = NodePath("PlantPlaceholder")
ItemRepository = ExtResource("7_w8caw")
FieldInteractionArea = NodePath("../InteractionArea")
_sceneKeyProvider = ExtResource("11_cjahb")
_fieldIndex = NodePath("..")
_wateringParticles = NodePath("../pouring water vfx")
_wateringEvent = ExtResource("14_57jmp")
[node name="MaskedField" type="Sprite2D" parent="FieldBehaviour"]
clip_children = 1
@@ -62,69 +34,9 @@ texture = ExtResource("5_wx561")
[node name="PlantPlaceholder" type="Node2D" parent="FieldBehaviour"]
[node name="OutlineSprite" type="Sprite2D" parent="FieldBehaviour"]
self_modulate = Color(1, 1, 1, 0)
z_index = 1
scale = Vector2(1.5, 1.5)
texture = ExtResource("9_wx561")
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("7_2eegd")]
position = Vector2(-26, -57)
[node name="InteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("7_2eegd")]
position = Vector2(-16, -54)
_active = false
_spritesToOutline = [NodePath("../FieldBehaviour/OutlineSprite")]
_showLabel = false
_spriteToOutline = NodePath("../FieldBehaviour/MaskedField/FieldTexture")
[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")]
script = ExtResource("22_57jmp")
_field = NodePath("../FieldBehaviour")
[node name="InteractionArea" parent="FieldActivator" instance=ExtResource("7_2eegd")]
_useOutline = false
[node name="CollisionShape3D" parent="FieldActivator/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_57jmp")
[connection signal="Planted" from="FieldBehaviour" to="PlantCreationEventRaiser" method="RaiseEvents"]
[connection signal="Interacted" from="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/InteractionArea" method="ToggleActive"]
[connection signal="Interacted" from="FieldActivator/InteractionArea" to="FieldActivator" method="ActivateField"]
[editable path="FieldActivator/InteractionArea"]
+2
View File
@@ -38,6 +38,7 @@ _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)
@@ -129,6 +130,7 @@ 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")
+1 -4
View File
@@ -12,7 +12,7 @@ radius = 300.0
resource_local_to_scene = true
radius = 300.0
[node name="Beet" instance=ExtResource("1_2u3jr")]
[node name="Beet2" instance=ExtResource("1_2u3jr")]
[node name="Seed1" parent="Seeds" index="0"]
texture = ExtResource("2_agmuy")
@@ -47,9 +47,6 @@ 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 -1
View File
@@ -6,7 +6,7 @@
[node name="DetectionCross" type="Node2D" node_paths=PackedStringArray("_detector")]
script = ExtResource("1_va8tx")
_detector = NodePath("detector")
_xOffset = 400.0
_xOffset = 300.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, 400)
size = Vector2(100, 200)
[node name="detector" type="Area2D"]
collision_layer = 4
@@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://dpbbroif2tnil"]
[gd_scene load_steps=15 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,8 +10,6 @@
[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
@@ -57,9 +55,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("_spritesToOutline") instance=ExtResource("4_xu8me")]
[node name="PickupInteractionArea" parent="." node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("4_xu8me")]
_outlineMaterial = ExtResource("4_harr4")
_spritesToOutline = [NodePath("../Icon")]
_spriteToOutline = NodePath("../Icon")
[node name="CollisionShape3D" parent="PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tlhp6")
@@ -76,10 +74,6 @@ 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"]
+11 -12
View File
@@ -11,7 +11,7 @@ config_version=5
[application]
config/name="Babushka"
run/main_scene="uid://c6wnoif01ltld"
run/main_scene="uid://bopv10dqm1knc"
config/features=PackedStringArray("4.5", "C#", "Forward Plus")
run/max_fps=120
boot_splash/fullsize=false
@@ -32,7 +32,6 @@ 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"
FieldService="*res://scripts/CSharp/Common/Farming/FieldService.cs"
[dialogic]
@@ -145,11 +144,8 @@ 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",
@@ -174,8 +170,6 @@ 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",
@@ -211,14 +205,19 @@ folder_colors={
"res://audio/": "yellow",
"res://dialog/": "green",
"res://fonts/": "green",
"res://logos/": "blue",
"res://prefabs/": "purple",
"res://resources/": "purple",
"res://scenes/": "purple",
"res://scripts/": "pink",
"res://logos/": "green",
"res://prefabs/": "teal",
"res://resources/": "teal",
"res://scenes/": "blue",
"res://scripts/": "purple",
"res://shader/": "pink"
}
[global_group]
PlantGrowing=""
Pickup=""
[input]
move_left={
@@ -1,7 +0,0 @@
[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"
@@ -1,7 +0,0 @@
[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"
@@ -1,8 +0,0 @@
[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"
@@ -1,8 +0,0 @@
[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"
@@ -1,7 +0,0 @@
[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"
+1 -1
View File
@@ -5,6 +5,6 @@
[node name="BabushkaSceneBootstrap" type="Node2D"]
[node name="BabushkaSceneStartMenu" parent="." instance=ExtResource("1_15ton")]
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_fight_world_room.tscn")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_farm_outside_2d.tscn")
[node name="SceneParent" type="Node" parent="."]
+54 -30
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=115 format=3 uid="uid://gigb28qk8t12"]
[gd_scene load_steps=117 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,6 +28,7 @@
[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"]
@@ -38,6 +39,7 @@
[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"]
@@ -73,10 +75,8 @@
[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"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wtdui"]
shader = ExtResource("13_7p0hq")
@@ -211,6 +211,13 @@ 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
@@ -597,7 +604,7 @@ texture = ExtResource("13_0qu0h")
[node name="JelenaMockupBg03" type="Sprite2D" parent="ParallaxBackground/background layer 4"]
z_index = -200
material = SubResource("ShaderMaterial_wtdui")
position = Vector2(7893.0005, 727)
position = Vector2(7923, 727)
scale = Vector2(2.75, 2.75)
texture = ExtResource("13_0qu0h")
@@ -1029,16 +1036,16 @@ position = Vector2(6403, 3362)
_timelinesToPlay = PackedStringArray("yeli_quest_select")
_retriggerSameTimeline = true
[node name="Vesna" parent="YSorted" instance=ExtResource("1_7wfwe")]
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") 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", "_fieldParent")]
[node name="FarmingControls" parent="YSorted/Vesna" index="1" node_paths=PackedStringArray("_camera")]
_camera = NodePath("../../../Camera2D")
_fieldParent = NodePath("../../FieldParent")
[node name="Well" type="Sprite2D" parent="YSorted" node_paths=PackedStringArray("_interactionArea")]
[node name="Brünnen" type="Sprite2D" parent="YSorted" node_paths=PackedStringArray("_interactionArea")]
z_index = 1
y_sort_enabled = true
material = SubResource("ShaderMaterial_2vojv")
@@ -1050,18 +1057,19 @@ region_rect = Rect2(0, 0, 1504, 1686)
script = ExtResource("32_lbnqo")
_interactionArea = NodePath("InteractionArea")
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Well"]
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Brünnen"]
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Well/StaticBody2D"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Brünnen/StaticBody2D"]
position = Vector2(145.5, -224)
shape = SubResource("RectangleShape2D_0sfl7")
[node name="InteractionArea" parent="YSorted/Well" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("27_klb81")]
_spritesToOutline = [NodePath("..")]
[node name="InteractionArea" parent="YSorted/Brünnen" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("27_klb81")]
_active = false
_spriteToOutline = NodePath("..")
_id = 1
[node name="CollisionShape3D" parent="YSorted/Well/InteractionArea/Area2D" index="0"]
[node name="CollisionShape3D" parent="YSorted/Brünnen/InteractionArea/Area2D" index="0"]
position = Vector2(146, -130)
shape = SubResource("CircleShape2D_p6n74")
@@ -1100,6 +1108,10 @@ 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
@@ -1113,9 +1125,6 @@ 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="Farm visuals" type="Node2D" parent="YSorted"]
position = Vector2(-60, 122)
@@ -1137,10 +1146,10 @@ 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("_spritesToOutline") instance=ExtResource("27_klb81")]
[node name="EnterHouseInteraction" parent="YSorted/Farm visuals/Static" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("27_klb81")]
position = Vector2(5834, 2354)
scale = Vector2(2.425, 2.425)
_spritesToOutline = [NodePath("DoorSprite")]
_spriteToOutline = NodePath("DoorSprite")
_id = 0
[node name="DoorSprite" type="Sprite2D" parent="YSorted/Farm visuals/Static/EnterHouseInteraction"]
@@ -2092,6 +2101,27 @@ 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"]
@@ -2109,9 +2139,9 @@ collision_mask = 4
position = Vector2(-106.663, 182.891)
shape = SubResource("RectangleShape2D_ycj14")
[node name="InteractionArea" parent="YSorted/Blocker" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("27_klb81")]
[node name="InteractionArea" parent="YSorted/Blocker" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("27_klb81")]
position = Vector2(11234, 1850)
_spritesToOutline = [NodePath("Fence Door")]
_spriteToOutline = NodePath("Fence Door")
_id = 1
[node name="CollisionShape3D" parent="YSorted/Blocker/InteractionArea/Area2D" index="0"]
@@ -2133,7 +2163,6 @@ position = Vector2(-113.561, 193.035)
shape = SubResource("RectangleShape2D_2vojv")
[node name="ducks" type="Node2D" parent="YSorted"]
visible = false
z_index = 1
y_sort_enabled = true
script = ExtResource("49_uxa2m")
@@ -2210,7 +2239,6 @@ position = Vector2(-4659, 2897)
position = Vector2(-5016, 3361)
[node name="trash" type="Node2D" parent="YSorted"]
visible = false
z_index = 1
y_sort_enabled = true
@@ -2394,19 +2422,16 @@ _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"
[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/Well/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[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"]
[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"]
@@ -2419,10 +2444,9 @@ _payloadToSet = "farmOutside"
[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/Well/InteractionArea"]
[editable path="YSorted/Brünnen/InteractionArea"]
[editable path="YSorted/CanGenericPickup"]
[editable path="YSorted/CanGenericPickup/PickupInteractionArea"]
[editable path="YSorted/RakeGenericPickup"]
@@ -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("_spritesToOutline") instance=ExtResource("11_gpagp")]
[node name="OutsideDoor" parent="BackWall/Room01DorrR" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(-7, 248)
scale = Vector2(1.5, 1.5)
_spritesToOutline = [NodePath("..")]
_spriteToOutline = 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("_spritesToOutline") instance=ExtResource("11_gpagp")]
[node name="VesnasRoomDoor" parent="BackWall/Room01DoorL" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(-1559, -16)
_spritesToOutline = [NodePath("..")]
_spriteToOutline = 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("_spritesToOutline") instance=ExtResource("11_gpagp")]
[node name="InteractionArea" parent="BackWall/Room01PechkaDoor" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(0, -3)
_spritesToOutline = [NodePath("..")]
_spriteToOutline = 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("_spritesToOutline") instance=ExtResource("11_gpagp")]
[node name="InteractionArea" parent="BackWall/Katze" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("11_gpagp")]
position = Vector2(-6.5, -44)
scale = Vector2(0.5, 0.5)
_spritesToOutline = [NodePath("..")]
_spriteToOutline = NodePath("..")
[node name="Room assets" type="Node" parent="BackWall"]
@@ -98,7 +98,7 @@ _followNode = NodePath("../Vesna/CharacterBody2D")
[node name="BedInteraction" parent="." instance=ExtResource("8_phqdf")]
position = Vector2(-1429, 487)
_useOutline = false
_useSprite = false
_id = 1
[node name="QuestCompleter" type="Node" parent="BedInteraction"]
@@ -108,7 +108,7 @@ toStatus = 2
[node name="DoorInteraction" parent="." instance=ExtResource("8_phqdf")]
position = Vector2(777, 201)
_useOutline = false
_useSprite = false
_id = 0
[node name="CollisionShape3D" parent="DoorInteraction/Area2D" index="0"]
+21 -115
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=96 format=3 uid="uid://b3ibx4resa1f3"]
[gd_scene load_steps=85 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,15 +42,14 @@
[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="AudioStream" uid="uid://dapsknn486aee" path="res://audio/sfx/Farming/SFX_WateringPlants_01.wav" id="59_km2vg"]
[ext_resource type="AudioStream" uid="uid://dnyne8wov50so" path="res://audio/sfx/Farming/SFX_WateringPlants_02.wav" id="60_qi2gu"]
@@ -170,42 +169,6 @@ 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
@@ -221,10 +184,6 @@ 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
@@ -959,9 +918,10 @@ shape = SubResource("RectangleShape2D_0qu0h")
z_index = 1
y_sort_enabled = true
[node name="Vesna" parent="YSorted" instance=ExtResource("27_qtaxr")]
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") 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"]
@@ -996,8 +956,8 @@ collision_mask = 4
position = Vector2(145.5, -224)
shape = SubResource("RectangleShape2D_0sfl7")
[node name="InteractionArea" parent="YSorted/Brünnen" node_paths=PackedStringArray("_spritesToOutline") instance=ExtResource("31_xcb8u")]
_spritesToOutline = [NodePath("..")]
[node name="InteractionArea" parent="YSorted/Brünnen" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("31_xcb8u")]
_spriteToOutline = NodePath("..")
_id = 1
[node name="CollisionShape3D" parent="YSorted/Brünnen/InteractionArea/Area2D" index="0"]
@@ -1742,9 +1702,12 @@ rotation = 1.5708
scale = Vector2(0.1, 8.7)
texture = ExtResource("26_bwvai")
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals"]
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals" node_paths=PackedStringArray("fields")]
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)
@@ -1754,37 +1717,31 @@ scale = Vector2(1, 1.00622)
_state = 2
_field = NodePath("../..")
[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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField2" index="0"]
FieldState = 3
[node name="Beet2" parent="YSorted/Farm visuals/FieldParent/BaseField2/FieldBehaviour/PlantPlaceholder" index="0" node_paths=PackedStringArray("_field") instance=ExtResource("41_vyqmy")]
_state = 2
_state = 1
_field = NodePath("../..")
[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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField3" index="0"]
FieldState = 3
[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="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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField4" index="0"]
FieldState = 3
@@ -1793,13 +1750,9 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
[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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField5" index="0"]
FieldState = 3
@@ -1808,13 +1761,9 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
[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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField6" index="0"]
FieldState = 3
@@ -1823,13 +1772,9 @@ FieldState = 3
_state = 1
_field = NodePath("../..")
[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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField7" index="0"]
FieldState = 3
@@ -1838,13 +1783,9 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
[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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField8" index="0"]
FieldState = 3
@@ -1853,30 +1794,22 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
[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
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField9" index="0"]
visible = false
FieldState = 3
[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="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("_spritesToOutline") instance=ExtResource("31_xcb8u")]
[node name="BackToFarm" parent="YSorted/Blocker" node_paths=PackedStringArray("_spriteToOutline") instance=ExtResource("31_xcb8u")]
position = Vector2(3774, 2025)
_spritesToOutline = [NodePath("Fence Door2")]
_spriteToOutline = NodePath("Fence Door2")
_id = 0
[node name="CollisionShape3D" parent="YSorted/Blocker/BackToFarm/Area2D" index="0"]
@@ -1915,18 +1848,6 @@ 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"]
@@ -1989,40 +1910,25 @@ 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"
[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"]
@@ -8,6 +8,7 @@ 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;
@@ -143,6 +144,7 @@ public partial class VesnaAnimations : Node
_sprite.Animation = "diagonal wateringcan";
_sprite.Play();
InputService.Instance.InputEnabled = false;
_wateringParticles.Emitting = true;
Task.Run(DelayedInputHandlerReset);
}
}
@@ -150,6 +152,7 @@ public partial class VesnaAnimations : Node
private async Task DelayedInputHandlerReset()
{
await Task.Delay(1000);
_wateringParticles.Emitting = false;
InputService.Instance.InputEnabled = true;
}
@@ -7,13 +7,13 @@ namespace Babushka.scripts.CSharp.Common.CharacterControls;
public partial class InteractionArea2D : Node2D
{
[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[] _spritesToOutline = [];
[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,7 +38,21 @@ public partial class InteractionArea2D : Node2D
{
if (_useOutline)
{
_backupMaterials = _spritesToOutline.Select(s => s.Material).ToArray();
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);
}
}
}
@@ -62,6 +76,9 @@ public partial class InteractionArea2D : Node2D
public void OnPlayerExited(Node2D player)
{
if (!_active)
return;
_label.Hide();
if (!_useOutline)
@@ -1,5 +1,3 @@
using System;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
using Godot.Collections;
@@ -8,18 +6,19 @@ namespace Babushka.scripts.CSharp.Common.Farming;
[GlobalClass]
public partial class FarmingControls2D : Node2D
{
[Export] private VariableResource _sceneKeyProvider;
[Export] private PackedScene _fieldPrefab;
[Export] private Node2D _movingPlayer;
[Export] private Camera2D _camera;
[Export] private CpuParticles2D _wateringParticles;
[Export] private float _wateringCanParticlesVerticalOffset = 50f;
[Export] private Vector2I _fieldOffsetVector = new Vector2I(735, 651);
[Export] private Node2D _fieldParent;
public FieldService2D FieldService;
private int _toolId = -1;
private bool _wateringCanFilled = false;
[Signal] public delegate void FieldCreatedEventHandler();
[Signal] public delegate void WateringFieldEventHandler();
#region Tools
@@ -53,13 +52,12 @@ public partial class FarmingControls2D : Node2D
public override void _Input(InputEvent @event)
{
if (@event.IsActionPressed("click"))
if (@event.IsActionPressed("click")
&& _toolId == WateringCanState.WATERING_CAN_ID
&& WateringCanState.GetFillState() > 0)
{
if ( _toolId == 0)
{
Vector2I adjustedPosition = GetAdjustedMousePosition();
MakeField(adjustedPosition);
}
Vector2I adjustedPosition = GetAdjustedMousePosition();
WaterTheField(adjustedPosition);
}
}
@@ -67,13 +65,43 @@ public partial class FarmingControls2D : Node2D
{
Vector2 mousePosition = _camera.GetGlobalMousePosition();
Vector2I mousePositionInteger = (Vector2I) mousePosition;
Vector2I adjustedPosition = AdjustValue(mousePositionInteger, _fieldOffsetVector);
Vector2I adjustedPosition = AdjustValue(mousePositionInteger, new Vector2I(735, 651));
return adjustedPosition;
}
private Vector2I AdjustValue(Vector2I input, Vector2I step)
/// <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)
{
return input.Snapped(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);
}
}
#region WATERING
@@ -84,15 +112,56 @@ 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 mousePosition)
private void MakeField(Vector2I fieldPosition)
{
int potentialFieldIndex = FieldService.Instance.PositionToIndex(mousePosition);
if(FieldService.Instance.TryGet(_sceneKeyProvider.Payload.AsString(), potentialFieldIndex) == null)
EmitSignal(SignalName.FieldCreated);
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
@@ -1,27 +0,0 @@
using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
public partial class FieldActivator : Node
{
[Export] private Node2D _field;
private bool _activated = false;
private bool _rakeInHand;
public void ActivateField()
{
if (!_activated && _rakeInHand)
{
GD.Print("Tryina activate this field right here....");
_field.Visible = true;
_activated = true;
}
}
public void RakeActivated(bool activated)
{
_rakeInHand = activated;
}
}
@@ -1 +0,0 @@
uid://dlbjjgbs0n4b0
@@ -1,8 +1,6 @@
using System;
using Babushka.scripts.CSharp.Common.CharacterControls;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Low_Code.Events;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
@@ -12,8 +10,6 @@ public partial class FieldBehaviour2D : Sprite2D
{
[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;
@@ -21,51 +17,15 @@ public partial class FieldBehaviour2D : Sprite2D
[Export] public InteractionArea2D PlantingInteraction;
[Export] public Node2D PlantingPlaceholder;
[Export] public ItemRepository ItemRepository;
[Export] public InteractionArea2D FieldInteractionArea;
[Export] public VariableResource _sceneKeyProvider;
[Export] private VariableNode _fieldIndex;
[Export] private CpuParticles2D _wateringParticles;
[Export] private EventResource _wateringEvent;
public Vector2 FieldPosition;
private bool _seedsActive;
private bool _wateringCanActive;
private bool _canPlant;
private bool _canWater;
[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 && _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()
{
UpdateFieldState(FieldState);
FieldService.Instance.TryAddEntry(_sceneKeyProvider.Payload.AsString(),_fieldIndex.Payload.AsInt32(), this);
int randomIndex = new Random().Next(0, _maskTexture.Length);
_maskSprite.Texture = _maskTexture[randomIndex];
_outlineSprite.Texture = _maskOutlineTextures[randomIndex];
base._Ready();
}
@@ -96,35 +56,22 @@ public partial class FieldBehaviour2D : Sprite2D
FieldState = FieldState.NotFound;
break;
}
UpdateInteractionArea();
}
public void Water()
{
if (WateringCanState.GetFillState() > 0)
{
UpdateFieldState(FieldState.Watered);
_wateringParticles.Emitting = true;
WateringCanState.Water();
_wateringEvent.Raise();
}
UpdateFieldState(FieldState.Watered);
}
/// <summary>
/// Called when the player enters the field's interaction area and presses <E> or clicks.
/// Called when the player enters the field's interaction area and presses <E>.
/// </summary>
public void Farm()
{
if (_canPlant || TryPlant())
{
EmitSignal(SignalName.Planted);
UpdateFieldState(FieldState.Planted);
}
if (_canWater)
if (TryPlant())
{
Water();
UpdateFieldState(FieldState.Planted);
}
}
@@ -158,6 +105,5 @@ public partial class FieldBehaviour2D : Sprite2D
return success;
}
}
@@ -1,111 +0,0 @@
using System.Collections.Generic;
using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
public partial class FieldService : Node
{
private Dictionary<string, FieldsInScene>? _outerDict = null!;
public static FieldService Instance { get; private set; } = null!;
public override void _EnterTree()
{
Instance = this;
_outerDict = new Dictionary<string, FieldsInScene>();
}
public override void _ExitTree()
{
Instance = null;
_outerDict = null;
}
//Create
public bool TryAddEntry(string sceneName, int fieldIndex, FieldBehaviour2D field)
{
GD.Print("Trying to add a field at: " + fieldIndex);
if (_outerDict != null )
{
FieldsInScene innerDict;
bool outerDictEntryExists = _outerDict.TryGetValue(sceneName, out innerDict);
if (!outerDictEntryExists)
{
innerDict = new FieldsInScene();
_outerDict.Add(sceneName, innerDict);
}
if (!innerDict.fields.ContainsKey(fieldIndex))
{
innerDict.fields.Add(fieldIndex, field);
return true;
}
else
{
GD.PrintErr("Duplicate field at: " + fieldIndex);
}
}
return false;
}
// Read
public FieldBehaviour2D? TryGet(string key, int fieldIndex)
{
if (_outerDict != null && _outerDict.TryGetValue(key, out FieldsInScene? field))
{
if (field.fields.TryGetValue(fieldIndex, out FieldBehaviour2D? fieldInstance))
{
return fieldInstance;
}
}
return null;
}
//Update
public void UpdateEntry(string key, int fieldIndex, FieldBehaviour2D state)
{
if (_outerDict != null && _outerDict.TryGetValue(key, out FieldsInScene? field))
{
if (field.fields.ContainsKey(fieldIndex))
{
field.fields[fieldIndex] = state;
}
else
{
TryAddEntry(key, fieldIndex, state);
}
}
}
//Delete
public void RemoveEntry(string key, int fieldIndex)
{
if (_outerDict != null && _outerDict.TryGetValue(key, out FieldsInScene? field))
{
if (field.fields.ContainsKey(fieldIndex))
{
field.fields.Remove(fieldIndex);
}
}
}
public int PositionToIndex(Vector2 position)
{
// some awesome code here
return 0;
}
}
internal class FieldsInScene
{
public Dictionary<int, FieldBehaviour2D?> fields;
public FieldsInScene()
{
fields = new Dictionary<int, FieldBehaviour2D?>();
}
}
@@ -1 +0,0 @@
uid://slo0uydmmvnu
@@ -1,9 +1,12 @@
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>
@@ -20,9 +23,8 @@ 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;
/// <summary>
/// public accessor for the field reference
@@ -35,23 +37,22 @@ public partial class PlantBehaviour2D : Node2D
public override void _Ready()
{
GD.Print($"Ready: {Name}");
if (_state == PlantState.None)
{
GetTree().CallGroup("PlantGrowing", VesnaAnimations.MethodName.PlayFarmingAnimation);
_state = PlantState.Planted;
_currentPlantSprite = GetRandomSprite(_seeds);
_currentPlantSprite.Visible = true;
}
else
{
GD.Print("plant state not none.");
_calledOnReady = true;
GrowPlant();
}
}
public void Grow()
{
GetTree().CallGroup("PlantGrowing", VesnaAnimations.MethodName.PlayFarmingAnimation);
GrowPlant();
}
@@ -61,13 +62,9 @@ public partial class PlantBehaviour2D : Node2D
/// </summary>
public void GrowPlant()
{
if (!_calledOnReady)
{
if (_field.FieldState != FieldState.Watered || _magicWordSaid != _magicWordNeeded)
return;
}
if (_field.FieldState != FieldState.Watered || _magicWordSaid != _magicWordNeeded)
return;
GD.Print("Growing plant.");
switch (_state)
{
case PlantState.None:
@@ -110,7 +107,6 @@ public partial class PlantBehaviour2D : Node2D
_field.UpdateFieldState(FieldState.Tilled);
_magicWordSaid = false;
_calledOnReady = false;
}
private Sprite2D GetRandomSprite(Sprite2D[] sprites)
@@ -9,6 +9,7 @@ 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;
@@ -25,6 +26,7 @@ public partial class VesnaBehaviour2D : Node
public override void _Ready()
{
_farmingControls.FieldService = _fieldParent;
_inventoryManager = InventoryManager.Instance;
_inventoryInstance = _inventoryManager.playerInventory;
_inventoryManager.SlotIndexChanged += HandleInventorySelectedSlotIndexChanged;
@@ -59,7 +59,7 @@ public partial class AllFightersVisual : Node
if (from == FightHappening.FightState.ActionAnim)
{
_fighterVisuals.Values.ForEach(fv => fv.UpdateHealthBar());
_fighterVisuals.Values.ForEach(fv => fv.UpdateVisuals());
}
}
@@ -192,6 +192,8 @@ public partial class FightHappening : Node
HappeningData.actionStaging = null;
HappeningData.fightersEnterStaging = null;
RemoveDeadFighters();
if (!FightWorld.Instance.allyFighters.IsAlive())
{
ChangeState(FightState.EnemyWin);
@@ -345,6 +347,17 @@ public partial class FightHappening : Node
vesnaFighter.health = vesnaFighter.maxHealth;
GD.Print("Vesna has been revived. This is for the current prototype only");
}
private void RemoveDeadFighters()
{
foreach (var f in HappeningData.fighterTurn)
{
if (f.IsDead())
{
HappeningData.fighterTurn.Remove(f);
}
}
}
#endregion // Game Logic
+29 -3
View File
@@ -1,9 +1,12 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Babushka.scripts.CSharp.Common.Fight;
public class FighterTurn
public class FighterTurn : IEnumerable<FightWorld.Fighter>
{
private class Node
{
@@ -13,7 +16,8 @@ public class FighterTurn
private Node? _currentNode;
public FightWorld.Fighter Current => _currentNode?.fighter ?? throw new InvalidOperationException("No current fighter");
public FightWorld.Fighter Current =>
_currentNode?.fighter ?? throw new InvalidOperationException("No current fighter");
public void Next()
{
@@ -84,7 +88,7 @@ public class FighterTurn
{
// if removing current, keep current
// it will be implicitly deleted by loss of reference on the next Next() call
node.next = node.next.next;
return true;
}
@@ -94,4 +98,26 @@ public class FighterTurn
return false;
}
public IEnumerator<FightWorld.Fighter> GetEnumerator()
{
if (_currentNode == null) return Enumerable.Empty<FightWorld.Fighter>().GetEnumerator();
var list = new List<FightWorld.Fighter>();
var n = _currentNode;
while (true)
{
list.Add(n.fighter);
if (n.next == _currentNode)
break;
n = n.next;
}
return list.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
+7 -12
View File
@@ -7,7 +7,6 @@ using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class FighterVisual : Node2D
{
#region Shortcuts
@@ -28,21 +27,17 @@ public partial class FighterVisual : Node2D
public void Initialize(FightWorld.Fighter fighter)
{
_boundFighter = fighter;
UpdateMirrorState();
UpdateHealthBar();
UpdateVisuals();
}
/// <summary>
/// fighter visuals should always look to the right in the scene.
/// This function flips the sprites horizontally, when the fighter is an enemy.
/// </summary>
private void UpdateMirrorState()
public void UpdateVisuals()
{
_visualParent.Scale = new Vector2(_boundFighter.IsInFormation(HappeningData.enemyFighterFormation) ? -1 : 1, 1);
}
// fighter visuals should always look to the right in the scene.
// This function flips the sprites horizontally, when the fighter is an enemy.
_visualParent.Scale = new Vector2(
_boundFighter.IsInFormation(HappeningData.enemyFighterFormation) ? -1 : 1,
_boundFighter.IsDead() ? .3f : 1);
public void UpdateHealthBar()
{
healthBarVisual.UpdateHealth(_boundFighter.GetHealth(), _boundFighter.maxHealth);
}
@@ -1,48 +0,0 @@
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);
}
}
@@ -1 +0,0 @@
uid://3t0af586fimq
@@ -0,0 +1,13 @@
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);
}
}
@@ -0,0 +1 @@
uid://dkk1vjijvgrd7
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Godot;
namespace Babushka.scripts.CSharp.Common.Util;
@@ -24,54 +23,4 @@ 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;
}
}
@@ -1,8 +0,0 @@
using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
public partial class VariableNode : Node
{
[Export] public Variant Payload { get; set; }
}
@@ -1 +0,0 @@
uid://j2mhvb45egej
@@ -1,14 +0,0 @@
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;
}
}
@@ -1 +0,0 @@
uid://dfpyjxivcuidr