#W# FarmController work. Added new graphic for farmablecabbage.

This commit is contained in:
WarrentyExpired 2026-08-19 12:54:54 -04:00
parent 4344a81180
commit 3d61b04b72
5 changed files with 52 additions and 11 deletions

View file

@ -9,12 +9,21 @@ namespace Server.Items
public static class FarmController
{
// Vegetable Plot Boundaries
private static Rectangle2D VeggieRect = new Rectangle2D(795, 771, 17, 15);
private static Rectangle2D CabbagePlot = new Rectangle2D(795, 771, 5, 4);
private static Rectangle2D CarrotPlot = new Rectangle2D(795, 776, 5, 4);
private static Rectangle2D LettucePlot = new Rectangle2D(795, 781, 5, 5);
private static Rectangle2D OnionPlot = new Rectangle2D(801, 771, 5, 4);
private static Rectangle2D TurnipPlot = new Rectangle2D(801, 776,5 ,4);
private static Rectangle2D PumpkinPlot = new Rectangle2D(801, 781, 5, 5);
private static Rectangle2D WheatPlot = new Rectangle2D(808, 771, 5, 4);
private static Rectangle2D FlaxPlot = new Rectangle2D(808, 776, 5, 4);
private static Rectangle2D CottonPlot = new Rectangle2D(808, 781, 5, 5);
// Reagent Plot Boundaries
private static Rectangle2D ReagentRect = new Rectangle2D(820, 843, 23, 16);
//private static Rectangle2D ReagentRect = new Rectangle2D(820, 843, 23, 16);
// Lists must be static now
private static List<Type> m_VeggieTypes = new List<Type> { typeof(FarmableCabbage), typeof(FarmableCarrot), typeof(FarmableCotton), typeof(FarmableFlax), typeof(FarmableLettuce), typeof(FarmableOnion), typeof(FarmablePumpkin), typeof(FarmableTurnip), typeof(FarmableWheat) };
//private static List<Type> m_VeggieTypes = new List<Type> { typeof(FarmableCabbage), typeof(FarmableCarrot), typeof(FarmableCotton), typeof(FarmableFlax), typeof(FarmableLettuce), typeof(FarmableOnion), typeof(FarmablePumpkin), typeof(FarmableTurnip), typeof(FarmableWheat) };
//private static List<Type> m_ReagentTypes = new List<Type> { typeof(FarmableBlackPearl), typeof(FarmableBloodmoss), typeof(FarmableGarlic), typeof(FarmableGinseng), typeof(FarmableMandrakeRoot), typeof(FarmableNightshade), typeof(FarmableSpidersSilk), typeof(FarmableSulfurousAsh) };
// The core looks for 'Initialize' on startup and runs it automatically
@ -30,8 +39,15 @@ namespace Server.Items
private static void SpawnTick()
{
// Spawn 2 vegetables and 2 reagents each tick if space allows
SpawnInArea(VeggieRect, m_VeggieTypes, 2);
//SpawnInArea(ReagentRect, m_ReagentTypes, 2);
SpawnInArea(CabbagePlot, new List<Type> { typeof(FarmableCabbage) }, 1);
SpawnInArea(CarrotPlot, new List<Type> { typeof(FarmableCarrot) }, 1);
SpawnInArea(LettucePlot, new List<Type> { typeof(FarmableLettuce) }, 1);
SpawnInArea(OnionPlot, new List<Type> { typeof(FarmableOnion) }, 1);
SpawnInArea(TurnipPlot, new List<Type> { typeof(FarmableTurnip) }, 1);
SpawnInArea(PumpkinPlot, new List<Type> { typeof(FarmablePumpkin) }, 1);
SpawnInArea(WheatPlot, new List<Type> { typeof(FarmableWheat) }, 1);
SpawnInArea(FlaxPlot, new List<Type> { typeof(FarmableFlax) }, 1);
SpawnInArea(CottonPlot, new List<Type> { typeof(FarmableCotton) }, 1);
}
private static void SpawnInArea(Rectangle2D rect, List<Type> types, int count)

View file

@ -8,7 +8,8 @@ namespace Server.Items
{
public static int GetCropID()
{
return 3254;
//return 3254;
return 0x48E4;
}
public override Item GetCropObject()
@ -48,4 +49,4 @@ namespace Server.Items
int version = reader.ReadEncodedInt();
}
}
}
}

View file

@ -21,6 +21,6 @@ namespace Server
public static bool S_MonstersSurprise = true;
public static bool S_DungeonTraps = true;
public static double S_FarmSpawnTimer = 15.0;
public static int S_HarvestRange = 2;
public static int S_HarvestRange = 1;
}
}