pixi-rainman-game-engine 0.1.34 → 0.1.36

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.
@@ -63,5 +63,6 @@ export type AppConfig = RequiredAppConfig & DeepPartial<OptionalAppConfig>;
63
63
  export interface Globals {
64
64
  currency: Currency;
65
65
  disableSpeedPopup?: (value: boolean) => void;
66
+ handleDisablingButtons?: (value?: boolean) => void;
66
67
  throttledSpin?: () => void;
67
68
  }
@@ -263,6 +263,7 @@ export class ButtonsEventManager {
263
263
  this.speedPopupShownAt = performance.now();
264
264
  const spinSpeedSettingsLayer = window.document.getElementById(UI_ITEMS.speedSettings);
265
265
  if (spinSpeedSettingsLayer !== null) {
266
+ RainMan.globals.handleDisablingButtons?.();
266
267
  spinSpeedSettingsLayer.style.display = displayValue;
267
268
  }
268
269
  }
@@ -125,6 +125,7 @@ export class MessageBox extends Container {
125
125
  if (RainMan.settingsStore.isFreeSpinsPlayEnabled && RainMan.config.disableFreeSpinText)
126
126
  return;
127
127
  this.hideIncentiveText();
128
+ this.hidePossibleWinText();
128
129
  if (this.currentWinShown)
129
130
  return;
130
131
  this.currentWinShown = true;
@@ -34,7 +34,7 @@ export declare abstract class AbstractSymbolBase extends Container {
34
34
  popSymbol(suffix?: string): Promise<void>;
35
35
  swapSymbol(symbolId: SymbolId): void;
36
36
  private setupClickListener;
37
- protected setSymbol(symbolId: SymbolId): void;
37
+ protected setSymbol(symbolId: SymbolId, shouldSwitchSprite?: boolean): void;
38
38
  protected resolveAndDestroyPlayingPromise(): void;
39
39
  protected abstract getResourceForSymbolId(symbolId: SymbolId): LoadersSpineData;
40
40
  protected abstract getAnimationNameForSymbol(symbolId: SymbolId, suffix?: string): string;
@@ -141,9 +141,10 @@ export class AbstractSymbolBase extends Container {
141
141
  togglePaytable();
142
142
  });
143
143
  }
