fix(spells): load complete retail DAT catalog

Replace the incomplete 3,956-row production CSV with one immutable projection of all 6,266 records in portal.dat. Preserve retail formula targeting, shared Spellbook/MagicRuntime metadata ownership, and fail startup when the required SpellTable is absent.

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-15 21:17:13 +02:00
parent 09612f9981
commit 0eab7497c1
19 changed files with 633 additions and 114 deletions

View file

@ -16,6 +16,34 @@ public sealed class RetailSpellFormulaTests
=> Assert.Equal(expected,
RetailSpellFormula.InqSpellLevelByRoughHeuristic([component]));
[Theory]
[InlineData(0x31u, 0x10u)]
[InlineData(0x39u, 0x00088B8Fu)]
[InlineData(0x3Bu, 0x10010000u)]
[InlineData(0xBEu, 0x10u)]
[InlineData(0x30u, 0u)]
public void TargetComponent_UsesRetailItemTypeMask(uint component, uint expected)
=> Assert.Equal(expected,
RetailSpellFormula.GetTargetTypeFromComponentId(component));
[Fact]
public void TargetingType_UsesTargetFormulaSlotsOnly()
{
Assert.Equal(0x10u,
RetailSpellFormula.GetTargetingType([1u, 2u, 3u, 4u, 5u, 0x31u]));
Assert.Equal(0u,
RetailSpellFormula.GetTargetingType([1u, 2u, 3u, 0x31u]));
}
[Fact]
public void TargetingType_MapsFinalPopulatedFormulaComponent()
{
Assert.Equal(0x10u,
RetailSpellFormula.GetTargetingType([1u, 2u, 3u, 4u, 0x39u, 0x31u]));
Assert.Equal(0x00088B8Fu,
RetailSpellFormula.GetTargetingType([1u, 2u, 3u, 4u, 0x39u, 0u, 0x31u]));
}
[Fact]
public void CustomizeForAccount_IsDeterministic_AndOnlyChangesTapers()
{