public static bool OnStrikeNpc(NPC npc, ref int damage, ref float knockback, ref int hitdirection, ref bool crit, ref bool noEffect, ref double retdamage) { if (NpcHooks.StrikeNpc == null) { return(false); } NpcStrikeEventArgs npcStrikeEventArgs = new NpcStrikeEventArgs { Npc = npc, Damage = damage, KnockBack = knockback, HitDirection = hitdirection, Critical = crit, NoEffect = noEffect, ReturnDamage = retdamage }; NpcHooks.StrikeNpc(npcStrikeEventArgs); crit = npcStrikeEventArgs.Critical; damage = npcStrikeEventArgs.Damage; knockback = npcStrikeEventArgs.KnockBack; hitdirection = npcStrikeEventArgs.HitDirection; noEffect = npcStrikeEventArgs.NoEffect; retdamage = npcStrikeEventArgs.ReturnDamage; return(npcStrikeEventArgs.Handled); }
private void NpcHooks_OnStrikeNpc(NpcStrikeEventArgs e) { if (Config.InfiniteInvasion) { IncrementKills(); if (Main.invasionSize < 10) { Main.invasionSize = 20000000; } } }
public static bool OnStrikeNpc(NPC npc, ref int damage, ref float knockback, ref int hitdirection, ref bool crit, ref bool noEffect, ref double retdamage) { if (NpcHooks.StrikeNpc == null) { return false; } NpcStrikeEventArgs npcStrikeEventArgs = new NpcStrikeEventArgs { Npc = npc, Damage = damage, KnockBack = knockback, HitDirection = hitdirection, Critical = crit, NoEffect = noEffect, ReturnDamage = retdamage }; NpcHooks.StrikeNpc(npcStrikeEventArgs); crit = npcStrikeEventArgs.Critical; damage = npcStrikeEventArgs.Damage; knockback = npcStrikeEventArgs.KnockBack; hitdirection = npcStrikeEventArgs.HitDirection; noEffect = npcStrikeEventArgs.NoEffect; retdamage = npcStrikeEventArgs.ReturnDamage; return npcStrikeEventArgs.Handled; }