144
- setSymbol(symbolId) {
144
+ setSymbol(symbolId, shouldSwitchSprite = true) {
145
145
  this._id = symbolId;
146
- this.switchSymbolBaseDisplayedObject("sprite");
146
+ if (shouldSwitchSprite)
147
+ this.switchSymbolBaseDisplayedObject("sprite");
147
148
  }
148
149
  resolveAndDestroyPlayingPromise() {
149
150
  if (this.endOfMultiplierAnimationPromise) {
@@ -1,12 +1,12 @@
1
1
  import { Container } from "pixi.js";
2
2
  import { SpeedAdapterInterface, SpeedLevel, SymbolId } from "../../application";
3
3
  import { DropTransformationDetails, SymbolReel } from "../../connectivity";
4
+ import { Nullable } from "../../utils";
4
5
  import { AbstractColumnsContainer, AbstractFrame } from "../frame";
5
6
  import { AbstractSymbolBase } from "./AbstractSymbolBase";
6
7
  import { AnimationTimeSettings } from "./types";
7
8
  /**
8
9
  * Class represent single column in ColumnsContainer
9
- * @date 12/04/2024 - 13:34:42
10
10
  *
11
11
  * @export
12
12
  * @abstract
@@ -40,7 +40,8 @@ export declare abstract class AbstractSymbolsColumn extends Container implements
40
40
  private triggerNextColumnPromise;
41
41
  private spinEndPromise;
42
42
  skipHidingMysteryFx: boolean;
43
- protected bonusSymbol: SymbolId | null;
43
+ protected bonusSymbol: Nullable<SymbolId>;
44
+ protected frozenSymbol: Nullable<AbstractSymbolBase>;
44
45
  private readonly _id;
45
46
  protected constructor(id: string, columnsContainer: AbstractColumnsContainer, allSymbols: SymbolId[]);
46
47
  protected abstract get tileHeight(): number;
@@ -84,5 +85,6 @@ export declare abstract class AbstractSymbolsColumn extends Container implements
84
85
  fixStationaryPositions(): void;
85
86
  private initStopTween;
86
87
  protected sortSymbols(): void;
88
+ protected areAnyFrozenTiles(): boolean;
87
89
  private ensureIsRightEnding;
88
90
  }
@@ -9,7 +9,6 @@ import { droppableSymbolsFactory } from "./DroppableSymbolsColumn";
9
9
  import { Phase, Speed } from "./types";
10
10
  /**
11
11
  * Class represent single column in ColumnsContainer
12
- * @date 12/04/2024 - 13:34:42
13
12
  *
14
13
  * @export
15
14
  * @abstract
@@ -44,6 +43,7 @@ export class AbstractSymbolsColumn extends Container {
44
43
  spinEndPromise = null;
45
44
  skipHidingMysteryFx = false;
46
45
  bonusSymbol = null;
46
+ frozenSymbol = null;
47
47
  _id;
48
48
  constructor(id, columnsContainer, allSymbols) {
49
49
  super();
@@ -321,7 +321,9 @@ export class AbstractSymbolsColumn extends Container {
321
321
  if (!this.topMostSymbol || this.phase === Phase.END)
322
322
  return;
323
323
  if (this.topMostSymbol.y >= this.tileHeight / 2) {
324
- if (!this.columnsContainer.quickReelsStop && RainMan.settingsStore.currentSpeed !== SPEED_LEVELS.fast)
324
+ if (!this.columnsContainer.quickReelsStop &&
325
+ RainMan.settingsStore.currentSpeed !== SPEED_LEVELS.fast &&
326
+ !this.areAnyFrozenTiles())
325
327
  SoundManager.play(this.shouldPlaySpecialRollStopSound() ? SoundTracks.specialSymbolOnReel : SoundTracks.rollStop);
326
328
  this.fixStationaryPositions();
327
329
  this.doStop();
@@ -445,6 +447,9 @@ export class AbstractSymbolsColumn extends Container {
445
447
  sortSymbols() {
446
448
  this.symbols = this.getSymbolsSortedByYPosition();
447
449
  }
450
+ areAnyFrozenTiles() {
451
+ return !!this.frozenSymbol;
452
+ }
448
453
  ensureIsRightEnding() {
449
454
  let position = 0;
450
455
  for (const symbol of this.symbols) {
@@ -34,7 +34,12 @@ export type SpinAndFreezeTransformationDetails = {
34
34
  symbolsOnReels: SymbolReels;
35
35
  coordinates: Point[];
36
36
  };
37
- export type TransformationDetails = DropTransformationDetails | VerticalTransformationDetails | ReplaceTransformationDetails | SpinTransformationDetails | FreezeTransformationDetails;
37
+ export type SwapTransformationDetails = {
38
+ type: typeof transformationTypes.swap;
39
+ coordinates: Point;
40
+ symbolId: SymbolId;
41
+ };
42
+ export type TransformationDetails = DropTransformationDetails | VerticalTransformationDetails | ReplaceTransformationDetails | SpinTransformationDetails | FreezeTransformationDetails | SwapTransformationDetails;
38
43
  export type RawVerticalTransformationDetails = {
39
44
  coordinates: Point;
40
45
  };
@@ -4,6 +4,7 @@ export declare const transformationTypes: {
4
4
  readonly set: "set";
5
5
  readonly freeze: "freeze";
6
6
  readonly spin: "spin";
7
+ readonly swap: "swap";
7
8
  readonly replace: "replace";
8
9
  readonly spinAndFreeze: "spinAndFreeze";
9
10
  readonly verticalExpand: "vertical-expand";
@@ -4,7 +4,8 @@ export const transformationTypes = {
4
4
  set: "set",
5
5
  freeze: "freeze",
6
6
  spin: "spin",
7
+ swap: "swap",
7
8
  replace: "replace",
8
9
  spinAndFreeze: "spinAndFreeze",
9
- verticalExpand: "vertical-expand"
10
+ verticalExpand: "vertical-expand",
10
11
  };
@@ -58,6 +58,7 @@ export class AbstractController {
58
58
  this.uiController = new UiController(this.config);
59
59
  this.componentRegistry = RainMan.componentRegistry;
60
60
  this.setupSpaceOrEnterListener();
61
+ RainMan.globals.handleDisablingButtons = this.handleDisablingButtons.bind(this);
61
62
  RainMan.settingsStore.increaseBet = () => this.uiController.updateBet("increase");
62
63
  RainMan.settingsStore.decreaseBet = () => this.uiController.updateBet("decrease");
63
64
  }
@@ -365,6 +366,7 @@ export class AbstractController {
365
366
  const elementsToSkipHide = [];
366
367
  if (performance.now() - this.buttonsEventManager.speedPopupShownAt <
367
368
  RainMan.config.durationOfActions.speedPopupVisibleTime) {
369
+ RainMan.globals.handleDisablingButtons?.();
368
370
  elementsToSkipHide.push(UI_ITEMS.speedSettings);
369
371
  }
370
372
  hideLayerIfPresent(elementsToSkipHide);
@@ -79,8 +79,6 @@ export class UiController {
79
79
  */
80
80
  afterUpdateBet(_bet) { }
81
81
  updateBet(strategy) {
82
- if (RainMan.settingsStore.isFreeSpinsPlayEnabled)
83
- return;
84
82
  const bet = this.getNewBet(strategy);
85
83
  this.beforeUpdateBet(this.lastBet);
86
84
  this.lastBet = bet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
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",