pixi-rainman-game-engine 0.1.8 → 0.1.10

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 (72) hide show
  1. package/dist/DescribedPlayableAction/DescribedPlayableAction.d.ts +3 -2
  2. package/dist/DescribedPlayableAction/DescribedPlayableAction.js +3 -1
  3. package/dist/Money/MoneyText.js +2 -2
  4. package/dist/Rainman/Rainman.d.ts +2 -3
  5. package/dist/Rainman/Rainman.js +4 -2
  6. package/dist/Rainman/appConfig.js +2 -1
  7. package/dist/Rainman/types.d.ts +11 -1
  8. package/dist/SettingsUI/components/OptionButton/index.jsx +2 -0
  9. package/dist/SettingsUI/index.css +1 -1
  10. package/dist/application/ApiConfig/ApiConfig.d.ts +14 -4
  11. package/dist/application/ApiConfig/ApiConfig.js +30 -7
  12. package/dist/application/SoundManager/types.d.ts +1 -1
  13. package/dist/application/SpinLogic/SpinLogic.d.ts +4 -1
  14. package/dist/application/SpinLogic/SpinLogic.js +10 -0
  15. package/dist/application/SpinLogic/SpinLogicDTO.d.ts +1 -0
  16. package/dist/application/SpinLogic/SpinLogicDTO.js +4 -1
  17. package/dist/application/SpinLogic/types.d.ts +2 -1
  18. package/dist/application/SpinLogic/util.d.ts +2 -3
  19. package/dist/application/SpinLogic/util.js +5 -8
  20. package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.d.ts +3 -2
  21. package/dist/components/AbstractFreeSpinContainer/AbstractFreeSpinContainer.js +1 -0
  22. package/dist/components/AbstractMainContainer/AbstractMainContainer.d.ts +9 -6
  23. package/dist/components/AbstractMainContainer/AbstractMainContainer.js +42 -5
  24. package/dist/components/GambleGame/GambleGame.js +6 -5
  25. package/dist/components/buttons/buttonGroups/LeftButtons.d.ts +1 -1
  26. package/dist/components/buttons/buttonGroups/LeftButtons.js +3 -3
  27. package/dist/components/buttons/default/AutoplayButton.js +4 -1
  28. package/dist/components/common/AnimatedBackground.js +2 -0
  29. package/dist/components/common/FreeSpinBox.js +2 -1
  30. package/dist/components/common/Logo.d.ts +7 -1
  31. package/dist/components/common/Logo.js +27 -13
  32. package/dist/components/common/LogoStatic.d.ts +2 -1
  33. package/dist/components/common/LogoStatic.js +4 -2
  34. package/dist/components/dictionary/locales/en.json +1 -1
  35. package/dist/components/frame/AbstractColumnsContainer.d.ts +4 -2
  36. package/dist/components/frame/AbstractColumnsContainer.js +6 -3
  37. package/dist/components/frame/AbstractFrame.d.ts +4 -3
  38. package/dist/components/frame/AbstractFrame.js +16 -3
  39. package/dist/components/frame/WinLineAnimation.js +3 -0
  40. package/dist/components/messageBox/MessageBox.js +1 -0
  41. package/dist/components/symbols/AbstractSymbolBase.d.ts +2 -2
  42. package/dist/components/symbols/AbstractSymbolBase.js +1 -1
  43. package/dist/components/symbols/AbstractSymbolsColumn.d.ts +3 -3
  44. package/dist/components/symbols/AbstractSymbolsColumn.js +5 -2
  45. package/dist/components/updatable/GambleUpdatableText.js +1 -1
  46. package/dist/components/updatable/UpdatableTextComponent.js +11 -2
  47. package/dist/components/updatable/UpdatableValueComponent.d.ts +1 -0
  48. package/dist/components/updatable/UpdatableValueComponent.js +3 -0
  49. package/dist/components/winLineIndicator/WinLineIndicator.js +3 -1
  50. package/dist/connectivity/ConnectionWrapper.d.ts +3 -1
  51. package/dist/connectivity/ConnectionWrapper.js +9 -4
  52. package/dist/connectivity/LocalConnectionWrapper.d.ts +1 -0
  53. package/dist/connectivity/LocalConnectionWrapper.js +5 -1
  54. package/dist/connectivity/serverConnection.d.ts +1 -0
  55. package/dist/connectivity/serverData.d.ts +4 -1
  56. package/dist/connectivity/spinData.js +2 -2
  57. package/dist/connectivity/transformation.d.ts +2 -2
  58. package/dist/connectivity/wins.d.ts +18 -2
  59. package/dist/constants/gamble.d.ts +2 -2
  60. package/dist/constants/gamble.js +3 -3
  61. package/dist/controllers/AbstractController.d.ts +10 -6
  62. package/dist/controllers/AbstractController.js +26 -10
  63. package/dist/loading/AbstractLoadingContainer.d.ts +1 -1
  64. package/dist/loading/AbstractLoadingContainer.js +7 -0
  65. package/dist/stores/SettingsStore.js +9 -4
  66. package/dist/utils/common/functions.d.ts +3 -0
  67. package/dist/utils/common/functions.js +6 -0
  68. package/dist/winComponents/UpdatableSpineContainer.d.ts +3 -3
  69. package/dist/winComponents/UpdatableSpineContainer.js +1 -1
  70. package/dist/winComponents/winFactory.d.ts +1 -1
  71. package/dist/winComponents/winFactory.js +3 -3
  72. package/package.json +1 -1
