🚧 watering fields kinda works now

This commit is contained in:
2025-11-11 15:51:15 +01:00
parent d51cc461f7
commit b00b466045
11 changed files with 69 additions and 97 deletions
+24 -23
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=3 uid="uid://b1d2e7ely6hyw"]
[gd_scene load_steps=22 format=3 uid="uid://b1d2e7ely6hyw"]
[ext_resource type="Script" uid="uid://j2mhvb45egej" path="res://scripts/CSharp/Low Code/Variables/VariableNode.cs" id="1_4mg73"]
[ext_resource type="Script" uid="uid://bdffon388rkty" path="res://scripts/CSharp/Common/Farming/FieldBehaviour2D.cs" id="1_qa01x"]
@@ -15,21 +15,18 @@
[ext_resource type="Texture2D" uid="uid://bovypw2hsn2nq" path="res://art/masks/field_outline_1_outline.png" id="9_wx561"]
[ext_resource type="Resource" uid="uid://b4hawvsc7cmkn" path="res://resources/low code/farming/event_newPlantCreated.tres" id="10_wx561"]
[ext_resource type="Resource" uid="uid://tt3d166mntmi" path="res://resources/low code/farming/var_sceneNameProvider.tres" id="11_cjahb"]
[ext_resource type="Resource" uid="uid://cmqapbvv0hev2" path="res://resources/low code/farming/event_watering.tres" id="14_57jmp"]
[ext_resource type="Script" uid="uid://3t0af586fimq" path="res://scripts/CSharp/Common/Inventory/InventoryListener.cs" id="14_w08sx"]
[ext_resource type="Resource" uid="uid://d1uuxp1lp4aro" path="res://resources/items/tomato_seed.tres" id="15_i4qwg"]
[ext_resource type="Resource" uid="uid://duq7tshxv6uhp" path="res://resources/items/beet_seed.tres" id="16_i4qwg"]
[ext_resource type="Resource" uid="uid://cndd64batns31" path="res://resources/items/wateringcan.tres" id="17_1mi0u"]
[ext_resource type="Script" uid="uid://dfpyjxivcuidr" path="res://scripts/CSharp/Low Code/Variables/VariableSetter.cs" id="19_lgya6"]
[ext_resource type="Resource" uid="uid://fnb0n0w2ktuc" path="res://resources/low code/farming/var_cursorOnField.tres" id="20_lgya6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_57jmp"]
size = Vector2(600, 400)
[ext_resource type="Texture2D" uid="uid://l5ym7gi82l1b" path="res://art/ui/UI/Watercan-ui/Tropfen-ui-6.png" id="21_4mg73"]
[node name="BaseField" type="Node2D"]
script = ExtResource("1_4mg73")
Payload = 0
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "_outlineSprite", "PlantingInteraction", "PlantingPlaceholder", "FieldInteractionArea", "_fieldIndex")]
[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "_outlineSprite", "PlantingInteraction", "PlantingPlaceholder", "FieldInteractionArea", "_fieldIndex", "_wateringParticles")]
z_index = -1
scale = Vector2(0.9, 1)
script = ExtResource("1_qa01x")
@@ -46,6 +43,8 @@ ItemRepository = ExtResource("7_w8caw")
FieldInteractionArea = NodePath("../InteractionArea")
_sceneKeyProvider = ExtResource("11_cjahb")
_fieldIndex = NodePath("..")
_wateringParticles = NodePath("../pouring water vfx")
_wateringEvent = ExtResource("14_57jmp")
[node name="MaskedField" type="Sprite2D" parent="FieldBehaviour"]
clip_children = 1
@@ -80,24 +79,26 @@ _itemResourcesToListenFor = Array[Object]([ExtResource("15_i4qwg"), ExtResource(
script = ExtResource("14_w08sx")
_itemResourcesToListenFor = Array[Object]([ExtResource("17_1mi0u")])
[node name="CursorOnFieldCollider" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="CursorOnFieldCollider"]
shape = SubResource("RectangleShape2D_57jmp")
[node name="CursorOnFieldSetter" type="Node" parent="CursorOnFieldCollider"]
script = ExtResource("19_lgya6")
_variableResource = ExtResource("20_lgya6")
_payloadToSet = true
[node name="CursorNotOnFieldSetter" type="Node" parent="CursorOnFieldCollider"]
script = ExtResource("19_lgya6")
_variableResource = ExtResource("20_lgya6")
_payloadToSet = false
[node name="pouring water vfx" type="CPUParticles2D" parent="."]
position = Vector2(0, -300)
emitting = false
amount = 25
texture = ExtResource("21_4mg73")
one_shot = true
randomness = 1.0
local_coords = true
draw_order = 1
emission_shape = 2
emission_sphere_radius = 128.0
gravity = Vector2(0, 500)
linear_accel_min = 44.07
linear_accel_max = 78.81
scale_amount_min = 0.4
scale_amount_max = 0.8
color = Color(0.400601, 0.62444, 0.791217, 1)
hue_variation_max = 0.4
[connection signal="Planted" from="FieldBehaviour" to="PlantCreationEventRaiser" method="RaiseEvents"]
[connection signal="Interacted" from="InteractionArea" to="FieldBehaviour" method="Farm"]
[connection signal="ItemInstanceActivated" from="InventoryListener Seeds" to="FieldBehaviour" method="ActivatedSeedInInventory"]
[connection signal="ItemInstanceActivated" from="InventoryListener watering can" to="FieldBehaviour" method="ActivateWateringCanInInventory"]
[connection signal="mouse_entered" from="CursorOnFieldCollider" to="CursorOnFieldCollider/CursorOnFieldSetter" method="Set"]
[connection signal="mouse_exited" from="CursorOnFieldCollider" to="CursorOnFieldCollider/CursorNotOnFieldSetter" method="Set"]