Fixed farming (the way it was before)

pull/14/head
kziolkowski 6 months ago
parent 5affc48dc5
commit d2c7302ab2

@ -9,7 +9,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="_builds/Babushka_win_0_3/Babushka.exe"
export_path="_builds/Babushka_showcase_win_04/Babushka.exe"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
@ -79,7 +79,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="_builds/Babushka_linux_0_2/Babushka.x86_64"
export_path="_builds/Babushka_showcase_lux_04/Babushka.x86_64"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""

@ -1,6 +1,5 @@
[gd_scene load_steps=10 format=3 uid="uid://b1d2e7ely6hyw"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="1_jrdc4"]
[ext_resource type="Script" uid="uid://bdffon388rkty" path="res://scripts/CSharp/Common/Farming/FieldBehaviour2D.cs" id="2_vl3uw"]
[ext_resource type="Texture2D" uid="uid://cgmu3qlovdr22" path="res://art/masks/field_outline_1.png" id="3_uqkef"]
[ext_resource type="Texture2D" uid="uid://eg5ej0mtuac" path="res://art/masks/field_outline_2.png" id="4_di17a"]
@ -9,16 +8,15 @@
[ext_resource type="Texture2D" uid="uid://ctvdxwgmfaj5c" path="res://art/farm/tilable grounds/böden/nasse farming erde.png" id="7_f504p"]
[ext_resource type="PackedScene" uid="uid://gishbn0a8eke" path="res://prefabs/farm/tomato_plant.tscn" id="8_jrdc4"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vl3uw"]
[sub_resource type="CircleShape2D" id="CircleShape2D_jrdc4"]
resource_local_to_scene = true
radius = 300.0
[node name="BaseField" type="Node2D"]
[sub_resource type="CircleShape2D" id="CircleShape2D_l0vvv"]
resource_local_to_scene = true
radius = 300.0
[node name="InteractionArea2" parent="." instance=ExtResource("1_jrdc4")]
visible = false
z_index = 1
scale = Vector2(2.225, 2.225)
[node name="BaseField" type="Node2D"]
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "_growingCollider")]
z_index = -1
@ -29,13 +27,21 @@ _maskSprite = NodePath("MaskedField")
_maskTexture = Array[Texture2D]([ExtResource("3_uqkef"), ExtResource("4_di17a"), ExtResource("5_4a8nv")])
Tilled = ExtResource("6_l7j4c")
Watered = ExtResource("7_f504p")
_growingCollider = NodePath("BasePlant2/InteractionArea")
_growingCollider = NodePath("BasePlant2/GrowingInteractionArea")
[node name="BasePlant2" parent="FieldBehaviour" node_paths=PackedStringArray("_field") groups=["PlantGrowing"] instance=ExtResource("8_jrdc4")]
_field = NodePath("..")
_magicWordNeeded = false
[node name="CollisionShape3D" parent="FieldBehaviour/BasePlant2/GrowingInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_jrdc4")
[node name="Label" parent="FieldBehaviour/BasePlant2/GrowingInteractionArea" index="1"]
text = "[E] Grow
"
[node name="CollisionShape3D" parent="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_vl3uw")
[node name="CollisionShape3D" parent="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_l0vvv")
[node name="MaskedField" type="Sprite2D" parent="FieldBehaviour"]
clip_children = 1
@ -46,5 +52,6 @@ texture = ExtResource("4_di17a")
texture = ExtResource("6_l7j4c")
[editable path="FieldBehaviour/BasePlant2"]
[editable path="FieldBehaviour/BasePlant2/GrowingInteractionArea"]
[editable path="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem"]
[editable path="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem/InteractionArea2"]
[editable path="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem/PickupInteractionArea"]

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://gishbn0a8eke"]
[gd_scene load_steps=13 format=3 uid="uid://gishbn0a8eke"]
[ext_resource type="Script" uid="uid://cms357f23fmfy" path="res://scripts/CSharp/Common/Farming/PlantBehaviour2D.cs" id="1_66p1c"]
[ext_resource type="Texture2D" uid="uid://dtr4uga5uspg" path="res://art/farm/farming/farmobjekte/tomaten/tomaten baby.png" id="2_vjw4j"]
@ -22,7 +22,11 @@ shader_parameter/distortion = 0.0
shader_parameter/heightOffset = 0.635
shader_parameter/offset = 0.0
[sub_resource type="CircleShape2D" id="CircleShape2D_2tt5u"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vjw4j"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_7hdur"]
resource_local_to_scene = true
radius = 300.0
@ -100,7 +104,7 @@ region_enabled = true
region_rect = Rect2(228, 600, 85, 92)
[node name="BigPlant" type="Node2D" parent="."]
position = Vector2(0, 2)
position = Vector2(0, -400)
[node name="01" type="Sprite2D" parent="BigPlant"]
visible = false
@ -134,9 +138,15 @@ texture = ExtResource("4_hmj2d")
region_enabled = true
region_rect = Rect2(546, 697, 535, 687)
[node name="InteractionArea" parent="." instance=ExtResource("5_3j24b")]
[node name="GrowingInteractionArea" parent="." instance=ExtResource("5_3j24b")]
position = Vector2(0, 2.3)
[node name="CollisionShape3D" parent="GrowingInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_vjw4j")
[node name="Label" parent="GrowingInteractionArea" index="1"]
text = "[E] Grow"
[node name="ReadyPlantInventoryItem" parent="." instance=ExtResource("6_gdrin")]
position = Vector2(0, 2.3)
IsActive = false
@ -150,13 +160,17 @@ visible = false
[node name="PickupErrorLabel" parent="ReadyPlantInventoryItem" index="2"]
visible = false
[node name="CollisionShape3D" parent="ReadyPlantInventoryItem/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_2tt5u")
[node name="PickupInteractionArea" parent="ReadyPlantInventoryItem" index="3"]
visible = false
[node name="CollisionShape3D" parent="ReadyPlantInventoryItem/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_7hdur")
[node name="Icon" parent="ReadyPlantInventoryItem" index="4"]
visible = false
[node name="ReadyPlant" type="Node2D" parent="ReadyPlantInventoryItem"]
position = Vector2(0, -400)
[node name="01" type="Sprite2D" parent="ReadyPlantInventoryItem/ReadyPlant"]
visible = false
@ -209,7 +223,8 @@ scale_amount_max = 0.1
color = Color(0.400601, 0.62444, 0.791217, 1)
hue_variation_max = 0.4
[connection signal="Interacted" from="InteractionArea" to="." method="Grow"]
[connection signal="Interacted" from="GrowingInteractionArea" to="." method="Grow"]
[editable path="GrowingInteractionArea"]
[editable path="ReadyPlantInventoryItem"]
[editable path="ReadyPlantInventoryItem/InteractionArea2"]
[editable path="ReadyPlantInventoryItem/PickupInteractionArea"]

