public static List <GameLocation> getCabins() { StardewValley.Farm farm = Game1.getLocationFromName("Farm") as StardewValley.Farm; List <GameLocation> cabins = new List <GameLocation>(); farm.buildings.Where(x => x.isCabin).All(i => { cabins.Add(i.indoors.Value); return(true); }); return(cabins); }
public static bool RequiredBuildingIsBuilt(SDV.Farm farm, string[] buildings, out string type) { if (buildings.Where(name => Location.IsBuildingConstructed(farm, name)).Any()) { type = null; return(true); } var dataValue = Content.GetDataValue <string, string>(Content.DataBlueprintsContentPath, buildings.First(), 8); type = Content.LoadString("Strings\\StringsFromCSFiles:Utility.cs.5926").Replace("Coop", dataValue); return(false); }
public static bool Farm_tryToAddHay_prefix(StardewValley.Farm __instance, ref int __result, int num) { try { int num1 = Math.Min(Utility.numSilos() * SiloCapacity - __instance.piecesOfHay.Value, num); __instance.piecesOfHay.Value += num1; __result = num - num1; return(false); } catch (Exception ex) { Monitor.Log($"Farm_tryToAddHay_prefix technical problem:\n{ex}", LogLevel.Error); Monitor.Log("Reverting to unpatched Farm.tryToAddHay behavior!", LogLevel.Warn); return(true); } }
public static SDV.Object FormatAsAnimalAvailableForPurchase( SDV.Farm farm, string name, string displayName, string[] types, string[] buildings) { string type; RequiredBuildingIsBuilt(farm, buildings, out type); var @object = new SDV.Object(100, 1, price: (int)Math.Ceiling(FarmAnimal.GetCheapestPrice(types.ToList()) / 2.0)) { Type = type, displayName = displayName }; @object.Name = name; return(@object); }
public Farm(StardewValley.Farm farm) { _farm = farm; }