v1.0.5NeverDark ModuleBSD-2-Clause

nd-class for axil-nd, ported from SIC to libxylem.

GitHub
git clone https://github.com/tty-pt/nd-class

Documentation

axil-nd-class

nd-class for axil-nd, ported from SIC to libxylem.

Owns character classes: the class table (auto-indexed), the per-entity classist assignment, and the life-dice bonus. Its one stat role is co-implementing nd-attr's hp_max chain โ€” base value plus class life dice scaled by level โ€” reading the predecessor with nd_last().

Install

make install

Installs one file:

lib/libnd-class.so

There is deliberately no lib/nd-class.so symlink (see axil-nd-wts for why: mods.load names the installed filename, and the OpenBSD packing list never lists a symlink).

Also packaged across all 9 platforms (deb, apk, rpm, pacman, brew, openbsd, winget + Scoop, android-lib, and ios-lib + SwiftPM XCFramework) from a v* tag.

It installs no header because it exports no API โ€” every symbol it defines is discovered by the engine, not called by another module.

Build from source

make

Needs libxylem and the engine's game API, <nd/xy.h>, plus <nd/level.h> (it scales by level) and <nd/attr.h> (the chain it co-implements) โ€” from checkouts beside this repo or from installed packages:

git clone https://github.com/tty-pt/nd-class && cd nd-class
git clone https://github.com/tty-pt/axil-nd ../axil-nd
git clone https://github.com/tty-pt/nd-level ../axil-nd-level
git clone https://github.com/tty-pt/nd-attr ../axil-nd-attr
make

Both the checkout -I flags and the installed-package paths are on the command line at once (see Makefile), and a missing -I is ignored, so the same command works either way. CI names the deps explicitly (axil-nd,libxylem,nd-level,nd-attr).

What it does

  • xy_install() registers the class table (auto-indexed) and the

classist table (one row per entity).

  • hp_max adds the class life dice on top of the chain value;

on_add assigns the class; on_status reports it.

In-Game Commands (man-src/)

Class selection and review are integrated with nd-session's character creation and nd-attr's status command.

Packaged Assets (art/)

Class insignias, skill badges, and character creation portraits.

Wire Protocol & BCP Integration

Class hit dice and level bonuses fold into BCP_HP and BCP_STATS updates streamed to client HUDs.

XY Bus Hooks & Dependencies

  • Co-implements the hp_max chain and hooks on_add (creation) and on_status.
  • Depends on nd-attr and nd-level.

Modder Extension Guide

To register a custom character class:

  1. Define a new class_t record specifying base hit die (e.g. d6, d8, d10, d12) and primary attribute affinities.
  2. Insert the class into the class table during xy_install().
  3. Co-implement class-specific stat or combat bonuses in hp_max or modifier chains.

Testing

There is no test.sh here. Behaviour is asserted by the engine's own suite:

cd ../axil-nd
make && ./test.sh

Notes from the port

  • SIC_DEF โ†’ XY_IMPL, mod_install โ†’ xy_install, call_f(...) โ†’

f(...).

  • The link line is libxylem alone. NEEDED is libxylem.so and libc.so.6.

License

BSD 2-Clause, carried over from tty-pt/nd-class. See LICENSE.

Maintained by:tty-pt