feedback5 WY: 华法琳's granted trait stops at the data's 7 / 14 layers per battle, not 12 / 24 (GitHub #175; from PR #192 by @kukiC; the owner's decision of 2026-10-06)

PRTS 卫戍协议:盟约 下半, 3月27日更新#2调整 (revision 439189): 「[Ⅳ阶]华法琳:赋予的特质的叠层上限从 初始12/精锐24
降低至 初始7/精锐14」 — a nerf; the current 参战干员 record says 至多7层 / 14层 and the client blackboard is 7 / 14.
Research 02 Addendum 1 had read the line backwards, so the remake overrode garrison_95's cap to 12 / 24.

Ported from PR #192 by @kukiC: GRANTED_CAP_OVERRIDE is removed from server/sim/content/garrisons/battle.js and from
the client-result layer bound (server/match/fields.js layerAllowanceOf); a granted trait keeps its data cap like a
native one. Tests from the PR: garrisons_battle (updated on purpose: the 7th cast reaches 7 / 14, the 8th adds
nothing), feedback1-gaps (the bound with 华法琳 + 古米), playtest3 (both cards show 7 / 14); the first two fail without
the fix. Docs: research 00 / 01 / 02 corrected (02-bonds.json's note; data/bonds.json regenerated offline — only
miraShip.spec.layerGain changed), history 0.1.1's pointer, DESIGN §25.13.2 and the §25.10 table.
Golden unchanged (no corpus battle casts 8 times in front of 华法琳).
This commit is contained in:
sganggs committed 2026-10-06 21:03:56 +08:00
1 parent 463352d9bc
commit 269d7b0bcf
12 files changed
+77 -31

No files matched your search

+6 -8
View File
@@ -32,7 +32,6 @@
import { TICK, SNAPSHOT_EVERY } from '../sim/constants.js';
import { layerGainRoom } from '../../shared/constants.js';
import { uniteLeft } from '../sim/spec.js';
import { GRANTED_CAP_OVERRIDE } from '../sim/content/garrisons/battle.js';
import { diyTokenOwner } from '../../shared/diy.js';
export const MAX_TICKS_PER_INTERVAL = 8;
@@ -589,8 +588,8 @@ function layerBondsOf(p, gd) {
* §21.26): the traits of its units (garrisons with `bond_add_count` / `bond_add_count_multi`) and the ones their ADD_BOND
* traits hand out (`give_garrison_id`, counted for every operator of the player — "所有【X】" reaches them all), each on
* the bonds it names (`bond_by_id` ids; `bond_self` / `bond_actived_maxstack`: every bond of the player's snapshot and
* units), up to the per-battle cap the sim applies (content/garrisons/battle.js: `max_add_count_per_battle`, the handed-out
* 华法琳 trait's GRANTED_CAP_OVERRIDE). A trait the data gives no cap (初雪 / 银灰's freeze trait, 菲莱 / 百炼嘉维尔's per-skill
* units), up to the per-battle cap the sim applies (content/garrisons/battle.js: `max_add_count_per_battle` — a handed-out
* trait's too, 华法琳's 7 / 14, GitHub #175). A trait the data gives no cap (初雪 / 银灰's freeze trait, 菲莱 / 百炼嘉维尔's per-skill
* 萨尔贡, 斯卡蒂's per-kill …) — or a 魔王, whose +extra on every trait gain counts toward no cap — leaves its bonds bounded
* only by the room under 999 (Infinity here): such boards legitimately gain hundreds of layers a battle.
* @returns {Map<string, number>} bondId → extra allowance (Infinity: uncapped)
@@ -602,23 +601,22 @@ function layerAllowanceOf(p, gd) {
const lineup = new Set(Object.keys(p.bonds && typeof p.bonds === 'object' ? p.bonds : {}));
for (const u of units) for (const b of gd.chess(u.chessId)?.bonds || []) lineup.add(b);
let extra = false;
const credit = (g, times, handedOut) => {
const credit = (g, times) => {
const bb = g.bb || {};
if (Number.isFinite(bb.extra_cnt)) { extra = true; return; }
if (!Number.isFinite(bb.bond_add_count) && !Number.isFinite(bb.bond_add_count_multi)) return;
const s = g.bbStr || {};
const bonds = s.bond_type === 'bond_by_id' ? String(s.bond_id ?? '').split(',').map((x) => x.trim()).filter((x) => gd.bond(x)) : [...lineup];
const override = handedOut ? GRANTED_CAP_OVERRIDE[g.garrisonId] : undefined;
const cap = override ?? (Number(bb.max_add_count_per_battle) > 0 ? Number(bb.max_add_count_per_battle) : Infinity);
const cap = Number(bb.max_add_count_per_battle) > 0 ? Number(bb.max_add_count_per_battle) : Infinity;
for (const b of bonds) out.set(b, (out.get(b) || 0) + cap * times);
};
for (const u of units) {
for (const gid of gd.chess(u.chessId)?.garrisonIds || []) {
const g = gd.garrison(gid);
if (!g || g.eventType !== 'IN_BATTLE') continue;
if (g.effectKey !== 'ADD_BOND') { credit(g, 1, false); continue; }
if (g.effectKey !== 'ADD_BOND') { credit(g, 1); continue; }
const given = gd.garrison(g.bbStr?.give_garrison_id);
if (given && given.eventType === 'IN_BATTLE') credit(given, units.length, true);
if (given && given.eventType === 'IN_BATTLE') credit(given, units.length);
}
}
if (extra) for (const b of out.keys()) out.set(b, Infinity);