feat(editor): add WSPC JSON round-trip (--export/--import-wspc-json)

Closes the editing loop on the spell-power-cost bucket catalog:
dump a .wspc to JSON, hand-edit baseCost / perLevelCost /
percentOfBase / powerType / costFlags (e.g. retune LowMana from
5% to 4%, add ScalesWithMastery to a class bucket, switch a
Whirlwind cost from 25 rage to 20), re-import to a byte-identical
binary.

The exporter emits both powerType (int 0..11) and the human-
readable powerTypeName ("mana" / "rage" / "focus" / "energy" /
"happiness" / "runic-power" / "runes" / "soul-shards" /
"holy-power" / "eclipse" / "health" / "no-cost"). costFlags is
emitted as both int bitfield AND pipe-separated label string.
The importer prefers the int form for costFlags when both are
present so unknown flag bits round-trip losslessly.

Verified byte-identical round-trip on all three presets
(starter / rage / mixed). CLI flag count 927 -> 929.
This commit is contained in:
Kelsi 2026-05-09 22:02:08 -07:00
parent 88effe39cd
commit 47d8892f74
3 changed files with 189 additions and 0 deletions

View file

@ -1771,6 +1771,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WSPC entries (id / powerType / baseCost / perLevelCost / percentOfBase / cost flags / name) — flags decoded as label list\n");
std::printf(" --validate-wspc <wspc-base> [--json]\n");
std::printf(" Static checks: id+name required, powerType 0..11, no duplicate ids; warns on percent outside [0,1], NoCost+nonzero, and non-NoCost types with no cost set (would cast for free)\n");
std::printf(" --export-wspc-json <wspc-base> [out.json]\n");
std::printf(" Export binary .wspc to a human-editable JSON sidecar (defaults to <base>.wspc.json)\n");
std::printf(" --import-wspc-json <json-path> [out-base]\n");
std::printf(" Import a .wspc.json sidecar back into binary .wspc (accepts powerType int OR name; costFlags int OR pipe-separated label string)\n");
std::printf(" --gen-weather-temperate <wow-base> [zoneName]\n");
std::printf(" Emit .wow weather schedule: clear-dominant + occasional rain + fog (forest / grassland)\n");
std::printf(" --gen-weather-arctic <wow-base> [zoneName]\n");