Exemplo n.º 1
0
        public static bool Prefix(
            ref StardewValley.FarmAnimal __instance,
            ref GameTime time,
            ref GameLocation location,
            ref bool __result)
        {
            var moddedAnimal = new Decorators.FarmAnimal(__instance);

            if (!moddedAnimal.HasHome() || moddedAnimal.IsEating() || Game1.IsClient || __instance.controller != null)
            {
                return(true);
            }
            var moddedLocation = new Location(location);

            HandleFindGrassToEat(ref moddedAnimal, ref moddedLocation);
            if (HandleNightTimeRoutine(ref moddedAnimal, ref moddedLocation))
            {
                __result = true;
            }
            else
            {
                HandleFindProduce(ref moddedAnimal, ref moddedLocation);
                __result = false;
            }

            return(false);
        }