pixi-rainman-game-engine 0.3.32 → 0.3.33-beta.1

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.
@@ -10,5 +10,8 @@ export declare class DescribedPlayableAction<T> {
10
10
  winAmount: Nullable<number>;
11
11
  skipLooping: boolean;
12
12
  isFirstStreak: boolean;
13
+ animationTarget: {
14
+ isCurrentAnimationPastHalf?: () => boolean;
15
+ } | null;
13
16
  constructor(type: T, action: PlayableAction, winAmount?: Nullable<number>, skipLooping?: boolean);
14
17
  }
@@ -9,6 +9,7 @@ export class DescribedPlayableAction {
9
9
  winAmount;
10
10
  skipLooping;
11
11
  isFirstStreak = false;
12
+ animationTarget = null;
12
13
  constructor(type, action, winAmount = null, skipLooping = false) {
13
14
  this.type = type;
14
15
  this.action = action;
@@ -98,6 +98,7 @@ export declare abstract class AbstractSymbolBase extends Container implements Sp
98
98
  * @returns {Promise<void>} - A promise that resolves when the animation is complete
99
99
  */
100
100
  play(suffix?: string): Promise<void>;
101
+ isCurrentAnimationPastHalf(): boolean;
101
102
  /**
102
103
  * Function for stopping the symbol animation.
103
104
  * @public
@@ -214,6 +214,18 @@ export class AbstractSymbolBase extends Container {
214
214
  });
215
215
  });
216
216
  }
217
+ isCurrentAnimationPastHalf() {
218
+ const entry = this.spine.state.tracks[0];
219
+ if (!entry) {
220
+ return false;
221
+ }
222
+ const trackTime = entry.trackTime ?? 0;
223
+ const animationEnd = entry.animationEnd ?? 0;
224
+ if (animationEnd <= 0) {
225
+ return false;
226
+ }
227
+ return trackTime >= animationEnd / 2;
228
+ }
217
229
  /**
218
230
  * Function for stopping the symbol animation.
219
231
  * @public
@@ -59,6 +59,9 @@ export declare abstract class AbstractController<T> {
59
59
  shouldStopMobileSpin: boolean;
60
60
  disableMessageBoxChange: boolean;
61
61
  shouldClearQuickReelsStopAfterSpin: boolean;
62
+ protected firstAnimationTarget: {
63
+ isCurrentAnimationPastHalf?: () => boolean;
64
+ } | null;
62
65
  protected resolveBigWin?: () => void;
63
66
  protected resolveMysteryWin?: () => void;
64
67
  protected resolveBonusWin?: () => void;
@@ -59,6 +59,7 @@ export class AbstractController {
59
59
  shouldStopMobileSpin = false;
60
60
  disableMessageBoxChange = false;
61
61
  shouldClearQuickReelsStopAfterSpin = false;
62
+ firstAnimationTarget = null;
62
63
  resolveBigWin;
63
64
  resolveMysteryWin;
64
65
  resolveBonusWin;
@@ -1143,6 +1144,8 @@ export class AbstractController {
1143
1144
  this.uiController.limitWinAmount(spinLogic.winTotalAmount);
1144
1145
  }
1145
1146
  this.composeWinActionsQueue(spinLogic);
1147
+ this.firstAnimationTarget =
1148
+ this.winActionsQueue.find((action) => action.animationTarget)?.animationTarget ?? null;
1146
1149
  if (spinLogic.winTotalAmount === 0 && this.invokeFreeSpinPlateAfterWin) {
1147
1150
  this.uiController.messageBox.hideCurrentWinText();
1148
1151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-rainman-game-engine",
3
- "version": "0.3.32",
3
+ "version": "0.3.33-beta.1",
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",