Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 971d8d461b | |||
| 628da80ed3 | |||
| 0dfbd73978 | |||
| 8a93b00e72 | |||
| ba7d550c3f | |||
| b65a3bbd6d | |||
| bcbc074c86 | |||
| 745f54b375 | |||
| 59d313d97d |
@@ -8,4 +8,7 @@
|
||||
<Folder Include="prefabs\UI\Inventory\" />
|
||||
<Folder Include="scripts\CSharp\Low Code\Randomizer\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -18,22 +18,11 @@
|
||||
<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_003AGodotObject_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F51f2b63b967748e314386b5617f797f966737023321cdc6407d4677cd0d7_003FGodotObject_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>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AResourceLoader_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F9f4e8eb124d11f8219cb513a19bed22b2120ed29f9d6785ba56e3367b48d581_003FResourceLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AResourceLoader_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003F9f4e8eb124d11f8219cb513a19bed22b2120ed29f9d6785ba56e3367b48d581_003FResourceLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fc7102cd0ffb8973777e61b1942c3fffac7e14016a511d055c3adf73ff91748_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEnumerable_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F76fabf6f8acf4a0099cae0bcf8b218467f10_003F7e_003F28cee476_003FEnumerable_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>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANullable_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F5acc345db3c207bc9d886a36ff14867ef8d65557432172c2a42f19aeac04d1b_003FNullable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AResourceLoader_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F9f4e8eb124d11f8219cb513a19bed22b2120ed29f9d6785ba56e3367b48d581_003FResourceLoader_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ASceneTree_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F8d6960554e939a669841b1ece03d27df4ab42f92bb80be3767eaec8cdaccf84b_003FSceneTree_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AShape2D_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003F3671dbbd9b17cdf2bf9075b468b6bd7e3ab13fc3be7a116484085d3b6cc9fe_003FShape2D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003FJonathan_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fc7102cd0ffb8973777e61b1942c3fffac7e14016a511d055c3adf73ff91748_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=bc5a80e4_002D7ba6_002D4f7d_002Db896_002Dc591eec7ab12/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="Tests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
|
||||
<TestAncestor>
|
||||
<TestId>NUnit3x::A6EF2269-9E64-40D4-BA0A-33CB234E2503::net9.0::BabushkaTest.Tests</TestId>
|
||||
</TestAncestor>
|
||||
</SessionState></s:String></wpf:ResourceDictionary>
|
||||
|
||||
@@ -4,19 +4,22 @@ importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://b3kyrsoobmkhp"
|
||||
valid=false
|
||||
path="res://.godot/imported/best_house_blender.blend-ac89c74aef2f275bdf4b4baadee17c0c.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/mockups/3d/best_house_blender.blend"
|
||||
dest_files=["res://.godot/imported/best_house_blender.blend-ac89c74aef2f275bdf4b4baadee17c0c.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
@@ -31,6 +34,9 @@ animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
@@ -50,3 +56,4 @@ blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
gltf/naming_version=0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[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://c2cgj153m05sp" path="res://scripts/CSharp/Common/Interactables/TrashObject.cs" id="2_u7jgg"]
|
||||
[ext_resource type="Script" uid="uid://d3n8kwva4pxx5" path="res://scripts/CSharp/GameEntity/EntityNodes/TrashEntityNode.cs" id="2_u7jgg"]
|
||||
[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"]
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://hdfejdnmp8sl"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://umop2b1m1qm8" path="res://scripts/CSharp/GameEntity/Management/EntityManager.cs" id="1_2bwns"]
|
||||
[ext_resource type="Script" uid="uid://bogqp274y1pgr" path="res://scripts/CSharp/GameEntity/Management/EntityNodeCreator.cs" id="2_8m173"]
|
||||
[ext_resource type="PackedScene" uid="uid://sbf12hin4kes" path="res://prefabs/Interactables/trash_object.tscn" id="3_v3vdc"]
|
||||
|
||||
[node name="EntityManager" type="Node" node_paths=PackedStringArray("_nodeCreator")]
|
||||
script = ExtResource("1_2bwns")
|
||||
_nodeCreator = NodePath("EntityCreator")
|
||||
|
||||
[node name="EntityCreator" type="Node" parent="."]
|
||||
script = ExtResource("2_8m173")
|
||||
_entityPrefabs = Dictionary[String, PackedScene]({
|
||||
"TrashEntity": ExtResource("3_v3vdc")
|
||||
})
|
||||
+16
-1
@@ -11,7 +11,7 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="Babushka"
|
||||
run/main_scene="uid://bopv10dqm1knc"
|
||||
run/main_scene="uid://66pmq4efjip8"
|
||||
config/features=PackedStringArray("4.5", "C#", "Forward Plus")
|
||||
run/max_fps=120
|
||||
boot_splash/fullsize=false
|
||||
@@ -35,6 +35,7 @@ FightWorldAutoload="*res://prefabs/fight/fight_world_autoload.tscn"
|
||||
SaveGameManager="*res://scripts/CSharp/Common/Savegame/SaveGameManager.cs"
|
||||
SettingsSaveController="*res://scripts/CSharp/Common/Savegame/SettingsSaveController.cs"
|
||||
DayAndNight="*res://prefabs/day_and_night/day_and_night.tscn"
|
||||
EntityManager="*res://prefabs/entity_system/entity_manager.tscn"
|
||||
|
||||
[dialogic]
|
||||
|
||||
@@ -224,6 +225,10 @@ folder_colors={
|
||||
"res://shader/": "pink"
|
||||
}
|
||||
|
||||
[filesystem]
|
||||
|
||||
import/blender/enabled=false
|
||||
|
||||
[global_group]
|
||||
|
||||
Saveable=""
|
||||
@@ -310,6 +315,16 @@ NextDayCheat={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
DebugEntities={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":66,"key_label":0,"unicode":98,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
SaveGame={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194336,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[internationalization]
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -897,15 +897,6 @@ scale = Vector2(3.25, 1)
|
||||
skew = 1.309
|
||||
texture = ExtResource("25_l6ca2")
|
||||
|
||||
[node name="EndLeft3" type="Sprite2D" parent="Fence"]
|
||||
texture_repeat = 2
|
||||
material = SubResource("ShaderMaterial_ualyd")
|
||||
position = Vector2(8133.001, 2924.0042)
|
||||
rotation = -1.5847566
|
||||
scale = Vector2(3.619918, 1.0631187)
|
||||
skew = 1.1688291
|
||||
texture = ExtResource("25_l6ca2")
|
||||
|
||||
[node name="EndLeft2" type="Sprite2D" parent="Fence"]
|
||||
texture_repeat = 2
|
||||
material = SubResource("ShaderMaterial_ualyd")
|
||||
@@ -1004,7 +995,7 @@ position = Vector2(146, -130)
|
||||
shape = SubResource("CircleShape2D_p6n74")
|
||||
|
||||
[node name="CanGenericPickup" parent="YSorted" instance=ExtResource("32_cw83k")]
|
||||
position = Vector2(6855, 3507)
|
||||
position = Vector2(8192, 3507)
|
||||
metadata/SaveID = "5a823507-8107-40ce-8b32-6d0f81a3c44e"
|
||||
|
||||
[node name="SpawnWithItem" parent="YSorted/CanGenericPickup" index="0"]
|
||||
@@ -1020,7 +1011,7 @@ shape = SubResource("CircleShape2D_2065p")
|
||||
offset = Vector2(0, -50)
|
||||
|
||||
[node name="RakeGenericPickup" parent="YSorted" instance=ExtResource("32_cw83k")]
|
||||
position = Vector2(4738, 2042)
|
||||
position = Vector2(8391, 2060)
|
||||
metadata/SaveID = "e13886b1-2131-4072-bc06-7d8abb19357b"
|
||||
|
||||
[node name="SpawnWithItem" parent="YSorted/RakeGenericPickup" index="0"]
|
||||
@@ -1033,7 +1024,6 @@ metadata/SaveID = "c148aa78-114b-4770-a040-8498483edb1d"
|
||||
shape = SubResource("CircleShape2D_tm0yg")
|
||||
|
||||
[node name="SeedPickup" parent="YSorted" instance=ExtResource("32_cw83k")]
|
||||
visible = false
|
||||
position = Vector2(9927, 2257)
|
||||
_finiteSupply = 3
|
||||
metadata/SaveID = "e1bbe13f-0622-42b8-97f3-87a8af369dc0"
|
||||
@@ -1051,7 +1041,6 @@ shape = SubResource("CircleShape2D_tm0yg")
|
||||
scale = Vector2(1, 1)
|
||||
|
||||
[node name="SeedPickup2" parent="YSorted" instance=ExtResource("32_cw83k")]
|
||||
visible = false
|
||||
position = Vector2(10705, 2257)
|
||||
_finiteSupply = 3
|
||||
metadata/SaveID = "77972c50-63a7-461a-bc7d-6fa46333bc5c"
|
||||
@@ -2243,20 +2232,6 @@ position = Vector2(9259, 3194)
|
||||
_penTarget = NodePath("../../pen/penSlot2")
|
||||
metadata/SaveID = "94c8a740-2745-4162-91e7-66f36b8681e0"
|
||||
|
||||
[node name="Duck8" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("50_6330x")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(10459, 2630)
|
||||
_penTarget = NodePath("../../pen/penSlot2")
|
||||
metadata/SaveID = "94c8a740-2745-4162-91e7-66f36b8681e0"
|
||||
|
||||
[node name="Duck9" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("50_6330x")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(12411, 2979)
|
||||
_penTarget = NodePath("../../pen/penSlot2")
|
||||
metadata/SaveID = "94c8a740-2745-4162-91e7-66f36b8681e0"
|
||||
|
||||
[node name="Duck4" parent="YSorted/ducks" node_paths=PackedStringArray("_penTarget") instance=ExtResource("50_6330x")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
@@ -2320,7 +2295,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
|
||||
position = Vector2(-569, -42)
|
||||
@@ -2328,13 +2302,13 @@ position = Vector2(-569, -42)
|
||||
[node name="trashObject" parent="YSorted/trash" instance=ExtResource("53_j4nx2")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(10051, 3026)
|
||||
position = Vector2(1269, 3170)
|
||||
metadata/SaveID = "f6bf35b0-a145-4a8d-a946-38dc6ee53507"
|
||||
|
||||
[node name="trashObject2" parent="YSorted/trash" instance=ExtResource("53_j4nx2")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(13710, 2355)
|
||||
position = Vector2(3183, 2369)
|
||||
offset = Vector2(1, -50)
|
||||
region_rect = Rect2(207, 1184, 149, 142)
|
||||
metadata/SaveID = "1b175e9c-f4a6-4b30-b024-95ab1a6c4ec7"
|
||||
@@ -2342,7 +2316,7 @@ metadata/SaveID = "1b175e9c-f4a6-4b30-b024-95ab1a6c4ec7"
|
||||
[node name="trashObject3" parent="YSorted/trash" instance=ExtResource("53_j4nx2")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(13463, 3519)
|
||||
position = Vector2(4724, 3519)
|
||||
offset = Vector2(1, -50)
|
||||
region_rect = Rect2(400, 1053, 163, 141)
|
||||
metadata/SaveID = "28770149-73d5-45bd-b760-6e84a07c59b8"
|
||||
@@ -2350,7 +2324,7 @@ metadata/SaveID = "28770149-73d5-45bd-b760-6e84a07c59b8"
|
||||
[node name="trashObject4" parent="YSorted/trash" instance=ExtResource("53_j4nx2")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(14239, 2353)
|
||||
position = Vector2(5385, 3391)
|
||||
offset = Vector2(1, -50)
|
||||
region_rect = Rect2(1048, 1092, 348, 106)
|
||||
metadata/SaveID = "1cbdfeb5-68d4-4489-896e-7879e7baa26f"
|
||||
@@ -2358,7 +2332,7 @@ metadata/SaveID = "1cbdfeb5-68d4-4489-896e-7879e7baa26f"
|
||||
[node name="trashObject5" parent="YSorted/trash" instance=ExtResource("53_j4nx2")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(15935, 2541)
|
||||
position = Vector2(8051, 2541)
|
||||
offset = Vector2(1, -50)
|
||||
region_rect = Rect2(531, 1207, 176, 167)
|
||||
metadata/SaveID = "b6bdce90-0b79-45c8-a2d1-3078a58d3314"
|
||||
@@ -2526,8 +2500,6 @@ script = ExtResource("79_m37ba")
|
||||
[connection signal="GoalReached" from="YSorted/ducks" to="YSorted/ducks/DialogicToggle" method="ToggleDialogue"]
|
||||
[connection signal="DuckCollected" from="YSorted/ducks/Duck2" to="YSorted/ducks" method="Increment"]
|
||||
[connection signal="DuckCollected" from="YSorted/ducks/Duck3" to="YSorted/ducks" method="Increment"]
|
||||
[connection signal="DuckCollected" from="YSorted/ducks/Duck8" to="YSorted/ducks" method="Increment"]
|
||||
[connection signal="DuckCollected" from="YSorted/ducks/Duck9" to="YSorted/ducks" method="Increment"]
|
||||
[connection signal="DuckCollected" from="YSorted/ducks/Duck4" to="YSorted/ducks" method="Increment"]
|
||||
[connection signal="DuckCollected" from="YSorted/ducks/Duck5" to="YSorted/ducks" method="Increment"]
|
||||
[connection signal="DuckCollected" from="YSorted/ducks/Duck6" to="YSorted/ducks" method="Increment"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=109 format=3 uid="uid://bsaworp0kp2gb"]
|
||||
[gd_scene load_steps=109 format=3 uid="uid://cfax63b8gwgjf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_yi67q"]
|
||||
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="2_8skws"]
|
||||
@@ -1016,7 +1016,6 @@ modulate = Color(0.24313726, 0.1882353, 0.5294118, 1)
|
||||
[node name="SeedPickup" parent="YSorted" instance=ExtResource("32_lcoqd")]
|
||||
visible = false
|
||||
position = Vector2(9927, 2257)
|
||||
_finiteSupply = 3
|
||||
metadata/SaveID = "e1bbe13f-0622-42b8-97f3-87a8af369dc0"
|
||||
|
||||
[node name="SpawnWithItem" parent="YSorted/SeedPickup" index="0"]
|
||||
@@ -1037,7 +1036,6 @@ scale = Vector2(1, 1)
|
||||
[node name="SeedPickup2" parent="YSorted" instance=ExtResource("32_lcoqd")]
|
||||
visible = false
|
||||
position = Vector2(10705, 2257)
|
||||
_finiteSupply = 3
|
||||
metadata/SaveID = "77972c50-63a7-461a-bc7d-6fa46333bc5c"
|
||||
|
||||
[node name="SpawnWithItem" parent="YSorted/SeedPickup2" index="0"]
|
||||
|
||||
@@ -228,7 +228,7 @@ _sceneNamesToLoad = PackedStringArray("res://scenes/scene_indoor_vesnas_room.tsc
|
||||
[node name="Table" type="Sprite2D" parent="Foreground"]
|
||||
z_index = 2
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-1883, 1051)
|
||||
position = Vector2(-1888, 1112)
|
||||
texture = ExtResource("2_ufnxe")
|
||||
offset = Vector2(0, -200)
|
||||
region_enabled = true
|
||||
@@ -237,7 +237,7 @@ region_rect = Rect2(1012, 1743, 1470, 417)
|
||||
[node name="Chair" type="Sprite2D" parent="Foreground"]
|
||||
z_index = 3
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-3037, 2025)
|
||||
position = Vector2(-3032, 2096)
|
||||
texture = ExtResource("3_pejp6")
|
||||
offset = Vector2(216, -1064)
|
||||
region_enabled = true
|
||||
@@ -245,14 +245,13 @@ region_rect = Rect2(1534, 1976, 379, 184)
|
||||
|
||||
[node name="Chair2" type="Sprite2D" parent="Foreground"]
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-1069, 2013)
|
||||
position = Vector2(-1064, 2064)
|
||||
texture = ExtResource("3_pejp6")
|
||||
offset = Vector2(184, -1056)
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1534, 1976, 379, 184)
|
||||
|
||||
[node name="Samowar" type="Sprite2D" parent="Foreground"]
|
||||
visible = false
|
||||
z_index = 1
|
||||
y_sort_enabled = true
|
||||
position = Vector2(-1904, 1192)
|
||||
@@ -564,12 +563,12 @@ region_rect = Rect2(2748, 432, 174, 191)
|
||||
|
||||
[node name="Vesna" parent="." instance=ExtResource("26_yq173")]
|
||||
y_sort_enabled = false
|
||||
position = Vector2(-2296, 573)
|
||||
position = Vector2(-4473, 319)
|
||||
|
||||
[node name="Yeli" parent="." instance=ExtResource("27_pfr1s")]
|
||||
z_index = 0
|
||||
y_sort_enabled = false
|
||||
position = Vector2(-1258, 648)
|
||||
position = Vector2(-2841, 198)
|
||||
_timelinesToPlay = PackedStringArray("yeli_intro_05")
|
||||
|
||||
[node name="InteractionArea" parent="Yeli" index="0"]
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://bvp5ju36h1vl2"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://bvp5ju36h1vl2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_ftmt4"]
|
||||
[ext_resource type="Texture2D" uid="uid://da67c7avarwq2" path="res://art/indoor/kitchen_bgAssets.png" id="2_qsw8g"]
|
||||
[ext_resource type="Texture2D" uid="uid://x7trh4dgsvoe" path="res://art/indoor/room export/Room_01_assets.png" id="5_3wvmt"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="7_6mpmc"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfvgp1my5rydh" path="res://prefabs/characters/Yeli.tscn" id="8_6asqd"]
|
||||
[ext_resource type="Texture2D" uid="uid://djewfwrdt4iv3" path="res://art/ui/UI/icons/icon-fruit-beetroot.png" id="9_nd6ln"]
|
||||
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Vesna.tscn" id="25_58hm8"]
|
||||
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="30_wqpex"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="31_jyyyu"]
|
||||
@@ -217,14 +215,14 @@ _followNode = NodePath("../Vesna/CharacterBody2D")
|
||||
|
||||
[node name="cupboard" type="Sprite2D" parent="BackItems"]
|
||||
z_index = -10
|
||||
position = Vector2(-352.5, 153)
|
||||
position = Vector2(-2071, 114)
|
||||
texture = ExtResource("2_qsw8g")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1359, 440, 1591, 401)
|
||||
|
||||
[node name="wallshelf" type="Sprite2D" parent="BackItems"]
|
||||
z_index = -10
|
||||
position = Vector2(10.5, -296)
|
||||
position = Vector2(-1708, -335)
|
||||
texture = ExtResource("2_qsw8g")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(3037, 440, 701, 170)
|
||||
@@ -248,7 +246,6 @@ region_rect = Rect2(2748, 432, 174, 191)
|
||||
|
||||
[node name="FrontItems" type="Node2D" parent="."]
|
||||
z_index = 50
|
||||
position = Vector2(-28, -119)
|
||||
|
||||
[node name="Stove" type="Sprite2D" parent="FrontItems"]
|
||||
position = Vector2(-2482, 926)
|
||||
@@ -277,14 +274,6 @@ texture = ExtResource("2_qsw8g")
|
||||
region_enabled = true
|
||||
region_rect = Rect2(1599, 1107, 1351, 418)
|
||||
|
||||
[node name="Yeli" parent="." instance=ExtResource("8_6asqd")]
|
||||
position = Vector2(-2694, 989)
|
||||
|
||||
[node name="IconFruitBeetroot" type="Sprite2D" parent="."]
|
||||
position = Vector2(-625, -73)
|
||||
rotation = -1.0380759
|
||||
texture = ExtResource("9_nd6ln")
|
||||
|
||||
[connection signal="InteractedTool" from="Background/Room01DoorL/CommonRoomDoor" to="." method="LoadSceneAtIndex"]
|
||||
[connection signal="Interacted" from="FrontItems/Stove/Firetoggle" to="FrontItems/Stove/Fireleft" method="hide"]
|
||||
[connection signal="Interacted" from="FrontItems/Stove/Firetoggle" to="FrontItems/Stove/FireRight" method="hide"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=19 format=3 uid="uid://ceaa2qj2bmw43"]
|
||||
[gd_scene load_steps=18 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"]
|
||||
@@ -10,7 +10,6 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dnlhlf1mx01h5" path="res://art/indoor/vesna_indoor_door.png" id="11_axs81"]
|
||||
[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="Texture2D" uid="uid://bleimj6jr1jka" path="res://art/general/rectangle.png" id="14_axs81"]
|
||||
[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"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="24_xwo8y"]
|
||||
@@ -75,7 +74,6 @@ shape = SubResource("RectangleShape2D_2spkc")
|
||||
[node name="BackWall" type="Node" parent="."]
|
||||
|
||||
[node name="Room01Walls2" type="Sprite2D" parent="BackWall"]
|
||||
modulate = Color(0.16470589, 0, 0.49803922, 1)
|
||||
z_index = -100
|
||||
position = Vector2(4992, -487)
|
||||
scale = Vector2(2, 2)
|
||||
@@ -83,7 +81,6 @@ texture = ExtResource("2_j25a2")
|
||||
offset = Vector2(-2768, 264)
|
||||
|
||||
[node name="Room01Shelf" type="Sprite2D" parent="BackWall"]
|
||||
modulate = Color(0.16470589, 0, 0.49803922, 1)
|
||||
z_index = -50
|
||||
position = Vector2(-1978, -678)
|
||||
texture = ExtResource("13_11fdt")
|
||||
@@ -122,7 +119,6 @@ questResource = ExtResource("9_heyef")
|
||||
toStatus = 2
|
||||
|
||||
[node name="Bedsprite" type="Sprite2D" parent="BedInteraction"]
|
||||
modulate = Color(0.16470589, 0, 0.49803922, 1)
|
||||
z_index = -99
|
||||
position = Vector2(4925, -967)
|
||||
scale = Vector2(2, 2)
|
||||
@@ -139,7 +135,6 @@ _id = 0
|
||||
shape = SubResource("CircleShape2D_2spkc")
|
||||
|
||||
[node name="Doorsprite" type="Sprite2D" parent="DoorInteraction"]
|
||||
modulate = Color(0.16470589, 0, 0.49803922, 1)
|
||||
z_index = -99
|
||||
position = Vector2(5559, -961)
|
||||
scale = Vector2(2, 2)
|
||||
@@ -154,13 +149,6 @@ _sceneIndexToLoad = 1
|
||||
[node name="CountDayUp" type="Node" parent="NightStarter"]
|
||||
script = ExtResource("11_heyef")
|
||||
|
||||
[node name="PointLight2D" type="PointLight2D" parent="."]
|
||||
position = Vector2(-630, -568)
|
||||
scale = Vector2(2.5, 1.3)
|
||||
color = Color(1, 0.73333335, 0.69803923, 1)
|
||||
energy = 1.86
|
||||
texture = ExtResource("14_axs81")
|
||||
|
||||
[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"]
|
||||
|
||||
@@ -77,23 +77,10 @@ custom_minimum_size = Vector2(100, 80)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 36
|
||||
toggle_mode = true
|
||||
text = "Settings
|
||||
"
|
||||
|
||||
[node name="MarginContainer4" type="MarginContainer" parent="CanvasLayer/TextureRect/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="Quit" type="Button" parent="CanvasLayer/TextureRect/VBoxContainer/MarginContainer4"]
|
||||
custom_minimum_size = Vector2(100, 80)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 36
|
||||
toggle_mode = true
|
||||
text = "Quit
|
||||
"
|
||||
|
||||
[connection signal="pressed" from="CanvasLayer/TextureRect/VBoxContainer/MarginContainer/Continue" to="." method="LoadScene"]
|
||||
[connection signal="pressed" from="CanvasLayer/TextureRect/VBoxContainer/MarginContainer2/New Game" to="." method="LoadScene"]
|
||||
[connection signal="pressed" from="CanvasLayer/TextureRect/VBoxContainer/MarginContainer2/New Game" to="CanvasLayer/TextureRect/VBoxContainer/MarginContainer2/New Game" method="Reset"]
|
||||
[connection signal="pressed" from="CanvasLayer/TextureRect/VBoxContainer/MarginContainer4/Quit" to="." method="Quit"]
|
||||
[connection signal="pressed" from="CanvasLayer/TextureRect/VBoxContainer/MarginContainer3/Quit" to="." method="Quit"]
|
||||
|
||||
@@ -5,7 +5,7 @@ using Godot.Collections;
|
||||
/// <summary>
|
||||
/// Simple collectible scene objects with saveable state.
|
||||
/// </summary>
|
||||
public partial class TrashObject : Sprite2D, ISaveable
|
||||
public partial class TrashObject : Sprite2D, ISaveable // deprecated
|
||||
{
|
||||
private bool _collected;
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
using Babushka.scripts.CSharp.GameEntity.LoadSave;
|
||||
using Godot;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Inventory;
|
||||
|
||||
// Do not instantiate this resource
|
||||
// But it has to be a resource because Godot
|
||||
[GlobalClass]
|
||||
public partial class ItemInstance: Resource
|
||||
public partial class ItemInstance : Resource, IJsonSerializable
|
||||
{
|
||||
[Export] public required ItemResource blueprint;
|
||||
[Export] public int amount = 1;
|
||||
@@ -17,4 +20,18 @@ public partial class ItemInstance: Resource
|
||||
amount = amount
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadFromJson(JObject json)
|
||||
{
|
||||
var blueprintPath = json.GetStringValue("blueprint");
|
||||
blueprint = GD.Load<ItemResource>(blueprintPath);
|
||||
amount = json.GetIntValue("amount");
|
||||
}
|
||||
|
||||
public JObject SaveToJson()
|
||||
{
|
||||
return new(
|
||||
new JProperty("blueprint", blueprint.ResourcePath),
|
||||
new JProperty("amount", amount));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Godot;
|
||||
using Babushka.scripts.CSharp.GameEntity.LoadSave;
|
||||
using Godot;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.Common.Inventory;
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Babushka.scripts.CSharp.GameEntity.LoadSave;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
|
||||
public class Entity
|
||||
{
|
||||
public long id;
|
||||
public virtual string EntityType => "";
|
||||
|
||||
public Entity()
|
||||
{
|
||||
id = new Random().NextInt64();
|
||||
}
|
||||
|
||||
public virtual void SaveEntity(JObject json)
|
||||
{
|
||||
json["id"] = id;
|
||||
json["type"] = EntityType;
|
||||
}
|
||||
|
||||
public virtual void LoadEntity(JObject json)
|
||||
{
|
||||
id = json.GetLongValue("id");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://hnmpt23ovfgl
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Transactions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
|
||||
public class LoadedScenesEntity : Entity
|
||||
{
|
||||
private HashSet<string> _loadedScenes = new();
|
||||
public override string EntityType => OWN_TYPE_NAME;
|
||||
public const string OWN_TYPE_NAME = "LoadedScenesEntity";
|
||||
|
||||
public void AddScene(string sceneName) => _loadedScenes.Add(sceneName);
|
||||
|
||||
public bool WasSceneLoaded(string sceneName) => _loadedScenes.Contains(sceneName);
|
||||
|
||||
public override void SaveEntity(JObject json)
|
||||
{
|
||||
base.SaveEntity(json);
|
||||
json["scenes"] = new JArray(_loadedScenes);
|
||||
}
|
||||
|
||||
public override void LoadEntity(JObject json)
|
||||
{
|
||||
base.LoadEntity(json);
|
||||
JArray array = (JArray?) json["scenes"] ?? throw new Exception("No scenes found in LoadedScenesEntity.");
|
||||
|
||||
_loadedScenes = array.ToObject<HashSet<string>>()!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://rabb1y637cm5
|
||||
@@ -0,0 +1,35 @@
|
||||
using Babushka.scripts.CSharp.GameEntity.LoadSave;
|
||||
using Godot;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
|
||||
public abstract class PositionalEntity : Entity
|
||||
{
|
||||
public Vector2 position;
|
||||
public string sceneName = "none";
|
||||
|
||||
public override void SaveEntity(JObject json)
|
||||
{
|
||||
base.SaveEntity(json);
|
||||
json["posx"] = position.X;
|
||||
json["posy"] = position.Y;
|
||||
json["scene"] = sceneName;
|
||||
}
|
||||
|
||||
public override void LoadEntity(JObject json)
|
||||
{
|
||||
base.LoadEntity(json);
|
||||
position = new Vector2(
|
||||
json.GetFloatValue("posx"),
|
||||
json.GetFloatValue("posy"));
|
||||
sceneName = json.GetStringValue("scene");
|
||||
}
|
||||
|
||||
// Deals with Instantiation of the node
|
||||
public abstract void InstantiateEntityNode(Node2D parent);
|
||||
|
||||
// Deals with Removal of the node before the whole scene is unloaded
|
||||
public abstract void RemoveEntityNode();
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bs38dulqv7sop
|
||||
@@ -0,0 +1,34 @@
|
||||
using Babushka.scripts.CSharp.GameEntity.EntityNodes;
|
||||
using Babushka.scripts.CSharp.GameEntity.Management;
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
|
||||
public class TrashEntity : PositionalEntity
|
||||
{
|
||||
public override string EntityType => OWN_TYPE_NAME;
|
||||
public const string OWN_TYPE_NAME = "TrashEntity";
|
||||
private EntityNodeCreator _creator;
|
||||
private TrashEntityNode? _entityNode;
|
||||
|
||||
public TrashEntity()
|
||||
{
|
||||
}
|
||||
|
||||
public override void InstantiateEntityNode(Node2D parent)
|
||||
{
|
||||
if (_creator == null) _creator = EntityManager.Instance.NodeCreator;
|
||||
var entityNode = _creator.InstantiateNode(EntityType);
|
||||
parent.AddChild(entityNode);
|
||||
entityNode.GlobalPosition = position;
|
||||
var trashEntityNode = (TrashEntityNode)entityNode;
|
||||
trashEntityNode.Initialize(this);
|
||||
_entityNode = trashEntityNode;
|
||||
}
|
||||
|
||||
public override void RemoveEntityNode()
|
||||
{
|
||||
if(_entityNode.IsValid())
|
||||
_entityNode!.QueueFree();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://c31k34epunk5t
|
||||
@@ -0,0 +1,20 @@
|
||||
using Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
using Babushka.scripts.CSharp.GameEntity.Management;
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.EntityNodes;
|
||||
|
||||
public partial class TrashEntityNode : Node2D
|
||||
{
|
||||
private TrashEntity _trashEntity;
|
||||
|
||||
public void Initialize(TrashEntity trashEntity)
|
||||
{
|
||||
_trashEntity = trashEntity;
|
||||
}
|
||||
|
||||
public void Collect()
|
||||
{
|
||||
EntityManager.Instance.RemoveEntity(_trashEntity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://d3n8kwva4pxx5
|
||||
@@ -0,0 +1,26 @@
|
||||
using Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
using Babushka.scripts.CSharp.GameEntity.Management;
|
||||
using Godot;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.EntityPlacer;
|
||||
|
||||
public partial class TrashEntityPlacer : Node2D
|
||||
{
|
||||
private string _trashEntityType = TrashEntity.OWN_TYPE_NAME;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
string sceneName = EntityManager.Instance.CurrentEntitySceneContainer!.sceneName;
|
||||
var loadedScenesEntity = EntityManager.Instance.GetUniqueEntity<LoadedScenesEntity>();
|
||||
|
||||
if (!loadedScenesEntity.WasSceneLoaded(sceneName))
|
||||
{
|
||||
TrashEntity entity = new TrashEntity();
|
||||
entity.sceneName = sceneName;
|
||||
entity.position = GlobalPosition;
|
||||
EntityManager.Instance.AddEntity(entity);
|
||||
}
|
||||
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bilg7e33usxuv
|
||||
@@ -0,0 +1,44 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.LoadSave;
|
||||
|
||||
public static class EntityLoadSaveUtil
|
||||
{
|
||||
private static void AssertTokenType(this JObject json, string key, JTokenType type)
|
||||
{
|
||||
var token = json[key];
|
||||
if (token == null) throw new MalformedJsonException(json, key, "does not exist");
|
||||
//if (!token.HasValues) throw new MalformedJsonException(json, key, "has no value");
|
||||
if (token.Type != type) throw new MalformedJsonException(json, key, $"is not of type {type}");
|
||||
}
|
||||
|
||||
public static long GetLongValue(this JObject json, string key)
|
||||
{
|
||||
AssertTokenType(json, key, JTokenType.Integer);
|
||||
return json.Value<long>(key);
|
||||
}
|
||||
|
||||
public static int GetIntValue(this JObject json, string key)
|
||||
{
|
||||
AssertTokenType(json, key, JTokenType.Integer);
|
||||
return json.Value<int>(key);
|
||||
}
|
||||
|
||||
public static float GetFloatValue(this JObject json, string key)
|
||||
{
|
||||
AssertTokenType(json, key, JTokenType.Float);
|
||||
return json.Value<float>(key);
|
||||
}
|
||||
|
||||
public static JObject GetObject(this JObject json, string key)
|
||||
{
|
||||
AssertTokenType(json, key, JTokenType.Object);
|
||||
return json.Value<JObject>(key)!;
|
||||
}
|
||||
|
||||
public static string GetStringValue(this JObject json, string key)
|
||||
{
|
||||
AssertTokenType(json, key, JTokenType.String);
|
||||
return json.Value<string>(key)!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://ccu6p418viliu
|
||||
@@ -0,0 +1,9 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.LoadSave;
|
||||
|
||||
public interface IJsonSerializable
|
||||
{
|
||||
public void LoadFromJson(JObject json);
|
||||
public JObject SaveToJson();
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://cuma3347l55mb
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.LoadSave;
|
||||
|
||||
public class MalformedJsonException(JObject actualJson, string key, string problem) : Exception
|
||||
{
|
||||
public override string Message => $"JsonObject was malformed: {key} {problem}";
|
||||
public override IDictionary Data => new Dictionary<string, JObject> { { "json", actualJson } };
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://d1o066hh84ow
|
||||
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
using Godot;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Entity = Babushka.scripts.CSharp.GameEntity.Entities.Entity;
|
||||
using PositionalEntity = Babushka.scripts.CSharp.GameEntity.Entities.PositionalEntity;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Management;
|
||||
|
||||
/// <summary>
|
||||
/// Manages the lifecycle and interactions of all entities within the game, including their creation, retrieval,
|
||||
/// and organization. The EntityManager serves as a centralized hub for managing both standard and positional entities.
|
||||
/// </summary>
|
||||
public partial class EntityManager : Node
|
||||
{
|
||||
public static EntityManager Instance;
|
||||
|
||||
[Export] private EntityNodeCreator _nodeCreator = null!;
|
||||
[Export] private string saveDirectory = "user://save_data/";
|
||||
|
||||
private EntitySceneContainer? _currentEntitySceneContainer;
|
||||
private readonly List<Entity> _allEntities = new();
|
||||
|
||||
public IEnumerable<Entity> AllEntities => _allEntities;
|
||||
public IEnumerable<PositionalEntity> AllPositionalEntities => _allEntities.OfType<PositionalEntity>();
|
||||
public EntitySceneContainer? CurrentEntitySceneContainer => _currentEntitySceneContainer;
|
||||
public EntityNodeCreator NodeCreator => _nodeCreator;
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
Instance = this;
|
||||
Load();
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
// for debugging purposes
|
||||
if (@event.IsActionPressed("DebugEntities"))
|
||||
{
|
||||
GD.Print("Entities:");
|
||||
foreach (var entity in AllEntities)
|
||||
{
|
||||
GD.Print(entity.EntityType + " " + entity.id);
|
||||
}
|
||||
}
|
||||
|
||||
if(@event.IsActionPressed("SaveGame")) Save();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
JArray array = new JArray();
|
||||
foreach (var entity in AllEntities)
|
||||
{
|
||||
JObject saveData = new JObject();
|
||||
entity.SaveEntity(saveData);
|
||||
array.Add(saveData);
|
||||
}
|
||||
|
||||
using var SaveFile = FileAccess.Open(saveDirectory + "save.json", FileAccess.ModeFlags.Write);
|
||||
SaveFile.StoreString(array.ToString());
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
using var saveFile = FileAccess.Open(saveDirectory + "save.json", FileAccess.ModeFlags.Read);
|
||||
if (saveFile == null) return;
|
||||
|
||||
JArray array = JArray.Parse(saveFile.GetAsText());
|
||||
|
||||
foreach (var token in array)
|
||||
{
|
||||
var jobj = (JObject)token;
|
||||
|
||||
if (jobj == null) continue;
|
||||
|
||||
if (jobj.TryGetValue("type", out var entityType))
|
||||
{
|
||||
string entityTypeString = (string) entityType!;
|
||||
Entity entity = InitializeEntity(entityTypeString);
|
||||
entity.LoadEntity(jobj);
|
||||
AddEntity(entity);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Entity InitializeEntity(string type)
|
||||
{
|
||||
Entity entity = type switch
|
||||
{
|
||||
TrashEntity.OWN_TYPE_NAME => new TrashEntity(),
|
||||
LoadedScenesEntity.OWN_TYPE_NAME => new LoadedScenesEntity(),
|
||||
_ => throw new Exception($"Trying to load unknown entity type: {type}")
|
||||
};
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
#region ENTITY MANAGEMENT
|
||||
|
||||
/// <summary>
|
||||
/// Adds an entity to the list of managed entities. If the entity is a positional entity
|
||||
/// and its scene matches the current scene container, it is also instantiated in the scene.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity to be added to the manager.</param>
|
||||
public void AddEntity(Entity entity)
|
||||
{
|
||||
if (!_allEntities.Contains(entity))
|
||||
_allEntities.Add(entity);
|
||||
if(entity is PositionalEntity positionalEntity && positionalEntity.sceneName == _currentEntitySceneContainer?.sceneName)
|
||||
InstantiatePositionalEntityNode(positionalEntity);
|
||||
}
|
||||
|
||||
private void InstantiatePositionalEntityNode(PositionalEntity entity)
|
||||
{
|
||||
if(_currentEntitySceneContainer == null) return;
|
||||
entity.InstantiateEntityNode(_currentEntitySceneContainer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the first entity of the specified type from the list of managed entities.
|
||||
/// If no such entity exists, creates a new instance of the specified type, adds it to the manager, and returns it.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of entity to retrieve or create. Must inherit from the Entity class and have a parameterless constructor.</typeparam>
|
||||
/// <returns>The first entity of the specified type or a newly created entity of that type if none were found.</returns>
|
||||
public T GetUniqueEntity<T>() where T : Entity, new()
|
||||
{
|
||||
var result = AllEntities.OfType<T>().FirstOrDefault();
|
||||
if (result == null)
|
||||
{
|
||||
var newEntity = new T();
|
||||
AddEntity(newEntity);
|
||||
result = newEntity;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region SCENE CONTAINER ACCESS
|
||||
|
||||
public void SetSceneContainer(EntitySceneContainer sceneContainer)
|
||||
{
|
||||
_currentEntitySceneContainer = sceneContainer;
|
||||
}
|
||||
|
||||
public void UnsetSceneContainer()
|
||||
{
|
||||
_currentEntitySceneContainer = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void RemoveEntity(Entity entity)
|
||||
{
|
||||
_allEntities.Remove(entity);
|
||||
if (entity is PositionalEntity positionalEntity)
|
||||
{
|
||||
positionalEntity.RemoveEntityNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://umop2b1m1qm8
|
||||
@@ -0,0 +1,22 @@
|
||||
using Godot;
|
||||
using PositionalEntity = Babushka.scripts.CSharp.GameEntity.Entities.PositionalEntity;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Management;
|
||||
|
||||
public static class EntityManagerUtil
|
||||
{
|
||||
public static void AddIfNeeded(this EntitySceneContainer? self, PositionalEntity entity)
|
||||
{
|
||||
if(self == null) return;
|
||||
if(self.sceneName != entity.sceneName) return;
|
||||
|
||||
self.AddEntity(entity);
|
||||
}
|
||||
|
||||
public static bool IsValid<T>(this T? node) where T : GodotObject
|
||||
{
|
||||
return node != null
|
||||
&& GodotObject.IsInstanceValid(node)
|
||||
&& !node.IsQueuedForDeletion();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://dc3283h7sx4cl
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Management;
|
||||
|
||||
public partial class EntityNodeCreator : Node
|
||||
{
|
||||
[Export] private Dictionary<string, PackedScene> _entityPrefabs;
|
||||
|
||||
public Node2D InstantiateNode(string type)
|
||||
{
|
||||
if (string.IsNullOrEmpty(type))
|
||||
{
|
||||
throw new NullReferenceException("The type provided for Node instantiation cannot be null or empty.");
|
||||
}
|
||||
|
||||
if (!_entityPrefabs.ContainsKey(type))
|
||||
{
|
||||
throw new Exception($"The type provided for Node instantiation ({type}) is not specified in the EntityNodeCreator dictionary.");
|
||||
}
|
||||
|
||||
return _entityPrefabs[type].Instantiate<Node2D>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bogqp274y1pgr
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Linq;
|
||||
using Babushka.scripts.CSharp.GameEntity.Entities;
|
||||
using Godot;
|
||||
using PositionalEntity = Babushka.scripts.CSharp.GameEntity.Entities.PositionalEntity;
|
||||
|
||||
namespace Babushka.scripts.CSharp.GameEntity.Management;
|
||||
|
||||
public partial class EntitySceneContainer : Node2D
|
||||
{
|
||||
[Export] public string sceneName = "none";
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
EntityManager.Instance.SetSceneContainer(this);
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
EntityManager.Instance.Save();
|
||||
EntityManager.Instance.UnsetSceneContainer();
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
AddAllEntities();
|
||||
CallDeferred(nameof(RegisterWithScenesEntity));
|
||||
}
|
||||
|
||||
private void RegisterWithScenesEntity()
|
||||
{
|
||||
var loadedScenesEntity = EntityManager.Instance.GetUniqueEntity<LoadedScenesEntity>();
|
||||
loadedScenesEntity.AddScene(sceneName);
|
||||
}
|
||||
|
||||
public void AddAllEntities()
|
||||
{
|
||||
foreach (var positionalEntity in EntityManager.Instance.AllPositionalEntities.Where(x => x.sceneName == sceneName))
|
||||
{
|
||||
AddEntity(positionalEntity);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddEntity(PositionalEntity entity)
|
||||
{
|
||||
entity.InstantiateEntityNode(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://ca1pg6k3gn47y
|
||||
@@ -12,6 +12,9 @@ uniform float brightness_add : hint_range(-1.0, 1.0) = 0.0;
|
||||
// Contrast multiplier in RGB space. 1.0 means no change.
|
||||
uniform float contrast_mult : hint_range(0.0, 2.0) = 1.0;
|
||||
|
||||
//Cached Color value to reapply modulate
|
||||
varying vec4 modulate;
|
||||
|
||||
// Converts an RGB color to HSV.
|
||||
vec3 rgb2hsv(vec3 c) {
|
||||
float cMax = max(max(c.r, c.g), c.b);
|
||||
@@ -65,6 +68,10 @@ vec3 hsv2rgb(vec3 c) {
|
||||
return rgb + vec3(m);
|
||||
}
|
||||
|
||||
void vertex(){
|
||||
modulate = COLOR;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
// Get the original texture color.
|
||||
vec4 tex_color = texture(TEXTURE, UV);
|
||||
@@ -89,4 +96,6 @@ void fragment() {
|
||||
|
||||
// Output the final color while preserving the original alpha.
|
||||
COLOR = vec4(col, tex_color.a);
|
||||
//reapply vertex color value to keep modulate changes
|
||||
COLOR = COLOR * modulate;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,14 @@ shader_type canvas_item;
|
||||
|
||||
uniform vec2 tiling_scale = vec2(5.0, 5.0);
|
||||
uniform sampler2D noise : repeat_enable;
|
||||
varying vec4 modulate;
|
||||
|
||||
void vertex() {
|
||||
modulate = COLOR;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = vec2(UV.x * tiling_scale.x, UV.y * tiling_scale.y); // Change 10.0 to control tiling scale
|
||||
COLOR = texture(TEXTURE, fract(uv));
|
||||
COLOR = COLOR * modulate;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ uniform float heightOffset : hint_range(0.0, 1.0);
|
||||
// With the offset value, you can if you want different moves for each asset. Just put a random value (1, 2, 3) in the editor. Don't forget to mark the material as unique if you use this
|
||||
uniform float offset = 0;
|
||||
|
||||
// caching color settings to reapply modulate value
|
||||
varying vec4 modulate;
|
||||
|
||||
float getWind(vec2 vertex, vec2 uv, float time){
|
||||
float diff = pow(maxStrength - minStrength, 2.0);
|
||||
float strength = clamp(minStrength + diff + sin(time / interval) * diff, minStrength, maxStrength) * strengthScale;
|
||||
@@ -47,8 +50,13 @@ float noise(vec2 x) {
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
modulate = COLOR;
|
||||
vec4 pos = MODEL_MATRIX * vec4(0.0, 0.0, 0.0, 1.0);
|
||||
//float time = TIME * speed + sin(VERTEX.x * noise(VERTEX.xy) * offset);
|
||||
float time = TIME * speed + sin(pos.x * offset) * cos( pos.x * offset) ;
|
||||
VERTEX.x += getWind(VERTEX.xy, UV, time);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
COLOR = modulate * COLOR;
|
||||
}
|
||||
Reference in New Issue
Block a user