code wiki / _hdl_build / nx_wardrobe_state.nx
nx_wardrobe_state.nx
buildroot/runtime/_hdl_build/nx_wardrobe_state.nx
about
nx_wardrobe_state.nx -- THE WARDROBE / EXPOSURE / TRANSFORMATION STATE MACHINE (certified composable PART).
nx_gamebench ranked its capabilities: adult-gating-by-construction (blocks all 10 adult reference titles)
and wardrobe-state-coherence (blocks 3) top the gap_queue. This part eats both.
It is the game-side twin of the companion keystone F975 (a character dresses herself + STAYS coherent):
a body is a set of ZONES each with a coverage LEVEL; the state can never self-contradict, round-trips
through the certified save part bit-exact, and -- the point -- FAILS CLOSED on age<18 BY CONSTRUCTION,
the nx_card_compile refusal pattern generalized to a reusable game part.
Built as a LIB (no main) per knowledge/registry/game_parts.tsv doctrine so every emitted adult title
inherits these properties for free. Composes nx_gamesave (the certified persistence part).
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 3 importers
imports: nx_syscalls.nxnx_gamesave.nx
imported by: nx_coc_engine.nxnx_m2d_engine.nxnx_wardrobe_state_gate.nx
structs
| none |
consts
| 17 | const WS_NZ: i64 = 8 // zones: 0 head 1 torso 2 chest 3 waist 4 hips 5 legs 6 feet 7 hands |
| 18 | const WS_MAXCOV: i64 = 4 // 0 nude, 1 underwear, 2 modest, 3 dressed, 4 outerwear |
| 19 | const WS_MODEST: i64 = 2 // coverage >= WS_MODEST = NOT sexually exposed |
| 20 | const WS_ADULT_AGE: i64 = 18 // fail-closed threshold (matches nx_card_compile) |
| 21 | const WS_NMORPH: i64 = 8 // transformation forms 0..WS_NMORPH-1 (species/morph, humanoid-only) |
| 22 | const WS_LEN: i64 = 10 // i64 state vector: [0]=age [1]=morph [2..9]=coverage per zone |
| 23 | const WS_SCHEMA: i64 = 975 // save schema id (F975 lineage) |
| 24 | const WS_CK_SEED: i64 = 2166136261 |
| 25 | const WS_CK_MUL: i64 = 16777619 |
| 28 | const WS_E_MINOR: i64 = 0-1 // adult gate: would expose a gated zone on a minor -> REFUSED |
| 29 | const WS_E_ZONE: i64 = 0-2 |
| 30 | const WS_E_COV: i64 = 0-3 |
| 31 | const WS_E_INCOHERENT: i64 = 0-4 // load refused: persisted state violates an invariant |
| 32 | const WS_E_MORPH: i64 = 0-5 |
functions
| 34 | func ws_len() -> i64 { return WS_LEN } called by 1: main |
| 37 | func ws_is_gated_zone(z: i64) -> i64 |
| 45 | func ws_init(w: *i64, age: i64, morph: i64) -> i64 |
| 58 | func ws_set(w: *i64, zone: i64, cov: i64) -> i64 |
| 75 | func ws_morph(w: *i64, new_morph: i64) -> i64 |
| 83 | func ws_exposure(w: *i64) -> i64 |
| 92 | func ws_coherent(w: *i64) -> i64 |
| 114 | func ws_ck(w: *i64) -> i64 |
| 126 | func ws_save(w: *i64, path: *u8, saved_at: i64) -> i64 |
| 132 | func ws_load(w: *i64, path: *u8) -> i64 |