fixed # 补全梦三怪物、卡牌

fixed # 修复天书乱斗中,过关技能不会重置次数的问题
This commit is contained in:
2026-10-03 04:42:19 +08:00
parent b005a7ff15
commit c448da39c2
131 changed files with 5021 additions and 246 deletions
+5 -5
View File
@@ -23,17 +23,17 @@ export function applyRewardPackage(run, pack, selection, applyReward) {
const card = run.player.deck.find(card => card.id === selection.cardId);
const relic = pack.relicChoices.find(choice =>
choice.id === selection.relicId);
if (pack.upgradeChoices.length) {
if (selection.cardId !== null) {
if (!pack.upgradeChoices.some(card => card.id === selection.cardId) ||
!canUpgradeCard(card)) throw new Error("强化目标无效");
} else if (selection.cardId !== null) throw new Error("无可强化卡牌");
if (pack.relicChoices.length) {
}
if (selection.relicId !== null) {
if (!relic || !canAcquireRelic(run, relic.relic)) {
throw new Error("遗物选择无效");
}
} else if (selection.relicId !== null) throw new Error("无可选遗物");
}
run.player.gold += pack.gold;
run.statistics.goldEarned += pack.gold;
if (pack.upgradeChoices.length) card.upgrade = (card.upgrade || 0) + 1;
if (selection.cardId !== null) card.upgrade = (card.upgrade || 0) + 1;
if (relic) applyReward(run, relic.id);
}
+6 -2
View File
@@ -2,6 +2,9 @@ import { createStartingDeck } from "../cards/starting-deck.js";
import config from "../config.js";
import { initializeInnateBonds } from "../bonds/state.js";
import { RAIDER_TRIO_ENCOUNTER, createRaiderTrioBattlePlan } from "../content/acts/act1/raider-trio.js";
import { INKLET_CHARACTER } from "../monsters/inklet-intent.js";
import { createInkletBattlePlan } from "../content/acts/act1/inklet-group.js";
import { NIBBIT_PAIR_ENCOUNTER, createNibbitPairBattlePlan } from "../content/acts/act1/nibbit-pair.js";
const hashText = text => {
let value = 2166136261;
@@ -250,7 +253,7 @@ export const getNodeEncounter = (run, node, override = null) => {
}
const enemy = randomGet(run, pool.filter(Boolean));
return {
name: encounter?.name || (enemy === RAIDER_TRIO_ENCOUNTER ? "劫掠者团伙" : ""),
name: encounter?.name || (enemy === RAIDER_TRIO_ENCOUNTER ? "劫掠者团伙" : enemy === INKLET_CHARACTER ? "墨宝群" : enemy === NIBBIT_PAIR_ENCOUNTER ? "小啃兽双只" : ""),
requiredCharacter: encounter?.requiredCharacter || null,
openingDialogue: encounter?.openingDialogue || [],
fixedRewards: encounter?.fixedRewards || [],
@@ -258,7 +261,8 @@ export const getNodeEncounter = (run, node, override = null) => {
skipRandomReward: encounter?.skipRandomReward === true,
victoryDialogue: encounter?.victoryDialogue || [],
battlePlan: encounter?.battlePlan || (enemy === RAIDER_TRIO_ENCOUNTER ?
createRaiderTrioBattlePlan(() => nextRandom(run)) : null),
createRaiderTrioBattlePlan(() => nextRandom(run)) : enemy === INKLET_CHARACTER ?
createInkletBattlePlan() : enemy === NIBBIT_PAIR_ENCOUNTER ? createNibbitPairBattlePlan() : null),
tier: encounter?.tier || (node.type === "elite" ? "elite" : "normal"),
enemy,
gold: encounter?.gold ?? (node.type == "elite" || node.type == "story" ? act.baseGold * 2 : act.baseGold),