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.
Files changed (118) hide show
  1. package/dist/Rainman/appConfig.js +1 -0
  2. package/dist/Rainman/types.d.ts +1 -0
  3. package/dist/SettingsUI/components/SlidingSwitch/index.jsx +1 -1
  4. package/dist/SettingsUI/components/VolumeSettings/index.jsx +14 -23
  5. package/dist/application/ApiConfig/ApiConfig.js +2 -2
  6. package/dist/application/ApiConfig/SymbolId.d.ts +1 -1
  7. package/dist/application/ButtonsEventManager/ButtonsEventManager.js +1 -1
  8. package/dist/application/SoundManager/SoundManager.d.ts +1 -1
  9. package/dist/application/SoundManager/SoundManager.js +19 -14
  10. package/dist/application/SoundManager/types.d.ts +45 -21
  11. package/dist/application/SoundManager/types.js +6 -6
  12. package/dist/application/SpinLogic/SpinLogic.d.ts +5 -1
  13. package/dist/application/SpinLogic/SpinLogic.js +12 -2
  14. package/dist/application/SpinLogic/SpinLogicDTO.d.ts +3 -1
  15. package/dist/application/SpinLogic/SpinLogicDTO.js +13 -3
  16. package/dist/application/SpinLogic/types.d.ts +2 -1
  17. package/dist/application/SpinLogic/util.d.ts +1 -1
  18. package/dist/application/SpinLogic/util.js +1 -1
  19. package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +19 -17
  20. package/dist/components/AbstractMainContainer/AbstractMainContainer.js +53 -15
  21. package/dist/components/GambleGame/GambleGame.d.ts +26 -0
  22. package/dist/components/GambleGame/GambleGame.js +156 -0
  23. package/dist/components/GambleGame/index.d.ts +2 -0
  24. package/dist/components/GambleGame/index.js +2 -0
  25. package/dist/components/GambleGame/types.d.ts +7 -0
  26. package/dist/components/GambleGame/types.js +1 -0
  27. package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +13 -0
  28. package/dist/components/buttons/buttonGroups/LeftButtons.js +41 -0
  29. package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.d.ts +9 -0
  30. package/dist/components/buttons/buttonGroups/LeftButtonsLandscape.js +29 -0
  31. package/dist/components/buttons/buttonGroups/{AbstractLeftButtonsMobile.d.ts → LeftButtonsMobile.d.ts} +5 -4
  32. package/dist/components/buttons/buttonGroups/LeftButtonsMobile.js +34 -0
  33. package/dist/components/buttons/buttonGroups/{AbstractMiddleButtons.d.ts → MiddleButtons.d.ts} +6 -3
  34. package/dist/components/buttons/buttonGroups/MiddleButtons.js +68 -0
  35. package/dist/components/buttons/buttonGroups/{AbstractRightButtons.d.ts → RightButtons.d.ts} +3 -2
  36. package/dist/components/buttons/buttonGroups/{AbstractRightButtons.js → RightButtons.js} +11 -7
  37. package/dist/components/buttons/buttonGroups/{AbstractRightButtonsLandscape.d.ts → RightButtonsLandscape.d.ts} +3 -2
  38. package/dist/components/buttons/buttonGroups/RightButtonsLandscape.js +51 -0
  39. package/dist/components/buttons/buttonGroups/{AbstractRightButtonsMobile.d.ts → RightButtonsMobile.d.ts} +5 -4
  40. package/dist/components/buttons/buttonGroups/RightButtonsMobile.js +39 -0
  41. package/dist/components/buttons/buttonGroups/constants.d.ts +4 -0
  42. package/dist/components/buttons/buttonGroups/constants.js +4 -0
  43. package/dist/components/buttons/buttonGroups/index.d.ts +7 -7
  44. package/dist/components/buttons/buttonGroups/index.js +7 -7
  45. package/dist/components/buttons/default/BlackButton.d.ts +5 -0
  46. package/dist/components/buttons/default/BlackButton.js +13 -0
  47. package/dist/components/buttons/default/CollectButton.d.ts +5 -0
  48. package/dist/components/buttons/default/CollectButton.js +13 -0
  49. package/dist/components/buttons/default/RedButton.d.ts +5 -0
  50. package/dist/components/buttons/default/RedButton.js +13 -0
  51. package/dist/components/buttons/default/VolumeButton.js +2 -3
  52. package/dist/components/buttons/default/index.d.ts +3 -0
  53. package/dist/components/buttons/default/index.js +3 -0
  54. package/dist/components/common/AnimatedBackground.d.ts +14 -0
  55. package/dist/components/common/AnimatedBackground.js +46 -0
  56. package/dist/components/common/FreeSpinBox.d.ts +10 -2
  57. package/dist/components/common/FreeSpinBox.js +32 -6
  58. package/dist/components/common/index.d.ts +1 -0
  59. package/dist/components/common/index.js +1 -0
  60. package/dist/components/dictionary/locales/en.json +9 -1
  61. package/dist/components/frame/AbstractColumnsContainer.d.ts +2 -2
  62. package/dist/components/frame/AbstractColumnsContainer.js +24 -2
  63. package/dist/components/frame/AbstractFrame.d.ts +1 -2
  64. package/dist/components/frame/AbstractFrame.js +5 -11
  65. package/dist/components/index.d.ts +1 -0
  66. package/dist/components/index.js +1 -0
  67. package/dist/components/messageBox/MessageBox.d.ts +2 -2
  68. package/dist/components/messageBox/MessageBox.js +29 -9
  69. package/dist/components/symbols/AbstractSymbolBase.d.ts +7 -5
  70. package/dist/components/symbols/AbstractSymbolBase.js +12 -7
  71. package/dist/components/symbols/AbstractSymbolsColumn.d.ts +2 -2
  72. package/dist/components/symbols/AbstractSymbolsColumn.js +7 -5
  73. package/dist/components/symbols/DroppableSymbolsColumn.d.ts +1 -1
  74. package/dist/components/symbols/DroppableSymbolsColumn.js +2 -2
  75. package/dist/components/updatable/GambleUpdatableText.d.ts +6 -0
  76. package/dist/components/updatable/GambleUpdatableText.js +35 -0
  77. package/dist/components/updatable/StylefulUpdatableText.js +2 -2
  78. package/dist/components/updatable/UpdatableValueComponent.d.ts +7 -4
  79. package/dist/components/updatable/index.d.ts +1 -0
  80. package/dist/components/updatable/index.js +1 -0
  81. package/dist/connectivity/ConnectionWrapper.d.ts +4 -1
  82. package/dist/connectivity/ConnectionWrapper.js +22 -5
  83. package/dist/connectivity/apiQueue.js +2 -2
  84. package/dist/connectivity/serverData.d.ts +1 -1
  85. package/dist/connectivity/wins.d.ts +7 -1
  86. package/dist/constants/gamble.d.ts +9 -0
  87. package/dist/constants/gamble.js +14 -0
  88. package/dist/constants/index.d.ts +1 -0
  89. package/dist/constants/index.js +1 -0
  90. package/dist/constants/wins.d.ts +13 -6
  91. package/dist/constants/wins.js +13 -6
  92. package/dist/controllers/AbstractController.d.ts +1 -1
  93. package/dist/controllers/AbstractController.js +10 -8
  94. package/dist/controllers/UiController.d.ts +2 -0
  95. package/dist/controllers/UiController.js +5 -0
  96. package/dist/localStorage/localStorage.d.ts +3 -0
  97. package/dist/localStorage/localStorage.js +6 -1
  98. package/dist/stores/SettingsStore.d.ts +4 -4
  99. package/dist/stores/SettingsStore.js +51 -20
  100. package/dist/utils/common/functions.d.ts +0 -1
  101. package/dist/utils/common/functions.js +0 -3
  102. package/dist/utils/common/logger.d.ts +5 -4
  103. package/dist/utils/common/logger.js +2 -1
  104. package/dist/utils/common/placementHelpers.d.ts +2 -1
  105. package/dist/utils/common/placementHelpers.js +3 -2
  106. package/dist/winComponents/UpdatableSpineContainer.d.ts +3 -2
  107. package/dist/winComponents/UpdatableSpineContainer.js +9 -9
  108. package/dist/winComponents/winFactory.d.ts +1 -1
  109. package/dist/winComponents/winFactory.js +14 -1
  110. package/package.json +1 -1
  111. package/dist/components/buttons/buttonGroups/AbstractLeftButtons.d.ts +0 -13
  112. package/dist/components/buttons/buttonGroups/AbstractLeftButtons.js +0 -33
  113. package/dist/components/buttons/buttonGroups/AbstractLeftButtonsLandscape.d.ts +0 -8
  114. package/dist/components/buttons/buttonGroups/AbstractLeftButtonsLandscape.js +0 -14
  115. package/dist/components/buttons/buttonGroups/AbstractLeftButtonsMobile.js +0 -21
  116. package/dist/components/buttons/buttonGroups/AbstractMiddleButtons.js +0 -26
  117. package/dist/components/buttons/buttonGroups/AbstractRightButtonsLandscape.js +0 -32
  118. package/dist/components/buttons/buttonGroups/AbstractRightButtonsMobile.js +0 -23
