From 229dd04bc1acb15291a03e52dc5d518717c19905 Mon Sep 17 00:00:00 2001 From: kziolkowski Date: Wed, 3 Dec 2025 18:55:45 +0100 Subject: [PATCH] :sparkles: Made bed interaction count up the days and verified that you can now play a full loop --- scenes/Babushka_scene_farm_outside_2d.tscn | 1 + scenes/Babushka_scene_indoor_common_room.tscn | 2 +- scenes/Babushka_scene_indoor_vesnas_room.tscn | 7 ++++++- .../CSharp/Common/DayAndNight/CalendarController.cs | 12 ++++++++---- .../CSharp/Common/DayAndNight/DayAndNightHelper.cs | 11 +++++++++++ .../Common/DayAndNight/DayAndNightHelper.cs.uid | 1 + 6 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs create mode 100644 scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs.uid diff --git a/scenes/Babushka_scene_farm_outside_2d.tscn b/scenes/Babushka_scene_farm_outside_2d.tscn index cb2e181..09d13c0 100644 --- a/scenes/Babushka_scene_farm_outside_2d.tscn +++ b/scenes/Babushka_scene_farm_outside_2d.tscn @@ -1296,6 +1296,7 @@ polygon = PackedVector2Array(247.227, 43.5123, 44.7822, 43.5123, -87.2178, 45.12 [node name="EnterHouseInteraction" parent="YSorted/Farm visuals/Static" instance=ExtResource("27_klb81")] position = Vector2(5834, 2354) scale = Vector2(2.425, 2.425) +_id = 0 metadata/SaveID = "5a93071f-c1ab-4b4b-b74e-a6324d44ddf8" [node name="DoorSprite" type="Sprite2D" parent="YSorted/Farm visuals/Static/EnterHouseInteraction"] diff --git a/scenes/Babushka_scene_indoor_common_room.tscn b/scenes/Babushka_scene_indoor_common_room.tscn index a795518..b494ae5 100644 --- a/scenes/Babushka_scene_indoor_common_room.tscn +++ b/scenes/Babushka_scene_indoor_common_room.tscn @@ -218,7 +218,7 @@ radius = 400.0 z_index = 1 y_sort_enabled = true script = ExtResource("1_3vr4f") -_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_vesnas_room.tscn", "res://scenes/Babushka_scene_farm_outside_2d_ducksCollected.tscn") +_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_vesnas_room.tscn", "res://scenes/Babushka_scene_farm_outside_2d.tscn") [node name="Foreground" type="Node" parent="."] diff --git a/scenes/Babushka_scene_indoor_vesnas_room.tscn b/scenes/Babushka_scene_indoor_vesnas_room.tscn index 1e3b2cc..ebae355 100644 --- a/scenes/Babushka_scene_indoor_vesnas_room.tscn +++ b/scenes/Babushka_scene_indoor_vesnas_room.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=15 format=3 uid="uid://ceaa2qj2bmw43"] +[gd_scene load_steps=16 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"] @@ -6,6 +6,7 @@ [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="Script" uid="uid://jg4jryfus3bw" path="res://scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs" id="11_heyef"] [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/Vesna.tscn" id="18_3gevq"] [ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="23_408bg"] @@ -125,8 +126,12 @@ shape = SubResource("CircleShape2D_2spkc") script = ExtResource("10_j25a2") _sceneIndexToLoad = 1 +[node name="CountDayUp" type="Node" parent="NightStarter"] +script = ExtResource("11_heyef") + [connection signal="Interacted" from="BedInteraction" to="BedInteraction/QuestCompleter" method="Trigger"] [connection signal="Interacted" from="BedInteraction" to="NightStarter" method="StartNight"] +[connection signal="Interacted" from="BedInteraction" to="NightStarter/CountDayUp" method="IncreaseDayCount"] [connection signal="Interacted" from="DoorInteraction" to="." method="LoadScene"] [connection signal="LoadScene" from="NightStarter" to="." method="LoadSceneAtIndex"] diff --git a/scripts/CSharp/Common/DayAndNight/CalendarController.cs b/scripts/CSharp/Common/DayAndNight/CalendarController.cs index fed5dde..878ff02 100644 --- a/scripts/CSharp/Common/DayAndNight/CalendarController.cs +++ b/scripts/CSharp/Common/DayAndNight/CalendarController.cs @@ -31,10 +31,14 @@ public partial class CalendarController : Node { if (@event.IsActionPressed("NextDayCheat")) { - int days = _dayCounter.Payload.AsInt32(); - days++; - _dayCounter.Payload = days; - + GoToNextDay(); } } + + public void GoToNextDay() + { + int days = _dayCounter.Payload.AsInt32(); + days++; + _dayCounter.Payload = days; + } } \ No newline at end of file diff --git a/scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs b/scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs new file mode 100644 index 0000000..a51b4ee --- /dev/null +++ b/scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs @@ -0,0 +1,11 @@ +using Godot; + +namespace Babushka.scripts.CSharp.Common.DayAndNight; + +public partial class DayAndNightHelper : Node +{ + public void IncreaseDayCount() + { + CalendarController.Instance?.GoToNextDay(); + } +} \ No newline at end of file diff --git a/scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs.uid b/scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs.uid new file mode 100644 index 0000000..7b924fa --- /dev/null +++ b/scripts/CSharp/Common/DayAndNight/DayAndNightHelper.cs.uid @@ -0,0 +1 @@ +uid://jg4jryfus3bw