feat(editor): add WCRE JSON round-trip (--export/--import-wcre-json)

Dual encoding for ccImmunityMask: int OR "+"-joined
token string composed from {root, snare, stun, fear,
sleep, silence, charm, disarm, polymorph, banish,
knockback, interrupt, taunt, bleed} plus the shorthands
"all" (0xFFFF, typical raid-boss profile) and "none" (0).
The "+" syntax matches what ccImmunityString emits on
info display so the round-trip uses identical syntax.

Per-bit token form is much more useful than raw bitfield
ints for hand-edited JSON — operators can read
"fear+silence" and immediately know the buff hits both
without doing 0x0028 & flag math.

mechanicImmunityMask remains a raw uint32 (no token form
yet — the underlying mechanic enum has 30+ values that
would clutter the token table; deferred until a real
authoring need surfaces).

All 3 presets (bosses/elites/immunities) byte-identical
roundtrip OK. Token-form import smoke-tested with
"fear+silence+polymorph" parsing to 0x0128 correctly.
CLI flag count 1167 -> 1169.
This commit is contained in:
Kelsi 2026-05-10 01:42:56 -07:00
parent f9cad45154
commit 3c8516f8d4
3 changed files with 198 additions and 0 deletions

View file

@ -327,6 +327,7 @@ const char* const kArgRequired[] = {
"--export-wldn-json", "--import-wldn-json",
"--gen-cre", "--gen-cre-elites", "--gen-cre-immune",
"--info-wcre", "--validate-wcre",
"--export-wcre-json", "--import-wcre-json",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",