@@ -6,6 +6,7 @@ export const defaultAppConfig = {
6
6
  idleTimeout: 10000,
7
7
  fontSize: 35,
8
8
  mobileFontSize: 45,
9
+ updatableSpineContainerFontSize: 50,
9
10
  fontColor: new Color(0xfbd400).toHex(),
10
11
  updatableTextValueColor: new Color(0xffffff).toHex(),
11
12
  fontFace: "HelveticaNeueLTStd",
@@ -14,6 +14,7 @@ export type OptionalAppConfig = {
14
14
  idleTimeout: number;
15
15
  currency: Currency;
16
16
  fontSize: number;
17
+ updatableSpineContainerFontSize: number;
17
18
  mobileFontSize: number;
18
19
  fontColor: string;
19
20
  updatableTextValueColor: string;
@@ -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" defaultChecked={flag} onChange={(event) => setFlag(event.target.checked)}/>
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.setIsSoundEnabled(newVolumeLevel > 0);
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={settingStore.volumeLevel === 0
18
- ? {
19
- backgroundColor: "#FA5F27",
20
- borderColor: "#FA5F27",
21
- ...handleStyle,
22
- }
23
- : {
24
- backgroundColor: "#2FC408",
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: "#fff",
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={settingStore.volumeLevel === 0
37
- ? {
38
- color: "#FA5F27",
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 { debug } from "../../utils";
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
- debug(`🛑 "${name}" was not found in SymbolIds enum!`);
76
+ logError(`🛑 "${name}" was not found in SymbolIds enum!`);
77
77
  }
78
78
  this.symbolMap.set(backendId, name);
79
79
  }
@@ -1,3 +1,3 @@
1
1
  export interface SymbolIds {
2
2
  }
3
- export type SymbolId = keyof SymbolIds;
3
+ export type SymbolId = SymbolIds[keyof SymbolIds];
@@ -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.setIsSoundEnabled(!RainMan.settingsStore.isSoundEnabled);
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
- setFxSoundsVolume(volumeLevel: number): void;
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.bonusWaitingLoop, SoundTracks.music];
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
- const loadingPromise = new Promise((resolve) => {
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
- loaded: () => {
32
- resolve();
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
- setFxSoundsVolume(volumeLevel) {
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.volume = volumeLevel;
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 (!RainMan.settingsStore.isSoundEnabled)
58
- return;
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
- sound.loop = soundsToLoop.includes(soundName);
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
- readonly button: "button";
3
- readonly deactivationAutostart: "deactivationAutostart";
4
- readonly increaseRate: "increaseRate";
5
- readonly music: "music";
6
- readonly reductionRate: "reductionRate";
7
- readonly allRollStops: "allRollStops";
8
- readonly bigWin: "bigWin";
9
- readonly bonus: "bonus";
10
- readonly bonusExtra: "bonusExtra";
11
- readonly bonusWaitingEnd: "bonusWaitingEnd";
12
- readonly bonusWaitingLoop: "bonusWaitingLoop";
13
- readonly line: "line";
14
- readonly mystery: "mystery";
15
- readonly mysteryDrawLoop: "mysteryDrawLoop";
16
- readonly rollStop: "rollStop";
17
- readonly start: "start";
18
- readonly wild: "wild";
19
- readonly symbol: "symbol";
20
- };
21
- export type SoundTrack = (typeof SoundTracks)[keyof typeof SoundTracks];
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
- bonus: "bonus",
10
- bonusExtra: "bonusExtra",
11
- bonusWaitingEnd: "bonusWaitingEnd",
12
- bonusWaitingLoop: "bonusWaitingLoop",
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 { debug } from "../../utils";
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
- debug(JSON.stringify(this));
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 invert(RainMan.symbolIds)[symbol];
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, ITextStyle, Sprite } from "pixi.js";
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 { AbstractMiddleButtons } from "../buttons";
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
- private bigWinContainer;
14
- private mysteryWinContainer;
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 abstract background: Background;
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<AbstractMiddleButtons>;
22
- protected landscapePlayButtons: Nullable<AbstractMiddleButtons>;
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(messageBoxTextStyle: Partial<ITextStyle>);
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 abstract createLeftButtons(): ResponsiveContainer;
60
- protected abstract createRightButtons(): ResponsiveContainer;
61
- protected abstract createLeftButtonsMobile(): ResponsiveContainer;
62
- protected abstract createRightButtonsMobile(): ResponsiveContainer;
63
- protected abstract createLeftButtonsLandscape(): ResponsiveContainer;
64
- protected abstract createRightButtonsLandscape(): ResponsiveContainer;
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;