pixi-rainman-game-engine 0.1.5 → 0.1.6
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/Rainman/appConfig.js +1 -0
- package/dist/Rainman/types.d.ts +1 -0
- package/dist/SettingsUI/components/SlidingSwitch/index.jsx +1 -1
- package/dist/SettingsUI/components/VolumeSettings/index.jsx +14 -23
- package/dist/application/ApiConfig/ApiConfig.js +2 -2
- package/dist/application/ApiConfig/SymbolId.d.ts +1 -1
- package/dist/application/ButtonsEventManager/ButtonsEventManager.js +1 -1
- package/dist/application/SoundManager/SoundManager.d.ts +1 -1
- package/dist/application/SoundManager/SoundManager.js +19 -14
- package/dist/application/SoundManager/types.d.ts +45 -21
- package/dist/application/SoundManager/types.js +6 -6
- package/dist/application/SpinLogic/SpinLogic.d.ts +5 -1
- package/dist/application/SpinLogic/SpinLogic.js +12 -2
- package/dist/application/SpinLogic/SpinLogicDTO.d.ts +3 -1
- package/dist/application/SpinLogic/SpinLogicDTO.js +13 -3
- package/dist/application/SpinLogic/types.d.ts +2 -1
- package/dist/application/SpinLogic/util.d.ts +1 -1
- package/dist/application/SpinLogic/util.js +1 -1
- package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +19 -17
- package/dist/components/AbstractMainContainer/AbstractMainContainer.js +53 -15
- package/dist/components/GambleGame/GambleGame.d.ts +26 -0
- package/dist/components/GambleGame/GambleGame.js +156 -0
- package/dist/components/GambleGame/index.d.ts +2 -0
- package/dist/components/GambleGame/index.js +2 -0
- package/dist/components/GambleGame/types.d.ts +7 -0
- package/dist/components/GambleGame/types.js +1 -0
- package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +13 -0
- package/dist/components/buttons/buttonGroups/LeftButtons.js +41 -0
- package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.d.ts +9 -0
- package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.js +29 -0
- package/dist/components/buttons/buttonGroups/{AbstractLeftButtonsMobile.d.ts → LeftButtonsMobile.d.ts} +5 -4
- package/dist/components/buttons/buttonGroups/LeftButtonsMobile.js +34 -0
- package/dist/components/buttons/buttonGroups/{AbstractMiddleButtons.d.ts → MiddleButtons.d.ts} +6 -3
- package/dist/components/buttons/buttonGroups/MiddleButtons.js +68 -0
- package/dist/components/buttons/buttonGroups/{AbstractRightButtons.d.ts → RightButtons.d.ts} +3 -2
- package/dist/components/buttons/buttonGroups/{AbstractRightButtons.js → RightButtons.js} +11 -7
- package/dist/components/buttons/buttonGroups/{AbstractRightButtonsLandscape.d.ts → RightButtonsLandscape.d.ts} +3 -2
- package/dist/components/buttons/buttonGroups/RightButtonsLandscape.js +51 -0
- package/dist/components/buttons/buttonGroups/{AbstractRightButtonsMobile.d.ts → RightButtonsMobile.d.ts} +5 -4
- package/dist/components/buttons/buttonGroups/RightButtonsMobile.js +39 -0
- package/dist/components/buttons/buttonGroups/constants.d.ts +4 -0
- package/dist/components/buttons/buttonGroups/constants.js +4 -0
- package/dist/components/buttons/buttonGroups/index.d.ts +7 -7
- package/dist/components/buttons/buttonGroups/index.js +7 -7
- package/dist/components/buttons/default/BlackButton.d.ts +5 -0
- package/dist/components/buttons/default/BlackButton.js +13 -0
- package/dist/components/buttons/default/CollectButton.d.ts +5 -0
- package/dist/components/buttons/default/CollectButton.js +13 -0
- package/dist/components/buttons/default/RedButton.d.ts +5 -0
- package/dist/components/buttons/default/RedButton.js +13 -0
- package/dist/components/buttons/default/VolumeButton.js +2 -3
- package/dist/components/buttons/default/index.d.ts +3 -0
- package/dist/components/buttons/default/index.js +3 -0
- package/dist/components/common/AnimatedBackground.d.ts +14 -0
- package/dist/components/common/AnimatedBackground.js +46 -0
- package/dist/components/common/FreeSpinBox.d.ts +10 -2
- package/dist/components/common/FreeSpinBox.js +32 -6
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/common/index.js +1 -0
- package/dist/components/dictionary/locales/en.json +9 -1
- package/dist/components/frame/AbstractColumnsContainer.d.ts +2 -2
- package/dist/components/frame/AbstractColumnsContainer.js +24 -2
- package/dist/components/frame/AbstractFrame.d.ts +1 -2
- package/dist/components/frame/AbstractFrame.js +5 -11
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/messageBox/MessageBox.d.ts +2 -2
- package/dist/components/messageBox/MessageBox.js +29 -9
- package/dist/components/symbols/AbstractSymbolBase.d.ts +7 -5
- package/dist/components/symbols/AbstractSymbolBase.js +12 -7
- package/dist/components/symbols/AbstractSymbolsColumn.d.ts +2 -2
- package/dist/components/symbols/AbstractSymbolsColumn.js +7 -5
- package/dist/components/symbols/DroppableSymbolsColumn.d.ts +1 -1
- package/dist/components/symbols/DroppableSymbolsColumn.js +2 -2
- package/dist/components/updatable/GambleUpdatableText.d.ts +6 -0
- package/dist/components/updatable/GambleUpdatableText.js +35 -0
- package/dist/components/updatable/StylefulUpdatableText.js +2 -2
- package/dist/components/updatable/UpdatableValueComponent.d.ts +7 -4
- package/dist/components/updatable/index.d.ts +1 -0
- package/dist/components/updatable/index.js +1 -0
- package/dist/connectivity/ConnectionWrapper.d.ts +4 -1
- package/dist/connectivity/ConnectionWrapper.js +22 -5
- package/dist/connectivity/apiQueue.js +2 -2
- package/dist/connectivity/serverData.d.ts +1 -1
- package/dist/connectivity/wins.d.ts +7 -1
- package/dist/constants/gamble.d.ts +9 -0
- package/dist/constants/gamble.js +14 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/wins.d.ts +13 -6
- package/dist/constants/wins.js +13 -6
- package/dist/controllers/AbstractController.d.ts +1 -1
- package/dist/controllers/AbstractController.js +10 -8
- package/dist/controllers/UiController.d.ts +2 -0
- package/dist/controllers/UiController.js +5 -0
- package/dist/localStorage/localStorage.d.ts +3 -0
- package/dist/localStorage/localStorage.js +6 -1
- package/dist/stores/SettingsStore.d.ts +4 -4
- package/dist/stores/SettingsStore.js +51 -20
- package/dist/utils/common/functions.d.ts +0 -1
- package/dist/utils/common/functions.js +0 -3
- package/dist/utils/common/logger.d.ts +5 -4
- package/dist/utils/common/logger.js +2 -1
- package/dist/utils/common/placementHelpers.d.ts +2 -1
- package/dist/utils/common/placementHelpers.js +3 -2
- package/dist/winComponents/UpdatableSpineContainer.d.ts +3 -2
- package/dist/winComponents/UpdatableSpineContainer.js +9 -9
- package/dist/winComponents/winFactory.d.ts +1 -1
- package/dist/winComponents/winFactory.js +14 -1
- package/package.json +1 -1
- package/dist/components/buttons/buttonGroups/AbstractLeftButtons.d.ts +0 -13
- package/dist/components/buttons/buttonGroups/AbstractLeftButtons.js +0 -33
- package/dist/components/buttons/buttonGroups/AbstractLeftButtonsLandscape.d.ts +0 -8
- package/dist/components/buttons/buttonGroups/AbstractLeftButtonsLandscape.js +0 -14
- package/dist/components/buttons/buttonGroups/AbstractLeftButtonsMobile.js +0 -21
- package/dist/components/buttons/buttonGroups/AbstractMiddleButtons.js +0 -26
- package/dist/components/buttons/buttonGroups/AbstractRightButtonsLandscape.js +0 -32
- package/dist/components/buttons/buttonGroups/AbstractRightButtonsMobile.js +0 -23
package/dist/Rainman/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
export const SlidingSwitch = observer(({ flag, setFlag }) => {
|
|
5
5
|
return (<label className="switch">
|
|
6
6
|
<span className={`switch-round-box round ${flag ? "switch-round-box--active" : ""}`}/>
|
|
7
|
-
<input type="checkbox"
|
|
7
|
+
<input type="checkbox" checked={flag} onChange={(event) => setFlag(event.target.checked)}/>
|
|
8
8
|
<p className={`switch__text ${flag ? "switch__text--active" : ""}`}>{flag ? "ON" : "OFF"}</p>
|
|
9
9
|
</label>);
|
|
10
10
|
});
|
|
@@ -5,41 +5,32 @@ import Slider from "rc-slider";
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { RainMan } from "../../../Rainman";
|
|
7
7
|
import { useStores } from "../../hooks";
|
|
8
|
-
const handleStyle = { width: "7px", height: "24px", bottom: "-6px", borderRadius: "4px" };
|
|
9
8
|
const onChange = (newVolumeLevel) => {
|
|
10
9
|
RainMan.settingsStore.setVolumeLevel(newVolumeLevel);
|
|
11
|
-
RainMan.settingsStore.
|
|
10
|
+
RainMan.settingsStore.flipSoundsEnabled(newVolumeLevel);
|
|
12
11
|
};
|
|
13
12
|
export const VolumeSettings = observer(() => {
|
|
14
13
|
const { settingStore } = useStores();
|
|
14
|
+
const COLOR = settingStore.isSoundEnabled() ? "#2FC408" : "#FA5F27";
|
|
15
15
|
return (<div className="volume-control">
|
|
16
16
|
<div className="volume-control__volume-icon"></div>
|
|
17
|
-
<Slider className="volume-control__slider" step={1} min={0} max={100} value={settingStore.volumeLevel} handleStyle={
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
:
|
|
24
|
-
|
|
25
|
-
borderColor: "#2FC408",
|
|
26
|
-
...handleStyle,
|
|
27
|
-
}} railStyle={{
|
|
17
|
+
<Slider className="volume-control__slider" step={1} min={0} max={100} value={settingStore.volumeLevel} handleStyle={{
|
|
18
|
+
backgroundColor: COLOR,
|
|
19
|
+
borderColor: COLOR,
|
|
20
|
+
width: "7px",
|
|
21
|
+
height: "24px",
|
|
22
|
+
bottom: "-6px",
|
|
23
|
+
borderRadius: "4px",
|
|
24
|
+
}} railStyle={{
|
|
28
25
|
backgroundColor: "#fff",
|
|
29
26
|
}} trackStyle={{
|
|
30
|
-
backgroundColor:
|
|
27
|
+
backgroundColor: COLOR,
|
|
31
28
|
height: "5px",
|
|
32
29
|
borderRadius: "1px",
|
|
33
|
-
}} dotStyle={{
|
|
34
|
-
borderColor: "#2FC408",
|
|
35
30
|
}} onChange={onChange}/>
|
|
36
|
-
<p className="volume-control__text" style={
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
: {
|
|
41
|
-
color: "#2FC408",
|
|
42
|
-
}}>
|
|
31
|
+
<p className="volume-control__text" style={{
|
|
32
|
+
color: COLOR,
|
|
33
|
+
}}>
|
|
43
34
|
{settingStore.volumeLevel}
|
|
44
35
|
</p>
|
|
45
36
|
</div>);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RainMan } from "../../Rainman";
|
|
2
|
-
import {
|
|
2
|
+
import { logError } from "../../utils";
|
|
3
3
|
export class ApiConfig {
|
|
4
4
|
token;
|
|
5
5
|
symbolMap = new Map();
|
|
@@ -73,7 +73,7 @@ export class ApiConfig {
|
|
|
73
73
|
for (const [key, name] of data.symbols_names.entries()) {
|
|
74
74
|
const backendId = data.symbols[key];
|
|
75
75
|
if (!Object.values(RainMan.symbolIds).includes(name)) {
|
|
76
|
-
|
|
76
|
+
logError(`🛑 "${name}" was not found in SymbolIds enum!`);
|
|
77
77
|
}
|
|
78
78
|
this.symbolMap.set(backendId, name);
|
|
79
79
|
}
|
|
@@ -112,7 +112,7 @@ export class ButtonsEventManager {
|
|
|
112
112
|
initVolumeButtonEvent() {
|
|
113
113
|
RainMan.settingsStore.setUpdateVolumeButtonTexture(() => RainMan.componentRegistry.get(VolumeButton.registryName).changeTextureDependOnVolume());
|
|
114
114
|
RainMan.componentRegistry.get(VolumeButton.registryName).setOnClick(() => {
|
|
115
|
-
RainMan.settingsStore.
|
|
115
|
+
RainMan.settingsStore.flipSoundsEnabled();
|
|
116
116
|
RainMan.componentRegistry.get(VolumeButton.registryName).changeTextureDependOnVolume();
|
|
117
117
|
this.handleModalInvocation(UI_ITEMS.volume);
|
|
118
118
|
});
|
|
@@ -10,7 +10,7 @@ export declare class SoundManagerInstance implements SpeedAdapterInterface<Sound
|
|
|
10
10
|
constructor();
|
|
11
11
|
loadSounds(assets: Record<string, string>): Promise<void>;
|
|
12
12
|
setVolume(volumeLevel: number): void;
|
|
13
|
-
|
|
13
|
+
stopPlayingFxSounds(): void;
|
|
14
14
|
setPlayStatus(soundName: SoundTrack, flag: boolean): void;
|
|
15
15
|
play(soundName: SoundTrack): void;
|
|
16
16
|
pause(soundName: SoundTrack): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Sound } from "@pixi/sound";
|
|
2
2
|
import { RainMan } from "../../Rainman";
|
|
3
3
|
import { SoundTracks } from "./types";
|
|
4
|
-
const soundsToLoop = [SoundTracks.
|
|
4
|
+
const soundsToLoop = [SoundTracks.mysteryFxLoop, SoundTracks.music];
|
|
5
5
|
export class SoundManagerInstance {
|
|
6
6
|
static instance;
|
|
7
7
|
static getInstance() {
|
|
@@ -23,46 +23,51 @@ export class SoundManagerInstance {
|
|
|
23
23
|
async loadSounds(assets) {
|
|
24
24
|
const loadingSoundsPromises = [];
|
|
25
25
|
for (const [soundName, url] of Object.entries(assets)) {
|
|
26
|
-
|
|
26
|
+
if (!url)
|
|
27
|
+
continue;
|
|
28
|
+
loadingSoundsPromises.push(new Promise((resolve) => {
|
|
27
29
|
const sound = Sound.from({
|
|
28
30
|
url,
|
|
29
31
|
autoPlay: false,
|
|
30
32
|
preload: true,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
33
|
+
loop: soundsToLoop.includes(soundName),
|
|
34
|
+
loaded: () => resolve(),
|
|
34
35
|
});
|
|
35
36
|
this.musicCatalogue.set(soundName, sound);
|
|
36
|
-
});
|
|
37
|
-
loadingSoundsPromises.push(loadingPromise);
|
|
37
|
+
}));
|
|
38
38
|
}
|
|
39
39
|
await Promise.all(loadingSoundsPromises);
|
|
40
40
|
}
|
|
41
41
|
setVolume(volumeLevel) {
|
|
42
42
|
this.musicCatalogue.forEach((sound) => (sound.volume = volumeLevel));
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
if (!RainMan.settingsStore.isSoundEnabled)
|
|
46
|
-
return;
|
|
44
|
+
stopPlayingFxSounds() {
|
|
47
45
|
for (const [soundName, sound] of this.musicCatalogue.entries()) {
|
|
48
46
|
if (soundName === SoundTracks.music)
|
|
49
47
|
continue;
|
|
50
|
-
sound.
|
|
48
|
+
sound.pause();
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
setPlayStatus(soundName, flag) {
|
|
54
52
|
flag ? this.play(soundName) : this.pause(soundName);
|
|
55
53
|
}
|
|
56
54
|
play(soundName) {
|
|
57
|
-
if (
|
|
58
|
-
|
|
55
|
+
if (soundName === "music") {
|
|
56
|
+
if (!RainMan.settingsStore.ambientMusicFlag)
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (!RainMan.settingsStore.soundFxFlag)
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
59
63
|
const overrideSoundName = this.overrides[soundName];
|
|
60
64
|
const sound = overrideSoundName
|
|
61
65
|
? this.musicCatalogue.get(overrideSoundName)
|
|
62
66
|
: this.musicCatalogue.get(soundName);
|
|
63
67
|
if (!sound)
|
|
64
68
|
return;
|
|
65
|
-
|
|
69
|
+
if (soundName === "music" && sound.isPlaying)
|
|
70
|
+
return;
|
|
66
71
|
sound.play();
|
|
67
72
|
}
|
|
68
73
|
pause(soundName) {
|
|
@@ -1,21 +1,45 @@
|
|
|
1
|
-
export declare const SoundTracks:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
export declare const SoundTracks: SoundTracks;
|
|
2
|
+
export interface SoundTracks {
|
|
3
|
+
button: "button";
|
|
4
|
+
deactivationAutostart: "deactivationAutostart";
|
|
5
|
+
increaseRate: "increaseRate";
|
|
6
|
+
music: "music";
|
|
7
|
+
reductionRate: "reductionRate";
|
|
8
|
+
allRollStops: "allRollStops";
|
|
9
|
+
bigWin: "bigWin";
|
|
10
|
+
boom: "boom";
|
|
11
|
+
standaloneBoom: "standaloneBoom";
|
|
12
|
+
symbolsFalling: "symbolsFalling";
|
|
13
|
+
mysteryFxEnd: "mysteryFxEnd";
|
|
14
|
+
mysteryFxLoop: "mysteryFxLoop";
|
|
15
|
+
line: "line";
|
|
16
|
+
mysteryDrawLoop: "mysteryDrawLoop";
|
|
17
|
+
rollStop: "rollStop";
|
|
18
|
+
specialSymbolOnReel: "specialSymbolOnReel";
|
|
19
|
+
start: "start";
|
|
20
|
+
symbol: "symbol";
|
|
21
|
+
}
|
|
22
|
+
export type SoundTrack = SoundTracks[keyof SoundTracks];
|
|
23
|
+
/**
|
|
24
|
+
* Object for mapping SoundTracks to appropriate asset.
|
|
25
|
+
* All properties must be set, if no sound should be played set empty string
|
|
26
|
+
* @property {string} button - default click button sound
|
|
27
|
+
* @property {string} deactivationAutostart - click on autostart button
|
|
28
|
+
* @property {string} increaseRate - click on plus button
|
|
29
|
+
* @property {string} music - ambient music in loop
|
|
30
|
+
* @property {string} reductionRate - click on neg button
|
|
31
|
+
* @property {string} allRollStops - skipping rolling reels, on end
|
|
32
|
+
* @property {string} bigWin - on show big win popup
|
|
33
|
+
* @property {string} boom - symbol destroy
|
|
34
|
+
* @property {string} standaloneBoom - symbol destroy for standalone
|
|
35
|
+
* @property {string} symbolsFalling - dropping symbols after destroy
|
|
36
|
+
* @property {string} mysteryFxEnd - on mystery fx hides
|
|
37
|
+
* @property {string} mysteryFxLoop - when mystery fx in visible in loop
|
|
38
|
+
* @property {string} line - default win line sound, for both single and multiple lines
|
|
39
|
+
* @property {string} mysteryDrawLoop - on show mystery popup, play during randomizing win
|
|
40
|
+
* @property {string} rollStop - single reel stopping
|
|
41
|
+
* @property {string} specialSymbolOnReel - single reel stopping with special symbol like bonus or mystery
|
|
42
|
+
* @property {string} start - on start spinning
|
|
43
|
+
* @property {string} symbol - on symbol click and show paytable popup
|
|
44
|
+
*/
|
|
45
|
+
export type GameSoundAssets = Record<SoundTrack, string> & Record<string, string>;
|
|
@@ -6,15 +6,15 @@ export const SoundTracks = {
|
|
|
6
6
|
reductionRate: "reductionRate",
|
|
7
7
|
allRollStops: "allRollStops",
|
|
8
8
|
bigWin: "bigWin",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
boom: "boom",
|
|
10
|
+
standaloneBoom: "standaloneBoom",
|
|
11
|
+
symbolsFalling: "symbolsFalling",
|
|
12
|
+
mysteryFxEnd: "mysteryFxEnd",
|
|
13
|
+
mysteryFxLoop: "mysteryFxLoop",
|
|
13
14
|
line: "line",
|
|
14
|
-
mystery: "mystery",
|
|
15
15
|
mysteryDrawLoop: "mysteryDrawLoop",
|
|
16
16
|
rollStop: "rollStop",
|
|
17
|
+
specialSymbolOnReel: "specialSymbolOnReel",
|
|
17
18
|
start: "start",
|
|
18
|
-
wild: "wild",
|
|
19
19
|
symbol: "symbol",
|
|
20
20
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SymbolReels } from "../../connectivity";
|
|
1
|
+
import { SymbolReels, TransformationDetails } from "../../connectivity";
|
|
2
2
|
import { ApiConfig } from "../ApiConfig";
|
|
3
3
|
import { AdaptedSpinResponse } from "./types";
|
|
4
4
|
import { WinScenarios } from "./WinScenarios";
|
|
@@ -8,12 +8,16 @@ export declare class SpinLogic {
|
|
|
8
8
|
private readonly _onStopBlindsConfiguration;
|
|
9
9
|
private readonly _finalBlindsConfiguration;
|
|
10
10
|
private readonly _availableFreeSpins;
|
|
11
|
+
private readonly _hasMysteryWin;
|
|
11
12
|
private readonly _winScenarios;
|
|
13
|
+
private readonly _standaloneTransformations;
|
|
12
14
|
constructor(spinConfig: AdaptedSpinResponse, gameConfig: ApiConfig);
|
|
13
15
|
get postSpinBalance(): number;
|
|
14
16
|
get winTotalAmount(): number;
|
|
15
17
|
get onStopBlindsConfiguration(): SymbolReels;
|
|
16
18
|
get finalBlindsConfiguration(): SymbolReels;
|
|
17
19
|
get availableFreeSpins(): number;
|
|
20
|
+
get hasMysteryWin(): boolean;
|
|
18
21
|
get winScenarios(): WinScenarios[];
|
|
22
|
+
get standaloneTransformations(): TransformationDetails[][];
|
|
19
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { logInfo } from "../../utils";
|
|
2
2
|
import { SpinLogicDTO } from "./SpinLogicDTO";
|
|
3
3
|
export class SpinLogic {
|
|
4
4
|
_postSpinBalance;
|
|
@@ -6,7 +6,9 @@ export class SpinLogic {
|
|
|
6
6
|
_onStopBlindsConfiguration;
|
|
7
7
|
_finalBlindsConfiguration;
|
|
8
8
|
_availableFreeSpins;
|
|
9
|
+
_hasMysteryWin;
|
|
9
10
|
_winScenarios;
|
|
11
|
+
_standaloneTransformations;
|
|
10
12
|
constructor(spinConfig, gameConfig) {
|
|
11
13
|
const spinLogicReader = new SpinLogicDTO(spinConfig, gameConfig);
|
|
12
14
|
this._postSpinBalance = spinLogicReader.updatedBalance;
|
|
@@ -14,8 +16,10 @@ export class SpinLogic {
|
|
|
14
16
|
this._onStopBlindsConfiguration = spinLogicReader.onStopBlindsConfiguration;
|
|
15
17
|
this._finalBlindsConfiguration = spinLogicReader.finalBlindsConfiguration;
|
|
16
18
|
this._availableFreeSpins = spinLogicReader.freeSpinsRemaining;
|
|
19
|
+
this._hasMysteryWin = spinLogicReader.hasMysteryWin;
|
|
17
20
|
this._winScenarios = spinLogicReader.winScenarios;
|
|
18
|
-
|
|
21
|
+
this._standaloneTransformations = spinLogicReader.standaloneTransformations;
|
|
22
|
+
logInfo("Spin logic", JSON.parse(JSON.stringify(this)));
|
|
19
23
|
}
|
|
20
24
|
get postSpinBalance() {
|
|
21
25
|
return this._postSpinBalance;
|
|
@@ -32,7 +36,13 @@ export class SpinLogic {
|
|
|
32
36
|
get availableFreeSpins() {
|
|
33
37
|
return this._availableFreeSpins;
|
|
34
38
|
}
|
|
39
|
+
get hasMysteryWin() {
|
|
40
|
+
return this._hasMysteryWin;
|
|
41
|
+
}
|
|
35
42
|
get winScenarios() {
|
|
36
43
|
return this._winScenarios;
|
|
37
44
|
}
|
|
45
|
+
get standaloneTransformations() {
|
|
46
|
+
return this._standaloneTransformations;
|
|
47
|
+
}
|
|
38
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SymbolReels } from "../../connectivity";
|
|
1
|
+
import { SymbolReels, TransformationDetails } from "../../connectivity";
|
|
2
2
|
import { ApiConfig } from "../ApiConfig";
|
|
3
3
|
import { AdaptedSpinResponse } from "./types";
|
|
4
4
|
import { WinScenarios } from "./WinScenarios";
|
|
@@ -12,6 +12,8 @@ export declare class SpinLogicDTO {
|
|
|
12
12
|
get finalBlindsConfiguration(): SymbolReels;
|
|
13
13
|
get onStopBlindsConfiguration(): SymbolReels;
|
|
14
14
|
get winScenarios(): WinScenarios[];
|
|
15
|
+
get standaloneTransformations(): TransformationDetails[][];
|
|
16
|
+
get hasMysteryWin(): boolean;
|
|
15
17
|
private getSingleWin;
|
|
16
18
|
private getWinsFromRawData;
|
|
17
19
|
private stringToSymbolId;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { invert } from "lodash";
|
|
2
1
|
import { PossibleWins } from "../../constants";
|
|
3
2
|
import { RainMan } from "../../Rainman";
|
|
4
3
|
import { WinScenarios } from "./WinScenarios";
|
|
@@ -48,6 +47,17 @@ export class SpinLogicDTO {
|
|
|
48
47
|
return new WinScenarios(win, result.transformations);
|
|
49
48
|
});
|
|
50
49
|
}
|
|
50
|
+
get standaloneTransformations() {
|
|
51
|
+
const { standaloneTransformations } = this.rawData;
|
|
52
|
+
if (!standaloneTransformations)
|
|
53
|
+
return [];
|
|
54
|
+
return standaloneTransformations;
|
|
55
|
+
}
|
|
56
|
+
get hasMysteryWin() {
|
|
57
|
+
return this.winScenarios.some((winScenario) => {
|
|
58
|
+
return winScenario.wins.some((win) => win.type === PossibleWins.mystery);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
51
61
|
getSingleWin(singleWin, availableFreeSpins) {
|
|
52
62
|
const rawWin = {
|
|
53
63
|
type: this.gameConfig.getWinId(singleWin.typeId),
|
|
@@ -57,7 +67,7 @@ export class SpinLogicDTO {
|
|
|
57
67
|
quantity: singleWin.quantity,
|
|
58
68
|
spinId: singleWin.spinId,
|
|
59
69
|
multiplier: singleWin.multiplier,
|
|
60
|
-
typeId: singleWin.typeId
|
|
70
|
+
typeId: singleWin.typeId,
|
|
61
71
|
};
|
|
62
72
|
if (rawWin.type === PossibleWins.freeSpins) {
|
|
63
73
|
const remainingFreeSpins = Math.max(RainMan.settingsStore.howManyFreeSpinsLeft - 1, 0);
|
|
@@ -69,6 +79,6 @@ export class SpinLogicDTO {
|
|
|
69
79
|
return rawData.wins.map((win) => this.getSingleWin(win, availableFreeSpins));
|
|
70
80
|
}
|
|
71
81
|
stringToSymbolId(symbol) {
|
|
72
|
-
return
|
|
82
|
+
return symbol;
|
|
73
83
|
}
|
|
74
84
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SpinDataInterface, SymbolReels, WinWithTransformationInterface } from "../../connectivity";
|
|
1
|
+
import { SpinDataInterface, SymbolReels, TransformationDetails, WinWithTransformationInterface } from "../../connectivity";
|
|
2
2
|
import { ApiConfig } from "../ApiConfig";
|
|
3
3
|
import { SpinLogic } from "./SpinLogic";
|
|
4
4
|
export type AdaptedSpinResponse = {
|
|
@@ -9,5 +9,6 @@ export type AdaptedSpinResponse = {
|
|
|
9
9
|
finalBlindsConfiguration: SymbolReels;
|
|
10
10
|
winAmountTotal: number;
|
|
11
11
|
results: WinWithTransformationInterface[];
|
|
12
|
+
standaloneTransformations: TransformationDetails[][];
|
|
12
13
|
};
|
|
13
14
|
export type SpinLogicFactory = (spinLogicResponse: SpinDataInterface, gameConfig: ApiConfig) => SpinLogic;
|
|
@@ -3,4 +3,4 @@ import { ApiConfig } from "../ApiConfig";
|
|
|
3
3
|
export declare const concatenateDestroyAndSetTransformations: (spinLogicResponse: SpinDataInterface, currentIndexOfRootTransformation: number, gameConfig: ApiConfig) => [DropTransformationDetails[], number];
|
|
4
4
|
export declare const mapSymbolIdsToSymbolNames: (symbols_on_reels: number[][], gameConfig: ApiConfig) => never[][];
|
|
5
5
|
export declare const isBlindsConfiguredByTransformations: (results: Result[]) => number[][] | null;
|
|
6
|
-
export declare const collectWinDetailsWithTransformation: (winIndex: string, winsDetails: RawWin, transformations: TransformationDetails[]) => WinWithTransformationInterface;
|
|
6
|
+
export declare const collectWinDetailsWithTransformation: (winIndex: string | null, winsDetails: RawWin, transformations: TransformationDetails[]) => WinWithTransformationInterface;
|
|
@@ -77,7 +77,7 @@ export const isBlindsConfiguredByTransformations = (results) => {
|
|
|
77
77
|
};
|
|
78
78
|
export const collectWinDetailsWithTransformation = (winIndex, winsDetails, transformations) => {
|
|
79
79
|
return {
|
|
80
|
-
wins: [getWinFromRawResponse(winsDetails, winIndex)],
|
|
80
|
+
wins: [getWinFromRawResponse(winsDetails, winIndex ?? "")],
|
|
81
81
|
transformations,
|
|
82
82
|
};
|
|
83
83
|
};
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { Container, Graphics,
|
|
1
|
+
import { Container, Graphics, Sprite } from "pixi.js";
|
|
2
2
|
import { ButtonsEventManager } from "../../application";
|
|
3
3
|
import { AbstractController } from "../../controllers";
|
|
4
4
|
import { Nullable } from "../../utils";
|
|
5
5
|
import { UpdatableSpineContainer } from "../../winComponents";
|
|
6
6
|
import { AbstractFreeSpinContainer } from "../AbstractFreeSpinContainer";
|
|
7
|
-
import {
|
|
8
|
-
import { Background, Logo, ResponsiveContainer } from "../common";
|
|
7
|
+
import { LeftButtons, LeftButtonsLandscape, LeftButtonsMobile, MiddleButtons, RightButtons, RightButtonsLandscape, RightButtonsMobile } from "../buttons";
|
|
8
|
+
import { AnimatedBackground, Background, FreeSpinBox, Logo, ResponsiveContainer } from "../common";
|
|
9
9
|
import { AbstractFrame } from "../frame";
|
|
10
10
|
import { MessageBox } from "../messageBox";
|
|
11
11
|
export declare abstract class AbstractMainContainer extends Container {
|
|
12
12
|
static readonly registryName = "mainContainer";
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
protected bigWinContainer: Nullable<UpdatableSpineContainer>;
|
|
14
|
+
protected mysteryWinContainer: Nullable<UpdatableSpineContainer>;
|
|
15
15
|
private overlay;
|
|
16
16
|
messageBox: MessageBox;
|
|
17
17
|
protected readonly buttonsEventManager: ButtonsEventManager;
|
|
18
18
|
protected logo: Nullable<Logo>;
|
|
19
|
-
protected
|
|
19
|
+
protected background: Nullable<Background>;
|
|
20
|
+
protected animatedBackground: Nullable<AnimatedBackground>;
|
|
21
|
+
protected abstract freeSpinBox: Nullable<FreeSpinBox>;
|
|
20
22
|
protected underFramePanel: Nullable<Graphics>;
|
|
21
|
-
protected portraitPlayButtons: Nullable<
|
|
22
|
-
protected landscapePlayButtons: Nullable<
|
|
23
|
+
protected portraitPlayButtons: Nullable<MiddleButtons>;
|
|
24
|
+
protected landscapePlayButtons: Nullable<MiddleButtons>;
|
|
23
25
|
protected abstract leftButtons: ResponsiveContainer;
|
|
24
26
|
protected abstract rightButtons: ResponsiveContainer;
|
|
25
27
|
protected abstract bottomPanel: Sprite;
|
|
@@ -29,7 +31,7 @@ export declare abstract class AbstractMainContainer extends Container {
|
|
|
29
31
|
private _mysteryWinInvokedAt;
|
|
30
32
|
protected abstract _frame: AbstractFrame;
|
|
31
33
|
protected _controller: Nullable<AbstractController>;
|
|
32
|
-
protected constructor(
|
|
34
|
+
protected constructor();
|
|
33
35
|
get freeSpinPlate(): Nullable<AbstractFreeSpinContainer>;
|
|
34
36
|
get freeSpinSummary(): Nullable<AbstractFreeSpinContainer>;
|
|
35
37
|
protected abstract createFreeSpinPlate(resolver: () => void, freeSpinCount: number, isAdditionalFreeSpin: boolean): AbstractFreeSpinContainer;
|
|
@@ -48,20 +50,20 @@ export declare abstract class AbstractMainContainer extends Container {
|
|
|
48
50
|
destroyBigWin(): void;
|
|
49
51
|
destroyMysteryWin(): void;
|
|
50
52
|
invokeGambleGame(): void;
|
|
51
|
-
protected abstract createPortraitPlayButtons(): AbstractMiddleButtons;
|
|
52
53
|
enableForMobile(): void;
|
|
53
|
-
protected abstract createLandscapePlayButtons(): AbstractMiddleButtons;
|
|
54
54
|
enableForLandscape(): void;
|
|
55
55
|
disableForMobile(): void;
|
|
56
56
|
disableForLandscape(): void;
|
|
57
57
|
protected abstract repositionComponentsForScreenRatio(): void;
|
|
58
58
|
resize(): void;
|
|
59
|
-
protected
|
|
60
|
-
protected
|
|
61
|
-
protected
|
|
62
|
-
protected
|
|
63
|
-
protected
|
|
64
|
-
protected
|
|
59
|
+
protected createLeftButtons(): LeftButtons;
|
|
60
|
+
protected createRightButtons(): RightButtons;
|
|
61
|
+
protected createLeftButtonsMobile(): LeftButtonsMobile;
|
|
62
|
+
protected createRightButtonsMobile(): RightButtonsMobile;
|
|
63
|
+
protected createLeftButtonsLandscape(): LeftButtonsLandscape;
|
|
64
|
+
protected createRightButtonsLandscape(): RightButtonsLandscape;
|
|
65
|
+
protected createPortraitPlayButtons(): MiddleButtons;
|
|
66
|
+
protected createLandscapePlayButtons(): MiddleButtons;
|
|
65
67
|
private initComponentsForScreenRatio;
|
|
66
68
|
private resizeDependentComponents;
|
|
67
69
|
protected refreshLayers(): void;
|