Energion Fantasy Role-Playing Game System
[Neufeld Computer Services] [Henry's Web] [Enzar Empire Press]

The Energion Role-Playing Game System

Stat Formula Examples

These are the simples formulas in the system. You can see the results of this most basic roll. If a gamemaster wants to pay attention to that level of detail, the greater negative value indicates a greater failure, while the greater positive value indicates greater succes. For example, I might use a roll under IQ bonus to determine the likelihood that a character might know an obscure fact that is not covered specifically by a knowledge field, or that a character might combine two pieces of information. A very high negative value then might indicate that the character thinks he knows, but in fact is wrong; a low negative value might indicate the character simply doesn't know. A positive value indicates knowledge, and you can consider a bonus for a very high positive value.

StatBonusPenalty# of DiceStat RollBonus Roll
0 54 -99

The following text is the php code for the formulas involved.

function stat_bonus($st) {
	return $st - 100;
}

//$st is the stat
//$t is the type, default='b' as this is the most common roll
//$n = number of d100, default 1
//'s' = roll under stat
//'b' = roll under bonus
//'hb' = roll under half bonus
//'qb' = roll under quarter bonus
function stat_roll($st,$t='b',$penalty=0,$n=1) {
	list($usec, $sec) = explode(' ', microtime());
	srand((float) $sec + ((float) $usec * 100000));
	$roll = 0;
	for ($i=0; $i<$n; $i++)
		$roll += rand(1,100);
	$roll /= $n;
	switch ($t) {
		case 'b':
			return stat_bonus($st) - $penalty - $roll;
		case 's':
			return $st - $penalty - $roll;
		case 'hb':
			return stat_bonus($st) / 2 - $penalty - $roll;
		case 'qb':
			return stat_bonus($st) / 4 - $penalty - $roll;
	}
	return 0;
}