fix(sim): 浊心斯卡蒂 S1 and 坚守 tier 2 no longer bounce redirected damage between each other (the battle froze: every cycle branched per 坚守 member until the hook depth guard); regression test; golden: unchanged
This commit is contained in:
1 parent
1db8e51023
commit
e9a2e27c58
3 files changed
+55
-2
No files matched your search
@@ -121,7 +121,10 @@ function skadi2(bb, chess, def) {
|
||||
battle.on('hit', (ctx) => {
|
||||
const t = ctx.target, d = ctx.dmg;
|
||||
if (!(share > 0) || !t || t === unit || t.side !== 'ally' || t.kind === 'device' || !live(unit) || !unit.skill?.active) return;
|
||||
if (d.type === 'element' || d.type === 'elemental' || d.skadiShare || d.tags?.includes('transfer') || !inCover(battle, unit, t)) return;
|
||||
// damage another sharing effect already redirected (坚守 bond:stead:share) is not redirected again: the two
|
||||
// would bounce it between Skadi and the 坚守 members until the hook depth guard (docs/SIM.md §5 re-entrancy
|
||||
// rule) [ASSUMED: the official game does not chain the two transfers either]
|
||||
if (d.type === 'element' || d.type === 'elemental' || d.skadiShare || d.steadShare || d.tags?.includes('transfer') || d.tags?.includes('bond:stead:share') || !inCover(battle, unit, t)) return;
|
||||
d.skadiShare = { share, tag: TAG }; // 同类效果取最高: one transfer per damage instance
|
||||
d.mul *= 1 - share;
|
||||
}, { owner: unit, priority: -20 });
|
||||
|
||||
Reference in new issue
Block a user