feat: regen buffs, wand aura, spellbook assess, indicator press flash

Four reports from one gate round. Three were mine; the fourth I first
mis-explained, and the correction is the useful part.

**The vital regeneration rates were never cast.** Regeneration (health),
Rejuvenation (stamina) and Mana Renewal (mana) all landed in the catch-all
Other bucket, which is off by default. Retail words each of the three
differently and two of the six phrasings do not begin with "Increases the
caster's" at all:

    Increase caster's natural healing rate by 10%.                 <- and note "Increase"
    Increases your Health Regeneration Rate by 50%.                (Empyrean)
    Increases the rate at which the caster regains Stamina by 10%.
    Increases the caster's natural mana rate by 10%.

They are matched per vital, on by default, and ranked at the very tail of the
Life group so they finish the pass. The mana line had to be checked BEFORE the
generic "Increases the caster's X by N" match, which would otherwise read it as
a buff to a stat named "natural mana rate".

**Aura of Hermetic Link was the sixth aura line and the only one missed.**
"a magic casting implement's" is reached by none of the other alternatives, so
the wand's mana-conversion buff was silently in Other too.

**Right-clicking a spell in the spellbook did nothing.** I claimed this had
never worked; the user said it used to, and they were right -- I had checked
one file's history and concluded from it. The regression is 3e31b0ac, which
gave UiCatalogSlot its own RightClick case returning true unconditionally. On
any list that had not wired the examine seam -- the spellbook among them -- the
event was reported handled and UiRoot stopped bubbling. Two fixes: the row now
reports an unwired right-click UNHANDLED so bubbling continues, and the
spellbook wires the seam to the same appraisal window the spell bar uses.

Retail does this generically in the list rather than per window
(UIElement_ItemList::ListenToElementMessage @ 0x004E4F1F -> ExamineSpell
@ 0x00564A70), which is exactly why a per-controller seam could be forgotten
for one window and not another.

**No green flash when pressing an indicator.** Every indicator button authors
a full-size 0x100000F2 child whose DirectState is a draw-nothing File=0 image
and whose only other state, Normal_pressed, carries the green selector sprite
0x06004CE8 -- and the buttons author Normal_pressed with PassToChildren. But
UiButton.ConsumesDatChildren drops dat children at import, so the cascade had
nothing left to reach. The child is re-attached through the same repair the map
hotspot's rollover highlight already uses.

**tools/LayoutDump** is new, and is why the last two are diagnoses rather than
guesses: it prints an authored LayoutDesc tree -- geometry, edge modes, state
sets, PassToChildren, per-state media -- straight from the installed DATs.
"Does this button even have a pressed state?" was being answered by reading our
own importer and inferring; now it is read from the data.

Solution builds clean; 14,464 tests pass on the standard hermetic lane filter,
0 failures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-20 20:38:28 +02:00
parent fe1f124cd8
commit 46ce6f238c
14 changed files with 1003 additions and 18 deletions

View file

@ -40,9 +40,15 @@ public sealed class BuffSettings
public bool BuffBanes { get; set; } = true;
/// <summary>
/// Anything else self-targeted with a duration (regeneration and friends).
/// Off by default: useful to some characters, wasted mana for others, and
/// it is the bucket anything unrecognised falls into.
/// The vital regeneration rates — Regeneration (health), Rejuvenation
/// (stamina), Mana Renewal (mana). Cast last, as the tail of a pass.
/// </summary>
public bool BuffRegeneration { get; set; } = true;
/// <summary>
/// Anything else self-targeted with a duration. Off by default: useful to
/// some characters, wasted mana for others, and it is the bucket anything
/// unrecognised falls into.
/// </summary>
public bool BuffOther { get; set; }
@ -122,6 +128,7 @@ public static class BuffPlan
BuffTargetKind.Protection => settings.BuffProtections,
BuffTargetKind.Aura => settings.BuffAuras,
BuffTargetKind.Bane => settings.BuffBanes,
BuffTargetKind.Regeneration => settings.BuffRegeneration,
BuffTargetKind.Other => settings.BuffOther,
_ => false,
};
@ -187,7 +194,8 @@ public static class BuffPlan
/// </list>
/// </item>
/// <item><b>Item Enchantment</b> — the banes and weapon auras.</item>
/// <item><b>Life Magic</b> last — the protections and Armor Self.</item>
/// <item><b>Life Magic</b> last — the protections and Armor Self, then
/// the vital regeneration rates to finish.</item>
/// </list>
/// <para>
/// <b>Willpower is matched as "Self".</b> Retail's spell is named Willpower
@ -206,11 +214,23 @@ public static class BuffPlan
_ => 3, // war/void and anything unschooled trail the rest
};
// Only the creature group has an internal order; the other groups are
// cast in whatever order the tiebreak gives.
return (school * 10) + (school == 0 ? CreatureOrder(line) : 0);
int within = school switch
{
0 => CreatureOrder(line),
2 => LifeOrder(line),
_ => 0, // the item group has no internal order
};
return (school * 10) + within;
}
/// <summary>
/// Inside Life Magic the protections go first and the vital regeneration
/// rates finish the pass — they are the buffs that matter least if mana
/// runs out, and the ones a character most often wants topped up last.
/// </summary>
private static int LifeOrder(BuffLine line) =>
line.Kind == BuffTargetKind.Regeneration ? 1 : 0;
private static int CreatureOrder(BuffLine line)
{
if (line.Kind == BuffTargetKind.Skill