Padlock on casts that can't be interrupted

This commit is contained in:
rope 2026-10-25 19:44:58 +00:00
parent 294f2957e7
commit f6951b0f12
3 changed files with 9 additions and 1 deletions

View file

@ -1129,7 +1129,13 @@ function animateFight(now) {
if (castEl.dataset.key !== key) {
castEl.dataset.key = key;
castEl.classList.toggle("stopped", !!stopped);
castEl.innerHTML = cast ? `<span>${spec.icon} ${esc(spec.name)}</span><span class="bar"><span></span></span>`
// A cast no interrupt can stop gets a padlock; stuns still stop it on all but bosses.
const foe = f.pack[+el.dataset.u.slice(1)];
const locked = cast && spec.interrupt === false;
const boss = foe && (foe.boss || foe.archetype === "boss" || foe.archetype === "dragon");
castEl.classList.toggle("locked", !!locked);
castEl.title = locked ? `Can't be interrupted${boss ? "" : " · stuns stop it"}` : "";
castEl.innerHTML = cast ? `<span>${spec.icon} ${esc(spec.name)}${locked ? ` ${glyph("padlock", "currentColor")}` : ""}</span><span class="bar"><span></span></span>`
: stopped ? `<span>✋ <s>${spec.icon} ${esc(spec.name)}</s></span><span class="small">interrupted</span>` : "";
}
if (cast) castEl.querySelector(".bar > span").style.width = `${Math.min(100, (t - cast.from) / (cast.until - cast.from) * 100)}%`;