tvl-depot/users/grfn/xanthous
Griffin Smith 76258fbfa1 feat(xanthous): Describe *where* the item is in the inventory
When describing items in the inventory, both in detail and when
producing menus from those items, describe not just the item itself but
also *where* in the inventory the item is (either in the backpack, or
wielded in either or both of the hands). This uses a new
InventoryPosition datatype, and a method to get a list of items in the
inventory associated with their inventory position. When *removing*
items from the inventory (to wield, drop, or eat them), we want to make
sure we remove from the right position, so this also introduces
a `removeItemAtPosition` method to make that happen correctly.

Finally, some of the tests for this stuff was getting really slow - I
narrowed this down to runaway arbitrary generation for message
Templates, so I've tweaked the Arbitrary instance for that type to
generate smaller values.

Change-Id: I24e9948adae24b0ca9bf13955602108ca9079dcc
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3228
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-06-23 21:52:08 +00:00
..
.github refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
bench refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
build refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
src feat(xanthous): Describe *where* the item is in the inventory 2021-06-23 21:52:08 +00:00
test feat(xanthous): Describe *where* the item is in the inventory 2021-06-23 21:52:08 +00:00
.envrc refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
.gitignore refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
default.nix refactor(users/grfn): build all haskell packages without ifd 2021-04-13 10:34:24 +00:00
hie.yaml refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
LICENSE refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
nixpkgs.nix refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
package.yaml feat(xanthous): Track the volume and density of item types 2021-06-23 21:52:08 +00:00
pkg.nix feat(xanthous): Add a generator for random english syllables 2021-06-13 01:24:47 +00:00
README.org refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Setup.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
shell.nix feat(xanthous): Install qpdf in the shell 2021-06-18 17:51:43 +00:00
xanthous.cabal feat(xanthous): Track the volume and density of item types 2021-06-23 21:52:08 +00:00

Xanthous

Building

$ nix build

Running

$ ./result/bin/xanthous [--help]

Keyboard commands

Keyboard commands are currently undocumented, but can be found in [this file. Movement uses the nethack-esque hjklybnu.

Development

Use lorri, or run everything in a nix-shell

# Build (for dev)
$ cabal new-build

# Run the game
$ cabal new-run xanthous

# Run tests
$ cabal new-run test

# Run a repl
$ cabal new-repl