tModLoader Is it possible to create a weapon that can damage town NPCs?

Hellfire Taco

Terrarian
I know that it's possible to create projectiles that damage town NPCs, but what about a weapon? I want to make a gun that shoots bullets like any other normal gun, but I want the bullets to be able to damage town NPCs. Is that possible?
 
Prerry much what you said
I'm not sure how that would work. I know that Rotten Eggs can damage friendly NPCs, but is the code that allows it to do that in the projectile or the item? If it's in the projectile, I'd have to make a new projectile that is the exact same as every bullet but has the ability to damage town NPCs, and I'd also have to make the weapon shoot the correct type of bullet for the type of bullet it's consuming. On top of that, it wouldn't be able to use any bullets from other mods, as I'd have to specify what type of ammo the weapon uses, instead of just specifying the type of ammo.
 
Back
Top Bottom