Let charged guardian heals act without enemies and fix mixed S2 triggers (#406)

This commit is contained in:
sganggs committed 2026-10-09 17:31:42 +08:00
1 parent c9481c40bb
commit e86c7c8304
9 files changed
+155 -50

No files matched your search

+7
View File
@@ -101,6 +101,13 @@ export function updateAlly(b, u, dt) {
// (a 秘术师's `canAttack` is its own target rule: false = no valid target — 深靛's bound enemies, 维伊's marked ones)
if (prof.canAttack && !prof.canAttack(b, u)) { if (prof.storeEnergy) { u.trait.hadTarget = false; storeEnergy(b, u, prof); } return; }
let targets = acquireTargets(b, u, prof);
// A DEFAULT charged heal can replace this attack with an eligible ally even when no enemy exists.
// Run after cooldown/control checks so silence, disarm and the exact attack cadence still apply (#406).
if (!targets.length && sk?.triggerAllies && sk.onAboutToAttack()) {
prof = effectiveProfile(u);
if (prof.noAttack || !u.alive) return;
targets = acquireTargets(b, u, prof);
}
if (!targets.length) { u.trait.hadTarget = false; storeEnergy(b, u, prof); return; }
u.trait.hadTarget = true;
if (sk && sk.onAboutToAttack()) {