pixi-rainman-game-engine 0.1.28 → 0.1.30

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.
@@ -1,4 +1,4 @@
1
- import { isIncentiveComponentInterface, isSpeedAdapterInterface, SpeedLevelHandler, TimedIncentiveController, } from "../application";
1
+ import { isIncentiveComponentInterface, isSpeedAdapterInterface, SPEED_LEVELS, SpeedLevelHandler, TimedIncentiveController, } from "../application";
2
2
  import { SpeedControlButton } from "../components";
3
3
  import { RainMan } from "../Rainman";
4
4
  import { openFullscreen } from "../utils";
@@ -52,6 +52,9 @@ export class ComponentRegistry {
52
52
  */
53
53
  nextSpeedLevel() {
54
54
  this.speedLevelHandler.nextSpeed();
55
+ if (this.speedLevelHandler.currentSpeed !== SPEED_LEVELS.slow) {
56
+ RainMan.globals.disableSpeedPopup?.(false);
57
+ }
55
58
  RainMan.settingsStore.setSpeedLevel(this.speedLevelHandler.currentSpeed);
56
59
  this.updateAllSpeedAdaptable(RainMan.settingsStore.currentSpeed);
57
60
  this.get(SpeedControlButton.registryName).forceTextureUpdate();
@@ -15,6 +15,7 @@ export const defaultAppConfig = {
15
15
  updatableTextValueColor: new Color(0xffffff).toHex(),
16
16
  autoplayGlowColor: new Color(0xff3000).toNumber(),
17
17
  fontFace: ["HelveticaNeueLTStd"],
18
+ disableFreeSpinText: false,
18
19
  winLineIndicatorSymbolScale: 0.75,
19
20
  durationOfActions: {
20
21
  eachColumnsSpinDelay: [0, 200, 700, 1200, 1800],
@@ -22,6 +22,7 @@ export type OptionalAppConfig = {
22
22
  mobileFontFace?: string[];
23
23
  autoplayGlowColor: number;
24
24
  winLineIndicatorSymbolScale: number;
25
+ disableFreeSpinText: boolean;
25
26
  durationOfActions: {
26
27
  eachColumnsSpinDelay: number[];
27
28
  spinBaseTime: number;
@@ -56,5 +57,6 @@ export type OptionalAppConfig = {
56
57
  export type AppConfig = RequiredAppConfig & DeepPartial<OptionalAppConfig>;
57
58
  export interface Globals {
58
59
  currency: Currency;
60
+ disableSpeedPopup?: (value: boolean) => void;
59
61
  throttledSpin?: () => void;
60
62
  }
@@ -70,6 +70,7 @@ export class ButtonsEventManager {
70
70
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.normal);
71
71
  this.setSpeedPopupVisibility("none");
72
72
  messageBox.updateIncentiveText(i18n.t("rabbitSelected"));
73
+ RainMan.globals.disableSpeedPopup?.(true);
73
74
  });
74
75
  }
75
76
  }
@@ -80,6 +81,7 @@ export class ButtonsEventManager {
80
81
  RainMan.componentRegistry.setSpeedLevel(SPEED_LEVELS.fast);
81
82
  this.setSpeedPopupVisibility("none");
82
83
  messageBox.updateIncentiveText(i18n.t("cheetahSelected"));
84
+ RainMan.globals.disableSpeedPopup?.(true);
83
85
  });
84
86
  }
85
87
  }
@@ -13,6 +13,7 @@ export interface SoundTracks {
13
13
  mysteryFxEnd: "mysteryFxEnd";
14
14
  mysteryFxLoop: "mysteryFxLoop";
15
15
  line: "line";
16
+ freeLine: "freeLine";
16
17
  mysteryDrawLoop: "mysteryDrawLoop";
17
18
  rollStop: "rollStop";
18
19
  specialSymbolOnReel: "specialSymbolOnReel";
@@ -36,6 +37,7 @@ export type SoundTrack = SoundTracks[keyof SoundTracks];
36
37
  * @property {string} mysteryFxEnd - on mystery fx hides
37
38
  * @property {string} mysteryFxLoop - when mystery fx in visible in loop
38
39
  * @property {string} line - default win line sound, for both single and multiple lines
40
+ * @property {string} freeLine - win line sound for free spins
39
41
  * @property {string} mysteryDrawLoop - on show mystery popup, play during randomizing win
40
42
  * @property {string} rollStop - single reel stopping
41
43
  * @property {string} specialSymbolOnReel - single reel stopping with special symbol like bonus or mystery
@@ -16,5 +16,6 @@ export const SoundTracks = {
16
16
  rollStop: "rollStop",
17
17
  specialSymbolOnReel: "specialSymbolOnReel",
18
18
  start: "start",
19
+ freeLine: "freeLine",
19
20
  symbol: "symbol",
20
21
  };
@@ -123,8 +123,8 @@ export class AbstractColumnsContainer extends Container {
123
123
  promises.push(promise);
124
124
  });