@ -43,12 +43,12 @@ theme = SubResource("Theme_harr4")
text = "thewe waf a pwoblem wiph picking up te item UWU"
autowrap_mode = 3
[node name="InteractionArea2" parent="." instance=ExtResource("4_xu8me")]
[node name="PickupInteractionArea" parent="." instance=ExtResource("4_xu8me")]
[node name="CollisionShape3D" parent="InteractionArea2/Area2D" index="0"]
[node name="CollisionShape3D" parent="PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tlhp6")
[node name="Label" parent="InteractionArea2" index="1"]
[node name="Label" parent="PickupInteractionArea" index="1"]
z_index = 5
offset_left = -68.0
offset_top = -111.0
@ -62,6 +62,6 @@ position = Vector2(5, -300)
scale = Vector2(0.868852, 0.868852)
texture = ExtResource("5_harr4")
[connection signal="Interacted" from="InteractionArea2" to="." method="TryPickUp"]
[connection signal="Interacted" from="PickupInteractionArea" to="." method="TryPickUp"]
[editable path="InteractionArea2"]
[editable path="PickupInteractionArea"]

@ -5,6 +5,5 @@
[node name="BabushkaSceneBootstrap" type="Node2D"]
[node name="BabushkaSceneStartMenu" parent="." instance=ExtResource("1_15ton")]
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_disclaimer.tscn")
[node name="SceneParent" type="Node" parent="."]

