@slot-engine/core 0.1.8 → 0.1.10
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.js +4 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3498,9 +3498,9 @@ var GeneratedReelSet = class extends ReelSet {
|
|
|
3498
3498
|
`Error generating reels for game mode "${this.associatedGameModeName}". It's not defined in the game config.`
|
|
3499
3499
|
);
|
|
3500
3500
|
}
|
|
3501
|
+
const outputDir = path7.join(config.rootDir, config.outputDir);
|
|
3501
3502
|
const filePath = path7.join(
|
|
3502
|
-
|
|
3503
|
-
config.outputDir,
|
|
3503
|
+
outputDir,
|
|
3504
3504
|
`reels_${this.associatedGameModeName}-${this.id}.csv`
|
|
3505
3505
|
);
|
|
3506
3506
|
const exists = fs5.existsSync(filePath);
|
|
@@ -3574,12 +3574,6 @@ var GeneratedReelSet = class extends ReelSet {
|
|
|
3574
3574
|
chosenSymbolId = prevSymbol.id;
|
|
3575
3575
|
}
|
|
3576
3576
|
}
|
|
3577
|
-
if (this.preferStackedSymbols && reel.length > 0) {
|
|
3578
|
-
const prevSymbol = r - 1 >= 0 ? reel[r - 1] : reel[reel.length - 1];
|
|
3579
|
-
if (Math.round(this.rng.randomFloat(1, 100)) <= this.preferStackedSymbols && (!this.spaceBetweenSameSymbols || !this.violatesSpacing(reel, prevSymbol.id, r))) {
|
|
3580
|
-
chosenSymbolId = prevSymbol.id;
|
|
3581
|
-
}
|
|
3582
|
-
}
|
|
3583
3577
|
const stackCfg = this.resolveStacking(chosenSymbolId, ridx);
|
|
3584
3578
|
if (stackCfg && this.isSymbolAllowedOnReel(chosenSymbolId, ridx)) {
|
|
3585
3579
|
const roll = Math.round(this.rng.randomFloat(1, 100));
|
|
@@ -3647,12 +3641,13 @@ var GeneratedReelSet = class extends ReelSet {
|
|
|
3647
3641
|
}
|
|
3648
3642
|
const csvString = csvRows.map((row) => row.join(",")).join("\n");
|
|
3649
3643
|
if (isMainThread5) {
|
|
3644
|
+
createDirIfNotExists(outputDir);
|
|
3650
3645
|
fs5.writeFileSync(filePath, csvString);
|
|
3651
|
-
this.reels = this.parseReelsetCSV(filePath, config);
|
|
3652
3646
|
console.log(
|
|
3653
3647
|
`Generated reelset ${this.id} for game mode ${this.associatedGameModeName}`
|
|
3654
3648
|
);
|
|
3655
3649
|
}
|
|
3650
|
+
this.reels = this.parseReelsetCSV(filePath, config);
|
|
3656
3651
|
return this;
|
|
3657
3652
|
}
|
|
3658
3653
|
};
|