public static void Spend(global::StardewValley.Farmer farmer, int amount, Utilities.Currency.Type currency) { switch (currency) { case Utilities.Currency.Type.Money: farmer.Money = Math.Max(Utilities.Currency.MinimumAmount, farmer.Money - amount); break; case Utilities.Currency.Type.FestivalScore: farmer.festivalScore = Math.Max(Utilities.Currency.MinimumAmount, farmer.festivalScore - amount); break; case Utilities.Currency.Type.ClubCoins: farmer.clubCoins = Math.Max(Utilities.Currency.MinimumAmount, farmer.clubCoins - amount); break; } }
public static bool CanAfford(global::StardewValley.Farmer farmer, int amount, Utilities.Currency.Type currency = Utilities.Currency.Type.Money) { switch (currency) { case Utilities.Currency.Type.Money: return(farmer.Money >= amount); case Utilities.Currency.Type.FestivalScore: return(farmer.festivalScore >= amount); case Utilities.Currency.Type.ClubCoins: return(farmer.clubCoins >= amount); default: return(false); } }
public static bool HasSeenEvent(global::StardewValley.Farmer farmer, int eventId) { return(farmer.eventsSeen.Contains(eventId)); }
public static long GetUniqueId(global::StardewValley.Farmer farmer) { return(farmer.UniqueMultiplayerID); }
public static void SpendMoney(global::StardewValley.Farmer farmer, int amount) { Characters.Farmer.Spend(farmer, amount, Utilities.Currency.Type.Money); }
public static bool HasProfession(global::StardewValley.Farmer farmer, Characters.Farmer.Profession profession) { return(farmer.professions.Contains((int)profession)); }
public static bool IsCurrentLocation(global::StardewValley.Farmer farmer, GameLocation location) { return(Locations.Location.IsLocation(Characters.Farmer.GetCurrentLocation(farmer), location)); }
internal static bool Prefix(ref global::StardewValley.Object __result, int waterDepth, global::StardewValley.Farmer who) { if (Global.Config.OverrideGetSewerFishKing && (Game1.random.NextDouble() < Global.Config.SewerFishKingThreshold + ((who.getTileX() > 14 && who.getTileY() > 42) ? 0.08 : 0.0))) { __result = new global::StardewValley.Object(682, 1, false, -1, 0); return(false); } return(true); }
public static double GetDailyLuck(global::StardewValley.Farmer farmer) { return(Utilities.Game.GetDailyLuck() + Characters.Farmer.GetLuckLevel(farmer)); }
public static GameLocation GetCurrentLocation(global::StardewValley.Farmer farmer) { return(farmer.currentLocation); }
internal static bool Prefix(ref global::StardewValley.Object __result, int waterDepth, global::StardewValley.Farmer who) { if (Global.Config.OverrideGetWinterFishKing && Game1.currentSeason.Equals("winter") && who.getTileX() == 58 && who.getTileY() == 87 && who.FishingLevel >= 6 && waterDepth >= 3 && Game1.random.NextDouble() < Global.Config.WinterFishKingThreshold) { __result = new global::StardewValley.Object(775, 1, false, -1, 0); return(false); } return(true); }
internal static bool Prefix(ref global::StardewValley.Object __result, int waterDepth, global::StardewValley.Farmer who) { if (Global.Config.OverrideGetSpringFishKing && Game1.currentSeason.Equals("spring") && Game1.isRaining && who.FishingLevel >= 10 && waterDepth >= 4 && Game1.random.NextDouble() < Global.Config.SpringFishKingThreshold) { __result = new global::StardewValley.Object(163, 1, false, -1, 0); return(false); } return(true); }
internal static bool Prefix(ref global::StardewValley.Object __result, int waterDepth, global::StardewValley.Farmer who) { if (Global.Config.OverrideGetFallFishKing && Game1.currentSeason.Equals("fall") && who.getTileLocation().Y < 15f && who.FishingLevel >= 3 && Game1.random.NextDouble() < Global.Config.FallFishKingThreshold) { __result = new global::StardewValley.Object(160, 1, false, -1, 0); return(false); } return(true); }
public static bool HasCompletedQuest(global::StardewValley.Farmer farmer, int questId) { return(farmer.questLog.Where(o => o.id.Value.Equals(questId) && o.completed.Value).Any()); }
public static global::StardewValley.FarmAnimal CreateFarmAnimal(global::StardewValley.Farmer farmer, string type, string name = null, Building home = null, long myId = default(long)) { return(Characters.FarmAnimal.CreateFarmAnimal(type, Characters.Farmer.GetUniqueId(farmer), name, home, myId)); }
public static int GetLuckLevel(global::StardewValley.Farmer farmer) { return(farmer.LuckLevel); }
public static bool IsBlueChickenAvailableForPurchase(global::StardewValley.Farmer farmer) { return(Characters.FarmAnimal.RollBlueChickenChance(farmer)); }