pixi-rainman-game-engine 0.2.0 → 0.2.2
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.
- package/dist/DescribedPlayableAction/DescribedPlayableAction.d.ts +1 -1
- package/dist/DescribedPlayableAction/DescribedPlayableAction.js +1 -1
- package/dist/Rainman/Rainman.d.ts +10 -0
- package/dist/Rainman/Rainman.js +10 -0
- package/dist/application/ApiConfig/SymbolId.d.ts +8 -0
- package/dist/application/ApiConfig/WinTypeId.d.ts +6 -0
- package/dist/application/SpinLogic/WinScenarios.d.ts +1 -1
- package/dist/application/SpinLogic/WinScenarios.js +1 -1
- package/dist/components/buttons/BaseButton/ButtonState.d.ts +11 -0
- package/dist/components/buttons/BaseButton/ButtonState.js +11 -0
- package/dist/components/common/AnimatedNumber.d.ts +4 -0
- package/dist/components/common/AnimatedNumber.js +4 -0
- package/dist/components/common/ResumableContainers.d.ts +1 -1
- package/dist/components/common/ResumableContainers.js +1 -1
- package/dist/components/frame/AbstractColumnsContainer.js +0 -3
- package/dist/components/frame/AbstractFrame.d.ts +16 -1
- package/dist/components/frame/AbstractFrame.js +16 -1
- package/dist/components/frame/AbstractInnerFrame.d.ts +1 -1
- package/dist/components/frame/AbstractInnerFrame.js +1 -1
- package/dist/components/symbols/AbstractSymbolBase.d.ts +1 -1
- package/dist/components/symbols/AbstractSymbolsColumn.d.ts +1 -2
- package/dist/components/symbols/AbstractSymbolsColumn.js +3 -7
- package/dist/components/symbols/DroppableSymbol.d.ts +1 -1
- package/dist/components/symbols/DroppableSymbol.js +1 -1
- package/dist/connectivity/serverData.d.ts +3 -0
- package/dist/connectivity/transformation.d.ts +3 -0
- package/dist/constants/gamePhase.d.ts +1 -1
- package/dist/constants/gamePhase.js +1 -1
- package/dist/constants/transformation.d.ts +3 -0
- package/dist/constants/transformation.js +3 -0
- package/dist/constants/wins.d.ts +3 -0
- package/dist/constants/wins.js +3 -0
- package/dist/controllers/AbstractController.d.ts +86 -1
- package/dist/controllers/AbstractController.js +78 -1
- package/dist/controllers/QuickStopController.d.ts +2 -1
- package/dist/controllers/QuickStopController.js +2 -1
- package/dist/controllers/UiController.d.ts +8 -0
- package/dist/controllers/UiController.js +8 -1
- package/dist/layers/layers.d.ts +16 -0
- package/dist/layers/layers.js +16 -0
- package/dist/stores/SettingsStore.d.ts +20 -0
- package/dist/stores/SettingsStore.js +20 -0
- package/dist/utils/common/functions.d.ts +18 -0
- package/dist/utils/common/functions.js +18 -0
- package/dist/utils/common/placementHelpers.d.ts +5 -0
- package/dist/utils/common/placementHelpers.js +5 -0
- package/dist/winComponents/AnimableParticlesEmitter.d.ts +1 -1
- package/dist/winComponents/AnimableParticlesEmitter.js +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,16 @@ import { SymbolIds, WinTypeIds } from "../application";
|
|
|
4
4
|
import { ComponentRegistry } from "../ComponentRegistry";
|
|
5
5
|
import { SettingsStore } from "../stores";
|
|
6
6
|
import { AppConfig, Globals, OptionalAppConfig, RequiredAppConfig } from "./types";
|
|
7
|
+
/**
|
|
8
|
+
* This class represents Pixi application. Before initializing game, user has to configure following:
|
|
9
|
+
* - {@link Application}
|
|
10
|
+
* - {@link RequiredAppConfig} and {@link OptionalAppConfig}
|
|
11
|
+
* - {@link SymbolIds} present in `gameEngineConfig`
|
|
12
|
+
* - {@link WinTypeIds} present in `gameEngineConfig`
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @class RainMan
|
|
16
|
+
*/
|
|
7
17
|
export declare class RainMan {
|
|
8
18
|
static app: Application;
|
|
9
19
|
static config: RequiredAppConfig & OptionalAppConfig;
|
package/dist/Rainman/Rainman.js
CHANGED
|
@@ -4,6 +4,16 @@ import { Currencies } from "ts-money";
|
|
|
4
4
|
import { ComponentRegistry } from "../ComponentRegistry";
|
|
5
5
|
import { settingStore } from "../SettingsUI/hooks";
|
|
6
6
|
import { defaultAppConfig } from "./appConfig";
|
|
7
|
+
/**
|
|
8
|
+
* This class represents Pixi application. Before initializing game, user has to configure following:
|
|
9
|
+
* - {@link Application}
|
|
10
|
+
* - {@link RequiredAppConfig} and {@link OptionalAppConfig}
|
|
11
|
+
* - {@link SymbolIds} present in `gameEngineConfig`
|
|
12
|
+
* - {@link WinTypeIds} present in `gameEngineConfig`
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @class RainMan
|
|
16
|
+
*/
|
|
7
17
|
export class RainMan {
|
|
8
18
|
static app;
|
|
9
19
|
static config;
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
* Interface for specifying symbols in game
|
|
3
3
|
* This type can be modified for each game in engine.d.ts file
|
|
4
4
|
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```
|
|
7
|
+
* interface SymbolIds {
|
|
8
|
+
* cherries: "cherries",
|
|
9
|
+
* lemon: "lemon",
|
|
10
|
+
* }
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
5
13
|
* @export
|
|
6
14
|
* @interface SymbolIds
|
|
7
15
|
* @typedef {SymbolIds}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransformationDetails, Win } from "../../connectivity";
|
|
2
2
|
/**
|
|
3
|
-
* This class represents win scenarios
|
|
3
|
+
* This class represents win and transformation scenarios described in {@link transformationTypes} and {@link PossibleWins}
|
|
4
4
|
*
|
|
5
5
|
* @exports {WinScenarios}
|
|
6
6
|
*/
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes all button states in game
|
|
3
|
+
*@example
|
|
4
|
+
* ```
|
|
5
|
+
* const textureMap = {
|
|
6
|
+
* [ButtonStates.NORMAL]: getTexture("continueButton-normal.png"),
|
|
7
|
+
* [ButtonStates.CLICKED]: getTexture("continueButton-clicked.png"),
|
|
8
|
+
* [ButtonStates.OVER]: getTexture("continueButton-hover.png"),
|
|
9
|
+
* } as TextureMap;
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
1
12
|
export declare const ButtonStates: {
|
|
2
13
|
readonly NORMAL: "NORMAL";
|
|
3
14
|
readonly OVER: "OVER";
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes all button states in game
|
|
3
|
+
*@example
|
|
4
|
+
* ```
|
|
5
|
+
* const textureMap = {
|
|
6
|
+
* [ButtonStates.NORMAL]: getTexture("continueButton-normal.png"),
|
|
7
|
+
* [ButtonStates.CLICKED]: getTexture("continueButton-clicked.png"),
|
|
8
|
+
* [ButtonStates.OVER]: getTexture("continueButton-hover.png"),
|
|
9
|
+
* } as TextureMap;
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
1
12
|
export const ButtonStates = {
|
|
2
13
|
NORMAL: "NORMAL",
|
|
3
14
|
OVER: "OVER",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
|
+
/**
|
|
3
|
+
* Class representing animated number, based on spine animation.
|
|
4
|
+
* Animation names should be exact the same as a represented symbol.
|
|
5
|
+
*/
|
|
2
6
|
export declare class AnimatedNumber extends Container {
|
|
3
7
|
private spineName;
|
|
4
8
|
private number;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Container } from "pixi.js";
|
|
2
2
|
import { Spine } from "pixi-spine";
|
|
3
3
|
import { getSpineData } from "../../utils";
|
|
4
|
+
/**
|
|
5
|
+
* Class representing animated number, based on spine animation.
|
|
6
|
+
* Animation names should be exact the same as a represented symbol.
|
|
7
|
+
*/
|
|
4
8
|
export class AnimatedNumber extends Container {
|
|
5
9
|
spineName;
|
|
6
10
|
number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Container, Sprite } from "pixi.js";
|
|
2
2
|
import { Spine } from "pixi-spine";
|
|
3
3
|
/**
|
|
4
|
-
* Class representing container with all spines
|
|
4
|
+
* Class representing container with all spines. Every used spine have to be put in `allSpines` array to enable battery saver functionality
|
|
5
5
|
*
|
|
6
6
|
* @extends {Spine}
|
|
7
7
|
* @class
|
|
@@ -2,7 +2,7 @@ import { Container, Sprite } from "pixi.js";
|
|
|
2
2
|
import { Spine } from "pixi-spine";
|
|
3
3
|
import { setTimeScale } from "../../utils";
|
|
4
4
|
/**
|
|
5
|
-
* Class representing container with all spines
|
|
5
|
+
* Class representing container with all spines. Every used spine have to be put in `allSpines` array to enable battery saver functionality
|
|
6
6
|
*
|
|
7
7
|
* @extends {Spine}
|
|
8
8
|
* @class
|
|
@@ -93,9 +93,6 @@ export class AbstractColumnsContainer extends Container {
|
|
|
93
93
|
const configureSpinAction = configuredBlindSpinsActions.shift();
|
|
94
94
|
if (configureSpinAction !== undefined) {
|
|
95
95
|
if (indexesOfReelsToExtendSpinningTime.includes(index)) {
|
|
96
|
-
indexesOfReelsToExtendSpinningTime.forEach((number) => {
|
|
97
|
-
this.allColumns[number].changeMultiplier();
|
|
98
|
-
});
|
|
99
96
|
this.currentColumn = this.allColumns[index];
|
|
100
97
|
this.currentColumn.adaptToSpeed(RainMan.settingsStore.currentSpeed);
|
|
101
98
|
frame.invokeMysteryFx(this.currentColumn.x, this.currentColumn.y);
|
|
@@ -7,7 +7,8 @@ import { AbstractInnerFrame } from "./AbstractInnerFrame";
|
|
|
7
7
|
import { MysteryFxCoordinates } from "./types";
|
|
8
8
|
import { WinLineAnimation } from "./WinLineAnimation";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Class aggregating all reels and activities related to them. Each frame has its own proportions, which allow for proper positioning on the screen.
|
|
11
|
+
* This represents all of elements in center frame like {@link ColumnsContainer}, frame animation (on {@link FrameLayer})
|
|
11
12
|
*
|
|
12
13
|
* @export
|
|
13
14
|
* @abstract
|
|
@@ -35,13 +36,27 @@ export declare abstract class AbstractFrame extends ResumableContainer implement
|
|
|
35
36
|
protected constructor(spineName: string);
|
|
36
37
|
get columnsContainer(): AbstractColumnsContainer;
|
|
37
38
|
adaptToSpeed(speedLevel: SpeedLevel): void;
|
|
39
|
+
/**
|
|
40
|
+
* Invoke mystery fx on symbol position
|
|
41
|
+
*
|
|
42
|
+
* @param x {number}
|
|
43
|
+
* @param y {number}
|
|
44
|
+
*/
|
|
38
45
|
invokeMysteryFx(x: number, y: number): void;
|
|
39
46
|
protected repositionMysteryFx(_x: number, _y: number): void;
|
|
40
47
|
hideMysteryFx(): void;
|
|
41
48
|
private resetMysteryFxCoordinates;
|
|
42
49
|
destroyMysteryFx(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Create win line animation, individual for each game, based on {@link WinLineAnimation}
|
|
52
|
+
* */
|
|
43
53
|
protected createWinLineAnimation(_animationName: string): WinLineAnimation | null;
|
|
44
54
|
playAllWinLineAnimations(animationNames: string[]): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Creates and plays win line animation.
|
|
57
|
+
*
|
|
58
|
+
* @param animationName
|
|
59
|
+
*/
|
|
45
60
|
playWinLineAnimation(animationName: string): Promise<void>;
|
|
46
61
|
stopPlayingWinLineAnimations(): void;
|
|
47
62
|
isPlayingWinLineAnimation(): boolean;
|
|
@@ -5,7 +5,8 @@ import { RainMan } from "../../Rainman";
|
|
|
5
5
|
import { getDeviceOrientation, getSpineData, logError, scaleToParent } from "../../utils";
|
|
6
6
|
import { ResumableContainer } from "../common";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Class aggregating all reels and activities related to them. Each frame has its own proportions, which allow for proper positioning on the screen.
|
|
9
|
+
* This represents all of elements in center frame like {@link ColumnsContainer}, frame animation (on {@link FrameLayer})
|
|
9
10
|
*
|
|
10
11
|
* @export
|
|
11
12
|
* @abstract
|
|
@@ -35,6 +36,12 @@ export class AbstractFrame extends ResumableContainer {
|
|
|
35
36
|
adaptToSpeed(speedLevel) {
|
|
36
37
|
this.velocityMultiplier = this.speedLevelMapper[speedLevel];
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Invoke mystery fx on symbol position
|
|
41
|
+
*
|
|
42
|
+
* @param x {number}
|
|
43
|
+
* @param y {number}
|
|
44
|
+
*/
|
|
38
45
|
invokeMysteryFx(x, y) {
|
|
39
46
|
if (!this.mysteryFxConfig)
|
|
40
47
|
return;
|
|
@@ -78,12 +85,20 @@ export class AbstractFrame extends ResumableContainer {
|
|
|
78
85
|
this.mysteryFxHighlight = null;
|
|
79
86
|
}
|
|
80
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Create win line animation, individual for each game, based on {@link WinLineAnimation}
|
|
90
|
+
* */
|
|
81
91
|
createWinLineAnimation(_animationName) {
|
|
82
92
|
return null;
|
|
83
93
|
}
|
|
84
94
|
async playAllWinLineAnimations(animationNames) {
|
|
85
95
|
await Promise.allSettled(animationNames.map((animationName) => this.playWinLineAnimation(animationName)));
|
|
86
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Creates and plays win line animation.
|
|
99
|
+
*
|
|
100
|
+
* @param animationName
|
|
101
|
+
*/
|
|
87
102
|
async playWinLineAnimation(animationName) {
|
|
88
103
|
const winLineAnimation = this.createWinLineAnimation(animationName);
|
|
89
104
|
if (winLineAnimation === null) {
|
|
@@ -12,7 +12,7 @@ import { LoadersSpineData, Nullable } from "../../utils";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare abstract class AbstractSymbolBase extends Container {
|
|
14
14
|
private multiplierSpineName;
|
|
15
|
-
|
|
15
|
+
symbolImage: Sprite;
|
|
16
16
|
spine: Spine;
|
|
17
17
|
protected destroySuffix: string;
|
|
18
18
|
protected animationSpeedMultiplier: number;
|
|
@@ -6,7 +6,7 @@ import { AbstractColumnsContainer, AbstractFrame } from "../frame";
|
|
|
6
6
|
import { AbstractSymbolBase } from "./AbstractSymbolBase";
|
|
7
7
|
import { AnimationTimeSettings } from "./types";
|
|
8
8
|
/**
|
|
9
|
-
* Class represent single column in ColumnsContainer
|
|
9
|
+
* Class represent single column in {@link ColumnsContainer}. It contains array of {@link AbstractSymbolBase}
|
|
10
10
|
*
|
|
11
11
|
* @export
|
|
12
12
|
* @abstract
|
|
@@ -52,7 +52,6 @@ export declare abstract class AbstractSymbolsColumn extends Container implements
|
|
|
52
52
|
get id(): string;
|
|
53
53
|
protected get componentsTimingSettings(): AnimationTimeSettings;
|
|
54
54
|
adaptToSpeed(speedLevel: SpeedLevel): void;
|
|
55
|
-
changeMultiplier(): void;
|
|
56
55
|
speedUpForMysterySpin(velocity: number, duration: number): Promise<void>;
|
|
57
56
|
changeVelocity(velocity: number, duration: number, frame?: AbstractFrame): Promise<void>;
|
|
58
57
|
protected animateDependentComponents(_distance: number): void;
|
|
@@ -8,7 +8,7 @@ import { logInfo } from "../../utils";
|
|
|
8
8
|
import { droppableSymbolsFactory } from "./DroppableSymbolsColumn";
|
|
9
9
|
import { Phase, Speed } from "./types";
|
|
10
10
|
/**
|
|
11
|
-
* Class represent single column in ColumnsContainer
|
|
11
|
+
* Class represent single column in {@link ColumnsContainer}. It contains array of {@link AbstractSymbolBase}
|
|
12
12
|
*
|
|
13
13
|
* @export
|
|
14
14
|
* @abstract
|
|
@@ -80,15 +80,11 @@ export class AbstractSymbolsColumn extends Container {
|
|
|
80
80
|
this.velocityMultiplier = this.speedLevelMapper[speedLevel];
|
|
81
81
|
this.symbols.forEach((symbol) => symbol.updateTimeScaleOfSpine(this.velocityMultiplier));
|
|
82
82
|
}
|
|
83
|
-
changeMultiplier() {
|
|
84
|
-
this.velocityMultiplier = 3.5;
|
|
85
|
-
}
|
|
86
83
|
async speedUpForMysterySpin(velocity, duration) {
|
|
87
84
|
await new Promise((resolve) => {
|
|
88
85
|
this.resolveMysterySpeedUp = resolve;
|
|
89
|
-
this.tween = new TWEEN.Tween({ velocity:
|
|
90
|
-
.to({
|
|
91
|
-
.easing(TWEEN.Easing.Linear.None)
|
|
86
|
+
this.tween = new TWEEN.Tween({ velocity: Speed.FAST })
|
|
87
|
+
.to({ velocity: velocity }, duration)
|
|
92
88
|
.onUpdate((value) => {
|
|
93
89
|
this.velocity = value.velocity;
|
|
94
90
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SymbolId } from "../../application";
|
|
2
2
|
import { AbstractSymbolBase } from "./AbstractSymbolBase";
|
|
3
3
|
/**
|
|
4
|
-
* This class represents symbol that can be dropped from column
|
|
4
|
+
* This class represents symbol that can be dropped from column. Based on transformation type `drop` from {@link transformationTypes}
|
|
5
5
|
*
|
|
6
6
|
* @export
|
|
7
7
|
* @class DroppableSymbol
|
|
@@ -60,6 +60,9 @@ export interface RangeSymbolMultiplierTable {
|
|
|
60
60
|
type: typeof PaytableTypes.range;
|
|
61
61
|
quantity: RangeQuantityValue;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Type for symbol (or jackpots if present) paytables
|
|
65
|
+
*/
|
|
63
66
|
export type SymbolMultiplierTable = FixedSymbolMultiplierTable | RangeSymbolMultiplierTable;
|
|
64
67
|
export type PayTableInterface = Record<string, SymbolMultiplierTable>;
|
|
65
68
|
export interface SpinDataInterface {
|
package/dist/constants/wins.d.ts
CHANGED
package/dist/constants/wins.js
CHANGED
|
@@ -10,7 +10,7 @@ import { SpinDataWithLogic } from "./types";
|
|
|
10
10
|
import { UiController } from "./UiController";
|
|
11
11
|
/**
|
|
12
12
|
* Abstract controller class for games, this class control game flow
|
|
13
|
-
* and handle all game logic
|
|
13
|
+
* and handle all game logic, including wins, transformations
|
|
14
14
|
*
|
|
15
15
|
* @abstract
|
|
16
16
|
* @class AbstractController
|
|
@@ -56,6 +56,9 @@ export declare abstract class AbstractController<T> {
|
|
|
56
56
|
* Function for initializing function after timeout
|
|
57
57
|
*/
|
|
58
58
|
reinitializeUserBalanceData(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Function for reinitializing all buttons
|
|
61
|
+
*/
|
|
59
62
|
reinitializeAllButtons(): void;
|
|
60
63
|
private setupSpaceOrEnterListener;
|
|
61
64
|
disableBetButtons(shouldBeDisabled: boolean): void;
|
|
@@ -65,7 +68,17 @@ export declare abstract class AbstractController<T> {
|
|
|
65
68
|
private initButtons;
|
|
66
69
|
private initBetButtons;
|
|
67
70
|
private initSpinButton;
|
|
71
|
+
/**
|
|
72
|
+
* This function is responsible for checking if buttons (not bet buttons) should be disabled
|
|
73
|
+
*
|
|
74
|
+
* @return {boolean}
|
|
75
|
+
*/
|
|
68
76
|
get shouldButtonsBeDisabled(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* This function is responsible for checking if bet buttons should be disabled
|
|
79
|
+
*
|
|
80
|
+
* @return {boolean}
|
|
81
|
+
*/
|
|
69
82
|
get shouldBetButtonsBeDisabled(): boolean;
|
|
70
83
|
get lastWinAmount(): number;
|
|
71
84
|
get balance(): number;
|
|
@@ -90,6 +103,10 @@ export declare abstract class AbstractController<T> {
|
|
|
90
103
|
protected changeGamePhase(newPhase: GamePhase): void;
|
|
91
104
|
private setRefreshButtonBasedOnPhase;
|
|
92
105
|
private setMessageBoxBasedOnPhase;
|
|
106
|
+
/**
|
|
107
|
+
* This function is responsible for getting indexes of reels which should show mystery fx, based on {@link spinLogic}
|
|
108
|
+
* @param {SpinLogic} spinLogic
|
|
109
|
+
*/
|
|
93
110
|
protected getReelIndexesToShowMysteryFx(spinLogic: SpinLogic): number[];
|
|
94
111
|
/**
|
|
95
112
|
* Function is responsible for initializing the spin process
|
|
@@ -106,6 +123,9 @@ export declare abstract class AbstractController<T> {
|
|
|
106
123
|
* Function for autoplay spin
|
|
107
124
|
*/
|
|
108
125
|
protected autoplaySpin(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Function for clearing and destroying actions in win actions queue
|
|
128
|
+
*/
|
|
109
129
|
protected clearAndDestroyActions(): void;
|
|
110
130
|
/**
|
|
111
131
|
* Function disabling autoplay functionality
|
|
@@ -120,6 +140,11 @@ export declare abstract class AbstractController<T> {
|
|
|
120
140
|
* @param {SpinLogic} _spinLogic
|
|
121
141
|
*/
|
|
122
142
|
protected onDataFetch(_spinData: SpinData, _spinLogic: SpinLogic): void;
|
|
143
|
+
/**
|
|
144
|
+
* Getter for extra data for some games
|
|
145
|
+
*
|
|
146
|
+
* @returns {ExtraDataRequest}
|
|
147
|
+
*/
|
|
123
148
|
protected getExtraData(): ExtraDataRequest;
|
|
124
149
|
/**
|
|
125
150
|
* Function for fetching and preparing spin data
|
|
@@ -127,6 +152,10 @@ export declare abstract class AbstractController<T> {
|
|
|
127
152
|
* @returns {SpinDataWithLogic}
|
|
128
153
|
*/
|
|
129
154
|
protected fetchAndPrepareSpinData(): Promise<SpinDataWithLogic>;
|
|
155
|
+
/**
|
|
156
|
+
* Checks if we can skip action based on conditions. By default it checks {@link !this.isPlayingUnskippableStreak}
|
|
157
|
+
*
|
|
158
|
+
*/
|
|
130
159
|
protected canSkipActions(): boolean;
|
|
131
160
|
protected onSpinningStart(): Promise<void>;
|
|
132
161
|
protected onSpinningEnd(_spinLogic: SpinLogic): Promise<void>;
|
|
@@ -146,16 +175,53 @@ export declare abstract class AbstractController<T> {
|
|
|
146
175
|
* @returns {Promise<void>}
|
|
147
176
|
*/
|
|
148
177
|
private spin;
|
|
178
|
+
/**
|
|
179
|
+
* Function for invoking free spin plate, invoked in mainContainer
|
|
180
|
+
* ```ts
|
|
181
|
+
* this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins, isAdditionalFreeSpin);
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @param numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
|
|
185
|
+
* @param isAdditionalFreeSpin - flag for displaying additional free spins
|
|
186
|
+
*/
|
|
149
187
|
private handleFreeSpinPlateInvocation;
|
|
188
|
+
/**
|
|
189
|
+
* Function for invoking free spin summary plate, invoked in mainContainer
|
|
190
|
+
* ```ts
|
|
191
|
+
* this.mainContainer.invokeFreeSpinSummary(numberOfFreeSpins, totalFreeSpinWinAmount);
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
150
194
|
protected handleFreeSpinSummaryPlateInvocation(): Promise<void>;
|
|
151
195
|
private handleAutoplayLogic;
|
|
152
196
|
private lockLogicWhileSpinning;
|
|
153
197
|
private unlockLogicAfterSpinning;
|
|
154
198
|
protected stopPlayingSymbolsStreak(): void;
|
|
155
199
|
protected stopPlayingSymbolsTransformation(): void;
|
|
200
|
+
/**
|
|
201
|
+
* Function for displaying big win. Invoking that by `this.mainContainer.invokeBigWin();` and destroying it by `this.mainContainer.destroyBigWin();`
|
|
202
|
+
*
|
|
203
|
+
* @param customAmount - amount of win, if not provided, `RainMan.settingsStore.bet` will be used
|
|
204
|
+
*/
|
|
156
205
|
protected countBigWin(customAmount?: number): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Function for displaying bonus win. Invoking that by `this.mainContainer.invokeBonusWin();` and destroying it by `this.mainContainer.destroyBonusWin();`
|
|
208
|
+
*
|
|
209
|
+
* @param customAmount - amount of win, if not provided, `RainMan.settingsStore.bet` will be used
|
|
210
|
+
*/
|
|
157
211
|
protected countBonusWin(winAmount?: number): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
|
|
214
|
+
*
|
|
215
|
+
* @param winAmount - amount of win, if not provided `RainMan.settingsStore.cumulativeWinAmount` will be used
|
|
216
|
+
*/
|
|
158
217
|
protected countSuperBonusWin(winAmount?: number): Promise<void>;
|
|
218
|
+
/**
|
|
219
|
+
* Function for displaying mystery win. Invoking that by `this.mainContainer.invokeMysteryWin();` and destroying it by `this.mainContainer.destroyMysteryWin();`.
|
|
220
|
+
* Function requires `this.mysteryWinSymbol` to be fired.
|
|
221
|
+
*
|
|
222
|
+
* @param winAmount
|
|
223
|
+
* @param quantity - how many symbols create mystery win, by default 3
|
|
224
|
+
*/
|
|
159
225
|
protected countMysteryWin(winAmount?: number, quantity?: number): Promise<void>;
|
|
160
226
|
/**
|
|
161
227
|
* Parser for streaks and reels quantity
|
|
@@ -165,11 +231,30 @@ export declare abstract class AbstractController<T> {
|
|
|
165
231
|
* @returns {StreakReelsIndexes}
|
|
166
232
|
*/
|
|
167
233
|
protected parseStreak(streak: StreakReelsIndexes, reelsQuantity: number): StreakReelsIndexes;
|
|
234
|
+
/**
|
|
235
|
+
* Function for getting symbols ids from {@link StreakReelsIndexes}
|
|
236
|
+
*
|
|
237
|
+
* @param streak
|
|
238
|
+
*/
|
|
168
239
|
protected getSymbolIdsForStreak(streak: StreakReelsIndexes): SymbolId[];
|
|
169
240
|
protected updateUiValues(value: number): void;
|
|
241
|
+
/**
|
|
242
|
+
* Function for composing win actions queue based on wins and transformations from {@link transformationTypes} and {@link PossibleWins}
|
|
243
|
+
*
|
|
244
|
+
* @param spinLogic
|
|
245
|
+
*/
|
|
170
246
|
protected abstract composeWinActionsQueue(spinLogic: SpinLogic): void;
|
|
247
|
+
/**
|
|
248
|
+
* Function for playing win actions queue from `this.winActionsQueue` or `this.winActionsQueueSorted`, if used.
|
|
249
|
+
*/
|
|
171
250
|
protected abstract playWinActionQueue(): Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Function will turn off loop while `RainMan.settingsStore.isAutoplayEnabled` is `true`
|
|
253
|
+
*/
|
|
172
254
|
protected handleLoopingWinActionQueue(): Promise<void>;
|
|
255
|
+
/**
|
|
256
|
+
* Function for looping win actions queue, after initial play
|
|
257
|
+
*/
|
|
173
258
|
protected loopWinActionsQueue(): Promise<void>;
|
|
174
259
|
getFreeSpinsWins(spinLogic: SpinLogic): FreeSpinWin[];
|
|
175
260
|
}
|
|
@@ -9,7 +9,7 @@ import { QuickStopController } from "./QuickStopController";
|
|
|
9
9
|
import { UiController } from "./UiController";
|
|
10
10
|
/**
|
|
11
11
|
* Abstract controller class for games, this class control game flow
|
|
12
|
-
* and handle all game logic
|
|
12
|
+
* and handle all game logic, including wins, transformations
|
|
13
13
|
*
|
|
14
14
|
* @abstract
|
|
15
15
|
* @class AbstractController
|
|
@@ -103,6 +103,9 @@ export class AbstractController {
|
|
|
103
103
|
this.uiController.updateBet("first");
|
|
104
104
|
this.uiController.triggerUiElementsUpdate();
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Function for reinitializing all buttons
|
|
108
|
+
*/
|
|
106
109
|
reinitializeAllButtons() {
|
|
107
110
|
this.initButtons();
|
|
108
111
|
this.initBetButtons();
|
|
@@ -212,6 +215,11 @@ export class AbstractController {
|
|
|
212
215
|
clearMobileSpinTimeout();
|
|
213
216
|
});
|
|
214
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* This function is responsible for checking if buttons (not bet buttons) should be disabled
|
|
220
|
+
*
|
|
221
|
+
* @return {boolean}
|
|
222
|
+
*/
|
|
215
223
|
get shouldButtonsBeDisabled() {
|
|
216
224
|
if (this.quickStopController.quickStopCounterLock)
|
|
217
225
|
return true;
|
|
@@ -221,6 +229,11 @@ export class AbstractController {
|
|
|
221
229
|
this.gamePhase === gamePhases.CONFIGURING_SPIN ||
|
|
222
230
|
this.gamePhase === gamePhases.DATA_FETCH);
|
|
223
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* This function is responsible for checking if bet buttons should be disabled
|
|
234
|
+
*
|
|
235
|
+
* @return {boolean}
|
|
236
|
+
*/
|
|
224
237
|
get shouldBetButtonsBeDisabled() {
|
|
225
238
|
return this.shouldButtonsBeDisabled || RainMan.settingsStore.isFreeSpinsPlayEnabled;
|
|
226
239
|
}
|
|
@@ -298,6 +311,10 @@ export class AbstractController {
|
|
|
298
311
|
this.uiController.messageBox.showAutoSpinText();
|
|
299
312
|
}
|
|
300
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* This function is responsible for getting indexes of reels which should show mystery fx, based on {@link spinLogic}
|
|
316
|
+
* @param {SpinLogic} spinLogic
|
|
317
|
+
*/
|
|
301
318
|
getReelIndexesToShowMysteryFx(spinLogic) {
|
|
302
319
|
const { onStopBlindsConfiguration } = spinLogic;
|
|
303
320
|
const reelsIndexesWithScatter = [];
|
|
@@ -460,6 +477,9 @@ export class AbstractController {
|
|
|
460
477
|
this.changeGamePhase(gamePhases.IDLE);
|
|
461
478
|
return this.throttledSpin();
|
|
462
479
|
}
|
|
480
|
+
/**
|
|
481
|
+
* Function for clearing and destroying actions in win actions queue
|
|
482
|
+
*/
|
|
463
483
|
clearAndDestroyActions() {
|
|
464
484
|
this.winActionsQueue.length = 0;
|
|
465
485
|
this.currentlyPlayedAction = undefined;
|
|
@@ -482,6 +502,11 @@ export class AbstractController {
|
|
|
482
502
|
* @param {SpinLogic} _spinLogic
|
|
483
503
|
*/
|
|
484
504
|
onDataFetch(_spinData, _spinLogic) { }
|
|
505
|
+
/**
|
|
506
|
+
* Getter for extra data for some games
|
|
507
|
+
*
|
|
508
|
+
* @returns {ExtraDataRequest}
|
|
509
|
+
*/
|
|
485
510
|
getExtraData() {
|
|
486
511
|
return {};
|
|
487
512
|
}
|
|
@@ -512,6 +537,10 @@ export class AbstractController {
|
|
|
512
537
|
spinLogic,
|
|
513
538
|
};
|
|
514
539
|
}
|
|
540
|
+
/**
|
|
541
|
+
* Checks if we can skip action based on conditions. By default it checks {@link !this.isPlayingUnskippableStreak}
|
|
542
|
+
*
|
|
543
|
+
*/
|
|
515
544
|
canSkipActions() {
|
|
516
545
|
return !this.isPlayingUnskippableStreak;
|
|
517
546
|
}
|
|
@@ -660,6 +689,15 @@ export class AbstractController {
|
|
|
660
689
|
RainMan.settingsStore.setModalsAvailability(true);
|
|
661
690
|
this.performActionsAfterSpin();
|
|
662
691
|
}
|
|
692
|
+
/**
|
|
693
|
+
* Function for invoking free spin plate, invoked in mainContainer
|
|
694
|
+
* ```ts
|
|
695
|
+
* this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins, isAdditionalFreeSpin);
|
|
696
|
+
* ```
|
|
697
|
+
*
|
|
698
|
+
* @param numberOfFreeSpins - number of free spins, if not provided, `RainMan.settingsStore.totalNumberOfFreeSpins` will be used
|
|
699
|
+
* @param isAdditionalFreeSpin - flag for displaying additional free spins
|
|
700
|
+
*/
|
|
663
701
|
async handleFreeSpinPlateInvocation(numberOfFreeSpins, isAdditionalFreeSpin = false) {
|
|
664
702
|
await this.buttonsEventManager.disableButtonsForAction(async () => {
|
|
665
703
|
await this.mainContainer.invokeFreeSpinPlate(numberOfFreeSpins ?? RainMan.settingsStore.totalNumberOfFreeSpins, isAdditionalFreeSpin);
|
|
@@ -667,6 +705,12 @@ export class AbstractController {
|
|
|
667
705
|
this.changeGamePhase(gamePhases.IDLE);
|
|
668
706
|
this.invokeFreeSpinPlateAfterWin = false;
|
|
669
707
|
}
|
|
708
|
+
/**
|
|
709
|
+
* Function for invoking free spin summary plate, invoked in mainContainer
|
|
710
|
+
* ```ts
|
|
711
|
+
* this.mainContainer.invokeFreeSpinSummary(numberOfFreeSpins, totalFreeSpinWinAmount);
|
|
712
|
+
* ```
|
|
713
|
+
*/
|
|
670
714
|
async handleFreeSpinSummaryPlateInvocation() {
|
|
671
715
|
await this.buttonsEventManager.disableButtonsForAction(async () => {
|
|
672
716
|
this.uiController.updateDisplayedBalance(this.uiController.totalFreeSpinWinAmount);
|
|
@@ -725,6 +769,11 @@ export class AbstractController {
|
|
|
725
769
|
stopPlayingSymbolsTransformation() {
|
|
726
770
|
this.columnsContainer.stopPlayingSymbolsTransformationInColumns();
|
|
727
771
|
}
|
|
772
|
+
/**
|
|
773
|
+
* Function for displaying big win. Invoking that by `this.mainContainer.invokeBigWin();` and destroying it by `this.mainContainer.destroyBigWin();`
|
|
774
|
+
*
|
|
775
|
+
* @param customAmount - amount of win, if not provided, `RainMan.settingsStore.bet` will be used
|
|
776
|
+
*/
|
|
728
777
|
async countBigWin(customAmount) {
|
|
729
778
|
if (RainMan.config.disableBigWinOnBonus)
|
|
730
779
|
return;
|
|
@@ -748,6 +797,11 @@ export class AbstractController {
|
|
|
748
797
|
}, RainMan.config.durationOfActions.bigWinPhaseTimeout / animationTimeDivider);
|
|
749
798
|
});
|
|
750
799
|
}
|
|
800
|
+
/**
|
|
801
|
+
* Function for displaying bonus win. Invoking that by `this.mainContainer.invokeBonusWin();` and destroying it by `this.mainContainer.destroyBonusWin();`
|
|
802
|
+
*
|
|
803
|
+
* @param customAmount - amount of win, if not provided, `RainMan.settingsStore.bet` will be used
|
|
804
|
+
*/
|
|
751
805
|
async countBonusWin(winAmount) {
|
|
752
806
|
if (!winAmount)
|
|
753
807
|
return;
|
|
@@ -768,6 +822,11 @@ export class AbstractController {
|
|
|
768
822
|
}, RainMan.config.durationOfActions.bonusWinPhaseTimeout / animationTimeDivider);
|
|
769
823
|
});
|
|
770
824
|
}
|
|
825
|
+
/**
|
|
826
|
+
* Function for displaying super bonus win. Invoking that by `this.mainContainer.invokeSuperBonusWin();` and destroying it by `this.mainContainer.destroySuperBonusWin();`
|
|
827
|
+
*
|
|
828
|
+
* @param winAmount - amount of win, if not provided `RainMan.settingsStore.cumulativeWinAmount` will be used
|
|
829
|
+
*/
|
|
771
830
|
async countSuperBonusWin(winAmount) {
|
|
772
831
|
if (!winAmount)
|
|
773
832
|
return;
|
|
@@ -788,6 +847,13 @@ export class AbstractController {
|
|
|
788
847
|
}, RainMan.config.durationOfActions.superBonusWinPhaseTimeout / animationTimeDivider);
|
|
789
848
|
});
|
|
790
849
|
}
|
|
850
|
+
/**
|
|
851
|
+
* Function for displaying mystery win. Invoking that by `this.mainContainer.invokeMysteryWin();` and destroying it by `this.mainContainer.destroyMysteryWin();`.
|
|
852
|
+
* Function requires `this.mysteryWinSymbol` to be fired.
|
|
853
|
+
*
|
|
854
|
+
* @param winAmount
|
|
855
|
+
* @param quantity - how many symbols create mystery win, by default 3
|
|
856
|
+
*/
|
|
791
857
|
async countMysteryWin(winAmount, quantity = 3) {
|
|
792
858
|
if (!winAmount || !this.mysteryWinSymbol)
|
|
793
859
|
return;
|
|
@@ -834,6 +900,11 @@ export class AbstractController {
|
|
|
834
900
|
}
|
|
835
901
|
return parsedStreak;
|
|
836
902
|
}
|
|
903
|
+
/**
|
|
904
|
+
* Function for getting symbols ids from {@link StreakReelsIndexes}
|
|
905
|
+
*
|
|
906
|
+
* @param streak
|
|
907
|
+
*/
|
|
837
908
|
getSymbolIdsForStreak(streak) {
|
|
838
909
|
const symbolsIds = [];
|
|
839
910
|
streak.forEach((reelIndex, index) => {
|
|
@@ -855,6 +926,9 @@ export class AbstractController {
|
|
|
855
926
|
this.uiController.updateShownBalance();
|
|
856
927
|
}
|
|
857
928
|
}
|
|
929
|
+
/**
|
|
930
|
+
* Function will turn off loop while `RainMan.settingsStore.isAutoplayEnabled` is `true`
|
|
931
|
+
*/
|
|
858
932
|
async handleLoopingWinActionQueue() {
|
|
859
933
|
if (RainMan.settingsStore.isAutoplayEnabled || this.invokeFreeSpinPlateAfterWin)
|
|
860
934
|
return;
|
|
@@ -862,6 +936,9 @@ export class AbstractController {
|
|
|
862
936
|
await this.loopWinActionsQueue();
|
|
863
937
|
this.isLoopingWinActionsQueue = false;
|
|
864
938
|
}
|
|
939
|
+
/**
|
|
940
|
+
* Function for looping win actions queue, after initial play
|
|
941
|
+
*/
|
|
865
942
|
async loopWinActionsQueue() { }
|
|
866
943
|
getFreeSpinsWins(spinLogic) {
|
|
867
944
|
const wins = spinLogic.winScenarios.find((winScenario) => winScenario.wins.find((win) => win.type === PossibleWins.freeSpins))?.wins || [];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ButtonsEventManager } from "../application";
|
|
2
2
|
/**
|
|
3
3
|
* This controller is used to show the speed popup and handle quick stops
|
|
4
|
-
* After 4 quick stops, the speed popup will be shown
|
|
4
|
+
* After 4 quick stops, the speed popup will be shown.
|
|
5
|
+
* Number of quick spin can be adjusted in {@link MAX_QUICK_STOPS}
|
|
5
6
|
*
|
|
6
7
|
* @exports
|
|
7
8
|
*/
|
|
@@ -3,7 +3,8 @@ import { RainMan } from "../Rainman";
|
|
|
3
3
|
const MAX_QUICK_STOPS = 4;
|
|
4
4
|
/**
|
|
5
5
|
* This controller is used to show the speed popup and handle quick stops
|
|
6
|
-
* After 4 quick stops, the speed popup will be shown
|
|
6
|
+
* After 4 quick stops, the speed popup will be shown.
|
|
7
|
+
* Number of quick spin can be adjusted in {@link MAX_QUICK_STOPS}
|
|
7
8
|
*
|
|
8
9
|
* @exports
|
|
9
10
|
*/
|
|
@@ -28,6 +28,11 @@ export declare class UiController {
|
|
|
28
28
|
increaseTotalFreeSpinWinAmount(value: number): void;
|
|
29
29
|
resetTotalFreeSpinWinAmount(): void;
|
|
30
30
|
private getNewBet;
|
|
31
|
+
/**
|
|
32
|
+
* Functions to be called before bet is updated
|
|
33
|
+
*
|
|
34
|
+
* @param _lastBet - last bet
|
|
35
|
+
*/
|
|
31
36
|
protected beforeUpdateBet(_lastBet: number): void;
|
|
32
37
|
/**
|
|
33
38
|
* Function to be called after bet is updated
|
|
@@ -39,6 +44,9 @@ export declare class UiController {
|
|
|
39
44
|
updateShownSpeedLevel(currentSpeed: SpeedLevel): void;
|
|
40
45
|
updateShownBalance(): void;
|
|
41
46
|
updateShownCurrentWin(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Shows possible win in a bottom panel, if exists
|
|
49
|
+
*/
|
|
42
50
|
updateShownPossibleWin(): void;
|
|
43
51
|
updateShownFreeSpinAmount(amount: number, isAdditionalFreeSpins?: boolean): void;
|
|
44
52
|
delegateUpdatingWinAndBalance(amount: Nullable<number>): void;
|
|
@@ -70,7 +70,11 @@ export class UiController {
|
|
|
70
70
|
return this.config?.getFirstBet() || 0;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Functions to be called before bet is updated
|
|
75
|
+
*
|
|
76
|
+
* @param _lastBet - last bet
|
|
77
|
+
*/
|
|
74
78
|
beforeUpdateBet(_lastBet) { }
|
|
75
79
|
/**
|
|
76
80
|
* Function to be called after bet is updated
|
|
@@ -103,6 +107,9 @@ export class UiController {
|
|
|
103
107
|
}
|
|
104
108
|
RainMan.componentRegistry.get(MessageBox.currentWinTextRegistryName).set(this.recentWin);
|
|
105
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Shows possible win in a bottom panel, if exists
|
|
112
|
+
*/
|
|
106
113
|
updateShownPossibleWin() {
|
|
107
114
|
this.messageBox.showPossibleWinText();
|
|
108
115
|
RainMan.componentRegistry.get(MessageBox.possibleWinTextRegistryName).set(this.recentWin);
|
package/dist/layers/layers.d.ts
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { Layer } from "@pixi/layers";
|
|
2
|
+
/**
|
|
3
|
+
* Layer visibility hierarchy (from bottom):
|
|
4
|
+
* - {@link BackgroundLayer}
|
|
5
|
+
* - {@link FrameLayer}
|
|
6
|
+
* - {@link AnimationLayer}
|
|
7
|
+
* - {@link UXLayer}
|
|
8
|
+
*/
|
|
2
9
|
export declare const UXLayer: Layer;
|
|
10
|
+
/**
|
|
11
|
+
* {@inheritDoc UXLayer}
|
|
12
|
+
*/
|
|
3
13
|
export declare const BackgroundLayer: Layer;
|
|
14
|
+
/**
|
|
15
|
+
* {@inheritDoc UXLayer}
|
|
16
|
+
*/
|
|
4
17
|
export declare const FrameLayer: Layer;
|
|
18
|
+
/**
|
|
19
|
+
* {@inheritDoc UXLayer}
|
|
20
|
+
*/
|
|
5
21
|
export declare const AnimationLayer: Layer;
|
package/dist/layers/layers.js
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { Layer } from "@pixi/layers";
|
|
2
|
+
/**
|
|
3
|
+
* Layer visibility hierarchy (from bottom):
|
|
4
|
+
* - {@link BackgroundLayer}
|
|
5
|
+
* - {@link FrameLayer}
|
|
6
|
+
* - {@link AnimationLayer}
|
|
7
|
+
* - {@link UXLayer}
|
|
8
|
+
*/
|
|
2
9
|
export const UXLayer = new Layer();
|
|
3
10
|
UXLayer.name = "UXLayer";
|
|
11
|
+
/**
|
|
12
|
+
* {@inheritDoc UXLayer}
|
|
13
|
+
*/
|
|
4
14
|
export const BackgroundLayer = new Layer();
|
|
5
15
|
BackgroundLayer.name = "backgroundLayer";
|
|
16
|
+
/**
|
|
17
|
+
* {@inheritDoc UXLayer}
|
|
18
|
+
*/
|
|
6
19
|
export const FrameLayer = new Layer();
|
|
7
20
|
FrameLayer.name = "frameLayer";
|
|
21
|
+
/**
|
|
22
|
+
* {@inheritDoc UXLayer}
|
|
23
|
+
*/
|
|
8
24
|
export const AnimationLayer = new Layer();
|
|
9
25
|
AnimationLayer.name = "animationLayer";
|
|
@@ -58,8 +58,23 @@ export declare class SettingsStore {
|
|
|
58
58
|
resetCumulativeWinAmount(): void;
|
|
59
59
|
updateBet(newBet: number): void;
|
|
60
60
|
setBatteryFlag(flag: boolean): void;
|
|
61
|
+
/**
|
|
62
|
+
* Resets animation timescale for all spines `allSpines` in {@link ResumableContainer}, {@link SpineWithResumableContainer}
|
|
63
|
+
*/
|
|
61
64
|
refreshBatterySaver(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Sets flag for ambient music.
|
|
67
|
+
*
|
|
68
|
+
* @param flag
|
|
69
|
+
* @param saveToLocalStorage - default {@link true}, if true the flag will be saved to localStorage
|
|
70
|
+
*/
|
|
62
71
|
setAmbientMusicFlag(flag: boolean, saveToLocalStorage?: boolean): void;
|
|
72
|
+
/**
|
|
73
|
+
* Sets flag for effect sounds
|
|
74
|
+
*
|
|
75
|
+
* @param flag
|
|
76
|
+
* @param saveToLocalStorage - default {@link true}, if true the flag will be saved to localStorage
|
|
77
|
+
*/
|
|
63
78
|
setSoundFxFlag(flag: boolean, saveToLocalStorage?: boolean): void;
|
|
64
79
|
flipSoundsEnabled(volumeLevel?: number | null): void;
|
|
65
80
|
isSoundEnabled(): boolean;
|
|
@@ -77,6 +92,11 @@ export declare class SettingsStore {
|
|
|
77
92
|
resetDataForSymbolPaytablePopup(): void;
|
|
78
93
|
setUpdateVolumeButtonTexture(fn: () => void): void;
|
|
79
94
|
repositionSymbolPaytablePopup(x: number, y: number): void;
|
|
95
|
+
/**
|
|
96
|
+
* Initialize paytable map for all symbols. based on backend data {@link InitDataInterface.paytable}
|
|
97
|
+
*
|
|
98
|
+
* @param initConfigData
|
|
99
|
+
*/
|
|
80
100
|
initPaytableMap(initConfigData: InitDataInterface): void;
|
|
81
101
|
decreaseAutoSpinsCount(): void;
|
|
82
102
|
setAutoSpinsCount(count: number): void;
|
|
@@ -132,9 +132,18 @@ export class SettingsStore {
|
|
|
132
132
|
this.refreshBatterySaver();
|
|
133
133
|
setToLocalStorage(LOCAL_STORAGE.batterySaver, flag);
|
|
134
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Resets animation timescale for all spines `allSpines` in {@link ResumableContainer}, {@link SpineWithResumableContainer}
|
|
137
|
+
*/
|
|
135
138
|
refreshBatterySaver() {
|
|
136
139
|
this.containersWithSpines.forEach((spine) => spine.setAnimationTimescale(!this.batterySaverFlag));
|
|
137
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Sets flag for ambient music.
|
|
143
|
+
*
|
|
144
|
+
* @param flag
|
|
145
|
+
* @param saveToLocalStorage - default {@link true}, if true the flag will be saved to localStorage
|
|
146
|
+
*/
|
|
138
147
|
setAmbientMusicFlag(flag, saveToLocalStorage = true) {
|
|
139
148
|
this.ambientMusicFlag = flag;
|
|
140
149
|
SoundManager.setPlayStatus(SoundTracks.music, flag);
|
|
@@ -144,6 +153,12 @@ export class SettingsStore {
|
|
|
144
153
|
removeFromLocalStorage(LOCAL_STORAGE.isSoundEnabled);
|
|
145
154
|
}
|
|
146
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Sets flag for effect sounds
|
|
158
|
+
*
|
|
159
|
+
* @param flag
|
|
160
|
+
* @param saveToLocalStorage - default {@link true}, if true the flag will be saved to localStorage
|
|
161
|
+
*/
|
|
147
162
|
setSoundFxFlag(flag, saveToLocalStorage = true) {
|
|
148
163
|
this.soundFxFlag = flag;
|
|
149
164
|
if (!flag)
|
|
@@ -257,6 +272,11 @@ export class SettingsStore {
|
|
|
257
272
|
repositionSymbolPaytablePopup(x, y) {
|
|
258
273
|
this.popupPaytablePosition = { x, y };
|
|
259
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Initialize paytable map for all symbols. based on backend data {@link InitDataInterface.paytable}
|
|
277
|
+
*
|
|
278
|
+
* @param initConfigData
|
|
279
|
+
*/
|
|
260
280
|
initPaytableMap(initConfigData) {
|
|
261
281
|
for (const [key, name] of initConfigData.symbols_names.entries()) {
|
|
262
282
|
const backendId = initConfigData.symbols[key];
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { Spine } from "pixi-spine";
|
|
2
2
|
import { Point } from "../../connectivity";
|
|
3
3
|
export declare const ceilToDecimal: (value: number, decimalPlaces?: number) => number;
|
|
4
|
+
/**
|
|
5
|
+
* Wait for a specified amount of time
|
|
6
|
+
*
|
|
7
|
+
* @param ms - time in milliseconds
|
|
8
|
+
*/
|
|
4
9
|
export declare const wait: (ms: number) => Promise<void>;
|
|
5
10
|
export declare const range: (start: number, stop: number, step: number) => number[];
|
|
6
11
|
export declare const getRandomInt: (min: number, max: number) => number;
|
|
7
12
|
export declare const removeMatchingElements: <T>(array: T[], elementsToRemove: T[]) => T[];
|
|
8
13
|
export declare const hideLayerIfPresent: (elementsToSkip?: string[]) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Hides paytable
|
|
16
|
+
*/
|
|
9
17
|
export declare const hidePaytable: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Toggles paytable, while user clicks on the symbol
|
|
20
|
+
*/
|
|
10
21
|
export declare const togglePaytable: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Waits for spine animation to end
|
|
24
|
+
*
|
|
25
|
+
* @param spine
|
|
26
|
+
* @param animationName
|
|
27
|
+
* @param loopAnimationName
|
|
28
|
+
*/
|
|
11
29
|
export declare const waitForAnimationToEnd: (spine: Spine, animationName: string, loopAnimationName?: string) => Promise<void>;
|
|
12
30
|
export declare const setTimeScale: (spine: Spine, flag: boolean) => void;
|
|
13
31
|
export declare const changeResolution: (high: boolean) => void;
|
|
@@ -3,6 +3,11 @@ import { allUiItems, UI_ITEMS } from "./uiItems";
|
|
|
3
3
|
export const ceilToDecimal = (value, decimalPlaces = 2) => {
|
|
4
4
|
return Number(value.toFixed(decimalPlaces));
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Wait for a specified amount of time
|
|
8
|
+
*
|
|
9
|
+
* @param ms - time in milliseconds
|
|
10
|
+
*/
|
|
6
11
|
export const wait = (ms) => {
|
|
7
12
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
8
13
|
};
|
|
@@ -33,18 +38,31 @@ export const hideLayerIfPresent = (elementsToSkip = []) => {
|
|
|
33
38
|
});
|
|
34
39
|
return anyHidden;
|
|
35
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Hides paytable
|
|
43
|
+
*/
|
|
36
44
|
export const hidePaytable = () => {
|
|
37
45
|
const paytableLayer = window.document.getElementById(UI_ITEMS.symbolPayTable);
|
|
38
46
|
if (paytableLayer === null)
|
|
39
47
|
return;
|
|
40
48
|
paytableLayer.style.display = "none";
|
|
41
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Toggles paytable, while user clicks on the symbol
|
|
52
|
+
*/
|
|
42
53
|
export const togglePaytable = () => {
|
|
43
54
|
const paytableLayer = window.document.getElementById(UI_ITEMS.symbolPayTable);
|
|
44
55
|
if (paytableLayer === null)
|
|
45
56
|
return;
|
|
46
57
|
paytableLayer.style.display = paytableLayer.style.display === "flex" ? "none" : "flex";
|
|
47
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* Waits for spine animation to end
|
|
61
|
+
*
|
|
62
|
+
* @param spine
|
|
63
|
+
* @param animationName
|
|
64
|
+
* @param loopAnimationName
|
|
65
|
+
*/
|
|
48
66
|
export const waitForAnimationToEnd = async (spine, animationName, loopAnimationName) => {
|
|
49
67
|
spine.state.clearListeners();
|
|
50
68
|
await new Promise((resolve) => {
|
|
@@ -2,5 +2,10 @@ import { Rect } from "adaptive-scale/lib";
|
|
|
2
2
|
import { Container, DisplayObject } from "pixi.js";
|
|
3
3
|
import { Nullable } from "./types";
|
|
4
4
|
export declare const scaleToParent: (width: number, height: number, parentWidth: number, parentHeight: number) => Rect;
|
|
5
|
+
/**
|
|
6
|
+
* Get global min ratio of current device, used for scaling elements.
|
|
7
|
+
*
|
|
8
|
+
* @exports
|
|
9
|
+
*/
|
|
5
10
|
export declare const globalMinRatio: () => number;
|
|
6
11
|
export declare const setChildIndexWithAscendingOrder: (parentContainer: Container, childrenComponents: Nullable<DisplayObject>[]) => void;
|
|
@@ -19,6 +19,11 @@ const valueForMobile = () => {
|
|
|
19
19
|
}
|
|
20
20
|
return globalYRatio * 2;
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Get global min ratio of current device, used for scaling elements.
|
|
24
|
+
*
|
|
25
|
+
* @exports
|
|
26
|
+
*/
|
|
22
27
|
export const globalMinRatio = () => {
|
|
23
28
|
if (getScreenRatio() < 1) {
|
|
24
29
|
return valueForMobile();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EmitterConfigV3 } from "@pixi/particle-emitter";
|
|
2
2
|
import { Container } from "pixi.js";
|
|
3
3
|
/**
|
|
4
|
-
* Class for creating Emitter and plays animation while Big, mystery wins
|
|
4
|
+
* Class for creating Emitter and plays particle animation background while Big, mystery wins
|
|
5
5
|
*
|
|
6
6
|
* @export
|
|
7
7
|
* @class AnimableParticlesEmitter
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Emitter } from "@pixi/particle-emitter";
|
|
2
2
|
import { Container } from "pixi.js";
|
|
3
3
|
/**
|
|
4
|
-
* Class for creating Emitter and plays animation while Big, mystery wins
|
|
4
|
+
* Class for creating Emitter and plays particle animation background while Big, mystery wins
|
|
5
5
|
*
|
|
6
6
|
* @export
|
|
7
7
|
* @class AnimableParticlesEmitter
|