All fixes'
This commit is contained in:
@ -4,6 +4,7 @@ import { PegasusActorCreate } from "./pegasus-create-char.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const __level2Dice = [ "d0", "d4", "d6", "d8", "d10", "d12" ];
|
||||
const __level2DiceValue = [ 0, 4, 6, 8, 10, 12 ];
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class PegasusUtility {
|
||||
@ -179,6 +180,18 @@ export class PegasusUtility {
|
||||
return it;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getDiceValue( level = 0) {
|
||||
let locLevel = level
|
||||
let diceValue = 0
|
||||
while (locLevel > 0) {
|
||||
let idx = locLevel % __level2Dice.length
|
||||
diceValue += __level2DiceValue[idx]
|
||||
locLevel -= idx
|
||||
}
|
||||
return diceValue
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getDiceFromLevel(level = 0) {
|
||||
level = Number(level)
|
||||
|
Reference in New Issue
Block a user