@@ -1,8 +1,9 @@
1
1
  import { Nullable, PlayableAction } from "../utils";
2
- export declare class DescribedPlayableAction<T = number> {
2
+ export declare class DescribedPlayableAction<T> {
3
3
  readonly type: T;
4
4
  action: PlayableAction;
5
5
  winAmount: Nullable<number>;
6
+ skipLooping: boolean;
6
7
  isFirstStreak: boolean;
7
- constructor(type: T, action: PlayableAction, winAmount?: Nullable<number>);
8
+ constructor(type: T, action: PlayableAction, winAmount?: Nullable<number>, skipLooping?: boolean);
8
9
  }
@@ -2,10 +2,12 @@ export class DescribedPlayableAction {
2
2
  type;
3
3
  action;
4
4
  winAmount;
5
+ skipLooping;
5
6
  isFirstStreak = false;
6
- constructor(type, action, winAmount = null) {
7
+ constructor(type, action, winAmount = null, skipLooping = false) {
7
8
  this.type = type;
8
9
  this.action = action;
9
10
  this.winAmount = winAmount;
11
+ this.skipLooping = skipLooping;
10
12
  }
11
13
  }
@@ -10,9 +10,9 @@ import { RainMan } from "../Rainman";
10
10
  export class MoneyText {
11
11
  money;
12
12
  constructor(amount) {
13
- this.money = Money.fromDecimal(amount, RainMan.currency, Math.round);
13
+ this.money = Money.fromDecimal(amount, RainMan.globals.currency, Math.round);
14
14
  }
15
15
  toString() {
16
- return `${this.money} ${RainMan.currency.symbol_native}`;
16
+ return `${this.money} ${RainMan.globals.currency.symbol_native}`;
17
17
  }
18
18
  }
@@ -1,10 +1,9 @@
1
1
  import "../components/dictionary/i18n";
2
2
  import { Application } from "pixi.js";
3
- import { Currency } from "ts-money";
4
3
  import { SpinLogicFactory, SymbolIds, WinTypeIds } from "../application";
5
4
  import { ComponentRegistry } from "../ComponentRegistry";
6
5
  import { SettingsStore } from "../stores";
7
- import { AppConfig, OptionalAppConfig, RequiredAppConfig } from "./types";
6
+ import { AppConfig, Globals, OptionalAppConfig, RequiredAppConfig } from "./types";
8
7
  export declare class RainMan {
9
8
  static app: Application;
10
9
  static config: RequiredAppConfig & OptionalAppConfig;
@@ -13,6 +12,6 @@ export declare class RainMan {
13
12
  static settingsStore: SettingsStore;
14
13
  static componentRegistry: ComponentRegistry;
15
14
  static spinLogicFactory: SpinLogicFactory;
16
- static currency: Currency;
15
+ static globals: Globals;
17
16
  constructor(app: Application, config: AppConfig, symbolIds: SymbolIds, winTypeIds: WinTypeIds, spinLogicFactory: SpinLogicFactory);
18
17
  }
@@ -12,7 +12,7 @@ export class RainMan {
12
12
  static settingsStore;
13
13
  static componentRegistry;
14
14
  static spinLogicFactory;
15
- static currency;
15
+ static globals;
16
16
  constructor(app, config, symbolIds, winTypeIds, spinLogicFactory) {
17
17
  RainMan.app = app;
18
18
  RainMan.config = merge(defaultAppConfig, config);
@@ -21,6 +21,8 @@ export class RainMan {
21
21
  RainMan.settingsStore = settingStore;
22
22
  RainMan.componentRegistry = new ComponentRegistry(app);
23
23
  RainMan.spinLogicFactory = spinLogicFactory;
24
- RainMan.currency = Currencies["USD"];
24
+ RainMan.globals = {
25
+ currency: Currencies["USD"],
26
+ };
25
27
  }
26
28
  }
@@ -12,9 +12,9 @@ export const defaultAppConfig = {
12
12
  fontSize: 35,
13
13
  mobileFontSize: 45,
14
14
  updatableSpineContainerFontSize: 50,
15
- fontColor: new Color(0xfbd400).toHex(),
16
15
  updatableTextValueColor: new Color(0xffffff).toHex(),
17
16
  fontFace: ["HelveticaNeueLTStd"],
17
+ winLineIndicatorSymbolScale: 0.75,
18
18
  durationOfActions: {
19
19
  eachColumnsSpinDelay: [0, 200, 700, 1200, 1800],
20
20
  spinBaseTime: 800,
@@ -43,5 +43,6 @@ export const defaultAppConfig = {
43
43
  },
44
44
  constants: {
45
45
  bigWinMultiplier: 30,
46
+ bigWinTextOffset: 0,
46
47
  },
47
48
  };
@@ -1,3 +1,4 @@
1
+ import { Currency } from "ts-money";
1
2
  import { DeepPartial } from "../utils";
2
3
  export type RequiredAppConfig = {
3
4
  websocketUrl: string;
@@ -6,6 +7,8 @@ export type RequiredAppConfig = {
6
7
  gameInitReference: string;
7
8
  numberOfColumns: number;
8
9
  numberOfRows: number;
10
+ fontColor: string;
11
+ autoplayGlowColor: number;
9
12
  };
10
13
  export type OptionalAppConfig = {
11
14
  gameWidth: number;
@@ -14,9 +17,11 @@ export type OptionalAppConfig = {
14
17
  fontSize: number;
15
18
  updatableSpineContainerFontSize: number;
16
19
  mobileFontSize: number;
17
- fontColor: string;
20
+ mobileFontColor?: string;
18
21
  updatableTextValueColor: string;
19
22
  fontFace: string[];
23
+ mobileFontFace?: string[];
24
+ winLineIndicatorSymbolScale: number;
20
25
  durationOfActions: {
21
26
  eachColumnsSpinDelay: number[];
22
27
  spinBaseTime: number;
@@ -45,6 +50,11 @@ export type OptionalAppConfig = {
45
50
  };
46
51
  constants: {
47
52
  bigWinMultiplier: number;
53
+ bigWinTextOffset: number;
48
54
  };
49
55
  };
50
56
  export type AppConfig = RequiredAppConfig & DeepPartial<OptionalAppConfig>;
57
+ export interface Globals {
58
+ currency: Currency;
59
+ throttledSpin?: () => void;
60
+ }
@@ -1,6 +1,7 @@
1
1
  import i18next from "i18next";
2
2
  import { upperFirst } from "lodash";
3
3
  import React from "react";
4
+ import { RainMan } from "../../../Rainman";
4
5
  import { UI_ITEMS } from "../../../utils";
5
6
  import { useStores } from "../../hooks";
6
7
  import { closeModal } from "../CloseModalButton";
@@ -22,6 +23,7 @@ export const OptionButton = ({ option, currency, setMessage }) => {
22
23
  settingStore.setIsFreeSpinBought(true, data);
23
24
  settingStore.setRoundNumber(data.getRawData().round_number);
24
25
  settingStore.setFreeSpinNumberBought(option.amount);
26
+ RainMan.globals.throttledSpin?.();
25
27
  closeModal(UI_ITEMS.freeSpin);
26
28
  }
27
29
  catch (err) {
@@ -131,7 +131,7 @@ body {
131
131
  position: fixed;
132
132
  width: 100%;
133
133
  height: 100%;
134
- background: url("../assets/images/swipe-up.png") no-repeat 50% 50%;
134
+ background: url("../assets/images/materials/swipe-up.png") no-repeat 50% 50%;
135
135
  background-size: 150px;
136
136
  animation: iosAnimMove 1.5s ease-out infinite;
137
137
  }
@@ -1,4 +1,5 @@
1
- import { InitDataInterface } from "../../connectivity";
1
+ import { InitDataInterface, SpinDataInterface } from "../../connectivity";
2
+ import { AdaptedSpinResponse } from "../SpinLogic";
2
3
  import { SymbolId } from "./SymbolId";
3
4
  import { TransformationTypeId } from "./TransformationTypesId";
4
5
  import { WinTypeId } from "./WinTypeId";
@@ -22,14 +23,23 @@ export declare class ApiConfig {
22
23
  * @param {InitDataInterface} data
23
24
  */
24
25
  constructor(data: InitDataInterface);
26
+ /**
27
+ * Function to generate metadata for a particular spin
28
+ *
29
+ * @public
30
+ * @param {SpinDataInterface} spinLogicResponse
31
+ * @returns AdaptedSpinResponse without results and standalone results, these should be created in each game
32
+ */
33
+ generateMetadata(spinLogicResponse: SpinDataInterface): Omit<AdaptedSpinResponse, "results" | "standaloneTransformations">;
25
34
  /**
26
35
  * Getter for win line number
27
36
  *
28
37
  * @public
29
38
  * @param winLineAnimationName
39
+ * @param defaultNumber
30
40
  * @returns {string | number}
31
41
  */
32
- getWinLineNumber(winLineAnimationName: string): number | string;
42
+ getWinLineNumber(winLineAnimationName: string, defaultNumber?: string): number | string;
33
43
  /**
34
44
  * Function for getting next bet from config
35
45
  *
@@ -91,9 +101,9 @@ export declare class ApiConfig {
91
101
  *
92
102
  * @public
93
103
  * @param {number[][]} symbols_on_reels
94
- * @returns {SymbolId[]}
104
+ * @returns {SymbolId[][]}
95
105
  */
96
- mapSymbolIdsToSymbolNames(symbols_on_reels: number[][]): SymbolId[];
106
+ mapSymbolIdsToSymbolNames(symbols_on_reels: number[][]): SymbolId[][];
97
107
  /**
98
108
  * Getter for bet that placed in current position
99
109
  *
@@ -1,5 +1,6 @@
1
1
  import { RainMan } from "../../Rainman";
2
2
  import { logError } from "../../utils";
3
+ import { isBlindsConfiguredByTransformations } from "../SpinLogic";
3
4
  /**
4
5
  * Class representing config for connection to API
5
6
  *
@@ -30,15 +31,39 @@ export class ApiConfig {
30
31
  this.initStreakMap(data);
31
32
  this.initTransformationMap(data);
32
33
  }
34
+ /**
35
+ * Function to generate metadata for a particular spin
36
+ *
37
+ * @public
38
+ * @param {SpinDataInterface} spinLogicResponse
39
+ * @returns AdaptedSpinResponse without results and standalone results, these should be created in each game
40
+ */
41
+ generateMetadata(spinLogicResponse) {
42
+ const blindsConfiguredByResponse = this.mapSymbolIdsToSymbolNames(spinLogicResponse.symbols_on_reels);
43
+ const blindsConfiguredByTransformation = isBlindsConfiguredByTransformations(spinLogicResponse.results);
44
+ const finalSpinPositionOnReels = blindsConfiguredByTransformation !== null
45
+ ? this.mapSymbolIdsToSymbolNames(blindsConfiguredByTransformation)
46
+ : blindsConfiguredByResponse;
47
+ return {
48
+ action: spinLogicResponse.action,
49
+ balance: spinLogicResponse.balance,
50
+ availableFreeSpins: spinLogicResponse.available_free_spins,
51
+ symbolsOnReels: blindsConfiguredByResponse,
52
+ finalBlindsConfiguration: finalSpinPositionOnReels,
53
+ winAmountTotal: spinLogicResponse.win_amount_total,
54
+ extraData: spinLogicResponse.extra_data,
55
+ };
56
+ }
33
57
  /**
34
58
  * Getter for win line number
35
59
  *
36
60
  * @public
37
61
  * @param winLineAnimationName
62
+ * @param defaultNumber
38
63
  * @returns {string | number}
39
64
  */
40
- getWinLineNumber(winLineAnimationName) {
41
- return this.streakMap.get(winLineAnimationName) ?? "unknown";
65
+ getWinLineNumber(winLineAnimationName, defaultNumber = "unknown") {
66
+ return this.streakMap.get(winLineAnimationName) ?? defaultNumber;
42
67
  }
43
68
  /**
44
69
  * Function for getting next bet from config
@@ -129,14 +154,12 @@ export class ApiConfig {
129
154
  *
130
155
  * @public
131
156
  * @param {number[][]} symbols_on_reels
132
- * @returns {SymbolId[]}
157
+ * @returns {SymbolId[][]}
133
158
  */
134
159
  mapSymbolIdsToSymbolNames(symbols_on_reels) {
135
- return symbols_on_reels
136
- .map((reel) => {
160
+ return symbols_on_reels.map((reel) => {
137
161
  return reel.map((symbolId) => this.getSymbolId(symbolId));
138
- })
139
- .flat();
162
+ });
140
163
  }
141
164
  /**
142
165
  * Getter for bet that placed in current position
@@ -42,5 +42,5 @@ export type SoundTrack = SoundTracks[keyof SoundTracks];
42
42
  * @property {string} start - on start spinning
43
43
  * @property {string} symbol - on symbol click and show paytable popup
44
44
  */
45
- export type GameSoundAssets = Record<SoundTrack, string> & Record<string, string>;
45
+ export type GameSoundAssets = Record<SoundTrack, string>;
46
46
  export type SoundOverrides = Partial<Record<SoundTrack, SoundTrack>>;
@@ -1,4 +1,4 @@
1
- import { SymbolReels, TransformationDetails } from "../../connectivity";
1
+ import { ExtraData, SymbolReels, TransformationDetails } from "../../connectivity";
2
2
  import { ApiConfig } from "../ApiConfig";
3
3
  import { AdaptedSpinResponse } from "./types";
4
4
  import { WinScenarios } from "./WinScenarios";
@@ -18,13 +18,16 @@ export declare class SpinLogic {
18
18
  private readonly _hasMysteryWin;
19
19
  private readonly _winScenarios;
20
20
  private readonly _standaloneTransformations;
21
+ private readonly _extraData;
21
22
  constructor(spinConfig: AdaptedSpinResponse, gameConfig: ApiConfig);
22
23
  get postSpinBalance(): number;
23
24
  get winTotalAmount(): number;
25
+ get winTotalAmountWithoutMystery(): number;
24
26
  get onStopBlindsConfiguration(): SymbolReels;
25
27
  get finalBlindsConfiguration(): SymbolReels;
26
28
  get availableFreeSpins(): number;
27
29
  get hasMysteryWin(): boolean;
28
30
  get winScenarios(): WinScenarios[];
29
31
  get standaloneTransformations(): TransformationDetails[][];
32
+ get extraData(): ExtraData;
30
33
  }
@@ -1,3 +1,4 @@
1
+ import { PossibleWins } from "../../constants";
1
2
  import { logInfo } from "../../utils";
2
3
  import { SpinLogicDTO } from "./SpinLogicDTO";
3
4
  /**
@@ -16,6 +17,7 @@ export class SpinLogic {
16
17
  _hasMysteryWin;
17
18
  _winScenarios;
18
19
  _standaloneTransformations;
20
+ _extraData;
19
21
  constructor(spinConfig, gameConfig) {
20
22
  const spinLogicReader = new SpinLogicDTO(spinConfig, gameConfig);
21
23
  this._postSpinBalance = spinLogicReader.updatedBalance;
@@ -26,6 +28,7 @@ export class SpinLogic {
26
28
  this._hasMysteryWin = spinLogicReader.hasMysteryWin;
27
29
  this._winScenarios = spinLogicReader.winScenarios;
28
30
  this._standaloneTransformations = spinLogicReader.standaloneTransformations;
31
+ this._extraData = spinLogicReader.extraData;
29
32
  logInfo("Spin logic", JSON.parse(JSON.stringify(this)));
30
33
  }
31
34
  get postSpinBalance() {
@@ -34,6 +37,10 @@ export class SpinLogic {
34
37
  get winTotalAmount() {
35
38
  return this._winTotalAmount;
36
39
  }
40
+ get winTotalAmountWithoutMystery() {
41
+ return this._winScenarios.reduce((accumulator, scenario) => accumulator +
42
+ scenario.wins.reduce((winAccumulator, currentWin) => currentWin.type === PossibleWins.mystery ? winAccumulator : winAccumulator + currentWin.amount, 0), 0);
43
+ }
37
44
  get onStopBlindsConfiguration() {
38
45
  return this._onStopBlindsConfiguration;
39
46
  }
@@ -52,4 +59,7 @@ export class SpinLogic {
52
59
  get standaloneTransformations() {
53
60
  return this._standaloneTransformations;
54
61
  }
62
+ get extraData() {
63
+ return this._extraData;
64
+ }
55
65
  }
@@ -11,6 +11,7 @@ export declare class SpinLogicDTO {
11
11
  get totalWonAmount(): number;
12
12
  get finalBlindsConfiguration(): SymbolReels;
13
13
  get onStopBlindsConfiguration(): SymbolReels;
14
+ get extraData(): import("../../connectivity").ExtraData;
14
15
  get winScenarios(): WinScenarios[];
15
16
  get standaloneTransformations(): TransformationDetails[][];
16
17
  get hasMysteryWin(): boolean;
@@ -38,6 +38,9 @@ export class SpinLogicDTO {
38
38
  get onStopBlindsConfiguration() {
39
39
  return this.rawData.symbolsOnReels.map((reel) => reel.map((symbol) => this.stringToSymbolId(symbol)));
40
40
  }
41
+ get extraData() {
42
+ return this.rawData.extraData;
43
+ }
41
44
  get winScenarios() {
42
45
  const { results, availableFreeSpins } = this.rawData;
43
46
  if (results === undefined)
@@ -65,8 +68,8 @@ export class SpinLogicDTO {
65
68
  symbolId: this.gameConfig.getSymbolId(singleWin.symbolId),
66
69
  positionOnReels: singleWin.positionOnReels,
67
70
  quantity: singleWin.quantity,
68
- spinId: singleWin.spinId,
69
71
  multiplier: singleWin.multiplier,
72
+ winIndex: singleWin.winIndex,
70
73
  typeId: singleWin.typeId,
71
74
  };
72
75
  if (rawWin.type === PossibleWins.freeSpins) {
@@ -1,4 +1,4 @@
1
- import { SpinDataInterface, SymbolReels, TransformationDetails, WinWithTransformation } from "../../connectivity";
1
+ import { ExtraData, SpinDataInterface, SymbolReels, TransformationDetails, WinWithTransformation } from "../../connectivity";
2
2
  import { ApiConfig } from "../ApiConfig";
3
3
  import { SpinLogic } from "./SpinLogic";
4
4
  export type AdaptedSpinResponse = {
@@ -10,5 +10,6 @@ export type AdaptedSpinResponse = {
10
10
  winAmountTotal: number;
11
11
  results: WinWithTransformation[];
12
12
  standaloneTransformations: TransformationDetails[][];
13
+ extraData: ExtraData;
13
14
  };
14
15
  export type SpinLogicFactory = (spinLogicResponse: SpinDataInterface, gameConfig: ApiConfig) => SpinLogic;
@@ -1,8 +1,7 @@
1
1
  import { DropTransformationDetails, FreezeTransformationDetails, RawFreezeTransformationDetails, RawWin, Result, SpinAndFreezeTransformationDetails, SpinDataInterface, SymbolReels, TransformationDetails, WinWithTransformation } from "../../connectivity";
2
2
  import { ApiConfig } from "../ApiConfig";
3
3
  export declare const concatenateDestroyAndSetTransformations: (spinLogicResponse: SpinDataInterface, currentIndexOfRootTransformation: number, gameConfig: ApiConfig) => [DropTransformationDetails[], number];
4
- export declare const mapSymbolIdsToSymbolNames: (symbols_on_reels: number[][], gameConfig: ApiConfig) => never[][];
5
4
  export declare const getFreezeTransformationFromRawResponse: (transformations: RawFreezeTransformationDetails[]) => FreezeTransformationDetails[];
6
5
  export declare const concatenateFreezeAndSpinTransformations: (freezeTransformations: FreezeTransformationDetails[], onStopBlindsConfiguration: SymbolReels) => SpinAndFreezeTransformationDetails;
7
- export declare const isBlindsConfiguredByTransformations: (results: Result[]) => number[][] | null;
8
- export declare const collectWinDetailsWithTransformation: (winIndex: string | null, winsDetails: RawWin | null, transformations: TransformationDetails[]) => WinWithTransformation;
6
+ export declare const isBlindsConfiguredByTransformations: (results: Result[], transformationTypeId?: number) => number[][] | null;
7
+ export declare const collectWinDetailsWithTransformation: (winsDetails: RawWin | null, transformations: TransformationDetails[], winIndex?: string | null) => WinWithTransformation;
@@ -5,10 +5,10 @@ const getWinFromRawResponse = (rawWin, winIndex) => {
5
5
  multiplier: rawWin.multiplier,
6
6
  positionOnReels: rawWin.position_on_reels,
7
7
  quantity: rawWin.quantity,
8
- spinId: winIndex,
9
8
  symbolId: rawWin.symbol_id,
10
9
  typeId: rawWin.type_id,
11
10
  amount: rawWin.amount,
11
+ winIndex,
12
12
  };
13
13
  };
14
14
  const joinTransformationsIntoDropTransformation = (destroyTransformations, symbolsOnReel, gameConfig) => {
@@ -62,9 +62,6 @@ export const concatenateDestroyAndSetTransformations = (spinLogicResponse, curre
62
62
  const parsedDropTransformations = joinTransformationsIntoDropTransformation(destroyTransformations, symbolsIdsOnReelsAfterSet, gameConfig);
63
63
  return [parsedDropTransformations, setTransformationsIndex];
64
64
  };
65
- export const mapSymbolIdsToSymbolNames = (symbols_on_reels, gameConfig) => {
66
- return symbols_on_reels.map((reel) => reel.map((symbolId) => gameConfig.getSymbolId(symbolId)));
67
- };
68
65
  export const getFreezeTransformationFromRawResponse = (transformations) => {
69
66
  return transformations.map((freezeTransformation) => {
70
67
  return {
@@ -81,17 +78,17 @@ export const concatenateFreezeAndSpinTransformations = (freezeTransformations, o
81
78
  symbolsOnReels: onStopBlindsConfiguration,
82
79
  };
83
80
  };
84
- export const isBlindsConfiguredByTransformations = (results) => {
85
- // make copy of results because reverse is made in place
81
+ export const isBlindsConfiguredByTransformations = (results, transformationTypeId = 16) => {
86
82
  const reversedResults = [...results].reverse();
87
83
  for (const rawTransformation of reversedResults) {
88
- if (rawTransformation.transformation_type === 16 && rawTransformation.symbols_on_reels !== null) {
84
+ if (rawTransformation.transformation_type === transformationTypeId &&
85
+ rawTransformation.symbols_on_reels !== null) {
89
86
  return rawTransformation.symbols_on_reels;
90
87
  }
91
88
  }
92
89
  return null;
93
90
  };
94
- export const collectWinDetailsWithTransformation = (winIndex, winsDetails, transformations) => {
91
+ export const collectWinDetailsWithTransformation = (winsDetails, transformations, winIndex = "") => {
95
92
  const wins = winsDetails ? [getWinFromRawResponse(winsDetails, winIndex ?? "")] : [];
96
93
  return {
97
94
  wins,
@@ -11,12 +11,13 @@ import { Spine } from "pixi-spine";
11
11
  */
12
12
  export declare abstract class AbstractFreeSpinContainer extends Container {
13
13
  protected abstract freeSpinPlate: Sprite | Spine;
14
- shownAt: number;
14
+ shownAt: number | null;
15
15
  protected scaleMultiplier: number;
16
16
  protected constructor();
17
17
  abstract get onClick(): () => void;
18
+ onStart(): Promise<void>;
18
19
  resize(): void;
19
- private reposition;
20
+ protected reposition(): void;
20
21
  protected centerComponent(component: Text | Container): void;
21
22
  protected abstract initChildPositions(): void;
22
23
  }
@@ -20,6 +20,7 @@ export class AbstractFreeSpinContainer extends Container {
20
20
  this.shownAt = performance.now();
21
21
  this.parentLayer = UXLayer;
22
22
  }
23
+ async onStart() { }
23
24
  resize() {
24
25
  this.scale.set(globalMinRatio() * this.scaleMultiplier);
25
26
  this.reposition();
@@ -19,26 +19,28 @@ export declare abstract class AbstractMainContainer extends Container {
19
19
  protected logo: Nullable<Logo>;
20
20
  protected abstract background: IResizableContainer;
21
21
  protected animatedFront: Nullable<IResizableContainer>;
22
- protected abstract freeSpinBox: Nullable<FreeSpinBox>;
23
- protected underFramePanel: Nullable<Graphics>;
22
+ protected freeSpinBox: Nullable<FreeSpinBox>;
23
+ protected underFramePanel: Nullable<Graphics | Sprite>;
24
24
  protected portraitPlayButtons: Nullable<MiddleButtons>;
25
25
  protected landscapePlayButtons: Nullable<MiddleButtons>;
26
26
  protected abstract leftButtons: ResponsiveContainer;
27
27
  protected abstract rightButtons: ResponsiveContainer;
28
28
  protected bottomPanel: Nullable<Sprite>;
29
+ private gambleGame;
30
+ protected gambleGameSpineName: Nullable<string>;
29
31
  protected _freeSpinPlate: Nullable<AbstractFreeSpinContainer>;
30
32
  protected _freeSpinSummary: Nullable<AbstractFreeSpinContainer>;
31
33
  private _bigWinInvokedAt;
32
34
  private _mysteryWinInvokedAt;
33
35
  protected abstract _frame: AbstractFrame;
34
- protected _controller: Nullable<AbstractController>;
36
+ protected _controller: Nullable<AbstractController<unknown>>;
35
37
  protected constructor();
36
38
  protected abstract triggerStoreInitState(): void;
37
39
  get freeSpinPlate(): Nullable<AbstractFreeSpinContainer>;
38
40
  get freeSpinSummary(): Nullable<AbstractFreeSpinContainer>;
39
- protected abstract createFreeSpinPlate(resolver: () => void, freeSpinCount: number, isAdditionalFreeSpin: boolean): AbstractFreeSpinContainer;
41
+ protected createFreeSpinPlate(_resolver: () => void, _freeSpinCount: number, _isAdditionalFreeSpin: boolean): AbstractFreeSpinContainer | null;
40
42
  invokeFreeSpinPlate(freeSpinCount: number, isAdditionalFreeSpin?: boolean): Promise<void>;
41
- protected abstract createFreeSpinSummary(resolver: () => void, freeSpinCount: number, winAmount: number): AbstractFreeSpinContainer;
43
+ protected createFreeSpinSummary(_resolver: () => void, _freeSpinCount: number, _winAmount: number): AbstractFreeSpinContainer | null;
42
44
  invokeFreeSpinSummary(freeSpinCount: number, winAmount: number): Promise<void>;
43
45
  hideFreeSpinSummary(): void;
44
46
  private showOverlay;
@@ -51,7 +53,8 @@ export declare abstract class AbstractMainContainer extends Container {
51
53
  invokeMysteryWin(): void;
52
54
  destroyBigWin(): void;
53
55
  destroyMysteryWin(): void;
54
- invokeGambleGame(): void;
56
+ invokeGambleGame(): Promise<void>;
57
+ protected createUnderFramePanel(): Graphics | Sprite;
55
58
  enableForMobile(): void;
56
59
  enableForLandscape(): void;
57
60
  disableForMobile(): void;
@@ -5,6 +5,7 @@ import { RainMan } from "../../Rainman";
5
5
  import { settingStore } from "../../SettingsUI/hooks";
6
6
  import { getDeviceOrientation, globalMinRatio } from "../../utils";
7
7
  import { BUTTONS, LeftButtons, LeftButtonsLandscape, LeftButtonsMobile, MiddleButtons, RefreshButton, RightButtons, RightButtonsLandscape, RightButtonsMobile, } from "../buttons";
8
+ import { GambleGame } from "../GambleGame";
8
9
  import { MessageBox } from "../messageBox";
9
10
  export class AbstractMainContainer extends Container {
10
11
  static registryName = "mainContainer";
@@ -15,10 +16,13 @@ export class AbstractMainContainer extends Container {
15
16
  buttonsEventManager;
16
17
  logo = null;
17
18
  animatedFront = null;
19
+ freeSpinBox = null;
18
20
  underFramePanel = null;
19
21
  portraitPlayButtons = null;
20
22
  landscapePlayButtons = null;
21
23
  bottomPanel = null;
24
+ gambleGame = null;
25
+ gambleGameSpineName = null;
22
26
  _freeSpinPlate = null;
23
27
  _freeSpinSummary = null;
24
28
  _bigWinInvokedAt = null;
@@ -39,14 +43,20 @@ export class AbstractMainContainer extends Container {
39
43
  get freeSpinSummary() {
40
44
  return this._freeSpinSummary;
41
45
  }
46
+ createFreeSpinPlate(_resolver, _freeSpinCount, _isAdditionalFreeSpin) {
47
+ return null;
48
+ }
42
49
  async invokeFreeSpinPlate(freeSpinCount, isAdditionalFreeSpin = false) {
43
50
  const refreshButton = RainMan.componentRegistry.get(RefreshButton.registryName);
44
51
  refreshButton.flipDisabledFlag(true);
45
- await new Promise((resolve) => {
52
+ await new Promise(async (resolve) => {
46
53
  this._freeSpinPlate = this.createFreeSpinPlate(resolve, freeSpinCount, isAdditionalFreeSpin);
54
+ if (this._freeSpinPlate === null)
55
+ return resolve();
47
56
  this._freeSpinPlate.resize();
48
57
  this.showOverlay();
49
58
  this.addChild(this._freeSpinPlate);
59
+ await this._freeSpinPlate.onStart();
50
60
  });
51
61
  if (this._freeSpinPlate !== null) {
52
62
  this.removeChild(this._freeSpinPlate);
@@ -55,11 +65,16 @@ export class AbstractMainContainer extends Container {
55
65
  this.hideOverlay();
56
66
  refreshButton.flipDisabledFlag(false);
57
67
  }
68
+ createFreeSpinSummary(_resolver, _freeSpinCount, _winAmount) {
69
+ return null;
70
+ }
58
71
  async invokeFreeSpinSummary(freeSpinCount, winAmount) {
59
72
  const refreshButton = RainMan.componentRegistry.get(BUTTONS.refresh);
60
73
  refreshButton.flipDisabledFlag(true);
61
74
  await new Promise((resolve) => {
62
75
  this._freeSpinSummary = this.createFreeSpinSummary(resolve, freeSpinCount, winAmount);
76
+ if (this._freeSpinSummary === null)
77
+ return resolve();
63
78
  this._freeSpinSummary.resize();
64
79
  this.showOverlay();
65
80
  this.addChild(this._freeSpinSummary);
@@ -150,13 +165,31 @@ export class AbstractMainContainer extends Container {
150
165
  this.mysteryWinContainer = null;
151
166
  this._mysteryWinInvokedAt = null;
152
167
  }
153
- invokeGambleGame() { }
168
+ async invokeGambleGame() {
169
+ if (!this.gambleGameSpineName)
170
+ return;
171
+ const newBalance = await new Promise((resolve) => {
172
+ this.gambleGame = new GambleGame(this.gambleGameSpineName, resolve, this._controller.lastWinAmount, this._controller.balance);
173
+ this.showOverlay();
174
+ this.addChild(this.gambleGame);
175
+ });
176
+ if (this.gambleGame) {
177
+ this.removeChild(this.gambleGame);
178
+ this.gambleGame = null;
179
+ }
180
+ this._controller.balance = newBalance;
181
+ this.hideOverlay();
182
+ }
183
+ createUnderFramePanel() {
184
+ const underFramePanel = new Graphics();
185
+ underFramePanel.beginFill(0x0, 0.5);
186
+ underFramePanel.drawRect(0, 0, 800, 100);
187
+ return underFramePanel;
188
+ }
154
189
  enableForMobile() {
155
190
  if (this.logo)
156
191
  this.logo.renderable = true;
157
- this.underFramePanel = new Graphics();
158
- this.underFramePanel.beginFill(0x0, 0.5);
159
- this.underFramePanel.drawRect(0, 0, 800, 100);
192
+ this.underFramePanel = this.createUnderFramePanel();
160
193
  this.underFramePanel.name = "underFramePanel";
161
194
  this.underFramePanel.parentLayer = UXLayer;
162
195
  this.addChild(this.underFramePanel);
@@ -269,6 +302,7 @@ export class AbstractMainContainer extends Container {
269
302
  resizeDependentComponents() {
270
303
  const resizingHelper = globalMinRatio();
271
304
  this._frame.resize();
305
+ this.logo?.resize();
272
306
  this.leftButtons.resize();
273
307
  this.rightButtons.resize();
274
308
  if (this.landscapePlayButtons !== null)
@@ -292,6 +326,9 @@ export class AbstractMainContainer extends Container {
292
326
  this.addChild(this.mysteryWinContainer);
293
327
  this.mysteryWinContainer.resize();
294
328
  }
329
+ if (this.gambleGame) {
330
+ this.gambleGame.resize();
331
+ }
295
332
  if (this.bottomPanel) {
296
333
  this.bottomPanel.scale.set(resizingHelper);
297
334
  this.bottomPanel.width = RainMan.app.screen.width;