Talk:A CStaffInitBlink

From ZDoom Wiki
Jump to navigation Jump to search

I can't really figure what's the deal with pr_blink(). It seems to be an instance of the FRandom class which is the random number generator... but I can't see FRandom's named constructor returning anything. Not that constructors could return anything... -Chromium 12:42, 18 February 2011 (CST)

Basically, whenever you see a call to a pr_whatever FRandom function, the result is between 0 and 255. Here's how it works:
from m_random.h:
	// Returns a random number in the range [0,255]
	int operator()()
	{
		return GenRand32() & 255;
	}
You also will often see Random2(), which returns a value between -255 and 255. And finally, HitDice(x) gives you x × 1d8. --Gez 16:55, 18 February 2011 (CST)
Oh, I see. Thanks. (a bit late tho) -Chromium 09:11, 2 March 2011 (CST)