void Crit(Player target, ref float damageMultiplier) { damageMultiplier += Type1.GetValue(); PoMEffectHelper.Crit(target.position, target.width, target.height, 50); if (Main.netMode == NetmodeID.MultiplayerClient) { EffectPacketHandler.CSyncCrit(target, 50); } lastProcTime = Main.GameUpdateCount; }
void HealPlayer(Player player) { int amount = (int)MathHelper.Clamp(player.statLifeMax2 * Type1.GetValue(), 1, 9999999); player.statLife += amount; PoMEffectHelper.Heal(player, amount); if (Main.netMode == NetmodeID.MultiplayerClient) { EffectPacketHandler.CSyncHeal(player.whoAmI, amount); } lastProcTime = Main.GameUpdateCount; }
void Hit(Item item, Player player, Player target) { if (item == player.HeldItem && target.statLife >= target.statLifeMax2) { int critDamage = (int)Math.Round(target.statLifeMax2 * Type1.GetValue()); int direction = (target.Center.X - player.Center.X) > 0 ? 1 : -1; target.Hurt(Terraria.DataStructures.PlayerDeathReason.ByPlayer(player.whoAmI), critDamage, direction, true, false, false); target.immune = false; PoMEffectHelper.Crit(target.position, target.width, target.height, 100); if (Main.netMode == NetmodeID.MultiplayerClient) { EffectPacketHandler.CSyncCrit(target, 100); } } }
void Hit(Item item, Player player, NPC target) { NPC realTarget = target.realLife >= 0 ? Main.npc[target.realLife] : target; if (item == player.HeldItem && realTarget.life >= realTarget.lifeMax) { int critDamage = (int)Math.Round(realTarget.lifeMax * Type1.GetValue()); int direction = (target.Center.X - player.Center.X) > 0 ? 1 : -1; player.ApplyDamageToNPC(target, critDamage, 0, direction, false); PoMEffectHelper.Crit(target.position, target.width, target.height, 100); if (Main.netMode == NetmodeID.MultiplayerClient) { EffectPacketHandler.CSyncCrit(target, 100); } } }