public override void PostSellItem(NPC vendor, Item[] shopInventory, Item item)
 {
     for (int i = 0; i < salesCD.Length; i++)
     {
         if (salesCD[i] <= 0)
         {
             salesCD[i] = 3600;
             break;
         }
     }
     ElementsAwoken.DebugModeText("sales last min: " + (salesLastMin + 1));
 }
 public override void PostBuyItem(NPC vendor, Item[] shopInventory, Item item)
 {
     for (int i = 0; i < buysCD.Length; i++)
     {
         if (buysCD[i] <= 0)
         {
             buysCD[i] = 3600;
             break;
         }
     }
     ElementsAwoken.DebugModeText("buys last min: " + (buysLastMin + 1));
 }
        public override void Update(Item item, ref float gravity, ref float maxFallSpeed)
        {
            Player         player    = Main.player[item.owner];
            AwakenedPlayer modPlayer = player.GetModPlayer <AwakenedPlayer>(mod);

            if (MyWorld.awakenedMode)
            {
                // lavawet isnt set yet so check it manually
                reduceSanityCD--; // takes 3 frames for vanilla to destroy the voodoo doll (idk why) so add a cooldown so it doesnt reduce it too much
                if (item.type == ItemID.GuideVoodooDoll && Collision.LavaCollision(item.position, item.width, item.height) && Main.netMode != 1 && NPC.AnyNPCs(NPCID.Guide) && reduceSanityCD <= 0)
                {
                    reduceSanityCD    = 5;
                    modPlayer.sanity -= 20;
                    ElementsAwoken.DebugModeText("voodoll drain");
                }
            }
        }
        public override void NPCLoot(NPC npc)
        {
            Player      player    = Main.player[Main.myPlayer];
            PlayerUtils modPlayer = player.GetModPlayer <PlayerUtils>(mod);

            if (npc.boss)
            {
                for (int i = 0; i < modPlayer.bossKilledCD.Length; i++)
                {
                    if (modPlayer.bossKilledCD[i] <= 0)
                    {
                        modPlayer.bossKilledCD[i] = 18000;
                        break;
                    }
                }
                ElementsAwoken.DebugModeText("boss killed");
                ElementsAwoken.DebugModeText("bosses killed last min: " + (modPlayer.bossesKilledLastMin + 1)); // plus 1 because it hasnt updated yet
                ElementsAwoken.DebugModeText("bosses killed last five min: " + (modPlayer.bossesKilledLastFiveMin + 1));
            }
        }
        // check using potions, also works for quick buff idk why
        public override bool UseItem(Item item, Player player)
        {
            PlayerUtils modPlayer = player.GetModPlayer <PlayerUtils>(mod);

            if (item.buffType != 0 && item.useStyle == 2 && item.consumable)
            {
                for (int i = 0; i < modPlayer.potionConsumedCD.Length; i++)
                {
                    if (modPlayer.potionConsumedCD[i] <= 0)
                    {
                        modPlayer.potionConsumedCD[i] = 3600;
                        break;
                    }
                }
                ElementsAwoken.DebugModeText("potions consumed last min: " + (modPlayer.potionsConsumedLastMin + 1)); // plus 1 because it hasnt updated yet
            }

            /*if (item.Name.Contains("Potion") && item.buffType != 0)
             * {
             *
             * }*/
            return(base.UseItem(item, player));
        }