pixi-rainman-game-engine 0.2.26 → 0.2.28
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/ComponentRegistry/ComponentRegistry.js +2 -2
- package/dist/SettingsUI/hooks/useBuyFreeSpins/useBuyFreeSpins.js +1 -1
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +2 -2
- package/dist/application/SoundManager/SoundManager.js +23 -7
- package/dist/application/SoundManager/types.d.ts +2 -0
- package/dist/application/SoundManager/types.js +2 -0
- package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +2 -2
- package/dist/components/common/AnimatedNumber.d.ts +6 -4
- package/dist/components/common/AnimatedNumber.js +16 -0
- package/dist/components/frame/AbstractColumnsContainer.d.ts +104 -0
- package/dist/components/frame/AbstractColumnsContainer.js +98 -4
- package/dist/connectivity/ConnectionWrapper.d.ts +6 -0
- package/dist/connectivity/ConnectionWrapper.js +20 -2
- package/dist/connectivity/LocalConnectionWrapper.d.ts +1 -0
- package/dist/connectivity/LocalConnectionWrapper.js +11 -0
- package/dist/connectivity/serverConnection.d.ts +7 -3
- package/dist/connectivity/serverData.d.ts +10 -0
- package/dist/controllers/AbstractController.d.ts +12 -1
- package/dist/controllers/AbstractController.js +54 -14
- package/dist/controllers/QuickStopController.d.ts +34 -1
- package/dist/controllers/QuickStopController.js +38 -2
- package/dist/stores/SettingsStore.d.ts +2 -0
- package/dist/stores/SettingsStore.js +3 -1
- package/package.json +1 -1
|
@@ -24,7 +24,7 @@ export class ComponentRegistry {
|
|
|
24
24
|
*/
|
|
25
25
|
setTemporarySpeedLevel(newSpeedLevel) {
|
|
26
26
|
this.speedLevelHandler.setSpeed(newSpeedLevel);
|
|
27
|
-
this.updateAllSpeedAdaptable(
|
|
27
|
+
this.updateAllSpeedAdaptable(newSpeedLevel);
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Method for reverting speed level for turbo spin
|
|
@@ -32,7 +32,7 @@ export class ComponentRegistry {
|
|
|
32
32
|
*/
|
|
33
33
|
revertTemporarySpeedLevel() {
|
|
34
34
|
this.speedLevelHandler.setSpeed(RainMan.settingsStore.currentSpeed);
|
|
35
|
-
this.updateAllSpeedAdaptable(
|
|
35
|
+
this.updateAllSpeedAdaptable(RainMan.settingsStore.currentSpeed);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Setter fo speed level
|
|
@@ -5,7 +5,7 @@ export const useBuyFreeSpinOptions = () => {
|
|
|
5
5
|
const [options, setOptions] = useState([]);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
const disposer = autorun(() => {
|
|
8
|
-
setOptions(Object.entries(RainMan.settingsStore.freeSpinBuyTable).map(([amount, multiplier]) => ({
|
|
8
|
+
setOptions(Object.entries(RainMan.settingsStore.freeSpinBuyTable ?? {}).map(([amount, multiplier]) => ({
|
|
9
9
|
amount: parseInt(amount, 10),
|
|
10
10
|
price: multiplier
|
|
11
11
|
})));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i18n from "i18next";
|
|
2
2
|
import { sample } from "lodash";
|
|
3
|
-
import { SoundManager } from "../../application";
|
|
3
|
+
import { SoundManager, SoundTracks } from "../../application";
|
|
4
4
|
import { AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, MessageBox, SpeedControlButton, VolumeButton } from "../../components";
|
|
5
5
|
import { RainMan } from "../../Rainman";
|
|
6
6
|
import { allUiItems, hideLayerIfPresent, UI_ITEMS, wait } from "../../utils";
|
|
@@ -199,7 +199,7 @@ export class ButtonsEventManager {
|
|
|
199
199
|
if (RainMan.settingsStore.isSoundEnabled()) {
|
|
200
200
|
SoundManager.resumeAll();
|
|
201
201
|
if (RainMan.settingsStore.shouldPlayAmbientMusic) {
|
|
202
|
-
SoundManager.setPlayStatus(
|
|
202
|
+
SoundManager.setPlayStatus(RainMan.settingsStore.isFreeSpinsPlayEnabled ? SoundTracks.freeSpinsMusic : SoundTracks.music, RainMan.settingsStore.shouldPlayAmbientMusic);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
RainMan.componentRegistry.get(VolumeButton.registryName).changeTextureDependOnVolume();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Sound, sound } from "@pixi/sound";
|
|
2
2
|
import { RainMan } from "../../Rainman";
|
|
3
3
|
import { SoundTracks } from "./types";
|
|
4
|
-
const soundsToLoop = [SoundTracks.mysteryFxLoop, SoundTracks.music];
|
|
4
|
+
const soundsToLoop = [SoundTracks.mysteryFxLoop, SoundTracks.music, SoundTracks.freeSpinsMusic];
|
|
5
5
|
export const pixiSoundContext = sound.context;
|
|
6
6
|
/**
|
|
7
7
|
* Class for managing sound in game, uses the pixi sound library
|
|
@@ -86,20 +86,26 @@ export class SoundManagerInstance {
|
|
|
86
86
|
* @param {SoundTrack} soundName - name of the sound
|
|
87
87
|
*/
|
|
88
88
|
play(soundName) {
|
|
89
|
-
if (!RainMan.settingsStore.shouldPlayFxSounds)
|
|
89
|
+
if (!RainMan.settingsStore.shouldPlayFxSounds) {
|
|
90
90
|
return;
|
|
91
|
+
}
|
|
91
92
|
const overrideSoundName = this.overrides[soundName];
|
|
92
93
|
const sound = overrideSoundName
|
|
93
94
|
? this.musicCatalogue.get(overrideSoundName)
|
|
94
95
|
: this.musicCatalogue.get(soundName);
|
|
95
|
-
if (!sound)
|
|
96
|
+
if (!sound) {
|
|
96
97
|
return;
|
|
97
|
-
|
|
98
|
+
}
|
|
99
|
+
if (soundName === "music" &&
|
|
100
|
+
sound.isPlaying &&
|
|
101
|
+
!RainMan.settingsStore.isFreeSpinsPlayEnabled &&
|
|
102
|
+
!RainMan.settingsStore.shouldPlayAmbientMusic) {
|
|
98
103
|
return;
|
|
104
|
+
}
|
|
99
105
|
sound.play({
|
|
100
106
|
loop: soundsToLoop.includes(soundName),
|
|
101
107
|
singleInstance: true,
|
|
102
|
-
volume: soundName ===
|
|
108
|
+
volume: soundName === SoundTracks.music || soundName === SoundTracks.freeSpinsMusic ? 0.5 : 1
|
|
103
109
|
});
|
|
104
110
|
}
|
|
105
111
|
/**
|
|
@@ -108,9 +114,19 @@ export class SoundManagerInstance {
|
|
|
108
114
|
*/
|
|
109
115
|
resumeAll() {
|
|
110
116
|
this.musicCatalogue.forEach((sound, soundName) => {
|
|
111
|
-
if (sound.paused && sound.isPlaying)
|
|
117
|
+
if (sound.paused && sound.isPlaying) {
|
|
112
118
|
sound.resume();
|
|
113
|
-
|
|
119
|
+
}
|
|
120
|
+
if (RainMan.settingsStore.shouldPlayAmbientMusic &&
|
|
121
|
+
!RainMan.settingsStore.isFreeSpinsPlayEnabled &&
|
|
122
|
+
soundName === SoundTracks.music &&
|
|
123
|
+
sound.paused) {
|
|
124
|
+
sound.resume();
|
|
125
|
+
}
|
|
126
|
+
if (RainMan.settingsStore.shouldPlayAmbientMusic &&
|
|
127
|
+
RainMan.settingsStore.isFreeSpinsPlayEnabled &&
|
|
128
|
+
soundName === SoundTracks.freeSpinsMusic &&
|
|
129
|
+
sound.paused) {
|
|
114
130
|
sound.resume();
|
|
115
131
|
}
|
|
116
132
|
});
|
|
@@ -6,6 +6,7 @@ import { Sound } from "@pixi/sound";
|
|
|
6
6
|
* @property {string} deactivationAutostart - click on autostart button
|
|
7
7
|
* @property {string} increaseRate - click on plus button
|
|
8
8
|
* @property {string} music - ambient music in loop
|
|
9
|
+
* @property {string} freeSpinsMusic - ambient music in free spins
|
|
9
10
|
* @property {string} reductionRate - click on neg button
|
|
10
11
|
* @property {string} allRollStops - skipping rolling reels, on end
|
|
11
12
|
* @property {string} bigWin - on show big win popup
|
|
@@ -36,6 +37,7 @@ export interface SoundTracks {
|
|
|
36
37
|
deactivationAutostart: "deactivationAutostart";
|
|
37
38
|
increaseRate: "increaseRate";
|
|
38
39
|
music: "music";
|
|
40
|
+
freeSpinsMusic: "freeSpinsMusic";
|
|
39
41
|
reductionRate: "reductionRate";
|
|
40
42
|
allRollStops: "allRollStops";
|
|
41
43
|
bigWin: "bigWin";
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @property {string} deactivationAutostart - click on autostart button
|
|
6
6
|
* @property {string} increaseRate - click on plus button
|
|
7
7
|
* @property {string} music - ambient music in loop
|
|
8
|
+
* @property {string} freeSpinsMusic - ambient music in free spins
|
|
8
9
|
* @property {string} reductionRate - click on neg button
|
|
9
10
|
* @property {string} allRollStops - skipping rolling reels, on end
|
|
10
11
|
* @property {string} bigWin - on show big win popup
|
|
@@ -34,6 +35,7 @@ export const SoundTracks = {
|
|
|
34
35
|
deactivationAutostart: "deactivationAutostart",
|
|
35
36
|
increaseRate: "increaseRate",
|
|
36
37
|
music: "music",
|
|
38
|
+
freeSpinsMusic: "freeSpinsMusic",
|
|
37
39
|
reductionRate: "reductionRate",
|
|
38
40
|
allRollStops: "allRollStops",
|
|
39
41
|
bigWin: "bigWin",
|
|
@@ -137,7 +137,7 @@ export declare abstract class AbstractMainContainer extends Container {
|
|
|
137
137
|
* @param {WinTypeId} winType win type of jackpot roulette win
|
|
138
138
|
* @returns {void}
|
|
139
139
|
*/
|
|
140
|
-
|
|
140
|
+
protected destroyRouletteWin(winType: WinTypeId): void;
|
|
141
141
|
/**
|
|
142
142
|
* Function for invoking mystery bonus container
|
|
143
143
|
* @param {string} animationName animation name for the mystery bonus container
|
|
@@ -273,7 +273,7 @@ export declare abstract class AbstractMainContainer extends Container {
|
|
|
273
273
|
* Function for positioning the round win container.
|
|
274
274
|
* @returns {void}
|
|
275
275
|
*/
|
|
276
|
-
|
|
276
|
+
protected positionRoundWinContainer(): void;
|
|
277
277
|
/**
|
|
278
278
|
* Function for invoking the roulette win plate.
|
|
279
279
|
* @param {string} winAnimationName The name of the win animation.
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
|
+
import { Spine } from "pixi-spine";
|
|
2
3
|
/**
|
|
3
4
|
* Class representing animated number, based on spine animation.
|
|
4
5
|
* Animation names should be exact the same as a represented symbol.
|
|
5
6
|
*/
|
|
6
7
|
export declare class AnimatedNumber extends Container {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
spineName: string;
|
|
9
|
+
number: number | string;
|
|
10
|
+
digits: Spine[];
|
|
10
11
|
constructor(spineName: string, number: number | string);
|
|
11
12
|
private setDigits;
|
|
12
|
-
|
|
13
|
+
setMoveAnimation(): void;
|
|
14
|
+
removeDigits(): void;
|
|
13
15
|
get value(): number | string;
|
|
14
16
|
set value(value: number | string);
|
|
15
17
|
play(): void;
|
|
@@ -31,6 +31,22 @@ export class AnimatedNumber extends Container {
|
|
|
31
31
|
});
|
|
32
32
|
this.pivot.set(this.width / 2, this.height / 2);
|
|
33
33
|
}
|
|
34
|
+
setMoveAnimation() {
|
|
35
|
+
this.removeDigits();
|
|
36
|
+
Array.from(this.number.toString()).forEach((digit) => {
|
|
37
|
+
const digitSpine = new Spine(getSpineData(this.spineName));
|
|
38
|
+
digitSpine.state.setAnimation(0, digit + "-move", true);
|
|
39
|
+
digitSpine.x = (this.digits.at(-1)?.x || 0) + digitSpine.width * 2;
|
|
40
|
+
if (digit === "." || digit === ",") {
|
|
41
|
+
digitSpine.x += 15;
|
|
42
|
+
digitSpine.y += 25;
|
|
43
|
+
}
|
|
44
|
+
digitSpine.state.timeScale = 1;
|
|
45
|
+
this.addChild(digitSpine);
|
|
46
|
+
this.digits.push(digitSpine);
|
|
47
|
+
});
|
|
48
|
+
this.pivot.set(this.width / 2, this.height / 2);
|
|
49
|
+
}
|
|
34
50
|
removeDigits() {
|
|
35
51
|
this.digits.forEach((digit) => this.removeChild(digit));
|
|
36
52
|
this.digits = [];
|
|
@@ -31,11 +31,38 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
|
|
|
31
31
|
right: number;
|
|
32
32
|
};
|
|
33
33
|
protected constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Function for initializing columns container
|
|
36
|
+
* @protected
|
|
37
|
+
* @returns {void}
|
|
38
|
+
*/
|
|
34
39
|
protected init(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Function for resolving changing symbols in columns
|
|
42
|
+
* This is used in games i.e. BoW and MB
|
|
43
|
+
*/
|
|
35
44
|
resolveMysterySpeedUp(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Method for adapting to speed level
|
|
47
|
+
* @param {SpeedLevel} speedLevel new speed level
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
36
50
|
adaptToSpeed(speedLevel: SpeedLevel): void;
|
|
51
|
+
/**
|
|
52
|
+
* Function for enabling quick reels stop
|
|
53
|
+
* @public
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
37
56
|
enableQuickReelsStop(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Function for clearing quick reels stop
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
38
61
|
clearQuickReelsStop(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Function for blind spinning all columns
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
39
66
|
blindSpin(): void;
|
|
40
67
|
/**
|
|
41
68
|
* This function is responsible for setting symbols in columns
|
|
@@ -46,8 +73,28 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
|
|
|
46
73
|
* @returns {Promise<void>}
|
|
47
74
|
*/
|
|
48
75
|
configBlindSpin(finalSymbolReels: SymbolReels, afterSpinResolver: (value: void | PromiseLike<void>) => void, indexesOfReelsToExtendSpinningTime: number[]): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Function for playing all streaks
|
|
78
|
+
* @param {StreakReelsIndexes[]} streaks - The streaks to play
|
|
79
|
+
* @param {number} amount - The amount to play
|
|
80
|
+
* @param {SymbolId[]} allSymbols - All symbols to consider
|
|
81
|
+
* @returns {Promise<void>} - A promise that resolves when all streaks are played
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
49
84
|
playAllStreaks(streaks: StreakReelsIndexes[], amount: number, allSymbols?: SymbolId[]): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Function for resetting played sounds
|
|
87
|
+
* @public
|
|
88
|
+
* @returns {void}
|
|
89
|
+
*/
|
|
50
90
|
resetPlayedSounds(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Function for playing sound depending on the amount
|
|
93
|
+
* @public
|
|
94
|
+
* @param {number} amount - The amount to check
|
|
95
|
+
* @param {SymbolId[]} _allSymbols - All symbols to consider
|
|
96
|
+
* @returns {void}
|
|
97
|
+
*/
|
|
51
98
|
protected playSoundDependingOnAmount(amount: number, _allSymbols?: SymbolId[]): void;
|
|
52
99
|
protected playStreakSound(symbols: SymbolId[]): void;
|
|
53
100
|
/**
|
|
@@ -60,14 +107,71 @@ export declare abstract class AbstractColumnsContainer extends Container impleme
|
|
|
60
107
|
* @returns {Promise<void>}
|
|
61
108
|
*/
|
|
62
109
|
playStreak(streak: StreakReelsIndexes, reelsQuantity: number, multiplier?: number, suffix?: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Method for resizing columns container
|
|
112
|
+
* @public
|
|
113
|
+
* @abstract
|
|
114
|
+
* @returns {void}
|
|
115
|
+
*/
|
|
63
116
|
abstract doResize(): void;
|
|
117
|
+
/**
|
|
118
|
+
* Function for animating columns
|
|
119
|
+
* @public
|
|
120
|
+
* @param {number} delta - delta time for animation
|
|
121
|
+
* @returns {void}
|
|
122
|
+
*/
|
|
64
123
|
animate(delta: number): void;
|
|
124
|
+
/**
|
|
125
|
+
* Function for getting column at specific position
|
|
126
|
+
* @param {number} column index of column
|
|
127
|
+
* @returns {AbstractSymbolsColumn} column at specific position
|
|
128
|
+
* @public
|
|
129
|
+
* @abstract
|
|
130
|
+
*/
|
|
65
131
|
abstract getColumnAtPosition(column: number): AbstractSymbolsColumn;
|
|
132
|
+
/**
|
|
133
|
+
* Function for stopping all playing symbols in columns
|
|
134
|
+
* @public
|
|
135
|
+
* @returns {void}
|
|
136
|
+
*/
|
|
66
137
|
stopPlayingSymbolsInColumns(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Function for stopping all transformations playing symbols in columns
|
|
140
|
+
* @public
|
|
141
|
+
* @returns {void}
|
|
142
|
+
*/
|
|
67
143
|
stopPlayingSymbolsTransformationInColumns(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Function for setting interactivity for all symbols in columns
|
|
146
|
+
* @param {boolean} flag - flag for setting interactivity
|
|
147
|
+
* @public
|
|
148
|
+
* @returns {void}
|
|
149
|
+
*/
|
|
68
150
|
setInteractivityForSymbols(flag: boolean): void;
|
|
151
|
+
/**
|
|
152
|
+
* Function for handling multiple symbol transformations
|
|
153
|
+
* @param {DropTransformationDetails} transformations - array of transformations to apply
|
|
154
|
+
* @param {boolean} skipAnimations - flag for skipping animations
|
|
155
|
+
* @param {boolean} isStandalone - flag for standalone mode
|
|
156
|
+
* @param {boolean} allowSoundInSymbolsColumn - flag for allowing sound in symbols column
|
|
157
|
+
* @returns {Promise<void>}
|
|
158
|
+
*/
|
|
69
159
|
handleDestroyTransformations(transformations: DropTransformationDetails[], skipAnimations?: boolean, isStandalone?: boolean, allowSoundInSymbolsColumn?: boolean): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Function for creating mask for columns container
|
|
162
|
+
* @protected
|
|
163
|
+
* @returns {Graphics} mask for columns container
|
|
164
|
+
*/
|
|
70
165
|
protected createMask(): Graphics;
|
|
166
|
+
/**
|
|
167
|
+
* Function for fixing symbols columns position
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
71
170
|
fixSymbolsColumnsPosition(): void;
|
|
171
|
+
/**
|
|
172
|
+
* Function for preparing configuring reels end
|
|
173
|
+
* @param {SymbolReels} finalSymbolReels - final symbol reels
|
|
174
|
+
* @returns {PlayableAction[]} - array of playable actions
|
|
175
|
+
*/
|
|
72
176
|
protected prepareConfiguringReelsEnd(finalSymbolReels: SymbolReels): PlayableAction[];
|
|
73
177
|
}
|
|
@@ -32,6 +32,11 @@ export class AbstractColumnsContainer extends Container {
|
|
|
32
32
|
this.name = AbstractColumnsContainer.registryName;
|
|
33
33
|
this.parentLayer = FrameLayer;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Function for initializing columns container
|
|
37
|
+
* @protected
|
|
38
|
+
* @returns {void}
|
|
39
|
+
*/
|
|
35
40
|
init() {
|
|
36
41
|
this.allColumns.forEach((column) => {
|
|
37
42
|
RainMan.componentRegistry.add(column);
|
|
@@ -40,6 +45,10 @@ export class AbstractColumnsContainer extends Container {
|
|
|
40
45
|
Ticker.shared.add((delta) => this.animate(delta));
|
|
41
46
|
this.doResize();
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Function for resolving changing symbols in columns
|
|
50
|
+
* This is used in games i.e. BoW and MB
|
|
51
|
+
*/
|
|
43
52
|
resolveMysterySpeedUp() {
|
|
44
53
|
this.allColumns.forEach((column) => {
|
|
45
54
|
if (column.resolveMysterySpeedUp === null)
|
|
@@ -47,22 +56,41 @@ export class AbstractColumnsContainer extends Container {
|
|
|
47
56
|
column.resolveMysterySpeedUp();
|
|
48
57
|
});
|
|
49
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Method for adapting to speed level
|
|
61
|
+
* @param {SpeedLevel} speedLevel new speed level
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
50
64
|
adaptToSpeed(speedLevel) {
|
|
51
65
|
this.velocityMultiplier = this.speedLevelMapper[speedLevel];
|
|
52
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Function for enabling quick reels stop
|
|
69
|
+
* @public
|
|
70
|
+
* @returns {void}
|
|
71
|
+
*/
|
|
53
72
|
enableQuickReelsStop() {
|
|
54
|
-
RainMan.componentRegistry.setTemporarySpeedLevel(SPEED_LEVELS.fast);
|
|
55
73
|
this.quickReelsStop = true;
|
|
74
|
+
RainMan.componentRegistry.setTemporarySpeedLevel(SPEED_LEVELS.fast);
|
|
56
75
|
this.skipScatterDelay?.();
|
|
57
76
|
this.resolveMysterySpeedUp();
|
|
58
77
|
this.skipScatterDelay = null;
|
|
59
|
-
if (this.currentColumn)
|
|
78
|
+
if (this.currentColumn) {
|
|
60
79
|
this.currentColumn.skipHidingMysteryFx = true;
|
|
80
|
+
}
|
|
61
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Function for clearing quick reels stop
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
62
86
|
clearQuickReelsStop() {
|
|
63
87
|
this.quickReelsStop = false;
|
|
64
88
|
RainMan.componentRegistry.revertTemporarySpeedLevel();
|
|
65
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Function for blind spinning all columns
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
66
94
|
blindSpin() {
|
|
67
95
|
this.allColumns.forEach((column) => column.blindSpin());
|
|
68
96
|
}
|
|
@@ -77,14 +105,15 @@ export class AbstractColumnsContainer extends Container {
|
|
|
77
105
|
async configBlindSpin(finalSymbolReels, afterSpinResolver, indexesOfReelsToExtendSpinningTime) {
|
|
78
106
|
// spin
|
|
79
107
|
return new Promise(async (resolve) => {
|
|
80
|
-
const configuredBlindSpinsActions = this.prepareConfiguringReelsEnd(finalSymbolReels);
|
|
81
108
|
let index = 0;
|
|
109
|
+
const configuredBlindSpinsActions = this.prepareConfiguringReelsEnd(finalSymbolReels);
|
|
82
110
|
const frame = RainMan.componentRegistry.get(AbstractFrame.registryName);
|
|
83
111
|
while (configuredBlindSpinsActions.length !== 0) {
|
|
84
112
|
if (this.quickReelsStop || RainMan.settingsStore.currentSpeed === SPEED_LEVELS.fast) {
|
|
85
113
|
await Promise.all(configuredBlindSpinsActions.map(async (action) => await action()));
|
|
86
114
|
configuredBlindSpinsActions.length = 0;
|
|
87
115
|
SoundManager.play(SoundTracks.allRollStops);
|
|
116
|
+
this.clearQuickReelsStop();
|
|
88
117
|
break;
|
|
89
118
|
}
|
|
90
119
|
const configureSpinAction = configuredBlindSpinsActions.shift();
|
|
@@ -101,8 +130,9 @@ export class AbstractColumnsContainer extends Container {
|
|
|
101
130
|
}, RainMan.config.durationOfActions.scatterDelayerTime);
|
|
102
131
|
await this.currentColumn.changeVelocity(Speed.STOP, RainMan.config.durationOfActions.scatterSpinningTime, frame);
|
|
103
132
|
}
|
|
104
|
-
if (!indexesOfReelsToExtendSpinningTime.includes(index))
|
|
133
|
+
if (!indexesOfReelsToExtendSpinningTime.includes(index)) {
|
|
105
134
|
await configureSpinAction();
|
|
135
|
+
}
|
|
106
136
|
}
|
|
107
137
|
index++;
|
|
108
138
|
this.currentColumn = null;
|
|
@@ -112,6 +142,14 @@ export class AbstractColumnsContainer extends Container {
|
|
|
112
142
|
resolve();
|
|
113
143
|
});
|
|
114
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Function for playing all streaks
|
|
147
|
+
* @param {StreakReelsIndexes[]} streaks - The streaks to play
|
|
148
|
+
* @param {number} amount - The amount to play
|
|
149
|
+
* @param {SymbolId[]} allSymbols - All symbols to consider
|
|
150
|
+
* @returns {Promise<void>} - A promise that resolves when all streaks are played
|
|
151
|
+
* @public
|
|
152
|
+
*/
|
|
115
153
|
async playAllStreaks(streaks, amount, allSymbols = []) {
|
|
116
154
|
const columnsToPlay = [];
|
|
117
155
|
streaks.forEach((streak) => {
|
|
@@ -131,9 +169,21 @@ export class AbstractColumnsContainer extends Container {
|
|
|
131
169
|
this.playSoundDependingOnAmount(amount, allSymbols);
|
|
132
170
|
await Promise.allSettled(promises);
|
|
133
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Function for resetting played sounds
|
|
174
|
+
* @public
|
|
175
|
+
* @returns {void}
|
|
176
|
+
*/
|
|
134
177
|
resetPlayedSounds() {
|
|
135
178
|
this.playedSounds = [];
|
|
136
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* Function for playing sound depending on the amount
|
|
182
|
+
* @public
|
|
183
|
+
* @param {number} amount - The amount to check
|
|
184
|
+
* @param {SymbolId[]} _allSymbols - All symbols to consider
|
|
185
|
+
* @returns {void}
|
|
186
|
+
*/
|
|
137
187
|
playSoundDependingOnAmount(amount, _allSymbols = []) {
|
|
138
188
|
const bet = RainMan.settingsStore.bet;
|
|
139
189
|
if (amount < WIN_MULTIPLIER_VALUES.LOW_WIN * bet) {
|
|
@@ -198,12 +248,23 @@ export class AbstractColumnsContainer extends Container {
|
|
|
198
248
|
this.playStreakSound(streakSymbols);
|
|
199
249
|
await Promise.allSettled(promises);
|
|
200
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Function for animating columns
|
|
253
|
+
* @public
|
|
254
|
+
* @param {number} delta - delta time for animation
|
|
255
|
+
* @returns {void}
|
|
256
|
+
*/
|
|
201
257
|
animate(delta) {
|
|
202
258
|
const { lastTime } = Ticker.shared;
|
|
203
259
|
for (const column of this.allColumns) {
|
|
204
260
|
column.animate(delta, lastTime);
|
|
205
261
|
}
|
|
206
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Function for stopping all playing symbols in columns
|
|
265
|
+
* @public
|
|
266
|
+
* @returns {void}
|
|
267
|
+
*/
|
|
207
268
|
stopPlayingSymbolsInColumns() {
|
|
208
269
|
this.allColumns.forEach((column) => column.stopAllPlayingSymbols());
|
|
209
270
|
if (this.currentPlayingSoundName) {
|
|
@@ -211,12 +272,31 @@ export class AbstractColumnsContainer extends Container {
|
|
|
211
272
|
this.currentPlayingSoundName = null;
|
|
212
273
|
}
|
|
213
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Function for stopping all transformations playing symbols in columns
|
|
277
|
+
* @public
|
|
278
|
+
* @returns {void}
|
|
279
|
+
*/
|
|
214
280
|
stopPlayingSymbolsTransformationInColumns() {
|
|
215
281
|
this.allColumns.forEach((column) => column.stopTransformationPlayingSymbols());
|
|
216
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Function for setting interactivity for all symbols in columns
|
|
285
|
+
* @param {boolean} flag - flag for setting interactivity
|
|
286
|
+
* @public
|
|
287
|
+
* @returns {void}
|
|
288
|
+
*/
|
|
217
289
|
setInteractivityForSymbols(flag) {
|
|
218
290
|
this.allColumns.forEach((column) => column.setAllSymbolsInteractiveFlag(flag));
|
|
219
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* Function for handling multiple symbol transformations
|
|
294
|
+
* @param {DropTransformationDetails} transformations - array of transformations to apply
|
|
295
|
+
* @param {boolean} skipAnimations - flag for skipping animations
|
|
296
|
+
* @param {boolean} isStandalone - flag for standalone mode
|
|
297
|
+
* @param {boolean} allowSoundInSymbolsColumn - flag for allowing sound in symbols column
|
|
298
|
+
* @returns {Promise<void>}
|
|
299
|
+
*/
|
|
220
300
|
async handleDestroyTransformations(transformations, skipAnimations = false, isStandalone = false, allowSoundInSymbolsColumn = true) {
|
|
221
301
|
if (transformations.length === 0) {
|
|
222
302
|
return Promise.resolve();
|
|
@@ -224,6 +304,11 @@ export class AbstractColumnsContainer extends Container {
|
|
|
224
304
|
const column = this.getColumnAtPosition(transformations[0].coordinates.x);
|
|
225
305
|
await column.handleMultipleSymbolDropping(transformations, skipAnimations, isStandalone, allowSoundInSymbolsColumn);
|
|
226
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Function for creating mask for columns container
|
|
309
|
+
* @protected
|
|
310
|
+
* @returns {Graphics} mask for columns container
|
|
311
|
+
*/
|
|
227
312
|
createMask() {
|
|
228
313
|
const mask = new Graphics();
|
|
229
314
|
mask.beginFill(0xaaaaaa, 1);
|
|
@@ -233,9 +318,18 @@ export class AbstractColumnsContainer extends Container {
|
|
|
233
318
|
mask.endFill();
|
|
234
319
|
return mask;
|
|
235
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Function for fixing symbols columns position
|
|
323
|
+
* @public
|
|
324
|
+
*/
|
|
236
325
|
fixSymbolsColumnsPosition() {
|
|
237
326
|
this.allColumns.forEach((column) => column.fixStationaryPositions());
|
|
238
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Function for preparing configuring reels end
|
|
330
|
+
* @param {SymbolReels} finalSymbolReels - final symbol reels
|
|
331
|
+
* @returns {PlayableAction[]} - array of playable actions
|
|
332
|
+
*/
|
|
239
333
|
prepareConfiguringReelsEnd(finalSymbolReels) {
|
|
240
334
|
return this.allColumns.map((column, index) => async () => {
|
|
241
335
|
column.configBlindSpin(finalSymbolReels[index]);
|
|
@@ -69,6 +69,12 @@ export declare class ConnectionWrapper implements SubscribableConnectionWrapper
|
|
|
69
69
|
* @returns {Promise<ServerMessage>} - server message with end of round data
|
|
70
70
|
*/
|
|
71
71
|
sendEndOfRoundData(roundNumber: number): Promise<ServerMessage>;
|
|
72
|
+
/**
|
|
73
|
+
* Method for sending take action to the server. User can save his balance after spin and then safely leave the game.
|
|
74
|
+
* @param {number} roundNumber - the round number to send data from
|
|
75
|
+
* @returns {Promise<ServerMessage>} - server message with end of round data
|
|
76
|
+
*/
|
|
77
|
+
sendTakeAction(roundNumber: number): Promise<ServerMessage>;
|
|
72
78
|
/**
|
|
73
79
|
* Method for fetching gamble data from the server
|
|
74
80
|
* @param {number} roundNumber round number
|
|
@@ -150,7 +150,7 @@ export class ConnectionWrapper {
|
|
|
150
150
|
extra_data
|
|
151
151
|
});
|
|
152
152
|
this._messageHistory.push(data);
|
|
153
|
-
this.sendEndOfRoundData(roundNumber
|
|
153
|
+
this.sendEndOfRoundData(roundNumber);
|
|
154
154
|
return new SpinData(this.config, data);
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
@@ -172,6 +172,24 @@ export class ConnectionWrapper {
|
|
|
172
172
|
this._messageHistory.push(data);
|
|
173
173
|
return data;
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Method for sending take action to the server. User can save his balance after spin and then safely leave the game.
|
|
177
|
+
* @param {number} roundNumber - the round number to send data from
|
|
178
|
+
* @returns {Promise<ServerMessage>} - server message with end of round data
|
|
179
|
+
*/
|
|
180
|
+
async sendTakeAction(roundNumber) {
|
|
181
|
+
if (typeof this.config?.token === "undefined") {
|
|
182
|
+
throw new Error("Token was not defined");
|
|
183
|
+
}
|
|
184
|
+
const data = await this.fetch({
|
|
185
|
+
action: "take",
|
|
186
|
+
round_number: roundNumber,
|
|
187
|
+
reference: RainMan.config.gameInitReference,
|
|
188
|
+
token: this.config.token
|
|
189
|
+
});
|
|
190
|
+
this._messageHistory.push(data);
|
|
191
|
+
return data;
|
|
192
|
+
}
|
|
175
193
|
/**
|
|
176
194
|
* Method for fetching gamble data from the server
|
|
177
195
|
* @param {number} roundNumber round number
|
|
@@ -192,7 +210,7 @@ export class ConnectionWrapper {
|
|
|
192
210
|
choice
|
|
193
211
|
}));
|
|
194
212
|
this._messageHistory.push(this.lastGambleResponse);
|
|
195
|
-
this.sendEndOfRoundData(roundNumber
|
|
213
|
+
this.sendEndOfRoundData(roundNumber);
|
|
196
214
|
return this.lastGambleResponse;
|
|
197
215
|
}
|
|
198
216
|
/**
|
|
@@ -19,6 +19,7 @@ export declare class LocalConnectionWrapper implements SubscribableConnectionWra
|
|
|
19
19
|
fetchSpinData(): Promise<SpinData>;
|
|
20
20
|
subscribeForConfigChanges(subscriberFn: () => void): void;
|
|
21
21
|
sendEndOfRoundData(roundNumber: number): Promise<ServerMessage>;
|
|
22
|
+
sendTakeAction(roundNumber: number): Promise<ServerMessage>;
|
|
22
23
|
fetchFreeSpinData(roundNumber: number, quantity: number): Promise<SpinData>;
|
|
23
24
|
getMessageHistory(): ServerMessage[];
|
|
24
25
|
}
|
|
@@ -51,6 +51,17 @@ export class LocalConnectionWrapper {
|
|
|
51
51
|
this.subscribers.forEach((subscriber) => subscriber());
|
|
52
52
|
return Promise.resolve(data);
|
|
53
53
|
}
|
|
54
|
+
sendTakeAction(roundNumber) {
|
|
55
|
+
const data = {
|
|
56
|
+
action: "take",
|
|
57
|
+
balance: 1000,
|
|
58
|
+
round_number: roundNumber,
|
|
59
|
+
status: { code: 200, message: "OK" },
|
|
60
|
+
win_amount_total: 1
|
|
61
|
+
};
|
|
62
|
+
this.subscribers.forEach((subscriber) => subscriber());
|
|
63
|
+
return Promise.resolve(data);
|
|
64
|
+
}
|
|
54
65
|
fetchFreeSpinData(roundNumber, quantity) {
|
|
55
66
|
const data = {
|
|
56
67
|
action: "buy-free-spins",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EndDataInterface, GambleCardColor, GambleDataInterface, InitDataInterface, SpinDataInterface } from "./serverData";
|
|
1
|
+
import { EndDataInterface, GambleCardColor, GambleDataInterface, InitDataInterface, SpinDataInterface, TakeDataInterface } from "./serverData";
|
|
2
2
|
import { SpinData } from "./spinData";
|
|
3
3
|
export interface ServerCommunication {
|
|
4
4
|
initCommunication(): Promise<void>;
|
|
@@ -7,6 +7,7 @@ export interface ServerCommunication {
|
|
|
7
7
|
fetchSpinData(roundNumber: number, bet: number, extraData?: ExtraDataRequest): Promise<SpinData>;
|
|
8
8
|
fetchFreeSpinData(roundNumber: number, amount: number, price: number): Promise<SpinData>;
|
|
9
9
|
sendEndOfRoundData(roundNumber: number): Promise<ServerMessage>;
|
|
10
|
+
sendTakeAction(roundNumber: number): Promise<ServerMessage>;
|
|
10
11
|
getMessageHistory(): ServerMessage[];
|
|
11
12
|
}
|
|
12
13
|
export interface Subscribable {
|
|
@@ -51,8 +52,11 @@ export type GambleServerRequest = BaseServerRequest & {
|
|
|
51
52
|
export type EndServerRequest = BaseServerRequest & {
|
|
52
53
|
action: "end";
|
|
53
54
|
};
|
|
55
|
+
export type TakeServerRequest = BaseServerRequest & {
|
|
56
|
+
action: "take";
|
|
57
|
+
};
|
|
54
58
|
export interface ExtraDataRequest {
|
|
55
59
|
}
|
|
56
|
-
export type ServerRequest = InitServerRequest | SpinServerRequest | BuyFreeSpinServerRequest | GambleServerRequest | EndServerRequest;
|
|
57
|
-
export type ServerMessage = InitDataInterface | SpinDataInterface | GambleDataInterface | EndDataInterface;
|
|
60
|
+
export type ServerRequest = InitServerRequest | SpinServerRequest | BuyFreeSpinServerRequest | GambleServerRequest | EndServerRequest | TakeServerRequest;
|
|
61
|
+
export type ServerMessage = InitDataInterface | SpinDataInterface | GambleDataInterface | EndDataInterface | TakeDataInterface;
|
|
58
62
|
export {};
|
|
@@ -30,6 +30,16 @@ export interface EndDataInterface {
|
|
|
30
30
|
message: string;
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
+
export interface TakeDataInterface {
|
|
34
|
+
action: "take";
|
|
35
|
+
balance: number;
|
|
36
|
+
round_number: number;
|
|
37
|
+
status: {
|
|
38
|
+
code: number;
|
|
39
|
+
message: string;
|
|
40
|
+
};
|
|
41
|
+
win_amount_total: number;
|
|
42
|
+
}
|
|
33
43
|
export type JackpotType = "jackpot-mini" | "jackpot-minor" | "jackpot-major" | "jackpot-grand";
|
|
34
44
|
export type JackpotWins = {
|
|
35
45
|
"jackpot-grand": {
|
|
@@ -86,12 +86,17 @@ export declare abstract class AbstractController<T> {
|
|
|
86
86
|
* Function for disabling speed button
|
|
87
87
|
* @param {boolean} shouldBeDisabled flag to disable speed button
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
disableSpeedButton(shouldBeDisabled: boolean): void;
|
|
90
90
|
/**
|
|
91
91
|
* Function for disabling information buttons
|
|
92
92
|
* @param {boolean} shouldBeDisabled flag to disable information buttons
|
|
93
93
|
*/
|
|
94
94
|
disableInformationButtons(shouldBeDisabled: boolean): void;
|
|
95
|
+
/**
|
|
96
|
+
* Function for disabling refresh buttons
|
|
97
|
+
* @param {boolean} shouldBeDisabled flag to disable refresh buttons
|
|
98
|
+
*/
|
|
99
|
+
disableRefreshButton(shouldBeDisabled: boolean): void;
|
|
95
100
|
/**
|
|
96
101
|
* Function for handling disabling buttons
|
|
97
102
|
* @param {boolean} disabled flag to disable buttons
|
|
@@ -204,6 +209,12 @@ export declare abstract class AbstractController<T> {
|
|
|
204
209
|
* Function for clearing and destroying actions in win actions queue
|
|
205
210
|
*/
|
|
206
211
|
protected clearAndDestroyActions(): void;
|
|
212
|
+
/**
|
|
213
|
+
* Function that is used to invoke take action after winning (send request to backend to save status of wallet).
|
|
214
|
+
* After that action, gamble and other bonus games are blocked.
|
|
215
|
+
*
|
|
216
|
+
*/
|
|
217
|
+
protected useTakeAction(): Promise<void>;
|
|
207
218
|
/**
|
|
208
219
|
* Function disabling autoplay functionality
|
|
209
220
|
*/
|
|
@@ -61,6 +61,7 @@ export class AbstractController {
|
|
|
61
61
|
this.componentRegistry = RainMan.componentRegistry;
|
|
62
62
|
this.setupSpaceOrEnterListener();
|
|
63
63
|
RainMan.globals.handleDisablingButtons = this.handleDisablingButtons.bind(this);
|
|
64
|
+
RainMan.settingsStore.isTakeActionAvailable = false;
|
|
64
65
|
RainMan.settingsStore.increaseBet = () => {
|
|
65
66
|
this.uiController.updateBet("increase");
|
|
66
67
|
SoundManager.play(SoundTracks.increaseRate);
|
|
@@ -78,6 +79,7 @@ export class AbstractController {
|
|
|
78
79
|
this.config = new ApiConfig(initData);
|
|
79
80
|
RainMan.settingsStore.initPaytableMap(initData);
|
|
80
81
|
RainMan.globals.throttledSpin = this.throttledSpin.bind(this);
|
|
82
|
+
RainMan.settingsStore.useTakeAction = this.useTakeAction.bind(this);
|
|
81
83
|
this.connection.subscribeForConfigChanges(this.reinitializeUserBalanceData.bind(this));
|
|
82
84
|
this.uiController.updateBet("first");
|
|
83
85
|
this.uiController.currentBalance = initData.balance;
|
|
@@ -177,6 +179,13 @@ export class AbstractController {
|
|
|
177
179
|
];
|
|
178
180
|
buttonsToChange.forEach((button) => button.flipDisabledFlag(shouldBeDisabled));
|
|
179
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Function for disabling refresh buttons
|
|
184
|
+
* @param {boolean} shouldBeDisabled flag to disable refresh buttons
|
|
185
|
+
*/
|
|
186
|
+
disableRefreshButton(shouldBeDisabled) {
|
|
187
|
+
RainMan.componentRegistry.get(BUTTONS.refresh).flipDisabledFlag(shouldBeDisabled);
|
|
188
|
+
}
|
|
180
189
|
/**
|
|
181
190
|
* Function for handling disabling buttons
|
|
182
191
|
* @param {boolean} disabled flag to disable buttons
|
|
@@ -243,16 +252,19 @@ export class AbstractController {
|
|
|
243
252
|
*/
|
|
244
253
|
initSpinButton() {
|
|
245
254
|
const refreshButton = RainMan.componentRegistry.get(RefreshButton.registryName);
|
|
246
|
-
refreshButton.setOnClick(() => {
|
|
247
|
-
this.handleDisablingButtons(true);
|
|
248
|
-
this.handleSpinLogic();
|
|
249
|
-
});
|
|
250
255
|
const clearMobileSpinTimeout = () => {
|
|
251
256
|
if (this.mobileSpinTimeout) {
|
|
252
257
|
clearInterval(this.mobileSpinTimeout);
|
|
253
258
|
this.mobileSpinTimeout = null;
|
|
259
|
+
this.columnsContainer.clearQuickReelsStop();
|
|
254
260
|
}
|
|
255
261
|
};
|
|
262
|
+
refreshButton.setOnClick(() => this.handleSpinLogic());
|
|
263
|
+
refreshButton.on("touchend", () => clearMobileSpinTimeout());
|
|
264
|
+
refreshButton.on("touchcancel", () => clearMobileSpinTimeout());
|
|
265
|
+
refreshButton.on("touchleave", () => clearMobileSpinTimeout());
|
|
266
|
+
refreshButton.on("touchendoutside", () => clearMobileSpinTimeout());
|
|
267
|
+
refreshButton.on("globaltouchmove", () => clearMobileSpinTimeout());
|
|
256
268
|
refreshButton.on("touchstart", () => {
|
|
257
269
|
this.mobileSpinTimeout = setInterval(() => {
|
|
258
270
|
this.handleDisablingButtons(true);
|
|
@@ -268,13 +280,6 @@ export class AbstractController {
|
|
|
268
280
|
this.handleSpinLogic();
|
|
269
281
|
}, RainMan.config.durationOfActions.mobileSpinTimeout);
|
|
270
282
|
});
|
|
271
|
-
refreshButton.on("touchend", () => {
|
|
272
|
-
clearMobileSpinTimeout();
|
|
273
|
-
});
|
|
274
|
-
refreshButton.on("globaltouchmove", (event) => {
|
|
275
|
-
if (event.target !== refreshButton)
|
|
276
|
-
clearMobileSpinTimeout();
|
|
277
|
-
});
|
|
278
283
|
}
|
|
279
284
|
/**
|
|
280
285
|
* This function is responsible for checking if buttons (not bet buttons) should be disabled
|
|
@@ -455,6 +460,7 @@ export class AbstractController {
|
|
|
455
460
|
handleSpinLogic() {
|
|
456
461
|
this.handleDisablingButtons(true);
|
|
457
462
|
RainMan.globals.shouldShowModals = false;
|
|
463
|
+
this.columnsContainer.clearQuickReelsStop();
|
|
458
464
|
if (this.mainContainer.freeSpinPlate) {
|
|
459
465
|
if (this.mainContainer.freeSpinPlate.shownAt === null ||
|
|
460
466
|
performance.now() - this.mainContainer.freeSpinPlate.shownAt <
|
|
@@ -516,15 +522,16 @@ export class AbstractController {
|
|
|
516
522
|
RainMan.config.durationOfActions.speedPopupVisibleTime) {
|
|
517
523
|
RainMan.globals.handleDisablingButtons?.();
|
|
518
524
|
elementsToSkipHide.push(UI_ITEMS.speedSettings);
|
|
525
|
+
this.columnsContainer.clearQuickReelsStop();
|
|
519
526
|
}
|
|
520
527
|
hideLayerIfPresent(elementsToSkipHide);
|
|
521
528
|
hidePaytable();
|
|
522
529
|
if (this.gamePhase === gamePhases.DATA_FETCH ||
|
|
523
530
|
this.gamePhase === gamePhases.SPINNING ||
|
|
524
531
|
this.gamePhase === gamePhases.CONFIGURING_SPIN) {
|
|
525
|
-
this.columnsContainer.enableQuickReelsStop();
|
|
526
532
|
this.isSpinThrottled = true;
|
|
527
|
-
this.
|
|
533
|
+
this.columnsContainer.enableQuickReelsStop();
|
|
534
|
+
this.quickStopController.handleResetCounter(this.spinThrottlerTimeout !== null);
|
|
528
535
|
this.quickStopController.handleInvokingSpeedPopup();
|
|
529
536
|
return;
|
|
530
537
|
}
|
|
@@ -547,6 +554,11 @@ export class AbstractController {
|
|
|
547
554
|
this.changeGamePhase(gamePhases.IDLE);
|
|
548
555
|
}
|
|
549
556
|
if (this.spinThrottlerTimeout !== null) {
|
|
557
|
+
this.columnsContainer.clearQuickReelsStop();
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (this.mobileSpinTimeout !== null) {
|
|
561
|
+
this.columnsContainer.clearQuickReelsStop();
|
|
550
562
|
return;
|
|
551
563
|
}
|
|
552
564
|
if (this.gamePhase === gamePhases.IDLE || this.gamePhase === gamePhases.HANDLING_ACTIONS) {
|
|
@@ -586,6 +598,28 @@ export class AbstractController {
|
|
|
586
598
|
this.winActionsQueue.length = 0;
|
|
587
599
|
this.currentlyPlayedAction = undefined;
|
|
588
600
|
}
|
|
601
|
+
/**
|
|
602
|
+
* Function that is used to invoke take action after winning (send request to backend to save status of wallet).
|
|
603
|
+
* After that action, gamble and other bonus games are blocked.
|
|
604
|
+
*
|
|
605
|
+
*/
|
|
606
|
+
async useTakeAction() {
|
|
607
|
+
if (!RainMan.settingsStore.isTakeActionAvailable ||
|
|
608
|
+
RainMan.settingsStore.roundNumber === 0 ||
|
|
609
|
+
this._lastWinAmount === 0) {
|
|
610
|
+
logInfo("Take action can't be performed");
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
const takeData = await window.connectionWrapper.sendTakeAction(RainMan.settingsStore.roundNumber);
|
|
614
|
+
if (takeData.status.code === 200) {
|
|
615
|
+
RainMan.settingsStore.isTakeActionAvailable = false;
|
|
616
|
+
logInfo(`💰 Round ${takeData.round_number} ended with balance:`, takeData.balance);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
RainMan.settingsStore.isTakeActionAvailable = true;
|
|
620
|
+
logInfo("Error with take action");
|
|
621
|
+
}
|
|
622
|
+
}
|
|
589
623
|
/**
|
|
590
624
|
* Function disabling autoplay functionality
|
|
591
625
|
*/
|
|
@@ -730,6 +764,7 @@ export class AbstractController {
|
|
|
730
764
|
this.changeGamePhase(gamePhases.SPINNING);
|
|
731
765
|
this.uiController.resetWinAmount();
|
|
732
766
|
await this.onSpinningStart();
|
|
767
|
+
this.columnsContainer.clearQuickReelsStop();
|
|
733
768
|
this.columnsContainer.blindSpin();
|
|
734
769
|
this.clearAndDestroyActions();
|
|
735
770
|
const { spinLogic } = await this.fetchAndPrepareSpinData();
|
|
@@ -737,6 +772,12 @@ export class AbstractController {
|
|
|
737
772
|
const availableFreeSpins = spinLogic.availableFreeSpins;
|
|
738
773
|
const availableFreeSpinsIncreased = availableFreeSpins > RainMan.settingsStore.howManyFreeSpinsLeft;
|
|
739
774
|
this.hideFreeSpinsMessageBox = availableFreeSpinsIncreased;
|
|
775
|
+
if (this._lastWinAmount !== 0) {
|
|
776
|
+
RainMan.settingsStore.isTakeActionAvailable = true;
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
RainMan.settingsStore.isTakeActionAvailable = false;
|
|
780
|
+
}
|
|
740
781
|
if (!availableFreeSpinsIncreased) {
|
|
741
782
|
this.uiController.updateShownFreeSpinAmount(availableFreeSpins);
|
|
742
783
|
}
|
|
@@ -755,7 +796,6 @@ export class AbstractController {
|
|
|
755
796
|
await new Promise((resolveAfterSpins) => {
|
|
756
797
|
this.columnsContainer.configBlindSpin(spinLogic.onStopBlindsConfiguration, resolveAfterSpins, this.getReelIndexesToShowMysteryFx(spinLogic));
|
|
757
798
|
});
|
|
758
|
-
this.columnsContainer.clearQuickReelsStop();
|
|
759
799
|
this.changeGamePhase(gamePhases.HANDLING_ACTIONS);
|
|
760
800
|
this.handleDisablingButtons(true);
|
|
761
801
|
this.unlockLogicAfterSpinning();
|
|
@@ -8,11 +8,44 @@ export declare class QuickStopController {
|
|
|
8
8
|
private buttonsEventManager;
|
|
9
9
|
quickStopCounterLock: boolean;
|
|
10
10
|
shouldInvokeSpeedPopup: boolean;
|
|
11
|
-
private quickStopsCounter;
|
|
12
11
|
speedPopupDisabled: boolean;
|
|
12
|
+
private quickStopsCounter;
|
|
13
13
|
constructor(buttonsEventManager: ButtonsEventManager);
|
|
14
|
+
/**
|
|
15
|
+
* Function for handling invoking speed popup
|
|
16
|
+
* This function will increment the quick stops counter and lock the counter if it reaches the maximum
|
|
17
|
+
* If the maximum is reached, it will set the flag to show the speed popup
|
|
18
|
+
* @public
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
14
21
|
handleInvokingSpeedPopup(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Function for handling speed popup invocation
|
|
24
|
+
* This function will set the visibility of the speed popup and reset the quick stop counter lock
|
|
25
|
+
* It will also disable the speed popup to prevent it from being shown again until the next
|
|
26
|
+
* quick stop counter reset
|
|
27
|
+
* @public
|
|
28
|
+
* @returns {void}
|
|
29
|
+
*/
|
|
15
30
|
handleSpeedPopupInvocation(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Function for setting speed popup disabled state
|
|
33
|
+
* @public
|
|
34
|
+
* @param {boolean} value - whether the speed popup should be disabled
|
|
35
|
+
*/
|
|
16
36
|
setSpeedPopupDisabled(value: boolean): void;
|
|
37
|
+
/**
|
|
38
|
+
* Function for resetting the quick stops counter
|
|
39
|
+
* This function will reset the quick stops counter to 0 if the shouldReset parameter is true
|
|
40
|
+
* @public
|
|
41
|
+
* @param {boolean} shouldReset - whether the quick stops counter should be reset
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
17
44
|
handleResetCounter(shouldReset: boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* Function for setting quick stop counter lock state
|
|
47
|
+
* @public
|
|
48
|
+
* @param {boolean} value - whether the quick stop counter should be locked
|
|
49
|
+
*/
|
|
50
|
+
setQuickStopCounterLock(value: boolean): void;
|
|
18
51
|
}
|
|
@@ -10,12 +10,19 @@ export class QuickStopController {
|
|
|
10
10
|
buttonsEventManager;
|
|
11
11
|
quickStopCounterLock = false;
|
|
12
12
|
shouldInvokeSpeedPopup = false;
|
|
13
|
-
quickStopsCounter = 0;
|
|
14
13
|
speedPopupDisabled = false;
|
|
14
|
+
quickStopsCounter = 0;
|
|
15
15
|
constructor(buttonsEventManager) {
|
|
16
16
|
this.buttonsEventManager = buttonsEventManager;
|
|
17
17
|
RainMan.globals.disableSpeedPopup = this.setSpeedPopupDisabled.bind(this);
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Function for handling invoking speed popup
|
|
21
|
+
* This function will increment the quick stops counter and lock the counter if it reaches the maximum
|
|
22
|
+
* If the maximum is reached, it will set the flag to show the speed popup
|
|
23
|
+
* @public
|
|
24
|
+
* @returns {void}
|
|
25
|
+
*/
|
|
19
26
|
handleInvokingSpeedPopup() {
|
|
20
27
|
if (!this.quickStopCounterLock &&
|
|
21
28
|
this.quickStopsCounter < MAX_QUICK_STOPS &&
|
|
@@ -27,6 +34,14 @@ export class QuickStopController {
|
|
|
27
34
|
}
|
|
28
35
|
}
|
|
29
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Function for handling speed popup invocation
|
|
39
|
+
* This function will set the visibility of the speed popup and reset the quick stop counter lock
|
|
40
|
+
* It will also disable the speed popup to prevent it from being shown again until the next
|
|
41
|
+
* quick stop counter reset
|
|
42
|
+
* @public
|
|
43
|
+
* @returns {void}
|
|
44
|
+
*/
|
|
30
45
|
handleSpeedPopupInvocation() {
|
|
31
46
|
if (this.shouldInvokeSpeedPopup && !this.speedPopupDisabled) {
|
|
32
47
|
this.buttonsEventManager?.setSpeedPopupVisibility("flex");
|
|
@@ -35,11 +50,32 @@ export class QuickStopController {
|
|
|
35
50
|
}
|
|
36
51
|
this.quickStopCounterLock = false;
|
|
37
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Function for setting speed popup disabled state
|
|
55
|
+
* @public
|
|
56
|
+
* @param {boolean} value - whether the speed popup should be disabled
|
|
57
|
+
*/
|
|
38
58
|
setSpeedPopupDisabled(value) {
|
|
39
59
|
this.speedPopupDisabled = value;
|
|
40
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Function for resetting the quick stops counter
|
|
63
|
+
* This function will reset the quick stops counter to 0 if the shouldReset parameter is true
|
|
64
|
+
* @public
|
|
65
|
+
* @param {boolean} shouldReset - whether the quick stops counter should be reset
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
41
68
|
handleResetCounter(shouldReset) {
|
|
42
|
-
if (shouldReset)
|
|
69
|
+
if (shouldReset) {
|
|
43
70
|
this.quickStopsCounter = 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Function for setting quick stop counter lock state
|
|
75
|
+
* @public
|
|
76
|
+
* @param {boolean} value - whether the quick stop counter should be locked
|
|
77
|
+
*/
|
|
78
|
+
setQuickStopCounterLock(value) {
|
|
79
|
+
this.quickStopCounterLock = value;
|
|
44
80
|
}
|
|
45
81
|
}
|
|
@@ -23,6 +23,7 @@ export declare class SettingsStore {
|
|
|
23
23
|
buyFreeSpinsData: Nullable<SpinData>;
|
|
24
24
|
isAutoplayEnabled: boolean;
|
|
25
25
|
isLastFreeSpin: boolean;
|
|
26
|
+
isTakeActionAvailable: boolean;
|
|
26
27
|
infinitySpinsEnabled: boolean;
|
|
27
28
|
roundNumber: number;
|
|
28
29
|
HiResolutionFlag: boolean;
|
|
@@ -52,6 +53,7 @@ export declare class SettingsStore {
|
|
|
52
53
|
increaseBet?: () => void;
|
|
53
54
|
decreaseBet?: () => void;
|
|
54
55
|
enableButtons?: () => void;
|
|
56
|
+
useTakeAction?: () => void;
|
|
55
57
|
private readonly initialAutoplaySettingsState;
|
|
56
58
|
private modalsAvailable;
|
|
57
59
|
private paytableMap;
|
|
@@ -26,6 +26,7 @@ export class SettingsStore {
|
|
|
26
26
|
buyFreeSpinsData = null;
|
|
27
27
|
isAutoplayEnabled = false;
|
|
28
28
|
isLastFreeSpin = false;
|
|
29
|
+
isTakeActionAvailable = true;
|
|
29
30
|
infinitySpinsEnabled = false;
|
|
30
31
|
roundNumber = 0;
|
|
31
32
|
HiResolutionFlag = getFromLocalStorage(LOCAL_STORAGE.hiResolution, true);
|
|
@@ -55,6 +56,7 @@ export class SettingsStore {
|
|
|
55
56
|
increaseBet;
|
|
56
57
|
decreaseBet;
|
|
57
58
|
enableButtons;
|
|
59
|
+
useTakeAction;
|
|
58
60
|
initialAutoplaySettingsState = {
|
|
59
61
|
infinitySpinsEnabled: false,
|
|
60
62
|
onAnyWin: false,
|
|
@@ -159,7 +161,7 @@ export class SettingsStore {
|
|
|
159
161
|
*/
|
|
160
162
|
setShouldPlayAmbientMusic(flag, saveToLocalStorage = true) {
|
|
161
163
|
this.shouldPlayAmbientMusic = flag;
|
|
162
|
-
SoundManager.setPlayStatus(SoundTracks.music, flag);
|
|
164
|
+
SoundManager.setPlayStatus(this.isFreeSpinsPlayEnabled ? SoundTracks.freeSpinsMusic : SoundTracks.music, flag);
|
|
163
165
|
this.updateVolumeButtonTexture?.();
|
|
164
166
|
if (saveToLocalStorage) {
|
|
165
167
|
setToLocalStorage(LOCAL_STORAGE.isAmbientMusicEnabled, flag);
|
package/package.json
CHANGED