@swrpg-online/dice 1.4.0 → 1.4.1

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.
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DICE_FACES = exports.FORCE_DIE_FACES = exports.CHALLENGE_DIE_FACES = exports.PROFICIENCY_DIE_FACES = exports.DIFFICULTY_DIE_FACES = exports.ABILITY_DIE_FACES = exports.SETBACK_DIE_FACES = exports.BOOST_DIE_FACES = void 0;
4
+ exports.BOOST_DIE_FACES = {
5
+ 1: {}, // Blank
6
+ 2: {}, // Blank
7
+ 3: { successes: 1 }, // (S)
8
+ 4: { successes: 1, advantages: 1 }, // (S)(A)
9
+ 5: { advantages: 2 }, // (A)(A)
10
+ 6: { advantages: 1 }, // (A)
11
+ };
12
+ exports.SETBACK_DIE_FACES = {
13
+ 1: {}, // Blank
14
+ 2: {}, // Blank
15
+ 3: { failures: 1 }, // (F)
16
+ 4: { failures: 1 }, // (F)
17
+ 5: { threats: 1 }, // (TH)
18
+ 6: { threats: 1 }, // (TH)
19
+ };
20
+ exports.ABILITY_DIE_FACES = {
21
+ 1: {}, // Blank
22
+ 2: { successes: 1 }, // (S)
23
+ 3: { successes: 1 }, // (S)
24
+ 4: { successes: 2 }, // (S)(S)
25
+ 5: { advantages: 1 }, // (A)
26
+ 6: { advantages: 1 }, // (A)
27
+ 7: { successes: 1, advantages: 1 }, // (S)(A)
28
+ 8: { advantages: 2 }, // (A)(A)
29
+ };
30
+ exports.DIFFICULTY_DIE_FACES = {
31
+ 1: {}, // Blank
32
+ 2: { failures: 1 }, // (F)
33
+ 3: { failures: 2 }, // (F)(F)
34
+ 4: { threats: 1 }, // (TH)
35
+ 5: { threats: 1 }, // (TH)
36
+ 6: { threats: 1 }, // (TH)
37
+ 7: { threats: 2 }, // (TH)(TH)
38
+ 8: { failures: 1, threats: 1 }, // (F)(TH)
39
+ };
40
+ exports.PROFICIENCY_DIE_FACES = {
41
+ 1: {}, // Blank
42
+ 2: { successes: 1 }, // (S)
43
+ 3: { successes: 1 }, // (S)
44
+ 4: { successes: 2 }, // (S)(S)
45
+ 5: { successes: 2 }, // (S)(S)
46
+ 6: { advantages: 1 }, // (A)
47
+ 7: { successes: 1, advantages: 1 }, // (S)(A)
48
+ 8: { successes: 1, advantages: 1 }, // (S)(A)
49
+ 9: { successes: 1, advantages: 1 }, // (S)(A)
50
+ 10: { advantages: 2 }, // (A)(A)
51
+ 11: { successes: 1, advantages: 1 }, // (S)(A)
52
+ 12: { triumphs: 1 }, // (TR) - Triumph also counts as Success
53
+ };
54
+ exports.CHALLENGE_DIE_FACES = {
55
+ 1: {}, // Blank
56
+ 2: { failures: 1 }, // (F)
57
+ 3: { failures: 1 }, // (F)
58
+ 4: { failures: 2 }, // (F)(F)
59
+ 5: { failures: 2 }, // (F)(F)
60
+ 6: { threats: 1 }, // (TH)
61
+ 7: { threats: 1 }, // (TH)
62
+ 8: { failures: 1, threats: 1 }, // (F)(TH)
63
+ 9: { failures: 1, threats: 1 }, // (F)(TH)
64
+ 10: { threats: 2 }, // (TH)(TH)
65
+ 11: { threats: 2 }, // (TH)(TH)
66
+ 12: { despairs: 1 }, // (D) - Despair also counts as Failure
67
+ };
68
+ exports.FORCE_DIE_FACES = {
69
+ 1: { darkSide: 1 }, // (DS)
70
+ 2: { darkSide: 1 }, // (DS)
71
+ 3: { darkSide: 1 }, // (DS)
72
+ 4: { darkSide: 1 }, // (DS)
73
+ 5: { darkSide: 1 }, // (DS)
74
+ 6: { darkSide: 1 }, // (DS)
75
+ 7: { darkSide: 2 }, // (DS)(DS)
76
+ 8: { lightSide: 1 }, // (LS)
77
+ 9: { lightSide: 1 }, // (LS)
78
+ 10: { lightSide: 2 }, // (LS)(LS)
79
+ 11: { lightSide: 2 }, // (LS)(LS)
80
+ 12: { lightSide: 2 }, // (LS)(LS)
81
+ };
82
+ exports.DICE_FACES = {
83
+ boost: exports.BOOST_DIE_FACES,
84
+ setback: exports.SETBACK_DIE_FACES,
85
+ ability: exports.ABILITY_DIE_FACES,
86
+ difficulty: exports.DIFFICULTY_DIE_FACES,
87
+ proficiency: exports.PROFICIENCY_DIE_FACES,
88
+ challenge: exports.CHALLENGE_DIE_FACES,
89
+ force: exports.FORCE_DIE_FACES,
90
+ };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { roll } from "./dice";
2
- export type { DicePool, RollResult, DiceResult, RollOptions } from "./types";
2
+ export type { DicePool, RollResult, DiceResult, RollOptions, DieFaceSymbols, BoostDieFace, SetbackDieFace, AbilityDieFace, DifficultyDieFace, ProficiencyDieFace, ChallengeDieFace, ForceDieFace, Symbol, } from "./types";
3
+ export { SYMBOLS } from "./types";
4
+ export { BOOST_DIE_FACES, SETBACK_DIE_FACES, ABILITY_DIE_FACES, DIFFICULTY_DIE_FACES, PROFICIENCY_DIE_FACES, CHALLENGE_DIE_FACES, FORCE_DIE_FACES, DICE_FACES, } from "./diceFaces";
3
5
  export { createSkillCheck, createCombatCheck, createOpposedCheck, createDifficultyPool, applyTalentModifiers, } from "./pools";
