mirror of
https://github.com/Shu-Ying/noname-shuying.git
synced 2026-10-21 23:00:06 +08:00
fixed # 新增羁绊系统
fixed # 新增遗物系统 fixed # 梦三模式下移除护甲上限限制
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { createCardData } from "../cards/card-data.js";
|
||||
import { bondDefinitions } from "./definitions.js";
|
||||
import { ensureBonds, markBondDown } from "./state.js";
|
||||
import { getBondIntents } from "./intents.js";
|
||||
|
||||
export function initializeBondUnit(player, spec, run) {
|
||||
if (!spec.bondId) return null;
|
||||
const portrait = bondDefinitions[spec.bondId].portrait;
|
||||
if (player.node?.avatar) {
|
||||
player.node.avatar.style.backgroundImage = portrait ?
|
||||
`url("${portrait}")` : "none";
|
||||
}
|
||||
player.storage.mengsanBond_shuying = {
|
||||
id: spec.bondId, draw: spec.draw, handLimit: spec.handLimit,
|
||||
intents: getBondIntents(spec).map(move => ({ ...move })),
|
||||
turnsTaken: 0, intent: null,
|
||||
};
|
||||
player.storage.mengsanMaxEnergy_shuying = spec.energy;
|
||||
player.storage.mengsanEnergy_shuying = spec.energy;
|
||||
if (run.bondBattle?.id === spec.bondId) run.bondBattle.arrived = true;
|
||||
return {
|
||||
createDeck(prefix) {
|
||||
return spec.deck.map((entry, index) => {
|
||||
const card = typeof entry === "string" ? { name: entry } : entry;
|
||||
return createCardData({
|
||||
...card, id: `${prefix}_${index}`,
|
||||
suit: card.suit ||
|
||||
["spade", "heart", "club", "diamond"][index % 4],
|
||||
number: card.number || index % 13 + 1,
|
||||
}, { enemy: true });
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function recordBondDeath(player, run, log) {
|
||||
const id = player.storage?.mengsanBond_shuying?.id;
|
||||
if (!id || !run) return;
|
||||
if (ensureBonds(run).npcs[id]?.down) return;
|
||||
markBondDown(run, id);
|
||||
log(`${bondDefinitions[id].name}已退出战斗,羁绊状态:濒死`);
|
||||
}
|
||||
Reference in New Issue
Block a user