mirror of
https://github.com/Shu-Ying/noname-shuying.git
synced 2026-10-18 21:30:01 +08:00
fixed # 补全梦三怪物、卡牌
fixed # 修复天书乱斗中,过关技能不会重置次数的问题
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { get } from "../../../../noname.js";
|
||||
import { cardUpgradeRule } from "../cards/upgrades.js";
|
||||
import { lib, get } from "../../../../noname.js";
|
||||
import { getRelic } from "../relics/definitions.js";
|
||||
import {
|
||||
chooseCardDialog, chooseRelicDialog, chooseVictoryOptions,
|
||||
@@ -8,12 +7,12 @@ import {
|
||||
|
||||
const upgradeDescription = choice => {
|
||||
const card = choice.card;
|
||||
const rule = cardUpgradeRule(card.name);
|
||||
const damage = card.name === "sha" ? 6 : 8;
|
||||
const info = lib.card[card.name];
|
||||
const suit = get.translation(card.suit);
|
||||
return `${suit}${card.number} · 伤害 ${damage} → ${rule.damage}` +
|
||||
(rule.vulnerable ? `;易伤 2 → ${rule.vulnerable} 层` : "") +
|
||||
"。费用不变,最多强化一次。";
|
||||
// Display this card's current rules, not eligibility or upgrade comparisons.
|
||||
const description = typeof info?.cardPrompt === "function"
|
||||
? info.cardPrompt(card) : lib.translate[`${card.name}_info`] || "暂无卡牌介绍。";
|
||||
return `${suit}${card.number} · ${description}`;
|
||||
};
|
||||
|
||||
export async function chooseRewardPackage(choices, {
|
||||
@@ -23,59 +22,70 @@ export async function chooseRewardPackage(choices, {
|
||||
const upgradeChoices = pack.upgradeChoices.map(card => ({
|
||||
id: card.id, card,
|
||||
}));
|
||||
const ready = () => (!upgradeChoices.length || cardId !== null) &&
|
||||
(!pack.relicChoices.length || relicId !== null);
|
||||
const upgrade = {
|
||||
id: "upgrade", label: "强化一张牌",
|
||||
description: upgradeChoices.length
|
||||
? "从个人牌库中择一磨砺,查看强化前后的变化。"
|
||||
? "从个人牌库中选择一张牌进行磨砺。"
|
||||
: "当前没有可强化卡牌,此项无需选择。",
|
||||
isDisabled: () => !upgradeChoices.length,
|
||||
async choose() {
|
||||
const selected = await chooseCardDialog(upgradeChoices, {
|
||||
title: "磨砺 · 强化一张牌", skipLabel: "返回奖励",
|
||||
title: "磨砺 · 强化一张牌", skipLabel: "跳过强化",
|
||||
description: "择一磨砺,锋芒更盛。只强化你选中的一张牌。",
|
||||
describeChoice: upgradeDescription, actionLabel: "强化此牌",
|
||||
});
|
||||
cardId = selected;
|
||||
if (selected !== null) {
|
||||
cardId = selected;
|
||||
const choice = upgradeChoices.find(card => card.id === selected);
|
||||
upgrade.label = `已选强化 · ${get.translation(choice.card.name)}`;
|
||||
upgrade.description = upgradeDescription(choice);
|
||||
} else {
|
||||
upgrade.label = "已跳过强化";
|
||||
upgrade.description = "不强化卡牌;点击可重新选择。";
|
||||
}
|
||||
return RETURN_TO_VICTORY;
|
||||
},
|
||||
};
|
||||
const relic = {
|
||||
id: "relic", label: "遗物 · 三选一",
|
||||
id: "relic", label: pack.relicChoices.length
|
||||
? `遗物奖励 · ${pack.relicChoices.length}选1` : "遗物奖励 · 暂无候选",
|
||||
description: pack.relicChoices.length
|
||||
? "检视本次随机珍藏,择一伴你踏上下一段征途。"
|
||||
: "已持有奖励池中的全部遗物,此项无需选择。",
|
||||
isDisabled: () => !pack.relicChoices.length,
|
||||
async choose() {
|
||||
const selected = await chooseRelicDialog(pack.relicChoices, {
|
||||
skipLabel: "返回奖励", actionLabel: "携此遗物",
|
||||
skipLabel: "跳过遗物", actionLabel: "携此遗物",
|
||||
});
|
||||
relicId = selected;
|
||||
if (selected !== null) {
|
||||
relicId = selected;
|
||||
const choice = pack.relicChoices.find(item => item.id === selected);
|
||||
const definition = getRelic(choice.relic);
|
||||
relic.label = `已选遗物 · ${definition.name}`;
|
||||
relic.description = definition.description;
|
||||
} else {
|
||||
relic.label = "已跳过遗物";
|
||||
relic.description = "不领取遗物;点击可重新选择。";
|
||||
}
|
||||
return RETURN_TO_VICTORY;
|
||||
},
|
||||
};
|
||||
return chooseVictoryOptions([upgrade, relic, {
|
||||
id: "claim-package", label: "领取全部奖励",
|
||||
description: "完成以上选择后,金币、强化、遗物与固定卡牌一并入囊。",
|
||||
isDisabled: () => !ready(),
|
||||
id: "claim-package", label: "领取奖励并继续",
|
||||
description: "领取必得奖励与已选奖励,未选择的项目视为跳过。",
|
||||
choose: () => ({ cardId, relicId }),
|
||||
}, {
|
||||
id: "skip-package", label: "跳过",
|
||||
description: "跳过强化与遗物,金币与固定卡牌仍会获得。",
|
||||
choose: () => ({ cardId: null, relicId: null }),
|
||||
}], {
|
||||
title: "初识的卢", allowSkip: false,
|
||||
rewardLabel: "固定收获 · 完成两项选择后领取",
|
||||
rewardLabel: "搜刮 · 战利品列表",
|
||||
rewardItems: [{ name: `金币 · ${pack.gold}(必得)`,
|
||||
description: "无论选择还是跳过,金币都会结算。" },
|
||||
...fixedRewards.map(reward => ({ ...reward, name: `${reward.name}(必得)` }))],
|
||||
description: `固定获得 ${pack.gold} 金币与${fixedRewards.map(
|
||||
reward => `【${reward.name}】`).join("、")}。` +
|
||||
"另可强化一张牌,并从随机遗物中择一件。",
|
||||
"强化与遗物点击后选择,也可跳过。",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user