feat(editor): WCRA JSON round-trip closure

Adds --export-wcra-json / --import-wcra-json. Variable-length
reagent arrays serialize as JSON object array of {itemId, count}
allowing hand-edits of recipe formulas. tradeSkillName field on
export is informational (tradeSkillId int is authoritative).
All 3 presets (alchemy/engineering/blacksmithing) byte-identical
binary roundtrip OK including the 5-reagent Target Dummy
recipe.

Live-tested perpetual-motion validator: hand-mutated Minor
Healing Potion (recipeId 1, produces itemId 118) to add itemId
118 to its reagents. Validator correctly errored: "reagent
itemId equals producedItemId=118 — recipe consumes what it
makes (perpetual-motion bug)" — catches a class of crafting
bugs that would silently let players duplicate items.

CLI flag count 1398 -> 1400.
This commit is contained in:
Kelsi 2026-05-10 04:32:02 -07:00
parent 7df59b1d80
commit 6c77419633
3 changed files with 141 additions and 0 deletions

View file

@ -409,6 +409,7 @@ const char* const kArgRequired[] = {
"--export-wqgr-json", "--import-wqgr-json",
"--gen-cra-alchemy", "--gen-cra-engineering", "--gen-cra-blacksmithing",
"--info-wcra", "--validate-wcra",
"--export-wcra-json", "--import-wcra-json",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",