Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 public static bool HasSeenEvent(global::StardewValley.Farmer farmer, int eventId)
 {
     return(farmer.eventsSeen.Contains(eventId));
 }
Exemplo n.º 4
0
 public static long GetUniqueId(global::StardewValley.Farmer farmer)
 {
     return(farmer.UniqueMultiplayerID);
 }
Exemplo n.º 5
0
 public static void SpendMoney(global::StardewValley.Farmer farmer, int amount)
 {
     Characters.Farmer.Spend(farmer, amount, Utilities.Currency.Type.Money);
 }
Exemplo n.º 6
0
 public static bool HasProfession(global::StardewValley.Farmer farmer, Characters.Farmer.Profession profession)
 {
     return(farmer.professions.Contains((int)profession));
 }
Exemplo n.º 7
0
 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);
        }
Exemplo n.º 9
0
 public static double GetDailyLuck(global::StardewValley.Farmer farmer)
 {
     return(Utilities.Game.GetDailyLuck() + Characters.Farmer.GetLuckLevel(farmer));
 }
Exemplo n.º 10
0
 public static GameLocation GetCurrentLocation(global::StardewValley.Farmer farmer)
 {
     return(farmer.currentLocation);
 }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 14
0
 public static bool HasCompletedQuest(global::StardewValley.Farmer farmer, int questId)
 {
     return(farmer.questLog.Where(o => o.id.Value.Equals(questId) && o.completed.Value).Any());
 }
Exemplo n.º 15
0
 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));
 }
Exemplo n.º 16
0
 public static int GetLuckLevel(global::StardewValley.Farmer farmer)
 {
     return(farmer.LuckLevel);
 }
 public static bool IsBlueChickenAvailableForPurchase(global::StardewValley.Farmer farmer)
 {
     return(Characters.FarmAnimal.RollBlueChickenChance(farmer));
 }