Talk:Pain state

This article needs information on pain threshold. See Quasar's note here.

100% pain chance
According to Dehacked (and the respective actor's entries here on the wiki), the player and Romero's head all have 255 pain chance. This is translated to 100%. But something is wrong. As I understand, pain chance is out of 256, which would mean that 255 pain chance would translate to 99.61%, not 100%. However, if we assume that pain chance is actually out of 255, then that throws off every other pain chance calculation. Examples: I could go on, but you get the idea. If pain chance is really out of 256 and not 255, then the real pain% for the player and Romero's head is (255*100)/256=99.61%. --Reaper with no name 04:33, 31 December 2008 (UTC)
 * Arachnotron: 128 pain chance
 * (128*100)/256=50% (agrees with wiki)
 * (128*100)/255=50.20% (doesn't agree with wiki)
 * Mancubus: 80 pain chance
 * (80*100)/256=31.25% (agrees with wiki)
 * (80*100)/255=31.37% (doesn't agree with wiki)


 * Very sensible. According to the article, this is where an actor does or does not enter its pain state (from P_DamageMobj):

if ( (P_Random < target->info->painchance)         && !(target->flags&MF_SKULLFLY) ) {       target->flags |= MF_JUSTHIT;        // fight back! P_SetMobjState (target, target->info->painstate); }


 * Therefore, AFAICT, what "255" really means is "what fraction of the entries in m_random.c are below 255?". The answer is 255/256 &asymp; 99.61%.  For "80" it would be 79/256 &asymp; 30.86%.    Ryan W 20:18, 8 January 2009 (UTC)

Explanation
Pain chance is an 8-bit variable. That's 256 possibilities, from 0 to 255. 255 = 100%. --162.123.17.80 16:33, 9 January 2009 (UTC)Jared