pixi-rainman-game-engine 0.1.42 → 0.1.44
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/SettingsUI/components/Bet/BetControls.jsx +2 -2
- package/dist/SettingsUI/components/Bet/bet.css +16 -10
- package/dist/application/SoundManager/types.d.ts +8 -0
- package/dist/application/SoundManager/types.js +8 -0
- package/dist/components/frame/AbstractColumnsContainer.d.ts +2 -1
- package/dist/components/frame/AbstractColumnsContainer.js +23 -2
- package/dist/components/frame/constants.d.ts +9 -0
- package/dist/components/frame/constants.js +8 -0
- package/dist/controllers/AbstractController.js +8 -2
- package/dist/stores/SettingsStore.d.ts +1 -0
- package/dist/stores/SettingsStore.js +1 -0
- package/package.json +1 -1
|
@@ -16,13 +16,13 @@ export const BetControls = observer(() => {
|
|
|
16
16
|
return (<div className="bet-container">
|
|
17
17
|
<h2>{i18next.t("totalBet")}</h2>
|
|
18
18
|
<div className="bet-container__controls">
|
|
19
|
-
<button
|
|
19
|
+
<button disabled={settingStore.betChangeDisabled} onClick={() => onClick("decrease")} className="bet-container__button" name="bet-minus">
|
|
20
20
|
-
|
|
21
21
|
</button>
|
|
22
22
|
<div className="bet-container__value">
|
|
23
23
|
<p>{settingStore.betText}</p>
|
|
24
24
|
</div>
|
|
25
|
-
<button
|
|
25
|
+
<button disabled={settingStore.betChangeDisabled} onClick={() => onClick("increase")} className="bet-container__button" name="bet-plus">
|
|
26
26
|
+
|
|
27
27
|
</button>
|
|
28
28
|
</div>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
min-width: 140px;
|
|
15
15
|
width: fit-content;
|
|
16
16
|
text-align: center;
|
|
17
|
-
height:
|
|
17
|
+
height: 62px;
|
|
18
18
|
border-radius: 32px;
|
|
19
19
|
border: 2px white;
|
|
20
20
|
border-style: solid;
|
|
@@ -24,6 +24,12 @@
|
|
|
24
24
|
font-size: 24px;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
.bet-container h2 {
|
|
28
|
+
text-align: center;
|
|
29
|
+
color: white;
|
|
30
|
+
text-transform: uppercase;
|
|
31
|
+
}
|
|
32
|
+
|
|
27
33
|
.bet-container__button {
|
|
28
34
|
height: 62px;
|
|
29
35
|
width: 62px;
|
|
@@ -37,15 +43,10 @@
|
|
|
37
43
|
cursor: pointer;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
|
-
.bet-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.bet-container__controls {
|
|
47
|
-
display: flex;
|
|
48
|
-
gap: 8px;
|
|
46
|
+
.bet-container__button:disabled {
|
|
47
|
+
cursor: not-allowed;
|
|
48
|
+
opacity: 0.5;
|
|
49
|
+
user-select: none;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
.bet-container__button:active {
|
|
@@ -54,6 +55,11 @@
|
|
|
54
55
|
border: 2px solid #fdf425;
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
.bet-container__controls {
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
@media only screen and (max-width: 900px) {
|
|
58
64
|
#bet-layer.modal {
|
|
59
65
|
width: 90vw;
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
* @property {string} specialSymbolOnReel - single reel stopping with special symbol like bonus or mystery
|
|
23
23
|
* @property {string} start - on start spinning
|
|
24
24
|
* @property {string} symbol - on symbol click and show payTable popup
|
|
25
|
+
* @property {string} lowWin - on low win - this sound is played when win of all streaks is less than x1 * bet
|
|
26
|
+
* @property {string} mediumWin - on medium win - this sound is played when win of all streaks is more than x1.1 * bet and less than x5 * bet
|
|
27
|
+
* @property {string} highWin - on high win - this sound is played when win of all streaks is more than x5.1 * bet and less than x15 * bet
|
|
28
|
+
* @property {string} veryHighWin - on very high win - this sound is played when win of all streaks is more than x15.1 * bet
|
|
25
29
|
*
|
|
26
30
|
* @exports SoundTracks
|
|
27
31
|
*/
|
|
@@ -42,6 +46,10 @@ export interface SoundTracks {
|
|
|
42
46
|
line: "line";
|
|
43
47
|
fewLine: "fewLine";
|
|
44
48
|
oneLine: "oneLine";
|
|
49
|
+
lowWin: "lowWin";
|
|
50
|
+
mediumWin: "mediumWin";
|
|
51
|
+
highWin: "highWin";
|
|
52
|
+
veryHighWin: "veryHighWin";
|
|
45
53
|
freeLine: "freeLine";
|
|
46
54
|
mysteryDrawLoop: "mysteryDrawLoop";
|
|
47
55
|
rollStop: "rollStop";
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
* @property {string} specialSymbolOnReel - single reel stopping with special symbol like bonus or mystery
|
|
23
23
|
* @property {string} start - on start spinning
|
|
24
24
|
* @property {string} symbol - on symbol click and show payTable popup
|
|
25
|
+
* @property {string} lowWin - on low win - this sound is played when win of all streaks is less than x1 * bet
|
|
26
|
+
* @property {string} mediumWin - on medium win - this sound is played when win of all streaks is more than x1.1 * bet and less than x5 * bet
|
|
27
|
+
* @property {string} highWin - on high win - this sound is played when win of all streaks is more than x5.1 * bet and less than x15 * bet
|
|
28
|
+
* @property {string} veryHighWin - on very high win - this sound is played when win of all streaks is more than x15.1 * bet
|
|
25
29
|
*
|
|
26
30
|
* @exports SoundTracks
|
|
27
31
|
*/
|
|
@@ -42,6 +46,10 @@ export const SoundTracks = {
|
|
|
42
46
|
freeLine: "freeLine",
|
|
43
47
|
fewLine: "fewLine",
|
|
44
48
|
oneLine: "oneLine",
|
|
49
|
+
lowWin: "lowWin",
|
|
50
|
+
mediumWin: "mediumWin",
|
|
51
|
+
highWin: "highWin",
|
|
52
|
+
veryHighWin: "veryHighWin",
|
|
45
53
|
mysteryDrawLoop: "mysteryDrawLoop",
|
|
46
54
|
rollStop: "rollStop",
|
|
47
55
|
specialSymbolOnReel: "specialSymbolOnReel",
|
|
@@ -48,8 +48,9 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
|
|
|
48
48
|
* @returns {Promise<void>}
|
|
49
49
|
*/
|
|
50
50
|
configBlindSpin(finalSymbolReels: SymbolReels, afterSpinResolver: (value: void | PromiseLike<void>) => void, indexesOfReelsToExtendSpinningTime: number[]): Promise<void>;
|
|
51
|
-
playAllStreaks(streaks: StreakReelsIndexes[]): Promise<void>;
|
|
51
|
+
playAllStreaks(streaks: StreakReelsIndexes[], amount: number): Promise<void>;
|
|
52
52
|
resetPlayedSounds(): void;
|
|
53
|
+
protected playSoundDependingOnAmount(amount: number): void;
|
|
53
54
|
protected playStreakSound(symbols: SymbolId[]): void;
|
|
54
55
|
/**
|
|
55
56
|
* Function for playing animation of streak
|
|
@@ -4,6 +4,7 @@ import { FrameLayer } from "../../layers";
|
|
|
4
4
|
import { RainMan } from "../../Rainman";
|
|
5
5
|
import { Speed } from "../symbols";
|
|
6
6
|
import { AbstractFrame } from "./AbstractFrame";
|
|
7
|
+
import { WIN_MULTIPLIER_VALUES } from "./constants";
|
|
7
8
|
/**
|
|
8
9
|
* Class represents columns container in game
|
|
9
10
|
*
|
|
@@ -104,7 +105,7 @@ export class AbstractColumnsContainer extends Container {
|
|
|
104
105
|
resolve();
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
|
-
async playAllStreaks(streaks) {
|
|
108
|
+
async playAllStreaks(streaks, amount) {
|
|
108
109
|
const columnsToPlay = [];
|
|
109
110
|
streaks.forEach((streak) => {
|
|
110
111
|
streak.forEach((symbolIndex, index) => {
|
|
@@ -120,12 +121,32 @@ export class AbstractColumnsContainer extends Container {
|
|
|
120
121
|
columnsToPlay.forEach((column, index) => {
|
|
121
122
|
column.forEach((symbolIndex) => promises.push(this.getColumnAtPosition(index).playSymbolAtPosition(symbolIndex, true)));
|
|
122
123
|
});
|
|
123
|
-
|
|
124
|
+
this.playSoundDependingOnAmount(amount);
|
|
124
125
|
await Promise.allSettled(promises);
|
|
125
126
|
}
|
|
126
127
|
resetPlayedSounds() {
|
|
127
128
|
this.playedSounds = [];
|
|
128
129
|
}
|
|
130
|
+
playSoundDependingOnAmount(amount) {
|
|
131
|
+
const bet = RainMan.settingsStore.bet;
|
|
132
|
+
if (amount < WIN_MULTIPLIER_VALUES.LOW_WIN * bet) {
|
|
133
|
+
SoundManager.play(SoundTracks.lowWin);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (amount > WIN_MULTIPLIER_VALUES.MEDIUM_WIN_MIN * bet &&
|
|
137
|
+
amount < WIN_MULTIPLIER_VALUES.MEDIUM_WIN_MAX * bet) {
|
|
138
|
+
SoundManager.play(SoundTracks.mediumWin);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (amount > WIN_MULTIPLIER_VALUES.HIGH_WIN_MIN * bet && amount < WIN_MULTIPLIER_VALUES.HIGH_WIN_MAX * bet) {
|
|
142
|
+
SoundManager.play(SoundTracks.highWin);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (amount > WIN_MULTIPLIER_VALUES.VERY_HIGH_WIN * bet) {
|
|
146
|
+
SoundManager.play(SoundTracks.veryHighWin);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
129
150
|
playStreakSound(symbols) {
|
|
130
151
|
for (const [symbol, sound] of Object.entries(this.mapSymbolToSound)) {
|
|
131
152
|
if (!symbols.includes(symbol))
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const WIN_MULTIPLIER_VALUES: {
|
|
2
|
+
readonly LOW_WIN: 1;
|
|
3
|
+
readonly MEDIUM_WIN_MIN: 1.1;
|
|
4
|
+
readonly MEDIUM_WIN_MAX: 2;
|
|
5
|
+
readonly HIGH_WIN_MIN: 5.1;
|
|
6
|
+
readonly HIGH_WIN_MAX: 15;
|
|
7
|
+
readonly VERY_HIGH_WIN: 15.1;
|
|
8
|
+
};
|
|
9
|
+
export type WinMultiplierValues = (typeof WIN_MULTIPLIER_VALUES)[keyof typeof WIN_MULTIPLIER_VALUES];
|
|
@@ -59,8 +59,14 @@ export class AbstractController {
|
|
|
59
59
|
this.componentRegistry = RainMan.componentRegistry;
|
|
60
60
|
this.setupSpaceOrEnterListener();
|
|
61
61
|
RainMan.globals.handleDisablingButtons = this.handleDisablingButtons.bind(this);
|
|
62
|
-
RainMan.settingsStore.increaseBet = () =>
|
|
63
|
-
|
|
62
|
+
RainMan.settingsStore.increaseBet = () => {
|
|
63
|
+
this.uiController.updateBet("increase");
|
|
64
|
+
SoundManager.play(SoundTracks.increaseRate);
|
|
65
|
+
};
|
|
66
|
+
RainMan.settingsStore.decreaseBet = () => {
|
|
67
|
+
this.uiController.updateBet("decrease");
|
|
68
|
+
SoundManager.play(SoundTracks.reductionRate);
|
|
69
|
+
};
|
|
64
70
|
}
|
|
65
71
|
init() {
|
|
66
72
|
const initData = this.connection.initData();
|
package/package.json
CHANGED