valtech-components 4.0.404 → 4.0.406
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/esm2022/lib/components/organisms/mini-games/chessimals-engine.mjs +80 -8
- package/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +348 -23
- package/esm2022/lib/components/organisms/mini-games/chessimals-online.service.mjs +7 -7
- package/esm2022/lib/components/organisms/mini-games/mini-games.i18n.mjs +25 -1
- package/esm2022/lib/components/organisms/mini-games/retro-audio.service.mjs +187 -10
- package/esm2022/lib/components/organisms/mini-games/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +640 -45
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-engine.d.ts +2 -1
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +32 -0
- package/lib/components/organisms/mini-games/retro-audio.service.d.ts +27 -0
- package/lib/components/organisms/mini-games/types.d.ts +10 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/assets/games/chessimals/Game.mp3 +0 -0
- package/src/lib/assets/games/chessimals/bull.wav +0 -0
- package/src/lib/assets/games/chessimals/eagle-cry.wav +0 -0
- package/src/lib/assets/games/chessimals/kangaroo-jump.mp3 +0 -0
- package/src/lib/assets/games/chessimals/lion-roar.wav +0 -0
- package/src/lib/assets/games/chessimals/main-menu.mp3 +0 -0
- package/src/lib/assets/games/chessimals/tada.mp3 +0 -0
- package/src/lib/assets/games/chessimals/you-lose.mp3 +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameMode, ChessimalsGameState, ChessimalsGameStatus, ChessimalsMove, ChessimalsOnlineState, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
1
|
+
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameMode, ChessimalsGameState, ChessimalsGameStatus, ChessimalsMove, ChessimalsMoveHistoryEntry, ChessimalsOnlineState, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
2
2
|
export interface CreateChessimalsGameOptions {
|
|
3
3
|
id?: string;
|
|
4
4
|
mode?: ChessimalsGameMode;
|
|
@@ -11,5 +11,6 @@ export declare function getChessimalsLegalMoves(state: ChessimalsGameState, piec
|
|
|
11
11
|
export declare function getChessimalsAllLegalMoves(state: ChessimalsGameState, color?: ChessimalsPlayerColor): ChessimalsMove[];
|
|
12
12
|
export declare function chooseChessimalsBotMove(state: ChessimalsGameState, difficulty?: ChessimalsBotDifficulty): ChessimalsMove | undefined;
|
|
13
13
|
export declare function applyChessimalsMove(state: ChessimalsGameState, candidate: ChessimalsMove): ChessimalsGameState;
|
|
14
|
+
export declare function createChessimalsReviewState(state: ChessimalsGameState, entry: ChessimalsMoveHistoryEntry): ChessimalsGameState;
|
|
14
15
|
export declare function resignChessimalsGame(state: ChessimalsGameState, color: ChessimalsPlayerColor): ChessimalsGameState;
|
|
15
16
|
export declare function positionKey(position: ChessimalsPosition): string;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
2
3
|
import { ChessimalsAnimalType, ChessimalsBotDifficulty, ChessimalsBoardSize, ChessimalsGameState, ChessimalsHistoryEntry, ChessimalsLocalMode, ChessimalsMove, ChessimalsPiece, ChessimalsPlayerColor, ChessimalsPosition } from './types';
|
|
4
|
+
import { RangeInputMetadata } from '../../molecules/range-input/types';
|
|
5
|
+
import { ToggleInputMetadata } from '../../molecules/toggle-input/types';
|
|
3
6
|
import { UserAvatarMetadata } from '../../atoms/user-avatar/types';
|
|
4
7
|
import { ButtonMetadata } from '../../types';
|
|
5
8
|
import * as i0 from "@angular/core";
|
|
@@ -67,6 +70,7 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
67
70
|
readonly selectedPieceId: import("@angular/core").WritableSignal<string>;
|
|
68
71
|
readonly selectedAnimal: import("@angular/core").WritableSignal<ChessimalsAnimalType>;
|
|
69
72
|
readonly isRulesModalOpen: import("@angular/core").WritableSignal<boolean>;
|
|
73
|
+
readonly isSettingsModalOpen: import("@angular/core").WritableSignal<boolean>;
|
|
70
74
|
readonly isBoardOrienting: import("@angular/core").WritableSignal<boolean>;
|
|
71
75
|
readonly movingPiece: import("@angular/core").WritableSignal<ChessimalsMovingPieceView>;
|
|
72
76
|
readonly moveEffect: import("@angular/core").WritableSignal<ChessimalsMoveEffectView>;
|
|
@@ -83,15 +87,28 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
83
87
|
readonly resumeSplashVisible: import("@angular/core").WritableSignal<boolean>;
|
|
84
88
|
readonly rematchLoading: import("@angular/core").WritableSignal<boolean>;
|
|
85
89
|
readonly moveSyncing: import("@angular/core").WritableSignal<boolean>;
|
|
90
|
+
readonly reviewIndex: import("@angular/core").WritableSignal<number>;
|
|
86
91
|
readonly loggedInUser: import("@angular/core").Signal<import("valtech-components").AuthUser>;
|
|
87
92
|
readonly localPlayerProfile: import("@angular/core").Signal<import("./types").MiniGamePlayerProfile>;
|
|
88
93
|
readonly localPlayerAvatar: import("@angular/core").Signal<string>;
|
|
89
94
|
readonly loggedPlayerName: import("@angular/core").Signal<string>;
|
|
90
95
|
readonly loggedPlayerHandle: import("@angular/core").Signal<string>;
|
|
91
96
|
readonly loggedPlayerAvatarProps: import("@angular/core").Signal<UserAvatarMetadata>;
|
|
97
|
+
readonly musicEnabledControl: FormControl<boolean>;
|
|
98
|
+
readonly sfxEnabledControl: FormControl<boolean>;
|
|
99
|
+
readonly musicVolumeControl: FormControl<number>;
|
|
100
|
+
readonly sfxVolumeControl: FormControl<number>;
|
|
101
|
+
readonly musicToggleProps: import("@angular/core").Signal<ToggleInputMetadata>;
|
|
102
|
+
readonly sfxToggleProps: import("@angular/core").Signal<ToggleInputMetadata>;
|
|
103
|
+
readonly musicVolumeProps: import("@angular/core").Signal<RangeInputMetadata>;
|
|
104
|
+
readonly sfxVolumeProps: import("@angular/core").Signal<RangeInputMetadata>;
|
|
92
105
|
set onlineGameId(value: string | null | undefined);
|
|
93
106
|
miniGamesRoute: string;
|
|
94
107
|
projectionMode: boolean;
|
|
108
|
+
readonly replayEntries: import("@angular/core").Signal<import("./types").ChessimalsMoveHistoryEntry[]>;
|
|
109
|
+
readonly activeReviewIndex: import("@angular/core").Signal<number>;
|
|
110
|
+
readonly hasReplayControls: import("@angular/core").Signal<boolean>;
|
|
111
|
+
readonly reviewGame: import("@angular/core").Signal<ChessimalsGameState>;
|
|
95
112
|
readonly currentPlayer: import("@angular/core").Signal<import("./types").ChessimalsPlayerState>;
|
|
96
113
|
readonly legalMoves: import("@angular/core").Signal<ChessimalsMove[]>;
|
|
97
114
|
readonly legalMoveKeys: import("@angular/core").Signal<Set<string>>;
|
|
@@ -136,6 +153,8 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
136
153
|
private resignGame;
|
|
137
154
|
openRulesModal(): void;
|
|
138
155
|
closeRulesModal(): void;
|
|
156
|
+
openSettingsModal(): void;
|
|
157
|
+
closeSettingsModal(): void;
|
|
139
158
|
selectCell(position: ChessimalsPosition): void;
|
|
140
159
|
private animateMove;
|
|
141
160
|
private applyAnimatedMove;
|
|
@@ -146,7 +165,14 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
146
165
|
private triggerBoardOrientation;
|
|
147
166
|
private shouldKeepBoardOrientationStatic;
|
|
148
167
|
private focusBoardSoon;
|
|
168
|
+
private startChessimalsMenuMusicSoon;
|
|
169
|
+
private startChessimalsGameMusicSoon;
|
|
170
|
+
private syncChessimalsMusicAfterSettingsChange;
|
|
149
171
|
private playMoveSound;
|
|
172
|
+
private playChessimalsOutcomeSound;
|
|
173
|
+
private currentPlayerSideForOutcome;
|
|
174
|
+
private clearReview;
|
|
175
|
+
private showLatestReviewSnapshot;
|
|
150
176
|
private queueMoveEffect;
|
|
151
177
|
toggleAnimal(animal: ChessimalsAnimalView): void;
|
|
152
178
|
pieceAt(row: number, col: number): ChessimalsPiece | undefined;
|
|
@@ -190,6 +216,12 @@ export declare class ChessimalsGameComponent implements OnInit, OnDestroy {
|
|
|
190
216
|
localModeDescription(mode: ChessimalsLocalMode): string;
|
|
191
217
|
botDifficultyLabel(difficulty: ChessimalsBotDifficulty): string;
|
|
192
218
|
animalLabel(type: ChessimalsAnimalType): string;
|
|
219
|
+
canReviewPrevious(): boolean;
|
|
220
|
+
canReviewNext(): boolean;
|
|
221
|
+
reviewPreviousMove(): void;
|
|
222
|
+
reviewNextMove(): void;
|
|
223
|
+
replayPositionLabel(): string;
|
|
224
|
+
shouldShowFinishedOverlay(): boolean;
|
|
193
225
|
private displayRowIndex;
|
|
194
226
|
private displayColIndex;
|
|
195
227
|
private watchOnlineGame;
|
|
@@ -9,10 +9,24 @@ export declare class RetroAudioService {
|
|
|
9
9
|
private activeMelody?;
|
|
10
10
|
private pausedMelody?;
|
|
11
11
|
private suspendTimer?;
|
|
12
|
+
private readonly activeSamples;
|
|
13
|
+
private sampleMusic?;
|
|
14
|
+
private sampleMusicConfig?;
|
|
15
|
+
private pausedSampleMusic?;
|
|
12
16
|
readonly enabled: import("@angular/core").WritableSignal<boolean>;
|
|
17
|
+
readonly musicEnabled: import("@angular/core").WritableSignal<boolean>;
|
|
18
|
+
readonly sfxEnabled: import("@angular/core").WritableSignal<boolean>;
|
|
19
|
+
readonly musicVolume: import("@angular/core").WritableSignal<number>;
|
|
20
|
+
readonly sfxVolume: import("@angular/core").WritableSignal<number>;
|
|
13
21
|
constructor();
|
|
14
22
|
setEnabled(value: boolean): void;
|
|
23
|
+
setMusicEnabled(value: boolean): void;
|
|
24
|
+
setSfxEnabled(value: boolean): void;
|
|
25
|
+
setMusicVolume(value: number): void;
|
|
26
|
+
setSfxVolume(value: number): void;
|
|
15
27
|
startMenuMusic(): Promise<void>;
|
|
28
|
+
startChessimalsMenuMusic(): Promise<void>;
|
|
29
|
+
startChessimalsGameMusic(): Promise<void>;
|
|
16
30
|
startGameMusic(): Promise<void>;
|
|
17
31
|
startMusic(mode?: MelodyMode): Promise<void>;
|
|
18
32
|
stopMusic(): void;
|
|
@@ -29,15 +43,28 @@ export declare class RetroAudioService {
|
|
|
29
43
|
chessimalsBotMove(): void;
|
|
30
44
|
chessimalsCapture(): void;
|
|
31
45
|
chessimalsPower(power: ChessimalsPower): void;
|
|
46
|
+
private chessimalsPowerFallback;
|
|
47
|
+
private playChessimalsPowerSample;
|
|
48
|
+
private playSample;
|
|
32
49
|
chessimalsVictory(): void;
|
|
50
|
+
chessimalsDefeat(): void;
|
|
51
|
+
private chessimalsVictoryFallback;
|
|
33
52
|
chessimalsJoinRequest(): void;
|
|
34
53
|
chessimalsPowerUnlocked(): void;
|
|
35
54
|
private readEnabled;
|
|
55
|
+
private readBooleanSetting;
|
|
56
|
+
private readVolumeSetting;
|
|
57
|
+
private writeSetting;
|
|
58
|
+
private normalizeVolume;
|
|
59
|
+
private canPlayMusic;
|
|
60
|
+
private canPlaySfx;
|
|
36
61
|
private ensureContext;
|
|
37
62
|
private menuMelody;
|
|
38
63
|
private savannaPulse;
|
|
39
64
|
private gameMelody;
|
|
40
65
|
private sequence;
|
|
66
|
+
private startSampleMusic;
|
|
67
|
+
private stopSampleMusic;
|
|
41
68
|
private tone;
|
|
42
69
|
private sweep;
|
|
43
70
|
private filteredNoise;
|
|
@@ -69,6 +69,15 @@ export interface ChessimalsMove {
|
|
|
69
69
|
animal?: ChessimalsAnimalType;
|
|
70
70
|
capturesPieceId?: string;
|
|
71
71
|
}
|
|
72
|
+
export interface ChessimalsMoveHistoryEntry {
|
|
73
|
+
moveNumber: number;
|
|
74
|
+
pieces: ChessimalsPiece[];
|
|
75
|
+
currentTurn: ChessimalsPlayerColor;
|
|
76
|
+
status: ChessimalsGameStatus;
|
|
77
|
+
move?: ChessimalsMove;
|
|
78
|
+
winner?: ChessimalsPlayerColor;
|
|
79
|
+
winnerReason?: ChessimalsWinReason;
|
|
80
|
+
}
|
|
72
81
|
export type ChessimalsMoveLogStatus = 'accepted' | 'rejected';
|
|
73
82
|
export interface ChessimalsMoveLogEntry {
|
|
74
83
|
id: string;
|
|
@@ -146,5 +155,6 @@ export interface ChessimalsGameState {
|
|
|
146
155
|
winnerReason?: ChessimalsWinReason;
|
|
147
156
|
moveCount: number;
|
|
148
157
|
lastMove?: ChessimalsMove;
|
|
158
|
+
moveHistory?: ChessimalsMoveHistoryEntry[];
|
|
149
159
|
online?: ChessimalsOnlineState;
|
|
150
160
|
}
|
package/lib/version.d.ts
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|