mirror of
https://github.com/Shu-Ying/noname-shuying.git
synced 2026-10-18 13:20:02 +08:00
fixed # 新增羁绊系统
fixed # 新增遗物系统 fixed # 梦三模式下移除护甲上限限制
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
import config from "../config.js";
|
||||
import { nextRandom } from "./state.js";
|
||||
import { canAcquireCard } from "../cards/card-definitions.js";
|
||||
import { hasUpgradeableCard } from "../cards/upgrades.js";
|
||||
import { canAcquireRelic } from "../relics/definitions.js";
|
||||
|
||||
export const rewardCardName = reward => reward?.card?.name || ({ card_sha: "sha", card_tao: "tao" })[reward?.effectId] || null;
|
||||
export const canAcquireReward = (run, reward) => {
|
||||
if (reward?.relic) return canAcquireRelic(run, reward.relic);
|
||||
if (reward?.effectId === "item_hand") {
|
||||
return canAcquireRelic(run, "mengsan_hand_charm_shuying");
|
||||
}
|
||||
if (reward?.effectId === "upgrade") {
|
||||
return hasUpgradeableCard(run?.player?.deck);
|
||||
}
|
||||
const name = rewardCardName(reward);
|
||||
return !name || canAcquireCard(run?.player?.character, name);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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";
|
||||
|
||||
const hashText = text => {
|
||||
@@ -177,6 +178,7 @@ export const createRun = character => {
|
||||
},
|
||||
storyFlags: {},
|
||||
};
|
||||
initializeInnateBonds(run);
|
||||
run.map = generateActMap(run, 0);
|
||||
return run;
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { meetBond } from "../bonds/state.js";
|
||||
|
||||
export const getAvailableStoryChoices = (run, content) => {
|
||||
const flags = run.storyFlags || {};
|
||||
return (content?.choices || []).filter(choice => {
|
||||
@@ -9,5 +11,9 @@ export const getAvailableStoryChoices = (run, content) => {
|
||||
export const applyStoryOutcome = (run, outcome = {}) => {
|
||||
if (!run.storyFlags) run.storyFlags = {};
|
||||
Object.assign(run.storyFlags, outcome.flags || {});
|
||||
for (const bond of outcome.bonds || []) {
|
||||
meetBond(run, typeof bond === "string" ? bond : bond.id,
|
||||
typeof bond === "string" ? 1 : bond.level ?? 1);
|
||||
}
|
||||
return outcome;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user