pixi-rainman-game-engine 0.1.12 → 0.1.14

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 { InitDataInterface, SpinDataInterface } from "../../connectivity";
1
+ import { InitDataInterface, InitExtraData, SpinDataInterface } from "../../connectivity";
2
2
  import { AdaptedSpinResponse } from "../SpinLogic";
3
3
  import { SymbolId } from "./SymbolId";
4
4
  import { TransformationTypeId } from "./TransformationTypesId";
@@ -17,6 +17,7 @@ export declare class ApiConfig {
17
17
  private readonly bets;
18
18
  private winMap;
19
19
  private transformationMap;
20
+ extraData: InitExtraData;
20
21
  /**
21
22
  * Create instance of ApiConfig, requires InitDataInterfac
22
23
  *
@@ -15,6 +15,7 @@ export class ApiConfig {
15
15
  bets;
16
16
  winMap = new Map();
17
17
  transformationMap = new Map();
18
+ extraData;
18
19
  /**
19
20
  * Create instance of ApiConfig, requires InitDataInterfac
20
21
  *
@@ -26,6 +27,7 @@ export class ApiConfig {
26
27
  }
27
28
  this.token = data.token;
28
29
  this.bets = data.bets;
30
+ this.extraData = data.extra_data;
29
31
  this.initSymbolMap(data);
30
32
  this.initWinMap(data);
31
33
  this.initStreakMap(data);
@@ -182,10 +184,16 @@ export class ApiConfig {
182
184
  * @param {InitDataInterface} data
183
185
  */
184
186
  initSymbolMap(data) {
187
+ if (Object.keys(RainMan.symbolIds).length !== data.symbols.length) {
188
+ logError(`🛑 SYMBOL_IDS does not match symbols_names!`);
189
+ logError(RainMan.symbolIds, data.symbols_names);
190
+ throw new Error("Check and fix SYMBOL_IDS");
191
+ }
185
192
  for (const [key, name] of data.symbols_names.entries()) {
186
193
  const backendId = data.symbols[key];
187
194
  if (!Object.values(RainMan.symbolIds).includes(name)) {
188
195
  logError(`🛑 "${name}" was not found in SymbolIds enum!`);
196
+ throw new Error("Check and fix SYMBOL_IDS");
189
197
  }
190
198
  this.symbolMap.set(backendId, name);
191
199
  }
@@ -44,8 +44,8 @@ export declare abstract class AbstractMainContainer extends Container {
44
44
  protected createFreeSpinSummary(_resolver: () => void, _freeSpinCount: number, _winAmount: number): AbstractFreeSpinContainer | null;
45
45
  invokeFreeSpinSummary(freeSpinCount: number, winAmount: number): Promise<void>;
46
46
  hideFreeSpinSummary(): void;
47
- private showOverlay;
48
- private hideOverlay;
47
+ protected showOverlay(): void;
48
+ protected hideOverlay(): void;
49
49
  get bigWinVisibleFor(): number;
50
50
  get mysteryWinVisibleFor(): number;
51
51
  protected abstract createBigWinContainer(): UpdatableSpineContainer;
@@ -3,10 +3,10 @@ export declare class AnimatedNumber extends Container {
3
3
  private spineName;
4
4
  private number;
5
5
  private digits;
6
- constructor(spineName: string, number: number);
6
+ constructor(spineName: string, number: number | string);
7
7
  private setDigits;
8
8
  private removeDigits;
9
- get value(): number;
10
- set value(value: number);
9
+ get value(): number | string;
10
+ set value(value: number | string);
11
11
  play(): void;
12
12
  }
@@ -16,6 +16,7 @@
16
16
  "youHaveWon": "YOU HAVE WON",
17
17
  "youHaveWonAdditional": "YOU HAVE WON ADDITIONAL",
18
18
  "freeSpins": "FREE SPINS",
19
+ "jackpot": "JACKPOT",
19
20
  "freeSpinsSummaryText": "In {{amount}} free spins",
20
21
  "freeSpinsSummaryTextShort": "In {{amount}}",
21
22
  "pressToContinue": "\"Press ME to continue...\"",
@@ -24,7 +25,8 @@
24
25
  "numberWithCurrency": "{{amount}}{{currency}}",
25
26
  "currentWin": "WIN: ",
26
27
  "currentFreeSpins": "FREE SPINS: ",
27
- "linePays": "LINE {{winLineNumber}} PAYS {{amount}}",
28
+ "linePays": "LINE PAYS {{amount}}",
29
+ "lineWithNumberPays": "LINE {{winLineNumber}} PAYS {{amount}}",
28
30
  "gamePays": "GAME PAYS {{amount}}",
29
31
  "scatterPays": "SCATTER PAYS {{amount}}",
30
32
  "idleMessages": {
@@ -14,6 +14,9 @@ export interface InitDataInterface {
14
14
  transformations_names: Array<string>;
15
15
  transformations_types: Array<number>;
16
16
  paytable: PayTableInterface;
17
+ extra_data: InitExtraData;
18
+ }
19
+ export interface InitExtraData {
17
20
  }
18
21
  type FixedQuantityValue = Record<string, {
19
22
  value: number | number[];
@@ -47,7 +47,13 @@ export type SuperBonusWin = BaseWin & {
47
47
  export type ScatterWin = BaseWin & {
48
48
  type: typeof PossibleWins.scatter;
49
49
  };
50
- export type Win = StreakWin | FreeSpinWin | GambleWin | MysteryWin | EggWin | GoldWin | BigWin | BonusWin | SuperBonusWin | ScatterWin;
50
+ export type RouletteWin = BaseWin & {
51
+ type: typeof PossibleWins.roulette;
52
+ };
53
+ export type JackpotWin = BaseWin & {
54
+ type: typeof PossibleWins.jackpotMini | typeof PossibleWins.jackpotMinor | typeof PossibleWins.jackpotMajor | typeof PossibleWins.jackpotGrand;
55
+ };
56
+ export type Win = StreakWin | FreeSpinWin | GambleWin | MysteryWin | EggWin | GoldWin | BigWin | BonusWin | SuperBonusWin | ScatterWin | RouletteWin | JackpotWin;
51
57
  /**
52
58
  * Type represents data that come from backend
53
59
  *
@@ -33,6 +33,7 @@ export declare abstract class AbstractController<T> {
33
33
  protected resolveBigWin?: () => void;
34
34
  protected resolveMysteryWin?: () => void;
35
35
  protected mysteryFxSymbol: SymbolId | null;
36
+ protected mysteryFxSymbolMustFormWinningLine: boolean;
36
37
  protected mysteryWinSymbol: Nullable<SymbolId>;
37
38
  private componentRegistry;
38
39
  protected _lastWinAmount: number;
@@ -57,7 +58,7 @@ export declare abstract class AbstractController<T> {
57
58
  protected changeGamePhase(newPhase: GamePhase): void;
58
59
  private setRefreshButtonBasedOnPhase;
59
60
  private setMessageBoxBasedOnPhase;
60
- private getReelIndexesToShowMysteryFx;
61
+ protected getReelIndexesToShowMysteryFx(spinLogic: SpinLogic): number[];
61
62
  protected handleSpinLogic(): void;
62
63
  protected throttledSpin(): void;
63
64
  private getBoughtNumberOfFreeSpins;
@@ -32,6 +32,7 @@ export class AbstractController {
32
32
  resolveBigWin;
33
33
  resolveMysteryWin;
34
34
  mysteryFxSymbol = null;
35
+ mysteryFxSymbolMustFormWinningLine = false;
35
36
  mysteryWinSymbol = null;
36
37
  componentRegistry;
37
38
  _lastWinAmount = 0;
@@ -41,11 +42,9 @@ export class AbstractController {
41
42
  this.connection = connection;
42
43
  const initData = this.connection.initData();
43
44
  this.config = new ApiConfig(initData);
44
- this.buttonsEventManager = buttonsEventManager;
45
45
  this.quickStopController = new QuickStopController(buttonsEventManager);
46
46
  this.uiController = new UiController(this.config);
47
47
  this.componentRegistry = RainMan.componentRegistry;
48
- this.init();
49
48
  this.setupSpaceOrEnterListener();
50
49
  }
51
50
  init() {
@@ -236,6 +235,7 @@ export class AbstractController {
236
235
  getReelIndexesToShowMysteryFx(spinLogic) {
237
236
  const { onStopBlindsConfiguration } = spinLogic;
238
237
  const reelsIndexesWithScatter = [];
238
+ const streak = [];
239
239
  let howManyScattersAppeared = 0;
240
240
  for (let columnIndex = 0; columnIndex < RainMan.config.numberOfColumns; columnIndex++) {
241
241
  if (howManyScattersAppeared >= 2) {
@@ -245,9 +245,13 @@ export class AbstractController {
245
245
  const symbol = onStopBlindsConfiguration[columnIndex][rowIndex];
246
246
  if (symbol === this.mysteryFxSymbol) {
247
247
  howManyScattersAppeared++;
248
+ streak.push(rowIndex);
249
+ break;
248
250
  }
249
251
  }
250
252
  }
253
+ if (this.mysteryFxSymbolMustFormWinningLine)
254
+ return this.config.streakMap.has(streak.join("")) ? reelsIndexesWithScatter : [];
251
255
  return reelsIndexesWithScatter;
252
256
  }
253
257
  handleSpinLogic() {
@@ -1,7 +1,7 @@
1
1
  import { SpinData, SymbolReels } from "../../connectivity";
2
2
  export declare const logInfo: (...params: unknown[]) => false | void;
3
- export declare const logError: (message: string) => false | void;
4
- export declare const logWarn: (message: string) => false | void;
3
+ export declare const logError: (...message: unknown[]) => false | void;
4
+ export declare const logWarn: (...message: unknown[]) => false | void;
5
5
  export declare const logGroup: (...params: unknown[]) => false | void;
6
6
  export declare const logGroupEnd: () => false | void;
7
7
  export declare const debugSpinData: (data: SpinData) => void;
@@ -3,8 +3,8 @@ import { AbstractColumnsContainer } from "../../components";
3
3
  import { RainMan } from "../../Rainman";
4
4
  const DEBUG_ENABLED = process.env.NODE_ENV === "development";
5
5
  export const logInfo = (...params) => DEBUG_ENABLED && console.info("[RainMan][INFO]:", ...params);
6
- export const logError = (message) => DEBUG_ENABLED && console.error("[RainMan][ERROR]:", message);
7
- export const logWarn = (message) => DEBUG_ENABLED && console.warn("[RainMan][WARN]:", message);
6
+ export const logError = (...message) => DEBUG_ENABLED && console.error("[RainMan][ERROR]:", ...message);
7
+ export const logWarn = (...message) => DEBUG_ENABLED && console.warn("[RainMan][WARN]:", ...message);
8
8
  export const logGroup = (...params) => DEBUG_ENABLED && console.group("[RainMan][Group]\n", ...params);
9
9
  export const logGroupEnd = () => DEBUG_ENABLED && console.groupEnd();
10
10
  export const debugSpinData = (data) => {
@@ -12,8 +12,8 @@ import { PositioningFrame } from "./PositioningFrame";
12
12
  * @extends {Container}
13
13
  */
14
14
  export declare class UpdatableSpineContainer extends Container {
15
- protected text: StylefulUpdatableText;
16
- protected spine: ScalableSpine;
15
+ text: StylefulUpdatableText;
16
+ spine: ScalableSpine;
17
17
  protected frame: PositioningFrame;
18
18
  private emitters;
19
19
  private spineScale;
@@ -28,10 +28,10 @@ export class UpdatableSpineContainer extends Container {
28
28
  this.sortableChildren = true;
29
29
  RainMan.componentRegistry.add(this.text);
30
30
  this.addChild(this.frame);
31
+ this.emitters.forEach((emitter) => this.addChild(emitter));
31
32
  this.addChild(this.spine);
32
33
  this.addChild(this.text);
33
34
  this.fitToScreen();
34
- this.emitters.forEach((emitter) => this.addChild(emitter));
35
35
  Ticker.shared.add(this.animateBox, this);
36
36
  }
37
37
  positionText() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
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",