code wiki / _hdl_build / nx_wardrobe_state.nx

nx_wardrobe_state.nx

buildroot/runtime/_hdl_build/nx_wardrobe_state.nx

5600 B137 linesdepth 3pulls 4 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gamesave.nx nx_wardrobe_state.nx nx_coc_engine.nx nx_m2d_engine.nx nx_wardrobe_state_gate.nx

imports: nx_syscalls.nxnx_gamesave.nx

imported by: nx_coc_engine.nxnx_m2d_engine.nxnx_wardrobe_state_gate.nx

structs

none

consts

17const WS_NZ: i64 = 8 // zones: 0 head 1 torso 2 chest 3 waist 4 hips 5 legs 6 feet 7 hands
18const WS_MAXCOV: i64 = 4 // 0 nude, 1 underwear, 2 modest, 3 dressed, 4 outerwear
19const WS_MODEST: i64 = 2 // coverage >= WS_MODEST = NOT sexually exposed
20const WS_ADULT_AGE: i64 = 18 // fail-closed threshold (matches nx_card_compile)
21const WS_NMORPH: i64 = 8 // transformation forms 0..WS_NMORPH-1 (species/morph, humanoid-only)
22const WS_LEN: i64 = 10 // i64 state vector: [0]=age [1]=morph [2..9]=coverage per zone
23const WS_SCHEMA: i64 = 975 // save schema id (F975 lineage)
24const WS_CK_SEED: i64 = 2166136261
25const WS_CK_MUL: i64 = 16777619
28const WS_E_MINOR: i64 = 0-1 // adult gate: would expose a gated zone on a minor -> REFUSED
29const WS_E_ZONE: i64 = 0-2
30const WS_E_COV: i64 = 0-3
31const WS_E_INCOHERENT: i64 = 0-4 // load refused: persisted state violates an invariant
32const WS_E_MORPH: i64 = 0-5

functions

34func ws_len() -> i64 { return WS_LEN }
called by 1: main
37func ws_is_gated_zone(z: i64) -> i64
called by 2: ws_setws_coherent
45func ws_init(w: *i64, age: i64, morph: i64) -> i64
called by 3: ce_runmd_initmain
58func ws_set(w: *i64, zone: i64, cov: i64) -> i64
called by 3: ce_runmainmain calls 1: ws_is_gated_zone
75func ws_morph(w: *i64, new_morph: i64) -> i64
called by 2: ce_runmain
83func ws_exposure(w: *i64) -> i64
called by 2: ce_runmain
92func ws_coherent(w: *i64) -> i64
called by 3: mainws_loadmain calls 1: ws_is_gated_zone
114func ws_ck(w: *i64) -> i64
called by 2: mainmain
126func ws_save(w: *i64, path: *u8, saved_at: i64) -> i64
called by 1: main calls 1: gs_save
132func ws_load(w: *i64, path: *u8) -> i64
called by 1: main calls 2: gs_loadws_coherent