acdream/tests/AcDream.Plugins.MossTank.Tests
Erik fe1f124cd8 feat(mosstank): cast buffs in retail's dependency order
MossTank was casting cheapest-first. That is a reasonable rule for surviving
a mana shortfall and a bad one for everything else, because AC's buff order is
not a preference -- each group raises the skill the next group is cast with:

  1. Creature Enchantment, and inside it:
       - the Creature Enchantment skill itself, which every remaining creature
         buff is then cast with;
       - Focus, then Willpower, then Endurance -- Focus and Self are the
         attributes the Item Enchantment and Life Magic skills derive from, so
         raising them raises the skill groups 2 and 3 are cast with;
       - the rest of the creature spells.
  2. Item Enchantment -- the banes and weapon auras.
  3. Life Magic last -- the protections and Armor Self.

Casting out of that order means casting at a lower skill than the character
could have had, which shows up as fizzles.

Grouping is by the spell's school rather than by name or category, so
protections land in group 3 because retail files them under Life Magic, not
because anything here says "protections go last".

Willpower is matched as "Self": retail's spell is named Willpower but its
description reads "Increases the caster's Self by 10 points", and MossTank
classifies from the description, so the name it matches is the one retail
actually writes. Verified against the spell table rather than assumed
(0x05A5 Willpower Self I).

Cheapest-first survives as the tiebreak inside a group, so a mana shortfall
still costs the cheapest of the last group instead of something the rest of
the pass depended on.

The two ordering tests were confirmed to fail when CastRank is neutralised --
the third guards the tiebreak and passes either way, by design.

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

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 20:07:31 +02:00
..
AcDream.Plugins.MossTank.Tests.csproj feat(plugins): MossTank — a self-buffing plugin, and the automation surface it needed 2026-08-20 16:22:28 +02:00
BuffPlanTests.cs feat(mosstank): cast buffs in retail's dependency order 2026-08-20 20:07:31 +02:00
packages.neutral.lock.json feat(plugins): MossTank — a self-buffing plugin, and the automation surface it needed 2026-08-20 16:22:28 +02:00
VitalPlanTests.cs feat(mosstank): banes, protections and weapon auras 2026-08-20 19:49:51 +02:00