Difference between revisions of "Pain state"

From DoomWiki.org

[unchecked revision][unchecked revision]
m
(added technical blurp from Talk: Rocket launcher)
Line 6: Line 6:
  
 
For those monsters with a low pain chance, the shotguns or plasma guns are preferred. Only the Player and Lost Soul have a 100% pain chance.
 
For those monsters with a low pain chance, the shotguns or plasma guns are preferred. Only the Player and Lost Soul have a 100% pain chance.
 +
 +
==Technical==
 +
Pain chance is handled in P_DamageMobj () in p_inter.c. This is the generic "hurt something" code which is called for all damage events. There are no situations in the game where multiple separate damage events are combined into one pain chance check. Fox example, for rocket [[splash damage|splashes]], P_RadiusAttack () from p_map.c calls P_DamageMobj individually for each splash it makes, and the direct hit is also a separate call. [[BFG 9000|BFG]] tracers and shotgun pellets also call P_DamageMobj individually for each one, even if many hit one target.
  
 
[[Category:Doom engine]]
 
[[Category:Doom engine]]
 
[[Category:Monsters]]
 
[[Category:Monsters]]

Revision as of 16:04, 20 October 2007

Under construction icon-yellow.svgThis article or section is a stub. Please help the Doom Wiki by adding to it.

A monster's pain chance refers to the probability of a monster being distracted from its attack when being attacked by the player or another monster. The monster, when in pain from being hit by a projectile, shot, clawed, punched, or chainsawed, halts its attack and restarts from the beginning, sometimes by trying to maneuver into a new position to attack its target. It may or may not give out a distinctive cry.

The chaingun is particularly useful against monsters with a high pain chance, as due to its rapid rate of fire each bullet causes the monster to cringe and restart (called "doing the chaingun cha-cha" in the original Doom manual). These include Imps, Demons, Lost Souls, Cacodemons, Pain Elementals, Mancubus, Arachnotrons and Revenants.

For those monsters with a low pain chance, the shotguns or plasma guns are preferred. Only the Player and Lost Soul have a 100% pain chance.

Technical

Pain chance is handled in P_DamageMobj () in p_inter.c. This is the generic "hurt something" code which is called for all damage events. There are no situations in the game where multiple separate damage events are combined into one pain chance check. Fox example, for rocket splashes, P_RadiusAttack () from p_map.c calls P_DamageMobj individually for each splash it makes, and the direct hit is also a separate call. BFG tracers and shotgun pellets also call P_DamageMobj individually for each one, even if many hit one target.