@swrpg-online/dice 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +11 -7
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.main = void 0;
|
|
5
|
+
exports.parseDiceNotation = parseDiceNotation;
|
|
6
|
+
exports.formatResult = formatResult;
|
|
4
7
|
const dice_1 = require("./dice");
|
|
5
8
|
// import * as path from 'path';
|
|
6
9
|
function parseDiceNotation(input) {
|
|
@@ -52,10 +55,10 @@ function parseDiceNotation(input) {
|
|
|
52
55
|
break;
|
|
53
56
|
// b/boo = Blue/Boost
|
|
54
57
|
case "b":
|
|
55
|
-
pool.
|
|
58
|
+
pool.boostDice = count;
|
|
56
59
|
break;
|
|
57
60
|
case "boo":
|
|
58
|
-
pool.
|
|
61
|
+
pool.boostDice = count;
|
|
59
62
|
break;
|
|
60
63
|
// r/c = Red/ Challenge
|
|
61
64
|
case "r":
|
|
@@ -73,16 +76,16 @@ function parseDiceNotation(input) {
|
|
|
73
76
|
break;
|
|
74
77
|
// blk/k/sb/s = Black/Setback
|
|
75
78
|
case "blk":
|
|
76
|
-
pool.
|
|
79
|
+
pool.setBackDice = count;
|
|
77
80
|
break;
|
|
78
81
|
case "k":
|
|
79
|
-
pool.
|
|
82
|
+
pool.setBackDice = count;
|
|
80
83
|
break;
|
|
81
84
|
case "sb":
|
|
82
|
-
pool.
|
|
85
|
+
pool.setBackDice = count;
|
|
83
86
|
break;
|
|
84
87
|
case "s":
|
|
85
|
-
pool.
|
|
88
|
+
pool.setBackDice = count;
|
|
86
89
|
break;
|
|
87
90
|
// w/f = White/Force
|
|
88
91
|
// TODO
|
|
@@ -123,6 +126,7 @@ const main = () => {
|
|
|
123
126
|
const result = (0, dice_1.roll)(pool);
|
|
124
127
|
console.log(formatResult(result));
|
|
125
128
|
};
|
|
129
|
+
exports.main = main;
|
|
126
130
|
if (require.main === module) {
|
|
127
|
-
main();
|
|
131
|
+
(0, exports.main)();
|
|
128
132
|
}
|