fixed # 补全部分卡牌

fixed # 修复部分已知BUG
This commit is contained in:
2026-10-04 19:32:38 +08:00
parent c448da39c2
commit 94a2a6724b
163 changed files with 14008 additions and 1537 deletions
+13
View File
@@ -0,0 +1,13 @@
// Pure bridge: the controller validates the current battle/session on every lookup.
let resolver = () => null;
export function installSharedHookResolver(next) {
if (typeof next !== "function") throw new TypeError("通用牌钩子无效");
resolver = next;
}
export const sharedHooks = player => player ? resolver(player) : null;
export const sharedCardIsFree = (player,card) => sharedHooks(player)?.isFree(card) || false;
export const sharedCardCost = (player,card,cost) => sharedHooks(player)?.cost(card,cost) ?? cost;
export const sharedStrengthPenalty = player => sharedHooks(player)?.strengthPenalty() || 0;
export const beforeSharedBlock = (player,num,event) => sharedHooks(player)?.blockAmount(num,event) ?? num;
export const afterSharedDraw = async (player,cards) => sharedHooks(player)?.afterDraw(cards);