v1.0.10NeverDark ModuleBSD-2-Clause

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

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

Documentation

axil-nd-drink

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

Owns consumables: the consumable_t / consumable_skel_t types in <nd/drink.h> that nd-plant's carrot and tomato (and any future cooking module) build against, the on_consume hook they fire, and the drink display path (on_view_flags, on_add).

Install

make install

Installs:

lib/libnd-drink.so
include/nd/drink.h

There is deliberately no lib/nd-drink.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.

Build from source

make

Needs libxylem and the engine's game API, <nd/xy.h>, plus <nd/mortal.h> and <nd/core.h> โ€” from checkouts beside this repo or from installed packages:

git clone https://github.com/tty-pt/nd-drink && cd nd-drink
git clone https://github.com/tty-pt/axil-nd ../axil-nd
git clone https://github.com/tty-pt/nd-mortal ../axil-nd-mortal
git clone https://github.com/tty-pt/nd-core ../axil-nd-core
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-mortal,nd-core).

What it does

  • consumable_t (food, drink, quantity, capacity) and consumable_skel_t

(food, drink) live in <nd/drink.h> because nd-plant reads them.

  • on_consume is XY_DECL'd there: fired, but with no implementor anywhere

the dispatch returns 0.

  • on_add and on_view_flags cover creation and the drink display, and the

old on_icon body is now a core_icon_decorate decorator registered in xy_install (the shop precedent).

In-Game Commands (man-src/)

CommandSectionDescription
fill10Refill a liquid container from a water source or font
consume10Drink or eat a consumable item to restore vitality

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(...).

  • It opens no tables of its own in xy_install โ€” the consumable rows live

in the engine's skeleton/drop tables.

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

License

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

Maintained by:tty-pt