Research:Common Terms: Difference between revisions
Jump to navigation
Jump to search
(Added fatigueTerm.) |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Template:Research Navbox}} | |||
Formulae commonly used across multiple mechanics. It may be a good idea to factor these into their own functions to avoid code duplication. | Formulae commonly used across multiple mechanics. It may be a good idea to factor these into their own functions to avoid code duplication. | ||
===fatigueTerm=== | ===fatigueTerm=== | ||
Line 12: | Line 16: | ||
Note: fatigueTerm is normally 1.25 at full fatigue with default GMSTs. | Note: fatigueTerm is normally 1.25 at full fatigue with default GMSTs. | ||
</syntaxhighlight> | |||
===normalizedEncumbrance=== | |||
<syntaxhighlight lang="python"> | |||
with respect to an actor: | |||
if maxEncumbrance == 0: | |||
normalizedEncumbrance = 1 | |||
else: | |||
normalizedEncumbrance = currentEncumbrance / maxEncumbrance | |||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 18:51, 19 November 2015
Formulae commonly used across multiple mechanics. It may be a good idea to factor these into their own functions to avoid code duplication.
fatigueTerm
with respect to an actor:
fatigueTerm = fFatigueBase - fFatigueMult * (1 - normalizedFatigue)
# where normalizedFatigue is a function of actor fatigue. empty fatigue bar -> 0.0, full fatigue bar -> 1.0
if maxFatigue == 0: normalizedFatigue = 1
else: normalizedFatigue = max(0, currentFatigue / maxFatigue)
# it is possible for normalizedFatigue to go over 1.0 when fatigue is fortified, it is not capped from above.
Note: fatigueTerm is normally 1.25 at full fatigue with default GMSTs.
normalizedEncumbrance
with respect to an actor:
if maxEncumbrance == 0:
normalizedEncumbrance = 1
else:
normalizedEncumbrance = currentEncumbrance / maxEncumbrance