@ -1,4 +1,4 @@
[gd_scene load_steps=102 format=3 uid="uid://gigb28qk8t12"]
[gd_scene load_steps=105 format=3 uid="uid://gigb28qk8t12"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="1_7wfwe"]
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
@ -153,11 +153,23 @@ size = Vector2(1041, 368)
resource_local_to_scene = true
radius = 371.058
[sub_resource type="CircleShape2D" id="CircleShape2D_2nee2"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ycj14"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_ipqaa"]
[sub_resource type="CircleShape2D" id="CircleShape2D_2065p"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_tm0yg"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_lbnqo"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_l4wxt"]
resource_local_to_scene = true
radius = 300.0
@ -1011,7 +1023,7 @@ _timelinesToPlay = PackedStringArray("quest1_ducks_start", "quest2_tomatoes_star
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("1_7wfwe")]
z_index = 1
position = Vector2(-2031, 2949)
position = Vector2(9322, 2018)
_fieldParent = NodePath("../Farm visuals/FieldParent")
_hoe = ExtResource("28_6b2nr")
_wateringCan = ExtResource("28_ipqaa")
@ -1050,8 +1062,8 @@ position = Vector2(6095, 2087)
[node name="SpawnWithItem" parent="YSorted/HoeGenericPickup" index="0"]
_blueprint = ExtResource("26_ipqaa")
[node name="CollisionShape3D" parent="YSorted/HoeGenericPickup/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_2nee2")
[node name="CollisionShape3D" parent="YSorted/HoeGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_ycj14")
[node name="CanGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(8192, 3507)
@ -1059,11 +1071,8 @@ position = Vector2(8192, 3507)
[node name="SpawnWithItem" parent="YSorted/CanGenericPickup" index="0"]
_blueprint = ExtResource("28_ipqaa")
[node name="InteractionArea2" parent="YSorted/CanGenericPickup" index="3"]
position = Vector2(0, -159)
[node name="CollisionShape3D" parent="YSorted/CanGenericPickup/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa")
[node name="CollisionShape3D" parent="YSorted/CanGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_2065p")
[node name="RakeGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(8391, 2060)
@ -1071,8 +1080,8 @@ position = Vector2(8391, 2060)
[node name="SpawnWithItem" parent="YSorted/RakeGenericPickup" index="0"]
_blueprint = ExtResource("28_6b2nr")
[node name="CollisionShape3D" parent="YSorted/RakeGenericPickup/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa")
[node name="CollisionShape3D" parent="YSorted/RakeGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_tm0yg")
[node name="ScytheGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
visible = false
@ -1081,8 +1090,8 @@ position = Vector2(15642, 2158)
[node name="SpawnWithItem" parent="YSorted/ScytheGenericPickup" index="0"]
_blueprint = ExtResource("29_wtdui")
[node name="CollisionShape3D" parent="YSorted/ScytheGenericPickup/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa")
[node name="CollisionShape3D" parent="YSorted/ScytheGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_lbnqo")
[node name="ShovelGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
visible = false
@ -1091,8 +1100,8 @@ position = Vector2(5454, 2049)
[node name="SpawnWithItem" parent="YSorted/ShovelGenericPickup" index="0"]
_blueprint = ExtResource("27_ipqaa")
[node name="CollisionShape3D" parent="YSorted/ShovelGenericPickup/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa")
[node name="CollisionShape3D" parent="YSorted/ShovelGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_l4wxt")
[node name="Farm visuals" type="Node2D" parent="YSorted"]
position = Vector2(-60, 122)
@ -2071,10 +2080,11 @@ rotation = 1.5708
scale = Vector2(0.1, 10.8)
texture = ExtResource("21_if5vh")
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals"]
[node name="FieldParent" type="Node2D" parent="YSorted/Farm visuals" node_paths=PackedStringArray("_allowedArea")]
position = Vector2(53, 20)
scale = Vector2(1, 0.993819)
script = ExtResource("25_0qu0h")
_allowedArea = NodePath("Area2D")
metadata/_custom_type_script = "uid://dhxtdhfqx3bte"
[node name="Area2D" type="Area2D" parent="YSorted/Farm visuals/FieldParent"]
@ -2305,14 +2315,14 @@ script = ExtResource("40_w3jkj")
[editable path="YSorted/Vesna"]
[editable path="YSorted/Brünnen/InteractionArea"]
[editable path="YSorted/HoeGenericPickup"]
[editable path="YSorted/HoeGenericPickup/InteractionArea2"]
[editable path="YSorted/HoeGenericPickup/PickupInteractionArea"]
[editable path="YSorted/CanGenericPickup"]
[editable path="YSorted/CanGenericPickup/InteractionArea2"]
[editable path="YSorted/CanGenericPickup/PickupInteractionArea"]
[editable path="YSorted/RakeGenericPickup"]
[editable path="YSorted/RakeGenericPickup/InteractionArea2"]
[editable path="YSorted/RakeGenericPickup/PickupInteractionArea"]
[editable path="YSorted/ScytheGenericPickup"]
[editable path="YSorted/ScytheGenericPickup/InteractionArea2"]
[editable path="YSorted/ScytheGenericPickup/PickupInteractionArea"]
[editable path="YSorted/ShovelGenericPickup"]
[editable path="YSorted/ShovelGenericPickup/InteractionArea2"]
[editable path="YSorted/ShovelGenericPickup/PickupInteractionArea"]
[editable path="YSorted/trash/trashObject"]
[editable path="CanvasLayer"]

@ -42,6 +42,7 @@ public partial class InteractionArea2D : Node2D
_label.Hide();
EmitSignal(SignalName.InteractedTool, _id);
EmitSignal(SignalName.Interacted);
GD.Print("Interacted with: " + this.Name);
}
}

@ -27,10 +27,11 @@ public partial class PlantBehaviour2D : Node2D
[Export] private FieldBehaviour2D _field;
[Export] private ItemOnGround2D _harvestablePlant;
[Export] private CpuParticles2D _magicEffect;
[Export] private bool _magicWordNeeded = true;
private string _magicWordDialogicEventName = "MagicWord";
private Sprite2D _currentPlantSprite = null;
private bool _magicWordSaid;
private bool _magicWordSaid = false;
/// <summary>
@ -38,7 +39,7 @@ public partial class PlantBehaviour2D : Node2D
/// </summary>
public void Grow()
{
if (_field.FieldState != FieldState.Watered || !_magicWordSaid)
if (_field.FieldState != FieldState.Watered || _magicWordSaid != _magicWordNeeded)
return;
GD.Print("Trying to grow something here.");

@ -6,9 +6,9 @@ public partial class ItemOnGround2D : Node
{
private ItemInstance _itemInstance;
[Export] public bool IsActive = true;
[Export] private bool _infiniteSupply = false;
[Export] private int _finiteSupply = 1;
[Export] public bool IsActive = true;
private int pickUpCounter = 0;

Loading…
Cancel
Save