4
6
  export type { PoolModifiers } from "./pools";
package/dist/index.js CHANGED
@@ -1,8 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyTalentModifiers = exports.createDifficultyPool = exports.createOpposedCheck = exports.createCombatCheck = exports.createSkillCheck = exports.roll = void 0;
3
+ exports.applyTalentModifiers = exports.createDifficultyPool = exports.createOpposedCheck = exports.createCombatCheck = exports.createSkillCheck = exports.DICE_FACES = exports.FORCE_DIE_FACES = exports.CHALLENGE_DIE_FACES = exports.PROFICIENCY_DIE_FACES = exports.DIFFICULTY_DIE_FACES = exports.ABILITY_DIE_FACES = exports.SETBACK_DIE_FACES = exports.BOOST_DIE_FACES = exports.SYMBOLS = exports.roll = void 0;
4
4
  var dice_1 = require("./dice");
5
5
  Object.defineProperty(exports, "roll", { enumerable: true, get: function () { return dice_1.roll; } });
6
+ var types_1 = require("./types");
7
+ Object.defineProperty(exports, "SYMBOLS", { enumerable: true, get: function () { return types_1.SYMBOLS; } });
8
+ var diceFaces_1 = require("./diceFaces");
9
+ Object.defineProperty(exports, "BOOST_DIE_FACES", { enumerable: true, get: function () { return diceFaces_1.BOOST_DIE_FACES; } });
10
+ Object.defineProperty(exports, "SETBACK_DIE_FACES", { enumerable: true, get: function () { return diceFaces_1.SETBACK_DIE_FACES; } });
11
+ Object.defineProperty(exports, "ABILITY_DIE_FACES", { enumerable: true, get: function () { return diceFaces_1.ABILITY_DIE_FACES; } });
12
+ Object.defineProperty(exports, "DIFFICULTY_DIE_FACES", { enumerable: true, get: function () { return diceFaces_1.DIFFICULTY_DIE_FACES; } });
13
+ Object.defineProperty(exports, "PROFICIENCY_DIE_FACES", { enumerable: true, get: function () { return diceFaces_1.PROFICIENCY_DIE_FACES; } });
14
+ Object.defineProperty(exports, "CHALLENGE_DIE_FACES", { enumerable: true, get: function () { return diceFaces_1.CHALLENGE_DIE_FACES; } });
15
+ Object.defineProperty(exports, "FORCE_DIE_FACES", { enumerable: true, get: function () { return diceFaces_1.FORCE_DIE_FACES; } });
16
+ Object.defineProperty(exports, "DICE_FACES", { enumerable: true, get: function () { return diceFaces_1.DICE_FACES; } });
6
17
  var pools_1 = require("./pools");
7
18
  Object.defineProperty(exports, "createSkillCheck", { enumerable: true, get: function () { return pools_1.createSkillCheck; } });
8
19
  Object.defineProperty(exports, "createCombatCheck", { enumerable: true, get: function () { return pools_1.createCombatCheck; } });
package/dist/types.d.ts CHANGED
@@ -12,6 +12,8 @@ export type DicePool = {
12
12
  automaticThreats?: number;
13
13
  automaticTriumphs?: number;
14
14
  automaticDespairs?: number;
15
+ automaticLightSide?: number;
16
+ automaticDarkSide?: number;
15
17
  upgradeAbility?: number;
16
18
  upgradeDifficulty?: number;
17
19
  downgradeProficiency?: number;
@@ -49,6 +51,23 @@ export declare const SYMBOLS: {
49
51
  readonly DARK: "DARK";
50
52
  };
51
53
  export type Symbol = keyof typeof SYMBOLS;
54
+ export type DieFaceSymbols = {
55
+ successes?: number;
56
+ failures?: number;
57
+ advantages?: number;
58
+ threats?: number;
59
+ triumphs?: number;
60
+ despairs?: number;
61
+ lightSide?: number;
62
+ darkSide?: number;
63
+ };
64
+ export type BoostDieFace = 1 | 2 | 3 | 4 | 5 | 6;
65
+ export type SetbackDieFace = 1 | 2 | 3 | 4 | 5 | 6;
66
+ export type AbilityDieFace = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
67
+ export type DifficultyDieFace = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
68
+ export type ProficiencyDieFace = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
69
+ export type ChallengeDieFace = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
70
+ export type ForceDieFace = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
52
71
  export type RollOptions = {
53
72
  hints?: boolean;
54
73
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swrpg-online/dice",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "A TypeScript library that creates dice rolls using the narrative dice system for the Star Wars Roleplaying Game by Fantasy Flight Games and Edge Studio.",
5
5
  "keywords": [
6
6
  "swrpg",
@@ -81,7 +81,7 @@
81
81
  "rollup": "^2.79.2",
82
82
  "rollup-plugin-terser": "^7.0.2",
83
83
  "semantic-release": "^24.2.0",
84
- "ts-jest": "^29.4.1",
84
+ "ts-jest": "^29.4.4",
85
85
  "tslib": "^2.8.1",
86
86
  "typescript": "^5.7.2"
87
87
  },