This method is extremely unreliable. It can work for hitscan weapons since their attacks are instantaneous, but with projectile weapons it can be foiled. Fire a rocket at distant enemies, then while it's traveling, switch to the chainsaw. Once the rocket hits and kill the enemies, your system would detect that the player currently has "chainsawdeath" in inventory, and so the enemies would enter their chainsaw death...WARCHILD_89 wrote: //Inventory Itemthat causes Imp to go to its special death state only when Player has "shotgundeath"
// in his inventory. It can only be given by the currently selected weapon (here: the shotgun)
Another problem with your system: since it depends on what is in the monster's target's inventory, it can be foiled. Suppose an imp accidentally hit a arch-vile. Now the arch-vile will retaliate against the imp and fry it. The imp, however, is still targeting you, so despite being burnt by an arch-vile's pyrokinesis spell, it'll count as a shotgun death or whatever other weapon you are currently using.
Using custom damage types is a lot more reliable. It also handles infighting correctly.