125
125
  });
126
- SoundManager.play(SoundTracks.line);
127
- await Promise.all(promises);
126
+ SoundManager.play(RainMan.settingsStore.isFreeSpinsPlayEnabled ? SoundTracks.freeLine : SoundTracks.line);
127
+ await Promise.allSettled(promises);
128
128
  }
129
129
  resetPlayedSounds() {
130
130
  this.playedSounds = [];
@@ -140,7 +140,7 @@ export class AbstractColumnsContainer extends Container {
140
140
  return;
141
141
  }
142
142
  if (this.playLineSoundOnEachStreak)
143
- SoundManager.play(SoundTracks.line);
143
+ SoundManager.play(RainMan.settingsStore.isFreeSpinsPlayEnabled ? SoundTracks.freeLine : SoundTracks.line);
144
144
  }
145
145
  /**
146
146
  * Function for playing animation of streak
@@ -100,6 +100,8 @@ export class MessageBox extends Container {
100
100
  }
101
101
  }
102
102
  showCurrentWinText() {
103
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled && RainMan.config.disableFreeSpinText)
104
+ return;
103
105
  this.hideIncentiveText();
104
106
  if (this.currentWinShown)
105
107
  return;
@@ -117,6 +119,8 @@ export class MessageBox extends Container {
117
119
  this.addChild(this.autoSpinText);
118
120
  }
119
121
  showFreeSpinText() {
122
+ if (RainMan.config.disableFreeSpinText)
123
+ return;
120
124
  this.hideIncentiveText();
121
125
  this.hideAutoSpinText();
122
126
  this.hideWinLineIndicator();
@@ -6,7 +6,7 @@ export interface InitDataInterface {
6
6
  token: string;
7
7
  bets: Array<number>;
8
8
  currency: string;
9
- language: string;
9
+ language_code: string;
10
10
  symbols_names: Array<string>;
11
11
  symbols: Array<number>;
12
12
  streaks: Array<Array<Point>>;
@@ -50,13 +50,19 @@ export type ScatterWin = BaseWin & {
50
50
  export type RouletteWin = BaseWin & {
51
51
  type: typeof PossibleWins.roulette;
52
52
  };
53
+ export type MultiWin = BaseWin & {
54
+ type: typeof PossibleWins.multi;
55
+ };
56
+ export type JokerWin = BaseWin & {
57
+ type: typeof PossibleWins.joker;
58
+ };
53
59
  export type JackpotWin = BaseWin & {
54
60
  type: typeof PossibleWins.jackpotMini | typeof PossibleWins.jackpotMinor | typeof PossibleWins.jackpotMajor | typeof PossibleWins.jackpotGrand;
55
61
  };
56
62
  export type CoinWin = BaseWin & {
57
63
  type: typeof PossibleWins.coin;
58
64
  };
59
- export type Win = StreakWin | FreeSpinWin | GambleWin | MysteryWin | EggWin | GoldWin | BigWin | BonusWin | SuperBonusWin | ScatterWin | RouletteWin | JackpotWin | CoinWin;
65
+ export type Win = StreakWin | FreeSpinWin | GambleWin | MysteryWin | EggWin | GoldWin | BigWin | BonusWin | SuperBonusWin | ScatterWin | RouletteWin | JackpotWin | CoinWin | MultiWin | JokerWin;
60
66
  /**
61
67
  * Type represents data that come from backend
62
68
  *
@@ -15,4 +15,6 @@ export declare const PossibleWins: {
15
15
  readonly bigWin: "big-win";
16
16
  readonly bonus: "bonus";
17
17
  readonly superBonus: "super-bonus";
18
+ readonly joker: "joker";
19
+ readonly multi: "multi";
18
20
  };
@@ -15,4 +15,6 @@ export const PossibleWins = {
15
15
  bigWin: "big-win",
16
16
  bonus: "bonus",
17
17
  superBonus: "super-bonus",
18
+ joker: "joker",
19
+ multi: "multi",
18
20
  };
@@ -75,6 +75,7 @@ export declare abstract class AbstractController<T> {
75
75
  protected canSkipActions(): boolean;
76
76
  protected onSpinningStart(): Promise<void>;
77
77
  protected onSpinningEnd(_spinLogic: SpinLogic): Promise<void>;
78
+ protected performActionsAfterSpin(): void;
78
79
  private spin;
79
80
  private handleFreeSpinPlateInvocation;
80
81
  protected handleFreeSpinSummaryPlateInvocation(): Promise<void>;
@@ -421,6 +421,7 @@ export class AbstractController {
421
421
  }
422
422
  async onSpinningStart() { }
423
423
  async onSpinningEnd(_spinLogic) { }
424
+ performActionsAfterSpin() { }
424
425
  async spin() {
425
426
  if (this.uiController.currentBalance < RainMan.settingsStore.bet) {
426
427
  try {
@@ -541,6 +542,7 @@ export class AbstractController {
541
542
  RainMan.settingsStore.setRoundNumber(this.roundNumber);
542
543
  this.handleDisablingButtons();
543
544
  RainMan.settingsStore.setModalsAvailability(true);
545
+ this.performActionsAfterSpin();
544
546
  }
545
547
  async handleFreeSpinPlateInvocation(numberOfFreeSpins, isAdditionalFreeSpin = false) {
546
548
  await this.buttonsEventManager.disableButtonsForAction(async () => {
@@ -8,5 +8,6 @@ export declare class QuickStopController {
8
8
  constructor(buttonsEventManager: ButtonsEventManager);
9
9
  handleInvokingSpeedPopup(): void;
10
10
  handleSpeedPopupInvocation(): void;
11
+ setSpeedPopupDisabled(value: boolean): void;
11
12
  handleResetCounter(shouldReset: boolean): void;
12
13
  }
@@ -9,6 +9,7 @@ export class QuickStopController {
9
9
  speedPopupDisabled = false;
10
10
  constructor(buttonsEventManager) {
11
11
  this.buttonsEventManager = buttonsEventManager;
12
+ RainMan.globals.disableSpeedPopup = this.handleSpeedPopupInvocation.bind(this);
12
13
  }
13
14
  handleInvokingSpeedPopup() {
14
15
  if (!this.quickStopCounterLock &&
@@ -29,6 +30,9 @@ export class QuickStopController {
29
30
  }
30
31
  this.quickStopCounterLock = false;
31
32
  }
33
+ setSpeedPopupDisabled(value) {
34
+ this.speedPopupDisabled = value;
35
+ }
32
36
  handleResetCounter(shouldReset) {
33
37
  if (shouldReset)
34
38
  this.quickStopsCounter = 0;
@@ -4,7 +4,7 @@ import { RainMan } from "../Rainman";
4
4
  import { ceilToDecimal } from "../utils";
5
5
  export class UiController {
6
6
  config;
7
- lastBet = 0;
7
+ lastBet = RainMan.settingsStore.bet ?? 0;
8
8
  _messageBox;
9
9
  _totalNumberOfFreeSpins = 0;
10
10
  _totalFreeSpinWinAmount = 0;
@@ -71,7 +71,7 @@ export class UiController {
71
71
  beforeUpdateBet(_lastBet) { }
72
72
  afterUpdateBet(_bet) { }
73
73
  updateBet(strategy) {
74
- if (RainMan.settingsStore.isFreeSpinsPlayEnabled || RainMan.settingsStore.isAutoplayEnabled)
74
+ if (RainMan.settingsStore.isFreeSpinsPlayEnabled)
75
75
  return;
76
76
  const bet = this.getNewBet(strategy);
77
77
  this.beforeUpdateBet(this.lastBet);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
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",