@slot-engine/core 0.0.11 → 0.1.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.
- package/README.md +0 -3
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -650,11 +650,17 @@ var Board = class {
|
|
|
650
650
|
this.reels[reelIdx].splice(rowIdx, 1);
|
|
651
651
|
});
|
|
652
652
|
const newFirstSymbolPositions = {};
|
|
653
|
+
const newBoardSymbols = {};
|
|
654
|
+
const newPaddingTopSymbols = {};
|
|
653
655
|
for (let ridx = 0; ridx < reelsAmount; ridx++) {
|
|
654
656
|
while (this.reels[ridx].length < symbolsPerReel[ridx]) {
|
|
655
657
|
const padSymbol = this.paddingTop[ridx].pop();
|
|
656
658
|
if (padSymbol) {
|
|
657
659
|
this.reels[ridx].unshift(padSymbol);
|
|
660
|
+
if (!newBoardSymbols[ridx]) {
|
|
661
|
+
newBoardSymbols[ridx] = [];
|
|
662
|
+
}
|
|
663
|
+
newBoardSymbols[ridx].unshift(padSymbol);
|
|
658
664
|
} else {
|
|
659
665
|
break;
|
|
660
666
|
}
|
|
@@ -668,6 +674,10 @@ var Board = class {
|
|
|
668
674
|
assert3(newSymbol, "Failed to get new symbol for tumbling.");
|
|
669
675
|
this.reels[ridx].unshift(newSymbol);
|
|
670
676
|
newFirstSymbolPositions[ridx] = symbolPos;
|
|
677
|
+
if (!newBoardSymbols[ridx]) {
|
|
678
|
+
newBoardSymbols[ridx] = [];
|
|
679
|
+
}
|
|
680
|
+
newBoardSymbols[ridx].unshift(newSymbol);
|
|
671
681
|
}
|
|
672
682
|
}
|
|
673
683
|
for (let ridx = 0; ridx < reelsAmount; ridx++) {
|
|
@@ -678,8 +688,16 @@ var Board = class {
|
|
|
678
688
|
const padSymbol = reels[ridx][topPos];
|
|
679
689
|
assert3(padSymbol, "Failed to get new padding symbol for tumbling.");
|
|
680
690
|
this.paddingTop[ridx].unshift(padSymbol);
|
|
691
|
+
if (!newPaddingTopSymbols[ridx]) {
|
|
692
|
+
newPaddingTopSymbols[ridx] = [];
|
|
693
|
+
}
|
|
694
|
+
newPaddingTopSymbols[ridx].unshift(padSymbol);
|
|
681
695
|
}
|
|
682
696
|
}
|
|
697
|
+
return {
|
|
698
|
+
newBoardSymbols,
|
|
699
|
+
newPaddingTopSymbols
|
|
700
|
+
};
|
|
683
701
|
}
|
|
684
702
|
};
|
|
685
703
|
|
|
@@ -820,7 +838,7 @@ var BoardService = class extends AbstractService {
|
|
|
820
838
|
* Tumbles the board. All given symbols will be deleted and new symbols will fall from the top.
|
|
821
839
|
*/
|
|
822
840
|
tumbleBoard(symbolsToDelete) {
|
|
823
|
-
this.board.tumbleBoard({
|
|
841
|
+
return this.board.tumbleBoard({
|
|
824
842
|
ctx: this.ctx(),
|
|
825
843
|
symbolsToDelete
|
|
826
844
|
});
|
|
@@ -2565,9 +2583,9 @@ var WinType = class {
|
|
|
2565
2583
|
* Custom post-processing of wins, e.g. for handling multipliers.
|
|
2566
2584
|
*/
|
|
2567
2585
|
postProcess(func) {
|
|
2568
|
-
const result = func(this, this.ctx);
|
|
2569
|
-
this.payout = result.payout;
|
|
2586
|
+
const result = func(this.winCombinations, this.ctx);
|
|
2570
2587
|
this.winCombinations = result.winCombinations;
|
|
2588
|
+
this.payout = result.winCombinations.reduce((sum, w) => sum + w.payout, 0);
|
|
2571
2589
|
return this;
|
|
2572
2590
|
}
|
|
2573
2591
|
/**
|
|
@@ -3524,7 +3542,7 @@ var StandaloneBoard = class {
|
|
|
3524
3542
|
* Tumbles the board. All given symbols will be deleted and new symbols will fall from the top.
|
|
3525
3543
|
*/
|
|
3526
3544
|
tumbleBoard(symbolsToDelete) {
|
|
3527
|
-
this.board.tumbleBoard({
|
|
3545
|
+
return this.board.tumbleBoard({
|
|
3528
3546
|
ctx: this.ctx,
|
|
3529
3547
|
symbolsToDelete,
|
|
3530
3548
|
reelsAmount: this.reelsAmount,
|