valtech-components 4.0.467 → 4.0.468
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-challenge-progress.service.mjs +9 -1
- package/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +117 -13
- package/esm2022/lib/components/organisms/mini-games/mini-games.i18n.mjs +27 -1
- package/esm2022/lib/components/organisms/mini-games/types.mjs +1 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +151 -13
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +16 -1
- package/lib/components/organisms/mini-games/types.d.ts +7 -0
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/esm2022/lib/version.mjs
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Current version of valtech-components.
|
|
3
3
|
* This is automatically updated during the publish process.
|
|
4
4
|
*/
|
|
5
|
-
export const VERSION = '4.0.
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
export const VERSION = '4.0.468';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC40NjgnO1xuIl19
|
|
@@ -58,7 +58,7 @@ import fixWebmDuration from 'fix-webm-duration';
|
|
|
58
58
|
* Current version of valtech-components.
|
|
59
59
|
* This is automatically updated during the publish process.
|
|
60
60
|
*/
|
|
61
|
-
const VERSION = '4.0.
|
|
61
|
+
const VERSION = '4.0.468';
|
|
62
62
|
|
|
63
63
|
// Control de estado de refresco (singleton a nivel de módulo)
|
|
64
64
|
let isRefreshing = false;
|
|
@@ -62456,6 +62456,10 @@ class ChessimalsChallengeProgressService {
|
|
|
62456
62456
|
},
|
|
62457
62457
|
powerCaptures: current.powerCaptures + args.roundStats.powerCaptures,
|
|
62458
62458
|
promotions: current.promotions + args.roundStats.promotions,
|
|
62459
|
+
totalScore: current.totalScore + args.roundStats.score,
|
|
62460
|
+
bestRoundScore: Math.max(current.bestRoundScore, args.roundStats.score),
|
|
62461
|
+
bestMoveScore: Math.max(current.bestMoveScore, args.roundStats.bestMoveScore),
|
|
62462
|
+
bestCombo: Math.max(current.bestCombo, args.roundStats.bestCombo),
|
|
62459
62463
|
modeStats: {
|
|
62460
62464
|
...current.modeStats,
|
|
62461
62465
|
challenge: this.addModeResult(current.modeStats.challenge, args.won),
|
|
@@ -62491,6 +62495,10 @@ class ChessimalsChallengeProgressService {
|
|
|
62491
62495
|
powersUsed: { ...EMPTY_POWERS },
|
|
62492
62496
|
powerCaptures: 0,
|
|
62493
62497
|
promotions: 0,
|
|
62498
|
+
totalScore: 0,
|
|
62499
|
+
bestRoundScore: 0,
|
|
62500
|
+
bestMoveScore: 0,
|
|
62501
|
+
bestCombo: 0,
|
|
62494
62502
|
modeStats: this.emptyModeStats(),
|
|
62495
62503
|
};
|
|
62496
62504
|
}
|
|
@@ -62878,6 +62886,8 @@ const MINI_GAMES_I18N = {
|
|
|
62878
62886
|
chessimalsProgressTitle: 'Progreso',
|
|
62879
62887
|
chessimalsProgressSubtitle: 'Tus marcas, logros y poderes favoritos en Chessimals.',
|
|
62880
62888
|
chessimalsProgressPowers: 'Poderes y jugadas',
|
|
62889
|
+
chessimalsProgressBestRoundScore: 'Mejor ronda',
|
|
62890
|
+
chessimalsProgressTotalScore: 'Puntos totales',
|
|
62881
62891
|
chessimalsChallengeStart: 'Empezar desafío',
|
|
62882
62892
|
chessimalsChallengeStartNew: 'Nuevo desafío',
|
|
62883
62893
|
chessimalsChallengeResume: 'Retomar desafío',
|
|
@@ -62924,6 +62934,9 @@ const MINI_GAMES_I18N = {
|
|
|
62924
62934
|
chessimalsChallengePowersUsed: 'Poderes',
|
|
62925
62935
|
chessimalsChallengePowerCaptures: 'Capturas poder',
|
|
62926
62936
|
chessimalsChallengePromotions: 'Promociones',
|
|
62937
|
+
chessimalsChallengeRoundScore: 'Puntos',
|
|
62938
|
+
chessimalsChallengeBestMove: 'Mejor jugada',
|
|
62939
|
+
chessimalsChallengeBestCombo: 'Combo',
|
|
62927
62940
|
chessimalsChallengeRoundWonTitle: 'Rival superado',
|
|
62928
62941
|
chessimalsChallengeRoundWonBody: 'Derrotaste a {bot}. Te quedan {lives} vidas y usaste {powers} poderes.',
|
|
62929
62942
|
chessimalsChallengeRoundLostTitle: 'Una vida menos',
|
|
@@ -63030,8 +63043,16 @@ const MINI_GAMES_I18N = {
|
|
|
63030
63043
|
chessimalsResultCaptures: 'Capturas',
|
|
63031
63044
|
chessimalsResultPowers: 'Poderes',
|
|
63032
63045
|
chessimalsResultReason: 'Motivo',
|
|
63046
|
+
chessimalsResultScore: 'Puntos',
|
|
63033
63047
|
chessimalsResultPowersUsed: 'Poderes usados: {powers}.',
|
|
63034
63048
|
chessimalsResultNoPowers: 'ninguno',
|
|
63049
|
+
chessimalsResultNoBestMove: 'Mejor jugada: todavía sin puntos.',
|
|
63050
|
+
chessimalsResultBestMoveLine: 'Mejor jugada: +{score} por {move}.',
|
|
63051
|
+
chessimalsScoreMove: 'avance',
|
|
63052
|
+
chessimalsScoreCapture: 'captura',
|
|
63053
|
+
chessimalsScorePowerMove: 'poder',
|
|
63054
|
+
chessimalsScorePowerCapture: 'captura con poder',
|
|
63055
|
+
chessimalsScorePromotion: 'promoción',
|
|
63035
63056
|
chessimalsSeriesTitle: 'Serie',
|
|
63036
63057
|
chessimalsSeriesScore: 'Tú {mine} · {player} {rival}',
|
|
63037
63058
|
chessimalsSeriesLastWinner: 'Última partida: ganó {player}.',
|
|
@@ -63329,6 +63350,8 @@ const MINI_GAMES_I18N = {
|
|
|
63329
63350
|
chessimalsProgressTitle: 'Progress',
|
|
63330
63351
|
chessimalsProgressSubtitle: 'Your Chessimals records, achievements, and favorite powers.',
|
|
63331
63352
|
chessimalsProgressPowers: 'Powers and plays',
|
|
63353
|
+
chessimalsProgressBestRoundScore: 'Best round',
|
|
63354
|
+
chessimalsProgressTotalScore: 'Total points',
|
|
63332
63355
|
chessimalsChallengeStart: 'Start challenge',
|
|
63333
63356
|
chessimalsChallengeStartNew: 'New challenge',
|
|
63334
63357
|
chessimalsChallengeResume: 'Resume challenge',
|
|
@@ -63375,6 +63398,9 @@ const MINI_GAMES_I18N = {
|
|
|
63375
63398
|
chessimalsChallengePowersUsed: 'Powers',
|
|
63376
63399
|
chessimalsChallengePowerCaptures: 'Power captures',
|
|
63377
63400
|
chessimalsChallengePromotions: 'Promotions',
|
|
63401
|
+
chessimalsChallengeRoundScore: 'Points',
|
|
63402
|
+
chessimalsChallengeBestMove: 'Best move',
|
|
63403
|
+
chessimalsChallengeBestCombo: 'Combo',
|
|
63378
63404
|
chessimalsChallengeRoundWonTitle: 'Rival cleared',
|
|
63379
63405
|
chessimalsChallengeRoundWonBody: 'You defeated {bot}. You have {lives} lives left and used {powers} powers.',
|
|
63380
63406
|
chessimalsChallengeRoundLostTitle: 'One life down',
|
|
@@ -63481,8 +63507,16 @@ const MINI_GAMES_I18N = {
|
|
|
63481
63507
|
chessimalsResultCaptures: 'Captures',
|
|
63482
63508
|
chessimalsResultPowers: 'Powers',
|
|
63483
63509
|
chessimalsResultReason: 'Reason',
|
|
63510
|
+
chessimalsResultScore: 'Points',
|
|
63484
63511
|
chessimalsResultPowersUsed: 'Powers used: {powers}.',
|
|
63485
63512
|
chessimalsResultNoPowers: 'none',
|
|
63513
|
+
chessimalsResultNoBestMove: 'Best move: no points yet.',
|
|
63514
|
+
chessimalsResultBestMoveLine: 'Best move: +{score} for {move}.',
|
|
63515
|
+
chessimalsScoreMove: 'advance',
|
|
63516
|
+
chessimalsScoreCapture: 'capture',
|
|
63517
|
+
chessimalsScorePowerMove: 'power',
|
|
63518
|
+
chessimalsScorePowerCapture: 'power capture',
|
|
63519
|
+
chessimalsScorePromotion: 'promotion',
|
|
63486
63520
|
chessimalsSeriesTitle: 'Series',
|
|
63487
63521
|
chessimalsSeriesScore: 'You {mine} · {player} {rival}',
|
|
63488
63522
|
chessimalsSeriesLastWinner: 'Last game: {player} won.',
|
|
@@ -64990,7 +65024,12 @@ class ChessimalsGameComponent {
|
|
|
64990
65024
|
this.resultPowers = computed(() => this.replayEntries()
|
|
64991
65025
|
.map((entry) => entry.move?.animal)
|
|
64992
65026
|
.filter((animal) => !!animal));
|
|
65027
|
+
this.resultScore = computed(() => this.createGameScore(this.game()));
|
|
64993
65028
|
this.resultStats = computed(() => [
|
|
65029
|
+
{
|
|
65030
|
+
label: this.t('chessimalsResultScore'),
|
|
65031
|
+
value: String(this.resultScore().score),
|
|
65032
|
+
},
|
|
64994
65033
|
{
|
|
64995
65034
|
label: this.t('chessimalsResultMoves'),
|
|
64996
65035
|
value: String(this.game().moveCount),
|
|
@@ -65014,6 +65053,14 @@ class ChessimalsGameComponent {
|
|
|
65014
65053
|
return this.t('chessimalsResultNoPowers');
|
|
65015
65054
|
return powers.map((animal) => this.animalLabel(animal)).join(' · ');
|
|
65016
65055
|
});
|
|
65056
|
+
this.resultBestMoveLabel = computed(() => {
|
|
65057
|
+
const bestMove = this.resultScore().bestMove;
|
|
65058
|
+
if (!bestMove)
|
|
65059
|
+
return this.t('chessimalsResultNoBestMove');
|
|
65060
|
+
return this.t('chessimalsResultBestMoveLine')
|
|
65061
|
+
.replace('{score}', String(bestMove.score))
|
|
65062
|
+
.replace('{move}', bestMove.label);
|
|
65063
|
+
});
|
|
65017
65064
|
this.shouldShowBotReport = computed(() => this.game().mode === 'local' &&
|
|
65018
65065
|
this.game().status === 'finished' &&
|
|
65019
65066
|
!this.tutorialMode() &&
|
|
@@ -66941,13 +66988,74 @@ class ChessimalsGameComponent {
|
|
|
66941
66988
|
return 0;
|
|
66942
66989
|
return stats.powersUsed.eagle + stats.powersUsed.bull + stats.powersUsed.kangaroo + stats.powersUsed.lion;
|
|
66943
66990
|
}
|
|
66991
|
+
createGameScore(game, playerPrefix) {
|
|
66992
|
+
let score = 0;
|
|
66993
|
+
let combo = 0;
|
|
66994
|
+
let bestCombo = 0;
|
|
66995
|
+
let bestMove;
|
|
66996
|
+
for (const entry of game.moveHistory ?? []) {
|
|
66997
|
+
const move = entry.move;
|
|
66998
|
+
if (!move)
|
|
66999
|
+
continue;
|
|
67000
|
+
if (playerPrefix && !move.pieceId.startsWith(playerPrefix))
|
|
67001
|
+
continue;
|
|
67002
|
+
const moveColor = this.colorFromPieceId(move.pieceId);
|
|
67003
|
+
const isPromotion = entry.status === 'finished' && entry.winnerReason === 'promotion' && entry.winner === moveColor;
|
|
67004
|
+
const moveScore = this.scoreChessimalsMove(move, isPromotion, combo);
|
|
67005
|
+
if (move.capturesPieceId) {
|
|
67006
|
+
combo += 1;
|
|
67007
|
+
bestCombo = Math.max(bestCombo, combo);
|
|
67008
|
+
}
|
|
67009
|
+
else {
|
|
67010
|
+
combo = 0;
|
|
67011
|
+
}
|
|
67012
|
+
score += moveScore.score;
|
|
67013
|
+
if (!bestMove || moveScore.score > bestMove.score)
|
|
67014
|
+
bestMove = moveScore;
|
|
67015
|
+
}
|
|
67016
|
+
return { bestCombo, bestMove, score };
|
|
67017
|
+
}
|
|
67018
|
+
scoreChessimalsMove(move, promotion, currentCombo) {
|
|
67019
|
+
const capture = !!move.capturesPieceId;
|
|
67020
|
+
const combo = capture ? currentCombo + 1 : 0;
|
|
67021
|
+
const score = 1
|
|
67022
|
+
+ (capture ? (move.animal ? 5 : 3) : 0)
|
|
67023
|
+
+ (move.animal && !capture ? 1 : 0)
|
|
67024
|
+
+ (promotion ? 8 : 0)
|
|
67025
|
+
+ (combo > 1 ? combo - 1 : 0);
|
|
67026
|
+
const labelKey = promotion
|
|
67027
|
+
? 'chessimalsScorePromotion'
|
|
67028
|
+
: capture && move.animal
|
|
67029
|
+
? 'chessimalsScorePowerCapture'
|
|
67030
|
+
: capture
|
|
67031
|
+
? 'chessimalsScoreCapture'
|
|
67032
|
+
: move.animal
|
|
67033
|
+
? 'chessimalsScorePowerMove'
|
|
67034
|
+
: 'chessimalsScoreMove';
|
|
67035
|
+
return {
|
|
67036
|
+
combo,
|
|
67037
|
+
label: this.t(labelKey),
|
|
67038
|
+
score,
|
|
67039
|
+
};
|
|
67040
|
+
}
|
|
67041
|
+
colorFromPieceId(pieceId) {
|
|
67042
|
+
if (pieceId.startsWith('W') || pieceId.startsWith('TW'))
|
|
67043
|
+
return 'white';
|
|
67044
|
+
if (pieceId.startsWith('B') || pieceId.startsWith('TB'))
|
|
67045
|
+
return 'black';
|
|
67046
|
+
return undefined;
|
|
67047
|
+
}
|
|
66944
67048
|
createChallengeRoundStats(game) {
|
|
67049
|
+
const roundScore = this.createGameScore(game, 'W');
|
|
66945
67050
|
const stats = {
|
|
66946
67051
|
powersUsed: { eagle: 0, bull: 0, kangaroo: 0, lion: 0 },
|
|
66947
67052
|
powerCaptures: 0,
|
|
66948
67053
|
promotions: game.winner === 'white' && game.winnerReason === 'promotion' ? 1 : 0,
|
|
66949
67054
|
captures: 0,
|
|
66950
67055
|
moves: 0,
|
|
67056
|
+
score: roundScore.score,
|
|
67057
|
+
bestMoveScore: roundScore.bestMove?.score ?? 0,
|
|
67058
|
+
bestCombo: roundScore.bestCombo,
|
|
66951
67059
|
};
|
|
66952
67060
|
for (const entry of game.moveHistory ?? []) {
|
|
66953
67061
|
const move = entry.move;
|
|
@@ -67833,6 +67941,9 @@ class ChessimalsGameComponent {
|
|
|
67833
67941
|
<p class="chessimals-result__detail">
|
|
67834
67942
|
{{ t('chessimalsResultPowersUsed').replace('{powers}', resultPowersLabel()) }}
|
|
67835
67943
|
</p>
|
|
67944
|
+
<p class="chessimals-result__detail">
|
|
67945
|
+
{{ resultBestMoveLabel() }}
|
|
67946
|
+
</p>
|
|
67836
67947
|
@if (shouldShowBotReport()) {
|
|
67837
67948
|
<div class="chessimals-bot-report">
|
|
67838
67949
|
<span aria-hidden="true">{{ gameBotProfile()?.avatar }}</span>
|
|
@@ -67866,16 +67977,20 @@ class ChessimalsGameComponent {
|
|
|
67866
67977
|
@if (challengeLastRoundStats(); as roundStats) {
|
|
67867
67978
|
<div class="chessimals-challenge-summary__stats">
|
|
67868
67979
|
<span>
|
|
67869
|
-
<small>{{ t('
|
|
67870
|
-
<b>{{
|
|
67980
|
+
<small>{{ t('chessimalsChallengeRoundScore') }}</small>
|
|
67981
|
+
<b>{{ roundStats.score }}</b>
|
|
67871
67982
|
</span>
|
|
67872
67983
|
<span>
|
|
67873
|
-
<small>{{ t('
|
|
67874
|
-
<b>{{ roundStats.
|
|
67984
|
+
<small>{{ t('chessimalsChallengeBestMove') }}</small>
|
|
67985
|
+
<b>{{ roundStats.bestMoveScore }}</b>
|
|
67875
67986
|
</span>
|
|
67876
67987
|
<span>
|
|
67877
|
-
<small>{{ t('
|
|
67878
|
-
<b>{{ roundStats
|
|
67988
|
+
<small>{{ t('chessimalsChallengePowersUsed') }}</small>
|
|
67989
|
+
<b>{{ totalChallengePowers(roundStats) }}</b>
|
|
67990
|
+
</span>
|
|
67991
|
+
<span>
|
|
67992
|
+
<small>{{ t('chessimalsChallengeBestCombo') }}</small>
|
|
67993
|
+
<b>x{{ roundStats.bestCombo || 1 }}</b>
|
|
67879
67994
|
</span>
|
|
67880
67995
|
</div>
|
|
67881
67996
|
}
|
|
@@ -68165,6 +68280,14 @@ class ChessimalsGameComponent {
|
|
|
68165
68280
|
<small>{{ t('chessimalsChallengeStatusCompleted') }}</small>
|
|
68166
68281
|
<strong>{{ challengeStats().challengesCompleted }}</strong>
|
|
68167
68282
|
</span>
|
|
68283
|
+
<span>
|
|
68284
|
+
<small>{{ t('chessimalsProgressBestRoundScore') }}</small>
|
|
68285
|
+
<strong>{{ challengeStats().bestRoundScore }}</strong>
|
|
68286
|
+
</span>
|
|
68287
|
+
<span>
|
|
68288
|
+
<small>{{ t('chessimalsProgressTotalScore') }}</small>
|
|
68289
|
+
<strong>{{ challengeStats().totalScore }}</strong>
|
|
68290
|
+
</span>
|
|
68168
68291
|
</div>
|
|
68169
68292
|
</article>
|
|
68170
68293
|
|
|
@@ -68974,6 +69097,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
68974
69097
|
<p class="chessimals-result__detail">
|
|
68975
69098
|
{{ t('chessimalsResultPowersUsed').replace('{powers}', resultPowersLabel()) }}
|
|
68976
69099
|
</p>
|
|
69100
|
+
<p class="chessimals-result__detail">
|
|
69101
|
+
{{ resultBestMoveLabel() }}
|
|
69102
|
+
</p>
|
|
68977
69103
|
@if (shouldShowBotReport()) {
|
|
68978
69104
|
<div class="chessimals-bot-report">
|
|
68979
69105
|
<span aria-hidden="true">{{ gameBotProfile()?.avatar }}</span>
|
|
@@ -69007,16 +69133,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
69007
69133
|
@if (challengeLastRoundStats(); as roundStats) {
|
|
69008
69134
|
<div class="chessimals-challenge-summary__stats">
|
|
69009
69135
|
<span>
|
|
69010
|
-
<small>{{ t('
|
|
69011
|
-
<b>{{
|
|
69136
|
+
<small>{{ t('chessimalsChallengeRoundScore') }}</small>
|
|
69137
|
+
<b>{{ roundStats.score }}</b>
|
|
69138
|
+
</span>
|
|
69139
|
+
<span>
|
|
69140
|
+
<small>{{ t('chessimalsChallengeBestMove') }}</small>
|
|
69141
|
+
<b>{{ roundStats.bestMoveScore }}</b>
|
|
69012
69142
|
</span>
|
|
69013
69143
|
<span>
|
|
69014
|
-
<small>{{ t('
|
|
69015
|
-
<b>{{ roundStats
|
|
69144
|
+
<small>{{ t('chessimalsChallengePowersUsed') }}</small>
|
|
69145
|
+
<b>{{ totalChallengePowers(roundStats) }}</b>
|
|
69016
69146
|
</span>
|
|
69017
69147
|
<span>
|
|
69018
|
-
<small>{{ t('
|
|
69019
|
-
<b>{{ roundStats.
|
|
69148
|
+
<small>{{ t('chessimalsChallengeBestCombo') }}</small>
|
|
69149
|
+
<b>x{{ roundStats.bestCombo || 1 }}</b>
|
|
69020
69150
|
</span>
|
|
69021
69151
|
</div>
|
|
69022
69152
|
}
|
|
@@ -69306,6 +69436,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
69306
69436
|
<small>{{ t('chessimalsChallengeStatusCompleted') }}</small>
|
|
69307
69437
|
<strong>{{ challengeStats().challengesCompleted }}</strong>
|
|
69308
69438
|
</span>
|
|
69439
|
+
<span>
|
|
69440
|
+
<small>{{ t('chessimalsProgressBestRoundScore') }}</small>
|
|
69441
|
+
<strong>{{ challengeStats().bestRoundScore }}</strong>
|
|
69442
|
+
</span>
|
|
69443
|
+
<span>
|
|
69444
|
+
<small>{{ t('chessimalsProgressTotalScore') }}</small>
|
|
69445
|
+
<strong>{{ challengeStats().totalScore }}</strong>
|
|
69446
|
+
</span>
|
|
69309
69447
|
</div>
|
|
69310
69448
|
</article>
|
|
69311
69449
|
|