feedback4: a bond card's layer-scaled chance (不屈, 迅捷, 奇迹) stops at 100 % like the sim's (GitHub #108: 124 % at 266 layers)

This commit is contained in:
sganggs committed 2026-10-05 14:37:23 +08:00
1 parent 723755e3a5
commit 305b524df2
2 files changed
+9 -1

No files matched your search

+4 -1
View File
@@ -175,7 +175,10 @@ export function formatBondEffect(bond, layers = 0) {
if (!p || !Number.isInteger(p.index)) continue;
const base = Number(bb[p.base]) || 0;
const per = Number(bb[p.perStack]) || 0;
values[p.index] = base + per * L;
// a layer-scaled chance (迅捷 / 不屈 base_prob + prob_per_stack, 奇迹 baseprob + prob) stops at 100 % like the sim's
// min(1, …) (bonds/addon procChance, meta.js 奇迹) — the card read 124 % at 266 layers (GitHub #108)
const chance = /prob/i.test(`${p.base}|${p.perStack}`);
values[p.index] = chance ? Math.max(0, Math.min(1, base + per * L)) : base + per * L;
formats[p.index] = p.format || '0';
}
return fillPlaceholders(src, values, formats);