code wiki / _hdl_build / nx_creature_world.nx
nx_creature_world.nx
buildroot/runtime/_hdl_build/nx_creature_world.nx
about
nx_creature_world.nx -- the next REAL slices of a creature-collector, INTEGRATED so the core loop actually RUNS:
overworld walk -> wild encounter (only on grass) -> weaken in a real battle -> CAPTURE (real HP-dependent
catch formula) -> add to PARTY -> SAVE/LOAD party (real persistence). Reuses nx_creature_battle's real battle
engine. Pure-integer, deterministic, sovereign. HONEST SCOPE: headless logic spine -- NO visuals, NO real-time,
NO UI, NO netcode; a 1-D route, not a 2-D world; save = core stats (not moves/name). One honest vertical slice.
license_tier: ORIGINAL
dependencies 2 imports · 3 importers
imports: nx_creature_battle.nxnx_syscalls.nx
imported by: nx_creature_game.nxnx_creature_world_gate.nxnx_game_taming.nx
structs
| none |
consts
| 10 | const PARTY_MAX: i64 = 6 |
| 11 | const ENC_RATE: i64 = 70 // % wild-encounter chance per grass tile |
| 12 | const BALL_MAX: i64 = 8 // balls thrown per encounter before it breaks free |
functions
| 15 | func cw_set_catch(c: *i64, r: i64) -> i64 { c[21] = r; return 0 } |
| 17 | func cw_catch_a(t: *i64, ball: i64) -> i64 { return (3*t[2] - 2*t[3]) * t[21] * ball / (3*t[2]) } |
| 18 | func cw_try_catch(t: *i64, ball: i64, s: *i64) -> i64 |
| 24 | func cw_copy(dst: *i64, src: *i64) -> i64 { var i: i64 = 0; while i < 24 { dst[i] = src[i]; i = i + 1 } return 0 } called by 1: cw_explore |
| 26 | func cw_spawn(c: *i64, sid: i64) -> i64 |
| 34 | func cw_explore(route: *u8, T: i64, lead: *i64, party: *i64, pcountbox: *i64, seed: i64, buf: *u8) -> i64 |
| 76 | func cw_save(path: *u8, party: *i64, count: i64) -> i64 |
| 95 | func cw_parseint(data: *u8, n: i64, start: i64, out: *i64) -> i64 called by 1: cw_load |
| 102 | func cw_load(path: *u8, party: *i64, countbox: *i64) -> i64 |