mirror of
https://github.com/Burn-E99/TheArtificer.git
synced 2026-01-08 05:17:54 -05:00
deno fmt + added docs on cwod dice
This commit is contained in:
@ -28,7 +28,7 @@ export const formatRoll = (rollConf: string, maximiseRoll: boolean, nominalRoll:
|
||||
|
||||
if (!e.dropped && !e.rerolled) {
|
||||
// If the roll was not dropped or rerolled, add it to the stepTotal and flag the critHit/critFail
|
||||
switch(e.type) {
|
||||
switch (e.type) {
|
||||
case 'ova':
|
||||
case 'roll20':
|
||||
tempTotal += e.roll;
|
||||
@ -67,7 +67,7 @@ export const formatRoll = (rollConf: string, maximiseRoll: boolean, nominalRoll:
|
||||
// After the looping is done, remove the extra " + " from the details and cap it with the closing ]
|
||||
tempDetails = tempDetails.substring(0, tempDetails.length - 3);
|
||||
if (tempRollSet[0]?.type === 'cwod') {
|
||||
tempDetails += `, ${tempRollSet.filter(e => e.critHit).length} Successes, ${tempRollSet.filter(e => e.critFail).length} Fails`;
|
||||
tempDetails += `, ${tempRollSet.filter((e) => e.critHit).length} Successes, ${tempRollSet.filter((e) => e.critFail).length} Fails`;
|
||||
}
|
||||
tempDetails += ']';
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import {
|
||||
LT,
|
||||
} from '../../deps.ts';
|
||||
|
||||
import { RollSet, RollConf, RollType } from './solver.d.ts';
|
||||
import { RollConf, RollSet, RollType } from './solver.d.ts';
|
||||
import { compareOrigidx, compareRolls, genRoll, loggingEnabled } from './rollUtils.ts';
|
||||
|
||||
// roll(rollStr, maximiseRoll, nominalRoll) returns RollSet
|
||||
@ -104,7 +104,7 @@ export const roll = (rollStr: string, maximiseRoll: boolean, nominalRoll: boolea
|
||||
|
||||
// Use critScore to set the difficulty
|
||||
rollConf.critScore.on = true;
|
||||
const difficulty = parseInt(cwodParts[1] || '10')
|
||||
const difficulty = parseInt(cwodParts[1] || '10');
|
||||
for (let i = difficulty; i <= rollConf.dieSize; i++) {
|
||||
loggingEnabled && log(LT.LOG, `handling cwod ${rollStr} | Parsing difficulty ${i}`);
|
||||
rollConf.critScore.range.push(i);
|
||||
|
||||
2
src/solver/solver.d.ts
vendored
2
src/solver/solver.d.ts
vendored
@ -97,4 +97,4 @@ export type RollConf = {
|
||||
once: boolean;
|
||||
nums: number[];
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user