public override bool UseItem(Player player) { if (player.itemAnimation > 0 && player.statManaMax >= 200 && player.statManaMax < 300 && player.itemTime == 0) { player.itemTime = PlayerHooks.TotalUseTime(item.useTime, player, item); player.statManaMax2 += 10; player.GetModPlayer <TemperatePlayer>().ArcaneCrystals += 1; player.statMana += 10; if (Main.myPlayer == player.whoAmI) { player.ManaEffect(10); } AchievementsHelper.HandleSpecialEvent(player, AchievementHelperID.Special.ConsumeStar); } return(false); }
private static void ToggleOpenSpecialChest(int tX, int tY, Player player, int specialChestType) { Main.stackSplit = 600; // Clicked and current chest is already open if (specialChestType == player.chest) { player.chest = -1; Main.PlaySound(SoundID.MenuClose); } // Clicked and another chest is open else if (specialChestType != player.chest && player.chest == -1) { player.chest = specialChestType; Main.playerInventory = true; if (PlayerInput.GrappleAndInteractAreShared) { PlayerInput.Triggers.JustPressed.Grapple = false; } Main.recBigList = false; Main.PlaySound(SoundID.MenuOpen); player.chestX = tX; player.chestY = tY; if (Main.tile[tX, tY].frameX >= 36 && Main.tile[tX, tY].frameX < 72) { AchievementsHelper.HandleSpecialEvent(player, 16); } } // Switching between chests else { player.chest = specialChestType; Main.playerInventory = true; if (PlayerInput.GrappleAndInteractAreShared) { PlayerInput.Triggers.JustPressed.Grapple = false; } Main.recBigList = false; Main.PlaySound(SoundID.MenuTick); player.chestX = tX; player.chestY = tY; } Recipe.FindRecipes(); }
public override bool UseItem(Item item, Player player) { if (item.type == mod.ItemType("BlazingHeart") && player.itemAnimation > 0 && player.statLifeMax >= 300 && player.statLifeMax < 400 && player.itemTime == 0) { player.itemTime = (int)((float)item.useTime / PlayerHooks.TotalUseTimeMultiplier(player, item)); player.statLifeMax += 10; player.statLifeMax2 += 10; player.statLife += 10; if (Main.myPlayer == player.whoAmI) { player.HealEffect(10, true); } AchievementsHelper.HandleSpecialEvent(player, 2); } if (item.type == mod.ItemType("DazzlingHeart") && player.itemAnimation > 0 && player.statLifeMax >= 400 && player.statLifeMax < 450 && player.itemTime == 0) { player.itemTime = (int)((float)item.useTime / PlayerHooks.TotalUseTimeMultiplier(player, item)); player.statLifeMax += 5; player.statLifeMax2 += 5; player.statLife += 5; if (Main.myPlayer == player.whoAmI) { player.HealEffect(5, true); } AchievementsHelper.HandleSpecialEvent(player, 2); } if (item.type == 1291 && player.itemAnimation > 0 && player.statLifeMax >= 450 && player.statLifeMax < 500 && player.itemTime == 0) { player.itemTime = (int)((float)item.useTime / PlayerHooks.TotalUseTimeMultiplier(player, item)); player.statLifeMax += 5; player.statLifeMax2 += 5; player.statLife += 5; if (Main.myPlayer == player.whoAmI) { player.HealEffect(5, true); } AchievementsHelper.HandleSpecialEvent(player, 2); } return(base.UseItem(item, player)); }