@yipe/dice 0.2.21 → 0.2.22

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.
@@ -2422,7 +2422,9 @@ var Dice = class _Dice {
2422
2422
  if (key === "hit") {
2423
2423
  this.ensureHitDistribution();
2424
2424
  }
2425
- return this.outcomeData[key];
2425
+ const distribution = this.outcomeData[key];
2426
+ if (distribution === void 0) return void 0;
2427
+ return { ...distribution };
2426
2428
  }
2427
2429
  getFullOutcomeDistribution() {
2428
2430
  return { ...this.outcomeData };
@@ -3834,6 +3836,14 @@ var RollBuilder = class _RollBuilder {
3834
3836
  maxOf(count) {
3835
3837
  return new MaxOfRollBuilder(this, count);
3836
3838
  }
3839
+ // These methods are implemented via prototype augmentation in ac.ts and dc.ts
3840
+ // They are declared here to provide proper TypeScript types
3841
+ ac(targetAC) {
3842
+ throw new Error("ac() should be implemented via prototype augmentation");
3843
+ }
3844
+ dc(saveDC) {
3845
+ throw new Error("dc() should be implemented via prototype augmentation");
3846
+ }
3837
3847
  };
3838
3848
  var HalfRollBuilder = class _HalfRollBuilder extends RollBuilder {
3839
3849
  constructor(innerRoll) {
@@ -4210,7 +4220,12 @@ var rollFn = (count, sidesOrDie, modifier) => {
4210
4220
  return builder.plus(modifier);
4211
4221
  }
4212
4222
  };
4213
- rollFn.d = (sides) => new RollBuilder(1).d(sides);
4223
+ rollFn.d = (sides) => {
4224
+ if (typeof sides === "string") {
4225
+ return RollBuilder.fromArgs(sides);
4226
+ }
4227
+ return new RollBuilder(1).d(sides);
4228
+ };
4214
4229
  rollFn.hd20 = () => new RollBuilder(1).d20().reroll(1);
4215
4230
  rollFn.d4 = () => new RollBuilder(1).d4();
4216
4231
  rollFn.d6 = () => new RollBuilder(1).d6();
@@ -4221,6 +4236,9 @@ rollFn.d20 = () => new RollBuilder(1).d20();
4221
4236
  rollFn.d100 = () => new RollBuilder(1).d100();
4222
4237
  rollFn.flat = (n) => new RollBuilder(0).plus(n);
4223
4238
  function d(sides) {
4239
+ if (typeof sides === "string") {
4240
+ return RollBuilder.fromArgs(sides);
4241
+ }
4224
4242
  return new RollBuilder(1).d(sides);
4225
4243
  }
4226
4244
  var d4 = new RollBuilder(1).d4();