@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.js
CHANGED
|
@@ -3550,9 +3550,9 @@ var GeneratedReelSet = class extends ReelSet {
|
|
|
3550
3550
|
`Error generating reels for game mode "${this.associatedGameModeName}". It's not defined in the game config.`
|
|
3551
3551
|
);
|
|
3552
3552
|
}
|
|
3553
|
+
const outputDir = import_path7.default.join(config.rootDir, config.outputDir);
|
|
3553
3554
|
const filePath = import_path7.default.join(
|
|
3554
|
-
|
|
3555
|
-
config.outputDir,
|
|
3555
|
+
outputDir,
|
|
3556
3556
|
`reels_${this.associatedGameModeName}-${this.id}.csv`
|
|
3557
3557
|
);
|
|
3558
3558
|
const exists = import_fs5.default.existsSync(filePath);
|
|
@@ -3626,12 +3626,6 @@ var GeneratedReelSet = class extends ReelSet {
|
|
|
3626
3626
|
chosenSymbolId = prevSymbol.id;
|
|
3627
3627
|
}
|
|
3628
3628
|
}
|
|
3629
|
-
if (this.preferStackedSymbols && reel.length > 0) {
|
|
3630
|
-
const prevSymbol = r - 1 >= 0 ? reel[r - 1] : reel[reel.length - 1];
|
|
3631
|
-
if (Math.round(this.rng.randomFloat(1, 100)) <= this.preferStackedSymbols && (!this.spaceBetweenSameSymbols || !this.violatesSpacing(reel, prevSymbol.id, r))) {
|
|
3632
|
-
chosenSymbolId = prevSymbol.id;
|
|
3633
|
-
}
|
|
3634
|
-
}
|
|
3635
3629
|
const stackCfg = this.resolveStacking(chosenSymbolId, ridx);
|
|
3636
3630
|
if (stackCfg && this.isSymbolAllowedOnReel(chosenSymbolId, ridx)) {
|
|
3637
3631
|
const roll = Math.round(this.rng.randomFloat(1, 100));
|
|
@@ -3699,12 +3693,13 @@ var GeneratedReelSet = class extends ReelSet {
|
|
|
3699
3693
|
}
|
|
3700
3694
|
const csvString = csvRows.map((row) => row.join(",")).join("\n");
|
|
3701
3695
|
if (import_worker_threads5.isMainThread) {
|
|
3696
|
+
createDirIfNotExists(outputDir);
|
|
3702
3697
|
import_fs5.default.writeFileSync(filePath, csvString);
|
|
3703
|
-
this.reels = this.parseReelsetCSV(filePath, config);
|
|
3704
3698
|
console.log(
|
|
3705
3699
|
`Generated reelset ${this.id} for game mode ${this.associatedGameModeName}`
|
|
3706
3700
|
);
|
|
3707
3701
|
}
|
|
3702
|
+
this.reels = this.parseReelsetCSV(filePath, config);
|
|
3708
3703
|
return this;
|
|
3709
3704
|
}
|
|
3710
3705
|
};
|