@slot-engine/core 0.0.8 → 0.0.9
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 +28 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2080,14 +2080,39 @@ var Analysis = class {
|
|
|
2080
2080
|
[15e3, 19999.99],
|
|
2081
2081
|
[2e4, 24999.99]
|
|
2082
2082
|
];
|
|
2083
|
+
const payoutRanges = {};
|
|
2083
2084
|
for (const modeStr of gameModes) {
|
|
2084
|
-
|
|
2085
|
+
payoutRanges[modeStr] = {};
|
|
2085
2086
|
const lutOptimized = parseLookupTable(
|
|
2086
2087
|
import_fs3.default.readFileSync(this.filePaths[modeStr].lutOptimized, "utf-8")
|
|
2087
2088
|
);
|
|
2088
|
-
|
|
2089
|
-
|
|
2089
|
+
lutOptimized.forEach(([, , p]) => {
|
|
2090
|
+
const payout = p / 100;
|
|
2091
|
+
for (const [min, max] of winRanges) {
|
|
2092
|
+
if (payout >= min && payout <= max) {
|
|
2093
|
+
const rangeKey = `${min}-${max}`;
|
|
2094
|
+
if (!payoutRanges[modeStr][rangeKey]) {
|
|
2095
|
+
payoutRanges[modeStr][rangeKey] = 0;
|
|
2096
|
+
}
|
|
2097
|
+
payoutRanges[modeStr][rangeKey] += 1;
|
|
2098
|
+
break;
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
});
|
|
2102
|
+
const orderedRanges = {};
|
|
2103
|
+
Object.keys(payoutRanges[modeStr]).sort((a, b) => {
|
|
2104
|
+
const [aMin] = a.split("-").map(Number);
|
|
2105
|
+
const [bMin] = b.split("-").map(Number);
|
|
2106
|
+
return aMin - bMin;
|
|
2107
|
+
}).forEach((key) => {
|
|
2108
|
+
orderedRanges[key] = payoutRanges[modeStr][key];
|
|
2109
|
+
});
|
|
2110
|
+
payoutRanges[modeStr] = orderedRanges;
|
|
2090
2111
|
}
|
|
2112
|
+
writeJsonFile(
|
|
2113
|
+
import_path2.default.join(process.cwd(), this.gameConfig.outputDir, "stats_payouts.json"),
|
|
2114
|
+
payoutRanges
|
|
2115
|
+
);
|
|
2091
2116
|
}
|
|
2092
2117
|
getGameModeConfig(mode) {
|
|
2093
2118
|
const config = this.gameConfig.gameModes[mode];
|