TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ StrikeInstantKill()

void Terraria.NPC.StrikeInstantKill ( )
inline

Helper method for calling M:Terraria.NPC.StrikeNPC(Terraria.NPC.HitInfo,System.Boolean,System.Boolean) with a F:Terraria.NPC.HitInfo.InstantKill strike.
Use to butcher your own NPCs.
Not recommended for use on multiplayer clients because the net packet will trigger M:Terraria.NPC.PlayerInteraction(System.Int32) on the server.

Definition at line 91792 of file NPC.cs.

91793 {
91794 HitInfo hitInfo = new HitInfo();
91795 hitInfo.InstantKill = true;
91796 HitInfo hit = hitInfo;
91798 if (Main.netMode != 0)
91799 {
91800 NetMessage.SendStrikeNPC(this, in hit);
91801 }
91802 }
int StrikeNPC(int Damage, float knockBack, int hitDirection, bool crit=false, bool fromNet=false, bool noPlayerInteraction=false)
Definition NPC.cs:91679

References Terraria.Main.netMode, and Terraria.NetMessage.SendStrikeNPC().

+ Here is the call graph for this function: