@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 CHANGED
@@ -1,2 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ import { DicePool } from "./types";
3
+ export declare function parseDiceNotation(input: string): DicePool;
4
+ export declare function formatResult(result: any): string;
5
+ export declare const main: () => void;
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.setBackDice = count;
58
+ pool.boostDice = count;
56
59
  break;
57
60
  case "boo":
58
- pool.setBackDice = count;
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.boostDice = count;
79
+ pool.setBackDice = count;
77
80
  break;
78
81
  case "k":
79
- pool.boostDice = count;
82
+ pool.setBackDice = count;
80
83
  break;
81
84
  case "sb":
82
- pool.boostDice = count;
85
+ pool.setBackDice = count;
83
86
  break;
84
87
  case "s":
85
- pool.boostDice = count;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swrpg-online/dice",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "A TypeScript library for simulating Star Wars RPG narrative dice rolls.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {