public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) { Vector2 loc = player.itemLocation; loc.Y -= 20; Random rand = new Random(); int r = rand.Next(0, 6); if (r == 0) { for (int i = 0; i < 9; i++) { Dust.NewDust(loc, 50, 30, mod.DustType("Garnsworddust"), 0.0F, 0.0F, 0, default(Color), 4.5F); } damage += (int) (damage * 0.4); int healamount = (int)(damage * 0.33); player.HealEffect(healamount, true); if (player.statLife + healamount <= (player.statLifeMax + player.statLifeMax2)) { player.statLife += healamount; } else { player.statLife = (player.statLifeMax + player.statLifeMax2); } } }
/// <summary> /// /// </summary> /// <param name="p"></param> /// <returns></returns> public override bool? UseItem(Player p) { int heal = Math.Max(Main.rand.Next(90, 130), p.statLifeMax2 - p.statLife); p.statLife += heal; p.HealEffect(heal); return true; }
/// <summary> /// Activates the tome skill. /// </summary> /// <param name="p">The <see cref="Player" /> that activated the skill.</param> /// <remarks>No NetMessages have to be sent, this method is called on all clients and the server.</remarks> public override void Activate(Player p) { if (p.direction == 1) { if (p.statMana > 20) { p.statLife += 20; p.statMana -= 20; p.HealEffect(20); } } else if (p.statLife > 20) { p.statMana += 20; p.statLife -= 5 ; p.ManaEffect(20); } }
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { player.HealEffect(3); player.statLife += 3; }
/// <summary> /// Activates the tome skill. /// </summary> /// <param name="p">The <see cref="Player" /> that activated the skill.</param> /// <remarks>No NetMessages have to be sent, this method is called on all clients and the server.</remarks> public override void Activate(Player p) { if (p.statMana < 30f* p.manaCost) return; p.statMana = (int)(p.statMana - 30f * p.manaCost); if (Main.rand.Next(5) == 0 && (p.wet || p.lavaWet)) { if (p.wet) p.breath += 50; if (p.lavaWet) p.AddBuff(1, 180); } else if (Main.rand.Next(2) == 0) { p.statMana += 130; p.ManaEffect(130); } else { p.statLife += 100; p.HealEffect(100); } }