feat(editor): add WSPL JSON round-trip authoring workflow

Closes the WSPL open-format loop with --export-wspl-json /
--import-wspl-json, mirroring the JSON pairs added for
every other novel binary format. All 14 binary formats
added since WOL now have full JSON round-trip authoring.

Each spell round-trips all 18 scalar fields. Four enum-typed
fields emit dual int + name forms so a hand-author can use
either:
  • school     (physical / holy / fire / nature / frost / shadow / arcane)
  • targetType (self / single / cone / aoe-self / line / ground)
  • effectKind (damage / heal / buff / debuff / teleport / summon / dispel)
  • flags      (passive / channeled / ranged / aoe / friendly / hostile / ...)

The flags bitset emits string-array form so a hand-author
can write ["hostile", "aoe"] instead of having to remember
that HostileOnly|AreaOfEffect = 0x110.

Verified byte-identical round-trip on the mage preset (4
spells covering frost / fire / arcane schools and damage /
buff / teleport effects, full flag and effect-value coverage).

Adds 2 flags (544 documented total now).
This commit is contained in:
Kelsi 2026-05-09 16:06:29 -07:00
parent e5eaf13866
commit 08834ff498
3 changed files with 211 additions and 0 deletions

View file

@ -989,6 +989,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WSPL spell entries (id / school / effect / cast/cd / mana / range / damage range / name)\n");
std::printf(" --validate-wspl <wspl-base> [--json]\n");
std::printf(" Static checks: spellId>0+unique, name not empty, school 0..6, range/value min<=max, friendly+hostile incoherent\n");
std::printf(" --export-wspl-json <wspl-base> [out.json]\n");
std::printf(" Export binary .wspl to a human-editable JSON sidecar (defaults to <base>.wspl.json)\n");
std::printf(" --import-wspl-json <json-path> [out-base]\n");
std::printf(" Import a .wspl.json sidecar back into binary .wspl (accepts school/target/effect/flag int OR name forms)\n");
std::printf(" --gen-achievements <wach-base> [name]\n");
std::printf(" Emit .wach starter: 3 achievements (First Blood / Helping Hand / Coming of Age)\n");
std::printf(" --gen-achievements-bandit <wach-base> [name]\n");