update:优化节奏训练文案

This commit is contained in:
2026-10-12 16:12:24 +08:00
parent bad336c7d4
commit 5bb9df8a03
2 changed files with 22 additions and 8 deletions
@@ -223,7 +223,7 @@ const rhythmTitle = computed(() => {
if (!validRhythmHitReq.value) { if (!validRhythmHitReq.value) {
return `在最后的${validRhythmShootTime.value}秒内射箭`; return `在最后的${validRhythmShootTime.value}秒内射箭`;
} }
return `在最后的${validRhythmShootTime.value}秒并命中${validRhythmHitReq.value}环内`; return `在最后的${validRhythmShootTime.value}秒射箭并命中${validRhythmHitReq.value}环内`;
}); });
const displayName = computed(() => { const displayName = computed(() => {
+21 -7
View File
@@ -494,21 +494,17 @@ const trainingCopy = computed(() => {
if (trainingType.value === "rhythm") { if (trainingType.value === "rhythm") {
const totalArrows = getPositiveInteger(rhythmTargetArrows.value) || total.value; const totalArrows = getPositiveInteger(rhythmTargetArrows.value) || total.value;
// 总箭数与达标箭数分别展示,合格进度优先使用服务端快照。 // 节奏训练进度由总箭数减剩余箭数计算,qualifiedArrows 仅用于稳定训练。
const targetArrows = const targetArrows =
getPositiveInteger(practiceInfo.value.targetArrows) || getPositiveInteger(practiceInfo.value.targetArrows) ||
getPositiveInteger(trainingParams.value.totalReq) || totalArrows; getPositiveInteger(trainingParams.value.totalReq) || totalArrows;
const arrowsLeft = Math.min( const completedArrows = Math.min(
totalArrows, totalArrows,
Math.max( Math.max(
0, 0,
getPracticeNumber(practiceInfo.value.arrowsLeft, totalArrows) totalArrows - getPracticeNumber(practiceInfo.value.arrowsLeft, totalArrows)
) )
); );
const completedArrows = Math.max(
0,
getPracticeNumber(practiceInfo.value.qualifiedArrows, totalArrows - arrowsLeft)
);
const hitReq = rhythmHitReq.value; const hitReq = rhythmHitReq.value;
return { return {
@@ -735,6 +731,24 @@ const syncPracticeInfo = (message = {}) => {
return result; return result;
}, {}); }, {});
const isRhythmSnapshot =
messageTrainingType === "rhythm" &&
(message.type === undefined ||
[
MESSAGETYPESV2.BattleStart,
MESSAGETYPESV2.ShootResult,
MESSAGETYPESV2.BattleEnd,
].includes(message.type));
if (isRhythmSnapshot) {
// 完整快照中 proto3 会省略 0;最后一箭及重连时不能保留旧剩余数。
for (const field of ["arrowsLeft", "qualifiedArrows"]) {
if (!Object.prototype.hasOwnProperty.call(nextInfo, field)) {
nextInfo[field] = 0;
}
}
}
const isStabilityEnergySnapshot = const isStabilityEnergySnapshot =
messageTrainingType === "stability" && messageTrainingType === "stability" &&
(Object.prototype.hasOwnProperty.call(message, "currentEnergy") || (Object.prototype.hasOwnProperty.call(message, "currentEnergy") ||