Example #1
0
        public static void ApplyRecipeModifications()
        {
            var mymod = StarvationMod.Instance;

            if (mymod.Config.CustomPumpkinPieRecipe)
            {
                StarvationItem.ApplyPumpkinPieRecipeModification();
            }
        }
        ////

        public override void PostDrawInInventory(Item item, SpriteBatch sb, Vector2 pos, Rectangle _1, Color _2, Color _3, Vector2 _4,
                                                 float scale)
        {
            if (!this.NeedsSaving(item))
            {
                return;
            }
            if (item.type < 0 || item.type >= Main.itemTexture.Length)
            {
                return;
            }

            float freshnessPercent;

            if (!this.ComputeTimeLeftPercent(item, out freshnessPercent))
            {
                return;
            }

            StarvationItem.DrawFreshnessGaugeInventory(sb, Main.itemTexture[item.type], pos, freshnessPercent, scale);
        }
        ////////////////

        public override bool PreDrawInWorld(Item item, SpriteBatch sb, Color lightColor, Color _1, ref float _2, ref float scale,
                                            int whoAmI)
        {
            if (!this.NeedsSaving(item))
            {
                return(true);
            }

            float freshnessPercent;

            if (!this.ComputeTimeLeftPercent(item, out freshnessPercent))
            {
                return(true);
            }

            if (freshnessPercent <= 0f)
            {
                StarvationItem.DrawSpoilageWorld(sb, item.Center, lightColor, scale);
                return(false);
            }

            return(true);
        }
        public override bool PreDrawInInventory(Item item, SpriteBatch sb, Vector2 pos, Rectangle frame, Color drawColor, Color itemColor,
                                                Vector2 origin, float scale)
        {
            if (!this.NeedsSaving(item))
            {
                return(true);
            }

            float freshnessPercent;

            if (!this.ComputeTimeLeftPercent(item, out freshnessPercent))
            {
                return(true);
            }

            if (freshnessPercent <= 0f)
            {
                StarvationItem.DrawSpoilageInventory(sb, Main.itemTexture[item.type], pos, drawColor, scale);
                return(false);
            }

            return(true);
        }
Example #5
0
 public override bool NeedsSaving(Item item)
 {
     return(StarvationItem.CanSpoil(item));
 }
Example #6
0
 public override void PostAddRecipes()
 {
     StarvationItem.ApplyRecipeModifications();
 }
Example #7
0
        ////

        public override void AddRecipes()
        {
            StarvationItem.AddNewRecipes();
        }