WIP fixing farming mechanic again
This commit is contained in:
@@ -40,22 +40,27 @@ public partial class FieldBehaviour2D : Sprite2D
|
||||
{
|
||||
case FieldState.Empty:
|
||||
FieldState = FieldState.Empty;
|
||||
GD.Print("FieldState is Empty.");
|
||||
break;
|
||||
case FieldState.Tilled:
|
||||
FieldState = FieldState.Tilled;
|
||||
_fieldSprite.Texture = Tilled;
|
||||
_growingCollider.Visible = false;
|
||||
GD.Print("FieldState is Tilled.");
|
||||
break;
|
||||
case FieldState.Watered:
|
||||
FieldState = FieldState.Watered;
|
||||
_fieldSprite.Texture = Watered;
|
||||
_growingCollider.Visible = true;
|
||||
GD.Print("FieldState is Watered.");
|
||||
break;
|
||||
case FieldState.Planted:
|
||||
FieldState = FieldState.Planted;
|
||||
GD.Print("FieldState is Planted.");
|
||||
break;
|
||||
default:
|
||||
FieldState = FieldState.NotFound;
|
||||
GD.Print("FieldState is NotFound.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -63,8 +68,7 @@ public partial class FieldBehaviour2D : Sprite2D
|
||||
|
||||
public void Water()
|
||||
{
|
||||
FieldState = FieldState.Watered;
|
||||
_fieldSprite.Texture = Watered;
|
||||
UpdateFieldState(FieldState.Watered);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -41,6 +41,7 @@ public partial class PlantBehaviour2D : Node2D
|
||||
if (_field.FieldState != FieldState.Watered || !_magicWordSaid)
|
||||
return;
|
||||
|
||||
GD.Print("Trying to grow something here.");
|
||||
GetTree().CallGroup("PlantGrowing", Player2D.MethodName.PlayFarmingAnimation);
|
||||
|
||||
switch (_state)
|
||||
@@ -49,18 +50,21 @@ public partial class PlantBehaviour2D : Node2D
|
||||
_state = PlantState.Planted;
|
||||
_currentPlantSprite = GetRandomSprite(_seeds);
|
||||
_currentPlantSprite.Visible = true;
|
||||
GD.Print("PlantState is none.");
|
||||
break;
|
||||
case PlantState.Planted:
|
||||
_state = PlantState.SmallPlant;
|
||||
_currentPlantSprite.Visible = false;
|
||||
_currentPlantSprite = GetRandomSprite(_smallPlants);
|
||||
_currentPlantSprite.Visible = true;
|
||||
GD.Print("PlantState is planted.");
|
||||
break;
|
||||
case PlantState.SmallPlant:
|
||||
_state = PlantState.BigPlant;
|
||||
_currentPlantSprite.Visible = false;
|
||||
_currentPlantSprite = GetRandomSprite(_bigPlants);
|
||||
_currentPlantSprite.Visible = true;
|
||||
GD.Print("PlantState is Smallplant.");
|
||||
break;
|
||||
case PlantState.BigPlant:
|
||||
_state = PlantState.Ready;
|
||||
@@ -68,6 +72,7 @@ public partial class PlantBehaviour2D : Node2D
|
||||
_currentPlantSprite = GetRandomSprite(_readyPlants);
|
||||
_harvestablePlant.IsActive = true;
|
||||
_currentPlantSprite.Visible = true;
|
||||
GD.Print("PlantState is BigPlant.");
|
||||
break;
|
||||
case PlantState.Ready:
|
||||
_state = PlantState.None;
|
||||
|
||||
Reference in New Issue
Block a user