changed calculation of effective initiative so that it never returns negative values; also added functions to module.exports
This commit is contained in:
parent
6c4714048f
commit
62d86f12f0
@ -105,9 +105,9 @@ function whoGoesFirst(a, b) {
|
||||
|
||||
// compute a combatant's effective ini value (modified by wound penalties)
|
||||
function getEffectiveIni(tr) {
|
||||
// return -1 if combatant is K.O. or dead
|
||||
// return 0 if combatant is K.O. or dead
|
||||
if ($(tr).hasClass("ko-or-dead")) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
// otherwise compute effective ini (true ini minus wound penalties)
|
||||
let effectiveIni = parseInt($(tr).attr("data-true-ini")) - DAMAGE_PENALTY[parseInt($(tr).attr("data-damage-stun")) || 0] - DAMAGE_PENALTY[parseInt($(tr).attr("data-damage-physical")) || 0];
|
||||
@ -511,4 +511,4 @@ $(document).ready(function () {
|
||||
addTestCombatant();
|
||||
});
|
||||
|
||||
module.exports = { rollForInitiative, validateCombatant };
|
||||
module.exports = { rollForInitiative, validateCombatant, whoGoesFirst, getEffectiveIni };
|
||||
Loading…
Reference in New Issue
Block a user