WIP fixing farming mechanic again

This commit is contained in:
2025-07-11 03:55:36 +02:00
parent 7a3e96d679
commit a4f9511892
9 changed files with 52 additions and 44 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ texture = ExtResource("4_yav45")
[node name="FieldTexture" type="Sprite2D" parent="FieldBehaviour/MaskedField"]
texture = ExtResource("6_a35l4")
[node name="BeetRoot" parent="FieldBehaviour" node_paths=PackedStringArray("_smallPlants", "_field") instance=ExtResource("8_tgwxi")]
[node name="BeetRoot" parent="FieldBehaviour" node_paths=PackedStringArray("_smallPlants", "_field") groups=["PlantGrowing"] instance=ExtResource("8_tgwxi")]
_smallPlants = [NodePath("SmallPlant/01"), NodePath("SmallPlant/02"), null, null]
_state = 2
_field = NodePath("..")
+11 -31
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://b1d2e7ely6hyw"]
[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"]
@@ -7,15 +7,11 @@
[ext_resource type="Texture2D" uid="uid://djpigvoyadvjs" path="res://art/masks/field_outline_3.png" id="5_4a8nv"]
[ext_resource type="Texture2D" uid="uid://c2pirgay3jfnn" path="res://art/farm/tilable grounds/böden/trockene farming erde.png" id="6_l7j4c"]
[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://c3hwbwo423nbm" path="res://prefabs/farm/beet_plant.tscn" id="8_pa15t"]
[ext_resource type="PackedScene" uid="uid://gishbn0a8eke" path="res://prefabs/farm/tomato_plant.tscn" id="8_jrdc4"]
[sub_resource type="CircleShape2D" id="CircleShape2D_yi42k"]
[sub_resource type="CircleShape2D" id="CircleShape2D_vl3uw"]
resource_local_to_scene = true
radius = 201.345
[sub_resource type="CircleShape2D" id="CircleShape2D_femni"]
resource_local_to_scene = true
radius = 194.926
radius = 300.0
[node name="BaseField" type="Node2D"]
@@ -33,26 +29,13 @@ _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("BasePlant/InteractionArea")
_growingCollider = NodePath("BasePlant2/InteractionArea")
[node name="BasePlant" parent="FieldBehaviour" node_paths=PackedStringArray("_smallPlants", "_field") instance=ExtResource("8_pa15t")]
_smallPlants = [NodePath("SmallPlant/01"), NodePath("SmallPlant/02"), null, null]
[node name="BasePlant2" parent="FieldBehaviour" node_paths=PackedStringArray("_field") groups=["PlantGrowing"] instance=ExtResource("8_jrdc4")]
_field = NodePath("..")
[node name="BigPlant" parent="FieldBehaviour/BasePlant" index="2"]
position = Vector2(6, -161)
[node name="InteractionArea" parent="FieldBehaviour/BasePlant" index="3"]
z_index = 3
[node name="CollisionShape3D" parent="FieldBehaviour/BasePlant/InteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_yi42k")
[node name="CollisionShape3D" parent="FieldBehaviour/BasePlant/ReadyPlantInventoryItem/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_femni")
[node name="ReadyPlant" parent="FieldBehaviour/BasePlant/ReadyPlantInventoryItem" index="5"]
position = Vector2(0, -291.3)
[node name="CollisionShape3D" parent="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_vl3uw")
[node name="MaskedField" type="Sprite2D" parent="FieldBehaviour"]
clip_children = 1
@@ -62,9 +45,6 @@ texture = ExtResource("4_di17a")
[node name="FieldTexture" type="Sprite2D" parent="FieldBehaviour/MaskedField"]
texture = ExtResource("6_l7j4c")
[connection signal="Interacted" from="InteractionArea2" to="FieldBehaviour/BasePlant" method="Grow"]
[editable path="FieldBehaviour/BasePlant"]
[editable path="FieldBehaviour/BasePlant/InteractionArea"]
[editable path="FieldBehaviour/BasePlant/ReadyPlantInventoryItem"]
[editable path="FieldBehaviour/BasePlant/ReadyPlantInventoryItem/InteractionArea2"]
[editable path="FieldBehaviour/BasePlant2"]
[editable path="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem"]
[editable path="FieldBehaviour/BasePlant2/ReadyPlantInventoryItem/InteractionArea2"]
+23 -2
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://gishbn0a8eke"]
[gd_scene load_steps=12 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"]
@@ -8,6 +8,7 @@
[ext_resource type="PackedScene" uid="uid://dpbbroif2tnil" path="res://prefabs/interactions/generic_item_on_ground_2d.tscn" id="6_gdrin"]
[ext_resource type="Resource" uid="uid://blr8tine5m0ma" path="res://resources/items/tomato.tres" id="7_di4m0"]
[ext_resource type="Texture2D" uid="uid://cnwd3mb3jnuxm" path="res://art/farm/farming/farmobjekte/tomaten/teen adulte tomaten.png" id="8_evgr8"]
[ext_resource type="Texture2D" uid="uid://bleimj6jr1jka" path="res://art/general/rectangle.png" id="9_vjw4j"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_u4cty"]
shader = ExtResource("3_7hdur")
@@ -25,7 +26,7 @@ shader_parameter/offset = 0.0
resource_local_to_scene = true
radius = 300.0
[node name="BasePlant" type="Node2D" node_paths=PackedStringArray("_seeds", "_smallPlants", "_bigPlants", "_readyPlants", "_harvestablePlant")]
[node name="BasePlant" type="Node2D" node_paths=PackedStringArray("_seeds", "_smallPlants", "_bigPlants", "_readyPlants", "_harvestablePlant", "_magicEffect")]
z_index = 1
y_sort_enabled = true
script = ExtResource("1_66p1c")
@@ -34,6 +35,7 @@ _smallPlants = [NodePath("SmallPlant/01"), NodePath("SmallPlant/02"), NodePath("
_bigPlants = [NodePath("BigPlant/01"), NodePath("BigPlant/02"), NodePath("BigPlant/03"), NodePath("BigPlant/04")]
_readyPlants = [NodePath("ReadyPlantInventoryItem/ReadyPlant/01"), NodePath("ReadyPlantInventoryItem/ReadyPlant/02"), NodePath("ReadyPlantInventoryItem/ReadyPlant/03"), NodePath("ReadyPlantInventoryItem/ReadyPlant/04")]
_harvestablePlant = NodePath("ReadyPlantInventoryItem")
_magicEffect = NodePath("magic vfx")
[node name="Seeds" type="Node2D" parent="."]
position = Vector2(0, 0.5)
@@ -188,6 +190,25 @@ texture = ExtResource("8_evgr8")
region_enabled = true
region_rect = Rect2(1167, 863, 528, 785)
[node name="magic vfx" type="CPUParticles2D" parent="."]
position = Vector2(-133, -347)
rotation = -0.333807
emitting = false
amount = 20
texture = ExtResource("9_vjw4j")
lifetime = 0.5
randomness = 1.0
local_coords = true
draw_order = 1
emission_shape = 2
emission_sphere_radius = 128.0
linear_accel_min = 44.07
linear_accel_max = 78.81
scale_amount_min = 0.01
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"]
[editable path="ReadyPlantInventoryItem"]