Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ff426b0494 | |||
| 90616537bc |
@@ -1,3 +1,4 @@
|
|||||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArea3D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F8a54226fa2e1c9371a8091f24cfd744aef11fe6869527dc23b9b837623a29b9_003FArea3D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AArea3D_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F8a54226fa2e1c9371a8091f24cfd744aef11fe6869527dc23b9b837623a29b9_003FArea3D_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACastHelpers_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fd111abf504bf42b5968a609b168fd093b2e200_003Fbb_003F1c116fcd_003FCastHelpers_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ACastHelpers_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002Econfig_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fd111abf504bf42b5968a609b168fd093b2e200_003Fbb_003F1c116fcd_003FCastHelpers_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></wpf:ResourceDictionary>
|
||||||
+15
-5
@@ -1202,10 +1202,10 @@ _farmingControls = NodePath("FarmingControls")
|
|||||||
|
|
||||||
[node name="CharacterBody2D" type="CharacterBody2D" parent="." node_paths=PackedStringArray("_sprite")]
|
[node name="CharacterBody2D" type="CharacterBody2D" parent="." node_paths=PackedStringArray("_sprite")]
|
||||||
position = Vector2(0, 374)
|
position = Vector2(0, 374)
|
||||||
collision_layer = 3
|
collision_layer = 4
|
||||||
collision_mask = 3
|
collision_mask = 3
|
||||||
script = ExtResource("1_ssqtd")
|
script = ExtResource("1_ssqtd")
|
||||||
_speed = 750.0
|
_speed = 1500.0
|
||||||
_sprite = NodePath("visuals/Animated Sprites")
|
_sprite = NodePath("visuals/Animated Sprites")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
|
||||||
@@ -1233,7 +1233,7 @@ texture = ExtResource("292_28qer")
|
|||||||
region_enabled = true
|
region_enabled = true
|
||||||
region_rect = Rect2(980, 179, 374, 1233)
|
region_rect = Rect2(980, 179, 374, 1233)
|
||||||
|
|
||||||
[node name="WateringCan" type="Sprite2D" parent="CharacterBody2D/visuals"]
|
[node name="WateringCanEmpty" type="Sprite2D" parent="CharacterBody2D/visuals"]
|
||||||
visible = false
|
visible = false
|
||||||
position = Vector2(-38, -603)
|
position = Vector2(-38, -603)
|
||||||
scale = Vector2(0.5, 0.5)
|
scale = Vector2(0.5, 0.5)
|
||||||
@@ -1241,14 +1241,24 @@ texture = ExtResource("293_tyqby")
|
|||||||
region_enabled = true
|
region_enabled = true
|
||||||
region_rect = Rect2(-1, 1128, 417, 299)
|
region_rect = Rect2(-1, 1128, 417, 299)
|
||||||
|
|
||||||
|
[node name="WateringCanFull" type="Sprite2D" parent="CharacterBody2D/visuals"]
|
||||||
|
visible = false
|
||||||
|
modulate = Color(0.286, 0.16, 1, 1)
|
||||||
|
position = Vector2(-38, -603)
|
||||||
|
scale = Vector2(0.5, 0.5)
|
||||||
|
texture = ExtResource("293_tyqby")
|
||||||
|
region_enabled = true
|
||||||
|
region_rect = Rect2(-1, 1128, 417, 299)
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]
|
[node name="Camera2D" type="Camera2D" parent="CharacterBody2D"]
|
||||||
position = Vector2(26, -469)
|
position = Vector2(26, -469)
|
||||||
zoom = Vector2(0.3, 0.3)
|
zoom = Vector2(0.3, 0.3)
|
||||||
|
|
||||||
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_hoeSprite", "_wateringCanSprite", "_movingPlayer", "_camera")]
|
[node name="FarmingControls" type="Node2D" parent="." node_paths=PackedStringArray("_hoeSprite", "_wateringCanEmptySprite", "_wateringCanFilledSprite", "_movingPlayer", "_camera")]
|
||||||
script = ExtResource("291_31q85")
|
script = ExtResource("291_31q85")
|
||||||
_hoeSprite = NodePath("../CharacterBody2D/visuals/Hoe")
|
_hoeSprite = NodePath("../CharacterBody2D/visuals/Hoe")
|
||||||
_wateringCanSprite = NodePath("../CharacterBody2D/visuals/WateringCan")
|
_wateringCanEmptySprite = NodePath("../CharacterBody2D/visuals/WateringCanEmpty")
|
||||||
|
_wateringCanFilledSprite = NodePath("../CharacterBody2D/visuals/WateringCanFull")
|
||||||
_fieldPrefab = ExtResource("294_28qer")
|
_fieldPrefab = ExtResource("294_28qer")
|
||||||
_movingPlayer = NodePath("../CharacterBody2D")
|
_movingPlayer = NodePath("../CharacterBody2D")
|
||||||
_camera = NodePath("../CharacterBody2D/Camera2D")
|
_camera = NodePath("../CharacterBody2D/Camera2D")
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ script = ExtResource("2_femni")
|
|||||||
Tilled = ExtResource("3_lsfck")
|
Tilled = ExtResource("3_lsfck")
|
||||||
Watered = ExtResource("4_cus02")
|
Watered = ExtResource("4_cus02")
|
||||||
|
|
||||||
[node name="BasePlant" parent="FieldBehaviour" instance=ExtResource("5_femni")]
|
[node name="BasePlant" parent="FieldBehaviour" node_paths=PackedStringArray("_field") instance=ExtResource("5_femni")]
|
||||||
|
_field = NodePath("..")
|
||||||
|
|
||||||
[node name="BigPlant" parent="FieldBehaviour/BasePlant" index="2"]
|
[node name="BigPlant" parent="FieldBehaviour/BasePlant" index="2"]
|
||||||
position = Vector2(6, -161)
|
position = Vector2(6, -161)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
[ext_resource type="Script" uid="uid://ckp413wrub5fm" path="res://scripts/CSharp/Common/CharacterControls/InteractionArea2D.cs" id="1_6svbd"]
|
[ext_resource type="Script" uid="uid://ckp413wrub5fm" path="res://scripts/CSharp/Common/CharacterControls/InteractionArea2D.cs" id="1_6svbd"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_npluf"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_npluf"]
|
||||||
|
resource_local_to_scene = true
|
||||||
radius = 300.0
|
radius = 300.0
|
||||||
|
|
||||||
[node name="InteractionArea" type="Node2D" node_paths=PackedStringArray("_area", "_label")]
|
[node name="InteractionArea" type="Node2D" node_paths=PackedStringArray("_area", "_label")]
|
||||||
@@ -11,6 +12,7 @@ _area = NodePath("Area2D")
|
|||||||
_label = NodePath("Label")
|
_label = NodePath("Label")
|
||||||
|
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
collision_mask = 4
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape2D" parent="Area2D"]
|
[node name="CollisionShape3D" type="CollisionShape2D" parent="Area2D"]
|
||||||
shape = SubResource("CircleShape2D_npluf")
|
shape = SubResource("CircleShape2D_npluf")
|
||||||
|
|||||||
+2
-1
@@ -154,7 +154,8 @@ locale/translations=PackedStringArray("res://dialog/translations/dialogic_charac
|
|||||||
|
|
||||||
[layer_names]
|
[layer_names]
|
||||||
|
|
||||||
2d_physics/layer_1="interaction itemss"
|
2d_physics/layer_1="interaction items"
|
||||||
3d_physics/layer_1="General"
|
3d_physics/layer_1="General"
|
||||||
2d_physics/layer_2="Background elements"
|
2d_physics/layer_2="Background elements"
|
||||||
|
2d_physics/layer_3="player"
|
||||||
3d_physics/layer_5="Player"
|
3d_physics/layer_5="Player"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=48 format=3 uid="uid://gigb28qk8t12"]
|
[gd_scene load_steps=51 format=3 uid="uid://gigb28qk8t12"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/Player2D.tscn" id="1_7wfwe"]
|
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/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"]
|
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
|
||||||
@@ -94,7 +94,7 @@ shader_parameter/brightness_add = 0.0
|
|||||||
shader_parameter/contrast_mult = 0.913
|
shader_parameter/contrast_mult = 0.913
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_p6n74"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_p6n74"]
|
||||||
size = Vector2(5176, 1192)
|
size = Vector2(7632, 1192)
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_2vojv"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_2vojv"]
|
||||||
shader = ExtResource("13_7p0hq")
|
shader = ExtResource("13_7p0hq")
|
||||||
@@ -107,6 +107,18 @@ shader_parameter/contrast_mult = 1.398
|
|||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0sfl7"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0sfl7"]
|
||||||
size = Vector2(728, 368)
|
size = Vector2(728, 368)
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_p6n74"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
radius = 600.0
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_kxdmn"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
radius = 300.0
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_hukxv"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
radius = 300.0
|
||||||
|
|
||||||
[node name="BabushkaSceneFarmOutside2d" type="Node2D"]
|
[node name="BabushkaSceneFarmOutside2d" type="Node2D"]
|
||||||
|
|
||||||
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
||||||
@@ -580,7 +592,7 @@ texture = ExtResource("20_if5vh")
|
|||||||
|
|
||||||
[node name="StaticBody2D" type="StaticBody2D" parent="Fence/Fence"]
|
[node name="StaticBody2D" type="StaticBody2D" parent="Fence/Fence"]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 2
|
collision_mask = 4
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Fence/Fence/StaticBody2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Fence/Fence/StaticBody2D"]
|
||||||
position = Vector2(0.666672, 76)
|
position = Vector2(0.666672, 76)
|
||||||
@@ -596,7 +608,7 @@ texture = ExtResource("20_if5vh")
|
|||||||
|
|
||||||
[node name="StaticBody2D" type="StaticBody2D" parent="Fence/Fence2"]
|
[node name="StaticBody2D" type="StaticBody2D" parent="Fence/Fence2"]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 2
|
collision_mask = 4
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Fence/Fence2/StaticBody2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Fence/Fence2/StaticBody2D"]
|
||||||
position = Vector2(0.266632, 172)
|
position = Vector2(0.266632, 172)
|
||||||
@@ -655,7 +667,7 @@ texture = ExtResource("2_lhtpe")
|
|||||||
|
|
||||||
[node name="StaticBody2D" type="StaticBody2D" parent="Farm visuals/Static/House Mockup"]
|
[node name="StaticBody2D" type="StaticBody2D" parent="Farm visuals/Static/House Mockup"]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 2
|
collision_mask = 6
|
||||||
|
|
||||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Farm visuals/Static/House Mockup/StaticBody2D"]
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Farm visuals/Static/House Mockup/StaticBody2D"]
|
||||||
position = Vector2(-257.6, 236.8)
|
position = Vector2(-257.6, 236.8)
|
||||||
@@ -668,9 +680,10 @@ metadata/_custom_type_script = "uid://dhxtdhfqx3bte"
|
|||||||
|
|
||||||
[node name="Area2D" type="Area2D" parent="Farm visuals/FieldParent"]
|
[node name="Area2D" type="Area2D" parent="Farm visuals/FieldParent"]
|
||||||
position = Vector2(-48, -16)
|
position = Vector2(-48, -16)
|
||||||
|
collision_mask = 5
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Farm visuals/FieldParent/Area2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Farm visuals/FieldParent/Area2D"]
|
||||||
position = Vector2(-2492, 2980)
|
position = Vector2(-1264, 2980)
|
||||||
shape = SubResource("RectangleShape2D_p6n74")
|
shape = SubResource("RectangleShape2D_p6n74")
|
||||||
|
|
||||||
[node name="YSorted" type="Node2D" parent="."]
|
[node name="YSorted" type="Node2D" parent="."]
|
||||||
@@ -691,46 +704,78 @@ texture = ExtResource("21_ualyd")
|
|||||||
offset = Vector2(0, -800)
|
offset = Vector2(0, -800)
|
||||||
|
|
||||||
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Brünnen"]
|
[node name="StaticBody2D" type="StaticBody2D" parent="YSorted/Brünnen"]
|
||||||
|
collision_mask = 4
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Brünnen/StaticBody2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Brünnen/StaticBody2D"]
|
||||||
position = Vector2(116, -224)
|
position = Vector2(116, -224)
|
||||||
shape = SubResource("RectangleShape2D_0sfl7")
|
shape = SubResource("RectangleShape2D_0sfl7")
|
||||||
|
|
||||||
|
[node name="InteractionArea" parent="YSorted/Brünnen" instance=ExtResource("27_klb81")]
|
||||||
|
_id = 1
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" parent="YSorted/Brünnen/InteractionArea/Area2D" index="0"]
|
||||||
|
position = Vector2(80, -368)
|
||||||
|
shape = SubResource("CircleShape2D_p6n74")
|
||||||
|
|
||||||
[node name="BaseField" parent="." instance=ExtResource("26_vbdb2")]
|
[node name="BaseField" parent="." instance=ExtResource("26_vbdb2")]
|
||||||
position = Vector2(11280, 2560)
|
position = Vector2(11280, 2560)
|
||||||
|
|
||||||
|
[node name="FieldBehaviour" parent="BaseField" index="1"]
|
||||||
|
FieldState = 3
|
||||||
|
|
||||||
[node name="BaseField2" parent="." instance=ExtResource("26_vbdb2")]
|
[node name="BaseField2" parent="." instance=ExtResource("26_vbdb2")]
|
||||||
position = Vector2(11280, 3304)
|
position = Vector2(11280, 3304)
|
||||||
|
|
||||||
|
[node name="FieldBehaviour" parent="BaseField2" index="1"]
|
||||||
|
FieldState = 3
|
||||||
|
|
||||||
[node name="BaseField3" parent="." instance=ExtResource("26_vbdb2")]
|
[node name="BaseField3" parent="." instance=ExtResource("26_vbdb2")]
|
||||||
position = Vector2(12080, 3296)
|
position = Vector2(12080, 3296)
|
||||||
|
|
||||||
|
[node name="FieldBehaviour" parent="BaseField3" index="1"]
|
||||||
|
FieldState = 3
|
||||||
|
|
||||||
[node name="BaseField4" parent="." instance=ExtResource("26_vbdb2")]
|
[node name="BaseField4" parent="." instance=ExtResource("26_vbdb2")]
|
||||||
position = Vector2(12080, 2544)
|
position = Vector2(12080, 2544)
|
||||||
|
|
||||||
|
[node name="FieldBehaviour" parent="BaseField4" index="1"]
|
||||||
|
FieldState = 3
|
||||||
|
|
||||||
[node name="Hoe Pickup" parent="." node_paths=PackedStringArray("_sprites") instance=ExtResource("27_klb81")]
|
[node name="Hoe Pickup" parent="." node_paths=PackedStringArray("_sprites") instance=ExtResource("27_klb81")]
|
||||||
position = Vector2(3264, 2120)
|
position = Vector2(3264, 2120)
|
||||||
rotation = 3.3074
|
rotation = 3.3074
|
||||||
_sprites = NodePath("SpriteSwitcher2d")
|
_sprites = NodePath("SpriteSwitcher2d")
|
||||||
|
|
||||||
|
[node name="Area2D" parent="Hoe Pickup" index="0"]
|
||||||
|
collision_mask = 5
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" parent="Hoe Pickup/Area2D" index="0"]
|
||||||
|
shape = SubResource("CircleShape2D_kxdmn")
|
||||||
|
|
||||||
[node name="SpriteSwitcher2d" parent="Hoe Pickup" instance=ExtResource("28_p6n74")]
|
[node name="SpriteSwitcher2d" parent="Hoe Pickup" instance=ExtResource("28_p6n74")]
|
||||||
scale = Vector2(0.5, 0.5)
|
scale = Vector2(0.5, 0.5)
|
||||||
|
|
||||||
[node name="Watercan Pickup" parent="." node_paths=PackedStringArray("_sprites") instance=ExtResource("27_klb81")]
|
[node name="Watercan Pickup" parent="." node_paths=PackedStringArray("_sprites") instance=ExtResource("27_klb81")]
|
||||||
position = Vector2(6216, 2248)
|
position = Vector2(6216, 2248)
|
||||||
_sprites = NodePath("SpriteSwitcher2d")
|
_sprites = NodePath("ActiveInactive")
|
||||||
_id = 1
|
_id = 1
|
||||||
|
|
||||||
|
[node name="Area2D" parent="Watercan Pickup" index="0"]
|
||||||
|
collision_mask = 5
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" parent="Watercan Pickup/Area2D" index="0"]
|
||||||
|
shape = SubResource("CircleShape2D_hukxv")
|
||||||
|
|
||||||
[node name="Label" parent="Watercan Pickup" index="1"]
|
[node name="Label" parent="Watercan Pickup" index="1"]
|
||||||
z_index = 1
|
z_index = 1
|
||||||
|
|
||||||
[node name="SpriteSwitcher2d" parent="Watercan Pickup" instance=ExtResource("28_p6n74")]
|
[node name="ActiveInactive" parent="Watercan Pickup" instance=ExtResource("28_p6n74")]
|
||||||
|
|
||||||
[node name="ActiveSprite" parent="Watercan Pickup/SpriteSwitcher2d" index="0"]
|
[node name="ActiveSprite" parent="Watercan Pickup/ActiveInactive" index="0"]
|
||||||
texture = ExtResource("29_p6n74")
|
texture = ExtResource("29_p6n74")
|
||||||
region_rect = Rect2(-2, 1135, 421, 292)
|
region_rect = Rect2(-2, 1135, 421, 292)
|
||||||
|
|
||||||
[node name="InactiveSprite" parent="Watercan Pickup/SpriteSwitcher2d" index="1"]
|
[node name="InactiveSprite" parent="Watercan Pickup/ActiveInactive" index="1"]
|
||||||
texture = ExtResource("29_p6n74")
|
texture = ExtResource("29_p6n74")
|
||||||
region_rect = Rect2(1, 1138, 418, 288)
|
region_rect = Rect2(1, 1138, 418, 288)
|
||||||
|
|
||||||
@@ -738,9 +783,19 @@ region_rect = Rect2(1, 1138, 418, 288)
|
|||||||
[connection signal="mouse_exited" from="Farm visuals/FieldParent/Area2D" to="Farm visuals/FieldParent" method="MouseExitedAllowedArea"]
|
[connection signal="mouse_exited" from="Farm visuals/FieldParent/Area2D" to="Farm visuals/FieldParent" method="MouseExitedAllowedArea"]
|
||||||
[connection signal="PickedUpTool" from="YSorted/Player2d" to="Hoe Pickup" method="SetSpriteActiveState"]
|
[connection signal="PickedUpTool" from="YSorted/Player2d" to="Hoe Pickup" method="SetSpriteActiveState"]
|
||||||
[connection signal="PickedUpTool" from="YSorted/Player2d" to="Watercan Pickup" method="SetSpriteActiveState"]
|
[connection signal="PickedUpTool" from="YSorted/Player2d" to="Watercan Pickup" method="SetSpriteActiveState"]
|
||||||
[connection signal="Interacted" from="Hoe Pickup" to="YSorted/Player2d" method="ActivateTool"]
|
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Player2d" method="TryFillWateringCan"]
|
||||||
[connection signal="Interacted" from="Watercan Pickup" to="YSorted/Player2d" method="ActivateTool"]
|
[connection signal="InteractedTool" from="Hoe Pickup" to="YSorted/Player2d" method="ActivateTool"]
|
||||||
|
[connection signal="InteractedTool" from="Watercan Pickup" to="YSorted/Player2d" method="ActivateTool"]
|
||||||
|
|
||||||
|
[editable path="YSorted/Brünnen/InteractionArea"]
|
||||||
|
[editable path="BaseField"]
|
||||||
|
[editable path="BaseField/FieldBehaviour/BasePlant"]
|
||||||
|
[editable path="BaseField2"]
|
||||||
|
[editable path="BaseField2/FieldBehaviour/BasePlant"]
|
||||||
|
[editable path="BaseField3"]
|
||||||
|
[editable path="BaseField3/FieldBehaviour/BasePlant"]
|
||||||
|
[editable path="BaseField4"]
|
||||||
|
[editable path="BaseField4/FieldBehaviour/BasePlant"]
|
||||||
[editable path="Hoe Pickup"]
|
[editable path="Hoe Pickup"]
|
||||||
[editable path="Watercan Pickup"]
|
[editable path="Watercan Pickup"]
|
||||||
[editable path="Watercan Pickup/SpriteSwitcher2d"]
|
[editable path="Watercan Pickup/ActiveInactive"]
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ public partial class InteractionArea2D : Node2D
|
|||||||
[Export] private bool _showLabel = true;
|
[Export] private bool _showLabel = true;
|
||||||
[Export] private int _id;
|
[Export] private int _id;
|
||||||
|
|
||||||
[Signal]
|
[Signal] public delegate void InteractedToolEventHandler(int id);
|
||||||
public delegate void InteractedEventHandler(int id);
|
[Signal] public delegate void InteractedEventHandler();
|
||||||
|
|
||||||
public void OnPlayerEntered(Node2D player)
|
public void OnPlayerEntered(Node2D player)
|
||||||
{
|
{
|
||||||
@@ -29,7 +29,8 @@ public partial class InteractionArea2D : Node2D
|
|||||||
if (@event.IsAction("interact") && @event.IsPressed() && _area.HasOverlappingBodies())
|
if (@event.IsAction("interact") && @event.IsPressed() && _area.HasOverlappingBodies())
|
||||||
{
|
{
|
||||||
_label.Hide();
|
_label.Hide();
|
||||||
EmitSignal(SignalName.Interacted, _id);
|
EmitSignal(SignalName.InteractedTool, _id);
|
||||||
|
EmitSignal(SignalName.Interacted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,18 @@ namespace Babushka.scripts.CSharp.Common.Farming;
|
|||||||
public partial class FarmingControls2D : Node2D
|
public partial class FarmingControls2D : Node2D
|
||||||
{
|
{
|
||||||
[Export] private Sprite2D _hoeSprite;
|
[Export] private Sprite2D _hoeSprite;
|
||||||
[Export] private Sprite2D _wateringCanSprite;
|
[Export] private Sprite2D _wateringCanEmptySprite;
|
||||||
|
[Export] private Sprite2D _wateringCanFilledSprite;
|
||||||
[Export] private PackedScene _fieldPrefab;
|
[Export] private PackedScene _fieldPrefab;
|
||||||
[Export] private Node2D _movingPlayer;
|
[Export] private Node2D _movingPlayer;
|
||||||
[Export] private Camera2D _camera;
|
[Export] private Camera2D _camera;
|
||||||
|
|
||||||
public FieldService2D FieldParent;
|
public FieldService2D FieldService;
|
||||||
|
|
||||||
private int _toolId = -1;
|
private int _toolId = -1;
|
||||||
|
private bool _wateringCanFilled = false;
|
||||||
|
private int _currentWateringCanStep = 0;
|
||||||
|
private int _wateringCanCapacity = 3;
|
||||||
|
|
||||||
#region Tools
|
#region Tools
|
||||||
|
|
||||||
@@ -51,7 +55,16 @@ public partial class FarmingControls2D : Node2D
|
|||||||
_hoeSprite.Visible = activate;
|
_hoeSprite.Visible = activate;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
_wateringCanSprite.Visible = activate;
|
if (activate)
|
||||||
|
{
|
||||||
|
_wateringCanEmptySprite.Visible = true;
|
||||||
|
GD.Print("Activating empty Watering can sprite.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_wateringCanEmptySprite.Visible = false;
|
||||||
|
_wateringCanFilledSprite.Visible = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_toolId = -1;
|
_toolId = -1;
|
||||||
@@ -75,32 +88,54 @@ public partial class FarmingControls2D : Node2D
|
|||||||
MakeField(adjustedPosition);
|
MakeField(adjustedPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@event.IsActionPressed("click") && _toolId == 1)
|
if (@event.IsActionPressed("click") && _toolId == 1 && _wateringCanFilled)
|
||||||
{
|
{
|
||||||
WaterTheField(adjustedPosition);
|
WaterTheField(adjustedPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void FillWateringCan(bool fillUp)
|
||||||
|
{
|
||||||
|
if (_toolId == 1 )
|
||||||
|
{
|
||||||
|
GD.Print("Watering can in hand, filling.");
|
||||||
|
_wateringCanEmptySprite.Visible = !fillUp;
|
||||||
|
_wateringCanFilledSprite.Visible = fillUp;
|
||||||
|
_wateringCanFilled = fillUp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void WaterTheField(Vector2I fieldPosition)
|
private void WaterTheField(Vector2I fieldPosition)
|
||||||
{
|
{
|
||||||
FieldBehaviour2D field = FieldParent.Get(fieldPosition);
|
FieldBehaviour2D field = FieldService.Get(fieldPosition);
|
||||||
if (field == null)
|
if (field == null || field.FieldState == FieldState.Watered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
field.Water();
|
field.Water();
|
||||||
|
|
||||||
|
if (_currentWateringCanStep < _wateringCanCapacity)
|
||||||
|
{
|
||||||
|
_currentWateringCanStep++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_currentWateringCanStep = 0;
|
||||||
|
FillWateringCan(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MakeField(Vector2I fieldPosition)
|
private void MakeField(Vector2I fieldPosition)
|
||||||
{
|
{
|
||||||
if(FieldParent == null || _fieldPrefab == null)
|
if(FieldService == null || _fieldPrefab == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// only try to instantiate a field if you're in the allowed area
|
// only try to instantiate a field if you're in the allowed area
|
||||||
if (!FieldParent.FieldAllowed())
|
if (!FieldService.FieldAllowed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// only instantiate a field if there isn't one already.
|
// only instantiate a field if there isn't one already.
|
||||||
if(FieldParent.Get(fieldPosition) == null)
|
if(FieldService.Get(fieldPosition) == null)
|
||||||
{
|
{
|
||||||
Node fieldInstance = _fieldPrefab.Instantiate();
|
Node fieldInstance = _fieldPrefab.Instantiate();
|
||||||
if (fieldInstance is Node2D field2d)
|
if (fieldInstance is Node2D field2d)
|
||||||
@@ -108,11 +143,11 @@ public partial class FarmingControls2D : Node2D
|
|||||||
// add dictionary entry for the field
|
// add dictionary entry for the field
|
||||||
Array<Node> fields = field2d.FindChildren("*", nameof(FieldBehaviour2D));
|
Array<Node> fields = field2d.FindChildren("*", nameof(FieldBehaviour2D));
|
||||||
if (fields.Count > 0)
|
if (fields.Count > 0)
|
||||||
FieldParent.TryAddEntry(fieldPosition, fields[0] as FieldBehaviour2D);
|
FieldService.TryAddEntry(fieldPosition, fields[0] as FieldBehaviour2D);
|
||||||
|
|
||||||
// reposition and reparent the instance
|
// reposition and reparent the instance
|
||||||
field2d.Position = new Vector2(fieldPosition.X, fieldPosition.Y);;
|
field2d.Position = new Vector2(fieldPosition.X, fieldPosition.Y);;
|
||||||
FieldParent.AddChild(fieldInstance);
|
FieldService.AddChild(fieldInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,15 +7,40 @@ public partial class FieldBehaviour2D : Sprite2D
|
|||||||
{
|
{
|
||||||
[Export] private Texture2D Tilled;
|
[Export] private Texture2D Tilled;
|
||||||
[Export] private Texture2D Watered;
|
[Export] private Texture2D Watered;
|
||||||
[Export] public FieldState FieldState = FieldState.Empty;
|
[Export] public FieldState FieldState = FieldState.Tilled;
|
||||||
|
|
||||||
public Vector2 FieldPosition;
|
public Vector2 FieldPosition;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
Texture = Tilled;
|
UpdateFieldState(FieldState);
|
||||||
base._Ready();
|
base._Ready();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateFieldState(FieldState state)
|
||||||
|
{
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case FieldState.Empty:
|
||||||
|
FieldState = FieldState.Empty;
|
||||||
|
break;
|
||||||
|
case FieldState.Tilled:
|
||||||
|
FieldState = FieldState.Tilled;
|
||||||
|
Texture = Tilled;
|
||||||
|
break;
|
||||||
|
case FieldState.Watered:
|
||||||
|
FieldState = FieldState.Watered;
|
||||||
|
Texture = Watered;
|
||||||
|
break;
|
||||||
|
case FieldState.Planted:
|
||||||
|
FieldState = FieldState.Planted;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
FieldState = FieldState.NotFound;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Water()
|
public void Water()
|
||||||
{
|
{
|
||||||
@@ -24,7 +49,7 @@ public partial class FieldBehaviour2D : Sprite2D
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the player enters the field'S interaction area and presses <E>.
|
/// Called when the player enters the field's interaction area and presses <E>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Farm()
|
public void Farm()
|
||||||
{
|
{
|
||||||
@@ -34,7 +59,7 @@ public partial class FieldBehaviour2D : Sprite2D
|
|||||||
Texture = Tilled;
|
Texture = Tilled;
|
||||||
FieldState = FieldState.Tilled;
|
FieldState = FieldState.Tilled;
|
||||||
break;
|
break;
|
||||||
case FieldState.Tilled:
|
case FieldState.Watered:
|
||||||
FieldState = FieldState.Planted;
|
FieldState = FieldState.Planted;
|
||||||
break;
|
break;
|
||||||
case FieldState.Planted:
|
case FieldState.Planted:
|
||||||
@@ -42,6 +67,5 @@ public partial class FieldBehaviour2D : Sprite2D
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,14 +13,18 @@ public partial class PlantBehaviour2D : Node2D
|
|||||||
[Export] private Sprite2D[] _bigPlants;
|
[Export] private Sprite2D[] _bigPlants;
|
||||||
[Export] private Sprite2D[] _readyPlants;
|
[Export] private Sprite2D[] _readyPlants;
|
||||||
[Export] private PlantState _state = PlantState.None;
|
[Export] private PlantState _state = PlantState.None;
|
||||||
|
[Export] private FieldBehaviour2D _field;
|
||||||
|
|
||||||
private Sprite2D _currentPlantSprite = null;
|
private Sprite2D _currentPlantSprite = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Transitions the plant to its next groth stage.
|
/// Transitions the plant to its next growth stage.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Grow(int id)
|
public void Grow()
|
||||||
{
|
{
|
||||||
|
if (_field.FieldState != FieldState.Watered)
|
||||||
|
return;
|
||||||
|
|
||||||
switch (_state)
|
switch (_state)
|
||||||
{
|
{
|
||||||
case PlantState.None:
|
case PlantState.None:
|
||||||
@@ -54,6 +58,8 @@ public partial class PlantBehaviour2D : Node2D
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_field.UpdateFieldState(FieldState.Tilled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Sprite2D GetRandomSprite(Sprite2D[] sprites)
|
private Sprite2D GetRandomSprite(Sprite2D[] sprites)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public partial class VesnaBehaviour2D : Node
|
|||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
_farmingControls.FieldParent = _fieldParent;
|
_farmingControls.FieldService = _fieldParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Farming
|
#region Farming
|
||||||
@@ -22,6 +22,14 @@ public partial class VesnaBehaviour2D : Node
|
|||||||
bool activated = _farmingControls.TryActivateTool(toolId);
|
bool activated = _farmingControls.TryActivateTool(toolId);
|
||||||
EmitSignal(SignalName.PickedUpTool, activated, toolId);
|
EmitSignal(SignalName.PickedUpTool, activated, toolId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TryFillWateringCan(int toolId)
|
||||||
|
{
|
||||||
|
if (toolId == 1)
|
||||||
|
{
|
||||||
|
_farmingControls.FillWateringCan(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user