diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c34277ad..f8d13ab0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,11 @@ on: branches: ["main"] workflow_dispatch: +# The default for every job. The four that publish a release ask for +# contents: write themselves - nothing else needs to change the repository. +permissions: + contents: read + # A new push to a branch makes the run already going on it pointless. concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -48,7 +53,7 @@ jobs: run: sudo apt install -y libnotcurses-dev libnotcurses++-dev if: contains(matrix.configuration, 'notcurses=1') - name: Build ${{ matrix.configuration || 'release' }} - run: make -j$(nproc) CX=${{ matrix.cxx }} LD=${{ matrix.cxx }} ${{ matrix.configuration }} + run: make -j$(nproc) CXX=${{ matrix.cxx }} ${{ matrix.configuration }} - name: Check the binary starts run: ${{ contains(matrix.configuration, 'debug=1') && './avanor-d' || './avanor' }} --version - name: Test @@ -57,12 +62,117 @@ jobs: CONFIGURATION: ${{ matrix.configuration }} run: ./.github/run-tests.sh + # The Debian package, on a tag only. Pinned to the same 26.04 the build + # matrix uses, for the same reason: sol2-dev arrived there and exists in + # nothing older. + debian: + name: debian package + runs-on: ubuntu-latest + # Built on the oldest release it is meant to install on, not the + # newest available: dpkg works the libc dependency out from what the + # binary actually references, so a package built against a newer glibc + # than the target has refuses to install there. Debian 13 carries + # glibc 2.41; building on Ubuntu 26.04 asked for 2.43 and would not go + # onto Debian at all. Move this forward only when dropping support for + # what it currently reaches. + container: debian:13 + if: github.ref_type == 'tag' + permissions: + contents: write + steps: + # git before the checkout, as in the Fedora job - without it + # actions/checkout falls back to a REST tarball and leaves no .git. + - name: Install packaging dependencies + run: | + apt update + apt install -y build-essential debhelper devscripts git wget \ + libargparse-dev libcereal-dev libfmt-dev libluajit-5.1-dev \ + libzstd-dev pkg-config + # Everything else is packaged in Debian 13; sol2 is not - it arrived + # in forky. It is header-only, so the headers are put where the + # compiler looks and Build-Depends still names the package for the + # day trixie has one. + - name: Install sol2 headers + run: | + wget -q -O /tmp/sol2.tar.gz \ + https://github.com/ThePhD/sol2/archive/refs/tags/v3.5.0.tar.gz + tar xzf /tmp/sol2.tar.gz -C /tmp + cp -r /tmp/sol2-3.5.0/include/sol /usr/local/include/ + - uses: actions/checkout@v7 + - name: Build the package + run: | + # See the Fedora job: a container's workspace belongs to somebody + # else as far as git is concerned. + git config --global --add safe.directory "$GITHUB_WORKSPACE" + + dch --newversion "$(make -s version)-1" --distribution unstable "Automated build." + + # -d because sol2-dev is declared in Build-Depends but installed + # by hand above; the check would otherwise refuse to start. + dpkg-buildpackage -us -uc -b -d + - name: Collect the package + run: mv ../avanor_*.deb . + - name: Add it to the release + uses: softprops/action-gh-release@v3 + with: + files: avanor_*.deb + fail_on_unmatched_files: true + + # The Fedora package, on a tag only. + fedora: + name: fedora package + runs-on: ubuntu-latest + container: fedora:latest + if: github.ref_type == 'tag' + permissions: + contents: write + steps: + # git has to be there before the checkout: without it actions/checkout + # quietly falls back to fetching a tarball through the REST API, and + # the workspace ends up with no .git for `make version` to read. + - name: Install packaging dependencies + run: dnf install -y rpm-build gcc-c++ make git pkgconf-pkg-config argparse-devel cereal-devel fmt-devel libzstd-devel luajit-devel sol2-devel + - uses: actions/checkout@v7 + - name: Build the package + run: | + # This job runs in a container, so the workspace belongs to the + # host's runner user while the step runs as root, and git refuses + # to touch a repository somebody else owns. actions/checkout + # works around that for itself in a temporary global config that + # later steps do not inherit, so it has to be said again here - + # before make or git archive, both of which ask git for things. + git config --global --add safe.directory "$GITHUB_WORKSPACE" + + # An RPM version may not contain a hyphen, so the "-g" a + # non-release build carries becomes ".g". + VERSION=$(make -s version | tr '-' '.') + mkdir -p rpmbuild/{SOURCES,SPECS,BUILD,RPMS,SRPMS,BUILDROOT} + sed "s/^Version:.*/Version: $VERSION/" avanor.spec > rpmbuild/SPECS/avanor.spec + + # -o rather than piping into gzip: a pipeline reports the exit + # status of its last command, so a git archive that failed was + # hidden behind a gzip that cheerfully succeeded, and rpmbuild + # got a valid-looking archive of nothing. + git archive --prefix avanor-$VERSION/ --format=tar.gz \ + -o rpmbuild/SOURCES/avanor-$VERSION.tar.gz HEAD + + rpmbuild --define "_topdir $PWD/rpmbuild" -bb rpmbuild/SPECS/avanor.spec + - name: Collect the package + run: mv rpmbuild/RPMS/*/avanor-[0-9]*.rpm . + - name: Add it to the release + uses: softprops/action-gh-release@v3 + with: + files: avanor-[0-9]*.rpm + fail_on_unmatched_files: true + # Nothing here is run: the Windows console under Actions is not a # console either backend will open, so this proves the two builds still # compile and link, no more. windows: name: windows ${{ matrix.configuration || 'release' }} runs-on: windows-latest + permissions: + contents: write strategy: fail-fast: false matrix: @@ -79,11 +189,13 @@ jobs: git make wget + diffutils mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cereal mingw-w64-ucrt-x86_64-fmt mingw-w64-ucrt-x86_64-luajit mingw-w64-ucrt-x86_64-notcurses + mingw-w64-ucrt-x86_64-nsis mingw-w64-ucrt-x86_64-pkgconf mingw-w64-ucrt-x86_64-sol2 mingw-w64-ucrt-x86_64-zstd @@ -93,9 +205,25 @@ jobs: - name: Check the binary starts run: ${{ contains(matrix.configuration, 'debug=1') && './avanor-d.exe' || './avanor.exe' }} --version + # Only on a tag, and only from the release build of the default + # backend: the other three would each write the same file name, and + # a debug or notcurses build is not what anybody installs. + - name: Build the installer + if: github.ref_type == 'tag' && matrix.configuration == '' + run: make installer + - name: Add it to the release + if: github.ref_type == 'tag' && matrix.configuration == '' + uses: softprops/action-gh-release@v3 + with: + # [0-9] so this cannot pick up avanor-d.exe by accident + files: avanor-[0-9]*.exe + fail_on_unmatched_files: true + macos: name: macos ${{ matrix.configuration || 'release' }} runs-on: macos-latest + permissions: + contents: write strategy: fail-fast: false matrix: @@ -103,9 +231,13 @@ jobs: steps: - uses: actions/checkout@v7 - name: Install dependencies - run: brew install argparse cereal coreutils fmt luajit notcurses pkgconf sol2 wget zstd + run: brew install argparse cereal coreutils create-dmg dylibbundler fmt luajit make notcurses pkgconf sol2 wget zstd + # gmake, not make: macOS still ships GNU Make 3.81 from 2006, which + # reads a "#" inside $(shell ...) as the start of a comment and cuts + # the line in half. Homebrew's is the same 4.x every other platform + # builds with, so there is one make to support rather than two. - name: Build ${{ matrix.configuration || 'release' }} - run: make -j$(sysctl -n hw.ncpu) ${{ matrix.configuration }} + run: gmake -j$(sysctl -n hw.ncpu) ${{ matrix.configuration }} - name: Check the binary starts run: ${{ contains(matrix.configuration, 'debug=1') && './avanor-d' || './avanor' }} --version - name: Test @@ -113,3 +245,15 @@ jobs: env: CONFIGURATION: ${{ matrix.configuration }} run: ./.github/run-tests.sh + + # As on Windows: only on a tag, and only from the release build of + # the default backend, since all four would write the same file. + - name: Build the disk image + if: github.ref_type == 'tag' && matrix.configuration == '' + run: gmake dmg + - name: Add it to the release + if: github.ref_type == 'tag' && matrix.configuration == '' + uses: softprops/action-gh-release@v3 + with: + files: avanor-[0-9]*.dmg + fail_on_unmatched_files: true diff --git a/.gitignore b/.gitignore index f7c4ec41..14e92e02 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,31 @@ avanor-d avanor.exe avanor-d.exe +# Generated by the installer target +mainfiles.nsh +datafiles.nsh +avanor-*.exe +avanor-*.dmg + +# Generated by dpkg-buildpackage +debian/avanor/ +debian/files +debian/*.substvars +debian/*.debhelper +debian/debhelper-build-stamp +debian/.debhelper/ +avanor_*.deb + +# Generated by rpmbuild +rpmbuild/ +avanor-*.rpm +dmgroot/ +resources/Avanor.icns + +# Source archives +avanor-*-src.tar.gz +avanor-*-src.zip + # Game state avanor.hsc dmp*.txt diff --git a/Main.cpp b/Main.cpp index d510c751..33ce71eb 100644 --- a/Main.cpp +++ b/Main.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -545,12 +546,13 @@ const char* logo_text[] = { " T h e L a n d o f M y s t e r y", "", MSG_GREEN - " version " GAME_VERSION "\n", + " version " GAME_VERSION_FULL "\n", MSG_YELLOW, " (c) 2000 - 2006 by Vadim Gaidukevich", + " (c) 2025 - 2026 by Joachim de Groot", "", MSG_YELLOW - " http://www.avanor.com", + " http://avanor.sourceforge.net", "", "", " " @@ -587,7 +589,7 @@ XGame Game; int main(int argc, char* argv[]) { - argparse::ArgumentParser program("avanor", GAME_VERSION); + argparse::ArgumentParser program("avanor", GAME_VERSION_FULL); program.add_description("Avanor, the Land of Mystery - a roguelike."); program.add_argument("-g", "--god") @@ -642,6 +644,10 @@ int main(int argc, char* argv[]) return 1; } + // Before anything opens a file: the world, the manual and the score + // table are all named relative to where the game runs from. + vEnterDataDir(); + vRandSeed(program.is_used("--seed") ? program.get("--seed") : static_cast(time(nullptr))); vInit(); diff --git a/Makefile b/Makefile index 659b6802..ed385e8e 100644 --- a/Makefile +++ b/Makefile @@ -33,18 +33,52 @@ # needs with wget into external/ on demand, pinned to the versions below, # # so it stays reproducible without a manual install step. # # # -# There are also targets for making tarballs with the sources and binaries # -# Example: # -# Create tarball (avanor-0.5.7-src.tar.bz2) with the sources of the game # -# make VERSION=0.5.7 source-bz2 # +# There are also targets for making tarballs with the sources and binaries. # +# The source ones pack what is committed, named after the version the game # +# reports, so `make source-gz` writes avanor-0.6.0-src.tar.gz. Override the # +# name with VERSION=x.y.z, and ask for it with `make -s version`. # ############################################################################## -ifdef VERSION - DISTNAME := avanor-$(VERSION) -else - DISTNAME := avanor-r${shell svnversion .} +# What the archives are named after. The version is not asked of the +# version control system - the tags this history carries are not ancestors +# of anything current, so git describe has nothing to say - but read from +# the one place that already decides it: GAME_VERSION, which is what the +# binary prints for --version and what stands on the title screen. Pass +# VERSION=x.y.z to name an archive something else for once. +ifndef VERSION + VERSION := $(shell sed -n 's/^#define GAME_VERSION "\(.*\)".*/\1/p' helpers/hiscore.h) + + # In a git checkout, a commit that no tag points at is not a release, + # and both the archive name and the version the game reports say so by + # carrying the commit they were built from. A tagged commit is left + # alone, and so is a source archive, which has no repository to ask. + # + # --points-at rather than --contains: the question is whether *this* + # commit was released, not whether some later tag has it in its + # history - by that test every commit before a release counts as one. + ifneq ($(wildcard .git),) + GITREV := $(shell git log -n1 --format=%h) + GITTAG := $(shell git tag --points-at HEAD) + + ifeq ($(GITTAG),) + ifneq ($(GITREV),) + VERSION := $(VERSION)-g$(GITREV) + CFLAGS += -DGITREV=\"-g$(GITREV)\" + endif + endif + endif endif +DISTNAME := avanor-$(VERSION) + +# VERSIONINFO in the Windows resource takes four plain numbers, so the +# release number is split up and any "-g" dropped - the full +# string still goes in as text, under FileVersion. +VERSION_NUMBER := $(firstword $(subst -, ,$(VERSION))) +VERSION_MAJOR := $(word 1,$(subst ., ,$(VERSION_NUMBER))) +VERSION_MINOR := $(word 2,$(subst ., ,$(VERSION_NUMBER))) +VERSION_PATCH := $(word 3,$(subst ., ,$(VERSION_NUMBER))) + ifeq ($(OS),Windows_NT) win = 1 endif @@ -55,6 +89,7 @@ endif # is asked for rather than assumed: it is /opt/homebrew on Apple silicon # and /usr/local on Intel. ifeq ($(shell uname -s),Darwin) + macos = 1 BREW_PREFIX := $(shell brew --prefix 2>/dev/null) ifneq ($(BREW_PREFIX),) @@ -65,10 +100,26 @@ endif CFLAGS += -std=c++17 -fsigned-char -pipe -Wall -Wextra -Werror -I. +# sol2 decides how careful to be by looking for __OPTIMIZE__, so a release +# build got none of its checks: an error inside a world script did not come +# back as a failed result at all - it threw, or panicked LuaJIT, and took +# the game with it. Asked for explicitly, so a release behaves like a debug +# build here and a mistake in content is something the engine can report +# rather than die of. SOL_ALL_SAFETIES_ON is the only switch that covers +# calls made through the lua["name"](...) proxy; the finer-grained ones +# leave that path unprotected. +CFLAGS += -DSOL_ALL_SAFETIES_ON=1 + +WINDRES = windres + +# Cross-compiling a Windows binary from *nix. CXX and WINDRES are what +# the rules below actually use - this block used to set CX/CC/LD, which +# nothing has read since the rules were changed, so xmingw=1 quietly +# built with the host compiler and produced a Linux binary called +# avanor.exe. ifdef xmingw - CX = x86_64-w64-mingw32-g++ - CC = x86_64-w64-mingw32-gcc - LD = x86_64-w64-mingw32-g++ + CXX = x86_64-w64-mingw32-g++ + WINDRES = x86_64-w64-mingw32-windres win = 1 endif @@ -143,6 +194,16 @@ endif ifdef win NAME := ${addsuffix .exe,$(NAME)} + + # The icon and the version information, compiled by windres and linked + # in like any other object. The .rc takes its numbers from here so it + # never has to be edited for a release; the backslashes survive make, + # the shell and windres in that order, which is why there are so many. + RESOURCE := $(OBJDIR)/avanor.res + RESDEFINE := -DVERSION_MAJOR=$(VERSION_MAJOR) + RESDEFINE += -DVERSION_MINOR=$(VERSION_MINOR) + RESDEFINE += -DVERSION_PATCH=$(VERSION_PATCH) + RESDEFINE += -DVINFO=\\\"$(VERSION)\\\" endif OBJS := $(SRCS:.cpp=.o) @@ -152,17 +213,29 @@ DEPS = $(OBJS:.o=.d) ############################################################################## +.PHONY: all clean version installer dmg source-zip source-gz binary-zip binary-gz + all: $(OBJDIR) $(NAME) +# What the archives will be named after, for a packaging script to read - +# `make -s version` prints it and nothing else. +version: + @echo $(VERSION) + $(OBJDIR): mkdir $(OBJDIR) $(OBJDIR)/%.o: %.cpp $(CXX) -MMD $(CFLAGS) -c $< -o $@ -$(NAME): $(OBJS) +$(NAME): $(OBJS) $(RESOURCE) $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS) +# windres reads resources/avanor.rc, which names the .ico beside it - so +# it is run with that directory included, and rebuilt when either changes. +$(RESOURCE): resources/avanor.rc resources/avanor.ico | $(OBJDIR) + $(WINDRES) $(RESDEFINE) -I resources $< -O coff -o $@ + $(ARGPARSE_HEADER): mkdir -p $(dir $@) wget -q -O $@ $(ARGPARSE_URL) @@ -175,6 +248,25 @@ ifdef win $(OBJDIR)/Main.o: $(ARGPARSE_HEADER) endif +# Main.o is where the version string is compiled in, and nothing in +# Main.cpp changes when the commit does - so after a commit, a rebuild +# would happily keep reporting the commit before it. This stamp holds the +# version and is rewritten only when that actually changes, which makes +# Main.o out of date exactly then and at no other time. +ifneq ($(GITREV),) +VERSION_STAMP := $(OBJDIR)/.version + +$(OBJDIR)/Main.o: $(VERSION_STAMP) + +$(VERSION_STAMP): FORCE | $(OBJDIR) + @echo '$(VERSION)' > $@.new + @cmp -s $@.new $@ || mv -f $@.new $@ + @$(RM) $@.new + +FORCE: +.PHONY: FORCE +endif + ifndef notcurses $(OBJDIR)/global.o: $(STC_HEADER) endif @@ -187,29 +279,114 @@ endif clean: $(RM) $(addsuffix /*.o,$(ALL_OBJDIRS)) $(RM) $(addsuffix /*.d,$(ALL_OBJDIRS)) + $(RM) $(addsuffix /.version,$(ALL_OBJDIRS)) $(RM) $(ALL_NAMES) - + $(RM) mainfiles.nsh datafiles.nsh + $(RM) -r $(DMGROOT) resources/Avanor.icns + +# The Windows installer. The two .nsh files are the lists of what to +# install, generated here rather than kept in step by hand: MAINFILES is +# what sits beside the executable, DATADIRS the trees that keep their +# shape. The DLLs are asked of the binary itself - which ones are needed +# depends on the backend it was built with, and a list written down here +# would be wrong the first time that changed. +INSTALLER := avanor-$(VERSION).exe +MAINFILES = $(NAME) COPYING CHANGELOG.md README.md +DATADIRS = world manual + +mainfiles.nsh: $(NAME) + @$(RM) $@ + @for file in $(MAINFILES); do echo " File \"$$file\"" >> $@; done + @dlls=$$(ldd $(NAME) | sed -n 's|.*=> \(/[^/]*/bin/[^ ]*\) .*|\1|p'); \ + if [ -z "$$dlls" ]; then \ + echo "$@: ldd named no libraries outside the system directories." >&2; \ + echo "An installer without them would install a game that cannot start," >&2; \ + echo "so this stops here. Check what 'ldd $(NAME)' prints." >&2; \ + $(RM) $@; \ + exit 1; \ + fi; \ + for dll in $$dlls; do echo " File \"$$(cygpath -w $$dll)\"" >> $@; done + +datafiles.nsh: + @$(RM) $@ + @for dir in $(DATADIRS); do echo " File /r \"$$dir\"" >> $@; done + +installer: $(NAME) mainfiles.nsh datafiles.nsh avanor.nsi + makensis //DVERSION="$(VERSION)" \ + //DVERSION_MAJOR=$(VERSION_MAJOR) \ + //DVERSION_MINOR=$(VERSION_MINOR) \ + //DVERSION_PATCH=$(VERSION_PATCH) avanor.nsi + @$(RM) mainfiles.nsh datafiles.nsh + +# The macOS disk image: an application bundle, and the documents beside +# it, wrapped in a .dmg with an Applications folder to drag it into. +# +# The bundle keeps the game in Contents/MacOS and its world and manual in +# Contents/Resources, which is the layout vEnterDataDir() knows to look +# for. What Finder runs is resources/avanor-launcher rather than the game +# itself - see the comment in that file. +# +# dylibbundler copies the Homebrew libraries the binary needs into the +# bundle and rewrites its load paths to point inside it, so the .dmg runs +# on a Mac that has never seen Homebrew. +DMG := avanor-$(VERSION).dmg +DMGROOT := dmgroot +APPDIR := $(DMGROOT)/Avanor.app + +resources/Avanor.icns: resources/avanor.iconset + iconutil -c icns -o $@ $< + +dmg: $(NAME) resources/Avanor.icns + $(RM) -r $(DMGROOT) + mkdir -p $(APPDIR)/Contents/MacOS $(APPDIR)/Contents/Resources + + cp -p $(NAME) $(APPDIR)/Contents/MacOS/ + cp -p resources/avanor-launcher $(APPDIR)/Contents/MacOS/ + chmod +x $(APPDIR)/Contents/MacOS/avanor-launcher + + dylibbundler -cd -b -of \ + -x $(APPDIR)/Contents/MacOS/$(NAME) \ + -d $(APPDIR)/Contents/MacOS/libs \ + -p '@executable_path/libs/' + + cp -pR $(DATADIRS) $(APPDIR)/Contents/Resources/ + cp -p resources/Avanor.icns $(APPDIR)/Contents/Resources/ + cp -p resources/Info.plist $(APPDIR)/Contents/ + + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(VERSION)" \ + $(APPDIR)/Contents/Info.plist + /usr/libexec/PlistBuddy -c \ + "Add :CFBundleShortVersionString string $(VERSION_NUMBER)" \ + $(APPDIR)/Contents/Info.plist + + cp -p COPYING CHANGELOG.md README.md $(DMGROOT)/ + + create-dmg \ + --volname "Avanor $(VERSION)" \ + --volicon resources/Avanor.icns \ + --window-pos 400 100 \ + --window-size 480 360 \ + --icon-size 64 \ + --icon "Avanor.app" 110 130 \ + --hide-extension "Avanor.app" \ + --app-drop-link 350 130 \ + --icon "README.md" 70 260 \ + --icon "CHANGELOG.md" 190 260 \ + --icon "COPYING" 310 260 \ + $(DMG) $(DMGROOT)/ + + $(RM) -r $(DMGROOT) + +# The source archives, one command each: git archive writes out what is +# committed, under a $(DISTNAME)/ prefix, already compressed - so there is +# no export into a scratch directory to tidy up afterwards, and nothing +# but git to have installed. What it packs is HEAD, not the working tree, +# so an archive never carries a change that was not committed. source-zip: -# create zip archive with Avanor sources, requires subversion command line client -# and 7-zip archiver - -$(RM) $(DISTNAME)-src.zip - svn export . $(DISTNAME) - 7z a -tzip -r -mx $(DISTNAME)-src.zip "$(DISTNAME)/*" - svn delete --force $(DISTNAME) - -source-bz2: -# create tar.bz2 archive with Avanor sources (on *nix systems) - -$(RM) $(DISTNAME)-src.tar.bz2 - svn export . $(DISTNAME) - tar -cjf $(DISTNAME)-src.tar.bz2 $(DISTNAME) - svn delete --force $(DISTNAME) + git archive --format=zip --prefix=$(DISTNAME)/ -o $(DISTNAME)-src.zip HEAD source-gz: -# create tar.gz archive with Avanor sources (on *nix systems) - -$(RM) $(DISTNAME)-src.tar.gz - svn export . $(DISTNAME) - tar -czf $(DISTNAME)-src.tar.gz $(DISTNAME) - svn delete --force $(DISTNAME) + git archive --format=tar.gz --prefix=$(DISTNAME)/ -o $(DISTNAME)-src.tar.gz HEAD binary-zip: all -$(RM) $(DISTNAME).zip diff --git a/README.md b/README.md index e1cafd97..cbb1ef58 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Avanor is a **single-player roguelike RPG** set in a rich fantasy world. The gam - **8 Professions**: Warrior, Wizard, Archer, Ranger, Cleric, Paladin, Alchemist, Bard - **8 Core Stats**: Strength, Dexterity, Toughness, Learning, Willpower, Mana, Perception, Charisma - **5 Schools of Magic**: Elemental, Body, Protection, Death and Surviving, with 26 spells between them -- **23 Skills**: From archery and alchemy to mining, herbalism and climbing out of pits +- **19 Skills**: From alchemy to mining, herbalism and climbing - **Experience & Leveling**: Exponential progression curve ### Game World @@ -49,7 +49,6 @@ Avanor is a **single-player roguelike RPG** set in a rich fantasy world. The gam - **Multiple Locations**: Main valley, dungeons, caves, towns - **Dungeon Levels**: Progressive difficulty through depth - **NPC System**: Unique characters with quests and dialogue, all scripted in Lua -- **A Calendar**: The world keeps months, weeks and years, and herbs grow in their season ### Combat System @@ -69,7 +68,7 @@ Avanor is a **single-player roguelike RPG** set in a rich fantasy world. The gam - **15 Creature Classes**: Rats, felines, canines, reptiles, insects, humans, orcs, giants, kobolds, undead, goblins, demons, humanoids, blobs and others - **10 Difficulty Tiers** -- **AI System**: 18 base flags + 6 composite presets for diverse behaviors +- **AI System**: many base flags and composite presets for diverse behaviors, skriptable in Lua - **Special Abilities**: Spells, skills, brands, corpse effects --- @@ -79,8 +78,8 @@ Avanor is a **single-player roguelike RPG** set in a rich fantasy world. The gam ### Quick Start 1. **Create a Character**: Choose race, profession, and gender -2. **Enter the Valley**: Begin your adventure in the town of Avanor -3. **Explore**: Visit shops, talk to NPCs, accept quests +2. **Enter the Valley**: Begin your adventure in a village +3. **Explore**: Talk to NPCs, receive hints and accept quests 4. **Descend**: Venture into dungeons and caves 5. **Survive**: Manage food, health, and equipment 6. **Grow**: Gain experience, find better gear, learn new abilities @@ -113,9 +112,6 @@ list. The ones you need first: | `S` | Save | | `Q` | Quit | -Two more exist only under `--god`: `^F` lights the whole level, and `^W` -steps you anywhere on it. Neither costs a turn. - ### Tips for New Players - **Save often**: There is no autosave - `S` is the only thing that writes a save @@ -152,13 +148,11 @@ The project is currently in **active modernization** with the following status: - Sol2 integration for Lua scripting - Cereal integration for serialization -- Removal of legacy XFile system **Code Quality** - Conversion of legacy enums to C++11 enum classes - Type safety improvements -- Removal of deprecated code - Modern C++ features (smart pointers, const correctness, etc.) **Game Content** @@ -182,13 +176,6 @@ The project is currently in **active modernization** with the following status: - Performance optimizations - Memory management improvements -### Upcoming - -**Planned for Next Release** - -- The remaining content still hard-coded in C++ -- **Official release** of revived Avanor - --- ## Building and Running @@ -215,13 +202,6 @@ A **C++17** compiler is required - the code uses structured bindings, `std::optional`, `if`-initialisers, `std::string_view` and inline variables. GCC 9 or Clang 8 upwards will do. It is built and tested with GCC. -The versions this is currently developed against: - -``` -LuaJIT 2.1 fmt 11.2.0 zstd 1.5.7 -sol2 3.5.0 cereal 1.3.2 -``` - On Fedora: ```bash @@ -230,7 +210,20 @@ sudo dnf install gcc-c++ make pkgconf-pkg-config \ sol2-devel cereal-devel argparse-devel ``` -On Debian and Ubuntu: +Pushing a tag builds all four and attaches them to a GitHub release: +a `.deb`, an `.rpm`, a Windows installer and a macOS disk image. + +A Fedora package can be built with `rpmbuild` from `avanor.spec`; it +installs the game as `/usr/bin/avanor` with its world and manual under +`/usr/share/avanor`, which is the path the spec compiles in as `DATA_DIR`. +CI builds one on every tag. + +A Debian/Ubuntu package can be built from the tree with +`dpkg-buildpackage -us -uc -b`; it installs the game as `/usr/games/avanor` +and its world and manual under `/usr/share/avanor`, which is the path +`debian/rules` compiles in as `DATA_DIR`. CI builds one on every tag. + +To build by hand, on Debian and Ubuntu: ```bash sudo apt install g++ make pkg-config \ diff --git a/avanor.nsi b/avanor.nsi new file mode 100644 index 00000000..51479eab --- /dev/null +++ b/avanor.nsi @@ -0,0 +1,131 @@ +; +; avanor.nsi - the Windows installer for Avanor +; +; Built by the Makefile's `installer` target, which generates the file +; lists this includes. Do not run makensis on it by hand without them. +; +; This program is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2 of the License, or +; (at your option) any later version. +; + +; Unicode installer +Unicode True + +; Modern UI +!include "MUI2.nsh" + +!ifndef VERSION + !error "VERSION has not been defined" +!endif + +Name "Avanor ${VERSION}" +OutFile "avanor-${VERSION}.exe" + +SetCompressor /SOLID lzma + +InstallDir $PROGRAMFILES64\Avanor +InstallDirRegKey HKLM "Software\Avanor" "Install_Dir" + +RequestExecutionLevel admin + +;-------------------------------- +; Interface + +!define MUI_ICON "resources\avanor.ico" +!define MUI_UNICON "resources\avanor.ico" + +;-------------------------------- +; Pages + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "COPYING" +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +; Version information on the installer itself + +VIProductVersion "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.0" +VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Avanor" +VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Joachim de Groot" +VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "(C) 2000-2006 Vadim Gaidukevich, (C) 2025,2026 Joachim de Groot, GPLv2+" +VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Avanor Installation Program" +VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION}" + +;-------------------------------- +; What gets installed + +Section "Avanor (required)" + + SectionIn RO + + ; The executable, its libraries and the documents beside them. + SetOutPath $INSTDIR + !include "mainfiles.nsh" + + ; The world is script, read at startup from ./world, and the manual is + ; HTML read from ./manual - neither is optional, and both keep their + ; directory layout. + SetOutPath $INSTDIR + !include "datafiles.nsh" + + WriteRegStr HKLM SOFTWARE\Avanor "Install_Dir" "$INSTDIR" + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" "DisplayIcon" '"$INSTDIR\avanor.exe"' + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" "DisplayName" "Avanor ${VERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" "DisplayVersion" "${VERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" "Publisher" "Joachim de Groot" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" "NoRepair" 1 + WriteUninstaller "uninstall.exe" + +SectionEnd + +Section "Start Menu Shortcuts" + + ; The game reads ./world and ./manual from wherever it is started, so + ; the shortcut has to start it in the install directory. CreateShortCut + ; takes $OUTDIR for that, which is only still $INSTDIR here because the + ; section above happened to leave it there - said outright rather than + ; relied upon. + SetOutPath $INSTDIR + + CreateDirectory "$SMPROGRAMS\Avanor" + CreateShortCut "$SMPROGRAMS\Avanor\Avanor.lnk" "$INSTDIR\avanor.exe" "" "$INSTDIR\avanor.exe" 0 + CreateShortCut "$SMPROGRAMS\Avanor\Manual.lnk" "$INSTDIR\manual\index.html" + CreateShortCut "$SMPROGRAMS\Avanor\Uninstall.lnk" "$INSTDIR\uninstall.exe" + +SectionEnd + +;-------------------------------- +; Uninstaller + +Section "Uninstall" + + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Avanor" + DeleteRegKey HKLM SOFTWARE\Avanor + + ; The world and the manual are whole directory trees, so they go the + ; same way they came - recursively. Nothing the player writes lives + ; here: saves and scores are kept in the user's own profile. + RMDir /r "$INSTDIR\world" + RMDir /r "$INSTDIR\manual" + + Delete "$INSTDIR\*.*" + + Delete "$SMPROGRAMS\Avanor\*.*" + RMDir "$SMPROGRAMS\Avanor" + RMDir "$INSTDIR" + +SectionEnd diff --git a/avanor.spec b/avanor.spec new file mode 100644 index 00000000..3d80b855 --- /dev/null +++ b/avanor.spec @@ -0,0 +1,60 @@ +Name: avanor +Version: 0.6.0 +Release: 1%{?dist} +Summary: Dungeon exploration game in the tradition of Rogue and Moria +License: GPL-2.0-or-later +URL: https://github.com/jaydg/avanor +Source: %{url}/archive/refs/tags/%{version}/%{name}-%{version}.tar.gz + +BuildRequires: gcc-c++ +BuildRequires: make +BuildRequires: pkgconf-pkg-config +BuildRequires: argparse-devel +BuildRequires: cereal-devel +BuildRequires: fmt-devel +BuildRequires: libzstd-devel +BuildRequires: luajit-devel +BuildRequires: sol2-devel + +%description +Avanor is a single-player dungeon exploration game in the tradition of +Rogue and Moria, set in a valley the player leaves to find what lies +under it: caves, a dwarven city, and the wizard who put it all there. + +Nearly everything in it - the creatures, the items, the levels, the +quests and the people who give them - is written in Lua rather than +compiled in, so the world can be changed without a compiler. + +%prep +%setup -q + +%build +# DATA_DIR is compiled into the binary and is where it looks for the world +# and the manual once neither the working directory nor the directory the +# executable sits in has them - see vEnterDataDir() in engine/global.cpp. +# It has to match where %%install puts them below. +make %{?_smp_mflags} DATA_DIR=%{_datadir}/%{name}/ + +%install +mkdir -p %{buildroot}%{_bindir} +mkdir -p %{buildroot}%{_datadir}/%{name} +install -m 0755 avanor %{buildroot}%{_bindir}/avanor +cp -a world manual %{buildroot}%{_datadir}/%{name}/ + +%check +# The game's test modes want a terminal, which a build root has not got. +# --version is answered by the argument parser before the display is +# opened, so it is the one thing worth asking here: it proves the binary +# links and starts. +./avanor --version + +%files +%license COPYING +%doc README.md CHANGELOG.md +%{_bindir}/avanor +%{_datadir}/%{name}/ + +%changelog +* Sat Sep 19 2026 Joachim de Groot - 0.6.0-1 +- Initial spec file. The Version above is a placeholder: CI rewrites it + to match `make -s version` before every build. diff --git a/creature/ai_view.cpp b/creature/ai_view.cpp index cbb1dc22..ff506497 100644 --- a/creature/ai_view.cpp +++ b/creature/ai_view.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/anycr.cpp b/creature/anycr.cpp index 8f9908a1..d7d3ee08 100644 --- a/creature/anycr.cpp +++ b/creature/anycr.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/anycr.h b/creature/anycr.h index c64d3542..610a9856 100644 --- a/creature/anycr.h +++ b/creature/anycr.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/bodypart.cpp b/creature/bodypart.cpp index 79e8a3e6..a92f2e79 100644 --- a/creature/bodypart.cpp +++ b/creature/bodypart.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/bodypart.h b/creature/bodypart.h index 19621fde..571f99b8 100644 --- a/creature/bodypart.h +++ b/creature/bodypart.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/cr_defs.cpp b/creature/cr_defs.cpp index 8e2176eb..cef695c9 100644 --- a/creature/cr_defs.cpp +++ b/creature/cr_defs.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/cr_defs.h b/creature/cr_defs.h index 93466a60..18b5edbe 100644 --- a/creature/cr_defs.h +++ b/creature/cr_defs.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/creature.cpp b/creature/creature.cpp index 86978658..ece54085 100644 --- a/creature/creature.cpp +++ b/creature/creature.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/creature.h b/creature/creature.h index 908b8a33..580267d7 100644 --- a/creature/creature.h +++ b/creature/creature.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/creature2.cpp b/creature/creature2.cpp index 1b9e4b0a..9f3575e5 100644 --- a/creature/creature2.cpp +++ b/creature/creature2.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/deity.cpp b/creature/deity.cpp index 9b36bfb5..f907d4d0 100644 --- a/creature/deity.cpp +++ b/creature/deity.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/deity.h b/creature/deity.h index a14b64e3..3b4716a0 100644 --- a/creature/deity.h +++ b/creature/deity.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/lua_ai.cpp b/creature/lua_ai.cpp index d41ebcbb..3035bc7a 100644 --- a/creature/lua_ai.cpp +++ b/creature/lua_ai.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/lua_ai.h b/creature/lua_ai.h index 25def47b..ab1e1102 100644 --- a/creature/lua_ai.h +++ b/creature/lua_ai.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/shopkeeper.cpp b/creature/shopkeeper.cpp index d123d964..f92d0610 100644 --- a/creature/shopkeeper.cpp +++ b/creature/shopkeeper.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/shopkeeper.h b/creature/shopkeeper.h index 15e3620c..d5000e45 100644 --- a/creature/shopkeeper.h +++ b/creature/shopkeeper.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/skeep_ai.cpp b/creature/skeep_ai.cpp index 1b56c8bf..524277af 100644 --- a/creature/skeep_ai.cpp +++ b/creature/skeep_ai.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/skeep_ai.h b/creature/skeep_ai.h index 423d0e9e..1928db77 100644 --- a/creature/skeep_ai.h +++ b/creature/skeep_ai.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/std_ai.cpp b/creature/std_ai.cpp index 5511bc05..fcc2e3c4 100644 --- a/creature/std_ai.cpp +++ b/creature/std_ai.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/std_ai.h b/creature/std_ai.h index d8080b6c..b8d1a7e8 100644 --- a/creature/std_ai.h +++ b/creature/std_ai.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/xhero.cpp b/creature/xhero.cpp index fb3dd3bd..6cfc1a0d 100644 --- a/creature/xhero.cpp +++ b/creature/xhero.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/creature/xhero.h b/creature/xhero.h index ab1be457..43875b4b 100644 --- a/creature/xhero.h +++ b/creature/xhero.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..c3d0c4fa --- /dev/null +++ b/debian/changelog @@ -0,0 +1,8 @@ +avanor (0.6.0-1) UNRELEASED; urgency=medium + + * Packaging for Debian/Ubuntu. + The version above is a placeholder: CI rewrites it (via `dch + --newversion`) to match `make -s version` before every build, so it + does not need to be bumped by hand. + + -- Joachim de Groot Thu, 18 Sep 2026 00:00:00 +0000 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..776ee1a7 --- /dev/null +++ b/debian/control @@ -0,0 +1,26 @@ +Source: avanor +Section: games +Priority: optional +Maintainer: Joachim de Groot +Build-Depends: debhelper-compat (= 13), + libargparse-dev, + libcereal-dev, + libfmt-dev, + libluajit-5.1-dev, + libzstd-dev, + pkg-config, + sol2-dev +Standards-Version: 4.6.2 +Homepage: https://github.com/jaydg/avanor + +Package: avanor +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: roguelike set in the land of Avanor + Avanor is a single-player dungeon exploration game in the tradition of + Rogue and Moria, set in a valley the player leaves to find what lies + under it: caves, a dwarven city, and the wizard who put it all there. + . + Nearly everything in it - the creatures, the items, the levels, the + quests and the people who give them - is written in Lua rather than + compiled in, so the world can be changed without a compiler. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..6b43b824 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,31 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: avanor +Source: https://github.com/jaydg/avanor + +Files: * +Copyright: 2000-2006 Vadim Gaidukevich + 2025-2026 Joachim de Groot +License: GPL-2+ + +Files: external/* +Copyright: see the individual files +Comment: Headers the build fetches on demand; not shipped in this package. +License: GPL-2+ + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + . + On Debian systems, the full text of the GNU General Public License + version 2 can be found in the file /usr/share/common-licenses/GPL-2. diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..88dae246 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README.md +CHANGELOG.md diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..604a8428 --- /dev/null +++ b/debian/rules @@ -0,0 +1,26 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +%: + dh $@ + +# DATA_DIR is compiled into the binary and is where it looks for the world +# and the manual once neither the working directory nor the directory the +# executable sits in has them - see vEnterDataDir() in engine/global.cpp. +# It must match where dh_auto_install puts them below. +override_dh_auto_build: + $(MAKE) DATA_DIR=/usr/share/avanor/ + +# The test modes want a terminal, which a build daemon does not have. +# They are run by CI instead, before the package is built. +override_dh_auto_test: + +override_dh_auto_install: + install -D -m 0755 avanor debian/avanor/usr/games/avanor + mkdir -p debian/avanor/usr/share/avanor + cp -a world manual debian/avanor/usr/share/avanor/ + +override_dh_auto_clean: + dh_auto_clean + $(MAKE) clean diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/engine/global.cpp b/engine/global.cpp index c95bd1fd..757430bc 100644 --- a/engine/global.cpp +++ b/engine/global.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,12 +28,30 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include #include #include +#include #include #include #include #include +// Asking the system where the running executable is, so the game can find +// what was installed beside it. Each platform answers differently, and +// only Windows needs a header the backends below may not have pulled in. +#if defined(_WIN32) + #ifndef WIN32_LEAN_AND_MEAN + #define WIN32_LEAN_AND_MEAN + #endif + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include +#elif defined(__APPLE__) + #include +#else + #include +#endif + // Two interchangeable terminal backends, chosen at compile time. The // default is a plain-ANSI one built on the header-only stc.hpp: it asks // nothing of the system but a terminal that understands escape sequences, @@ -512,6 +531,7 @@ int vGetS(char* s, const int buffer_size) if (ch == 13 || ch == 27) { s[buffer_pos] = 0; + vHideCursor(); if (ch == 13) { return 1; @@ -1536,6 +1556,120 @@ void vRestore(const V_BUFFER* buf) #endif // !USE_NOTCURSES +namespace { + +// Where the running executable sits, or nothing if the system will not +// say. Not argv[0], which is whatever the caller felt like passing. +std::filesystem::path ExecutableDir() +{ + std::error_code ec; + +#if defined(_WIN32) + char path[MAX_PATH]; + const DWORD len = GetModuleFileNameA(nullptr, path, sizeof(path)); + + if (len == 0 || len == sizeof(path)) { + return {}; + } + + return std::filesystem::path(std::string(path, len)).parent_path(); +#elif defined(__APPLE__) + uint32_t size = 0; + _NSGetExecutablePath(nullptr, &size); + + std::string path(size, '\0'); + + if (_NSGetExecutablePath(path.data(), &size) != 0) { + return {}; + } + + path.resize(std::strlen(path.c_str())); + + // Through weakly_canonical, because the answer may be a symlink or + // carry /./ segments, and ../Resources below has to mean what it says. + const std::filesystem::path resolved = + std::filesystem::weakly_canonical(path, ec); + + return ec ? std::filesystem::path(path).parent_path() : resolved.parent_path(); +#else + const std::filesystem::path exe = + std::filesystem::read_symlink("/proc/self/exe", ec); + + return ec ? std::filesystem::path() : exe.parent_path(); +#endif +} + +// Whether a directory is the game's - the world is the thing it cannot +// start without, so that is what is looked for. +bool HoldsTheWorld(const std::filesystem::path& dir) +{ + std::error_code ec; + + return !dir.empty() + && std::filesystem::exists(dir / "world" / "init.lua", ec); +} + +} // namespace + +// Finds what was installed with the game and steps into it. +// +// Everything the game reads of itself is named relative to where it is +// running from - "./world/init.lua" here, "manual/..." in the manual, and +// six-and-twenty dofile("./world/...") inside init.lua itself. Rather +// than teach each of them where the game lives, the game goes there. +// +// The working directory is tried first so that running from a source tree +// keeps behaving exactly as it always has. Then beside the executable, +// which is how an unpacked release is laid out; then, on macOS only, +// ../Resources, which is where an application bundle keeps such things. +// +// Last is whatever DATA_DIR was compiled in, and that is the one a Linux +// package uses: an RPM or a .deb puts the binary in /usr/bin and the data +// in /usr/share/avanor, so nothing beside the executable is the answer +// there - the path has to be built in. +// +// Finding nothing is reported but not treated as fatal: loading the world +// fails immediately afterwards and names the file, which is the clearer +// error of the two - this only adds where it looked, which is what a +// half-unpacked copy needs said. +void vEnterDataDir() +{ + std::error_code ec; + const std::filesystem::path here = std::filesystem::current_path(ec); + const std::filesystem::path exe_dir = ExecutableDir(); + + const std::filesystem::path candidates[] = { + ec ? std::filesystem::path(".") : here, + exe_dir, +#ifdef __APPLE__ + exe_dir.empty() ? std::filesystem::path() : exe_dir / ".." / "Resources", +#endif + std::filesystem::path(DATA_DIR), + }; + + for (const std::filesystem::path& candidate : candidates) { + if (!HoldsTheWorld(candidate)) { + continue; + } + + std::filesystem::current_path(candidate, ec); + + return; + } + + // Nothing left to do but say where it looked. Loading the world will + // fail in a moment and complain about the file; this is the part that + // tells somebody with a half-unpacked copy what went wrong. + std::cerr << "avanor: found no world to load. Looked in:" << std::endl; + + for (const std::filesystem::path& candidate : candidates) { + if (!candidate.empty()) { + std::cerr << " " << std::filesystem::weakly_canonical(candidate, ec).string() + << std::endl; + } + } +} + std::string vMakePath(std::string_view prefix, std::string_view filename) { std::string path_buffer; diff --git a/engine/global.h b/engine/global.h index ba1bc449..b5aa8ff7 100644 --- a/engine/global.h +++ b/engine/global.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -375,4 +376,10 @@ long vRand(unsigned long n); std::string vMakePath(std::string_view prefix, std::string_view filename); +// Steps into the directory the game was installed into, so that the paths +// it reads of itself - world/, manual/ - mean what they say wherever it +// was started from. Call it before anything reads a file. See the comment +// on the definition for the order it looks in. +void vEnterDataDir(); + #endif diff --git a/engine/simulation.cpp b/engine/simulation.cpp index e800b52f..65b79bfd 100644 --- a/engine/simulation.cpp +++ b/engine/simulation.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/simulation.h b/engine/simulation.h index f24c7255..78e3fdcc 100644 --- a/engine/simulation.h +++ b/engine/simulation.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xapi.cpp b/engine/xapi.cpp index 756260b1..b8482656 100644 --- a/engine/xapi.cpp +++ b/engine/xapi.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xapi.h b/engine/xapi.h index b5b1a1c9..85807ae4 100644 --- a/engine/xapi.h +++ b/engine/xapi.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xarchive.cpp b/engine/xarchive.cpp index 3709dde5..d508098b 100644 --- a/engine/xarchive.cpp +++ b/engine/xarchive.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xarchive.h b/engine/xarchive.h index 5d0d6bd0..8a924218 100644 --- a/engine/xarchive.h +++ b/engine/xarchive.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xbaseobj.cpp b/engine/xbaseobj.cpp index 88d6af7b..d882e9c9 100644 --- a/engine/xbaseobj.cpp +++ b/engine/xbaseobj.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xbaseobj.h b/engine/xbaseobj.h index 76157cc8..ec67ba8d 100644 --- a/engine/xbaseobj.h +++ b/engine/xbaseobj.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xgen.cpp b/engine/xgen.cpp index 39487bce..a13d3406 100644 --- a/engine/xgen.cpp +++ b/engine/xgen.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xgen.h b/engine/xgen.h index 95cc23b7..2980b906 100644 --- a/engine/xgen.h +++ b/engine/xgen.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xlua.cpp b/engine/xlua.cpp index 9edb0734..3b634f3d 100644 --- a/engine/xlua.cpp +++ b/engine/xlua.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,6 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include +#include #include #include "creature/anycr.h" @@ -27,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "creature/deity.h" #include "creature/std_ai.h" #include "engine/global.h" +#include "helpers/msgwin.h" #include "engine/simulation.h" #include "engine/xlua.h" #include "game/location.h" @@ -506,10 +509,46 @@ void XLua::Init() XCreatureStorage::CreateQuickBase(); } +namespace { + +// Said once each. A handler that goes wrong tends to go wrong on every +// turn it runs, and the hundredth copy of the same complaint would bury +// everything else the message window had to say. +std::set already_complained; + +// A handler that did not finish. This used to be swallowed whole: the +// call failed, false went back to the caller, and the caller took that +// for the script's considered answer - which is how a chat handler that +// died halfway through came out as "You receive no answer" and nothing +// else, anywhere. +// +// It goes to stderr, where the rest of the world's complaints go and +// where the test harness looks, and to the message window, because +// stderr during play is written onto the alternate screen and painted +// over by the next frame. +void ComplainAboutHandler(const std::string_view handler, + const std::string_view what) +{ + std::string said = "world: "; + said.append(handler).append(": ").append(what); + + if (!already_complained.insert(said).second) { + return; + } + + std::cerr << said << std::endl; + msgwin.Add("" + said); +} + +} // namespace + bool XLua::ResultToBool(const sol::protected_function_result& result, const std::string_view handler) { if (!result.valid()) { + const sol::error err = result; + ComplainAboutHandler(handler, err.what()); + return false; } diff --git a/engine/xlua.h b/engine/xlua.h index 342c5999..7538a144 100644 --- a/engine/xlua.h +++ b/engine/xlua.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xmapobj.cpp b/engine/xmapobj.cpp index 23829d84..73de7c03 100644 --- a/engine/xmapobj.cpp +++ b/engine/xmapobj.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xmapobj.h b/engine/xmapobj.h index 7776e53a..85ee156b 100644 --- a/engine/xmapobj.h +++ b/engine/xmapobj.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xobject.cpp b/engine/xobject.cpp index f273c031..89f5df89 100644 --- a/engine/xobject.cpp +++ b/engine/xobject.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xobject.h b/engine/xobject.h index 9d5cf95a..070ed969 100644 --- a/engine/xobject.h +++ b/engine/xobject.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xscheduler.cpp b/engine/xscheduler.cpp index b0176810..67a1e09e 100644 --- a/engine/xscheduler.cpp +++ b/engine/xscheduler.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/engine/xscheduler.h b/engine/xscheduler.h index 7b961c60..495da755 100644 --- a/engine/xscheduler.h +++ b/engine/xscheduler.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/game.cpp b/game/game.cpp index 86b6e230..0f19621b 100644 --- a/game/game.cpp +++ b/game/game.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/game.h b/game/game.h index 8901ffb6..b1985218 100644 --- a/game/game.h +++ b/game/game.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/location.cpp b/game/location.cpp index 8acd625d..e9b59c76 100644 --- a/game/location.cpp +++ b/game/location.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/location.h b/game/location.h index e1bd4116..befde850 100644 --- a/game/location.h +++ b/game/location.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/quest.cpp b/game/quest.cpp index ba262656..201c2e5e 100644 --- a/game/quest.cpp +++ b/game/quest.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/quest.h b/game/quest.h index 5bf02f77..92148984 100644 --- a/game/quest.h +++ b/game/quest.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/shop.cpp b/game/shop.cpp index 7fea4fb7..077ff6c9 100644 --- a/game/shop.cpp +++ b/game/shop.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/shop.h b/game/shop.h index d873053c..2239e6b0 100644 --- a/game/shop.h +++ b/game/shop.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/xtime.cpp b/game/xtime.cpp index e47e9c1e..eb3561f9 100644 --- a/game/xtime.cpp +++ b/game/xtime.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/game/xtime.h b/game/xtime.h index e21fcce3..499a7f56 100644 --- a/game/xtime.h +++ b/game/xtime.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/dice.cpp b/helpers/dice.cpp index 68ffde73..ddfdcd60 100644 --- a/helpers/dice.cpp +++ b/helpers/dice.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/dice.h b/helpers/dice.h index 6179255b..8fbb9d87 100644 --- a/helpers/dice.h +++ b/helpers/dice.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/hiscore.cpp b/helpers/hiscore.cpp index 1919eb63..68ef39fe 100644 --- a/helpers/hiscore.cpp +++ b/helpers/hiscore.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include #include #include +#include #include #include #include @@ -66,8 +68,17 @@ XHiScoreItem::XHiScoreItem(const int _place, const unsigned int _score, std::str XHiScore::XHiScore() { - // read existing scores, if present - std::ifstream file(vMakePath(DATA_DIR, FileName)); + // The table lives with the player's other things - the saves, the + // memorials, the recipes - and not beside the game, which a packaged + // installation puts somewhere nobody may write to. + // + // A copy in the old place is still read, so a table written by an + // earlier version is not lost; the next score written moves it. + std::ifstream file(vMakePath(HOME_DIR, FileName)); + + if (!file.is_open()) { + file.open(vMakePath(DATA_DIR, FileName)); + } if (!file.is_open()) { return; @@ -121,8 +132,18 @@ void XHiScore::AddRecord(const std::shared_ptr& item) _item->place = place++; } - // write scores - std::ofstream file(vMakePath(DATA_DIR, FileName)); + // write scores - always to the player's own directory, see the + // constructor above + const std::string path = vMakePath(HOME_DIR, FileName); + std::ofstream file(path); + + if (!file.is_open()) { + std::cerr << "avanor: cannot write the score table to " << path + << std::endl; + + return; + } + cereal::JSONOutputArchive archive(file); int version = HISCORE_VERSION; diff --git a/helpers/hiscore.h b/helpers/hiscore.h index ec46ee96..257fd690 100644 --- a/helpers/hiscore.h +++ b/helpers/hiscore.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,8 +27,23 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "helpers/xgui.h" +// The release this is. GAME_VERSION is the number and nothing else - the +// Makefile reads it straight off this line to name its archives - while +// GAME_VERSION_FULL is what a build calls itself when asked. +// +// They differ when the commit being built is one no tag points at: the +// Makefile then defines GITREV as "-g" and appends it, so a build +// from the middle of development says so and cannot be taken for the +// release it was cut from. A source archive carries no repository, gets +// no GITREV, and is a release by definition. #define GAME_VERSION "0.6.0" +#ifndef GITREV + #define GITREV "" +#endif + +#define GAME_VERSION_FULL GAME_VERSION GITREV + class XHiScoreItem { public: diff --git a/helpers/keyword_dice.cpp b/helpers/keyword_dice.cpp index 34807a68..63ba6c8b 100644 --- a/helpers/keyword_dice.cpp +++ b/helpers/keyword_dice.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/keyword_dice.h b/helpers/keyword_dice.h index ea769c1e..b5e819a2 100644 --- a/helpers/keyword_dice.h +++ b/helpers/keyword_dice.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/manual.cpp b/helpers/manual.cpp index 1e42c804..8348c625 100644 --- a/helpers/manual.cpp +++ b/helpers/manual.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/manual.h b/helpers/manual.h index cab7fd89..fc0461ce 100644 --- a/helpers/manual.h +++ b/helpers/manual.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/msgwin.cpp b/helpers/msgwin.cpp index 5b595d75..4b5345f3 100644 --- a/helpers/msgwin.cpp +++ b/helpers/msgwin.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/msgwin.h b/helpers/msgwin.h index 9f0b7b1e..57cb2244 100644 --- a/helpers/msgwin.h +++ b/helpers/msgwin.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/point.h b/helpers/point.h index 45b5537c..dae82d98 100644 --- a/helpers/point.h +++ b/helpers/point.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/rect.cpp b/helpers/rect.cpp index 189ae991..179b95f7 100644 --- a/helpers/rect.cpp +++ b/helpers/rect.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/rect.h b/helpers/rect.h index 0aa16cca..0e7eef89 100644 --- a/helpers/rect.h +++ b/helpers/rect.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/registry.h b/helpers/registry.h index d2116747..ca01d159 100644 --- a/helpers/registry.h +++ b/helpers/registry.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/xgui.cpp b/helpers/xgui.cpp index 440deb0d..2b2c29da 100644 --- a/helpers/xgui.cpp +++ b/helpers/xgui.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/xgui.h b/helpers/xgui.h index f4890500..43a84729 100644 --- a/helpers/xgui.h +++ b/helpers/xgui.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/xguihtml.cpp b/helpers/xguihtml.cpp index 132f70f6..84bdc85d 100644 --- a/helpers/xguihtml.cpp +++ b/helpers/xguihtml.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/xstring.cpp b/helpers/xstring.cpp index 6286e3e6..cf49d723 100644 --- a/helpers/xstring.cpp +++ b/helpers/xstring.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/helpers/xstring.h b/helpers/xstring.h index 20ead42f..f6d252dd 100644 --- a/helpers/xstring.h +++ b/helpers/xstring.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/item.cpp b/item/item.cpp index 66b8adfe..89d33c6f 100644 --- a/item/item.cpp +++ b/item/item.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/item.h b/item/item.h index f35136c2..3f6e0c0d 100644 --- a/item/item.h +++ b/item/item.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/item_cereal.h b/item/item_cereal.h index c5dacfea..3ceea876 100644 --- a/item/item_cereal.h +++ b/item/item_cereal.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/item_misc.cpp b/item/item_misc.cpp index 6e857514..58a2590b 100644 --- a/item/item_misc.cpp +++ b/item/item_misc.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/item_misc.h b/item/item_misc.h index 32933536..4b5299ff 100644 --- a/item/item_misc.h +++ b/item/item_misc.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/itemdb.cpp b/item/itemdb.cpp index 4d79a622..7ef9ecf3 100644 --- a/item/itemdb.cpp +++ b/item/itemdb.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/itemdb.h b/item/itemdb.h index d35f9602..6d18a32c 100644 --- a/item/itemdb.h +++ b/item/itemdb.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/itemdef.h b/item/itemdef.h index fa8a1c52..bf7604cd 100644 --- a/item/itemdef.h +++ b/item/itemdef.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/itemf.cpp b/item/itemf.cpp index 5e7bd38b..1de0c97a 100644 --- a/item/itemf.cpp +++ b/item/itemf.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/itemf.h b/item/itemf.h index e2d63791..22d4b216 100644 --- a/item/itemf.h +++ b/item/itemf.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/itemkind.h b/item/itemkind.h index ab761e7f..73fce334 100644 --- a/item/itemkind.h +++ b/item/itemkind.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/itemlist.h b/item/itemlist.h index cb5d6397..232a44de 100644 --- a/item/itemlist.h +++ b/item/itemlist.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xamulet.cpp b/item/xamulet.cpp index 821c040d..bd3a0240 100644 --- a/item/xamulet.cpp +++ b/item/xamulet.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xamulet.h b/item/xamulet.h index b0a6202f..48b80d24 100644 --- a/item/xamulet.h +++ b/item/xamulet.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xanyfood.cpp b/item/xanyfood.cpp index 10f3dd58..1b3f1f36 100644 --- a/item/xanyfood.cpp +++ b/item/xanyfood.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xanyfood.h b/item/xanyfood.h index 8edb40ce..7f792eee 100644 --- a/item/xanyfood.h +++ b/item/xanyfood.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xarmor.cpp b/item/xarmor.cpp index c8e17d25..41fc6315 100644 --- a/item/xarmor.cpp +++ b/item/xarmor.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xarmor.h b/item/xarmor.h index fae323ee..48c9d89b 100644 --- a/item/xarmor.h +++ b/item/xarmor.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xbook.cpp b/item/xbook.cpp index da0dc083..ef716a9e 100644 --- a/item/xbook.cpp +++ b/item/xbook.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xbook.h b/item/xbook.h index d4771140..c110b17a 100644 --- a/item/xbook.h +++ b/item/xbook.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xboots.cpp b/item/xboots.cpp index 68d8a537..d786fb00 100644 --- a/item/xboots.cpp +++ b/item/xboots.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xboots.h b/item/xboots.h index 97b710c1..9288ee08 100644 --- a/item/xboots.h +++ b/item/xboots.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xcap.cpp b/item/xcap.cpp index 4bdfabb1..2c137350 100644 --- a/item/xcap.cpp +++ b/item/xcap.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xcap.h b/item/xcap.h index e156004d..27698833 100644 --- a/item/xcap.h +++ b/item/xcap.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xcloak.cpp b/item/xcloak.cpp index b9110992..8959658a 100644 --- a/item/xcloak.cpp +++ b/item/xcloak.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xcloak.h b/item/xcloak.h index fc7bd8c9..85475ff1 100644 --- a/item/xcloak.h +++ b/item/xcloak.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xclothes.cpp b/item/xclothes.cpp index 3c62b7c7..cbec9d46 100644 --- a/item/xclothes.cpp +++ b/item/xclothes.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xclothes.h b/item/xclothes.h index e5f25a97..21824335 100644 --- a/item/xclothes.h +++ b/item/xclothes.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xcorpse.cpp b/item/xcorpse.cpp index cdc2f761..6907fe27 100644 --- a/item/xcorpse.cpp +++ b/item/xcorpse.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xcorpse.h b/item/xcorpse.h index 9ab953a3..5d7d32ab 100644 --- a/item/xcorpse.h +++ b/item/xcorpse.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xenhance.cpp b/item/xenhance.cpp index 1837be92..37ea530d 100644 --- a/item/xenhance.cpp +++ b/item/xenhance.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xenhance.h b/item/xenhance.h index 1aa5e2a9..f0a11a9e 100644 --- a/item/xenhance.h +++ b/item/xenhance.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xgloves.cpp b/item/xgloves.cpp index c671ff86..a845a0a8 100644 --- a/item/xgloves.cpp +++ b/item/xgloves.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xgloves.h b/item/xgloves.h index 53c948db..fab90f5c 100644 --- a/item/xgloves.h +++ b/item/xgloves.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xherb.cpp b/item/xherb.cpp index 726d0f65..d2a3ae55 100644 --- a/item/xherb.cpp +++ b/item/xherb.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xherb.h b/item/xherb.h index fdfcf9f0..2bb4d4dc 100644 --- a/item/xherb.h +++ b/item/xherb.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xmissile.cpp b/item/xmissile.cpp index b6319d82..a89b846e 100644 --- a/item/xmissile.cpp +++ b/item/xmissile.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xmissile.h b/item/xmissile.h index d1c8df19..790f5466 100644 --- a/item/xmissile.h +++ b/item/xmissile.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xmissileweapon.cpp b/item/xmissileweapon.cpp index 941c7467..8d0bea40 100644 --- a/item/xmissileweapon.cpp +++ b/item/xmissileweapon.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xmissileweapon.h b/item/xmissileweapon.h index 14011b3d..e07f8b83 100644 --- a/item/xmissileweapon.h +++ b/item/xmissileweapon.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xmoney.cpp b/item/xmoney.cpp index 1e5b5c90..ef3799a6 100644 --- a/item/xmoney.cpp +++ b/item/xmoney.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xmoney.h b/item/xmoney.h index 4514b1c7..a539ac14 100644 --- a/item/xmoney.h +++ b/item/xmoney.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xpotion.cpp b/item/xpotion.cpp index 0acb7083..eb6e1060 100644 --- a/item/xpotion.cpp +++ b/item/xpotion.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xpotion.h b/item/xpotion.h index bb507cf7..ce8c0233 100644 --- a/item/xpotion.h +++ b/item/xpotion.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xring.cpp b/item/xring.cpp index 910d98df..6c56e02f 100644 --- a/item/xring.cpp +++ b/item/xring.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xring.h b/item/xring.h index 3d87bd86..a06a389b 100644 --- a/item/xring.h +++ b/item/xring.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xscroll.cpp b/item/xscroll.cpp index 6cb71cef..8a018f3b 100644 --- a/item/xscroll.cpp +++ b/item/xscroll.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xscroll.h b/item/xscroll.h index a736612f..181ee74d 100644 --- a/item/xscroll.h +++ b/item/xscroll.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xshield.cpp b/item/xshield.cpp index 6f8a3392..ee92873c 100644 --- a/item/xshield.cpp +++ b/item/xshield.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xshield.h b/item/xshield.h index efacb48d..64bb123e 100644 --- a/item/xshield.h +++ b/item/xshield.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xtool.h b/item/xtool.h index f8fa7c0a..0ed627ed 100644 --- a/item/xtool.h +++ b/item/xtool.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xweapon.cpp b/item/xweapon.cpp index 842551c0..32f4bafc 100644 --- a/item/xweapon.cpp +++ b/item/xweapon.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/item/xweapon.h b/item/xweapon.h index d25b348c..676ae5ed 100644 --- a/item/xweapon.h +++ b/item/xweapon.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lua/api_actor.cpp b/lua/api_actor.cpp index 04a7beca..0045428e 100644 --- a/lua/api_actor.cpp +++ b/lua/api_actor.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -379,8 +380,19 @@ COMBAT_SKILL GetItemWarSkill(void* item) return item ? ((XItem*)item)->wt : CS_NONE; } +// Nothing is not the hero. The check is not decoration: a place event +// hands its handler whatever walked in, which is sometimes nothing, and +// world/uniques/rotmoth.lua asks this before doing anything else. Calling +// a member function on a null pointer is undefined, and clang at -O2 uses +// that - it drops the null test inside isHero()'s dynamic_cast, having +// been promised the pointer cannot be null, and the game dies. GCC keeps +// the test and nobody notices. bool isHero(void* cr) { + if (!cr) { + return false; + } + return ((XCreature*)cr)->isHero(); } @@ -581,7 +593,7 @@ void SetEnemy(void* cr, const sol::object& cr_class) ((XCreature*)cr)->xai->SetEnemyClass(foes); } -int Gender(void* cr) +int GetGender(void* cr) { return ((XCreature*)cr)->GetGender(); } @@ -1155,7 +1167,7 @@ void RegisterActorApi(sol::state_view& lua) lua.set_function("Quest", &lua_api::Quest); lua.set_function("QuestModify", &lua_api::QuestModify); lua.set_function("QuestStatus", &lua_api::QuestStatus); - lua.set_function("Gender", &lua_api::Gender); + lua.set_function("GetGender", &lua_api::GetGender); } } // namespace lua_api diff --git a/lua/api_actor.h b/lua/api_actor.h index 721d2c56..cec68bdf 100644 --- a/lua/api_actor.h +++ b/lua/api_actor.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -141,7 +142,7 @@ namespace lua_api std::tuple GetWayXY(const std::string& l_id); void AddMessage(const std::string& str); std::string AskQuestion(const std::string& msg, const std::string& key, sol::variadic_args va); - int Gender(void* cr); + int GetGender(void* cr); XGUID GetObjectGUID(void* obj); std::tuple GetItemParam(void* item); bool IsKind(int kind, int wanted); diff --git a/lua/api_world.cpp b/lua/api_world.cpp index 3cbda1c4..b32cf8f3 100644 --- a/lua/api_world.cpp +++ b/lua/api_world.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/lua/api_world.h b/lua/api_world.h index b7e20b4b..8e5dff4d 100644 --- a/lua/api_world.h +++ b/lua/api_world.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/brand.cpp b/magic/brand.cpp index 2f371956..feccbaeb 100644 --- a/magic/brand.cpp +++ b/magic/brand.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/brand.h b/magic/brand.h index 43e4f939..47fb4907 100644 --- a/magic/brand.h +++ b/magic/brand.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/cskills.cpp b/magic/cskills.cpp index 14c214f0..45140186 100644 --- a/magic/cskills.cpp +++ b/magic/cskills.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/cskills.h b/magic/cskills.h index 6e435672..a8dee597 100644 --- a/magic/cskills.h +++ b/magic/cskills.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/effect.cpp b/magic/effect.cpp index a6ad2a7c..89b24dfb 100644 --- a/magic/effect.cpp +++ b/magic/effect.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/effect.h b/magic/effect.h index 3549e78c..dfc64a6c 100644 --- a/magic/effect.h +++ b/magic/effect.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/magic.cpp b/magic/magic.cpp index 85e72083..2222f480 100644 --- a/magic/magic.cpp +++ b/magic/magic.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/magic.h b/magic/magic.h index e018dbb0..eebc411c 100644 --- a/magic/magic.h +++ b/magic/magic.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/modifier.cpp b/magic/modifier.cpp index d9d3b0a6..6de2445d 100644 --- a/magic/modifier.cpp +++ b/magic/modifier.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/modifier.h b/magic/modifier.h index ad36dd89..824b25e1 100644 --- a/magic/modifier.h +++ b/magic/modifier.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/modifiers.cpp b/magic/modifiers.cpp index d12638f5..2329dee3 100644 --- a/magic/modifiers.cpp +++ b/magic/modifiers.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/modifiers.h b/magic/modifiers.h index db1f2cff..45a0f829 100644 --- a/magic/modifiers.h +++ b/magic/modifiers.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/resist.cpp b/magic/resist.cpp index ffccb07a..85034608 100644 --- a/magic/resist.cpp +++ b/magic/resist.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/resist.h b/magic/resist.h index a6b17396..d9340ddd 100644 --- a/magic/resist.h +++ b/magic/resist.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/skill.cpp b/magic/skill.cpp index 86ae4a7f..e992fc1f 100644 --- a/magic/skill.cpp +++ b/magic/skill.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/skill.h b/magic/skill.h index 188472c9..4e6a0d11 100644 --- a/magic/skill.h +++ b/magic/skill.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/skills.cpp b/magic/skills.cpp index 2b31ec48..15c943c6 100644 --- a/magic/skills.cpp +++ b/magic/skills.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/skills.h b/magic/skills.h index 97a5011b..cb309431 100644 --- a/magic/skills.h +++ b/magic/skills.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/stats.cpp b/magic/stats.cpp index 492862da..4f534007 100644 --- a/magic/stats.cpp +++ b/magic/stats.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/magic/stats.h b/magic/stats.h index 7b5ed067..ed8749cc 100644 --- a/magic/stats.h +++ b/magic/stats.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/cave_builder.cpp b/map/cave_builder.cpp index 850439d7..73604147 100644 --- a/map/cave_builder.cpp +++ b/map/cave_builder.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/cave_builder.h b/map/cave_builder.h index e9afb38c..2bce06d0 100644 --- a/map/cave_builder.h +++ b/map/cave_builder.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/chambers_builder.cpp b/map/chambers_builder.cpp index 381660bf..f376e7de 100644 --- a/map/chambers_builder.cpp +++ b/map/chambers_builder.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/chambers_builder.h b/map/chambers_builder.h index 0ce1d8fa..cbd96d42 100644 --- a/map/chambers_builder.h +++ b/map/chambers_builder.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/dungeon_builder.cpp b/map/dungeon_builder.cpp index 5afef4ba..e8329096 100644 --- a/map/dungeon_builder.cpp +++ b/map/dungeon_builder.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/dungeon_builder.h b/map/dungeon_builder.h index 932a77d2..6b3a5dd9 100644 --- a/map/dungeon_builder.h +++ b/map/dungeon_builder.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/fov.cpp b/map/fov.cpp index de070191..fce3bb8f 100644 --- a/map/fov.cpp +++ b/map/fov.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/fov.h b/map/fov.h index ad22349c..523d15db 100644 --- a/map/fov.h +++ b/map/fov.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/map.cpp b/map/map.cpp index 7e8cd5fb..4be08c9b 100644 --- a/map/map.cpp +++ b/map/map.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/map.h b/map/map.h index d7853d93..b9a890f6 100644 --- a/map/map.h +++ b/map/map.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/map_objects.cpp b/map/map_objects.cpp index 0e1cd35e..8e7cb2f4 100644 --- a/map/map_objects.cpp +++ b/map/map_objects.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/map_objects.h b/map/map_objects.h index 6b4f44f2..f900dbd1 100644 --- a/map/map_objects.h +++ b/map/map_objects.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/pattern.cpp b/map/pattern.cpp index 80694f72..43ed626a 100644 --- a/map/pattern.cpp +++ b/map/pattern.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/pattern.h b/map/pattern.h index d1bb5e71..5fccab64 100644 --- a/map/pattern.h +++ b/map/pattern.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/pattern_builder.cpp b/map/pattern_builder.cpp index f41e9178..1ea0d2fe 100644 --- a/map/pattern_builder.cpp +++ b/map/pattern_builder.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/pattern_builder.h b/map/pattern_builder.h index 5e4ab038..8bf4247c 100644 --- a/map/pattern_builder.h +++ b/map/pattern_builder.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/plain_builder.cpp b/map/plain_builder.cpp index ccbcc95a..cb4bb6eb 100644 --- a/map/plain_builder.cpp +++ b/map/plain_builder.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/plain_builder.h b/map/plain_builder.h index 5d1552f0..8e839292 100644 --- a/map/plain_builder.h +++ b/map/plain_builder.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/xanyplace.cpp b/map/xanyplace.cpp index 8324b88e..980e5012 100644 --- a/map/xanyplace.cpp +++ b/map/xanyplace.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/map/xanyplace.h b/map/xanyplace.h index 51883ae9..8395f1e2 100644 --- a/map/xanyplace.h +++ b/map/xanyplace.h @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/player/xhero_commands.cpp b/player/xhero_commands.cpp index a121256c..53c452a4 100644 --- a/player/xhero_commands.cpp +++ b/player/xhero_commands.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/player/xhero_game.cpp b/player/xhero_game.cpp index d1725b3c..294de9b8 100644 --- a/player/xhero_game.cpp +++ b/player/xhero_game.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/player/xhero_input.cpp b/player/xhero_input.cpp index 7ec40336..78f0aa18 100644 --- a/player/xhero_input.cpp +++ b/player/xhero_input.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -87,9 +88,8 @@ void XHero::NewMove() int ch; if (--isDisturb <= 0) { - vXGotoXY(x + SCR_X - l->map->wx, y + SCR_Y - l->map->wy); + vGotoXY(x + SCR_X - l->map->wx, y + SCR_Y - l->map->wy); ch = vGetch(); - vHideCursor(); } else { ch = last_char; } diff --git a/player/xhero_items.cpp b/player/xhero_items.cpp index 4580d54a..9ab346f3 100644 --- a/player/xhero_items.cpp +++ b/player/xhero_items.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/player/xhero_sheet.cpp b/player/xhero_sheet.cpp index 3336f80a..cb336864 100644 --- a/player/xhero_sheet.cpp +++ b/player/xhero_sheet.cpp @@ -1,7 +1,8 @@ /* This file is part of "Avanor, the Land of Mystery" roguelike game -Home page: http://www.avanor.com/ -Copyright (C) 2000-2003 Vadim Gaidukevich + +Copyright (C) 2000-2006 Vadim Gaidukevich +Copyright (C) 2025,2026 Joachim de Groot This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/resources/Info.plist b/resources/Info.plist new file mode 100644 index 00000000..f21cf80d --- /dev/null +++ b/resources/Info.plist @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + Avanor + + CFBundleExecutable + avanor-launcher + CFBundleIconFile + Avanor.icns + CFBundleIdentifier + com.avanor.avanor + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Avanor + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 0.0 + LSMinimumSystemVersion + 10.13 + NSHumanReadableCopyright + Copyright (C) 2000-2006 Vadim Gaidukevich, (C) 2025,2026 Joachim de Groot, GPLv2+ + + diff --git a/resources/avanor-256.png b/resources/avanor-256.png new file mode 100644 index 00000000..f2d0722c Binary files /dev/null and b/resources/avanor-256.png differ diff --git a/resources/avanor-launcher b/resources/avanor-launcher new file mode 100755 index 00000000..0aa30ee4 --- /dev/null +++ b/resources/avanor-launcher @@ -0,0 +1,18 @@ +#!/bin/sh +# +# What Finder runs when somebody opens Avanor.app. +# +# Avanor draws on a terminal, and an application launched from Finder does +# not have one - so rather than the game itself, the bundle's executable is +# this, which opens Terminal and starts the game there. The game finds its +# world and manual by looking beside itself and then in ../Resources, so it +# does not matter what directory Terminal happens to start in. +# +# The game binary keeps its own name beside this one, so what Terminal +# shows in its title bar is "avanor" rather than a launcher. + +set -eu + +here=$(cd "$(dirname "$0")" && pwd) + +exec /usr/bin/open -a Terminal "$here/avanor" diff --git a/resources/avanor.ico b/resources/avanor.ico new file mode 100644 index 00000000..502efedb Binary files /dev/null and b/resources/avanor.ico differ diff --git a/resources/avanor.iconset/icon_128x128.png b/resources/avanor.iconset/icon_128x128.png new file mode 100644 index 00000000..fb7d3137 Binary files /dev/null and b/resources/avanor.iconset/icon_128x128.png differ diff --git a/resources/avanor.iconset/icon_128x128@2x.png b/resources/avanor.iconset/icon_128x128@2x.png new file mode 100644 index 00000000..f2d0722c Binary files /dev/null and b/resources/avanor.iconset/icon_128x128@2x.png differ diff --git a/resources/avanor.iconset/icon_16x16.png b/resources/avanor.iconset/icon_16x16.png new file mode 100644 index 00000000..fb7929df Binary files /dev/null and b/resources/avanor.iconset/icon_16x16.png differ diff --git a/resources/avanor.iconset/icon_16x16@2x.png b/resources/avanor.iconset/icon_16x16@2x.png new file mode 100644 index 00000000..1172f5ac Binary files /dev/null and b/resources/avanor.iconset/icon_16x16@2x.png differ diff --git a/resources/avanor.iconset/icon_256x256.png b/resources/avanor.iconset/icon_256x256.png new file mode 100644 index 00000000..f2d0722c Binary files /dev/null and b/resources/avanor.iconset/icon_256x256.png differ diff --git a/resources/avanor.iconset/icon_256x256@2x.png b/resources/avanor.iconset/icon_256x256@2x.png new file mode 100644 index 00000000..d693fae2 Binary files /dev/null and b/resources/avanor.iconset/icon_256x256@2x.png differ diff --git a/resources/avanor.iconset/icon_32x32.png b/resources/avanor.iconset/icon_32x32.png new file mode 100644 index 00000000..1172f5ac Binary files /dev/null and b/resources/avanor.iconset/icon_32x32.png differ diff --git a/resources/avanor.iconset/icon_32x32@2x.png b/resources/avanor.iconset/icon_32x32@2x.png new file mode 100644 index 00000000..e652dbc7 Binary files /dev/null and b/resources/avanor.iconset/icon_32x32@2x.png differ diff --git a/resources/avanor.iconset/icon_512x512.png b/resources/avanor.iconset/icon_512x512.png new file mode 100644 index 00000000..d693fae2 Binary files /dev/null and b/resources/avanor.iconset/icon_512x512.png differ diff --git a/resources/avanor.iconset/icon_512x512@2x.png b/resources/avanor.iconset/icon_512x512@2x.png new file mode 100644 index 00000000..9f4560ae Binary files /dev/null and b/resources/avanor.iconset/icon_512x512@2x.png differ diff --git a/resources/avanor.rc b/resources/avanor.rc new file mode 100644 index 00000000..985f002b --- /dev/null +++ b/resources/avanor.rc @@ -0,0 +1,42 @@ +/* + * Windows resources compiled into avanor.exe by windres - the icon + * Explorer shows, and the version information the file's properties + * page reads. + * + * The numbers and the version string are not written here: the Makefile + * passes them in with -D, so this file never has to be edited when the + * version changes. See RESDEFINE there. + */ + +/* Id 1, so this is the icon Explorer picks for the executable. The file + * carries every size from 16 to 256 in one, and Windows chooses. + * + * It is the "A" of the title screen - see resources/make-icon.sh, which + * takes it straight out of Main.cpp's logo_text[] and can rebuild it. */ +1 ICON "avanor.ico" + +1 VERSIONINFO +FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + /* US English (0x0409), codepage 1252 */ + BLOCK "040904E4" + BEGIN + VALUE "CompanyName", "Joachim de Groot" + VALUE "FileDescription", "Avanor, the Land of Mystery" + VALUE "FileVersion", VINFO + VALUE "InternalName", "avanor" + VALUE "LegalCopyright", "(C) 2000-2006 Vadim Gaidukevich, (C) 2025,2026 Joachim de Groot, GPLv2+" + VALUE "OriginalFilename", "avanor.exe" + VALUE "ProductName", "Avanor" + VALUE "ProductVersion", VINFO + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END diff --git a/resources/make-icon.sh b/resources/make-icon.sh new file mode 100755 index 00000000..afe6b11d --- /dev/null +++ b/resources/make-icon.sh @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Regenerates the game's icons from its own title screen: avanor.ico for +# Windows, and avanor.iconset/ for macOS - which is a directory of PNGs at +# the sizes Apple asks for, turned into an .icns by iconutil during a mac +# build, because iconutil is the only thing that writes the format and it +# only exists there. +# +# The icon is the "A" of the logo in Main.cpp's logo_text[] - the first +# nine columns of its eight rows - drawn in xCYAN, the colour the title +# screen draws it in. Two renderings go into the one file: the large +# sizes keep the characters the logo is built from, and the small ones +# keep only the letterform, because at 16 pixels the characters are mud. +# +# Needs ImageMagick and icotool (icoutils). Run from the repository root. + +set -eu + +out=resources/avanor.ico +iconset=resources/avanor.iconset +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT + +font=$(fc-match -f '%{file}' "DejaVu Sans Mono:bold") +ink='#00A6A6' # xCYAN, as engine/global.h defines it +paper='#12161A' + +# The letter, taken from the logo rather than retyped. +sed -n '/^const char\* logo_text/,/MSG_WHITE/p' Main.cpp \ + | grep '^ "' | sed 's/^ "//; s/",\?$//' | cut -c1-9 > "$work/A.txt" + +# Large: the characters themselves, rows tightened so the letter is +# roughly square rather than terminal-shaped. +magick -background "$paper" -fill "$ink" -font "$font" -pointsize 256 \ + -interline-spacing -88 label:@"$work/A.txt" "$work/text.png" +magick "$work/text.png" -resize 928x928 -background "$paper" \ + -gravity center -extent 1024x1024 "$work/large.png" + +# Small: one filled block per character cell - the same shape, at a +# detail level a small icon can actually hold. +awk -v cell=24 '{ + for (x = 0; x < 9; x++) + if (substr($0, x + 1, 1) != " " && substr($0, x + 1, 1) != "") + printf "rectangle %d,%d %d,%d\n", x*cell, NR1*cell, (x+1)*cell-1, (NR1+1)*cell-1 +} { NR1++ }' "$work/A.txt" > "$work/block.mvg" + +magick -size 216x192 xc:"$paper" -fill "$ink" -draw "@$work/block.mvg" "$work/block.png" +magick "$work/block.png" -resize 928x928 -background "$paper" \ + -gravity center -extent 1024x1024 "$work/small.png" + +for s in 256 128 64 48; do magick "$work/large.png" -resize ${s}x${s} "$work/i-$s.png"; done +for s in 32 16; do magick "$work/small.png" -resize ${s}x${s} "$work/i-$s.png"; done + +icotool -c -o "$out" "$work"/i-256.png "$work"/i-128.png "$work"/i-64.png \ + "$work"/i-48.png "$work"/i-32.png "$work"/i-16.png + +cp "$work/i-256.png" resources/avanor-256.png + +# The macOS iconset. Apple names each file for the size it is drawn at +# and the scale it is drawn for, so 32x32 appears twice - once as itself +# and once as the retina half of 16x16. +rm -rf "$iconset" +mkdir -p "$iconset" + +for s in 512 1024; do magick "$work/large.png" -resize ${s}x${s} "$work/i-$s.png"; done + +cp "$work/i-16.png" "$iconset/icon_16x16.png" +cp "$work/i-32.png" "$iconset/icon_16x16@2x.png" +cp "$work/i-32.png" "$iconset/icon_32x32.png" +cp "$work/i-64.png" "$iconset/icon_32x32@2x.png" +cp "$work/i-128.png" "$iconset/icon_128x128.png" +cp "$work/i-256.png" "$iconset/icon_128x128@2x.png" +cp "$work/i-256.png" "$iconset/icon_256x256.png" +cp "$work/i-512.png" "$iconset/icon_256x256@2x.png" +cp "$work/i-512.png" "$iconset/icon_512x512.png" +cp "$work/i-1024.png" "$iconset/icon_512x512@2x.png" + +echo "wrote $out and $iconset" diff --git a/world/uniques/elder_gridor.lua b/world/uniques/elder_gridor.lua index 90bad6fc..4c8aa249 100644 --- a/world/uniques/elder_gridor.lua +++ b/world/uniques/elder_gridor.lua @@ -33,7 +33,7 @@ function ElderBanditQuest(p) if (bq >= XQuest.CLOSED) then AddMessage("'The road is open and the carts come through. Have a nice day,'") - if (Gender(p) == Gender.MALE) then + if (GetGender(p) == Gender.MALE) then AddMessage('sir!') else AddMessage("ma'am!") diff --git a/world/uniques/jorgus.lua b/world/uniques/jorgus.lua index 26c36291..e64258b0 100644 --- a/world/uniques/jorgus.lua +++ b/world/uniques/jorgus.lua @@ -27,7 +27,7 @@ end function JorgusHandler(e, t, p, v) if (e == LuaEvent.CHAT) then if (GetSkill(p, XSkill.STEALING) > 0) then - if (Gender(p) == Gender.MALE) then + if (GetGender(p) == Gender.MALE) then AddMessage("Good day, brother!") else AddMessage("Good day, sister!") @@ -37,7 +37,7 @@ function JorgusHandler(e, t, p, v) if (MoneyOperation(p, -1000) >= 0) then MoneyOperation(t, 1000) LearnSkill(p, XSkill.STEALING, 1) - if (Gender(p) == Gender.MALE) then + if (GetGender(p) == Gender.MALE) then AddMessage("You're welcome, brother!") else AddMessage("You're welcome, sister!")