@slot-engine/core 0.1.5 → 0.1.6
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/index.d.mts +86 -64
- package/dist/index.d.ts +86 -64
- package/dist/index.js +39 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -645,14 +645,15 @@ var Board = class {
|
|
|
645
645
|
this.lastUsedReels = opts.reels;
|
|
646
646
|
for (let ridx = 0; ridx < reelsAmount; ridx++) {
|
|
647
647
|
const reelPos = finalReelStops[ridx];
|
|
648
|
+
const reelLength = opts.reels[ridx].length;
|
|
648
649
|
for (let p = padSymbols - 1; p >= 0; p--) {
|
|
649
|
-
const topPos = (reelPos - (p + 1)) %
|
|
650
|
+
const topPos = ((reelPos - (p + 1)) % reelLength + reelLength) % reelLength;
|
|
650
651
|
this.paddingTop[ridx].push(opts.reels[ridx][topPos]);
|
|
651
|
-
const bottomPos = (reelPos + symbolsPerReel[ridx] + p) %
|
|
652
|
+
const bottomPos = (reelPos + symbolsPerReel[ridx] + p) % reelLength;
|
|
652
653
|
this.paddingBottom[ridx].unshift(opts.reels[ridx][bottomPos]);
|
|
653
654
|
}
|
|
654
655
|
for (let row = 0; row < symbolsPerReel[ridx]; row++) {
|
|
655
|
-
const symbol = opts.reels[ridx][(reelPos + row) %
|
|
656
|
+
const symbol = opts.reels[ridx][(reelPos + row) % reelLength];
|
|
656
657
|
if (!symbol) {
|
|
657
658
|
throw new Error(`Failed to get symbol at pos ${reelPos + row} on reel ${ridx}`);
|
|
658
659
|
}
|
|
@@ -728,6 +729,19 @@ var Board = class {
|
|
|
728
729
|
newPaddingTopSymbols
|
|
729
730
|
};
|
|
730
731
|
}
|
|
732
|
+
dedupeWinSymbolsForTumble(winCombinations) {
|
|
733
|
+
const symbolsMap = /* @__PURE__ */ new Map();
|
|
734
|
+
winCombinations.forEach((wc) => {
|
|
735
|
+
wc.symbols.forEach((s) => {
|
|
736
|
+
symbolsMap.set(`${s.reelIndex},${s.posIndex}`, {
|
|
737
|
+
reelIdx: s.reelIndex,
|
|
738
|
+
rowIdx: s.posIndex
|
|
739
|
+
});
|
|
740
|
+
});
|
|
741
|
+
});
|
|
742
|
+
const symbolsToRemove = Array.from(symbolsMap.values());
|
|
743
|
+
return symbolsToRemove;
|
|
744
|
+
}
|
|
731
745
|
};
|
|
732
746
|
|
|
733
747
|
// src/service/board.ts
|
|
@@ -872,6 +886,16 @@ var BoardService = class extends AbstractService {
|
|
|
872
886
|
symbolsToDelete
|
|
873
887
|
});
|
|
874
888
|
}
|
|
889
|
+
/**
|
|
890
|
+
* Dedupes win symbols for tumble.\
|
|
891
|
+
* Returns a list of symbols to remove from the board based on the given win combinations.
|
|
892
|
+
*
|
|
893
|
+
* Since it may be possible that multiple win combinations include the same symbol (e.g. Wilds),\
|
|
894
|
+
* this method ensures that each symbol is only listed once for removal. Otherwise tumbling may break.
|
|
895
|
+
*/
|
|
896
|
+
dedupeWinSymbolsForTumble(winCombinations) {
|
|
897
|
+
return this.board.dedupeWinSymbolsForTumble(winCombinations);
|
|
898
|
+
}
|
|
875
899
|
};
|
|
876
900
|
|
|
877
901
|
// src/service/data.ts
|
|
@@ -2270,28 +2294,12 @@ var Analysis = class {
|
|
|
2270
2294
|
const payoutRanges = {};
|
|
2271
2295
|
for (const modeStr of gameModes) {
|
|
2272
2296
|
payoutRanges[modeStr] = { overall: {}, criteria: {} };
|
|
2273
|
-
const lutOptimized = parseLookupTable(
|
|
2274
|
-
fs3.readFileSync(this.filePaths[modeStr].lutOptimized, "utf-8")
|
|
2275
|
-
);
|
|
2276
2297
|
const lutSegmented = parseLookupTableSegmented(
|
|
2277
2298
|
fs3.readFileSync(this.filePaths[modeStr].lutSegmented, "utf-8")
|
|
2278
2299
|
);
|
|
2279
|
-
lutOptimized.forEach(([, , p]) => {
|
|
2280
|
-
const payout = p / 100;
|
|
2281
|
-
for (const [min, max] of winRanges) {
|
|
2282
|
-
if (payout >= min && payout <= max) {
|
|
2283
|
-
const rangeKey = `${min}-${max}`;
|
|
2284
|
-
if (!payoutRanges[modeStr].overall[rangeKey]) {
|
|
2285
|
-
payoutRanges[modeStr].overall[rangeKey] = 0;
|
|
2286
|
-
}
|
|
2287
|
-
payoutRanges[modeStr].overall[rangeKey] += 1;
|
|
2288
|
-
break;
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
});
|
|
2292
2300
|
lutSegmented.forEach(([, criteria, bp, fsp]) => {
|
|
2293
|
-
const basePayout = bp
|
|
2294
|
-
const freeSpinPayout = fsp
|
|
2301
|
+
const basePayout = bp;
|
|
2302
|
+
const freeSpinPayout = fsp;
|
|
2295
2303
|
const payout = basePayout + freeSpinPayout;
|
|
2296
2304
|
for (const [min, max] of winRanges) {
|
|
2297
2305
|
if (payout >= min && payout <= max) {
|
|
@@ -3748,6 +3756,16 @@ var StandaloneBoard = class {
|
|
|
3748
3756
|
padSymbols: this.padSymbols
|
|
3749
3757
|
});
|
|
3750
3758
|
}
|
|
3759
|
+
/**
|
|
3760
|
+
* Dedupes win symbols for tumble.\
|
|
3761
|
+
* Returns a list of symbols to remove from the board based on the given win combinations.
|
|
3762
|
+
*
|
|
3763
|
+
* Since it may be possible that multiple win combinations include the same symbol (e.g. Wilds),\
|
|
3764
|
+
* this method ensures that each symbol is only listed once for removal. Otherwise tumbling may break.
|
|
3765
|
+
*/
|
|
3766
|
+
dedupeWinSymbolsForTumble(winCombinations) {
|
|
3767
|
+
return this.board.dedupeWinSymbolsForTumble(winCombinations);
|
|
3768
|
+
}
|
|
3751
3769
|
};
|
|
3752
3770
|
export {
|
|
3753
3771
|
ClusterWinType,
|