🐛 added preset fields to main outdoor scene and made them farmable

This commit is contained in:
2025-11-12 15:14:10 +01:00
parent 554a319428
commit 443741f5f1
10 changed files with 163 additions and 45 deletions
@@ -43,7 +43,7 @@ public partial class FieldBehaviour2D : Sprite2D
// fieldstate == tilled / watered && samen im Inventar
_canPlant = (FieldState == FieldState.Tilled || FieldState == FieldState.Watered) && _seedsActive;
// fieldstate == tilled && watering can ausgewählt
_canWater = FieldState == FieldState.Tilled && _wateringCanActive;
_canWater = (FieldState == FieldState.Tilled || FieldState == FieldState.Planted) && _wateringCanActive;
FieldInteractionArea.IsActive = _canPlant || _canWater;
}
@@ -116,7 +116,7 @@ public partial class FieldBehaviour2D : Sprite2D
/// </summary>
public void Farm()
{
if (_canPlant || TryPlant())
if (_canPlant && TryPlant())
{
EmitSignal(SignalName.Planted);
UpdateFieldState(FieldState.Planted);
@@ -133,7 +133,7 @@ public partial class FieldBehaviour2D : Sprite2D
bool success = false;
int currentSlotIndex = InventoryManager.Instance.CurrentSelectedSlotIndex;
ItemInstance? item = InventoryManager.Instance.playerInventory.Slots[currentSlotIndex].itemInstance;
if (item == null || PlantingPlaceholder.GetChildCount() > 0 || item.amount == 0)
return success;
@@ -155,7 +155,7 @@ public partial class FieldBehaviour2D : Sprite2D
InventoryManager.Instance.playerInventory.RemoveItem(currentSlotIndex);
success = true;
}
return success;
}