code wiki / _hdl_build / nx_creature_world.nx

nx_creature_world.nx

buildroot/runtime/_hdl_build/nx_creature_world.nx

7053 B125 linesdepth 3pulls 3 transitivereach 6 importersview sourcekind librarytopic creature
docsdependenciesstructsconstsfunctions

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

nx_creature_battle.nx nx_syscalls.nx nx_creature_world.nx nx_creature_game.nx nx_creature_world_gate.nx nx_game_taming.nx

imports: nx_creature_battle.nxnx_syscalls.nx

imported by: nx_creature_game.nxnx_creature_world_gate.nxnx_game_taming.nx

structs

none

consts

10const PARTY_MAX: i64 = 6
11const ENC_RATE: i64 = 70 // % wild-encounter chance per grass tile
12const BALL_MAX: i64 = 8 // balls thrown per encounter before it breaks free

functions

15func cw_set_catch(c: *i64, r: i64) -> i64 { c[21] = r; return 0 }
17func cw_catch_a(t: *i64, ball: i64) -> i64 { return (3*t[2] - 2*t[3]) * t[21] * ball / (3*t[2]) }
18func cw_try_catch(t: *i64, ball: i64, s: *i64) -> i64
24func 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
26func cw_spawn(c: *i64, sid: i64) -> i64
34func cw_explore(route: *u8, T: i64, lead: *i64, party: *i64, pcountbox: *i64, seed: i64, buf: *u8) -> i64
76func cw_save(path: *u8, party: *i64, count: i64) -> i64
95func cw_parseint(data: *u8, n: i64, start: i64, out: *i64) -> i64
called by 1: cw_load
102func cw_load(path: *u8, party: *i64, countbox: *i64) -> i64