gambling-bot-shared 0.1.27 → 0.1.29
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.
|
@@ -19,7 +19,9 @@ exports.readableGameNames = [
|
|
|
19
19
|
{ name: 'Rock Paper Scissors', value: 'rps' },
|
|
20
20
|
{ name: 'Golden Jackpot', value: 'goldenJackpot' },
|
|
21
21
|
{ name: 'Blackjack', value: 'blackjack' },
|
|
22
|
-
{ name: 'Prediction', value: 'prediction' }
|
|
22
|
+
{ name: 'Prediction', value: 'prediction' },
|
|
23
|
+
{ name: 'Raffle', value: 'raffle' },
|
|
24
|
+
{ name: 'Plinko', value: 'plinko' }
|
|
23
25
|
];
|
|
24
26
|
exports.defaultCasinoSettings = {
|
|
25
27
|
dice: {
|
|
@@ -94,5 +96,16 @@ exports.defaultCasinoSettings = {
|
|
|
94
96
|
},
|
|
95
97
|
raffle: {
|
|
96
98
|
casinoCut: 0.01
|
|
99
|
+
},
|
|
100
|
+
plinko: {
|
|
101
|
+
binMultipliers: {
|
|
102
|
+
0: 6,
|
|
103
|
+
1: 1.5,
|
|
104
|
+
2: 0.75,
|
|
105
|
+
3: 0.5,
|
|
106
|
+
4: 0.75,
|
|
107
|
+
5: 1.5,
|
|
108
|
+
6: 6
|
|
109
|
+
}
|
|
97
110
|
}
|
|
98
111
|
};
|
|
@@ -156,6 +156,17 @@ export declare const GuildConfigurationSchema: Schema<TGuildConfiguration, impor
|
|
|
156
156
|
raffle: {
|
|
157
157
|
casinoCut: number;
|
|
158
158
|
};
|
|
159
|
+
plinko: {
|
|
160
|
+
binMultipliers: {
|
|
161
|
+
0: number;
|
|
162
|
+
1: number;
|
|
163
|
+
2: number;
|
|
164
|
+
3: number;
|
|
165
|
+
4: number;
|
|
166
|
+
5: number;
|
|
167
|
+
6: number;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
159
170
|
}, TGuildConfiguration, import("mongoose").Document<unknown, {}, TGuildConfiguration, {
|
|
160
171
|
id: string;
|
|
161
172
|
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TGuildConfiguration & {
|
|
@@ -86,7 +86,7 @@ const calculateRTP = (game, settings) => {
|
|
|
86
86
|
parity: parityRTP,
|
|
87
87
|
range: rangeRTP,
|
|
88
88
|
dozen: dozenRTP,
|
|
89
|
-
column: columnRTP
|
|
89
|
+
column: columnRTP
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
case 'rps': {
|
|
@@ -98,9 +98,25 @@ const calculateRTP = (game, settings) => {
|
|
|
98
98
|
return (toNumber(winMultiplier) / toNumber(oneInChance)) * 100;
|
|
99
99
|
}
|
|
100
100
|
case 'blackjack':
|
|
101
|
-
return 99.4;
|
|
102
101
|
case 'prediction':
|
|
102
|
+
case 'raffle':
|
|
103
103
|
return 0;
|
|
104
|
+
case 'plinko': {
|
|
105
|
+
const { binMultipliers } = settings;
|
|
106
|
+
const multipliers = binMultipliers;
|
|
107
|
+
const bins = Object.keys(multipliers)
|
|
108
|
+
.map(Number)
|
|
109
|
+
.sort((a, b) => a - b);
|
|
110
|
+
const N = bins.length - 1; // rows
|
|
111
|
+
const p = 0.5;
|
|
112
|
+
let rtp = 0;
|
|
113
|
+
for (let k = 0; k <= N; k++) {
|
|
114
|
+
const probability = combination(N, k) * Math.pow(p, k) * Math.pow(1 - p, N - k);
|
|
115
|
+
const multiplier = toNumber(multipliers[k] ?? 0);
|
|
116
|
+
rtp += probability * multiplier;
|
|
117
|
+
}
|
|
118
|
+
return rtp * 100;
|
|
119
|
+
}
|
|
104
120
|
default:
|
|
105
121
|
console.warn(`RTP for ${game} not implemented`);
|
|
106
122
|
return 0;
|