public override bool OnPickup(Player player) { ECPlayer modPlayer = player.GetModPlayer <ECPlayer>(); modPlayer.PsychosisRestore(5f); Main.PlaySound(7, (int)player.position.X, (int)player.position.Y); return(false); }
public override bool UseItem(Player player) { ECPlayer modPlayer = player.GetModPlayer <ECPlayer>(); float[] psychosisDiff = { modPlayer.psychosis, 0 }; if (modPlayer.psychosis < 0f) { modPlayer.psychosis = 0f; } modPlayer.PsychosisRestore(restoreAmount, false); psychosisDiff[1] = modPlayer.psychosis; if (Main.myPlayer == player.whoAmI) { //player.HealEffect((int)Math.Ceiling((psychosisDiff[1] - psychosisDiff[0])), true); CombatText.NewText(new Rectangle((int)player.position.X, (int)player.position.Y, player.width, player.height), new Color(255, 105, 180, 255), (int)Math.Ceiling((psychosisDiff[1] - psychosisDiff[0]))); } player.statLife -= (int)Math.Ceiling((psychosisDiff[1] - psychosisDiff[0])); player.lifeRegenCount = 0; player.lifeRegenTime = 0; return(true); //return base.UseItem(player); }