pixi-rainman-game-engine 0.1.31 → 0.1.32

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.
@@ -9,6 +9,7 @@ export interface RegistryMap {
9
9
  [MessageBox.autoSpinTextRegistryName]: UpdatableValueComponent;
10
10
  [MessageBox.currentWinTextRegistryName]: UpdatableTextComponent;
11
11
  [MessageBox.freeSpinTextRegistryName]: UpdatableTextComponent;
12
+ [MessageBox.possibleWinTextRegistryName]: UpdatableTextComponent;
12
13
  [MessageBox.registryName]: MessageBox;
13
14
  [SpeedControlButton.registryName]: SpeedControlButton;
14
15
  [Background.registryName]: Background;
@@ -28,4 +29,6 @@ export interface RegistryMap {
28
29
  [COMPONENTS.creditText]: UpdatableTextComponent;
29
30
  [COMPONENTS.bigWin]: StylefulUpdatableText;
30
31
  [COMPONENTS.mysteryWin]: StylefulUpdatableText;
32
+ [COMPONENTS.bonusWin]: StylefulUpdatableText;
33
+ [COMPONENTS.superBonusWin]: StylefulUpdatableText;
31
34
  }
@@ -17,6 +17,7 @@ export const defaultAppConfig = {
17
17
  fontFace: ["HelveticaNeueLTStd"],
18
18
  disableFreeSpinText: false,
19
19
  winLineIndicatorSymbolScale: 0.75,
20
+ disableBigWinOnBonus: false,
20
21
  durationOfActions: {
21
22
  eachColumnsSpinDelay: [0, 200, 700, 1200, 1800],
22
23
  spinBaseTime: 800,
@@ -40,6 +41,10 @@ export const defaultAppConfig = {
40
41
  mysteryWinMinimumTime: 2000,
41
42
  bigWinMinimumTime: 2000,
42
43
  bigWinPhaseTimeout: 2800,
44
+ bonusWinPhaseTimeout: 2800,
45
+ bonusWinMinimumTime: 2000,
46
+ superBonusWinMinimumTime: 2000,
47
+ superBonusWinPhaseTimeout: 2600,
43
48
  speedPopupVisibleTime: 2000,
44
49
  minAnimationTime: 1000,
45
50
  },
@@ -23,6 +23,7 @@ export type OptionalAppConfig = {
23
23
  autoplayGlowColor: number;
24
24
  winLineIndicatorSymbolScale: number;
25
25
  disableFreeSpinText: boolean;
26
+ disableBigWinOnBonus?: boolean;
26
27
  durationOfActions: {
27
28
  eachColumnsSpinDelay: number[];
28
29
  spinBaseTime: number;
@@ -46,6 +47,10 @@ export type OptionalAppConfig = {
46
47
  mysteryWinMinimumTime: number;
47
48
  bigWinMinimumTime: number;
48
49
  bigWinPhaseTimeout: number;
50
+ bonusWinPhaseTimeout: number;
51
+ bonusWinMinimumTime: number;
52
+ superBonusWinPhaseTimeout: number;
53
+ superBonusWinMinimumTime: number;
49
54
  speedPopupVisibleTime: number;
50
55
  minAnimationTime: number;
51
56
  };
@@ -1,5 +1,6 @@
1
1
  import i18n from "i18next";
2
2
  import { sample } from "lodash";
3
+ import { pixiSoundContext } from "../../application";
3
4
  import { AutoplayButton, Background, BUTTONS, COMPONENTS, FreeSpinButton, MessageBox, SpeedControlButton, VolumeButton, } from "../../components";
4
5
  import { RainMan } from "../../Rainman";
5
6
  import { allUiItems, hideLayerIfPresent, UI_ITEMS } from "../../utils";
@@ -185,6 +186,7 @@ export class ButtonsEventManager {
185
186
  RainMan.settingsStore.setUpdateVolumeButtonTexture(() => RainMan.componentRegistry.get(VolumeButton.registryName).changeTextureDependOnVolume());
186
187
  RainMan.componentRegistry.get(VolumeButton.registryName).setOnClick(() => {
187
188
  RainMan.settingsStore.flipSoundsEnabled();
189
+ pixiSoundContext.refresh();
188
190
  RainMan.componentRegistry.get(VolumeButton.registryName).changeTextureDependOnVolume();
189
191
  this.handleModalInvocation(UI_ITEMS.volume);
190
192
  });
@@ -1,5 +1,7 @@
1
+ import { sound } from "@pixi/sound";
1
2
  import { SpeedAdapterInterface, SpeedLevel, SpeedLevelDirectory } from "../SpeedState";
2
3
  import { SoundOverrides, SoundTrack } from "./types";
4
+ export declare const pixiSoundContext: typeof sound.context;
3
5
  /**
4
6
  * Class for managing sound in game, uses the pixi sound library
5
7
  * The class uses SoundTrack enum to access specified sounds
@@ -1,7 +1,8 @@
1
- import { Sound } from "@pixi/sound";
1
+ import { Sound, sound } from "@pixi/sound";
2
2
  import { RainMan } from "../../Rainman";
3
3
  import { SoundTracks } from "./types";
4
4
  const soundsToLoop = [SoundTracks.mysteryFxLoop, SoundTracks.music];
5
+ export const pixiSoundContext = sound.context;
5
6
  /**
6
7
  * Class for managing sound in game, uses the pixi sound library
7
8
  * The class uses SoundTrack enum to access specified sounds
@@ -42,13 +43,12 @@ export class SoundManagerInstance {
42
43
  url,
43
44
  autoPlay: false,
44
45
  preload: true,
45
- loop: soundsToLoop.includes(soundName),
46
46
  loaded: () => resolve(),
47
47
  });
48
48
  this.musicCatalogue.set(soundName, sound);
49
49
  }));
50
50
  }
51
- await Promise.all(loadingSoundsPromises);
51
+ await Promise.allSettled(loadingSoundsPromises);
52
52
  }
53
53
  /**
54
54
  * Function for setting volume level for each sound in game
@@ -76,6 +76,7 @@ export class SoundManagerInstance {
76
76
  */
77
77
  setPlayStatus(soundName, flag) {
78
78
  flag ? this.play(soundName) : this.pause(soundName);
79
+ pixiSoundContext.refresh();
79
80
  }
80
81
  /**
81
82
  * Function for playing sound with given name
@@ -18,10 +18,12 @@ import { MessageBox } from "../messageBox";
18
18
  */
19
19
  export declare abstract class AbstractMainContainer extends Container {
20
20
  static readonly registryName = "mainContainer";
21
+ messageBox: MessageBox;
21
22
  protected bigWinContainer: Nullable<UpdatableSpineContainer>;
22
23
  protected mysteryWinContainer: Nullable<UpdatableSpineContainer>;
24
+ protected bonusWinContainer: Nullable<UpdatableSpineContainer>;
25
+ protected superBonusWinContainer: Nullable<UpdatableSpineContainer>;
23
26
  protected overlay: Nullable<Graphics>;
24
- messageBox: MessageBox;
25
27
  protected readonly buttonsEventManager: ButtonsEventManager;
26
28
  protected logo: Nullable<Logo>;
27
29
  protected abstract background: IResizableContainer;
@@ -39,6 +41,8 @@ export declare abstract class AbstractMainContainer extends Container {
39
41
  protected _freeSpinSummary: Nullable<AbstractFreeSpinContainer>;
40
42
  private _bigWinInvokedAt;
41
43
  private _mysteryWinInvokedAt;
44
+ private _bonusWinInvokedAt;
45
+ private _superBonusWinInvokedAt;
42
46
  protected abstract _frame: AbstractFrame;
43
47
  protected _controller: Nullable<AbstractController<unknown>>;
44
48
  protected constructor();
@@ -51,6 +55,24 @@ export declare abstract class AbstractMainContainer extends Container {
51
55
  get freeSpinPlate(): Nullable<AbstractFreeSpinContainer>;
52
56
  get freeSpinSummary(): Nullable<AbstractFreeSpinContainer>;
53
57
  protected createFreeSpinPlate(_resolver: () => void, _freeSpinCount: number, _isAdditionalFreeSpin: boolean): AbstractFreeSpinContainer | null;
58
+ /**
59
+ * Function for creating bonus win container
60
+ *
61
+ * @returns {Nullable<UpdatableSpineContainer>}
62
+ */
63
+ protected createBonusWinContainer(): Nullable<UpdatableSpineContainer>;
64
+ /**
65
+ * Function for creating super bonus win container
66
+ *
67
+ * @returns {Nullable<UpdatableSpineContainer>}
68
+ */
69
+ protected createSuperBonusWinContainer(): Nullable<UpdatableSpineContainer>;
70
+ /**
71
+ * Function for creating mystery win container
72
+ *
73
+ * @returns {Nullable<UpdatableSpineContainer>}
74
+ */
75
+ protected createMysteryWinContainer(): Nullable<UpdatableSpineContainer>;
54
76
  /**
55
77
  * Function for invoking free spin plate
56
78
  * If game draw an additional free spin, you can set isAdditionalFreeSpin to true
@@ -73,12 +95,17 @@ export declare abstract class AbstractMainContainer extends Container {
73
95
  protected hideOverlay(): void;
74
96
  get bigWinVisibleFor(): number;
75
97
  get mysteryWinVisibleFor(): number;
98
+ get bonusWinVisibleFor(): number;
99
+ get superBonusWinVisibleFor(): number;
76
100
  protected abstract createBigWinContainer(): UpdatableSpineContainer;
77
101
  invokeBigWin(): void;
78
- protected createMysteryWinContainer(): UpdatableSpineContainer | null;
102
+ invokeSuperBonusWin(): void;
103
+ invokeBonusWin(): void;
79
104
  invokeMysteryWin(): void;
80
105
  destroyBigWin(): void;
81
106
  destroyMysteryWin(): void;
107
+ destroyBonusWin(): void;
108
+ destroySuperBonusWin(): void;
82
109
  invokeGambleGame(): Promise<void>;
83
110
  protected createUnderFramePanel(): Graphics | Sprite;
84
111
  enableForMobile(): void;
@@ -15,10 +15,12 @@ import { MessageBox } from "../messageBox";
15
15
  */
16
16
  export class AbstractMainContainer extends Container {
17
17
  static registryName = "mainContainer";
18
+ messageBox;
18
19
  bigWinContainer = null;
19
20
  mysteryWinContainer = null;
21
+ bonusWinContainer = null;
22
+ superBonusWinContainer = null;
20
23
  overlay = null;
21
- messageBox;
22
24
  buttonsEventManager;
23
25
  logo = null;
24
26
  animatedFront = null;
@@ -33,6 +35,8 @@ export class AbstractMainContainer extends Container {
33
35
  _freeSpinSummary = null;
34
36
  _bigWinInvokedAt = null;
35
37
  _mysteryWinInvokedAt = null;
38
+ _bonusWinInvokedAt = null;
39
+ _superBonusWinInvokedAt = null;
36
40
  _controller = null;
37
41
  constructor() {
38
42
  super();
@@ -61,6 +65,30 @@ export class AbstractMainContainer extends Container {
61
65
  createFreeSpinPlate(_resolver, _freeSpinCount, _isAdditionalFreeSpin) {
62
66
  return null;
63
67
  }
68
+ /**
69
+ * Function for creating bonus win container
70
+ *
71
+ * @returns {Nullable<UpdatableSpineContainer>}
72
+ */
73
+ createBonusWinContainer() {
74
+ return null;
75
+ }
76
+ /**
77
+ * Function for creating super bonus win container
78
+ *
79
+ * @returns {Nullable<UpdatableSpineContainer>}
80
+ */
81
+ createSuperBonusWinContainer() {
82
+ return null;
83
+ }
84
+ /**
85
+ * Function for creating mystery win container
86
+ *
87
+ * @returns {Nullable<UpdatableSpineContainer>}
88
+ */
89
+ createMysteryWinContainer() {
90
+ return null;
91
+ }
64
92
  /**
65
93
  * Function for invoking free spin plate
66
94
  * If game draw an additional free spin, you can set isAdditionalFreeSpin to true
@@ -144,6 +172,12 @@ export class AbstractMainContainer extends Container {
144
172
  get mysteryWinVisibleFor() {
145
173
  return this._mysteryWinInvokedAt == null ? 0 : performance.now() - this._mysteryWinInvokedAt;
146
174
  }
175
+ get bonusWinVisibleFor() {
176
+ return this._bonusWinInvokedAt == null ? 0 : performance.now() - this._bonusWinInvokedAt;
177
+ }
178
+ get superBonusWinVisibleFor() {
179
+ return this._superBonusWinInvokedAt == null ? 0 : performance.now() - this._superBonusWinInvokedAt;
180
+ }
147
181
  invokeBigWin() {
148
182
  if (this.bigWinContainer !== null) {
149
183
  throw new Error("😡 Big Win is already declared");
@@ -158,8 +192,32 @@ export class AbstractMainContainer extends Container {
158
192
  SoundManager.play(SoundTracks.bigWin);
159
193
  this._bigWinInvokedAt = performance.now();
160
194
  }
161
- createMysteryWinContainer() {
162
- return null;
195
+ invokeSuperBonusWin() {
196
+ if (this.superBonusWinContainer !== null) {
197
+ throw new Error("😡 Super Bonus Win is already declared");
198
+ }
199
+ const { width, height } = RainMan.app.screen;
200
+ this.superBonusWinContainer = this.createSuperBonusWinContainer();
201
+ if (!this.superBonusWinContainer)
202
+ return;
203
+ this.superBonusWinContainer.x = width / 2;
204
+ this.superBonusWinContainer.y = height / 2;
205
+ this.superBonusWinContainer.resize();
206
+ this.superBonusWinContainer.parentLayer = UXLayer;
207
+ this.addChild(this.superBonusWinContainer);
208
+ this._superBonusWinInvokedAt = performance.now();
209
+ }
210
+ invokeBonusWin() {
211
+ if (this.bonusWinContainer !== null) {
212
+ throw new Error("😡 Bonus Win is already declared");
213
+ }
214
+ this.bonusWinContainer = this.createBonusWinContainer();
215
+ if (!this.bonusWinContainer)
216
+ return;
217
+ this.bonusWinContainer.resize();
218
+ this.bonusWinContainer.parentLayer = UXLayer;
219
+ this.addChild(this.bonusWinContainer);
220
+ this._bonusWinInvokedAt = performance.now();
163
221
  }
164
222
  invokeMysteryWin() {
165
223
  if (this.mysteryWinContainer !== null) {
@@ -194,6 +252,24 @@ export class AbstractMainContainer extends Container {
194
252
  this.mysteryWinContainer = null;
195
253
  this._mysteryWinInvokedAt = null;
196
254
  }
255
+ destroyBonusWin() {
256
+ if (this.bonusWinContainer === null)
257
+ return;
258
+ this.removeChild(this.bonusWinContainer);
259
+ this.bonusWinContainer.destroyAnimations();
260
+ this.bonusWinContainer.destroy({ children: true });
261
+ this.bonusWinContainer = null;
262
+ this._bonusWinInvokedAt = null;
263
+ }
264
+ destroySuperBonusWin() {
265
+ if (this.superBonusWinContainer === null)
266
+ return;
267
+ this.removeChild(this.superBonusWinContainer);
268
+ this.superBonusWinContainer.destroyAnimations();
269
+ this.superBonusWinContainer.destroy({ children: true });
270
+ this.superBonusWinContainer = null;
271
+ this._superBonusWinInvokedAt = null;
272
+ }
197
273
  async invokeGambleGame() {
198
274
  if (!this.gambleGameSpineName)
199
275
  return;
@@ -257,6 +333,15 @@ export class AbstractMainContainer extends Container {
257
333
  if (this.bigWinContainer) {
258
334
  this.removeChild(this.bigWinContainer);
259
335
  }
336
+ if (this.mysteryWinContainer) {
337
+ this.removeChild(this.mysteryWinContainer);
338
+ }
339
+ if (this.superBonusWinContainer) {
340
+ this.removeChild(this.superBonusWinContainer);
341
+ }
342
+ if (this.bonusWinContainer) {
343
+ this.removeChild(this.bonusWinContainer);
344
+ }
260
345
  this.messageBox.resize();
261
346
  this.background.resize();
262
347
  this.animatedFront?.resize();
@@ -352,6 +437,16 @@ export class AbstractMainContainer extends Container {
352
437
  this.addChild(this.bigWinContainer);
353
438
  this.bigWinContainer.resize();
354
439
  }
440
+ if (this.superBonusWinContainer) {
441
+ this.removeChild(this.superBonusWinContainer);
442
+ this.addChild(this.superBonusWinContainer);
443
+ this.superBonusWinContainer.resize();
444
+ }
445
+ if (this.bonusWinContainer) {
446
+ this.removeChild(this.bonusWinContainer);
447
+ this.addChild(this.bonusWinContainer);
448
+ this.bonusWinContainer.resize();
449
+ }
355
450
  if (this.mysteryWinContainer) {
356
451
  this.removeChild(this.mysteryWinContainer);
357
452
  this.addChild(this.mysteryWinContainer);
@@ -17,5 +17,7 @@ export declare const COMPONENTS: {
17
17
  readonly creditText: "creditText";
18
18
  readonly bigWin: "bigWinText";
19
19
  readonly mysteryWin: "mysteryWinText";
20
+ readonly bonusWin: "bonusWinText";
21
+ readonly superBonusWin: "superBonusWinText";
20
22
  readonly autoSpinConfirm: "autoSpin-confirm";
21
23
  };
@@ -17,5 +17,7 @@ export const COMPONENTS = {
17
17
  creditText: "creditText",
18
18
  bigWin: "bigWinText",
19
19
  mysteryWin: "mysteryWinText",
20
+ bonusWin: "bonusWinText",
21
+ superBonusWin: "superBonusWinText",
20
22
  autoSpinConfirm: "autoSpin-confirm",
21
23
  };
@@ -60,6 +60,7 @@
60
60
  "doubleTo": "DOUBLE TO",
61
61
  "collect": "COLLECT",
62
62
  "totalBet": "Bet",
63
- "buyFreeSpins": "Buy Free Spins"
63
+ "buyFreeSpins": "Buy Free Spins",
64
+ "possibleWin": "POSSIBLE WIN: "
64
65
  }
65
66
  }
@@ -19,26 +19,31 @@ export declare class MessageBox extends Container {
19
19
  static readonly freeSpinTextRegistryName = "freeSpinAmount";
20
20
  static readonly autoSpinTextRegistryName = "autoSpinAmount";
21
21
  static readonly currentWinTextRegistryName = "winAmount";
22
+ static readonly possibleWinTextRegistryName = "possibleWinAmount";
22
23
  private readonly positioningFrame;
23
- private readonly currentWinText;
24
24
  private readonly autoSpinText;
25
25
  private readonly freeSpinText;
26
26
  private readonly incentiveText;
27
+ private readonly currentWinText;
28
+ private readonly possibleWinText;
27
29
  private winLineIndicator?;
28
30
  private currentWinShown;
29
31
  private autoSpinShown;
30
32
  private freeSpinShown;
33
+ private possibleWinShown;
31
34
  private incentiveMessageShown;
32
35
  private winLineIndicatorShown;
33
36
  constructor();
34
37
  updateIncentiveText(newText: string): void;
35
38
  hideCurrentWinText(): void;
39
+ hidePossibleWinText(): void;
36
40
  hideFreeSpinText(): void;
37
41
  hideAutoSpinText(): void;
38
42
  hideIncentiveText(): void;
39
43
  hideWinLineIndicator(): void;
40
44
  resize(): void;
41
45
  showCurrentWinText(): void;
46
+ showPossibleWinText(): void;
42
47
  showAutoSpinText(): void;
43
48
  showFreeSpinText(): void;
44
49
  showIncentiveText(): void;
@@ -24,15 +24,18 @@ export class MessageBox extends Container {
24
24
  static freeSpinTextRegistryName = "freeSpinAmount";
25
25
  static autoSpinTextRegistryName = "autoSpinAmount";
26
26
  static currentWinTextRegistryName = "winAmount";
27
+ static possibleWinTextRegistryName = "possibleWinAmount";
27
28
  positioningFrame;
28
- currentWinText;
29
29
  autoSpinText;
30
30
  freeSpinText;
31
31
  incentiveText;
32
+ currentWinText;
33
+ possibleWinText;
32
34
  winLineIndicator = undefined;
33
35
  currentWinShown = false;
34
36
  autoSpinShown = false;
35
37
  freeSpinShown = false;
38
+ possibleWinShown = false;
36
39
  incentiveMessageShown = false;
37
40
  winLineIndicatorShown = false;
38
41
  constructor() {
@@ -49,6 +52,7 @@ export class MessageBox extends Container {
49
52
  this.freeSpinText = new UpdatableTextComponent(MessageBox.freeSpinTextRegistryName, i18n.t("currentFreeSpins"), UPDATABLE_MODES.int, fontSize, new Color(0xffffff).toHex(), () => this.centerTextOnX(this.freeSpinText));
50
53
  this.autoSpinText = new UpdatableTextComponent(MessageBox.autoSpinTextRegistryName, i18n.t("autoSpinsLeft"), UPDATABLE_MODES.int, fontSize, new Color(0xffffff).toHex(), () => this.centerTextOnX(this.autoSpinText));
51
54
  this.currentWinText = new UpdatableTextComponent(MessageBox.currentWinTextRegistryName, i18n.t("currentWin"), UPDATABLE_MODES.money, fontSize, undefined, () => this.centerTextOnX(this.currentWinText));
55
+ this.possibleWinText = new UpdatableTextComponent(MessageBox.possibleWinTextRegistryName, i18n.t("possibleWin"), UPDATABLE_MODES.money, fontSize, undefined, () => this.centerTextOnX(this.possibleWinText));
52
56
  this.incentiveText = new Text(sample(i18n.t("idleMessages", { returnObjects: true })[RainMan.componentRegistry.getSpeedLevel()]), {
53
57
  fontFamily: RainMan.config.fontFace,
54
58
  fontSize,
@@ -58,9 +62,15 @@ export class MessageBox extends Container {
58
62
  });
59
63
  this.incentiveText.y = -25;
60
64
  this.currentWinText.y = -25;
65
+ this.possibleWinText.y = -25;
61
66
  this.freeSpinText.y = this.currentWinText.y + this.currentWinText.height / 2 + this.freeSpinText.height / 2;
62
67
  this.autoSpinText.y = this.currentWinText.y + this.currentWinText.height / 2 + this.autoSpinText.height / 2;
63
- RainMan.componentRegistry.addMany([this.currentWinText, this.autoSpinText, this.freeSpinText]);
68
+ RainMan.componentRegistry.addMany([
69
+ this.currentWinText,
70
+ this.autoSpinText,
71
+ this.freeSpinText,
72
+ this.possibleWinText,
73
+ ]);
64
74
  }
65
75
  updateIncentiveText(newText) {
66
76
  this.incentiveText.text = newText;
@@ -72,6 +82,12 @@ export class MessageBox extends Container {
72
82
  this.removeChild(this.currentWinText);
73
83
  }
74
84
  }
85
+ hidePossibleWinText() {
86
+ if (this.possibleWinShown) {
87
+ this.possibleWinShown = false;
88
+ this.removeChild(this.possibleWinText);
89
+ }
90
+ }
75
91
  hideFreeSpinText() {
76
92
  if (this.freeSpinShown) {
77
93
  this.freeSpinShown = false;
@@ -115,6 +131,14 @@ export class MessageBox extends Container {
115
131
  this.centerTextOnX(this.currentWinText);
116
132
  this.addChild(this.currentWinText);
117
133
  }
134
+ showPossibleWinText() {
135
+ this.hideIncentiveText();
136
+ if (this.possibleWinShown)
137
+ return;
138
+ this.possibleWinShown = true;
139
+ this.centerTextOnX(this.possibleWinText);
140
+ this.addChild(this.possibleWinText);
141
+ }
118
142
  showAutoSpinText() {
119
143
  this.hideIncentiveText();
120
144
  this.hideWinLineIndicator();
@@ -138,6 +162,7 @@ export class MessageBox extends Container {
138
162
  }
139
163
  showIncentiveText() {
140
164
  this.hideCurrentWinText();
165
+ this.hidePossibleWinText();
141
166
  this.hideFreeSpinText();
142
167
  this.hideAutoSpinText();
143
168
  this.hideWinLineIndicator();
@@ -41,6 +41,8 @@ export declare abstract class AbstractController<T> {
41
41
  protected uiController: UiController;
42
42
  protected resolveBigWin?: () => void;
43
43
  protected resolveMysteryWin?: () => void;
44
+ protected resolveBonusWin?: () => void;
45
+ protected resolveSuperBonusWin?: () => void;
44
46
  protected mysteryFxSymbol: SymbolId | null;
45
47
  protected mysteryFxSymbolMustFormWinningLine: boolean;
46
48
  protected mysteryWinSymbol: Nullable<SymbolId>;
@@ -88,7 +90,6 @@ export declare abstract class AbstractController<T> {
88
90
  private setRefreshButtonBasedOnPhase;
89
91
  private setMessageBoxBasedOnPhase;
90
92
  protected getReelIndexesToShowMysteryFx(spinLogic: SpinLogic): number[];
91
- protected showSuperBonusWin(removeBonusWin: Promise<void>): void;
92
93
  /**
93
94
  * Function is responsible for initializing the spin process
94
95
  * This also is handler for refresh button and space functionalities
@@ -151,7 +152,9 @@ export declare abstract class AbstractController<T> {
151
152
  private lockLogicWhileSpinning;
152
153
  private unlockLogicAfterSpinning;
153
154
  protected stopPlayingSymbolsStreak(): void;
154
- protected countWinBigWin(customAmount?: number): Promise<void>;
155
+ protected countBigWin(customAmount?: number): Promise<void>;
156
+ protected countBonusWin(winAmount?: number): Promise<void>;
157
+ protected countSuperBonusWin(winAmount?: number): Promise<void>;
155
158
  protected countMysteryWin(winAmount?: number, quantity?: number): Promise<void>;
156
159
  /**
157
160
  * Parser for streaks and reels quantity
@@ -40,6 +40,8 @@ export class AbstractController {
40
40
  uiController;
41
41
  resolveBigWin;
42
42
  resolveMysteryWin;
43
+ resolveBonusWin;
44
+ resolveSuperBonusWin;
43
45
  mysteryFxSymbol = null;
44
46
  mysteryFxSymbolMustFormWinningLine = false;
45
47
  mysteryWinSymbol = null;
@@ -56,7 +58,6 @@ export class AbstractController {
56
58
  this.uiController = new UiController(this.config);
57
59
  this.componentRegistry = RainMan.componentRegistry;
58
60
  this.setupSpaceOrEnterListener();
59
- RainMan.settingsStore.showSuperBonusWin = this.showSuperBonusWin.bind(this);
60
61
  RainMan.settingsStore.increaseBet = () => this.uiController.updateBet("increase");
61
62
  RainMan.settingsStore.decreaseBet = () => this.uiController.updateBet("decrease");
62
63
  }
@@ -299,17 +300,6 @@ export class AbstractController {
299
300
  }
300
301
  return reelsIndexesWithScatter;
301
302
  }
302
- showSuperBonusWin(removeBonusWin) {
303
- this.changeGamePhase(gamePhases.BIG_WIN_INVOKED);
304
- const winAmount = RainMan.settingsStore.cumulativeWinAmount > 0
305
- ? RainMan.settingsStore.cumulativeWinAmount
306
- : this.uiController.recentWin;
307
- this.countWinBigWin(winAmount).then(async () => {
308
- await removeBonusWin;
309
- this.changeGamePhase(gamePhases.IDLE);
310
- });
311
- RainMan.settingsStore.resetCumulativeWinAmount();
312
- }
313
303
  /**
314
304
  * Function is responsible for initializing the spin process
315
305
  * This also is handler for refresh button and space functionalities
@@ -349,6 +339,22 @@ export class AbstractController {
349
339
  this.resolveBigWin?.();
350
340
  this.resolveBigWin = undefined;
351
341
  }
342
+ if (this.mainContainer.bonusWinVisibleFor) {
343
+ RainMan.componentRegistry.get(COMPONENTS.bonusWin).set(this.uiController.recentWin);
344
+ }
345
+ if (this.mainContainer.bonusWinVisibleFor > RainMan.config.durationOfActions.bonusWinMinimumTime) {
346
+ this.mainContainer.destroyBonusWin();
347
+ this.resolveBonusWin?.();
348
+ this.resolveBonusWin = undefined;
349
+ }
350
+ if (this.mainContainer.superBonusWinVisibleFor) {
351
+ RainMan.componentRegistry.get(COMPONENTS.superBonusWin).set(this.uiController.recentWin);
352
+ }
353
+ if (this.mainContainer.superBonusWinVisibleFor > RainMan.config.durationOfActions.superBonusWinMinimumTime) {
354
+ this.mainContainer.destroySuperBonusWin();
355
+ this.resolveSuperBonusWin?.();
356
+ this.resolveSuperBonusWin = undefined;
357
+ }
352
358
  this.throttledSpin();
353
359
  }
354
360
  /**
@@ -570,7 +576,7 @@ export class AbstractController {
570
576
  }
571
577
  this.composeWinActionsQueue(spinLogic);
572
578
  await this.playWinActionQueue();
573
- await this.countWinBigWin();
579
+ await this.countBigWin();
574
580
  await this.handleLoopingWinActionQueue();
575
581
  this.clearAndDestroyActions();
576
582
  debugSymbolsMatchConfiguration(spinLogic.finalBlindsConfiguration);
@@ -673,9 +679,10 @@ export class AbstractController {
673
679
  this.columnsContainer.stopPlayingSymbolsInColumns();
674
680
  this.frame.stopPlayingWinLineAnimations();
675
681
  }
676
- async countWinBigWin(customAmount) {
682
+ async countBigWin(customAmount) {
677
683
  if (this.uiController.recentWin <= RainMan.config.constants.bigWinMultiplier * RainMan.settingsStore.bet &&
678
- !customAmount)
684
+ !customAmount &&
685
+ RainMan.config.disableBigWinOnBonus)
679
686
  return;
680
687
  const amount = customAmount || this.uiController.recentWin;
681
688
  this.mainContainer.invokeBigWin();
@@ -694,6 +701,47 @@ export class AbstractController {
694
701
  }, RainMan.config.durationOfActions.bigWinPhaseTimeout / animationTimeDivider);
695
702
  });
696
703
  }
704
+ async countBonusWin(winAmount) {
705
+ if (!winAmount)
706
+ return;
707
+ const amount = winAmount || this.uiController.recentWin;
708
+ this.mainContainer.invokeBonusWin();
709
+ this.changeGamePhase(gamePhases.BIG_WIN_INVOKED);
710
+ const animationTimeDivider = RainMan.settingsStore.currentSpeed === SPEED_LEVELS.fast ? 3 : 1;
711
+ await RainMan.componentRegistry
712
+ .get(COMPONENTS.bonusWin)
713
+ .update(amount, RainMan.config.durationOfActions.updatableTextCountingDuration / animationTimeDivider);
714
+ await new Promise((resolve) => {
715
+ this.resolveBonusWin = resolve;
716
+ setTimeout(() => {
717
+ if (this.resolveBonusWin === undefined)
718
+ return;
719
+ this.mainContainer.destroyBonusWin();
720
+ this.resolveBonusWin();
721
+ this.resolveBonusWin = undefined;
722
+ }, RainMan.config.durationOfActions.bonusWinPhaseTimeout / animationTimeDivider);
723
+ });
724
+ }
725
+ async countSuperBonusWin(winAmount) {
726
+ if (!winAmount)
727
+ return;
728
+ const amount = winAmount || RainMan.settingsStore.cumulativeWinAmount;
729
+ this.mainContainer.invokeSuperBonusWin();
730
+ const animationTimeDivider = RainMan.settingsStore.currentSpeed === SPEED_LEVELS.fast ? 3 : 1;
731
+ await RainMan.componentRegistry
732
+ .get(COMPONENTS.superBonusWin)
733
+ .update(amount, RainMan.config.durationOfActions.updatableTextCountingDuration / animationTimeDivider);
734
+ await new Promise((resolve) => {
735
+ this.resolveSuperBonusWin = resolve;
736
+ setTimeout(() => {
737
+ if (this.resolveSuperBonusWin === undefined)
738
+ return;
739
+ this.mainContainer.destroySuperBonusWin();
740
+ this.resolveSuperBonusWin();
741
+ this.resolveSuperBonusWin = undefined;
742
+ }, RainMan.config.durationOfActions.superBonusWinPhaseTimeout / animationTimeDivider);
743
+ });
744
+ }
697
745
  async countMysteryWin(winAmount, quantity = 3) {
698
746
  if (!winAmount || !this.mysteryWinSymbol)
699
747
  return;
@@ -39,6 +39,7 @@ export declare class UiController {
39
39
  updateShownSpeedLevel(currentSpeed: SpeedLevel): void;
40
40
  updateShownBalance(): void;
41
41
  updateShownCurrentWin(): void;
42
+ updateShownPossibleWin(): void;
42
43
  updateShownFreeSpinAmount(amount: number, isAdditionalFreeSpins?: boolean): void;
43
44
  delegateUpdatingWinAndBalance(amount: Nullable<number>): void;
44
45
  updateDisplayedWin(amount: Nullable<number>): Promise<void>;
@@ -105,6 +105,10 @@ export class UiController {
105
105
  }
106
106
  RainMan.componentRegistry.get(MessageBox.currentWinTextRegistryName).set(this.recentWin);
107
107
  }
108
+ updateShownPossibleWin() {
109
+ this.messageBox.showPossibleWinText();
110
+ RainMan.componentRegistry.get(MessageBox.possibleWinTextRegistryName).set(this.recentWin);
111
+ }
108
112
  updateShownFreeSpinAmount(amount, isAdditionalFreeSpins = false) {
109
113
  if (isAdditionalFreeSpins)
110
114
  RainMan.componentRegistry.get(MessageBox.freeSpinTextRegistryName).update(amount);
@@ -43,7 +43,6 @@ export declare class SettingsStore {
43
43
  popupPaytableRepositionCallback?: () => void;
44
44
  updateVolumeButtonTexture?: () => void;
45
45
  handleModalInvocation?: (layerId: string) => void;
46
- showSuperBonusWin?: (callback: Promise<void>) => void;
47
46
  increaseBet?: () => void;
48
47
  decreaseBet?: () => void;
49
48
  private readonly initialAutoplaySettingsState;
@@ -73,7 +72,6 @@ export declare class SettingsStore {
73
72
  setBalancedDecreased(newValue: number): void;
74
73
  getMinimumPaytableValue(multipliers: RangeQuantityValue[keyof RangeQuantityValue]): number;
75
74
  getMaximumPaytableValue(multipliers: RangeQuantityValue[keyof RangeQuantityValue]): number;
76
- forceSuperBigWin(removeBonusWin: Promise<void>): void;
77
75
  setDataForSymbolPaytablePopup(symbolId: SymbolId, repositionCallback: () => void): void;
78
76
  resetDataForSymbolPaytablePopup(): void;
79
77
  setUpdateVolumeButtonTexture(fn: () => void): void;
@@ -49,7 +49,6 @@ export class SettingsStore {
49
49
  popupPaytableRepositionCallback;
50
50
  updateVolumeButtonTexture;
51
51
  handleModalInvocation;
52
- showSuperBonusWin;
53
52
  increaseBet;
54
53
  decreaseBet;
55
54
  initialAutoplaySettingsState = {
@@ -224,9 +223,6 @@ export class SettingsStore {
224
223
  return last(multipliers) || 0;
225
224
  return 0;
226
225
  }
227
- forceSuperBigWin(removeBonusWin) {
228
- this.showSuperBonusWin?.(removeBonusWin);
229
- }
230
226
  setDataForSymbolPaytablePopup(symbolId, repositionCallback) {
231
227
  this.popupPaytableRepositionCallback = repositionCallback;
232
228
  this.popupPaytableRepositionCallback();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "This repository contains all of the mechanics that used in rainman games.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",